修改rabbitmq Web UI 監控頁面的端口


在前幾天工作中遇到一個問題,部署服務器,需要用rabbitmq自帶的一個web UI監控組件,但是15672的端口沒有對外映射。嘗試了幾種辦法。開始修改rabbitmq.config,rabbitmq-ebv.config,總是不成功,因為修改的是rabbitmq-server的啟動端口號,從外面訪問的是web UI組件啟動的端口號,兩個是不一樣的。然后嘗試的rabbitmqadmin,因為web UI 監控頁面也是調用的httpapi ,rabbitmqadmin是從官網下載一個文本文件賦予可執行權限才可,注意你放置這個文件的位置要在你的PATH里面。百度了半天都沒,然后去了 
http://stackoverflow.com/questions/28461823/rabbitmq-management-console-on-cloud9/28472142#28472142 
這個上面查答案,平時沒VPN也就很少用了。還是這個比較溜,幾分鍾就找到了。

原文:

I’m new to RabbitMQ, but after a bit of googling and experimentation, 
I was able to run the management console.

The problem is that only port 8080 is forwarded from your Cloud9 
workspace, and RabbitMQ’s default port is explained here:

The web UI is located at: http://server-name:15672/ To fix, we need to 
modify the configuration to start the web UI at port 8080. Here are 
the steps I followed to get that working:

Install RabbitMQ (Steps outlined here: 
http://www.rabbitmq.com/install-debian.html) Enable the management 
console: sudo rabbitmq-plugins enable rabbitmq_management There wasn’t 
a rabbitmq.config file for me in RABBITMQHOME/etc/rabbitmq/,soIcopiedtheexamplefrom/usr/share/doc/rabbitmqserver/(afterunzippingit).EditedRABBITMQ_HOME/etc/rabbitmq/rabbitmq.config and 
found the rabbitmq_management key. There’s already an existing setup 
that’s commented out. I replaced it with:

{listener, [{port, 8080}, 
{ip, “0.0.0.0”}, 
{ssl, false}]}

Then I restarted the RabbitMQ server and visiting my url, i.e.: 
https://-.c9.io showed me the RabbitMQ 
management login screen.

Hope this helps!

其實感覺他的這個配置文件的格式 有點奇怪 不像json卻又像json。

 

[root@localhost ~]# ls
anaconda-ks.cfg               post-install
Desktop                      post-install.log
Documents                    Public
Downloads                    rabbitmq-server-3.5.6-1.noarch.rpm
erlang-17.4-1.el6.x86_64.rpm  Templates
Music                        Videos
Pictures
[root@localhost ~]# cd /usr/share/doc/rabbitmq-server-3.5.6/
[root@localhost rabbitmq-server-3.5.6]# ls
LICENSE                         LICENSE-BSD-glMatrix   LICENSE-MIT-Mochi
LICENSE-APACHE2-ExplorerCanvas  LICENSE-MIT-EJS10      LICENSE-MIT-Sammy060
LICENSE-Apache-Basho            LICENSE-MIT-eldap      LICENSE-MPL-RabbitMQ
LICENSE-APL2-Stomp-Websocket    LICENSE-MIT-Flot       rabbitmq.config.example
LICENSE-BSD-base64js            LICENSE-MIT-jQuery164  README
[root@localhost rabbitmq-server-3.5.6]#  cp /usr/share/doc/rabbitmq-server-3.5.6/rabbitmq.config.example /etc/rabbitmq/
[root@localhost rabbitmq]# cd /etc/rabbitmq/
[root@localhost rabbitmq]# mv rabbitmq.config.example rabbitmq.config
[root@localhost rabbitmq]# vim rabbitmq.config

 

{rabbitmq_management,
  [
{listener, [{port,     8080},
             {ip,       "0.0.0.0"},
             {ssl,     false}
]},

粘進去時候注意括號啥的,如果啟動不起來 看日志 添加或者減少括號即可。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM