1. 3臺(tái)Centos 7的機(jī)器,hostname分別為A、B、C
創(chuàng)新互聯(lián)建站主打移動(dòng)網(wǎng)站、成都網(wǎng)站設(shè)計(jì)、成都網(wǎng)站制作、網(wǎng)站改版、網(wǎng)絡(luò)推廣、網(wǎng)站維護(hù)、域名注冊(cè)、等互聯(lián)網(wǎng)信息服務(wù),為各行業(yè)提供服務(wù)。在技術(shù)實(shí)力的保障下,我們?yōu)榭蛻?hù)承諾穩(wěn)定,放心的服務(wù),根據(jù)網(wǎng)站的內(nèi)容與功能再?zèng)Q定采用什么樣的設(shè)計(jì)。最后,要實(shí)現(xiàn)符合網(wǎng)站需求的內(nèi)容、功能與設(shè)計(jì),我們還會(huì)規(guī)劃穩(wěn)定安全的技術(shù)方案做保障。2. IP地址分別為:A - 172.20.0.2 ??B - 172.20.0.3 ?C - 172.20.0.4
3. 修改hosts?件如下:
vim?/etc/ho?RabbitMq集群安裝?sts172.20.0.2?A?172.20.0.3?B?172.20.0.4?C4. 保證所有節(jié)點(diǎn)互通
1.?????安裝依賴(lài)項(xiàng)
yum?install?-y?epel-release2.?????下載esl-erlang rpm包
wget?https://packages.erlangsolutions.com/erlang/rpm/centos/7/x86_64/esl-erlang_22.1.71~centos~7_amd64.rpm3.?????安裝esl-erlang
yum?install?esl-erlang_22.1.7-1_centos_7_amd64.rpm4.?????驗(yàn)證esl-erlang
erl?-version 出現(xiàn)“Erlang?(SMP,ASYNC_THREADS,HIPE)?(BEAM)?emulator?version?10.5.5”?證明安裝成功5.?????下載rabbitmq rpm包
wget?https://github.com/rabbitmq/rabbitmqserver/releases/download/v3.8.1/rabbitmq-server-3.8.11.el7.noarch.rpm6.?????安裝socat依賴(lài)
yum?install?socat7.?????安裝rabbitmq
rpm?-ivh?rabbitmq-server-3.8.1-1.el7.noarch.rpm1.?????激活插件
rabbitmq-plugins?enable rabbitmq_management rabbitmq-plugins?list1.?????開(kāi)機(jī)啟動(dòng):
chkconfig?rabbitmq-server?on2.?????查看啟動(dòng)狀態(tài):
rabbitmqctl?status3.?????啟動(dòng),關(guān)閉,重啟:
systemctl?enable?rabbitmq-server.service systemctl?start?rabbitmq-server.service? systemctl?stop?rabbitmq-server.service? systemctl?restart?rabbitmq-server.service4.?????rabbitmq啟動(dòng)
rabbitmqctl?start_app1. 修改.erlang.cookie
chmod?600?/var/lib/rabbitmq/.erlang.cookie vim?/var/lib/rabbitmq/.erlang.cookie `保持所有節(jié)點(diǎn)cookie?致`2. B節(jié)點(diǎn)執(zhí)?
rabbitmqctl?stop_app rabbitmqctl?join_cluster?--ram?rabbit@A rabbitmqctl?start_app3. C節(jié)點(diǎn)執(zhí)?
rabbitmqctl?stop_app? rabbitmqctl?join_cluster?--ram?rabbit@A? rabbitmqctl?start_app4. 查看集群狀態(tài)(A節(jié)點(diǎn))
# 查看集群狀態(tài)
rabbitmqctl?cluster_status5. 增加鏡像策略(A節(jié)點(diǎn))
rabbitmqctl?set_policy?ha-all?"^"?'{"ha-mode":"all"}'1. 添加rabbitmq?戶(hù)
rabbitmqctl?add_user?admin?123456 rabbitmqctl?set_user_tags?admin?administrator rabbitmqctl?set_permissions?-p?/?admin?".*"?".*"?".*"另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無(wú)理由+7*72小時(shí)售后在線(xiàn),公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性?xún)r(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專(zhuān)為企業(yè)上云打造定制,能夠滿(mǎn)足用戶(hù)豐富、多元化的應(yīng)用場(chǎng)景需求。