Nacos configuration cluster

1. Make three copies of nacos

modify port

server.port=8848

server.port=8849
server.port=8850

2. Cluster configuration

/conf/cluster.conf.example is modified to cluster.conf

127.0.0.1:8848
127.0.0.1:8849
127.0.0.1:8850

Every node must have

3. Start the client

startup.cmd -m cluster

 

 

4. Check the effect

 

Turn off the 8850 node and check the effect

added to the config file

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 # 支持动态刷新

 

In this way, the cluster achieves high availability 

Guess you like

Origin blog.csdn.net/qq2942713658/article/details/123298103