二、各节点安装rabbitmq
安装非常简单,只需几步搞定:
1. 安装epel源
rpm -ivh http://download.Fedoraproject.org/pub/epel/6/x86_64/epel-release-6-7.noarch.rpm
wget -O /etc/yum.repos.d/epel-erlang.repo http://repos.fedorapeople.org/repos/peter/erlang/epel-erlang.repo
2. 安装erlang
yum install erlang xmlto git -y
rpm --import http://www.rabbitmq.com/rabbitmq-signing-key-public.asc
3. 安装rabbitmq
可以选择用yum安装,也可以选择下载rpm包安装,也可以用源码编译安装!
本文选择rpm包安装:
wget http://www.rabbitmq.com/releases/rabbitmq-server/v2.8.6/rabbitmq-server-2.8.6.noarch.rpm
rpm -ivh rabbitmq-server-2.8.6.noarch.rpm
4. 启动各节点rabbitmq,并验证启动情况
[root@mq136 ~]# rabbitmq-server --detached &
[root@mq136 ~]# ps aux |grep rabbitmq
rabbitmq 1394 0.0 0.0 10828 540 ? S Oct08 0:11 /usr/lib64/erlang/erts-5.8.5/bin/epmd -daemon
root 2483 0.0 0.0 103244 836 pts/1 S+ 17:40 0:00 grep rabbitmq
rabbitmq 5657 6.3 1.9 2224044 157200 ? Sl Oct08 959:17 /usr/lib64/erlang/erts-5.8.5/bin/beam.smp -W w -K true -A30 -P 1048576 -- -root /usr/lib64/erlang -progname erl -- -home /var/lib/rabbitmq -- -noshell -noinput -sname rabbit@mq136 -boot /var/lib/rabbitmq/mnesia/rabbit@mq136-plugins-expand/rabbit -kernel inet_default_connect_options [{nodelay,true}] -sasl errlog_type error -sasl sasl_error_logger false -rabbit error_logger {file,"/var/log/rabbitmq/rabbit@mq136.log"} -rabbit sasl_error_logger {file,"/var/log/rabbitmq/rabbit@mq136-sasl.log"} -os_mon start_cpu_sup false -os_mon start_disksup false -os_mon start_memsup false -mnesia dir "/var/lib/rabbitmq/mnesia/rabbit@mq136" -noshell -noinput
rabbitmq 5698 0.0 0.0 10788 520 ? Ss Oct08 0:00 inet_gethost 4
rabbitmq 5699 0.0 0.0 12892 692 ? S Oct08 0:00 inet_gethost 4
rabbitmq 11446 0.0 0.0 12892 680 ? S Oct13 0:00 inet_gethost 4
[root@mq136 ~]# lsof -i:5672
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
beam.smp 5657 rabbitmq 18u IPv4 5879364 0t0 TCP *:amqp (LISTEN)