E.S.
E.S.

Reputation: 2841

Pika/RabbitMQ Connection Problems - Running VMWare CentOS 6.3

I just set up a fresh VMWare install of CentOS 6.3. The internet is working and everything seems functional on it.

I am trying to experiment with RabbitMQ but I am getting stuck at step 1 of their tutorial:

http://www.rabbitmq.com/tutorials/tutorial-one-python.html

Basically, I:

  1. Set up the Linux instance
  2. Installed all the dependencies for RabbitMQ such as erlang/esel
  3. Trying their Hello World tutorial

It is failing actually at this line:

import pika
pika.BlockingConnection()

I get this error:

> Traceback (most recent call last):   File "<stdin>", line 1, in
> <module>   File
> "/usr/lib/python2.6/site-packages/pika/adapters/blocking_connection.py",
> line 33, in __init__
>     BaseConnection.__init__(self, parameters, None, reconnection_strategy)   File
> "/usr/lib/python2.6/site-packages/pika/adapters/base_connection.py",
> line 50, in __init__
>     reconnection_strategy)   File "/usr/lib/python2.6/site-packages/pika/connection.py", line 170, in
> __init__
>     self._connect()   File "/usr/lib/python2.6/site-packages/pika/connection.py", line 228, in
> _connect
>     self.parameters.port or  spec.PORT)   File "/usr/lib/python2.6/site-packages/pika/adapters/blocking_connection.py",
> line 37, in _adapter_connect
>     BaseConnection._adapter_connect(self, host, port)   File "/usr/lib/python2.6/site-packages/pika/adapters/base_connection.py",
> line 58, in _adapter_connect
>     self.socket.connect((host, port))   File "<string>", line 1, in connect socket.error: 
[Errno 111] Connection refused

I'm coming up try with all my trouble shooting attempts, I sort of expected someone else to have had this same problem too and posted about it. Oh well, guess I am the first!

Anyway, at this point, I don't think I've touched the RabbitMQ libraries so this may just be a Pika issue.

Here is what I see comeing from Wireshark, focused on 127.0.0.1:

1   0.000000    127.0.0.1   127.0.0.1   TCP 58748 > amqp [SYN] Seq=0 Win=32792 Len=0 MSS=16396 TSV=41371814 TSER=0 WS=6
2   0.000079    127.0.0.1   127.0.0.1   TCP amqp > 58748 [RST, ACK] Seq=1 Ack=1 Win=0 Len=0

I can supply more info from wireshark, just let me know

Upvotes: 2

Views: 2453

Answers (1)

hyperthunk
hyperthunk

Reputation: 151

The [RST, ACK] sequence looks like a rejected connection, but might be misleading. I am assuming that after installation the rabbitmq service started up correctly and that you can run rabbitmqctl status and get back a sensible result? If its not running then you might need to /sbin/service rabbitmq-server start first.

Assuming you've got the broker running, the next thing I would suggest is opening up the RabbitMQ logs - if you're not sure about the location then consult the relevant documentation - to see if the connection is being allowed. If the connection isn't logged (and you've not modified the log levels) then what you're seeing might be some other software (such as a firewall, iptables, etc) preventing connectivity.

Upvotes: 3

Related Questions