本文主要是介绍CentOS7安装RabbitMQ(鲲鹏服务器aarch64),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
一、安装背景
由于项目需要,准备安装RabiitMQ,项目使用的服务器为华为云鲲鹏服务器。通过centos安装RabiitMQ 3.5.8时,发现glibc版本不对,故卸载glibc重装,结果卸载后系统崩溃,无法恢复,造成重大损失。
所以安装各类组件时一定要优先选用鲲鹏本身支持的版本,并且erlang和RabbitMQ之间的版本对应关系要正确。
二、安装依赖环境Erlang
[root@les01 opt]# yum install erlang
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package erlang.aarch64 0:R16B-03.18.el7 will be installed
--> Processing Dependency: erlang-appmon(aarch-64) = R16B-03.18.el7 for package: erlang-R16B-03.18.el7.aarch64
--> Processing Dependency: erlang-asn1(aarch-64) = R16B-03.18.el7 for package: erlang-R16B-03.18.el7.aarch64
--> Processing Dependency: erlang-common_test(aarch-64) = R16B-03.18.el7 for package: erlang-R16B-03.18.el7.aarch64
..........................
..........................
Install 1 Package (+91 Dependent packages)
Total download size: 55 M
Installed size: 144 M
Is this ok [y/d/N]: y
Downloading packages:
(1/92): SDL-1.2.15-17.el7.aarch64.rpm
..........................
..........................
Complete!
三、安装RabbitMQ
3.1 检查系统Yum源
[root@les01 opt]# yum list rabbitmq-server
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Available Packages
rabbitmq-server.noarch 3.3.5-34.el7 epel
rabbitmq-server.aarch64 3.6.10-1.el7 kunpeng
3.2 安装RabbitMQ鲲鹏版本
[root@les01 opt]# yum install rabbitmq-server.aarch64
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
..........................
..........................
Total download size: 4.5 M
Installed size: 5.2 M
Is this ok [y/d/N]: y
..........................
..........................
Complete!
四、启动并配置RabbitMQ
4.1 启动RabbitMQ
[root@les01 opt]# sh /usr/bin/rabbitmq-server
RabbitMQ 3.6.10. Copyright (C) 2007-2017 Pivotal Software, Inc.
## ## Licensed under the MPL. See http://www.rabbitmq.com/
## ##
########## Logs: /usr/local/rabbitmq/var/log/rabbitmq/rabbit@les01.log
###### ## /usr/local/rabbitmq/var/log/rabbitmq/rabbit@les01.log
##########
Starting broker...
completed with 0 plugins.
4.2 查看端口信息
[root@les01 opt]# netstat -an|grep 5672
tcp 0 0 0.0.0.0:25672 0.0.0.0:* LISTEN
tcp6 0 0 :::5672 :::* LISTEN
4.3 查看状态
[root@les01opt]# rabbitmqctl status
Status of node 'les01'
[{pid,5858},
{running_applications,
[{rabbit,"RabbitMQ","3.6.10"},
..........................
..........................
4.4 新增用户
[root@les01 opt]# rabbitmqctl add_user admin xxxx
Creating user "admin"
[root@les01 opt]# rabbitmqctl list_users
Listing users
admin []
guest [administrator]
4.5 设置用户权限
[root@les01 opt]# rabbitmqctl set_user_tags admin administrator
Setting tags for user "admin" to [administrator]
[root@les01 opt]# rabbitmqctl set_permissions -p / admin ".*" ".*" ".*"
Setting permissions for user "admin" in vhost "/"
[root@les01 opt]# rabbitmqctl list_user_permissions admin
Listing permissions for user "admin"
/ .* .* .*
4.6 设置自动启动
[root@les01 opt]# rabbitmq-plugins enable rabbitmq_management
The following plugins have been enabled:
amqp_client
cowlib
cowboy
rabbitmq_web_dispatch
rabbitmq_management_agent
rabbitmq_management
Applying plugin configuration to rabbit@les01... started 6 plugins.
五、管理页面
http://xxx.xxx.xxx.xxx:15672/
输入用户名、密码即可。
这篇关于CentOS7安装RabbitMQ(鲲鹏服务器aarch64)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!