0
votes

I have a pair of computers running arch linux with rabbitmq message queues and I want to use a shovel to move messages from the queue on the first computer to the queue on the second. Unfortunately I can't seem to create a shovel, or even verify that my rabbitmq.config file is being read.

Computer 1 has an ip address of 192.168.6.66

/etc/rabbitmq/rabbitmq-env.conf

NODENAME=bunny
NODE_IP_ADDRESS=192.168.6.66
NODE_PORT=5672

LOG_BASE=/var/log/rabbitmq
MNESIA_BASE=/var/lib/rabbitmq/mnesia
RABBITMQ_PLUGINS_DIR=/usr/lib/rabbitmq/lib/rabbitmq_server-2.7.1/plugins

/etc/rabbitmq/rabbitmq.conf

[   {mnesia, [{dump_log_write_threshold, 100}]},
    {bunny, [{vm_memory_high_watermark, 0.3}]},
    {rabbitmq_shovel,
        [{shovels,
            [{test_shovel,
                [{sources, [{broker, "amqp://shoveluser:[email protected]:5672/"}]},
                 {destinations, [{broker, ""}]},
                 {queue, <<"observation2">>}
                ]
            }]

        }]
    }
].

Computer 2 has an ip address of 192.168.6.64

/etc/rabbitmq/rabbitmq-env.conf

NODENAME=bunny
NODE_IP_ADDRESS=0.0.0.0
NODE_PORT=5672

LOG_BASE=/var/log/rabbitmq
MNESIA_BASE=/var/lib/rabbitmq/mnesia
RABBITMQ_PLUGINS_DIR=/usr/lib/rabbitmq/lib/rabbitmq_server-2.7.1/plugins

When I restart the rabbitmq-server on computer 1 this is the output:

[root@test_toshiba ~]# /etc/rc.d/rabbitmq-server restart
:: Stopping rabbitmq-server daemon                                                                                                                            [BUSY] Stopping and halting node bunny@localhost ...
...done.
                                                                                                                                                              [DONE]
:: Starting rabbitmq-server daemon                                                                                                                            [BUSY] Activating RabbitMQ plugins ...

********************************************************************************
********************************************************************************

9 plugins activated:
* amqp_client-2.7.1
* erlando-2.7.1
* mochiweb-1.3-rmq2.7.1-git
* rabbitmq_management-2.7.1
* rabbitmq_management_agent-2.7.1
* rabbitmq_mochiweb-2.7.1
* rabbitmq_shovel-2.7.1
* rabbitmq_shovel_management-2.7.1
* webmachine-1.7.0-rmq2.7.1-hg

I expected to see this "config file(s) : /etc/rabbitmq/rabbitmq.config" given the description of the config file documentation here

And after the rabbitmq-server has started I run this command and don't see a shovel:

[root@test_toshiba ~]# rabbitmqctl eval 'rabbit_shovel_status:status().'
[]
...done.

Here is the rabbitmq status

[root@test_toshiba ~]# rabbitmqctl status
Status of node bunny@localhost ...
[{pid,14225},
 {running_applications,
     [{rabbitmq_shovel,"Data Shovel for RabbitMQ","2.7.1"},
      {erlando,"Syntax extensions for Erlang","2.7.1"},
      {rabbitmq_shovel_management,"Shovel Status","2.7.1"},
      {rabbitmq_management,"RabbitMQ Management Console","2.7.1"},
      {rabbitmq_management_agent,"RabbitMQ Management Agent","2.7.1"},
      {amqp_client,"RabbitMQ AMQP Client","2.7.1"},
      {rabbit,"RabbitMQ","2.7.1"},
      {os_mon,"CPO  CXC 138 46","2.2.9"},
      {sasl,"SASL  CXC 138 11","2.2.1"},
      {rabbitmq_mochiweb,"RabbitMQ Mochiweb Embedding","2.7.1"},
      {webmachine,"webmachine","1.7.0-rmq2.7.1-hg"},
      {mochiweb,"MochiMedia Web Server","1.3-rmq2.7.1-git"},
      {inets,"INETS  CXC 138 49","5.9"},
      {mnesia,"MNESIA  CXC 138 12","4.7"},
      {stdlib,"ERTS  CXC 138 10","1.18.1"},
      {kernel,"ERTS  CXC 138 10","2.15.1"}]},
 {os,{unix,linux}},
 {erlang_version,
     "Erlang R15B01 (erts-5.9.1) [source] [smp:4:4] [async-threads:30] [hipe] [kernel-poll:true]\n"},
 {memory,
     [{total,18530752},
      {processes,6813815},
      {processes_used,6813800},
      {system,11716937},
      {atom,428361},
      {atom_used,414658},
      {binary,182176},
      {code,8197217},
      {ets,911776}]},
 {vm_memory_high_watermark,0.39999999942574066},
 {vm_memory_limit,417929625}]
...done.

The logs at /var/log/rabbitmq didn't have any error messages in them.

How can I verify that my config file is being used, and why won't my shovel start?

2

2 Answers

2
votes

You need to define a destination for the shovel.


    [   {mnesia, [{dump_log_write_threshold, 100}]},
        {bunny, [{vm_memory_high_watermark, 0.3}]},
        {rabbitmq_shovel,
            [{shovels,
                [{test_shovel,
                    [{sources, [{broker, "amqp://shoveluser:[email protected]:5672/"}]},
                     {destinations, [{broker, "amqp://shoveluser:[email protected]:5672/"}]},
                     {queue, >}
                    ]
                }]

            }]
        }
    ].

0
votes

I think that "" is not sufficient to specify the localhost broker (in the 'destinations') term. I believe that "amqp://" is required instead.

So, your destinations term should read:

{destinations, [{broker, "amqp://"}]}

Specifying the local broker's username and hostname (the other answer) may also work, but I don't think that's necessary.