问题描述
我有两台运行带有rabbitmq消息队列的arch linux的计算机,我想用铁锹将消息从第一台计算机上的队列移动到第二台计算机上的队列.不幸的是,我似乎无法创建铲子,甚至无法验证我的rabbitmq.config文件已被读取.
I have a pair of computers running arch linux with rabbitmq message queues and I want to use a shovel to move messages from the queue on the first computer to the queue on the second. Unfortunately I can't seem to create a shovel, or even verify that my rabbitmq.config file is being read.
计算机1的IP地址为192.168.6.66
Computer 1 has an ip address of 192.168.6.66
/etc/rabbitmq/rabbitmq-env.conf
/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
/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:[email protected]:5672/"}]},
{destinations, [{broker, ""}]},
{queue, <<"observation2">>}
]
}]
}]
}
].
计算机2的IP地址为192.168.6.64
Computer 2 has an ip address of 192.168.6.64
/etc/rabbitmq/rabbitmq-env.conf
/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时,这是输出:
When I restart the rabbitmq-server on computer 1 this is the output:
[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""rel =" nofollow>此处
I expected to see this "config file(s) : /etc/rabbitmq/rabbitmq.config" given the description of the config file documentation here
在Rabbitmq服务器启动后,我运行以下命令,没有看到铁锹:
And after the rabbitmq-server has started I run this command and don't see a shovel:
[root@test_toshiba ~]# rabbitmqctl eval 'rabbit_shovel_status:status().'
[]
...done.
这是Rabbitmq状态
Here is the rabbitmq status
[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中的日志中没有任何错误消息.
The logs at /var/log/rabbitmq didn't have any error messages in them.
如何验证我的配置文件已被使用,为什么我的铲子无法启动?
How can I verify that my config file is being used, and why won't my shovel start?
推荐答案
您需要为铲子定义一个目的地.
You need to define a destination for the shovel.
[ {mnesia, [{dump_log_write_threshold, 100}]},
{bunny, [{vm_memory_high_watermark, 0.3}]},
{rabbitmq_shovel,
[{shovels,
[{test_shovel,
[{sources, [{broker, "amqp://shoveluser:[email protected]:5672/"}]},
{destinations, [{broker, "amqp://shoveluser:[email protected]:5672/"}]},
{queue, >}
]
}]
}]
}
].
这篇关于RabbitMQ铲无法启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!