[rabbitmq-discuss] Publishing to or consuming from a node that's mirroring queues fails

Urie, Ethan eurie at rosettastone.com
Wed Jan 25 14:45:31 GMT 2012


Hi all,
I'm attempting to set up a 2-node cluster with mirrored queues. I've tried it twice with different machines and have seen the same result.

My first attempt was with 2 Macs running 10.6.8 and Rabbit 2.7.1 with Erlang R15B.

I was able to successfully cluster the two machines, and verified that the queues were mirrored via the admin and rabbitmqctl. 

In my test, I had one exchange (fanout) with one queue that was declared with x-ha-policy = all. The exchange and queue were declared by a consumer connecting to node 1 after the nodes were clustered and both were running. 

Publishing and consuming work fine when connecting to node 1. However, if I connect to node 2, published messages don't show up in the queue and I get no error messages on the publisher or the logs. 

Connecting a consumer to node 2, however, causes the connection to error out. The following shows up in the logs:

=ERROR REPORT==== 25-Jan-2012::09:10:48 ===
** Generic server <0.29257.1> terminating
** Last message in was {'$gen_cast',
                          {method,
                              {'queue.declare',0,<<"RaiderAgent">>,false,
                                  true,false,false,false,
                                  [{<<"x-ha-policy">>,longstr,<<"all">>}]},
                              none}}
** When Server state == {ch,running,rabbit_framing_amqp_0_9_1,1,<0.29253.1>,
                           <0.29255.1>,<0.29253.1>,
                           {token,<0.29256.1>,false},
                           none,1,
                           {[],[]},
                           {[],[]},
                           [],
                           {user,<<"sappy_development">>,[],
                               rabbit_auth_backend_internal,
                               {internal_user,<<"sappy_development">>,
                                   <<45,57,22,84,184,35,204,58,106,148,26,227,
                                     153,72,42,191,26,208,27,25>>,
                                   []}},
                           <<"/sappy_development">>,<<>>,
                           {dict,0,16,16,8,80,48,
                               {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],
                                []},
                               {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],
                                 [],[]}}},
                           {dict,0,16,16,8,80,48,
                               {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],
                                []},
                               {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],
                                 [],[]}}},
                           {set,0,16,16,8,80,48,
                               {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],
                                []},
                               {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],
                                 [],[]}}},
                           {dict,0,16,16,8,80,48,
                               {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],
                                []},
                               {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],
                                 [],[]}}},
                           <0.29251.1>,
                           {state,fine,5000,#Ref<0.0.0.38570>},
                           false,1,
                           {0,nil},
                           {0,nil},
                           [],[],none}
** Reason for termination == 
** {{case_clause,badarg},
   [{rabbit_channel,handle_method,3},
    {rabbit_channel,handle_cast,2},
    {gen_server2,handle_msg,2},
    {proc_lib,init_p_do_apply,3}]}

=ERROR REPORT==== 25-Jan-2012::09:10:48 ===
connection <0.29253.1>, channel 1 - error:
{{case_clause,badarg},
[{rabbit_channel,handle_method,3},
 {rabbit_channel,handle_cast,2},
 {gen_server2,handle_msg,2},
 {proc_lib,init_p_do_apply,3}]}

=WARNING REPORT==== 25-Jan-2012::09:10:48 ===
Non-AMQP exit reason '{{case_clause,badarg},
                      [{rabbit_channel,handle_method,3},
                       {rabbit_channel,handle_cast,2},
                       {gen_server2,handle_msg,2},
                       {proc_lib,init_p_do_apply,3}]}'


If I have messages in the queue, and stop rabbit on node 1, consumers can connect and consume fine from node 2.

My understanding of how the clustering is meant to work with mirroring is that a consumer may consume from a queue regardless of what node "owns" it and a producer may publish to any node in the cluster and the messages get routed to the proper queues. Is this understanding wrong? Or do I have something wrong in my set up?


Thanks in advance,
Ethan



More information about the rabbitmq-discuss mailing list