💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
RabbitMQ is a widely used open-source message broker written in the Erlang programming language. As a message-oriented middleware, RabbitMQ can be used to implement the Advanced Message Queuing Protocol (AMQP) on all modern operating systems. ### Step 1: ~~~ yum install epel-release yum update reboot ~~~ ### Step 2 因为RabbitMQ使用Erlang写的,所以需要预先安装Erlang。 ~~~ cd ~ wget http://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm sudo rpm -Uvh erlang-solutions-1.0-1.noarch.rpm sudo yum install erlang ~~~ 输入erl验正 ### Step 3: Install RabbitMQ ~~~ cd ~ wget https://www.rabbitmq.com/releases/rabbitmq-server/v3.6.1/rabbitmq-server-3.6.1-1.noarch.rpm sudo rpm --import https://www.rabbitmq.com/rabbitmq-signing-key-public.asc sudo yum install rabbitmq-server-3.6.1-1.noarch.rpm ~~~ ### Step 4: Modify firewall rules 为了实现远程管理RabbitMQ,需要打开tcp在端口4369, 25672, 5671, 5672, 15672, 61613, 61614, 1883, and 8883. ~~~ firewall-cmd --zone=public --permanent --add-port=4369/tcp --add-port=25672/tcp --add-port=5671-5672/tcp --add-port=15672/tcp --add-port=61613-61614/tcp --add-port=1883/tcp --add-port=8883/tcp firewall-cmd --reload ~~~ 启动以及开机自启动 ~~~ systemctl start rabbitmq-server.service systemctl enable rabbitmq-server.service ~~~ 状态查看 ~~~ rabbitmqctl status ~~~ ### Step5 :开启RabbitMQ控制台。 开启之后就可以从浏览器里面监视RabbitMQ的服务进程。 ~~~ rabbitmq-plugins enable rabbitmq_management chown -R rabbitmq:rabbitmq /var/lib/rabbitmq/ ~~~ 接下来添加账户以及权限 ~~~ sudo rabbitmqctl add_user mqadmin mqadminpassword sudo rabbitmqctl set_user_tags mqadmin administrator sudo rabbitmqctl set_permissions -p / mqadmin ".*" ".*" ".*" ~~~ 打开以下端口 ~~~ http://[your-server-IP]:15672/ ~~~ Log in with the credentials you had specified earlier. You will be greeted with the RabbitMQ remote management console, where you can learn more about RabbitMQ. Enjoy! 常用配置 rabbitmqctl:用户服务管理和常规的任务操作 rabbitmq-diagnostics:用于诊断和健康检查