6

RabbitMQ starts up just fine, but the shovel plugin status is listed as "starting".

I'm using the following rabbitmq.config:

Each broker is running on a separate AWS instance. The remote server is windows 2008 server, the local server is Amazon Linux.

[{rabbitmq_shovel,
  [{shovels,
    [{scrape_request_shovel,
      [{sources,      [{broker,"amqp://test_user:test_password@localhost"}]},
       {destinations, [{broker, "amqp://test_user:test_password@ec2-###-##-###-###.compute-1.amazonaws.com"}]},
       {queue, <<"scp_request">>},
       {ack_mode, on_confirm},
       {publish_properties, [{delivery_mode, 2}]},
       {publish_fields, [{exchange, <<"">>},
                         {routing_key, <<"scp_request">>}]},
       {reconnect_delay, 5}
       ]}
      ]
   }]
}].

Running the following command:

sudo rabbitmqctl eval 'rabbit_shovel_status:status().'

returns:

[{scrape_request_shovel,starting,{{2012,7,11},{23,38,47}}}]

According to This question, this can result if the users haven't been set up correctly on the two brokers. However, I've double-checked that I've set up the users correctly via rabbitmqctl user_add on both machines -- have even tried it with a different set of users, to be sure.

I also ran an nmap scan of port 5672 on the remote host to verify is was up and running on that port.

UPDATE Problem isn't solved but this does appear to be a result of connection problems with the remote server. I changed "reconnect_delay" to 0 in my config file, to avoid having shovel infinitely re-try the connection. Highly recommend others with this problem do this as well, as it allows you to get error messages out of rabbit_shovel_status. In my case I got the following error:

[{scrape_request_shovel,
    {terminated,
        {{badmatch,{error,access_refused}},
         [{rabbit_shovel_worker,make_conn_and_chan,1},
          {rabbit_shovel_worker,handle_cast,2},
          {gen_server2,handle_msg,2},
          {proc_lib,init_p_do_apply,3}]}},
    {{2012,7,12},{0,4,37}}}]
4

1 回答 1

7

在这里回答我自己的问题,以防其他人遇到这个问题。这个错误(如果你得到它也是一个超时错误,{{badmatch,{error,etimedout}}, ),几乎可以肯定是两台机器之间的通信问题,很可能是由于端口访问/防火墙设置。

我在这里做了几件愚蠢的事情:

1) 为我的远程 EC2 实例使用了错误的 DNS(D'oh!真的很愚蠢 - 无法告诉你我花了多长时间将头撞在墙上......)。请记住,如果您没有与实例关联的弹性 IP,停止和启动您的实例会生成一个新的 DNS。

2)我的远程实例是一个windows服务器,我意识到你必须在windows防火墙和EC2安全组中打开端口5672——这里有两个重叠的访问控制级别,在EC2管理中打开端口如果您的机器是 EC2 上的 windows 服务器,控制台是不够的,因为您还必须配置 windows 服务器防火墙。

于 2012-07-13T20:24:59.873 回答