准备工作
安装各种环境
sudo yum install -y gcc gcc-c++ glibc-devel make ncurses-devel openssl-devel autoconf java-1.8.0-openjdk-devel git
#
yum install tcp_wrappers
# 下载socat
wget http://ftp.tu-chemnitz.de/pub/linux/dag/redhat/el6/en/x86_64/rpmforge/RPMS/socat-1.7.2.4-1.el6.rf.x86_64.rpm
rpm -ivh socat-1.7.2.4-1.el6.rf.x86_64.rpm
1、安装rabbitmq运行环境erlang
# 下载
wget https://github.com/rabbitmq/erlang-rpm/releases/download/v21.0.9/erlang-21.0.9-1.el7.centos.x86_64.rpm
# 安装
rpm -ivh erlang-21.0.9-1.el7.centos.x86_64.rpm
安装会报
警告:erlang-21.0.9-1.el7.centos.x86_64.rpm: 头V4 RSA/SHA1 Signature, 密钥 ID 6026dfca: NOKEY
错误:依赖检测失败:
libcrypto.so.10(OPENSSL_1.0.2)(64bit) 被 erlang-21.0.9-1.el7.centos.x86_64 需要
# 下载升级openssl 1.0.2
wget http://rpmfind.net/linux/centos/7.7.1908/os/x86_64/Packages/openssl-libs-1.0.2k-19.el7.x86_64.rpm
rpm -ivh openssl-libs-1.0.2k-19.el7.x86_64.rpm --force
2、安装rabbitmq
# 下载安装包
wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.7.9/rabbitmq-server-3.7.9-1.el7.noarch.rpm
rpm -ivh rabbitmq-server-3.7.9-1.el7.noarch.rpm
3、启动服务
# 完成后启动服务:
systemctl start rabbitmq-server (centos7用该命令)
service rabbitmq-server start
# 查看服务状态:
systemctl status rabbitmq-server (centos7用该命令)
service rabbitmq-server status
# 开启浏览器页面:
rabbitmq-plugins enable rabbitmq_management
# 添加用户名密码
rabbitmqctl add_user username password
# 删除用户
rabbitmqctl delete_user username
rabbitmqctl list_users
# 设置用户类型
rabbitmqctl set_user_tags root administrator
# 添加删除vhost
rabbitmqctl add_vhost
rabbitmqctl delete_vhost
rabbitmqctl list_vhosts
# 设置权限
rabbitmqctl set_permissions -p "/" joyce '.*' '.*' '.*'