gpt4 book ai didi

linux - RabbitMQ Shovel 无法启动

转载 作者:太空宇宙 更新时间:2023-11-04 09:50:56 27 4
gpt4 key购买 nike

我有两台运行带有 rabbitmq 消息队列的 arch linux 的计算机,我想使用铲子将消息从第一台计算机上的队列移动到第二台计算机上的队列。不幸的是,我似乎无法创建铲子,甚至无法验证是否正在读取我的 rabbitmq.config 文件。

计算机 1 的 ip 地址为 192.168.6.66

/etc/rabbitmq/rabbitmq-env.conf

NODENAME=bunny
NODE_IP_ADDRESS=192.168.6.66
NODE_PORT=5672

LOG_BASE=/var/log/rabbitmq
MNESIA_BASE=/var/lib/rabbitmq/mnesia
RABBITMQ_PLUGINS_DIR=/usr/lib/rabbitmq/lib/rabbitmq_server-2.7.1/plugins

/etc/rabbitmq/rabbitmq.conf

[   {mnesia, [{dump_log_write_threshold, 100}]},
{bunny, [{vm_memory_high_watermark, 0.3}]},
{rabbitmq_shovel,
[{shovels,
[{test_shovel,
[{sources, [{broker, "amqp://shoveluser:shoveluser@192.168.6.64:5672/"}]},
{destinations, [{broker, ""}]},
{queue, <<"observation2">>}
]
}]

}]
}
].

计算机 2 的 ip 地址为 192.168.6.64

/etc/rabbitmq/rabbitmq-env.conf

NODENAME=bunny
NODE_IP_ADDRESS=0.0.0.0
NODE_PORT=5672

LOG_BASE=/var/log/rabbitmq
MNESIA_BASE=/var/lib/rabbitmq/mnesia
RABBITMQ_PLUGINS_DIR=/usr/lib/rabbitmq/lib/rabbitmq_server-2.7.1/plugins

当我在计算机 1 上重新启动 rabbitmq-server 时,这是输出:

[root@test_toshiba ~]# /etc/rc.d/rabbitmq-server restart
:: Stopping rabbitmq-server daemon [BUSY] Stopping and halting node bunny@localhost ...
...done.
[DONE]
:: Starting rabbitmq-server daemon [BUSY] Activating RabbitMQ plugins ...

********************************************************************************
********************************************************************************

9 plugins activated:
* amqp_client-2.7.1
* erlando-2.7.1
* mochiweb-1.3-rmq2.7.1-git
* rabbitmq_management-2.7.1
* rabbitmq_management_agent-2.7.1
* rabbitmq_mochiweb-2.7.1
* rabbitmq_shovel-2.7.1
* rabbitmq_shovel_management-2.7.1
* webmachine-1.7.0-rmq2.7.1-hg

根据配置文件文档的描述,我希望看到这个“配置文件:/etc/rabbitmq/rabbitmq.config”here

在 rabbitmq-server 启动后,我运行这个命令,但没有看到铲子:

[root@test_toshiba ~]# rabbitmqctl eval 'rabbit_shovel_status:status().'
[]
...done.

这里是rabbitmq的状态

[root@test_toshiba ~]# rabbitmqctl status
Status of node bunny@localhost ...
[{pid,14225},
{running_applications,
[{rabbitmq_shovel,"Data Shovel for RabbitMQ","2.7.1"},
{erlando,"Syntax extensions for Erlang","2.7.1"},
{rabbitmq_shovel_management,"Shovel Status","2.7.1"},
{rabbitmq_management,"RabbitMQ Management Console","2.7.1"},
{rabbitmq_management_agent,"RabbitMQ Management Agent","2.7.1"},
{amqp_client,"RabbitMQ AMQP Client","2.7.1"},
{rabbit,"RabbitMQ","2.7.1"},
{os_mon,"CPO CXC 138 46","2.2.9"},
{sasl,"SASL CXC 138 11","2.2.1"},
{rabbitmq_mochiweb,"RabbitMQ Mochiweb Embedding","2.7.1"},
{webmachine,"webmachine","1.7.0-rmq2.7.1-hg"},
{mochiweb,"MochiMedia Web Server","1.3-rmq2.7.1-git"},
{inets,"INETS CXC 138 49","5.9"},
{mnesia,"MNESIA CXC 138 12","4.7"},
{stdlib,"ERTS CXC 138 10","1.18.1"},
{kernel,"ERTS CXC 138 10","2.15.1"}]},
{os,{unix,linux}},
{erlang_version,
"Erlang R15B01 (erts-5.9.1) [source] [smp:4:4] [async-threads:30] [hipe] [kernel-poll:true]\n"},
{memory,
[{total,18530752},
{processes,6813815},
{processes_used,6813800},
{system,11716937},
{atom,428361},
{atom_used,414658},
{binary,182176},
{code,8197217},
{ets,911776}]},
{vm_memory_high_watermark,0.39999999942574066},
{vm_memory_limit,417929625}]
...done.

/var/log/rabbitmq 中的日志中没有任何错误消息。

我如何验证我的配置文件正在被使用,为什么我的铲子不启动?

最佳答案

您需要为铲子定义一个目的地。

    [   {mnesia, [{dump_log_write_threshold, 100}]},        {bunny, [{vm_memory_high_watermark, 0.3}]},        {rabbitmq_shovel,            [{shovels,                [{test_shovel,                    [{sources, [{broker, "amqp://shoveluser:shoveluser@192.168.6.64:5672/"}]},                     {destinations, [{broker, "amqp://shoveluser:shoveluser@192.168.6.66:5672/"}]},                     {queue, >}                    ]                }]            }]        }    ].

关于linux - RabbitMQ Shovel 无法启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11217902/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com