Chinaunix首页 | 论坛 | 博客
  • 博客访问: 190524
  • 博文数量: 33
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 182
  • 用 户 组: 普通用户
  • 注册时间: 2014-06-17 17:57
个人简介

IT运维工程师

文章分类

全部博文(33)

文章存档

2015年(20)

2014年(13)

我的朋友

分类: LINUX

2014-09-17 18:18:44

在puppetmaster(mcollective client)端安装中间件ActiveMQ
1、安装puppetlabs官方yum源
[root@szlnmp01 tmp]# wget
[root@szlnmp01 tmp]# rpm -i puppetlabs-release-6-10.noarch.rpm
[root@szlnmp01 yum.repos.d]# ls
puppetlabs.repo


2、安装ActiveMQ
[root@szlnmp01 yum.repos.d]# yum install tanukiwrapper activemq activemq-info-provider -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
puppetlabs-deps                                                                                                                                           | 2.5 kB     00:00     
puppetlabs-products                                                                                                                                       | 2.5 kB     00:00     
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package activemq.noarch 0:5.8.0-3.el5.centos will be installed
---> Package activemq-info-provider.noarch 0:5.8.0-3.el5.centos will be installed
---> Package tanukiwrapper.x86_64 0:3.5.9-1.el5 will be installed
--> Finished Dependency Resolution


Dependencies Resolved


=================================================================================================================================================================================
 Package                                          Arch                             Version                                       Repository                                 Size
=================================================================================================================================================================================
Installing:
 activemq                                         noarch                           5.8.0-3.el5.centos                            puppetlabs-deps                            40 M
 activemq-info-provider                           noarch                           5.8.0-3.el5.centos                            puppetlabs-deps                           5.5 k
 tanukiwrapper                                    x86_64                           3.5.9-1.el5                                   puppetlabs-deps                           273 k


Transaction Summary
=================================================================================================================================================================================
Install       3 Package(s)


Total size: 40 M
Installed size: 40 M
Downloading Packages:
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID 4bd6ec30: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puppetlabs
Importing GPG key 0x4BD6EC30:
 Userid : Puppet Labs Release Key (Puppet Labs Release Key)
 Package: puppetlabs-release-6-10.noarch (installed)
 From   : /etc/pki/rpm-gpg/RPM-GPG-KEY-puppetlabs
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
  Installing : tanukiwrapper-3.5.9-1.el5.x86_64                                                                                                                              1/3 
  Installing : activemq-5.8.0-3.el5.centos.noarch                                                                                                                            2/3 
  Installing : activemq-info-provider-5.8.0-3.el5.centos.noarch                                                                                                              3/3 
  Verifying  : tanukiwrapper-3.5.9-1.el5.x86_64                                                                                                                              1/3 
  Verifying  : activemq-info-provider-5.8.0-3.el5.centos.noarch                                                                                                              2/3 
  Verifying  : activemq-5.8.0-3.el5.centos.noarch                                                                                                                            3/3 


Installed:
  activemq.noarch 0:5.8.0-3.el5.centos                  activemq-info-provider.noarch 0:5.8.0-3.el5.centos                  tanukiwrapper.x86_64 0:3.5.9-1.el5                 


Complete!


3、配置/etc/activemq/activemq.xml

 

......

   
   
   
   
   

......

   

......


4、启动activemq
/etc/rc.d/init.d/activemq start


5、查看监听端口
[root@szlnmp01 puppet]# lsof -i:61613
COMMAND  PID     USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
java    1196 activemq  136u  IPv6  10429      0t0  TCP *:61613 (LISTEN)
java    1196 activemq  144u  IPv6  30930      0t0  TCP szlnmp01.corp.dx:61613->mongo01:35981 (ESTABLISHED)
java    1196 activemq  145u  IPv6  28177      0t0  TCP szlnmp01.corp.dx:61613->iis01-op:53778 (ESTABLISHED)
[root@szlnmp01 puppet]# netstat -alnpt | grep 61613
tcp        0      0 :::61613                    :::*                        LISTEN      1196/java           
tcp        0      0 ::ffff:192.168.11.55:61613  ::ffff:192.168.11.53:53778  ESTABLISHED 1196/java           
tcp        0      0 ::ffff:192.168.11.55:61613  ::ffff:192.168.11.51:35981  ESTABLISHED 1196/java 


