Centos7.4安装RabbitMQ

1.1 安装RabbitMQ

1.1.1 系统环境

[root@rabbitmq ~]# cat /etc/redhat-release 
CentOS Linux release 7.4.1708 (Core) 
[root@rabbitmq ~]# uname -r
3.10.0-693.2.2.el7.x86_64
[root@rabbitmq ~]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:firewalld(1)
[root@rabbitmq ~]# getenforce
Disabled

1.2.1 安装socat

$ yum -y install socat

1.2.2 安装erlang

$ wget http://www.rabbitmq.com/releases/erlang/erlang-19.0.4-1.el7.centos.x86_64.rpm
$ rpm-ivh erlang-19.0.4-1.el7.centos.x86_64.rpm

安装完成后执行erl命令,出现下图则代表成功

1.2.3 安装rabbitmq

$ wget  http://www.rabbitmq.com/releases/rabbitmq-server/v3.6.10/rabbitmq-server-3.6.10-1.el7.noarch.rpm
$ rpm -ivhrabbitmq-server-3.6.10-1.el7.noarch.rpm

1.2.4 启动rabbitmq

$ systemctl start rabbitmq-server
或者使用:
$ rabbitmq-server -detached           //启动rabbitmq,-detached代表后台守护进程方式启动

1.2.5 配置网页插件

配置完成之后才可以网页访问
首先创建目录,否则可能报错:

$ mkdir /etc/rabbitmq

然后启用插件

$ rabbitmq-plugins enable rabbitmq_management

创建用户

$ rabbitmqctl add_user admin admin    # 创建用户admin,密码也是admin
$ rabbitmqctl list_users		# 查看用户列表
$ rabbitmqctl set_user_tags admin administrator		# 设置admin用户为administrator角色
$ rabbitmqctl set_permissions -p / admin ".*" ".*" ".*"		# 设置admin用户权限
$ rabbitmqctl list_user_permissions admin	# 查看admin用户权限

浏览器访问:IP地址:15672

参考文章:https://www.ihaiyun.cc/2018/10/14/RabbitMQ-Deploy/

posted @ 2018-12-26 16:42  Belief°  阅读(695)  评论(0编辑  收藏  举报