Rabbit安裝配置問題

1. 權(quán)限問題

Caused by: com.rabbitmq.client.ShutdownSignalException: connection error; protocol method: #method<connection.close>(reply-code=530, reply-text=NOT_ALLOWED - access to vhost '/' refused for user 'guest', class-id=10, method-id=40)
    at com.rabbitmq.utility.ValueOrException.getValue(ValueOrException.java:66) ~[amqp-client-4.0.2.jar:4.0.2
]
    at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java:32) ~[amqp-client-4.0.2.jar:4.0.2]
    at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(AMQChannel.java:366) ~[amqp-client-4.0.2.jar:4.0.2]
    at com.rabbitmq.client.impl.AMQChannel.privateRpc(AMQChannel.java:229) ~[amqp-client-4.0.2.jar:4.0.2]
    at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:117) ~[amqp-client-4.0.2.jar:4.0.2]
    ... 13 common frames omitted

這種問題用戶沒有權(quán)限需要 添加權(quán)限
添加權(quán)限有兩種

  1. 在dos命令中設(shè)置

rabbitmqctl set_permissions -p / guest '.* ' ' .* ' '.*'

顯示Setting permissions for user "guest" in vhost "/" 表明設(shè)置權(quán)限成功

2.在后臺(tái)控制臺(tái)輸入
輸入前需要添加rabbit的插件
后臺(tái)管理開啟方法

rabbitmq-plugins enable rabbitmq_management
重啟rabbitmq服務(wù)生效
打開http://localhost:15672/即可看到管理后臺(tái)
用戶名密碼均為guest
輸入http://127.0.0.1:15672進(jìn)入后臺(tái)

image.png

找到你自己的用戶
點(diǎn)擊名字

image.png
image.png

輸入框中內(nèi)容如圖所示即可。

ShutdownSignalException: channel error; protocol method: #method<channel.close>(reply-code=406, reply-text=PRECONDITION_FAILED - inequivalent arg 'durable' for queue 'order-delay-queue' in vhost '/': received 'false' but current is 'true', class-id=50, method-id=10)

表示你order-delay-queue隊(duì)列,已經(jīng)創(chuàng)建運(yùn)行,但是你告訴rabbit的是它沒有創(chuàng)建。原因在于‘

image.png

需要將此隊(duì)列刪除并且對(duì)應(yīng)代碼為


代碼rabbit官方文檔中有

2.延時(shí)隊(duì)列報(bào)錯(cuò)

ShutdownSignalException: connection error; protocol method: #method<connection.close>(reply-code=503, reply-text=COMMAND_INVALID - unknown exchange type 'x-delayed-message', class-id=40, method-id=10)

代表沒有找到對(duì)應(yīng)x-delayed-message的exchange type
rabbit官方github地址

image.png

說明你要是用延時(shí)隊(duì)列需要啟用插件
首先在dos命令中輸入文檔中的命令顯示error(錯(cuò)誤信息為沒有發(fā)現(xiàn)對(duì)應(yīng)插件)則需要到rabbit官網(wǎng)下載插件
插件地址
找到這個(gè)插件

插件地址

下載下來冰晶插件復(fù)制到rabbit-service的插件目錄(自己的安裝目錄)中

image.png

并且在dos命令中再次運(yùn)行

rabbitmq-plugins enable rabbitmq_delayed_message_exchange

就可以了

3. error: unable to connect to node rabbit@: nodedown

rabbitmq版本過低問題

當(dāng)前有些阿里云服務(wù)器阿里源對(duì)應(yīng)的rabbit的版本為3.5.X版本,但現(xiàn)在官網(wǎng)延遲插件對(duì)應(yīng)的最低版本為3.6.X
解決方案:

  1. 手動(dòng)安裝最新版(如果不想手動(dòng)則使用第二種)
  1. 添加源 echo 'deb http://www.rabbitmq.com/debian/ testing main' | tee /etc/apt/sources.list.d/rabbitmq.list 然后執(zhí)行 apt-get update 會(huì)安裝3.6.15的版本

4. # epmd reports: node 'rabbit' not running at all?

remove /var/log/rabbitmq/* and start it back

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

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

  • Spring Cloud為開發(fā)人員提供了快速構(gòu)建分布式系統(tǒng)中一些常見模式的工具(例如配置管理,服務(wù)發(fā)現(xiàn),斷路器,智...
    卡卡羅2017閱讀 136,554評(píng)論 19 139
  • 整體架構(gòu) 部署步驟 基于 Docker 基本概念內(nèi)存節(jié)點(diǎn)只保存狀態(tài)到內(nèi)存,例外情況是:持久的 queue 的內(nèi)容將...
    mvictor閱讀 12,904評(píng)論 5 30
  • rabbitmq有3種模式,集群模式2種? 單機(jī)模式:即單機(jī)情況不做集群,就單獨(dú)運(yùn)行一個(gè)rabbitmq而已。...
    嗷大彬彬閱讀 4,225評(píng)論 1 9
  • 來源 RabbitMQ是用Erlang實(shí)現(xiàn)的一個(gè)高并發(fā)高可靠AMQP消息隊(duì)列服務(wù)器。支持消息的持久化、事務(wù)、擁塞控...
    jiangmo閱讀 10,513評(píng)論 2 34
  • 關(guān)于消息隊(duì)列,從前年開始斷斷續(xù)續(xù)看了些資料,想寫很久了,但一直沒騰出空,近來分別碰到幾個(gè)朋友聊這塊的技術(shù)選型,是時(shí)...
    預(yù)流閱讀 586,616評(píng)論 51 787

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