RabbitMQ 的 Pika 超时问题
Posted
技术标签:
【中文标题】RabbitMQ 的 Pika 超时问题【英文标题】:Pika timeout issue with RabbitMQ 【发布时间】:2012-09-28 10:51:38 【问题描述】:我遇到了 Pika 出现超时错误的问题。相同的代码(如下)在其他环境中运行良好,但在这个环境中失败。
connection = pika.BlockingConnection(pika.ConnectionParameters(host=host))
rabbitmqctl 状态
[pid,30059,
running_applications,[rabbit,"RabbitMQ","2.8.2",
os_mon,"CPO CXC 138 46","2.2.4",
sasl,"SASL CXC 138 11","2.1.8",
mnesia,"MNESIA CXC 138 12","4.4.12",
stdlib,"ERTS CXC 138 10","1.16.4",
kernel,"ERTS CXC 138 10","2.13.4"],
os,unix,linux,
erlang_version,"Erlang R13B03 (erts-5.7.4) [source] [64-bit] [smp:8:8] [rq:8] [async-threads:30] [hipe] [kernel-poll:true]\n",
memory,[total,76031440,
processes,57368952,
processes_used,57354128,
system,18662488,
atom,1119593,
atom_used,1112833,
binary,205008,
code,12015821,
ets,1407392],
vm_memory_high_watermark,0.39999999993657753,
vm_memory_limit,5045529804,
disk_free_limit,12613824512,
disk_free,10839289856,
file_descriptors,[total_limit,924,
total_used,837,
sockets_limit,829,
sockets_used,829],
processes,[limit,1048576,used,6763],
run_queue,0,
uptime,3298]
...done.
以前有人打过这个吗?我假设这是一个rabbitmq配置问题
【问题讨论】:
这里是超时问题的解决方案。 ***.com/questions/16163308/…[1]:***.com/questions/16163308/… 【参考方案1】:查看 RabbitMQ 日志,您可能需要提供登录凭据:
pika.BlockingConnection(pika.ConnectionParameters(host, port=port, virtual_host=vhost, credentials=pika.credentials.PlainCredentials(username, password)))
【讨论】:
以上是关于RabbitMQ 的 Pika 超时问题的主要内容,如果未能解决你的问题,请参考以下文章