MCollective 守护进程未绑定网络套接字

MCollective 守护进程未绑定网络套接字

我刚刚在 Ubuntu 10.04 LTS 上安装了 PE,使用的是 puppet-enterprise-2.0-ubuntu-10.04-amd64.tar.gz(从http://puppetlabs.com/misc/pe-files/),目前同一台机器正在运行主服务器、控制台和代理服务器角色。

我似乎遇到了 MCollective 服务器的问题,尽管它似乎启动正常,但并没有按应有的方式打开端口 61613。

守护进程启动正常

$ sudo /etc/init.d/pe-mcollective start
 * Starting mcollective daemon                  [ OK ] 

出现是PS

$ ps aux | grep mcol | grep -v grep
root     25636  0.0  0.5  64680 12056 ?        S    07:21   0:00 /opt/puppet/bin/ruby /opt/puppet/sbin/mcollectived --pid /var/run/pe-mcollective.pid

Pid 文件包含正确的值

$ sudo cat /var/run/pe-mcollective.pid
25636

但是我没有看到任何进程在监听端口 61613

$ sudo netstat -lntp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      2395/mysqld     
tcp        0      0 127.0.0.1:11211         0.0.0.0:*               LISTEN      25542/memcached 
tcp        0      0 0.0.0.0:8140            0.0.0.0:*               LISTEN      25620/pe-httpd  
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      10096/apache2   
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      2345/sshd       
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      2822/master     
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      25620/pe-httpd  

当我查看日志时,我看到 mcollective 服务器和客户端日志中都有错误

$ sudo tail -f /var/log/pe-*/*
==> /var/log/pe-puppet-dashboard/mcollective_client.log <==
I, [2011-12-20T07:26:22.731870 #30944]  INFO -- : stomp.rb:79:in `on_connectfail' Connction to stomp://[email protected]:61613 failed on attempt 1646

==> /var/log/pe-mcollective/mcollective.log <==
I, [2011-12-20T07:26:24.852641 #25636]  INFO -- : stomp.rb:79:in `on_connectfail' Connction to stomp://[email protected]:61613 failed on attempt 20

当我检查 mcollective ruby​​ 脚本 /opt/puppet/sbin/mcollectived 时,我可以看到它引用了配置文件 /etc/puppetlabs/mcollective/server.cfg,该文件具有以下配置指令:

plugin.stomp.pool.size = 1
plugin.stomp.pool.host1 = puppetmaster.example.org
plugin.stomp.pool.port1 = 61613
plugin.stomp.pool.user1 = mcollective
plugin.stomp.pool.password1 = ***************
plugin.stomp.pool.ssl1 = true
plugin.stomp.base64 = true

我可以解决插件.stomp.pool.host1,如果我改变插件.stomp.pool.port1例如,设置为 61614 时,我看到它反映在上面提到的 mcollective.log 错误中。我设置日志级别 = 调试但它没有给我更多提示。我手动运行了脚本(/opt/puppet/bin/ruby /opt/puppet/sbin/mcollectived),但它也没有给我任何线索。

问:我该如何进一步解决这个问题?

答案1

问题出在 Java 密钥库上:

pe-activemq 启动正常

$ sudo /etc/init.d/pe-activemq start
 * pe-activemq started

但是通过观察 PS,我注意到 activemq 尝试启动但几乎立即失败。我修改了启动脚本以进行一些调试:

start() {
    echo -n "Starting $APP_NAME... "
    getpid
    if [ "X$pid" = "X" ]
    then
        # original command
        # COMMAND_LINE="$CMDNICE $WRAPPER_CMD $WRAPPER_CONF wrapper.syslog.ident=$APP_NAME wrapper.pidfile=$PIDFILE wrapper.daemonize=TRUE $ANCHORPROP $IGNOREPROP $LOCKPROP"
        # custom command with deamonize=FALSE
        COMMAND_LINE="$CMDNICE $WRAPPER_CMD $WRAPPER_CONF wrapper.syslog.ident=$APP_NAME wrapper.pidfile=$PIDFILE wrapper.daemonize=FALSE $ANCHORPROP $IGNOREPROP $LOCKPROP"
        echo "executing [$COMMAND_LINE]"

启动 pe-activemq 出现以下错误

jvm 1    | ERROR | Failed to start ActiveMQ JMS Message Broker. Reason: java.io.IOException: Transport Connector could not be registered in JMX: Failed to bind to server socket: stomp+ssl://0.0.0.0:61613 due to: java.net.SocketException: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: sun.security.ssl.DefaultSSLContextImpl)

这看起来像是密钥库的问题。/opt/puppet/activemq/conf/activemq-wrapper.conf 配置文件为您提供了以下详细信息:

set.default.ACTIVEMQ_BASE=/opt/puppet/activemq
wrapper.working.dir=/var/log/pe-activemq
[...]
# Enable SSL of the Stomp Connection (Note, this provides encryption only as per #10596)
wrapper.java.additional.7=-Djavax.net.ssl.keyStorePassword=puppet
wrapper.java.additional.8=-Djavax.net.ssl.keyStore=%ACTIVEMQ_BASE%/conf/broker.ks
# The trust store need not be present.
wrapper.java.additional.9=-Djavax.net.ssl.trustStorePassword=puppet
wrapper.java.additional.10=-Djavax.net.ssl.trustStore=%ACTIVEMQ_BASE%/conf/broker.ts

仅供参考,/opt/puppet/activemq/conf 是指向 /etc/puppetlabs/activemq 的符号链接。在该目录中,brochet.ts 文件存在,但缺少 broker.ks

根据此页面(http://activemq.apache.org/how-do-i-use-ssl.html),我做了以下事情

$ cd /etc/puppetlabs/activemq
$ sudo keytool -genkey -alias broker -keyalg RSA -keystore broker.ks
=> provided puppet password everywhere

然后activemq启动正常

jvm 1    |  INFO | Using Persistence Adapter: KahaDBPersistenceAdapter[/opt/puppet/activemq/data/kahadb]
jvm 1    |  INFO | KahaDB is version 3
jvm 1    |  INFO | Recovering from the journal ...
jvm 1    |  INFO | Recovery replayed 1 operations from the journal in 0.022 seconds.
jvm 1    |  INFO | ActiveMQ 5.5.0 JMS Message Broker (localhost) is starting
jvm 1    |  INFO | For help or more information please see: http://activemq.apache.org/
jvm 1    |  INFO | Installing StaticsBroker
jvm 1    |  INFO | Starting StatisticsBroker
jvm 1    |  INFO | Listening for connections at: tcp://myserver:61616
jvm 1    |  INFO | Connector openwire Started
jvm 1    |  INFO | Listening for connections at: stomp+ssl://myserver:61613
jvm 1    |  INFO | Connector stomp+ssl Started
jvm 1    |  INFO | ActiveMQ JMS Message Broker (localhost, ID:myserver-44300-1324455724257-0:1) started
jvm 1    |  INFO | jetty-7.1.6.v20100715
jvm 1    |  INFO | ActiveMQ WebConsole initialized.
jvm 1    |  INFO | Initializing Spring FrameworkServlet 'dispatcher'
jvm 1    |  INFO | ActiveMQ Console at http://0.0.0.0:8161/admin
jvm 1    |  INFO | WebApp@2109578614 at http://0.0.0.0:8161/camel
jvm 1    |  INFO | WebApp@2109578614 at http://0.0.0.0:8161/demo
jvm 1    |  INFO | WebApp@2109578614 at http://0.0.0.0:8161/fileserver
jvm 1    |  INFO | Started [email protected]:8161

问题解决了

答案2

守护进程没有监听,守护进程连接到中间件节点,在你的情况下是 puppetmaster.example.com:61613 ,其中应该正在运行 ActiveMQ,

如果你需要更多帮助,请将问题直接发送到 mcollective 邮件列表http://groups.google.com/group/mcollective-users

相关内容