CentOS 6.9 上安装RabbitMQ 3.7.7

同系列文章链接

  1. CentOS 6.9 上安装JDK 8
  2. CentOS 6.9 上安装Tomcat 8
  3. CentOS 6.9 上安装Nginx 1.12.2
  4. CentOS 6.9 上安装Redis 4.0.8
  5. CentOS 6.9 上安装Mysql 5.6.39
  6. CentOS 6.9 上安装vsftpd-2.2.2
  7. CentOS 6.9 上安装RabbitMQ 3.7.7
  8. CentOS 6.9 上安装activemq-5.15.4
  9. CentOS 6.9 上安装zookeeper-3.4.12

1、安装依赖

# erlang 
# https://dl.bintray.com/rabbitmq/rpm/erlang/21/el/7/x86_64/erlang-21.0.2-1.el7.centos.x86_64.rpm
wget https://dl.bintray.com/rabbitmq/rpm/erlang/21/el/6/x86_64/erlang-21.0.2-1.el6.x86_64.rpm
rpm -ivh erlang-21.0.2-1.el6.x86_64.rpm

# socat 
# 方式1
#http://www.rpmfind.net/linux/sourceforge/r/ro/roblinux-ext/repository/centos6/roblinux/10pe/x86_64/Packages/socat-1.7.3.0-1.x86_64.rpm
#https://forensics.cert.org/centos/cert/7/x86_64//socat-1.7.3.2-1.1.el7.x86_64.rpm
wget https://forensics.cert.org/centos/cert/6/x86_64//socat-1.7.3.2-1.1.el6.x86_64.rpm
rpm -ivh socat-1.7.3.2-1.1.el6.x86_64.rpm

# 方式2
# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo

yum -y install socat

2、安装 rabbitmq

# https://dl.bintray.com/rabbitmq/all/rabbitmq-server/3.7.7/rabbitmq-server-3.7.7-1.el7.noarch.rpm
wget https://dl.bintray.com/rabbitmq/all/rabbitmq-server/3.7.7/rabbitmq-server-3.7.7-1.el6.noarch.rpm
rpm -ivh rabbitmq-server-3.7.7-1.el6.noarch.rpm

3、启动rabbitmq

# 启动
service rabbitmq-server start
# 停止
service rabbitmq-server stop
# 重启
service rabbitmq-server restart
# 开机自启
chkconfig rabbitmq-server on


# 启用监控插件
rabbitmq-plugins enable rabbitmq_management

# 修改防火墙
vim /etc/sysconfig/iptables

# 开放端口15672 和 5672
-A INPUT -m state --state NEW -m tcp -p tcp --dport 15672 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 5672 -j ACCEPT

# 重启防火墙
service iptables restart

4、添加用户

# 添加用户admin,密码为123456
rabbitmqctl add_user admin 123456
# 给用户添加管理员角色
rabbitmqctl set_user_tags admin administrator
# 查看所有用户
rabbitmqctl list_users
# 查看admin所有权限
rabbitmqctl list_user_permissions admin
# 清除admin权限[指定权限]
rabbitmqctl clear_permissions [-p VHostPath] admin
# 查看所有权限[-p test_vhosts] 或指定权限
rabbitmqctl list_permissions [-p  VHostPath]
# 设置admin在VHostPath下的权限
rabbitmqctl set_permissions -p VHostPath admin ConfP WriteP ReadP


# 删除admin用户
rabbitmqctl delete_user admin
# 修改admin的密码为123456
rabbitmqctl change_password admin 123456

# 启用监控插件
rabbitmq-plugins enable rabbitmq_management
# 关闭监控插件
rabbitmq-plugins disable rabbitmq_management

5、访问监控管理后台地址

http://192.168.1.108:15672

你可能感兴趣的:(Linux)