TIPS
本文基於Consul 1.5.3,理論適用於Consul 1.6及更低版本。
下載Consul
百度盤加速器(Consul 1.5.3)
1 |
鏈接: https://pan.baidu.com/s/1Kyw5_duxW2TvEqb17YV9WQ |
需要的端口
Use | Default Ports |
---|---|
DNS: The DNS server (TCP and UDP) | 8600 |
HTTP: The HTTP API (TCP Only) | 8500 |
HTTPS: The HTTPs API | disabled (8501)* |
gRPC: The gRPC API | disabled (8502)* |
LAN Serf: The Serf LAN port (TCP and UDP) | 8301 |
Wan Serf: The Serf WAN port TCP and UDP) | 8302 |
server: Server RPC address (TCP Only) | 8300 |
Sidecar Proxy Min: Inclusive min port number to use for automatically assigned sidecar service registrations. | 21000 |
Sidecar Proxy Max: Inclusive max port number to use for automatically assigned sidecar service registrations. | 21255 |
檢查端口是否被占用的方法:
1 |
Windows: |
安裝 & 啟動
-
解壓下載下來的壓縮包,將目錄切換到
consul
所在目錄 -
執行如下命令即可:
1
./consul agent -dev -ui -client 0.0.0.0
-
驗證是否成功
1
./consul -v
-
訪問Consul首頁
localhost:8500
,可正常訪問頁面。
啟動參數
TIPS
目前暫時可以不關注,在后面Consul高可用一節,會列出所有常用的Consul啟動參數。
- -ui: 開啟ui頁面
- -client: 讓consul server擁有client的功能,允許接受服務注冊;0.0.0.0表示允許使用任意IP連接Consul,如果不指定,那么只能用loalhost去連接。
- -dev: 表示以開發模式運行Consul
在線Consul
- Consul官方提供:
https://demo.consul.io
- itmuch提供:
http://consul.itmuch.com:8500