linux 安装rabbitmq
时间: 2023-11-07 09:55:03 浏览: 83
好的,以下是在 Linux 系统下安装 RabbitMQ 的步骤:
1. 安装 Erlang:RabbitMQ 是使用 Erlang 语言开发的,因此需要先安装 Erlang。可以通过以下命令在 Ubuntu 系统上安装 Erlang:
```
sudo apt-get update
sudo apt-get install erlang
```
2. 添加 RabbitMQ 的 APT 源:RabbitMQ 官方提供了 APT 源,可以通过以下命令添加:
```
curl -s https://packagecloud.io/install/repositories/rabbitmq/rabbitmq-server/script.deb.sh | sudo bash
```
3. 安装 RabbitMQ:使用以下命令安装 RabbitMQ:
```
sudo apt-get update
sudo apt-get install rabbitmq-server
```
4. 启动 RabbitMQ:使用以下命令启动 RabbitMQ:
```
sudo service rabbitmq-server start
```
5. 验证 RabbitMQ 是否运行:使用以下命令验证 RabbitMQ 是否已经运行:
```
sudo rabbitmqctl status
```
如果输出类似于以下内容,则说明 RabbitMQ 已经成功安装并启动:
```
Status of node rabbit@localhost ...
[{pid,1593},
{running_applications,
[{rabbitmq_management,"RabbitMQ Management Console","3.7.8"},
{rabbitmq_web_dispatch,"RabbitMQ Web Dispatcher","3.7.8"},
{rabbitmq_management_agent,"RabbitMQ Management Agent","3.7.8"},
{rabbit,"RabbitMQ","3.7.8"},
{rabbit_common,[],"3.7.8"},
{cowlib,"Cowboy 2.2.0 adapter for Erlang/OTP","2.7.0"},
{ranch,"Socket acceptor pool for TCP protocols.","1.7.1"},
{cowboy,"Small, fast, modern HTTP server.","2.7.0"}]},
{os,{unix,linux}},
{erlang_version,"21.1.4"},
{memory,[{total,36291120},
{connection_readers,0},
{connection_writers,0},
{connection_channels,0},
{connection_other,0},
{queue_procs,0},
{queue_slave_procs,0},
{plugins,0},
{other_proc,10419336},
{mnesia,0},
{mgmt_db,0},
{msg_index,0},
{other_ets,0},
{binary,85736},
{code,27291943},
{atom,922993},
{other_system,1985722}]},
{alarms,[]},
{listeners,[{clustering,25672,"::"},{amqp,5672,"::"}]},
{vm_memory_high_watermark,0.4},
{vm_memory_limit,1337729233},
{disk_free_limit,50000000},
{disk_free,16445234176},
{file_descriptors,[{total_limit,1048576},
{total_used,2},
{sockets_limit,943626},
{sockets_used,0}]},
{processes,[{limit,1048576},{used,288}]},
{run_queue,0},
{uptime,1504}]
```
至此,RabbitMQ 已经在 Linux 系统上安装成功。
阅读全文