window nacos集群搭建踩坑记
一,nacos所在的mysql数据库需要设置允许Nacos集群电脑的ip远程连接
grant all privileges on *.* to root@192.168.1.4 identified by 'root' with grant option;
flush privileges;
grant all privileges on *.* to root@192.168.1.6 identified by 'root' with grant option;
flush privileges;
二.修改startup.cmd 启动模式为集群启动,
set MODE="cluster"
修改config/cluster.conf
#2022-07-10T11:48:16.413
192.168.1.4:8848
192.168.1.4:8849
192.168.1.6:8850
修改各自机器nacos下的config/application.properties,比如
### Default web server port:
server.port=8849
### Specify local server's IP:
nacos.inetutils.ip-address=192.168.1.4
### If use MySQL as datasource:
spring.datasource.platform=mysql
### Count of DB:
db.num=1
### Connect URL of DB:
db.url.0=jdbc:mysql://192.168.1.6:3308/nacos?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC
db.user=root
db.password=root

浙公网安备 33010602011771号