我刚刚设置了 CentOS 6.3 的全新 VMWare 安装。互联网正在运行,一切似乎都可以正常运行。
我正在尝试使用 RabbitMQ,但我被困在他们教程的第 1 步:
http://www.rabbitmq.com/tutorials/tutorial-one-python.html
基本上,我:
- 设置 Linux 实例
- 安装了 RabbitMQ 的所有依赖项,例如 erlang/esel
- 尝试他们的 Hello World 教程
它实际上在这一行失败了:
import pika
pika.BlockingConnection()
我收到此错误:
> 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
我正在尝试我所有的故障排除尝试,我有点期待其他人也有同样的问题并发布了它。哦,好吧,我猜我是第一个!
无论如何,在这一点上,我认为我没有接触过 RabbitMQ 库,所以这可能只是一个 Pika 问题。
以下是我从 Wireshark 看到的,专注于 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
我可以从wireshark提供更多信息,请告诉我