centos 安裝 rabbitmq-server 筆記

環境:centos Linux service.linxk.lan 3.10.0-862.14.4.el7.x86_64

安裝包:

curl -s https://packagecloud.io/install/repositories/rabbitmq/erlang/script.rpm.sh | sudo bash
yum install erlang.x86_64

curl -s https://packagecloud.io/install/repositories/rabbitmq/rabbitmq-server/script.rpm.sh | sudo bash

yum install rabbitmq-server   (3.7.14版本)

啓動方法:

1, systemctl start rabbitmq-server

2,service rabbitmq-server start

3,  /usr/lib/rabbitmq/bin/rabbitmq-server start 

 

安裝好啓動之後發現 執行: rabbitmqctl-status 

報錯:

Status of node rabbit@service ...
Error: unable to perform an operation on node 'rabbit@service'. Please see diagnostics information and suggestions below.

Most common reasons for this are:

 * Target node is unreachable (e.g. due to hostname resolution, TCP connection or firewall issues)
 * CLI tool fails to authenticate with the server (e.g. due to CLI tool's Erlang cookie not matching that of the server)
 * Target node is not running

In addition to the diagnostics info below:

 * See the CLI, clustering and networking guides on https://rabbitmq.com/documentation.html to learn more
 * Consult server logs on node rabbit@service
 * If target node is configured to use long node names, don't forget to use --longnames with CLI tools

DIAGNOSTICS
===========

attempted to contact: [rabbit@service]

rabbit@service:
  * connected to epmd (port 4369) on service
  * epmd reports node 'rabbit' uses port 25672 for inter-node and CLI tool traffic 
  * can't establish TCP connection to the target node, reason: timeout (timed out)
  * suggestion: check if host 'service' resolves, is reachable and ports 25672, 4369 are not blocked by firewall

Current node details:
 * node name: 'rabbitmqcli-3378-rabbit@service'
 * effective user's home directory: /var/lib/rabbitmq
 * Erlang cookie hash: 6y0V31QE7e3kp972ErQd/w==

 

Error: unable to perform an operation on node 'rabbit@service'. Please see diagnostics information and suggestions below. 

沒有rabbit@service節點, server就是本機的hostname

解決方法:

在/etc/hosts 中 添加

127.0.0.1 server

在次執行  rabbitmqctl-status 

正常顯示

Status of node rabbit@service ...
[{pid,1034},
 {running_applications,
     [{rabbitmq_management,"RabbitMQ Management Console","3.7.14"},
      {rabbitmq_web_dispatch,"RabbitMQ Web Dispatcher","3.7.14"},
      {rabbitmq_management_agent,"RabbitMQ Management Agent","3.7.14"},
      {rabbit,"RabbitMQ","3.7.14"},
      {sysmon_handler,"Rate-limiting system_monitor event handler","1.1.0"},
      {os_mon,"CPO  CXC 138 46","2.4.7"},

 .....

 

開啓web管理命令:rabbitmq-plugins enable rabbitmq_management

執行此命令後, 需重啓rabbitmq-server

 

服務系統有個默認的guest賬號, 但是只能在本機訪問,因此最好在命令好增加一個賬號

rabbitmqctl add_user username userpasswd     # 添加賬號密碼

rabbitmqctl set_user_tags  username administrator  #把賬號加入到高級管理

 

到此就可以用創建的賬號密碼登錄rabbitmq web了!

 

web 端的配置, 可查看此鏈接:

https://www.jianshu.com/p/7b6e575fd451

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章