centos7 部署 consul 集群服務(wù)

# 下載包
wget https://releases.hashicorp.com/consul/1.11.1/consul_1.11.1_linux_amd64.zip

# 安裝解壓庫 unzip
yum install -y unzip

# 解壓包到指定路徑: /usr/local
unzip consul_1.11.1_linux_amd64.zip -d /usr/local

# 添加軟連接
ln -s /usr/local/consul /usr/local/bin/consul

# 創(chuàng)建文件夾存放 log
mkdir /var/log/consul/

#啟動主節(jié)點(diǎn)帶ui (x.x.x.1為主節(jié)點(diǎn)機(jī)器, 另外兩個為從節(jié)點(diǎn)機(jī)器)
nohup consul agent -server -ui -bootstrap-expect=3 -data-dir=/hadoop/consul -node=server-1 -client=0.0.0.0 -bind=x.x.x.1 -datacenter=cn_dc1 >> /var/log/consul/consul.log &

#啟動從節(jié)點(diǎn) 注意 node bind datacenter 相關(guān)參數(shù)變更
nohup consul agent -server -ui -bootstrap-expect=3 -data-dir=/hadoop/consul -node=server-2 -client=0.0.0.0 -bind=x.x.x.2 -datacenter=cn_dc1 -join x.x.x.1 >> /var/log/consul/consul.log &

nohup consul agent -server -ui -bootstrap-expect=3 -data-dir=/hadoop/consul -node=server-3 -client=0.0.0.0 -bind=x.x.x.3 -datacenter=cn_dc1 -join x.x.x.1 >> /var/log/consul/consul.log &

# 查看輸出日志
tailf /var/log/consul/consul.log
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容