簡介
本文描述如何在連線到RabbitMQ使用者介面(UI)時解決問題。
必要條件
需求
本文件沒有特定需求。
採用元件
本檔案中的資訊是根據4.7.X和4.8.X。
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路正在作用,請確保您已瞭解任何指令可能造成的影響。
問題
當您嘗試通過瀏覽器連線到http://IP_address_of_AMQP:15672時,會收到「拒絕連線」錯誤。
在RabbitMQ控制檯上,您還將看到:
[root@amqp ~]# rabbitmqctl status
Status of node rabbit@amqp ...
Error: unable to connect to node rabbit@amqp: nodedown
DIAGNOSTICS
===========
attempted to contact: [rabbit@amqp]
rabbit@amqp:
* connected to epmd (port 4369) on amqp
* epmd reports: node 'rabbit' not running at all
no other nodes on amqp
* suggestion: start the node
current node details:
- node name: 'rabbitmq-cli-3496@amqp'
- home dir: /var/lib/rabbitmq
- cookie hash: gsXBP8HgENjwAKcRmvMU6A==
解決方案
1.重新配置虛擬機器(VM)的主機名。
- 使用新主機名更新/etc/hosts和/etc/hostname。
不要在新主機名中使用破折號。
2.重新安裝Rabbit:
rm /etc/cliqr_modules.conf
yum remove -y wxGTK-g1-2.8.12-20.e17.x86_64
chmod +x core+installer.bin
./core_installer.bin <os> <platform> rabbit
java -jar cco-installer.jar conn_broker-response.xml
3.在防火牆上開15672埠配置:
iptables -I INPUT 1 -p tcp --dport 15672 -j ACCEPT
service iptables save
service iptables restart
驗證
預期輸出為:
# netstat -atun | grep 15672
tcp 0 0 0.0.0.0:15672 0.0.0.0:* LISTEN
從另一台虛擬機器,使用此命令確認連線:
telent IP_address_of_AMQP 15672
# rabbitmqctl status
]Status of node rabbit@haamqp2 ...
[{pid,1759},
{running_applications,
[{rabbitmq_management,"RabbitMQ Management Console","3.5.1"},
{rabbitmq_web_dispatch,"RabbitMQ Web Dispatcher","3.5.1"},
{webmachine,"webmachine","1.10.3-rmq3.5.1-gite9359c7"},
{mochiweb,"MochiMedia Web Server","2.7.0-rmq3.5.1-git680dba8"},
{rabbitmq_management_agent,"RabbitMQ Management Agent","3.5.1"},
{rabbit,"RabbitMQ","3.5.1"},
{ssl,"Erlang/OTP SSL application","6.0"},
{public_key,"Public key infrastructure","0.23"},
{crypto,"CRYPTO","3.5"},
{asn1,"The Erlang ASN1 compiler version 3.0.4","3.0.4"},
{os_mon,"CPO CXC 138 46","2.3.1"},
{inets,"INETS CXC 138 49","5.10.6"},
{amqp_client,"RabbitMQ AMQP Client","3.5.1"},
{xmerl,"XML parser","1.3.7"},
{mnesia,"MNESIA CXC 138 12","4.12.5"},
{sasl,"SASL CXC 138 11","2.4.1"},
{stdlib,"ERTS CXC 138 10","2.4"},
{kernel,"ERTS CXC 138 10","3.2"}]},
{os,{unix,linux}},
{erlang_version,
"Erlang/OTP 17 [erts-6.4] [source-2e19e2f] [64-bit] [async-threads:30] [hipe] [kernel-poll:true]\n"},
{memory,
[{total,46019504},
{connection_readers,97704},
{connection_writers,19384},
{connection_channels,67928},
{connection_other,173656},
{queue_procs,165136},
{queue_slave_procs,0},
{plugins,501128},
{other_proc,13684160},
{mnesia,87752},
{mgmt_db,829016},
{msg_index,55056},
{other_ets,1144976},
{binary,1948544},
{code,22194354},
{atom,801697},
{other_system,4249013}]},
{alarms,[]},
{listeners,[{clustering,25672,"::"},{amqp,5672,"::"},{'amqp/ssl',5671,"::"}]},
{vm_memory_high_watermark,0.4},
{vm_memory_limit,771738828},
{disk_free_limit,50000000},
{disk_free,6418993152},
{file_descriptors,
[{total_limit,3996},
{total_used,10},
{sockets_limit,3594},
{sockets_used,6}]},
{processes,[{limit,1048576},{used,267}]},
{run_queue,0},
{uptime,1622687}]
現在,您應該能夠開啟http://IP_address_of_AMQP:15672的Web瀏覽器並啟動RabbitMQ GUI。預設登入方式為cliqr/cliqr。