6、如果ActiveMQ启动闪断,需要查看日志
[root@szlnmp01 puppet]# tail -100f /var/log/activemq/activemq.log
Caused by: org.xml.sax.SAXParseException; lineNumber: 123; columnNumber: 33; cvc-complex-type.2.3: Element 'authorizationPlugin' cannot have character [children], because the type's content type is element-only.
        at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198)
        at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134)
        at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:437)
        at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:368)
        at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:325)
        at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:458)
        at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3237)
        at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.elementLocallyValidComplexType(XMLSchemaValidator.java:3200)
        at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.elementLocallyValidType(XMLSchemaValidator.java:3160)
        at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processElementContent(XMLSchemaValidator.java:3062)
        at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleEndElement(XMLSchemaValidator.java:2140)
        at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.endElement(XMLSchemaValidator.java:859)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1782)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2973)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
        at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:117)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
        at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
        at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:243)
        at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:347)
        at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388)
        ... 32 more


7、修改activemq.xml后,启动正常
2014-09-09 16:43:46,742 [erSimpleAppMain] INFO  XBeanBrokerFactory$1           - Refreshing org.apache.activemq.xbean.XBeanBrokerFactory$1@5141928f: startup date [Tue Sep 09 16:43:46 CST 2014]; root of context hierarchy
2014-09-09 16:43:49,447 [erSimpleAppMain] INFO  PListStoreImpl                 - PListStore:[/usr/share/activemq/data/localhost/tmp_storage] started
2014-09-09 16:43:49,510 [erSimpleAppMain] INFO  BrokerService                  - Using Persistence Adapter: KahaDBPersistenceAdapter[/usr/share/activemq/data/kahadb]
2014-09-09 16:43:50,087 [erSimpleAppMain] INFO  StatisticsBrokerPlugin         - Installing StaticsBroker
2014-09-09 16:43:50,108 [erSimpleAppMain] INFO  BrokerService                  - Apache ActiveMQ 5.8.0 (localhost, ID:szlnmp01.corp.dx-43500-1410252229834-0:1) is starting
2014-09-09 16:43:50,114 [erSimpleAppMain] INFO  StatisticsBroker               - Starting StatisticsBroker
2014-09-09 16:43:50,158 [erSimpleAppMain] INFO  TransportServerThreadSupport   - Listening for connections at: stomp://szlnmp01.corp.dx:61613
2014-09-09 16:43:50,158 [erSimpleAppMain] INFO  TransportConnector             - Connector stomp+nio Started
2014-09-09 16:43:50,176 [erSimpleAppMain] INFO  BrokerService                  - Apache ActiveMQ 5.8.0 (localhost, ID:szlnmp01.corp.dx-43500-1410252229834-0:1) started
2014-09-09 16:43:50,176 [erSimpleAppMain] INFO  BrokerService                  - For help or more information please see:
2014-09-09 16:43:51,434 [erSimpleAppMain] INFO  Server                         - jetty-7.6.7.v20120910
2014-09-09 16:43:51,823 [erSimpleAppMain] INFO  WebConsoleStarter              - Web console type: embedded
2014-09-09 16:43:52,378 [erSimpleAppMain] INFO  WebConsoleStarter              - ActiveMQ WebConsole initialized.
2014-09-09 16:43:52,379 [erSimpleAppMain] INFO  ContextHandler                 - started o.e.j.w.WebAppContext{/admin,file:/var/lib/activemq/webapps/admin/}
2014-09-09 16:43:52,561 [erSimpleAppMain] INFO  /admin                         - Initializing Spring FrameworkServlet 'dispatcher'
2014-09-09 16:43:52,804 [erSimpleAppMain] INFO  ndingBeanNameUrlHandlerMapping - Mapped URL path [/createDestination.action] onto handler '/createDestination.action'
2014-09-09 16:43:52,804 [erSimpleAppMain] INFO  ndingBeanNameUrlHandlerMapping - Mapped URL path [/deleteDestination.action] onto handler '/deleteDestination.action'
2014-09-09 16:43:52,804 [erSimpleAppMain] INFO  ndingBeanNameUrlHandlerMapping - Mapped URL path [/createSubscriber.action] onto handler '/createSubscriber.action'
2014-09-09 16:43:52,804 [erSimpleAppMain] INFO  ndingBeanNameUrlHandlerMapping - Mapped URL path [/deleteSubscriber.action] onto handler '/deleteSubscriber.action'
2014-09-09 16:43:52,804 [erSimpleAppMain] INFO  ndingBeanNameUrlHandlerMapping - Mapped URL path [/sendMessage.action] onto handler '/sendMessage.action'
2014-09-09 16:43:52,805 [erSimpleAppMain] INFO  ndingBeanNameUrlHandlerMapping - Mapped URL path [/purgeDestination.action] onto handler '/purgeDestination.action'
2014-09-09 16:43:52,805 [erSimpleAppMain] INFO  ndingBeanNameUrlHandlerMapping - Mapped URL path [/deleteMessage.action] onto handler '/deleteMessage.action'
2014-09-09 16:43:52,805 [erSimpleAppMain] INFO  ndingBeanNameUrlHandlerMapping - Mapped URL path [/copyMessage.action] onto handler '/copyMessage.action'
2014-09-09 16:43:52,805 [erSimpleAppMain] INFO  ndingBeanNameUrlHandlerMapping - Mapped URL path [/moveMessage.action] onto handler '/moveMessage.action'
2014-09-09 16:43:52,805 [erSimpleAppMain] INFO  ndingBeanNameUrlHandlerMapping - Mapped URL path [/deleteJob.action] onto handler '/deleteJob.action'
2014-09-09 16:43:53,421 [erSimpleAppMain] INFO  WebAppContext                  - ActiveMQ Console at
2014-09-09 16:43:53,436 [erSimpleAppMain] INFO  ContextHandler                 - started o.e.j.w.WebAppContext{/camel,file:/var/lib/activemq/webapps/camel}
2014-09-09 16:43:53,451 [erSimpleAppMain] INFO  WebAppContext                  - WebApp@174088768 at
2014-09-09 16:43:53,479 [erSimpleAppMain] INFO  ContextHandler                 - started o.e.j.w.WebAppContext{/demo,file:/var/lib/activemq/webapps/demo}
2014-09-09 16:43:53,486 [erSimpleAppMain] INFO  WebAppContext                  - WebApp@174088768 at
2014-09-09 16:43:53,503 [erSimpleAppMain] INFO  ContextHandler                 - started o.e.j.w.WebAppContext{/fileserver,file:/var/lib/activemq/webapps/fileserver}
2014-09-09 16:43:53,510 [erSimpleAppMain] INFO  WebAppContext                  - WebApp@174088768 at
2014-09-09 16:43:53,650 [erSimpleAppMain] INFO  AbstractConnector              - Started SelectChannelConnector@0.0.0.0:8161
到此,ActiveMQ已经安装完成!


