環境:MacOSX, consul_0.9.2官方鏡像, docker
命令:docker run -p 8500:8500/tcp consul agent -server -ui -bootstrap-expect=1 -client=0.0.0.0
html
附非docker單節點(測試用,生產環境不推薦)啓動命令:java
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
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 uinode
參考連接:
https://hub.docker.com/_/consul/
http://www.cnblogs.com/java-zhao/p/5527779.htmldocker