首页 > 代码库 > Consul 启动命令

Consul 启动命令

  • 服务端:
    nohup consul agent -server -bootstrap-expect 1 -config-dir /etc/consul.d/ -data-dir /var/opt/consul -bind=121.42.204.73 >> /var/opt/consul/consul.log 2>&1 

    注册服务:

    curl -X PUT -d ‘{"type":"locationService","outPort":8081,"outPath":"/websocket", "forwardAddress":"121.42.204.73", "forwardPort":"8081"}‘ http://localhost:8500/v1/kv/websocket/my

    webui添加:http://localhost:8500/ui

    -client 0.0.0.0 -ui
  • 客户端:
    nohup consul agent -config-dir /etc/consul.d/ -data-dir /var/opt/consul -bind=121.42.204.73 -join=121.42.204.73 >consul.log 2>&1 &

     

Consul 启动命令