感謝此兄: https://blog.51cto.com/huwei555/2341513?source=dra (centos7 安裝rabbitmq 3.7)
以root用戶登錄。 cd /home/soft
安裝依賴包
yum -y update yum install gcc gcc-c++ glibc-devel make ncurses-devel openssl-devel xmlto unixODBC-devel -y 安裝各種依賴 wget –no-cache http://www./repos/definitions/rhel/6.x/convirt.repo -O /etc/yum.repos.d/convirt.repo 設(shè)置socat依賴包 yum makecache yum install socat 安裝socat依賴
安裝erlang依賴 wget https://github.com/rabbitmq/erlang-rpm/releases/download/v20.3.8.17/erlang-20.3.8.17-1.el7.centos.x86_64.rpm 從github獲取最新版erlang,避免版本太小不支持rabbitmq rpm -ivh erlang-20.3.8.17-1.el7.centos.x86_64.rpm 安裝erlang,注意rabbitmq依賴erlang19.3以上版本 ./erl 然后輸入’halt().’退出即可。測試是否安裝成功。
驗(yàn)證安裝:
[root@localhost soft]# erl
Erlang/OTP 20 [erts-9.3.3.7] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:10] [hipe] [kernel-poll:false]
Eshell V9.3.3.7 (abort with ^G)
1> 7+10.
17
2> halt().
[root@localhost soft]# rpm -qa|grep erlang
erlang-20.3.8.17-1.el7.centos.x86_64
[root@localhost soft]#
安裝rabbitmq3.7.9
wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.7.9/rabbitmq-server-3.7.9-1.el7.noarch.rpm rpm -ivh rabbitmq-server-3.7.9-1.el7.noarch.rpm
systemctl status rabbitmq-server.service 查看狀態(tài)
systemctl start rabbitmq-server.service 啟動(dòng)
systemctl stop rabbitmq-server.service 停止
驗(yàn)證安裝:
[root@localhost soft]# rpm -qa|grep rabbitmq-server
rabbitmq-server-3.7.9-1.el7.noarch
配置網(wǎng)頁訪問RabbitMQ
rabbitmqctl add_user joyce joyce 添加新用戶名密碼
rabbitmqctl set_permissions -p "/" joyce '.*' '.*' '.*' 賦予用戶權(quán)限命令
Setting permissions for user "joyce" in vhost "/" ...
rabbitmqctl set_user_tags joyce administrator 賦予用戶角色命令
Setting tags for user "joyce" to [administrator] ...
rabbitmqctl list_users 查看RabbitMQ中用戶命令
Listing users ...
user tags
guest [administrator]
joyce [administrator]
rabbitmq-plugins enable rabbitmq_management 開啟rabbitmq管理控制臺(tái)命令
The following plugins have been configured:
rabbitmq_management
rabbitmq_management_agent
rabbitmq_web_dispatch
Applying plugin configuration to rabbit@localhost...
The following plugins have been enabled:
rabbitmq_management
rabbitmq_management_agent
rabbitmq_web_dispatch
started 3 plugins.
瀏覽器端訪問rabbitmq
http://IP:15672 輸入用戶名密碼: joyce joyce
centos7上rabbit常用命令
[root@localhost soft]# rabbitmqctl list_queues 查看queue隊(duì)列
Timeout: 60.0 seconds ...
Listing queues for vhost / ...
name messages
hello 0
[root@localhost soft]# rabbitmqctl list_queues name messages_ready messages_unacknowledged 查看未ack確認(rèn)的隊(duì)列和消息數(shù)
Timeout: 60.0 seconds ...
Listing queues for vhost / ...
name messages_ready messages_unacknowledged
model2-work-manual-ack 0 0
model2-work 0 0
hello 1 0
來源:oschina 鏈接:https://my.oschina.net/u/4387790/blog/3600254
|