本地操作系统:ubuntu18,我使用docker的方式启动nacos服务
docker image方式启动nacos
在docker hub上可以搜到nacos-server
List-1.1 拉去最新的版本
mjduan@mjduan-ubuntu:/opt/software$ docker pull nacos/nacos-server
Using default tag: latest
latest: Pulling from nacos/nacos-server
7dc0dca2b151: Pull complete
a46f26868cab: Pull complete
58b2bce5f680: Pull complete
506f1b119cf6: Pull complete
3da2026c16ad: Pull complete
22d13405f5c0: Pull complete
a5b6fe7ac72b: Pull complete
df8f86d655e4: Pull complete
Digest: sha256:59d40cfe7fd6c9db209faeff27352c7600b887755bcdafcea5e668b2335ec540
Status: Downloaded newer image for nacos/nacos-server:latest
List-1.2 映射出端口8848,指定mode为standalone,即单机模式
mjduan@mjduan-ubuntu:/opt/software$ docker run -i -p 8848:8848 -e MODE=standalone --name nacos nacos/nacos-server:latest
......
,--.
,--.'|
,--,: : | Nacos 0.9.0
,`--.'`| ' : ,---. Running in stand alone mode, All function modules
| : : | | ' ,'\ .--.--. Port: 8848
: | \ | : ,--.--. ,---. / / | / / ' Pid: 25
| : ' '; | / \ / \. ; ,. :| : /`./ Console: http://172.172.172.2:8848/nacos/index.html
' ' ;. ;.--. .-. | / / '' | |: :| : ;_
| | | \ | \__\/: . .. ' / ' | .; : \ \ `. https://nacos.io
' : | ; .' ," .--.; |' ; :__| : | `----. \
| | '`--' / / ,. |' | '.'|\ \ / / /`--' /
' : | ; : .' \ : : `----' '--'. /
; |.' | , .-./\ \ / `--'---'
'---' `--`---' `----'
......
之后在浏览器中输入http://localhost:8848/nacos,提示输入账号密码,nacos/nacos,就登录控制台界面了。
配置更新、服务发现
参考官网,因为要描述清楚还要很多文字描述,参考官网,官网描述详细。
Reference
- https://nacos.io/zh-cn/docs/quick-start-spring-boot.html