安裝單機版Consul

TIPS

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

下載Consul

百度盤加速器(Consul 1.5.3)spring

連接: 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

檢查端口是否被佔用的方法:ide

Windows:
# 若是沒有結果說明沒有被佔用
netstat -ano| findstr "8500"

Linux:
# 若是沒有結果說明沒有被佔用
netstat -antp |grep 8500

macOS:
# 若是沒有結果說明沒有被佔用
netstat -ant | grep 8500
或
lsof -i:8500

安裝 & 啓動

  • 解壓下載下來的壓縮包,將目錄切換到 consul 所在目錄
  • 執行以下命令便可:ui

    ./consul agent -dev -ui -client 0.0.0.0
  • 驗證是否成功code

    ./consul -v
  • 訪問Consul首頁 localhost:8500 ,可正常訪問頁面。

啓動參數

TIPS

目前暫時能夠不關注,在後面Consul高可用一節,會列出全部經常使用的Consul啓動參數。server

  • -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-...htm

相關文章
相關標籤/搜索