我正在尝试使用 cli rabbitmqadmin 连接到远程 rabbitmq 主机。
我要执行的命令是:
rabbitmqadmin --host=$RABBITMQ_HOST --port=443 --ssl --vhost=$RABBITMQ_VHOST --username=$RABBITMQ_USERNAME --password=$RABBITMQ_PASSWORD list queues
在您问之前:环境变量 RABBITMQ_HOST、RABBITMQ_VHOST 等已设置...我已经检查了两次和三次。
我回来的错误是:
Traceback (most recent call last):
File "/usr/local/sbin/rabbitmqadmin", line 1007, in <module>
main()
File "/usr/local/sbin/rabbitmqadmin", line 413, in main
method()
File "/usr/local/sbin/rabbitmqadmin", line 588, in invoke_list
format_list(self.get(uri), cols, obj_info, self.options)
File "/usr/local/sbin/rabbitmqadmin", line 436, in get
return self.http("GET", "%s/api%s" % (self.options.path_prefix, path), "")
File "/usr/local/sbin/rabbitmqadmin", line 475, in http
self.options.port)
File "/usr/local/sbin/rabbitmqadmin", line 451, in __initialize_https_connection
context = self.__initialize_tls_context())
File "/usr/local/sbin/rabbitmqadmin", line 467, in __initialize_tls_context
self.options.ssl_key_file)
TypeError: coercing to Unicode: need string or buffer, NoneType found
从最后一行我假设这是一个与 python 相关的问题,我当前的 python 版本是 2.7.12,如果我尝试连接到 rabbitmq 的本地实例
rabbitmqadmin list queues
一切正常。非常感谢任何帮助谢谢:)