centos7下rabbitmq安装过程
1.erlang 下载
wget https://packages.erlang-solutions.com/erlang/rpm/centos/7/x86_64/esl-erlang_21.3.8.17-1~centos~7_amd64.rpm
2.rabbitmq下载
wget https://mirrors.huaweicloud.com/rabbitmq-server/v3.7.10/rabbitmq-server-3.7.10-1.el6.noarch.rpm
3.安装
rpm -ivh --nodeps esl-erlang_21.3.8.17-1~centos~7_amd64.rpm
rpm -ivh --nodeps rabbitmq-server-3.7.10-1.el6.noarch.rpm
4.启用插件
rabbitmq-plugins enable rabbitmq_management
5启动 但报错
# rabbitmq-server
ERROR: epmd error for host 192: badarg (unknown POSIX error)
vi /etc/rabbitmq/rabbitmq-env.conf
添加一行 NODENAME=rabbit@localhost 保存再启动rabbitmq-server ,
在操作单台时没问题,当配置集群时,导致集群连不上,可以 vi /etc/hostname 修改主机名
6 开放端口,通过localhost:15672访问管理界面了,默认用户密码 guest/guest
firewall-cmd --add-port=15672/tcp --permanent
firewall-cmd --add-port=5672/tcp --permanent
用ip登录时出现"User can only log in via localhost"时,解决如下
vi /usr/lib/rabbitmq/lib/rabbitmq_server-3.7.10/ebin/rabbit.app
将:{loopback_users, [<<”guest”>>]}, 改为:{loopback_users, []},
保存
默认guest权限大,开启远程ip访问后,不安全,仅测试用.
重新启动mq就可ip登录了.( rabbitmqctl start_app) (确保服务启动 systemctl start rabbitmq-server)