首页 > 其他 > 详细

Naocs单机及集群搭建

时间:2021-06-05 18:18:57      阅读:23      评论:0      收藏:0      [点我收藏+]

一、集群部署

  1. stack.yml配置文件

# Nacos服务注册与配置中心集群
    nacos-1:
        image: nacos/nacos-server
        deploy:
            mode: global
            placement:
                constraints: 
                    - node.labels.nacos-1 == true
            restart_policy:
                condition: on-failure
                delay: 5s
                max_attempts: 10
                window: 60s
        hostname: nacos-1
        networks:
            - rws-mp
        volumes:
            - /etc/localtime:/etc/localtime
            - nacos:/home/nacos/init.d
            - nacos-1-logs:/home/nacos/logs
        environment: 
            TZ: Asia/Shanghai
            PREFER_HOST_MODE: hostname
            NACOS_SERVERS: nacos-1:8848 nacos-2:8848 nacos-3:8848
            MYSQL_SERVICE_HOST: 10.10.10.41
            MYSQL_SERVICE_DB_NAME: rhxy-nacos
            MYSQL_SERVICE_PORT: 3300
            MYSQL_SERVICE_USER: root
            MYSQL_SERVICE_PASSWORD: 123456
    nacos-2:
        image: nacos/nacos-server
        deploy:
            mode: global
            placement:
                constraints: 
                    - node.labels.nacos-2 == true
            restart_policy:
                condition: on-failure
                delay: 5s
                max_attempts: 10
                window: 60s
        hostname: nacos-2
        networks:
            - rws-mp
        volumes:
            - /etc/localtime:/etc/localtime
            - nacos:/home/nacos/init.d
            - nacos-2-logs:/home/nacos/logs
        environment: 
            TZ: Asia/Shanghai
            PREFER_HOST_MODE: hostname
            NACOS_SERVERS: nacos-1:8848 acos-2:8848 nacos-3:8848
            MYSQL_SERVICE_HOST: 10.10.10.41
            MYSQL_SERVICE_DB_NAME: rhxy-nacos
            MYSQL_SERVICE_PORT: 3300
            MYSQL_SERVICE_USER: root
            MYSQL_SERVICE_PASSWORD: 123456
    nacos-3:
        image: nacos/nacos-server
        deploy:
            mode: global
            placement:
                constraints: 
                    - node.labels.nacos-3 == true
            restart_policy:
                condition: on-failure
                delay: 5s
                max_attempts: 10
                window: 60s
        hostname: nacos-3
        networks:
            - rws-mp
        volumes:
            - /etc/localtime:/etc/localtime
            - nacos:/home/nacos/init.d
            - nacos-3-logs:/home/nacos/logs
        environment: 
            TZ: Asia/Shanghai
            PREFER_HOST_MODE: hostname
            NACOS_SERVERS: nacos-1:8848 nacos-2:8848 nacos-3:8848
            MYSQL_SERVICE_HOST: 10.10.10.41
            MYSQL_SERVICE_DB_NAME: rhxy-nacos
            MYSQL_SERVICE_PORT: 3300
            MYSQL_SERVICE_USER: root
            MYSQL_SERVICE_PASSWORD: 123456

 

先记录搭建大概,后面详细补充

Naocs单机及集群搭建

原文:https://www.cnblogs.com/ruhuanxingyun/p/14852559.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!