1.拷贝三份nacos
修改端口
server.port=8848
server.port=8849
server.port=8850
2.集群配置
/conf/cluster.conf.example修改为cluster.conf
127.0.0.1:8848
127.0.0.1:8849
127.0.0.1:8850
每个节点都要有
3. 启动客户端
startup.cmd -m cluster
?
?
4.查看效果
?
关掉8850节点,查看效果
配置文件中增加
server-addr: 127.0.0.1:8848,127.0.0.1:8849,127.0.0.1:8850
server:
port: 56010
spring:
application:
name: service1
cloud:
nacos:
config:
server-addr: 127.0.0.1:8848,127.0.0.1:8849,127.0.0.1:8850
file-extension: yaml
namespace: 0c74cab7-f503-4fa8-af6d-25a5b65f598c
group: TEST_GROUP
ext-config[0]:
data-id: ext-config-db.properties
ext-config[1]:
data-id: ext-config-redis.properties
group: GLOBAL_GROUP
ext-config[2]:
data-id: ext-config-refresh.properties
group: REFRESH_GROUP
refresh: true # 支持动态刷新
?
这样就实现了集群实现了高可用?
|