使用mysql数据库
环境
jdk 1.8
maven3
源码下载地址 https://gitee.com/mirrors/Nacos
打包
mvn -Prelease-nacos clean install -U
打包完后图示
单机启动方式
sh startup.sh -m standalone
启动命令
sh startup.sh
启动成功日志如下
,—.
,—.’|
,—,: : | Nacos 1.0.0-RC3
,--.'
| ‘ : ,—-. Running in cluster mode, All function modules
| : : | | ‘ ,’\ .—.—. Port: 8848
: | \ | : ,—.—. ,—-. / / | / / ‘ Pid: 8782
| : ‘ ‘; | / \ / . ; ,. :| : /./ Console: http://192.168.18.199:8848/nacos/index.html<br />' ' ;. ;.--. .-. | / / '' | |: :| : ;_<br />| | | \ | \__\/: . .. ' / ' | .; : \ \
. https://nacos.io
‘ : | ; .’ ,” .—.; |’ ; :__| : | ----. \<br />| | '
—‘ / / ,. |’ | ‘.’|\ \ / / /--' /<br />' : | ; : .' \ : :
——‘ ‘—‘. /
; |.’ | , .-./\ \ / --'---'<br />'---'
—---'
——‘
2019-04-09 11:08:39,948 INFO The server IP list of Nacos is [192.168.18.199, 192.168.18.200, 192.168.0.156]
2019-04-09 11:08:40,960 INFO Nacos is starting…
2019-04-09 11:08:41,960 INFO Nacos is starting…
2019-04-09 11:08:42,968 INFO Nacos is starting…
2019-04-09 11:08:43,969 INFO Nacos is starting…
2019-04-09 11:08:44,973 INFO Nacos is starting…
2019-04-09 11:08:45,975 INFO Nacos is starting…
2019-04-09 11:08:46,976 INFO Nacos is starting…
2019-04-09 11:08:47,977 INFO Nacos is starting…
2019-04-09 11:08:48,977 INFO Nacos is starting…
2019-04-09 11:08:49,979 INFO Nacos is starting…
2019-04-09 11:08:50,985 INFO Nacos is starting…
2019-04-09 11:08:51,988 INFO Nacos is starting…
2019-04-09 11:08:52,989 INFO Nacos is starting…
2019-04-09 11:08:53,012 INFO Nacos Log files: /root/alibaba-cloud/nacos/logs/
2019-04-09 11:08:53,012 INFO Nacos Conf files: /root/alibaba-cloud/nacos/conf/
2019-04-09 11:08:53,012 INFO Nacos Data files: /root/alibaba-cloud/nacos/data/
2019-04-09 11:08:53,012 INFO Nacos started successfully in cluster mode.
访问
http://ip:8848/nacos/index.html
登录账号密码
nacos nacos
集群
使用mysql数据库
1 application.properties
db.num=2
db.url.0=jdbc:mysql://11.162.196.16:3306/nacos_devtest?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true
db.url.1=jdbc:mysql://11.163.152.9:3306/nacos_devtest?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true
db.user=nacos_devtest
db.password=nacos
2 cluster.conf.example 文件重命名为cluster.conf
3 删除文件中的注释
4 ip 为集群中其他节点的ip ,注意必须包含所有其他节点的ip和端口
10.10.109.214:8848
11.16.128.34:8848
11.16.128.36:8848