安装mcollective
[root@szlnmp01 yum.repos.d]# yum install mcollective  mcollective-common 
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package mcollective.noarch 0:2.6.0-1.el5 will be installed
---> Package mcollective-common.noarch 0:2.6.0-1.el5 will be installed
--> Processing Dependency: rubygems >= 1.3.7 for package: mcollective-common-2.6.0-1.el5.noarch
--> Processing Dependency: rubygem-stomp for package: mcollective-common-2.6.0-1.el5.noarch
--> Running transaction check
---> Package rubygem-stomp.noarch 0:1.3.2-1.el5 will be installed
---> Package rubygems.noarch 0:1.3.7-1.el5 will be installed
--> Finished Dependency Resolution


Dependencies Resolved


=================================================================================================================================================================================
 Package                                        Arch                               Version                                 Repository                                       Size
=================================================================================================================================================================================
Installing:
 mcollective                                    noarch                             2.6.0-1.el5                             puppetlabs-products                              11 k
 mcollective-common                             noarch                             2.6.0-1.el5                             puppetlabs-products                             864 k
Installing for dependencies:
 rubygem-stomp                                  noarch                             1.3.2-1.el5                             puppetlabs-deps                                 117 k
 rubygems                                       noarch                             1.3.7-1.el5                             puppetlabs-deps                                 217 k


Transaction Summary
=================================================================================================================================================================================
Install       4 Package(s)


Total download size: 1.2 M
Installed size: 1.2 M




安装
yum -y install mcollective-client-2.6.0-1.el5.noarch
才能使用mco命令

阅读(3045) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~