Hi,
We are trying to run two or more completely independent RabbitMQ nodes on the same machine, the only things will be/could be shared will be RabbitMQ binaries (e.g.rabbitmq-server, rabbitmqctl ), we tried to achieve this using environment variables in start up scripts as follows.
Node 1
-----------------
export RABBITMQ_NODE_PORT=5672
export RABBITMQ_NODENAME=rabbit1
export RABBITMQ_SERVER_START_ARGS="-rabbitmq_management listener [{port,15672}]"
export RABBITMQ_LOG_BASE=/var/log/rabbitmq1
Node 2
-----------------
export RABBITMQ_NODE_PORT=5673
export RABBITMQ_NODENAME=rabbit2
export RABBITMQ_SERVER_START_ARGS="-rabbitmq_management listener [{port,15673}]"
export RABBITMQ_LOG_BASE=/var/log/rabbitmq2
The setup is working fine for me.
/usr/sbin/rabbitmqctl -n [node_name] status
I believe even plugins directory can be changed by setting "RABBITMQ_PLUGINS_DIR" - then only resource which is shared between two node is erlang cookie - which resides in /var/lib/rabbitmq/ (I see RABBITMQ_BASE can help me in changing this location - but is available only in Windows).
I've two doubts here.
1. How safe it is to run two nodes of RabbitMQ independently on same server - please note they are not in cluster mode. Each node is going to serve its own requests independently.
2. Is it possible to change location of erlang cookie - if not, is it safe if two nodes (not in cluster) are using same erlang cookie.
It would be really helpful if someone can guide me on this.
Thanks in advance.
- Meghanand