环境:MacOSX, consul_0.9.2官方镜像, docker
命令:docker run -p 8500:8500/tcp consul agent -server -ui -bootstrap-expect=1 -client=0.0.0.0
附非docker单节点(测试用,生产环境不推荐)启动命令:
- mac
consul agent -server -bootstrap-expect=1 -data-dir=/tmp/consul -node=server-110 -bind=192.168.21.110 -dc=zjgdc1 -client 0.0.0.0 -ui
- win
consul.exe agent -data-dir "d:\micorservice\consul-data" -bind "192.168.1.41" -client "0.0.0.0" -server -bootstrap-expect=1 -ui -node "consulNode1"
说明:-client 0 0 0 0 -ui–>使得客户端可以直接通过url访问服务端的consul ui
参考链接:
https://hub.docker.com/_/consul/
http://www.cnblogs.com/java-zhao/p/5527779.html