RabbitMQ的安装及集群搭建方法

1 安装erlang
下载地址:
博主这里采用的是otp_src_19.1.tar.gz (200MB+)

[root@hidden util]# tar zxvf otp_src_19.1.tar.gz [root@hidden util]# cd otp_src_19.1 [root@hidden otp_src_19.1]# ./configure --prefix=/opt/erlang [root@hidden otp_src_19.1]# make [root@hidden otp_src_19.1]# make install

修改/etc/profile文件,添加下面的环境变量:

ERLANG_HOME=/opt/erlang export PATH=$PATH:$ERLANG_HOME/bin export ERLANG_HOME

最后执行source /etc/profile让文件生效。

2 安装simpleJson
下载地址:https://pypi.python.org/pypi/simplejson/
博主这里采用的是simplejson-3.10.0.tar.gz

[root@hidden util]# tar zxvf simplejson-3.10.0.tar.gz [root@hidden util]# cd simplejson-3.10.0 [root@hidden simplejson-3.10.0]# Python setup.py install

3 安装rabbitmq
下载地址:
博主这里用的版本就有很多了,比如2.7.0, 3.4.0, 3.4.1, 3.4.2, 3.4.3, 3.5.7, 3.6.0等等,不过都是用的rabbitmq-server-generic-unix-..*.tar.gz的版本。
这里以3.5.7举例:

[root@hidden util]# tar zvxf rabbitmq-server-generic-unix-3.5.7.tar.gz -C /opt [root@hidden util]# cd /opt [root@hidden util]# mv rabbitmq_server-3.5.7 rabbitmq

修改/etc/profile文件,添加下面的环境变量:

export PATH=$PATH:/opt/rabbitmq/sbin

最后执行source /etc/profile让文件生效。
运行:rabbitmq-server -detached
之后运行rabbitmqctl status查看rabbitmq是否正常启动:

[root@zhuzhonghua2-fqawb rabbitmq]# rabbitmqctl status Status of node 'rabbit@zhuzhonghua2-fqawb' ... [{pid,25020}, {running_applications, [{rabbitmq_management,"RabbitMQ Management Console","3.5.7"}, {rabbitmq_management_agent,"RabbitMQ Management Agent","3.5.7"}, {rabbit,"RabbitMQ","3.5.7"}, {mnesia,"MNESIA CXC 138 12","4.14.1"}, {rabbitmq_web_dispatch,"RabbitMQ Web Dispatcher","3.5.7"}, {webmachine,"webmachine","1.10.3-rmq3.5.7-gite9359c7"}, {mochiweb,"MochiMedia Web Server","2.7.0-rmq3.5.7-git680dba8"}, {os_mon,"CPO CXC 138 46","2.4.1"}, {amqp_client,"RabbitMQ AMQP Client","3.5.7"}, {inets,"INETS CXC 138 49","6.3.3"}, {xmerl,"XML parser","1.3.12"}, {sasl,"SASL CXC 138 11","3.0.1"}, {stdlib,"ERTS CXC 138 10","3.1"}, {kernel,"ERTS CXC 138 10","5.1"}]}, {os,{unix,linux}}, {erlang_version, "Erlang/OTP 19 [erts-8.1] [source] [64-bit] [smp:4:4] [async-threads:64] [hipe] [kernel-poll:true]\n"}, {memory, [{total,60110136}, {connection_readers,0}, {connection_writers,0}, {connection_channels,0}, {connection_other,5664}, {queue_procs,1028160}, {queue_slave_procs,1576056}, {plugins,8008840}, {other_proc,6115560}, {mnesia,197760}, {mgmt_db,14219256}, {msg_index,58288}, {other_ets,1181200}, {binary,633896}, {code,17650127}, {atom,711593}, {other_system,8723736}]}, {alarms,[]}, {listeners,[{clustering,25672,"::"},{amqp,5672,"::"}]}, {vm_memory_high_watermark,0.4}, {vm_memory_limit,3301929779}, {disk_free_limit,50000000}, {disk_free,35754786816}, {file_descriptors, [{total_limit,924},{total_used,6},{sockets_limit,829},{sockets_used,1}]}, {processes,[{limit,1048576},{used,195}]}, {run_queue,0}, {uptime,139660}]

RabbitMQ集群搭建方法

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/36112d31bad81773ee9ab8544232ce05.html