[rabbitmq-discuss] Bug(?) in stopping multiple instances of rabbitmq-server
Matthias Radestock
matthias at lshift.net
Wed Oct 22 07:14:29 BST 2008
Terry Jones wrote:
> I can then stop it via *either*
>
> NODE_PORT=22222 ./rabbitmq-multi stop_all
> or
> ./rabbitmq-multi stop_all
>
> I'm not sure how it knows how to stop itself when I don't tell it the port
> number. That's presumably logged somewhere.
rabbitmq-multi records the names of the nodes it has started. That's
enough for Erlang to be able to subsequently connect to them.
> # ./rabbitmq-multi start_all 1
> Starting all nodes...
> [snip]
>
> # NODENAME=fred NODE_PORT=30000 ./rabbitmq-multi start_all 1
> Starting all nodes...
> [snip]
That's a usage of rabbitmq-multi we hadn't thought of :)
rabbitmq-multi is designed to control *one set of* multiple nodes named
NODENAME, NODENAME_1, ..., NODENAME_{N-1}, at ports NODE_PORT,
NODE_PORT+1, ..., NODE_PORT+{N-1}.
The important bit here is the "one set". What you are doing above is
create *two* sets of nodes. The way rabbitmq-multi currently works, the
record of node names for the second set will overwrite the first. That
leads to the behaviour you saw:
> # NODENAME=fred NODE_PORT=30000 ./rabbitmq-multi stop_all
> Stopping all nodes...
> [snip]
>
> # ./rabbitmq-multi stop_all
> Stopping all nodes...
>
> rabbit_multi action stop_all failed:
> no_nodes_running
When the second set of nodes was started the first set of nodes will
have been forgotten.
Btw, there is no need to specify NODENAME etc in anything other than the
start_all call.
For starting a several nodes with unrelated names and ports I recommend
using the rabbitmq-server script, rather than rabbitmq-multi. You can
stop the nodes individually with rabbitmqctl.
Regards,
Matthias
More information about the rabbitmq-discuss
mailing list