安裝單機版Consul


TIPS

本文基於Consul 1.5.3,理論適用於Consul 1.6及更低版本。

下載Consul

百度盤加速器(Consul 1.5.3)

1
2
鏈接: https://pan.baidu.com/s/1Kyw5_duxW2TvEqb17YV9WQ 
提取碼: kfjt 復制這段內容后打開百度網盤手機App,操作更方便哦

需要的端口

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
2
3
4
5
6
7
8
9
10
11
12
13
Windows:
# 如果沒有結果說明沒有被占用
netstat -ano| findstr "8500"

Linux:
# 如果沒有結果說明沒有被占用
netstat -antp |grep 8500

macOS:
# 如果沒有結果說明沒有被占用
netstat -ant | grep 8500

lsof -i:8500

安裝 & 啟動

  • 解壓下載下來的壓縮包,將目錄切換到 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

參考文檔

本文首發

http://www.itmuch.com/spring-cloud/consul-single/


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM