RabbitMQ 的CLI管理工具 rabbitmqadmin(5)

2021-11-25 22:38:12 浏览数 (1)

下载安装 RabbitMQ

代码语言:javascript复制
[root@h102 rabbitmq]# wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.6.1/rabbitmq-server-3.6.1-1.noarch.rpm
--2016-04-18 16:41:08--  http://www.rabbitmq.com/releases/rabbitmq-server/v3.6.1/rabbitmq-server-3.6.1-1.noarch.rpm
Resolving www.rabbitmq.com... 192.240.153.117
Connecting to www.rabbitmq.com|192.240.153.117|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5088884 (4.9M) [application/x-redhat-package-manager]
Saving to: “rabbitmq-server-3.6.1-1.noarch.rpm”

100%[===================================================================================================>] 5,088,884    270K/s   in 16s     

2016-04-18 16:41:24 (320 KB/s) - “rabbitmq-server-3.6.1-1.noarch.rpm” saved [5088884/5088884]

[root@h102 rabbitmq]#
[root@h102 rabbitmq]# rpm -ivh rabbitmq-server-3.6.1-1.noarch.rpm 
warning: rabbitmq-server-3.6.1-1.noarch.rpm: Header V4 DSA/SHA1 Signature, key ID 056e8e56: NOKEY
Preparing...                ########################################### [100%]
   1:rabbitmq-server        ########################################### [100%]
[root@h102 rabbitmq]# 

Note: rabbitmq-server-3.6.1 需要 >= R16B-03 的 Erlang 的支持,否则会有如下报错

代码语言:javascript复制
[root@h102 rabbitmq]# rpm -ivh rabbitmq-server-3.6.1-1.noarch.rpm 
warning: rabbitmq-server-3.6.1-1.noarch.rpm: Header V4 DSA/SHA1 Signature, key ID 056e8e56: NOKEY
error: Failed dependencies:
	erlang >= R16B-03 is needed by rabbitmq-server-3.6.1-1.noarch
[root@h102 rabbitmq]#

启动服务

rabbitmqadmin 是由 rabbitmq_management 插件提供的,得启用此插件

首先启动服务

代码语言:javascript复制
[root@h102 rabbitmq]# /etc/init.d/rabbitmq-server start 
Starting rabbitmq-server: SUCCESS
rabbitmq-server.
[root@h102 rabbitmq]# 

查看端口

代码语言:javascript复制
[root@h102 rabbitmq]# ps faux | grep -i rabbitmq | grep -v grep 
rabbitmq  4703  0.0  0.0  10832   412 ?        S    15:08   0:00 /usr/lib64/erlang/erts-5.8.5/bin/epmd -daemon
root     32636  0.0  0.0 106364  1200 pts/0    S    17:29   0:00 /bin/sh /etc/init.d/rabbitmq-server start
root     32653  0.0  0.0 106096  1248 pts/0    S    17:29   0:00  _ /bin/bash -c ulimit -S -c 0 >/dev/null 2>&1 ; /usr/sbin/rabbitmq-server
root     32654  0.0  0.0 106096  1308 pts/0    S    17:29   0:00      _ /bin/sh /usr/sbin/rabbitmq-server
root     32662  0.0  0.1 163856  2168 pts/0    S    17:29   0:00          _ su rabbitmq -s /bin/sh -c /usr/lib/rabbitmq/bin/rabbitmq-server 
rabbitmq 32678  0.0  0.0 106100  1424 ?        Ss   17:29   0:00              _ /bin/sh -e /usr/lib/rabbitmq/bin/rabbitmq-server
rabbitmq 32893  0.7  3.8 1243180 73308 ?       Sl   17:29   0:49                  _ /usr/lib64/erlang/erts-7.3/bin/beam.smp -W w -A 64 -P 1048576 -K true -B i -- -root /usr/lib64/erlang -progname erl -- -home /var/lib/rabbitmq -- -pa /usr/lib/rabbitmq/lib/rabbitmq_server-3.6.1/ebin -noshell -noinput -s rabbit boot -sname rabbit@h102 -boot start_sasl -kernel inet_default_connect_options [{nodelay,true}] -sasl errlog_type error -sasl sasl_error_logger false -rabbit error_logger {file,"/var/log/rabbitmq/rabbit@h102.log"} -rabbit sasl_error_logger {file,"/var/log/rabbitmq/rabbit@h102-sasl.log"} -rabbit enabled_plugins_file "/etc/rabbitmq/enabled_plugins" -rabbit plugins_dir "/usr/lib/rabbitmq/lib/rabbitmq_server-3.6.1/plugins" -rabbit plugins_expand_dir "/var/lib/rabbitmq/mnesia/rabbit@h102-plugins-expand" -os_mon start_cpu_sup false -os_mon start_disksup false -os_mon start_memsup false -mnesia dir "/var/lib/rabbitmq/mnesia/rabbit@h102" -kernel inet_dist_listen_min 25672 -kernel inet_dist_listen_max 25672
rabbitmq 32976  0.0  0.0  10796   512 ?        Ss   17:29   0:00                      _ inet_gethost 4
rabbitmq 32977  0.0  0.0  12900   676 ?        S    17:29   0:00                          _ inet_gethost 4
[root@h102 rabbitmq]# netstat  -an | grep -E "(4369|25672|5672|5671|15672|61613|61614|1883|8883)"
tcp        0      0 0.0.0.0:4369                0.0.0.0:*                   LISTEN      
tcp        0      0 0.0.0.0:25672               0.0.0.0:*                   LISTEN      
tcp        0      0 127.0.0.1:40720             127.0.0.1:4369              ESTABLISHED 
tcp        0      0 192.168.100.102:4369        192.168.100.102:44969       TIME_WAIT   
tcp        0      0 127.0.0.1:4369              127.0.0.1:40720             ESTABLISHED 
tcp        0      0 :::5672                     :::*                        LISTEN      
[root@h102 rabbitmq]# 

0 人点赞