linux系统安装rabbitmq
时间: 2023-11-07 22:05:58 浏览: 141
安装 RabbitMQ 可以通过以下步骤完成:
1. 安装 Erlang:RabbitMQ 是用 Erlang 语言编写的,因此需要先安装 Erlang。可以通过以下命令在 Ubuntu 上安装 Erlang:
```
sudo apt-get update
sudo apt-get install erlang
```
2. 添加 RabbitMQ 的 APT 存储库:可以通过以下命令添加 RabbitMQ 的 APT 存储库:
```
echo "deb https://dl.bintray.com/rabbitmq/debian $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/bintray.rabbitmq.list
```
3. 添加 RabbitMQ 的公钥:可以通过以下命令添加 RabbitMQ 的公钥:
```
wget -O- https://www.rabbitmq.com/rabbitmq-release-signing-key.asc | sudo apt-key add -
```
4. 安装 RabbitMQ:可以通过以下命令安装 RabbitMQ:
```
sudo apt-get update
sudo apt-get install rabbitmq-server
```
5. 启动 RabbitMQ:可以通过以下命令启动 RabbitMQ:
```
sudo systemctl start rabbitmq-server
```
6. 验证 RabbitMQ 是否已经启动:可以通过以下命令验证 RabbitMQ 是否已经启动:
```
sudo systemctl status rabbitmq-server
```
如果 RabbitMQ 已经成功启动,那么输出应该类似于以下内容:
```
● rabbitmq-server.service - RabbitMQ Messaging Server
Loaded: loaded (/lib/systemd/system/rabbitmq-server.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2021-08-10 09:57:23 UTC; 2min 14s ago
Main PID: 1234 (beam.smp)
Status: "Initialized"
Tasks: 95 (limit: 4915)
Memory: 128.9M
CGroup: /system.slice/rabbitmq-server.service
├─1234 /usr/lib/erlang/erts-11.1.8/bin/beam.smp -W w -A 64 -MBas ageffcbf -MHas ageffcbf -MBlmbcs 512 -MHlmbcs 512 -MMmcs 30 -P 1048576 -t 5000000 -stbt db -zdbbl 32000 -K true -- -root /usr/lib/erlang -progname erl -- -home /var/lib/rabbitmq -- -pa /usr/lib/rabbitmq/lib/rabbitmq_server-3.8.16/ebin -noshell -noinput -s rabbit boot -sname rabbit@localhost -boot start_sasl -config /etc/rabbitmq/rabbitmq -kernel inet_default_connect_options [{nodelay,true}] -sasl errlog_type error -sasl sasl_error_logger false -rabbit error_logger {file,"/var/log/rabbitmq/rabbit@localhost.log"} -rabbit sasl_error_logger {file,"/var/log/rabbitmq/rabbit@localhost-sasl.log"} -rabbit enabled_plugins_file /etc/rabbitmq/enabled_plugins -rabbit plugins_dir /usr/lib/rabbitmq/plugins:/usr/lib/rabbitmq/lib/rabbitmq_server-3.8.16/plugins -rabbit plugins_expand_dir /var/lib/rabbitmq/mnesia/rabbit@localhost-plugins-expand -os_mon start_cpu_sup true -os_mon start_disksup false -os_mon start_memsup false -mnesia dir "/var/lib/rabbitmq/mnesia/rabbit@localhost"
├─1399 /usr/lib/erlang/erts-11.1.8/bin/epmd -daemon
├─1477 erl_child_setup 65536
├─1506 inet_gethost 4
└─1507 inet_gethost 4
```
阅读全文