[rabbitmq-discuss] Cannot start cluster?
simon at rabbitmq.com
Sat Jan 15 11:41:47 GMT 2011
On 14/01/2011 7:38PM, Brian Parkinson wrote:
> Hello - starting to play with clustering - I am using Rabbit 2.2.0 on
> Running one server (either by 'rabbit-server' or 'rabbit-multi
> start_all 1') works fine. Trying to start a cluster with 2 nodes
> fails - see output below.
> 1. Any ideas?
Hi Brian. If I had to guess I would say this is because you've got the
management plugin installed. rabbitmq-multi assigns sequential AMQP
listening ports for the nodes it starts, but it doesn't know anything
about the port opened by rabbitmq_mochiweb (or any other ports the nodes
might be configured to open - SSL, STOMP etc).
I think you'll want to start the nodes without using rabbitmq-multi,
just with multiple invocations of rabbitmq-server, using environment
variables to configure each node differently. I use a script like:
RABBITMQ_NODE_PORT=$1 RABBITMQ_NODENAME=$2 \
RABBITMQ_SERVER_START_ARGS="-rabbit_mochiweb port 5$1" \
and then invoke it as
start-node.sh 5672 rabbit
start-node.sh 5673 hare
etc. Note that this will start RabbitMQ in the foreground.
Note that neither rabbitmq-multi nor this approach will actually cluster
the nodes; you'll need something like:
rabbitmqctl cluster rabbit at hostname hare at hostname
to form a cluster.
> 2. A quick question/confirmation about a cluster. Assume I have a
2-node cluster running, and my client app connects via a
ConnectionFactory pointing at host/port of node1. If node1 then goes
down, will my client app continue to talk to node2?
No, I'm afraid you need to handle reconnection yourself.
More information about the rabbitmq-discuss