【RabbitMQ】安装RabbitMQ(一)

一、检测安装系统版本

查看Linux版本命令如下:

1、查看Linux内核
cat /proc/version
uname -a
2、查看Linux系统版本的命令
lsb_release -a          #即可列出所有版本信息
cat /etc/redhat-release #这种方法只适合Redhat系的Linux
cat /etc/issue          #此命令也适用于所有的Linux发行版

二、下载对应系统版本的软件包

RabbitMQ官网

Erlang and Elixir Packages Download - Erlang Solutions (erlang-solutions.com)

三、安装步骤.

当前系统为 Centos7。下载软件版本如下:

rabbitmq-server-3.9.13-1.el7.noarch.rpm,esl-erlang_23.3.4.5-1_centos_7_amd64.rpm

1、rabbitmq是使用Erlang开发,所以先安装Erlang

注意RabbitMQ与Erlang之间的版本对应关系

# 先安装依赖,否则可能报错
yum install -y libtool
yum install -y *unixODBC*
rpm -Uvh esl-erlang_23.3.4.5-1_centos_7_amd64.rpm
yum install -y erlang

安装完,使用 erl -version

[root@VM-16-2-centos rabbitmq]# erl -version
Erlang (SMP,ASYNC_THREADS,HIPE) (BEAM) emulator version 11.2.2.4
2、安装RabbitMq
rpm -Uvh rabbitmq-server-3.9.13-1.el7.noarch.rpm
yum install -y rabbitmq-server

执行完上面的命令,如果无错误,说明安装成功。

3、启动RabbitMq
systemctl start rabbitmq-server

查看启动状态:

systemctl status  rabbitmq-server
 rabbitmq-server.service - RabbitMQ broker
   Loaded: loaded (/usr/lib/systemd/system/rabbitmq-server.service; disabled; vendor preset: disabled)
   Active: active (running) since Thu 2022-01-20 09:34:37 CST; 22min ago
 Main PID: 11264 (beam.smp)
   CGroup: /system.slice/rabbitmq-server.service
           ├─11264 /usr/lib/erlang/erts-11.2.2.4/bin/beam.smp -W w -MBas ageffcbf -MHas ageffcbf -MBlmbcs 512 -MHlmbcs 512 -MMmcs 30 -P 104...
           ├─11279 erl_child_setup 32768
           ├─11304 /usr/lib/erlang/erts-11.2.2.4/bin/epmd -daemon
           ├─11332 inet_gethost 4
           └─11333 inet_gethost 4

Jan 20 09:34:35 VM-16-2-centos rabbitmq-server[11264]: Doc guides:  https://rabbitmq.com/documentation.html
Jan 20 09:34:35 VM-16-2-centos rabbitmq-server[11264]: Support:     https://rabbitmq.com/contact.html
Jan 20 09:34:35 VM-16-2-centos rabbitmq-server[11264]: Tutorials:   https://rabbitmq.com/getstarted.html
Jan 20 09:34:35 VM-16-2-centos rabbitmq-server[11264]: Monitoring:  https://rabbitmq.com/monitoring.html
Jan 20 09:34:35 VM-16-2-centos rabbitmq-server[11264]: Logs: /var/log/rabbitmq/rabbit@VM-16-2-centos.log
Jan 20 09:34:35 VM-16-2-centos rabbitmq-server[11264]: /var/log/rabbitmq/rabbit@VM-16-2-centos_upgrade.log
Jan 20 09:34:35 VM-16-2-centos rabbitmq-server[11264]: <stdout>
Jan 20 09:34:35 VM-16-2-centos rabbitmq-server[11264]: Config file(s): (none)
Jan 20 09:34:37 VM-16-2-centos rabbitmq-server[11264]: Starting broker... completed with 0 plugins.
Jan 20 09:34:37 VM-16-2-centos systemd[1]: Started RabbitMQ broker.

启动成功。

上一篇:win10自带的虚拟机安装Centos 及 Linux的一些基础命令


下一篇:Centos7上安装docker