我使用的是 RabbitMQ 3.7.5。
我创建了一个以rabbitmq用户身份运行rabbitmq的docker镜像。 但我无法运行rabbitmq-plugins。 bash-4.2$rabbitmq-插件列表
Usage:
rabbitmq-plugins [-n <node>] [-l] [-q] <command> [<command options>]
.......
<timeout> - operation timeout in seconds. Default is "infinity".
Only root or rabbitmq can run rabbitmq-plugins
bash-4.2$ id
uid=10000(rabbitmq) gid=10000(rabbitmq) groups=10000(rabbitmq),1(bin)
bash-4.2$rabbitmqctl cluster_status
Cluster status of node rabbit@zt-crmq-0 ...
[{nodes,[{disc,['rabbit@zt-crmq-0','rabbit@zt-crmq-1','rabbit@zt-crmq-2']}]},
{running_nodes,['rabbit@zt-crmq-2','rabbit@zt-crmq-1','rabbit@zt-crmq-0']},
{cluster_name,<<"<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="0b796a6969627f4b717f266879667a263b25717f266879667a256f6e6d6a7e677f25787d682568677e787f6e79256764686a67" rel="noreferrer noopener nofollow">[email protected]</a>">>},
{partitions,[]},
{alarms,[{'rabbit@zt-crmq-2',[]},
{'rabbit@zt-crmq-1',[]},
{'rabbit@zt-crmq-0',[]}]}]
对于/usr/sbin/rabbitm-plugins:
main() {
ensure_we_are_in_a_readable_dir
if current_user_is_rabbitmq && calling_rabbitmq_server
then
exec_rabbitmq_server "$@"
elif current_user_is_rabbitmq && ! calling_rabbitmq_plugins
then
exec_script_as_rabbitmq "$@"
elif current_user_is_root && calling_rabbitmq_plugins
then
exec_script_as_rabbitmq "$@"
elif current_user_is_root
then
exec_script_as_root "$@"
else
run_script_help_and_fail
fi
}
为什么判断不以rabbitmq用户身份运行rabbitmq_plugins?
任何帮助将不胜感激。
B.R, 涛
最佳答案
main()
中的 if 语句确实不让我们跑rabbitmq-plugins
来自rabbitmq
用户。不确定这是预期的还是只是一个错误,但您可以
完全绕过脚本:
$ /usr/lib/rabbitmq/bin/rabbitmq-plugins list | grep hash
[E*] rabbitmq_consistent_hash_exchange 3.8.4
关于rabbitmq-plugins 无法以rabbitmq 用户身份运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51470848/