RabbitMQ 单节点搭建
yum install -y -q curl wget ntp ntpdate lrzsz telnet zip unzip net-tools
timedatectl set-timezone Asia/Shanghai
/usr/sbin/ntpdate -u ntp.aliyun.com
- 2.修改机器名,示例将机器名设为
menhu
(第9步配置mq账号需要利用机器名)
hostnamectl set-hostname menhu
/usr/sbin/iptables -F
systemctl stop firewalld.service
systemctl disable firewalld.service
systemctl status firewalld.service
sed -i 's/^SELINUX=.*/SELINUX=disabled/' /etc/selinux/config
setenforce 0
curl -L http://iso.sqlfans.cn/linux/erlang-26.0.2-1.el7.x86_64.rpm -o /opt/erlang-26.0.2-1.el7.x86_64.rpm
rpm -ivh /opt/erlang-26.0.2-1.el7.x86_64.rpm
/usr/bin/erl -version
curl -L http://iso.sqlfans.cn/linux/rabbitmq-server-generic-unix-3.12.1.tar.xz -o /opt/rabbitmq-server-generic-unix-3.12.1.tar.xz
tar -xJf /opt/rabbitmq-server-generic-unix-3.12.1.tar.xz -C /opt/
mv /opt/rabbitmq_server-3.12.1 /usr/local/rabbitmq
/usr/local/rabbitmq/sbin/rabbitmqctl --version
echo $PATH | grep rabbitmq || echo 'export PATH=$PATH:/usr/local/rabbitmq/sbin' >> /etc/profile
source /etc/profile
rabbitmqctl --version
- 7.启用web管理端插件(rabbitmq_management,监听15672端口)
rabbitmq-plugins list
rabbitmq-plugins enable rabbitmq_management
rabbitmq-plugins list | grep rabbitmq_management
rabbitmq-server -detached
sleep 5 && netstat -lnpt | egrep "(15672|25672|5672)"
- 9.删除guest账号并添加管理员账号(请逐条执行,切记不要一起执行)
rabbitmqctl -n rabbit@menhu change_password guest Admin_147
rabbitmqctl -n rabbit@menhu delete_user guest
rabbitmqctl -n rabbit@menhu add_user admin Admin_147
rabbitmqctl -n rabbit@menhu set_user_tags admin administrator
rabbitmqctl -n rabbit@menhu set_permissions -p / admin '.*' '.*' '.*'
rabbitmqctl -n rabbit@menhu list_users
地址:http://10.30.4.111:15672
账号:admin
密码:Admin_147