当前位置:首页 > 服务端 > RabbitMQ 之 安装

RabbitMQ 之 安装

2022年11月07日 15:42:23服务端8

RabbitMQ 下载

RabbitMQ包
下载地址: https://www.rabbitmq.com/
百度云下载地址:链接:https://pan.baidu.com/s/1jmlgh6osLtfkaoNi259dSw 提取码:jskq

rabbitmq-server-windows-3.8.3.zip

https://www.rabbitmq.com/install-windows.html

Github:https://github.com/rabbitmq/

rabbitmq-server发布地址:https://github.com/rabbitmq/rabbitmq-server

https://github.com/rabbitmq/rabbitmq-server/releases

RabbitMQ 3.8.14

RabbitMQ 3.8.14 is a maintenance release that restores
Erlang 22.3 compatibility for environments that use direct reply-to.

Erlang/OTP Compatibility Notes

This release requires Erlang 22.3.
Erlang 23 is highly recommended
for best forward compatibility with future RabbitMQ versions.

Provisioning Latest Erlang Releases explains

RabbitMQ 之 安装 _ JavaClub全栈架构师技术笔记

与其对应的Erlang的windows版本下载地址:https://erlang.org/download/otp_versions_tree.html

what package repositories and tools can be used to provision a recent version of Erlang 23.x.


这里下载 [rabbitmq-server-windows-3.8.14.zip] 版本

与Erlang的版本对应关系:

https://www.rabbitmq.com/which-erlang.html

RabbitMQ 之 安装 _ JavaClub全栈架构师技术笔记

Erlang的版本仓储: https://www.rabbitmq.com/which-erlang.html#erlang-repositories

RabbitMQ 之 安装 _ JavaClub全栈架构师技术笔记

Erlang的windows版本https://erlang.org/download/otp_versions_tree.html

其实跳转到的下载地址是这里:

https://github.com/erlang/otp/releases

Erlang环境

官网:https://www.erlang.org/

下载地址:https://www.erlang.org/downloads

https://erlang.org/download/otp_versions_tree.html

https://github.com/erlang/otp/releases

Erlang语言运行环境
下载地址:http://www.erlang.org/downloads
百度云下载地址:https://pan.baidu.com/s/1eHRa6BZZ3UN-Cj4Of8sASA 提取码:ou3k

esl-erlang_22.1_windows_amd64.exe

Github:https://github.com/erlang/otp

我们得下载 22.3~23.x 版本才行

https://www.erlang.org/downloads

RabbitMQ 之 安装 _ JavaClub全栈架构师技术笔记

otp_win64_23.3.exe

Windows安装

参考资料:

https://blog.csdn.net/fisea/article/details/111876676

先安装Erlang

Erlang是RabbitMQ的运行环境,所有得先安装。

特别注意:
RabbitMQ版本依赖于不同的Erlang语言环境版本,
故先决定安装RabbitMQ的版本,再决定安装哪个版本的Erlang

RabbitMQ与Erlang语言环境版本关系参见:https://www.rabbitmq.com/which-erlang.html
RabbitMQ 之 安装 _ JavaClub全栈架构师技术笔记

这里使用的Erlang语言环境版本:

安装 otp_win64_23.3.exe,安装目录:C:\Program Files\erl-23.3

其它版本下载:https://www.erlang.org/downloads

然后设置环境变量

ERLANG_HOME:C:\Program Files\erl-23.3
Path: %ERLANG_HOME%\bin

运行CMD:

C:\Users\wei>erl -v
Eshell V11.2  (abort with ^G)
1>

说明安装成功。

安装RabbitMQ

解压 [rabbitmq-server-windows-3.8.14.zip] 版本,然后把文件夹rabbitmq_server-3.8.14拷贝到C:\Program Files\,即最终目录为:

C:\Program Files\rabbitmq_server-3.8.14

必须以管理员身份运行CMD

C:\WINDOWS\system32>cd C:\Program Files\rabbitmq_server-3.8.14\sbin

#安装为windows服务
C:\Program Files\rabbitmq_server-3.8.14\sbin>rabbitmq-service install
#安装成功提示
C:\Program Files\erl-23.3\erts-11.2\bin\erlsrv: Service RabbitMQ added to system.
C:\Program Files\rabbitmq_server-3.8.14\sbin>

打开 CMD > regedit

这时看注册表:
RabbitMQ 之 安装 _ JavaClub全栈架构师技术笔记

