rpm -Uvh *.rpm --nodeps --force
安装依赖(一步步来) rpm -ivh erlang-22.2.1-1.el7.x86_64.rpm rpm -ivh socat-1.7.3.2-2.el7.x86_64.rpm --nodeps --force rpm -ivh rabbitmq-server-3.8.3-1.el7.noarch.rpm 启动RabbitMQ systemctl start rabbitmq-server systemctl restart rabbitmq-server systemctl status rabbitmq-server
设置RabbitMQ开机自启动 systemctl enable rabbitmq-server #开启网页插件 rabbitmq-plugins enable rabbitmq_management # 添加用户 rabbitmqctl add_user cnmc cnmc20230630 # 设置用户角色,分配操作权限 rabbitmqctl set_user_tags cnmc administrator # 为用户添加资源权限(授予访问虚拟机根节点的所有权限) rabbitmqctl set_permissions -p "/" cnmc ".*" ".*" ".*"
保证每个服务器上erlang.cookie内容一致 chmod 777 /var/lib/rabbitmq/.erlang.cookie CRAZQSVYQHZKJJFORKFE chmod 400 /var/lib/rabbitmq/.erlang.cookie vim /var/lib/rabbitmq/.erlang.cookie SFUCRTJHNHNTVELYZLDC
修改hosts vim /etc/hosts 10.2.1.199 rabbit-node1 10.2.1.200 rabbit-node2 10.2.1.201 rabbit-node3 设置服务器hostname hostnamectl set-hostname rabbit-node1 # 在rabbit2 节点执行命令 停止并且链接到rabbit1节点 #停止节点 rabbitmqctl stop_app # 清空节点状态 rabbitmqctl reset # rabbit2和rabbit1构成集群,rabbit2必须能通过rabbit1的主机名ping通 rabbitmqctl join_cluster rabbit@ecs-5167-0615539 # 开启rabbitmq服务 rabbitmqctl start_app
固定服务名 rabbitmq-env.conf echo 'NODENAME=rabbit@ecs-c775-0615708' >> /etc/rabbitmq/rabbitmq-env.conf
标签:rpm,rabbitmq,server,rabbitmqctl,集群,RabbitMQ,rabbit,erlang,安装 From: https://www.cnblogs.com/tsvv-plus/p/17553748.html