linux 安装 RabbitMQ3.7.12-1 记录
-
安装Erlang依赖环境
- 相关命令
curl -s https://packagecloud.io/install/repositories/rabbitmq/erlang/script.rpm.sh | sudo bash
- 查看结果
https://packagecloud.io/rabbitmq/erlang/el/7/x86_64/repodata/repomd.xml: [Errno -1] Gpg Keys not imported, cannot verify repomd.xml for repo rabbitmq_erlang Generating yum cache for rabbitmq_erlang-source... The repository is setup! You can now install packages.
-
导入rabbitmq签名密钥(使RPM工具信任存储库中提供的包上的签名)
rpm --import https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc
这里需要注意,可能github上面签名密钥路径会发生变化,浏览器打开,也可以浏览器打开,手动下载,上传,import 进去
-
rabbitmq.repo 修改
[bintray-rabbitmq-server] name=bintray-rabbitmq-rpm baseurl=https://dl.bintray.com/rabbitmq/rpm/rabbitmq-server/v3.7.x/el/7/ gpgcheck=0 repo_gpgcheck=0 enabled=1
这里需要注意,如果已经存在了一个repo的文件,且名称不为rabbitmq.repo,就不要在进行修改了。
-
安装rabbitmq-server-3.7.12-1.el7.noarch.rpm
yum install https://dl.bintray.com/rabbitmq/rpm/rabbitmq-server/v3.7.x/el/7/noarch/rabbitmq-server-3.7.12-1.el7.noarch.rpm
中途如果报错为
Transaction check error: file /usr/lib64/erlang/bin/epmd from install of erlang-21 ... file /usr/lib64/erlang/bin/.... file /usr/lib64/erlang/bin/.... file /usr/lib64/erlang/bin/.... file /usr/lib64/erlang/bin/.... file /usr/lib64/erlang/bin/....
解决方法 - 卸载相关依赖,重新进行尝试
sudo yum remove erlang*
如果报错为
You could try using --skip-broken to work around the problem ** Found 2 pre-existing rpmdb problem(s), 'yum check' output follows: 2:postfix-2.10.1-6.el7.x86_64 has missing requires of libmysqlclient.so.18()(64bit) 2:postfix-2.10.1-6.el7.x86_64 has missing requires of libmysqlclient.so.18(libmysqlclient_18)(64bit)
缺少Percona-XtraDB-Cluster-shared-55-5.5.37-25.10.756.el6.x86_64.rpm这个包
wget http://www.percona.com/redir/downloads/Percona-XtraDB-Cluster/5.5.37-25.10/RPM/rhel6/x86_64/Percona-XtraDB-Cluster-shared-55-5.5.37-25.10.756.el6.x86_64.rpm rpm -ivh Percona-XtraDB-Cluster-shared-55-5.5.37-25.10.756.el6.x86_64.rpm
-
进行启动
#建议使用前面的三个 #启动:systemctl start rabbitmq-server #停止:systemctl stop rabbitmq-server #重启:systemctl restart rabbitmq-server #前台启动:rabbitmq-server start #后台启动:rabbitmq-server -detached 也可以使用RabbitMQ Server的rabbitmqctl命令: #启动:rabbitmqctl start_app #停止:rabbitmqctl stop_app
-
验证RabbitMQ 是否启动
service rabbitmq-server status 或者 rabbitmqctl status
-
后台启动相关
#启动:systemctl start rabbitmq-server #停止:systemctl stop rabbitmq-server #重启:systemctl restart rabbitmq-server
-
启动管理界面
rabbitmq-plugins enable rabbitmq_management
打开浏览器进行访问 -- 浏览器中访问管理页面:http://<虚拟机IP>:15672/
-
添加用户以及权限
#添加用户名,密码 rabbitmqctl add_user admin StrongPassword #添加用户的管理组 rabbitmqctl set_user_tags admin administrator # 设置用户的权限 rabbitmqctl set_permissions -p / admin “.*” “.*” “.*”
-
进行登陆
- 使用刚才的用户,进行登陆。
使用默认的guest用户登陆会报错 User can only log in via localhost
rabbitmq从3.3.0开始禁止使用guest/guest权限通过除localhost外的访问
来源:oschina
链接:https://my.oschina.net/u/2971292/blog/3196937