赞
踩
一、下载安装包
RabbitMq需要erlang配合,所以需要安装Rabbitmq-server和erlang
wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.5.0/rabbitmq-server-3.5.0-1.noarch.rpm
wget http://www.rabbitmq.com/releases/erlang/erlang-19.0.4-1.el7.centos.x86_64.rpm
如果未安装erlang则安装rabbitmq的时候会提示:
erlang >= R16B-03 被 rabbitmq-server-3.6.6-1.el7.noarch 需要
二、安装
- rpm -ivh erlang-19.04-1.e17.centos.x86_64.rpm
-
- rpm -ivh rabbitmq-server-3.5.0-1.noarch.rpm
提示:socat 被 rabbitmq-server-3.6.6-1.el7.noarch 需要
用yum 来自动安装rabbitmq 因为它能解析依赖关系
yum install rabbitmq-server-3.6.6-1.el7.noarch.rpm
- 正在解决依赖关系
- --> 正在检查事务
- ---> 软件包 rabbitmq-server.noarch.0.3.6.6-1.el7 将被 安装
- --> 正在处理依赖关系 socat,它被软件包 rabbitmq-server-3.6.6-1.el7.noarch 需要
- Loading mirror speeds from cached hostfile
- * base: mirrors.163.com
- * extras: mirrors.163.com
- * updates: mirrors.163.com
- --> 正在检查事务
- ---> 软件包 socat.x86_64.0.1.7.2.2-5.el7 将被 安装
- --> 解决依赖关系完成
-
- 依赖关系解决
这里就自动安装了socat
三、检查安装
rabbitmqctl -q status
- {pid,28842},
- {running_applications,[{rabbit,"RabbitMQ","3.6.6"},
- {rabbit_common,[],"3.6.6"},
- {os_mon,"CPO CXC 138 46","2.4.1"},
- {mnesia,"MNESIA CXC 138 12","4.14"},
- {ranch,"Socket acceptor pool for TCP protocols.",
- "1.2.1"},
- {xmerl,"XML parser","1.3.11"},
- {sasl,"SASL CXC 138 11","3.0"},
- {stdlib,"ERTS CXC 138 10","3.0.1"},
- {kernel,"ERTS CXC 138 10","5.0.1"}]},
- {os,{unix,linux}},
- {erlang_version,"Erlang/OTP 19 [erts-8.0.3] [source] [64-bit] [smp:8:8] [async-threads:128] [hipe] [kernel-poll:true]\n"},
- {memory,[{total,43903536},
- {connection_readers,0},
- {connection_writers,0},
- {connection_channels,0},
- {connection_other,0},
- {queue_procs,2832},
- {queue_slave_procs,0},
- {plugins,0},
- {other_proc,13512328},
- {mnesia,60376},
- {mgmt_db,0},
- {msg_index,51984},
- {other_ets,952272},
- {binary,13800},
- {code,17680793},
- {atom,752561},
- {other_system,10876590}]},
- {alarms,[]},
- {listeners,[{clustering,25672,"::"},{amqp,5672,"::"}]},
- {vm_memory_high_watermark,0.4},
- {vm_memory_limit,1191454310},
- {disk_free_limit,50000000},
- {disk_free,9430753280},
- {file_descriptors,[{total_limit,924},
- {total_used,2},
- {sockets_limit,829},
- {sockets_used,0}]},
- {processes,[{limit,1048576},{used,144}]},
- {run_queue,0},
- {uptime,1116},
- {kernel,{net_ticktime,60}}]
四、打开和关闭服务
打开服务:
service rabbitmq-server start
Redirecting to /bin/systemctl start rabbitmq-server.service
关闭服务:
# service rabbitmq-server stop
Redirecting to /bin/systemctl stop rabbitmq-server.service
查看所有队列信息
# rabbitmqctl list_queues
关闭应用
# rabbitmqctl stop_app
启动应用,和上述关闭命令配合使用,达到清空队列的目的
# rabbitmqctl start_app
清除所有队列
# rabbitmqctl reset
更多用法及参数,可以执行如下命令查看
# rabbitmqctl查看所有队列信息
# rabbitmqctl list_queues
关闭应用
# rabbitmqctl stop_app
启动应用,和上述关闭命令配合使用,达到清空队列的目的
# rabbitmqctl start_app
清除所有队列
# rabbitmqctl reset
更多用法及参数,可以执行如下命令查看
# rabbitmqctl查看所有队列信息
# rabbitmqctl list_queues
关闭应用
# rabbitmqctl stop_app
启动应用,和上述关闭命令配合使用,达到清空队列的目的
# rabbitmqctl start_app
清除所有队列
# rabbitmqctl reset
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。