如果之前安装过,再安装,有可能安装失败,可以先如上图的注册表RabbitMQ节点删除掉。

接着启用并启动服务

#服务启用
C:\Program Files\rabbitmq_server-3.8.14\sbin>rabbitmq-service enable

#服务启动
C:\Program Files\erl-23.3\erts-11.2\bin\erlsrv: Service RabbitMQ enabled.

C:\Program Files\rabbitmq_server-3.8.14\sbin>rabbitmq-service start
RabbitMQ 服务正在启动 .
RabbitMQ 服务已经启动成功。


C:\Program Files\rabbitmq_server-3.8.14\sbin>

查看windows服务:这时多出了一个RabbitMQ的windows服务

RabbitMQ 之 安装 _ JavaClub全栈架构师技术笔记

RabbitMQ 之 安装 _ JavaClub全栈架构师技术笔记

RabbitMQ 之 安装 _ JavaClub全栈架构师技术笔记

查看服务器状态:

C:\Program Files\rabbitmq_server-3.8.14\sbin>rabbitmqctl status
Error: unable to perform an operation on node 'rabbit@DESKTOP-E6NOF0N'. Please see diagnostics information and suggestions below.

Most common reasons for this are:

 * Target node is unreachable (e.g. due to hostname resolution, TCP connection or firewall issues)
 * CLI tool fails to authenticate with the server (e.g. due to CLI tool's Erlang cookie not matching that of the server)
 * Target node is not running

In addition to the diagnostics info below:

 * See the CLI, clustering and networking guides on https://rabbitmq.com/documentation.html to learn more
 * Consult server logs on node rabbit@DESKTOP-E6NOF0N
 * If target node is configured to use long node names, don't forget to use --longnames with CLI tools

DIAGNOSTICS
===========

attempted to contact: ['rabbit@DESKTOP-E6NOF0N']

rabbit@DESKTOP-E6NOF0N:
  * connected to epmd (port 4369) on DESKTOP-E6NOF0N
  * epmd reports node 'rabbit' uses port 25672 for inter-node and CLI tool traffic
  * TCP connection succeeded but Erlang distribution failed
  * suggestion: check if the Erlang cookie identical for all server nodes and CLI tools
  * suggestion: check if all server nodes and CLI tools use consistent hostnames when addressing each other
  * suggestion: check if inter-node connections may be configured to use TLS. If so, all nodes and CLI tools must do that
   * suggestion: see the CLI, clustering and networking guides on https://rabbitmq.com/documentation.html to learn more


Current node details:
 * node name: 'rabbitmqcli-369-rabbit@DESKTOP-E6NOF0N'
 * effective user's home directory: C:\Users\wei
 * Erlang cookie hash: WdpOFxVp/R53mEM5zLwTCQ==

出现以上的错误,或者其它如下图所示错误:

RabbitMQ 之 安装 _ JavaClub全栈架构师技术笔记

解决方法:

C:\Users\wei\目录中的文件.erlang.cookie拷贝到如下两个目录:

# 这个文件夹已经存在同名文件.erlang.cookie,将其覆盖
C:\Windows\System32\config\systemprofile 
C:\Program Files\rabbitmq_server-3.8.14\sbin

然后重启RabbitMQ的windows服务,再不行重启电脑

再查看服务状态:

# 提示一些错误
C:\Program Files\rabbitmq_server-3.8.14\sbin>rabbitmqctl status
Error: this command requires the 'rabbit' app to be running on the target node. Start it with 'rabbitmqctl start_app'.
Arguments given:
        status

Usage

rabbitmqctl [--node <node>] [--longnames] [--quiet] status [--unit <unit>] [--timeout <timeout>]


# 若还是提示以上些错误,多启动windows服务几次,等待久一点
C:\Program Files\rabbitmq_server-3.8.14\sbin>rabbitmqctl status
Status of node rabbit@DESKTOP-E6NOF0N ...
Runtime

OS PID: 10516
OS: Windows
Uptime (seconds): 246
Is under maintenance?: false
RabbitMQ version: 3.8.14
Node name: rabbit@DESKTOP-E6NOF0N
Erlang configuration: Erlang/OTP 23 [erts-11.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1]
Erlang processes: 308 used, 1048576 limit
Scheduler run queue: 1
Cluster heartbeat timeout (net_ticktime): 60

Plugins

Enabled plugin file: c:/Users/wei/AppData/Roaming/RabbitMQ/enabled_plugins
Enabled plugins:


Data directory![](https://img2022.cnblogs.com/blog/380433/202205/380433-20220503103138010-1063166949.png)


Node data directory: c:/Users/wei/AppData/Roaming/RabbitMQ/db/rabbit@DESKTOP-E6NOF0N-mnesia
Raft data directory: c:/Users/wei/AppData/Roaming/RabbitMQ/db/rabbit@DESKTOP-E6NOF0N-mnesia/quorum/rabbit@DESKTOP-E6NOF0N

Config files


Log file(s)

 * c:/Users/wei/AppData/Roaming/RabbitMQ/log/rabbit@DESKTOP-E6NOF0N.log
 * c:/Users/wei/AppData/Roaming/RabbitMQ/log/rabbit@DESKTOP-E6NOF0N_upgrade.log

Alarms

(none)

Memory

Total memory used: 0.12 gb
Calculation strategy: rss
Memory high watermark setting: 0.4 of available memory, computed to: 6.8238 gb

other_proc: 0.0459 gb (36.07 %)
allocated_unused: 0.031 gb (24.36 %)
code: 0.0293 gb (23.0 %)
other_system: 0.0155 gb (12.19 %)
other_ets: 0.003 gb (2.38 %)
atom: 0.0014 gb (1.07 %)
plugins: 0.0004 gb (0.35 %)
binary: 0.0003 gb (0.27 %)
metrics: 0.0002 gb (0.17 %)
mnesia: 0.0001 gb (0.07 %)
quorum_ets: 0.0 gb (0.04 %)
msg_index: 0.0 gb (0.03 %)
connection_channels: 0.0 gb (0.0 %)
connection_other: 0.0 gb (0.0 %)
connection_readers: 0.0 gb (0.0 %)
connection_writers: 0.0 gb (0.0 %)
mgmt_db: 0.0 gb (0.0 %)
queue_procs: 0.0 gb (0.0 %)
queue_slave_procs: 0.0 gb (0.0 %)
quorum_queue_procs: 0.0 gb (0.0 %)
reserved_unallocated: 0.0 gb (0.0 %)

File Descriptors

Total: 2, limit: 65439
Sockets: 0, limit: 58893

Free Disk Space

Low free disk space watermark: 0.05 gb
Free disk space: 105.4149 gb

Totals

Connection count: 0
Queue count: 0
Virtual host count: 1

Listeners

Interface: [::], port: 25672, protocol: clustering, purpose: inter-node and CLI tool communication
Interface: [::], port: 5672, protocol: amqp, purpose: AMQP 0-9-1 and AMQP 1.0
Interface: 0.0.0.0, port: 5672, protocol: amqp, purpose: AMQP 0-9-1 and AMQP 1.0

C:\Program Files\rabbitmq_server-3.8.14\sbin>

看到以上输出,说明已经正常启动了

管理界面

默认情况下,RabbitMQ 没有安装Web端的客户端插件,需要安装才可以生效

RabbitMQ插件:https://www.rabbitmq.com/management.html

从查看服务运行状态看:

C:\Program Files\rabbitmq_server-3.8.14\sbin>rabbitmqctl status

Listeners

Interface: [::], port: 25672, protocol: clustering, purpose: inter-node and CLI tool communication
Interface: [::], port: 5672, protocol: amqp, purpose: AMQP 0-9-1 and AMQP 1.0
Interface: 0.0.0.0, port: 5672, protocol: amqp, purpose: AMQP 0-9-1 and AMQP 1.0

并没有开启管理界面插件(插件名:rabbitmq_management ,监听端口为:15672)

默认的开启的插件,每个版本可能不一样

查看下插件列表:

C:\Program Files\rabbitmq_server-3.8.14\sbin>rabbitmq-plugins list
Listing plugins with pattern ".*" ...
 Configured: E = explicitly enabled; e = implicitly enabled
 | Status: * = running on rabbit@DESKTOP-E6NOF0N
 |/
[  ] rabbitmq_amqp1_0                  3.8.14
[  ] rabbitmq_auth_backend_cache       3.8.14
[  ] rabbitmq_auth_backend_http        3.8.14
[  ] rabbitmq_auth_backend_ldap        3.8.14
[  ] rabbitmq_auth_backend_oauth2      3.8.14
[  ] rabbitmq_auth_mechanism_ssl       3.8.14
[  ] rabbitmq_consistent_hash_exchange 3.8.14
[  ] rabbitmq_event_exchange           3.8.14
[  ] rabbitmq_federation               3.8.14
[  ] rabbitmq_federation_management    3.8.14
[  ] rabbitmq_jms_topic_exchange       3.8.14
[  ] rabbitmq_management               3.8.14
[  ] rabbitmq_management_agent         3.8.14
[  ] rabbitmq_mqtt                     3.8.14
[  ] rabbitmq_peer_discovery_aws       3.8.14
[  ] rabbitmq_peer_discovery_common    3.8.14
[  ] rabbitmq_peer_discovery_consul    3.8.14
[  ] rabbitmq_peer_discovery_etcd      3.8.14
[  ] rabbitmq_peer_discovery_k8s       3.8.14
[  ] rabbitmq_prometheus               3.8.14
[  ] rabbitmq_random_exchange          3.8.14
[  ] rabbitmq_recent_history_exchange  3.8.14
[  ] rabbitmq_sharding                 3.8.14
[  ] rabbitmq_shovel                   3.8.14
[  ] rabbitmq_shovel_management        3.8.14
[  ] rabbitmq_stomp                    3.8.14
[  ] rabbitmq_top                      3.8.14
[  ] rabbitmq_tracing                  3.8.14
[  ] rabbitmq_trust_store              3.8.14
[  ] rabbitmq_web_dispatch             3.8.14
[  ] rabbitmq_web_mqtt                 3.8.14
[  ] rabbitmq_web_mqtt_examples        3.8.14
[  ] rabbitmq_web_stomp                3.8.14
[  ] rabbitmq_web_stomp_examples       3.8.14

确实没有启用,现在开始启用:


#### 启用插件rabbitmq_management
C:\Program Files\rabbitmq_server-3.8.14\sbin>rabbitmq-plugins enable rabbitmq_management
Enabling plugins on node rabbit@DESKTOP-E6NOF0N:
rabbitmq_management
The following plugins have been configured:
  rabbitmq_management
  rabbitmq_management_agent
  rabbitmq_web_dispatch
Applying plugin configuration to rabbit@DESKTOP-E6NOF0N...
The following plugins have been enabled:
  rabbitmq_management
  rabbitmq_management_agent
  rabbitmq_web_dispatch

started 3 plugins.

#### 查看是否启用插件成功
C:\Program Files\rabbitmq_server-3.8.14\sbin>rabbitmq-plugins list rabbitmq_management
Listing plugins with pattern "rabbitmq_management" ...
 Configured: E = explicitly enabled; e = implicitly enabled
 | Status: * = running on rabbit@DESKTOP-E6NOF0N
 |/
[E*] rabbitmq_management       3.8.14
[e*] rabbitmq_management_agent 3.8.14

启用插件成功后,访问:http://localhost:15672/

RabbitMQ 之 安装 _ JavaClub全栈架构师技术笔记

查看用户列表:

C:\Program Files\rabbitmq_server-3.8.14\sbin>rabbitmqctl list_users
Listing users ...
user    tags
guest   [administrator]

guest是管理员账号,密码是:guest,现在使用其进行登录

RabbitMQ 之 安装 _ JavaClub全栈架构师技术笔记

用户

//创建用户testuser密码为123456 
rabbitmqctl  add_user testuser 123456   

//赋予testuser读写所有消息队列的权限
rabbitmqctl  set_permissions testuser ".*"  ".*"  ".*"    

//分配用户组(administrator)
rabbitmqctl  set_user_tags testuser administrator    

其它设置

为了方便查找 , 设置如下环境变量 ,这样可以在任何地方在CMD运行(不行!!!)

RABBITMQ_SERVER: C:\Program Files\rabbitmq_server-3.8.14 (根目录)
Path :%RABBITMQ_SERVER%\sbin

卸载RabbitMQ 和Erlang环境

1 打开Windows控制面板,双击“程序和功能”。
2 在当前安装的程序列表中,右键单击RabbitMQ Server,然后单击“卸载”。
3 在当前安装的程序列表中,右键单击“Erlang OTP”,然后单击“卸载”。
4 打开Windows任务管理器。
5 在任务管理器中,查找进程epmd.exe。 如果此进程仍在运行,请右键单击该进程,然后单击“结束进程”。
6 删除RabbitMQ和Erlang的所有安装目录。
7 删除文件C:\Windows.erlang.cookie(如果存在)。
8 删除电脑找那个所有的.erlang.cookie。
9 同样在User文件夹中,转到AppData\Roaming\RabbitMQ。删除RabbitMQ
10 打开运行cmd->sc delete RabbitMQ。
11 打开运行->regedit 找到RabbitMQ节点,删掉即可

RabbitMQ 之 安装 _ JavaClub全栈架构师技术笔记

Docker安装

镜像仓储:https://registry.hub.docker.com/_/rabbitmq/

下载镜像:

[root@centos7 ~]# docker pull rabbitmq:management
management: Pulling from library/rabbitmq
6e0aa5e7af40: Pull complete 
d47239a868b3: Pull complete 
49cbb10cca85: Pull complete 
b7c2edd50e35: Pull complete 
a6bdd84df6f2: Pull complete 
db4e517e38d3: Pull complete 
b3982db455b0: Pull complete 
9f6708aa7fd0: Pull complete 
21c9ffa1be59: Pull complete 
5c6680e36ae7: Pull complete 
fffa3770b398: Pull complete 
213b533bb8a3: Pull complete 
97df3b39dc36: Pull complete 
Digest: sha256:7ac3902a85940c5c1cf4cdf0f528196b8139344bc79e9b3fa8c9b60c7a4ea293
Status: Downloaded newer image for rabbitmq:management
docker.io/library/rabbitmq:management

运行容器:

[root@centos7 ~]# docker run -di --name myrabitt -e RABBITMQ_DEFAULT_USER=admin  -e RABBITMQ_DEFAULT_PASS=admin -p 15672:15672 -p 25672:25672 -p 61613:61613 -p 1883:1883 rabbitmq:management 
4f795f5970b7bf00be344b6b516b7e1c28170210a5cb460d3f70fca2a119be0f
[root@centos7 ~]# docker ps 
CONTAINER ID   IMAGE    COMMAND        CREATED    STATUS       PORTS     NAMES
4f795f5970b7   rabbitmq:management   "docker-entrypoint.s…"   11 seconds ago   Up 6 seconds   4369/tcp, 5671-5672/tcp, 0.0.0.0:1883->1883/tcp, 15671/tcp, 0.0.0.0:15672->15672/tcp, 0.0.0.0:25672->25672/tcp, 0.0.0.0:61613->61613/tcp, 15691-15692/tcp   myrabitt

查看日志:

[root@centos7 ~]#docker logs myrabitt

访问:http://192.168.130.130:15672/ 就可以看到一个管理界面

RabbitMQ 之 安装 _ JavaClub全栈架构师技术笔记

默认的账号和密码都是admin(创建docker容器时我们指定的):

docker run -di --name myrabitt -e RABBITMQ_DEFAULT_USER=admin  -e RABBITMQ_DEFAULT_PASS=admin ......

查看RabbitMQ-Docker容器的插件列表和启用的插件:

[root@centos7 ~]# docker exec -it myrabitt /bin/bash
root@4f795f5970b7:/# rabbitmq-plugins list
Listing plugins with pattern ".*" ...
 Configured: E = explicitly enabled; e = implicitly enabled
 | Status: * = running on rabbit@4f795f5970b7
 |/
[  ] rabbitmq_amqp1_0                  3.8.14
[  ] rabbitmq_auth_backend_cache       3.8.14
[  ] rabbitmq_auth_backend_http        3.8.14
[  ] rabbitmq_auth_backend_ldap        3.8.14
[  ] rabbitmq_auth_backend_oauth2      3.8.14
[  ] rabbitmq_auth_mechanism_ssl       3.8.14
[  ] rabbitmq_consistent_hash_exchange 3.8.14
[  ] rabbitmq_event_exchange           3.8.14
[  ] rabbitmq_federation               3.8.14
[  ] rabbitmq_federation_management    3.8.14
[  ] rabbitmq_jms_topic_exchange       3.8.14
[E*] rabbitmq_management               3.8.14
[e*] rabbitmq_management_agent         3.8.14
[  ] rabbitmq_mqtt                     3.8.14
[  ] rabbitmq_peer_discovery_aws       3.8.14
[  ] rabbitmq_peer_discovery_common    3.8.14
[  ] rabbitmq_peer_discovery_consul    3.8.14
[  ] rabbitmq_peer_discovery_etcd      3.8.14
[  ] rabbitmq_peer_discovery_k8s       3.8.14
[E*] rabbitmq_prometheus               3.8.14
[  ] rabbitmq_random_exchange          3.8.14
[  ] rabbitmq_recent_history_exchange  3.8.14
[  ] rabbitmq_sharding                 3.8.14
[  ] rabbitmq_shovel                   3.8.14
[  ] rabbitmq_shovel_management        3.8.14
[  ] rabbitmq_stomp                    3.8.14
[  ] rabbitmq_top                      3.8.14
[  ] rabbitmq_tracing                  3.8.14
[  ] rabbitmq_trust_store              3.8.14
[e*] rabbitmq_web_dispatch             3.8.14
[  ] rabbitmq_web_mqtt                 3.8.14
[  ] rabbitmq_web_mqtt_examples        3.8.14
[  ] rabbitmq_web_stomp                3.8.14
[  ] rabbitmq_web_stomp_examples       3.8.14
root@4f795f5970b7:/# cat /etc/rabbitmq/enabled_plugins
[rabbitmq_management,rabbitmq_prometheus].

CentOS安装

CentOS下载

https://www.rabbitmq.com/download.html

这里我们下载:[CentOS7.x版本](https://github-releases.githubusercontent.com/924551/01217e00-7b7e-11eb-9ba0-11817d4f9778?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20210327%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20210327T161048Z&X-Amz-Expires=300&X-Amz-Signature=b672a597bd510fcac071a09e81bb2cd9dcafa56b69eade8a0d05d46233d7a68e&X-Amz-SignedHeaders=host&actor_id=35329755&key_id=0&repo_id=924551&response-content-disposition=attachment%3B filename%3Drabbitmq-server-3.8.14-1.el7.noarch.rpm&response-content-type=application%2Foctet-stream) :rabbitmq-server-3.8.14-1.el7.noarch.rpm ,看到文件,知道其版本号为3.814

Erlang下载

RabbitMQ 之 安装 _ JavaClub全栈架构师技术笔记

https://github.com/rabbitmq/erlang-rpm

https://github.com/rabbitmq/erlang-rpm/releases/tag/v23.3

Redhat7\CentOS7对应的版本: erlang-23.3-2.el7.x86_64.rpm

上传安装包

因为现在安装包已经放到了Github上,下载比较慢,故:先下载到本机,在上传到云服务器,可以已使用

Xftp 软件上传

安装Erlang

[root@centos7 ~]# mkdir -p /usr/rabbitmq
[root@centos7 ~]# cd /usr/rabbitmq/
# 本地上传安装文件
[root@centos7 rabbitmq]# ls
erlang-23.3-2.el7.x86_64.rpm  rabbitmq-server-3.8.14-1.el7.noarch.rpm

# 解压?安装?
[root@centos7 rabbitmq]# rpm -Uvh erlang-23.3-2.el7.x86_64.rpm 
警告:erlang-23.3-2.el7.x86_64.rpm: 头V4 RSA/SHA1 Signature, 密钥 ID 6026dfca: NOKEY
准备中...                          ### [100%]
	软件包 erlang-23.3-2.el7.x86_64 已经安装
	
#yum安装
[root@centos7 rabbitmq]# yum install -vy erlang-23.3-2.el7.x86_64
加载 "fastestmirror" 插件
加载 "langpacks" 插件
Adding zh_CN.UTF-8 to language list
Config time: 0.014
Yum version: 3.4.3
rpmdb time: 0.001
设置软件包群集
Loading mirror speeds from cached hostfile
 * base: mirrors.ustc.edu.cn
 * extras: mirrors.ustc.edu.cn
 * updates: mirrors.aliyun.com
base                                                                                                                                                                                      | 3.6 kB  00:00:00     
docker-ce-stable                                                                                                                                                                          | 3.5 kB  00:00:00     
extras                                                                                                                                                                                    | 2.9 kB  00:00:00     
updates                                                                                                                                                                                   | 2.9 kB  00:00:00     
updates/7/x86_64/primary_db                                                                                                                                                               | 6.5 MB  00:00:01     
pkgsack time: 4.825
检测 erlang-23.3-2.el7.x86_64 提供的依赖或文件
无须任何处理

# 检查安装成功
[root@centos7 rabbitmq]# erl -v
Erlang/OTP 23 [erts-11.2] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe]

说明:

rpm命令:https://www.linuxcool.com/rpm

yum 命令:https://www.linuxcool.com/yum

安装socat

安装RabbitMQ过程中要依赖一个插件socat,所以先安装socat

[root@centos7 rabbitmq]# yum install -y socat
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.ustc.edu.cn
 * extras: mirrors.ustc.edu.cn
 * updates: mirrors.aliyun.com
正在解决依赖关系
--> 正在检查事务
---> 软件包 socat.x86_64.0.1.7.3.2-2.el7 将被 安装
--> 解决依赖关系完成

依赖关系解决

=================================================================================================================================================================================================================
 Package                                         架构                                             版本                                                      源                                              大小
=================================================================================================================================================================================================================
正在安装:
 socat                                           x86_64                                           1.7.3.2-2.el7                                             base                                           290 k

事务概要
=================================================================================================================================================================================================================
安装  1 软件包

总下载量:290 k
安装大小:1.1 M
Downloading packages:
socat-1.7.3.2-2.el7.x86_64.rpm                                                                                                                                                            | 290 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
警告:RPM 数据库已被非 yum 程序修改。
  正在安装    : socat-1.7.3.2-2.el7.x86_64                                                                                                                                                                   1/1 
  验证中      : socat-1.7.3.2-2.el7.x86_64                                                                                                                                                                   1/1 

已安装:
  socat.x86_64 0:1.7.3.2-2.el7                                                                                                                                                                                   

完毕!

安装RabbitMQ

这里使用本地上传的安装包安装:

[root@centos7 rabbitmq]# rpm -Uvh rabbitmq-server-3.8.14-1.el7.noarch.rpm 
警告:rabbitmq-server-3.8.14-1.el7.noarch.rpm: 头V4 RSA/SHA256 Signature, 密钥 ID 6026dfca: NOKEY
准备中...                          ### [100%]
正在升级/安装...
   1:rabbitmq-server-3.8.14-1.el7     ### [100%]

[root@centos7 rabbitmq]# yum install rabbitmq-server
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.ustc.edu.cn
 * extras: mirrors.ustc.edu.cn
 * updates: mirrors.aliyun.com
无须任何处理

启动服务

#启动服务,停止用:systemctl start rabbitmq-server
[root@centos7 rabbitmq]# systemctl start rabbitmq-server

# 查看服务状态
[root@centos7 rabbitmq]# 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 日 2021-03-28 23:24:25 CST; 29s ago
 Main PID: 11372 (beam.smp)
   Status: "Initialized"
    Tasks: 28
   Memory: 75.1M
   CGroup: /system.slice/rabbitmq-server.service
           ├─11372 /usr/lib64/erlang/erts-11.2/bin/beam.smp -W w -MBas ageffcbf -MHas ageffcbf -MBlmbcs 512 -MHlmbcs 512 -MMmcs 30 -P 1048576 -t 5000000 -stbt db -zdbbl 128000 -sbwt none -sbwtdcpu none -sbw...
           ├─11388 erl_child_setup 32768
           ├─11415 /usr/lib64/erlang/erts-11.2/bin/epmd -daemon
           ├─11440 inet_gethost 4
           └─11486 inet_gethost 4

3月 28 23:23:36 centos7.6 rabbitmq-server[11372]: ####  Licensed under the MPL 2.0. Website: https://rabbitmq.com
3月 28 23:23:36 centos7.6 rabbitmq-server[11372]: Doc guides: https://rabbitmq.com/documentation.html
3月 28 23:23:36 centos7.6 rabbitmq-server[11372]: Support:    https://rabbitmq.com/contact.html
3月 28 23:23:36 centos7.6 rabbitmq-server[11372]: Tutorials:  https://rabbitmq.com/getstarted.html
3月 28 23:23:36 centos7.6 rabbitmq-server[11372]: Monitoring: https://rabbitmq.com/monitoring.html
3月 28 23:23:36 centos7.6 rabbitmq-server[11372]: Logs: /var/log/rabbitmq/rabbit@centos7.log
3月 28 23:23:36 centos7.6 rabbitmq-server[11372]: /var/log/rabbitmq/rabbit@centos7_upgrade.log
3月 28 23:23:36 centos7.6 rabbitmq-server[11372]: Config file(s): (none)
3月 28 23:24:25 centos7.6 rabbitmq-server[11372]: Starting broker... completed with 0 plugins.
3月 28 23:24:25 centos7.6 systemd[1]: Started RabbitMQ broker.

#开启启动服务
[root@centos7 rabbitmq]# systemctl enable rabbitmq-server
Created symlink from /etc/systemd/system/multi-user.target.wants/rabbitmq-server.service to /usr/lib/systemd/system/rabbitmq-server.service.

作者:easy5
来源链接:https://www.cnblogs.com/easy5weikai/p/16217820.html

版权声明:
1、JavaClub(https://www.javaclub.cn)以学习交流为目的,由作者投稿、网友推荐和小编整理收藏优秀的IT技术及相关内容,包括但不限于文字、图片、音频、视频、软件、程序等,其均来自互联网,本站不享有版权,版权归原作者所有。

2、本站提供的内容仅用于个人学习、研究或欣赏,以及其他非商业性或非盈利性用途,但同时应遵守著作权法及其他相关法律的规定,不得侵犯相关权利人及本网站的合法权利。
3、本网站内容原作者如不愿意在本网站刊登内容,请及时通知本站(javaclubcn@163.com),我们将第一时间核实后及时予以删除。


本文链接:https://www.javaclub.cn/server/68349.html

分享给朋友:

“RabbitMQ 之 安装” 的相关文章

中间件RabbitMQ

中间件RabbitMQ

一、前言 RabbitMQ在Windows上安装非常简单,就跟日常安装应用聊天软件一样,因此这里选择Linux环境安装RabbitMQ,并且借助Docker容器进行安装,在使用Docker安装RabbitMQ之前,我们先简单的了解一下几个概念:什么...

RabbitMQ(三) 微服务 RabbitMQ 入门案例

RabbitMQ(三) 微服务 RabbitMQ 入门案例

一、创建案例项目  打开 https://start.spring.io/  ,在“Dependencies”中搜索RabbitMQ和web,生成spring-boot项目 点击生成按钮,即下载了一个包含RabbitMQ的项目。...

CentOS7 RabbitMQ 安装

CentOS7 RabbitMQ 安装

1.包的选择 安装RabbitMQ之前需要安装Erlang,这里注意安装的版本的对应关系,详见官网 版本对应,大致为  在这里我选择的是: erlang-23.3.4-1.el7.x86_64.rpm rabbitmq-serv...

RabbitMQ理解

RabbitMQ理解

RabbitMQ 1.什么是MQ MQ:(Message Queue)消息队列 对列:(Queue)简单的说 就是一种数据结构 先进先出 (Redis list) 消息队列:简单的说就是用来进行消息传输的 消...

rabbitmq面试题

rabbit面试题 1.什么是rabbitmq 采用AMQP高级消息队列协议的一种消息队列技术,最大的特点就是消费并不需要确保提供方存在,实现了服务之间的高度解耦 2.为什么要使用rabbitmq 1.在分布式系统下具备异步,削峰...

RabbitMQ安装教程

RabbitMQ安装教程

前言    之前安装的时候参考了一篇博客,成功的安装上了,但是没有记录自己安装过程,又在一个虚拟机上重新安装了一遍,记录自己的安装过程,方便自己以后参考。 步骤   Rabbitmq是用erlang语言写的,所以我们需要安装Erla...

【SpringBoot学习11】springboot整合rabbitMQ

【SpringBoot学习11】springboot整合rabbitMQ

文章目录 1. 相关软件安装 1.1 Erlang安装 1.2 rabbitMQ安装 2. 整合ra...

Linux卸载RabbitMQ

一、卸载rabbitmq相关的 1、卸载前先停掉rabbitmq服务,执行命令          service rabbitmq-server stop 2、查看rabbitmq安装的相关列表...

Windows环境快速搭建RabbitMq

Windows环境快速搭建RabbitMq

(1)下载 下载Erlang:https://github.com/erlang/otp/releases/download/OTP-24.2/otp_win64_24.2.exe 下载RabbitMq:https://github.com/rabbit...

RabbitMQ必须了解的概念

RabbitMQ必须了解的概念

本文转载自RabbitMq入门以及使用教程 一、简介 MQ全称为Message Queue, 消息队列(MQ)是一种应用程序对应用程序的通信方法。应用程序通过读写出入队列的消息(针对应用程序的数据)来通信,而无需专用连接来链接它们。消息传递...

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。