2016-10-03 66 views
2

我试图在puppetmaster(开源puppet)上设置mcollective/activemq。我遇到了ActiveMQ无法识别Stomp协议的问题。这里是我的/etc/activemq/instances-enabled/activemq/activemq.xml文件中的相关片段,它应使蹬+ SSL:当我通过service activemq start开始的ActiveMQActiveMQ不识别Stomp:传输方案无法识别:[stomp + ssl]

<transportConnectors> 
      <transportConnector name="openwire" uri="tcp://0.0.0.0:61616"/> 
      <transportConnector name="stomp+ssl" uri="stomp+ssl://0.0.0.0:61614?needClientAuth=true&amp;transport.enabledProtocols=TLSv1,TLSv1.1,TLSv1.2"/> 
</transportConnectors> 

,我注意到守护进程不结束运行(我不认为这是一个处理)。然后我试着运行service activemq console activemq,看起来问题是无法找到stomp Transport方案。这是我在输出中看到的第一个错误(并且错误在整个输出中仍然存在):

错误|无法启动Apache ActiveMQ([localhost, ID:my-servers-hostname.example.com-40447-1475514312306-0:1],java.io.IOException:Transport 连接器无法在 中注册JMX:java .io.IOException:Transport scheme not recognized:[stomp + ssl])

ActiveMQ可以很好地识别openwire。当仅使用openwire + ssl而不使用stomp + ssl时,ActiveMQ守护程序可以毫无错误地正常启动。然而,当我尝试运行mco find,我得到一个错误,因为它似乎MCO仍试图用跺脚+ SSL(和ActiveMQ的只有openwire +启用SSL):

错误2016年10月3日17: 26:59:activemq.rb:149:在`on_ssl_connectfail” SSL会话创建与STOMP + SSL:// mcollective @本地:61614失败:连接被拒绝 - (2)连接为 “localhost” 的端口61614

也许我需要调整我的mco配置来使用openwire代替stomp?我不确定该配置会在哪里或哪些文件中。不知道为什么它不能识别脚跺,但我想知道我的选项在这里。是否甚至有可能只使用openwire + ssl来使用MCollective/ActiveMQ,或者如果我想使用mco,是否正在使用stomp要求?我不认为这是一个端口问题,因为我相信服务器上的相关端口是开放的。

这里是安装在我的机器上的相关的包/版本:

OS: Ubuntu 16.04 (xenial) 
puppet: 4.7.0 
ActiveMQ: 5.13.2 
ruby-stomp: 1.3.5-1 
MCollective (mco) version: 2.9.0 
+0

你找到一个解决的办法? –

回答

1

我碰到与我的项目中嵌入的ActiveMQ服务器同样的问题。原来,我需要添加以下依赖关系到我的POM。

<dependency> 
     <groupId>org.apache.activemq</groupId> 
     <artifactId>activemq-stomp</artifactId> 
     <version>5.15.0</version> 
    </dependency> 
    <dependency> 
     <groupId>org.apache.activemq</groupId> 
     <artifactId>activemq-kahadb-store</artifactId> 
     <version>5.15.0</version> 
    </dependency> 

在你的情况,我认为你需要让那些2瓶的保持,并将它们添加到您的ActiveMQ安装。

1

activemq ubuntu提供的包16+库stomp transport不包括在内。我不知道为什么。 同比也可以手动下载并在/usr/share/activemq/lib地方:

cd /usr/share/activemq/lib 
# check your actviemq version before (apt-cache policy activemq) and use the relevant version of library. 
wget https://repository.apache.org/content/repositories/releases/org/apache/activemq/activemq-stomp/5.13.5/activemq-stomp-5.13.5.jar 
service activemq restart 
+2

请修改您的帖子,以包括为什么代码将回答问题的详细信息 –

+0

@CalvT븃添加更多信息 – Hett

+0

这修复了Ubuntu 16.04上ActiveMQ的问题,其中ActiveMQ在通过'systemctl start activemq调用时不会启动。service';例如当试图运行带有ActiveMQ的经典(Puppet 3.x)MCollective代理(由[voxpupuli/mcollective]管理)(https://github.com/voxpupuli/puppet-mcollective)而不是新的[Choria MCollective部署](https://choria.io/),它使用NATS作为中间件,运行'/etc/init.d/activemq console mcollective'可以帮助识别丢失Stomp库的问题,这个问题不会在其他地方记录下来。 – daff