安装ganglia
yum install –y wget apr-devel apr-util check-devel cairo-devel pango-devel libxml2-devel rpmbuild glib2-devel dbus-devel freetype-devel fontconfig-devel gcc-c++ expat-devel python-devel libXrender-devel rrdtool* rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm rpm -ivh http://github.com/downloads/jmxtrans/jmxtrans/jmxtrans-20121016.145842.6a28c97fbb-0.noarch.rpm yum install ganglia* |
配置ganglia,仅指出必要配置部分
vim /etc/ganglia/gmetad.conf data_source “solrcluster” 127.0.0.1 #运行gmod机器的ip vim /etc/ganglia/gmond.conf cluster { name = “solrcluster” owner = “unspecified” latlong = “unspecified” url = “unspecified” } vim /etc/httpd/conf.d/ganglia.conf <Location /ganglia> Order deny,allow Allow from all Allow from 127.0.0.1 Allow from ::1 # Allow from .example.com </Location> |
配置solr启动参数,红色的为必要参数
/home/solr/start-solr.sh java -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=3000 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Djava.rmi.server.hostname=127.0.0.1 -jar start.jar |
配置jmxtrans
#/var/lib/jmxtrans/solr.json # host 的ip地址必须与 -Djava.rmi.server.hostname=IP_OR_HOSTNAME 参数指定的ip相同 { “servers” : [ { “host” : “127.0.0.1”, “alias” : “solr”, “port” : “3000”, “queries” : [ { “obj” : “java.lang:type=Memory”, “resultAlias”: “solr1.heap”, “attr” : [ “HeapMemoryUsage”, “NonHeapMemoryUsage” ], “outputWriters” : [ { “@class” : “com.googlecode.jmxtrans.model.output.GangliaWriter”, “settings” : { “groupName” : “Solr-JVM”, “host” : “239.2.11.71”, “port” : “8649” } }] }, { “obj” : “java.lang:name=CMS Old Gen,type=MemoryPool”, “resultAlias”: “solr1.cmsoldgen”, “attr” : [ “Usage” ], “outputWriters” : [ { “@class” : “com.googlecode.jmxtrans.model.output.GangliaWriter”, “settings” : { “groupName” : “Solr-JVM”, “host” : “239.2.11.71”, “port” : “8649” } }] }, { “obj” : “java.lang:type=GarbageCollector,name=*”, “resultAlias”: “solr1.gc”, “attr” : [ “CollectionCount”, “CollectionTime” ], “outputWriters” : [ { “@class” : “com.googlecode.jmxtrans.model.output.GangliaWriter”, “settings” : { “groupName” : “Solr-JVM”, “host” : “239.2.11.71”, “port” : “8649” } }] }, { “obj” : “java.lang:type=Threading”, “resultAlias”: “solr1.threads”, “attr” : [ “DaemonThreadCount”, “PeakThreadCount”, “ThreadCount”, “TotalStartedThreadCount” ], “outputWriters” : [ { “@class” : “com.googlecode.jmxtrans.model.output.GangliaWriter”, “settings” : { “groupName” : “Solr-JVM”, “host” : “239.2.11.71”, “port” : “8649” } }] }, { “obj” : “solr/collection1:type=queryResultCache,id=org.apache.solr.search.LRUCache”, “resultAlias”: “solr1.queryCache”, “attr” : [ “warmupTime”,”size”,”lookups”,”evictions”,”hits”,”hitratio”,”inserts”,”cumulative_lookups” ,”cumulative_hits”,”cumulative_hits”,”cumulative_hitratio”,”cumulative_inserts”,”cumulative_evictions” ], “outputWriters” : [ { “@class” : “com.googlecode.jmxtrans.model.output.GangliaWriter”, “settings” : { “groupName” : “Solr-JVM”, “host” : “239.2.11.71”, “port” : “8649” } }] }, { “obj” : “solr/collection1:type=searcher,id=org.apache.solr.search.SolrIndexSearcher”, “resultAlias”: “solr1.searcher”, “attr” : [ “maxDoc”,”numDocs”,”warmupTime” ], “outputWriters” : [ { “@class” : “com.googlecode.jmxtrans.model.output.GangliaWriter”, “settings” : { “groupName” : “Solr-JVM”, “host” : “239.2.11.71”, “port” : “8649” } }] }] }] } |
启动,jmxtrans要最后启动
/etc/init.d/httpd start /etc/init.d/gmetad start /etc/init.d/gmond start /home/solr/start-solr.sh /etc/init.d/jmxtrans start |