我在 Pika 给出超时错误时遇到问题。 相同的代码(如下)在其他环境中运行良好,但在此环境中失败。
connection = pika.BlockingConnection(pika.ConnectionParameters(host=host))
兔子状态
[{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 日志,您可能需要提供登录凭据:
pika.BlockingConnection(pika.ConnectionParameters(host, port=port, virtual_host=vhost, credentials=pika.credentials.PlainCredentials(username, password)))