linux rabbitMQ安装

1.手动配置安装源:
vim /etc/yum.repos.d/rabbitmq-erlang.repo
配置erlang安装源
[rabbitmq-erlang]
name=rabbitmq-erlang
baseurl=https://dl.bintray.com/rabbitmq/rpm/erlang/19/el/6
gpgckeck=1
gpgkey=https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc
repo_gpgcheck=0
enabled=1

linux rabbitMQ安装_第1张图片
保存后执行命令:yum -y install erlang

2.获取rabbitmq包
wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.4.1/rabbitmq-server-3.4.1-1.noarch.rpm

.安装:
rpm -ivh rabbitmq-server-3.4.1-1.noarch.rpm

启动服务
 service rabbitmq-server start
 service rabbitmq-server stop
 service rabbitmq-server restart
3.开机自启 
 chkconfig rabbitmq-server on
 
4.复制mq配置文件
cp /usr/share/doc/rabbitmq-server-3.4.1/rabbitmq.config.example  /etc/rabbitmq/
 改名字:mv rabbitmq.config.example rabbitmq.config
 去掉rabbitmq.config 行的{loopback_user,[]},的注释 并去掉逗号{loopback_user,[]}

linux rabbitMQ安装_第2张图片
5.开启web界面管理工具,并重启rabbitMQ
  /etc/rabbitmq文件下启动后台管理页面命令:
  rabbitmq-plugins enable rabbitmq_management

并重启服务:service rabbitmq-server restart
6.修改防火墙配置文件,开发15672和5672端口
  15672:网页访问端口
  5672:java程序访问mq时用到的端口
  vim /etc/sysconfig/iptables
  -A INPUT -p tcp -m tcp --dport 15672 -j ACCEPT 
  -A INPUT -p tcp -m tcp --dport 5672 -j ACCEPT 
  重启iptalbes
  service iptables restart

centos防火墙关闭firewall:
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
firewall-cmd --state #查看默认防火墙状态(关闭后显示notrunning,开启后显示running)
7.访问
  http://127.0.0.1:15672

默认账号:guest 密码:guest

linux rabbitMQ安装_第3张图片

 

你可能感兴趣的:(web环境)