在同一个OS中运行多个RabbitMQ node主要要满足以下两个条件:
[root@h101 ~]# rabbitmqctl status
Status of node rabbit@h101 ...
Error: unable to connect to node rabbit@h101: nodedown
DIAGNOSTICS
===========
attempted to contact: [rabbit@h101]
rabbit@h101:
* connected to epmd (port 4369) on h101
* epmd reports: node 'rabbit' not running at all
no other nodes on h101
* suggestion: start the node
current node details:
- node name: 'rabbitmq-cli-2840@h101'
- home dir: /var/lib/rabbitmq
- cookie hash: FkPvQU6k3zuamsY9Ow+9Og==
[root@h101 ~]#
[root@h101 ~]# free -m
total used free shared buffers cached
Mem: 3824 659 3165 0 20 84
-/+ buffers/cache: 553 3271
Swap: 3999 0 3999
[root@h101 ~]#
使用不同名字,不同端口,分别从后台启动两个服务进程
[root@h101 ~]# RABBITMQ_NODE_PORT=5672 RABBITMQ_NODENAME=rabbit rabbitmq-server -detached
Warning: PID file not written; -detached was passed.
[root@h101 ~]# ps faux | grep mq
root 3054 0.0 0.0 103252 828 pts/0 S+ 14:21 0:00 \_ grep mq
rabbitmq 2888 0.0 0.0 10828 468 ? S 14:14 0:00 /usr/lib64/erlang/erts-5.8.5/bin/epmd -daemon
rabbitmq 2975 22.7 0.8 1088040 33292 ? Sl 14:21 0:02 /usr/lib64/erlang/erts-5.8.5/bin/beam.smp -W w -A 64 -P 1048576 -K erlang -progname erl -- -home /var/lib/rabbitmq -- -pa /usr/lib/rabbitmq/lib/rabbitmq_server-3.5.6/sbin/../ebin -noshell -noinput -st -boot start_sasl -kernel inet_default_connect_options [{nodelay,true}] -rabbit tcp_listeners [{"auto",5672}] -sasl errlog_type errr false -rabbit error_logger {file,"/var/log/rabbitmq/rabbit.log"} -rabbit sasl_error_logger {file,"/var/log/rabbitmq/rabbit-sasl.lons_file "/etc/rabbitmq/enabled_plugins" -rabbit plugins_dir "/usr/lib/rabbitmq/lib/rabbitmq_server-3.5.6/sbin/../plugins" -rabbit plb/rabbitmq/mnesia/rabbit-plugins-expand" -os_mon start_cpu_sup false -os_mon start_disksup false -os_mon start_memsup false -mnesia esia/rabbit" -kernel inet_dist_listen_min 25672 -kernel inet_dist_listen_max 25672 -noshell -noinput
rabbitmq 3050 0.0 0.0 10792 508 ? Ss 14:21 0:00 \_ inet_gethost 4
rabbitmq 3051 0.0 0.0 12896 648 ? S 14:21 0:00 \_ inet_gethost 4
[root@h101 ~]# RABBITMQ_NODE_PORT=5673 RABBITMQ_NODENAME=hare rabbitmq-server -detached
Warning: PID file not written; -detached was passed.
[root@h101 ~]# ps faux | grep mq
root 3196 0.0 0.0 103252 824 pts/0 S+ 14:22 0:00 \_ grep mq
rabbitmq 2888 0.0 0.0 10828 468 ? S 14:14 0:00 /usr/lib64/erlang/erts-5.8.5/bin/epmd -daemon
rabbitmq 2975 8.6 0.8 1088040 33292 ? Sl 14:21 0:02 /usr/lib64/erlang/erts-5.8.5/bin/beam.smp -W w -A 64 -P 1048576 -K erlang -progname erl -- -home /var/lib/rabbitmq -- -pa /usr/lib/rabbitmq/lib/rabbitmq_server-3.5.6/sbin/../ebin -noshell -noinput -st -boot start_sasl -kernel inet_default_connect_options [{nodelay,true}] -rabbit tcp_listeners [{"auto",5672}] -sasl errlog_type errr false -rabbit error_logger {file,"/var/log/rabbitmq/rabbit.log"} -rabbit sasl_error_logger {file,"/var/log/rabbitmq/rabbit-sasl.lons_file "/etc/rabbitmq/enabled_plugins" -rabbit plugins_dir "/usr/lib/rabbitmq/lib/rabbitmq_server-3.5.6/sbin/../plugins" -rabbit plb/rabbitmq/mnesia/rabbit-plugins-expand" -os_mon start_cpu_sup false -os_mon start_disksup false -os_mon start_memsup false -mnesia esia/rabbit" -kernel inet_dist_listen_min 25672 -kernel inet_dist_listen_max 25672 -noshell -noinput
rabbitmq 3050 0.0 0.0 10792 508 ? Ss 14:21 0:00 \_ inet_gethost 4
rabbitmq 3051 0.0 0.0 12896 648 ? S 14:21 0:00 \_ inet_gethost 4
rabbitmq 3116 29.8 0.8 1087524 33684 ? Sl 14:21 0:01 /usr/lib64/erlang/erts-5.8.5/bin/beam.smp -W w -A 64 -P 1048576 -K erlang -progname erl -- -home /var/lib/rabbitmq -- -pa /usr/lib/rabbitmq/lib/rabbitmq_server-3.5.6/sbin/../ebin -noshell -noinput -s-boot start_sasl -kernel inet_default_connect_options [{nodelay,true}] -rabbit tcp_listeners [{"auto",5673}] -sasl errlog_type errorfalse -rabbit error_logger {file,"/var/log/rabbitmq/hare.log"} -rabbit sasl_error_logger {file,"/var/log/rabbitmq/hare-sasl.log"} -re "/etc/rabbitmq/enabled_plugins" -rabbit plugins_dir "/usr/lib/rabbitmq/lib/rabbitmq_server-3.5.6/sbin/../plugins" -rabbit plugins_itmq/mnesia/hare-plugins-expand" -os_mon start_cpu_sup false -os_mon start_disksup false -os_mon start_memsup false -mnesia dir "/vae" -kernel inet_dist_listen_min 25673 -kernel inet_dist_listen_max 25673 -noshell -noinput
rabbitmq 3191 0.0 0.0 10792 508 ? Ss 14:21 0:00 \_ inet_gethost 4
rabbitmq 3192 0.0 0.0 12896 648 ? S 14:21 0:00 \_ inet_gethost 4
[root@h101 ~]#
本文系转载,前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。
本文系转载,前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。