zoukankan      html  css  js  c++  java
  • consul集群docker版本脚本


    https://blog.csdn.net/fenglailea/article/details/79098246

    docker run -d --name node1 -e 'CONSUL_LOCAL_CONFIG={"skip_leave_on_interrupt": true}' consul agent -server  -node=node1 -bootstrap-expect=2 &&
    docker run -d --name node2 -e 'CONSUL_LOCAL_CONFIG={"skip_leave_on_interrupt": true}' consul agent -server  -node=node2 -join $(docker inspect -f '{{.NetworkSettings.IPAddress}}' node1) &&
    docker run -d --name node3 -e 'CONSUL_LOCAL_CONFIG={"skip_leave_on_interrupt": true}' consul agent -server  -node=node3 -join $(docker inspect -f '{{.NetworkSettings.IPAddress}}' node1) &&
    date

    JOIN_IP="$(docker inspect -f '{{.NetworkSettings.IPAddress}}' node1)" &&
    docker run -d --name node4 -e 'CONSUL_LOCAL_CONFIG={"skip_leave_on_interrupt": true}' consul agent -node=node4 -join $JOIN_IP &&
    docker run -d --name node11 -p 8400:8400 -p 8500:8500 -p 8600:53/udp -e 'CONSUL_LOCAL_CONFIG={"skip_leave_on_interrupt": true}' consul agent -ui -node=node11 -client=0.0.0.0 -join $JOIN_IP &&
    date

    docker run -d --name node20 -e 'CONSUL_LOCAL_CONFIG={"skip_leave_on_interrupt": true}' consul agent -node=node20 &&

    docker exec node20 consul join $(docker inspect -f '{{.NetworkSettings.IPAddress}}' node1)

    {
       "ID": "userServiceId",
       "Name": "userService",
       "Tags": [             
         "primary",
         "v1"
       ],
       "Address": "127.0.0.1",
       "Port": 8000,         
       "EnableTagOverride": false,
       "Check": {           
         "DeregisterCriticalServiceAfter": "90m",
         "HTTP": "http://www.baidu.com",
         "Interval": "10s" 
       }
    }

  • 相关阅读:
    lua的数组下标是从1开始的
    DestroyImmediate的一些坑
    c#的IDisposable
    unity工具开发(转)
    winform控件命名规范对照表
    C#调用Exe程序示例
    System.Diagnostics.Process.Start的妙用
    C#中AppDomain.CurrentDomain.BaseDirectory及各种路径获取方法
    C# WindowsAPI
    TabPage判断重复添加Page
  • 原文地址:https://www.cnblogs.com/feinian/p/9903189.html
Copyright © 2011-2022 走看看