1.安装rabbitmq所需要的依赖包
yum install build-essential openssl openssl-devel unixODBC unixODBC-devel make gcc gcc-
c++ kernel-devel m4 ncurses-devel tk tc xz
2.安装环境
wget http://www.rabbitmq.com/releases/erlang/erlang-19.0.4-1.el7.centos.x86_64.rpm
yum -y install socat
wget https://www.rabbitmq.com/releases/rabbitmq-server/current/rabbitmq-server-3.6.15-1.el6.noarch.rpm
rpm -ivh erlang-19.0.4-1.el7.centos.x86_64.rpm
rpm -ivh rabbitmq-server-3.6.15-1.el6.noarch.rpm
2.修改配置
vim /usr/lib/rabbitmq/lib/rabbitmq_server-3.6.5/ebin/rabbit.app
loopback_users 中的 <<"guest">>,改为guest
vi /etc/rabbitmq/rabbitmq-env.conf
如果没有配置文件就手动新增及以下内容
NODE_IP_ADDRESS=0.0.0.0
NODENAME=rabbit
#[{rabbit, [{loopback_users, []}]}].
#loopback_users = none
#{rabbit, [{tcp_listeners, [5672]}, {loopback_users, ["mj"]}]}
3.
rabbitmq-server start &
lsof -i:5672
rabbitmq-plugins enable rabbitmq_management
linux设置shell和图形
shell:systemctl set-default multi-user.target
图形: systemctl set-default graphical.target
rabbitmq停止重启
cd /usr/lib/rabbitmq/lib/rabbitmq_server-3.6.15/sbin
# 需要开起来
service rabbitmq-serverstart
# 停止rabbitmq
service rabbitmq-serverstop
# 查看rabbitmq的状态
service rabbitmq-serverstatus
如果用的新买的阿里云服务器。。。!!!最坑的一定要打开防火墙端口
阿里云防火墙端口设置:https://yq.aliyun.com/articles/684782