首页 > 代码库 > CentOS 7 安装RabbitMQ 3.3

CentOS 7 安装RabbitMQ 3.3

1、安装erlang 语言环境

安装依赖文件

#yum install ncurses-devel

进入 http://www.erlang.org/download.html 选择源文件下载

wget http://www.erlang.org/download/ otp_src_17.1.tar.gz
tar zxvf  otp_src_17.1.tar.gz
cd  otp_src_17.1    阅读HOTO/INSTALL.md文件 
#./configure   #make && make install 

安装完成以后,执行erl看是否能打开eshell,用’halt().’退出,注意后面的点号,那是erlang的结束符。

[root@localhost src]# erl
Erlang/OTP 17 [erts-6.1] [source] [64-bit] [async-threads:10] [hipe] [kernel-poll:false]

Eshell V6.1  (abort with ^G)
2> 9+3.
12
3> halt().

2、安装RabbitMQ
     安装依赖文件:

yum install xmlto
进入http://www.rabbitmq.com/download.html选择最新的源码包

#wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.3.4/rabbitmq-server-3.3.4.tar.gz

#tar zxvf rabbitmq-server-3.3.4.tar.gz

#cd rabbitmq-server-3.3.4

#make TARGET_DIR=/usr/rabbitmq SBIN_DIR=/usr/rabbitmq/sbin MAN_DIR=/usr/rabbitmq/man DOC_INSTALL_DIR=/usr/rabbitmq/doc

#make TARGET_DIR=/usr/rabbitmq SBIN_DIR=/usr/rabbitmq/sbin MAN_DIR=/usr/rabbitmq/man DOC_INSTALL_DIR=/usr/rabbitmq/doc  install

3、启动rabbitmq-server

运行rabbitmq:

# /usr/rabbitmq/sbin/rabbitmq-server  -detached

查看rabbitmq状态:

# /usr/rabbitmq/sbin/rabbitmqctl status

关闭rabbitmq:

# /usr/rabbitmq/sbin/rabbitmqctl stop

4、查看RabbitMQ服务启动的状态,并开启RabbitMQ的相应管理插件

[root@localhost sbin]# ./rabbitmqctl status
Status of node rabbit@localhost ...
[{pid,35112},
{running_applications,[{rabbit,"RabbitMQ","3.3.4"},
                        {os_mon,"CPO  CXC 138 46","2.2.15"},
                        {xmerl,"XML parser","1.3.7"},
                        {mnesia,"MNESIA  CXC 138 12","4.12.1"},
                        {sasl,"SASL  CXC 138 11","2.4"},
                        {stdlib,"ERTS  CXC 138 10","2.1"},
                        {kernel,"ERTS  CXC 138 10","3.0.1"}]},
{os,{unix,linux}},
{erlang_version,"Erlang/OTP 17 [erts-6.1] [source] [64-bit] [async-threads:30] [hipe] [kernel-poll:true]\n"},
{memory,[{total,35218336},
          {connection_procs,2728},
          {queue_procs,5456},
          {plugins,0},
          {other_proc,13339072},
          {mnesia,57552},
          {mgmt_db,0},
          {msg_index,33968},
          {other_ets,708832},
          {binary,30112},
          {code,16881166},
          {atom,654217},
          {other_system,3505233}]},
{alarms,[]},
{listeners,[{clustering,25672,"::"},{amqp,5672,"::"}]},
{vm_memory_high_watermark,0.4},
{vm_memory_limit,769332019},
{disk_free_limit,50000000},
{disk_free,45550653440},
{file_descriptors,[{total_limit,924},
                    {total_used,3},
                    {sockets_limit,829},
                    {sockets_used,1}]},
{processes,[{limit,1048576},{used,124}]},
{run_queue,0},
{uptime,2182}]
...done.
[root@localhost sbin]# ./rabbitmq-plugins list
[ ] amqp_client                       3.3.4
[ ] cowboy                            0.5.0-rmq3.3.4-git4b93c2d
[ ] eldap                             3.3.4-gite309de4
[ ] mochiweb                          2.7.0-rmq3.3.4-git680dba8
[ ] rabbitmq_amqp1_0                  3.3.4
[ ] rabbitmq_auth_backend_ldap        3.3.4
[ ] rabbitmq_auth_mechanism_ssl       3.3.4
[ ] rabbitmq_consistent_hash_exchange 3.3.4
[ ] rabbitmq_federation               3.3.4
[ ] rabbitmq_federation_management    3.3.4
[ ] rabbitmq_management               3.3.4
[ ] rabbitmq_management_agent         3.3.4
[ ] rabbitmq_management_visualiser    3.3.4
[ ] rabbitmq_mqtt                     3.3.4
[ ] rabbitmq_shovel                   3.3.4
[ ] rabbitmq_shovel_management        3.3.4
[ ] rabbitmq_stomp                    3.3.4
[ ] rabbitmq_test                     3.3.4
[ ] rabbitmq_tracing                  3.3.4
[ ] rabbitmq_web_dispatch             3.3.4
[ ] rabbitmq_web_stomp                3.3.4
[ ] rabbitmq_web_stomp_examples       3.3.4
[ ] sockjs                            0.3.4-rmq3.3.4-git3132eb9
[ ] webmachine                        1.10.3-rmq3.3.4-gite9359c7
[root@localhost sbin]#
运行如下的命令,增加用户admin,密码admin

[root@localhost sbin]# ./rabbitmqctl add_user admin admin
Creating user "admin" ...
...done.
[root@localhost sbin]# ./rabbitmqctl set_user_tags admin administraotr
Setting tags for user "admin" to [administraotr] ...
...done.
[root@localhost sbin]# ./rabbitmqctl list_users
Listing users ...
admin   [administraotr]
guest   [administrator]
...done.

NET下RabbitMQ实践[配置篇]

NET下RabbitMQ实践[示例篇]

NET下RabbitMQ实践[WCF发布篇]

NET下RabbitMQ实践[实战篇] 

RabbitMQ C# Tutorial