【问题标题】:RabbitMQ and ActiveMQ running on the same machineRabbitMQ 和 ActiveMQ 在同一台机器上运行
【发布时间】:2015-04-18 09:16:36
【问题描述】:

出于测试目的,我需要在同一台 Windows 机器上运行 ActiveMQ 和 RabbitMQ。我都安装了,但我不能同时运行它们:我需要停止一项服务才能让另一项服务运行。

这是我尝试启动运行 ActiveMQ 的 RabbitMQ 时遇到的错误:

=INFO REPORT==== 17-Feb-2015::14:24:00 ===
Error description:
   {could_not_start,rabbit,
    {bad_return,
     {{rabbit,start,[normal,[]]},
      {'EXIT',
       {rabbit,failure_during_boot,
        {boot_step,networking,
         {case_clause,
          {error,
           {{shutdown,
             {failed_to_start_child,tcp_listener,
              {cannot_listen,{0,0,0,0,0,0,0,0},5672,eacces}}},
            {child,undefined,'rabbit_tcp_listener_sup_:::5672',
             {tcp_listener_sup,start_link,
              [{0,0,0,0,0,0,0,0},
               5672,
               [inet6,binary,
                {packet,raw},
                {reuseaddr,true},
                {backlog,128},
                {nodelay,true},
                {linger,{true,0}},
                {exit_on_close,false}],
               {rabbit_networking,tcp_listener_started,[amqp]},
               {rabbit_networking,tcp_listener_stopped,[amqp]},
               {rabbit_networking,start_client,[]},
               "TCP Listener"]},
             transient,infinity,supervisor,
             [tcp_listener_sup]}}}}}}}}}}

这是我尝试在 RabbitMQ 已经运行的情况下启动 ActiveMQ 时出现的错误:

jvm 1    |  INFO | Listening for connections at: tcp://BROKER:61616?maximumConnections=1000&wireFormat.maxFrameSize=104857600
jvm 1    |  INFO | Connector openwire started
jvm 1    | ERROR | Failed to start Apache ActiveMQ ([localhost, ID:DEV-BROKER01-56290-1424197666199-0:1], java.io.IOException: Transport Connector could not be registered in JMX: java.io.IOException: Failed to bind to server socket: amqp://0.0.0.0:5672?maximumConnections=1000&wireFormat.maxFrameSize=104857600 due to: 
                   java.net.BindException: Address already in use: JVM_Bind)
jvm 1    |  INFO | Apache ActiveMQ 5.11.0 (localhost, ID:DEV-BROKER01-56290-1424197666199-0:1) is shutting down

我猜“地址已在使用”是关键。

有什么办法解决吗?谢谢

【问题讨论】:

  • 你有什么错误?
  • 已添加日志!如果还需要什么,请告诉我

标签: rabbitmq activemq


【解决方案1】:

这就是问题所在: java.net.BindException:地址已在使用中:JVM_Bind)

两个代理都使用5672 端口(amqp 默认端口)。

只需更改一个代理的端口,例如在 rabbitmq 中检查此链接: https://www.rabbitmq.com/configure.html

配置文件 rabbitmq.config 允许 RabbitMQ 内核 应用程序、Erlang 服务和要配置的 RabbitMQ 插件。它 是一个标准的 Erlang 配置文件,记录在 Erlang 配置手册页。

一个示例配置文件如下:

[

     {rabbit, [{tcp_listeners, [5673]}]}   
]. 

本例将 RabbitMQ 监听的端口从 5672 到 5673。

这个配置文件和rabbitmq-env.conf不一样, 可用于在非windows系统上设置环境变量。

【讨论】:

  • 很棒的答案,正是我所需要的。谢谢@Gas!
猜你喜欢
  • 2016-03-22
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2010-11-08
  • 2015-08-25
  • 2012-05-09
  • 1970-01-01
  • 2017-01-29
相关资源
最近更新 更多