rabbitmq部署
时间: 2023-11-23 14:57:23 浏览: 122
rabbitmq配置文件
以下是rabbitmq部署的步骤:
1.安装Erlang
```shell
# 添加Erlang软件源
wget https://packages.erlang-solutions.com/erlang-solutions_2.0_all.deb && sudo dpkg -i erlang-solutions_2.0_all.deb
# 更新软件源
sudo apt-get update
# 安装Erlang
sudo apt-get install -y erlang
```
2.安装RabbitMQ
```shell
# 添加RabbitMQ软件源
echo 'deb http://www.rabbitmq.com/debian/ testing main' | sudo tee /etc/apt/sources.list.d/rabbitmq.list
# 添加公钥
wget -O- https://www.rabbitmq.com/rabbitmq-release-signing-key.asc | sudo apt-key add -
# 更新软件源
sudo apt-get update
# 安装RabbitMQ
sudo apt-get install -y rabbitmq-server
```
3.启动RabbitMQ
```shell
sudo service rabbitmq-server start
```
4.配置RabbitMQ
```shell
# 创建用户
sudo rabbitmqctl add_user admin password
# 授权
sudo rabbitmqctl set_user_tags admin administrator
sudo rabbitmqctl set_permissions -p / admin ".*" ".*" ".*"
```
5.启用RabbitMQ插件
```shell
sudo rabbitmq-plugins enable rabbitmq_tracing
```
6.停止RabbitMQ应用
```shell
sudo rabbitmqctl stop_app
```
7.重置RabbitMQ节点
```shell
sudo rabbitmqctl reset
```
8.加入RabbitMQ集群
```shell
sudo rabbitmqctl join_cluster rabbit1@ydt1 --ram
```
9.启动RabbitMQ应用
```shell
sudo rabbitmqctl start_app
```
阅读全文