CentOS Build Jmxtrans Service

Source: Internet
Author: User

1. Download the installation package

http://central.maven.org/maven2/org/jmxtrans/jmxtrans/

Select your desired version at this address and download the RPM package, I choose jmxtrans-259.rpm


2. Installation

Execute command

[Email protected] local]# rpm-i jmxtrans-259.rpm

If you have the following error

[Email protected] local]# rpm-i jmxtrans-259.rpmerror:failed Dependencies:java >= 1.7 are needed by jmxtrans-259-1.no Arch

The command is executed

[Email protected] local]# rpm-i jmxtrans-259.rpm--nodeps--force


3. View the Installation

The default app is installed in the/usr/share/jmxtrans directory

Initialize script directory /etc/init.d/jmxtrans

JSON file storage location/var/lib/jmxtrans


4, debugging, view

Change the log level to debug

Modify Wrapper.java.additional.5=-djmxtrans.log.level=DEBUG in the configuration file/usr/share/jmxtrans/etc/wrapper.conf

Log file directory Wrapper.java.additional.6=-djmxtrans.log.dir=/var/log/jmxtrans


Create your own query file (in JSON format) under the/var/lib/jmxtrans directory

{"Servers": [{"Host": "Dx2.zdp.ol", "Port": "22222", "Queries": [{"Outputwriters": [{"@class": " Com.googlecode.jmxtrans.model.output.GangliaWriter "," settings ": {" GroupName ":" Jmxtrans "," host ":" 100.100.160.200 "," Port ":" 8649 "}]," obj ":" Kafka.consumer:type=consumerfetchermanager,name=maxlag,clientid=flume "," Resultalias " : "Dx2_22222.ConsumerFetcherManager.MaxLag"}], "Numquerythreads": 2}]}


5. Startup script

[Email protected] bin]# Pwd/usr/share/jmxtrans/bin[[email protected] bin]#./jmxtrans start/var/lib/jmxtrans/dx2_ Jmxtrans.json


6. Viewing log files

[Email protected] bin]# tail-f/var/log/jmxtrans/jmxtrans.log
Some log files [09  September  2016 14:21:10] [jmxtrans-result-5] 1715596 DEBUG  ( com.googlecode.jmxtrans.model.output.gangliawriter:201)  - sending ganglia metric dx2_ 33334_pmsgateway.consumerfetchermanager.maxlag.value=0 [type=int32][09  September  2016 14:21:10]  [jmxtrans-result-5] 1715596 DEBUG  (com.googlecode.jmxtrans.model.output.gangliawriter:201 )  - sending ganglia metric dx2_33334_pmsgateway.consumerfetchermanager.maxlag.value=0  [type=INT32][09  September  2016 14:21:12] [serverscheduler_worker-6] 1717578 debug   (com.googlecode.jmxtrans.jobs.serverjob:58)  - +++++ Started server job:  Server (Pid=null, host=dx2.zdp.ol, port=33336, url=service:jmx:rmi:///jndi/rmi://dx2.zdp.ol : 33336/jmxrmi, cronexpression=null, numquerythreads=0) [09  September  2016 14:21:12] [ serverscheduler_worker-6] 1717578 debug  (com.googlecode.jmxtrans.jobs.serverjob:58)  - +++++ started server  job: server (pid=null, host=dx2.zdp.ol, port=33336, url=service:jmx:rmi:///jndi/rmi:/ /dx2.zdp.ol:33336/jmxrmi, cronexpression=null, numquerythreads=0) [09  September  2016 14:21:12 ] [serverscheduler_worker-6] 1717578 debug  (com.googlecode.jmxtrans.jobs.serverjob:64)  - +++++ finished server job: server (pid=null, host=dx2.zdp.ol, port= 33336, url=service:jmx:rmi:///jndi/rmi://dx2.zdp.ol:33336/jmxrmi, cronexpression=null,  numquerythreads=0) [09  September  2016 14:21:12] [serverscheduler_worker-6] 1717578 debug   (com.googlecode.jmxtrans.jobs.serverjob:64)  - +++++ Finished server job:  Server (Pid=null, host=dx2.zdp.ol, port=33336, url=service:jmx:rmi:///jndi/rmi://dx2.zdp.ol : 33336/jmxrmi, cronexpression=null, numquerythreads=0) 

7, from the output side ganglia view effect

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/87/0D/wKioL1fSWIugGFTWAAHcw0QfnKU261.png "title=" Gangliawriter.png "alt=" Wkiol1fswiuggftwaahcw0qfnku261.png "/>


This article is from the "Chocolate Black" blog, be sure to keep this source http://10120275.blog.51cto.com/10110275/1851106

CentOS Build Jmxtrans Service

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.