rabbitmq 二进制安装

时间:2021-04-19 10:28:56
# wget -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# ls
epel-release-6-8.noarch.rpm # rpm -ivh epel-release-6-8.noarch.rpm
warning: epel-release-6-8.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Preparing... ########################################### [100%]
1:epel-release ########################################### [100%]
# cd /etc/yum.repos.d/ ;ls
CentOS-Base.repo CentOS-fasttrack.repo CentOS-Vault.repo epel-testing.repo
CentOS-Debuginfo.repo CentOS-Media.repo epel.repo
# wget -c http://mirrors.163.com/.help/CentOS6-Base-163.repo
# ls
CentOS6-Base-163.repo CentOS-Debuginfo.repo CentOS-Media.repo epel.repo
CentOS-Base.repo CentOS-fasttrack.repo CentOS-Vault.repo epel-testing.repo
# yum clean all && yum makecache
# yum install rabbitmq-server # erl
Erlang R14B04 (erts-5.8.5) [source] [64-bit] [rq:1] [async-threads:0] [kernel-poll:false] Eshell V5.8.5 (abort with ^G)
1>
BREAK: (a)bort (c)ontinue (p)roc info (i)nfo (l)oaded
(v)ersion (k)ill (D)b-tables (d)istribution
#ctrl + c #退出 # cd /usr/lib/rabbitmq/ && ls
bin lib # ls bin/
rabbitmqctl rabbitmq-defaults rabbitmq-env rabbitmq-plugins rabbitmq-server

查看插件表:

# ./bin/rabbitmq-plugins list
[ ] amqp_client 3.1.5
[ ] cowboy 0.5.0-rmq3.1.5-git4b93c2d
[ ] eldap 3.1.5-gite309de4
[ ] mochiweb 2.7.0-rmq3.1.5-git680dba8
[ ] rabbitmq_amqp1_0 3.1.5
[ ] rabbitmq_auth_backend_ldap 3.1.5
[ ] rabbitmq_auth_mechanism_ssl 3.1.5
[ ] rabbitmq_consistent_hash_exchange 3.1.5
[ ] rabbitmq_federation 3.1.5
[ ] rabbitmq_federation_management 3.1.5
[ ] rabbitmq_jsonrpc 3.1.5
[ ] rabbitmq_jsonrpc_channel 3.1.5
[ ] rabbitmq_jsonrpc_channel_examples 3.1.5
[ ] rabbitmq_management 3.1.5
[ ] rabbitmq_management_agent 3.1.5
[ ] rabbitmq_management_visualiser 3.1.5
[ ] rabbitmq_mqtt 3.1.5
[ ] rabbitmq_shovel 3.1.5
[ ] rabbitmq_shovel_management 3.1.5
[ ] rabbitmq_stomp 3.1.5
[ ] rabbitmq_tracing 3.1.5
[ ] rabbitmq_web_dispatch 3.1.5
[ ] rabbitmq_web_stomp 3.1.5
[ ] rabbitmq_web_stomp_examples 3.1.5
[ ] rfc4627_jsonrpc 3.1.5-git5e67120
[ ] sockjs 0.3.4-rmq3.1.5-git3132eb9
[ ] webmachine 1.10.3-rmq3.1.5-gite9359c7

启动WEB插件

# ./bin/rabbitmq-plugins enable rabbitmq_management
The following plugins have been enabled:
mochiweb
webmachine
rabbitmq_web_dispatch
amqp_client
rabbitmq_management_agent
rabbitmq_management
Plugin configuration has changed. Restart RabbitMQ for changes to take effect.

启动服务

# /etc/init.d/rabbitmq-server start

查看状态

# /etc/init.d/rabbitmq-server status
Status of node rabbit@xxxx ...
[{pid,1687},
{running_applications,
[{rabbitmq_management,"RabbitMQ Management Console","3.1.5"},
{rabbitmq_web_dispatch,"RabbitMQ Web Dispatcher","3.1.5"},
{webmachine,"webmachine","1.10.3-rmq3.1.5-gite9359c7"},
{mochiweb,"MochiMedia Web Server","2.7.0-rmq3.1.5-git680dba8"},
{rabbitmq_management_agent,"RabbitMQ Management Agent","3.1.5"},
{rabbit,"RabbitMQ","3.1.5"},
{mnesia,"MNESIA CXC 138 12","4.5"},
{os_mon,"CPO CXC 138 46","2.2.7"},
{inets,"INETS CXC 138 49","5.7.1"},
{xmerl,"XML parser","1.2.10"},
{amqp_client,"RabbitMQ AMQP Client","3.1.5"},
{sasl,"SASL CXC 138 11","2.1.10"},
{stdlib,"ERTS CXC 138 10","1.17.5"},
{kernel,"ERTS CXC 138 10","2.14.5"}]},
{os,{unix,linux}},
{erlang_version,
"Erlang R14B04 (erts-5.8.5) [source] [64-bit] [rq:1] [async-threads:30] [kernel-poll:true]\n"},
{memory,
[{total,30449784},
{connection_procs,5296},
{queue_procs,5296},
{plugins,172024},
{other_proc,9156840},
{mnesia,57392},
{mgmt_db,47032},
{msg_index,23904},
{other_ets,1047080},
{binary,2048},
{code,17075518},
{atom,1548833},
{other_system,1308521}]},
{vm_memory_high_watermark,0.4},
{vm_memory_limit,411294105},
{disk_free_limit,1000000000},
{disk_free,16201068544},
{file_descriptors,
[{total_limit,924},{total_used,3},{sockets_limit,829},{sockets_used,1}]},
{processes,[{limit,1048576},{used,191}]},
{run_queue,0},
{uptime,66}]
...done.

查看端口

# netstat -tlnp|grep beam
tcp 0 0 0.0.0.0:34067 0.0.0.0:* LISTEN 1687/beam
tcp 0 0 0.0.0.0:15672 0.0.0.0:* LISTEN 1687/beam
tcp 0 0 0.0.0.0:55672 0.0.0.0:* LISTEN 1687/beam
tcp 0 0 :::5672 :::* LISTEN 1687/beam

http://10.100.0.115:15672/

注意防火墙一定要关了或反端口打开

查看队列:
# rabbitmqctl list_queues
Listing queues ...
...done.
查看用户表
# rabbitmqctl list_users
Listing users ...
guest [administrator]
...done.
增加用户,给用户角色,修改用户密码
# rabbitmqctl add_user admin admin@test
Creating user "admin" ...
...done.
# rabbitmqctl set_user_tags admin administrator
Setting tags for user "admin" to [administrator] ...
...done.
# rabbitmqctl change_password admin admin@test
Changing password for user "admin" ...
...done.