RabbitMQ linux安装
时间: 2023-12-02 16:42:41 浏览: 145
以下是RabbitMQ在Linux上的安装步骤:
1.确保已经安装了Erlang,可以通过以下命令检查Erlang是否已经安装:
```shell
erl -v
```
2.如果Erlang未安装,则需要先安装Erlang。可以通过以下命令在CentOS上安装Erlang:
```shell
yum install erlang
```
3.下载RabbitMQ的安装包。可以从RabbitMQ官网下载最新版本的RabbitMQ安装包。
4.安装RabbitMQ。可以通过以下命令安装RabbitMQ:
```shell
yum install rabbitmq-server-3.6.8-1.el7.noarch.rpm
```
5.启动RabbitMQ服务。可以通过以下命令启动RabbitMQ服务:
```shell
systemctl start rabbitmq-server
```
6.检查RabbitMQ服务是否已经启动。可以通过以下命令检查RabbitMQ服务是否已经启动:
```shell
systemctl status rabbitmq-server
```
如果RabbitMQ服务已经启动,则会输出类似以下内容:
```shell
● rabbitmq-server.service - RabbitMQ broker
Loaded: loaded (/usr/lib/systemd/system/rabbitmq-server.service; enabled; vendor preset: disabled)
Active: active (running) since Tue 2021-08-10 14:22:22 CST; 1h 5min ago
Main PID: 12345 (beam.smp)
Status: "Initialized"
Tasks: 102 (limit: 4915)
Memory: 155.9M
CGroup: /system.slice/rabbitmq-server.service
├─12345 /usr/lib64/erlang/erts-10.3.5.6/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/lib64/erlang -progname erl -- -home /var/lib/rabbitmq -- -pa /usr/lib/rabbitmq/lib/rabbitmq_server-3.6.8/sbin/../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/lib/rabbitmq_server-3.6.8/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"
├─12456 /usr/lib64/erlang/erts-10.3.5.6/bin/epmd -daemon
├─12678 erl_child_setup 65536
├─12789 inet_gethost 4
└─12790 inet_gethost 4
```
如果RabbitMQ服务未启动,则会输出类似以下内容:
```shell
● rabbitmq-server.service - RabbitMQ broker
Loaded: loaded (/usr/lib/systemd/system/rabbitmq-server.service; enabled; vendor preset: disabled)
Active: inactive (dead)
```
阅读全文