zoukankan      html  css  js  c++  java
  • 使用docker部署Consul集群

    echo -e "33[33m 是否启动consul33[0m"
    echo "y 是"
    echo "n 否"
    read start_con
    if [ $start_con == "y" ] 
    then
        JOIN_IP="$(docker inspect -f '{{.NetworkSettings.IPAddress}}' consul_server_1_master)";
        docker stop $(docker ps | grep consul | awk '{print $1}')
        docker rm $(docker ps -qf status=exited)
        docker run -d -p 8500:8500 --restart=always -v /data/consul/data/server1:/consul/data -v /data/consul/conf/server1:/consul/config -e CONSUL_BIND_INTERFACE='eth0' --privileged=true --name=consul_server_1_master consul:latest agent -server -bootstrap-expect=2 -ui -node=consul_server_1_master -client='0.0.0.0' -data-dir /consul/data -config-dir /consul/config -datacenter=dc1;
        docker run -d -p 8501:8500 --restart=always -v /data/consul/data/server2:/consul/data -v /data/consul/conf/server2:/consul/config -e CONSUL_BIND_INTERFACE='eth0' --privileged=true --name=consul_server_2 consul:latest agent -server -ui -node=consul_server_2 -client='0.0.0.0' -datacenter=dc1 -data-dir /consul/data -config-dir /consul/config -join=$JOIN_IP
        docker run -d -p 8502:8500 --restart=always -v /data/consul/data/server3:/consul/data -v /data/consul/conf/server3:/consul/config -e CONSUL_BIND_INTERFACE='eth0' --privileged=true --name=consul_server_3 consul:latest agent -server -ui -node=consul_server_3 -client='0.0.0.0' -datacenter=dc1 -data-dir /consul/data -config-dir /consul/config -join=$JOIN_IP
    fi
  • 相关阅读:
    启智树提高组Day4T3 2的幂拆分
    拉格朗日插值
    #3342. 「NOI2020」制作菜品
    P6776 [NOI2020]超现实树
    P6773 [NOI2020]命运
    P5298 [PKUWC2018]Minimax
    每日总结5.20
    每日总结5.19
    每日总结5.18
    每日总结5.17
  • 原文地址:https://www.cnblogs.com/dayang12525/p/13889429.html
Copyright © 2011-2022 走看看