You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by karunakarsingh <ka...@timesinternet.in> on 2017/08/07 05:39:15 UTC

I am not able to read mxbean values of ignite

Team,here is the scenario, i am fetching jmx values of application and
servers through logstash and it is getting visible for java app. but when i
tried it for ignite it is not getting getheched. as per my finding the
mxbean value for objects are false. please help.jmx values for java 
<http://apache-ignite-users.70518.x6.nabble.com/file/n16022/1java.jpg> jmx
value for ignite
<http://apache-ignite-users.70518.x6.nabble.com/file/n16022/2ignite.jpg> 



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/I-am-not-able-to-read-mxbean-values-of-ignite-tp16022.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: I am not able to read mxbean values of ignite

Posted by neerajbhatt <ne...@gmail.com>.
Thanks Slave, this is working for us now. There was a configuration issue in
org.apache:clsLdr=*



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/I-am-not-able-to-read-mxbean-values-of-ignite-tp16022p16123.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: I am not able to read mxbean values of ignite

Posted by "slava.koptilin" <sl...@gmail.com>.
Hello,

The reason whyr mxbean is false that Apache Ignite "exports" its own beans
as DynamicBean.

I've tried logstash 5.5.1 with logstash-input-jmx 3.0.2 plugin
I've used the following jmx configuration that is gathering simple
statistics about MyTestCache, DiscoverySpi and CommunicationSpi:
{
    "host" : "localhost",
    "port" : <JMX port should be specified here>,
    "queries" : [
      {
          "object_name" :
"org.apache:clsLdr=*,group=MyTestCache,name=org.apache.ignite.internal.processors.cache.CacheClusterMetricsMXBeanImpl",
          "object_alias" : "CacheStatistics",
  	  "attributes" : ["StatisticsEnabled","Size"]
      },	
      {
          "object_name" :
"org.apache:clsLdr=*,group=SPIs,name=TcpDiscoverySpi",
          "object_alias" : "TcpDiscoverySpi",
  	  "attributes" : ["Coordinator","IgniteHome","ClientMode"]
      },
      {
          "object_name" :
"org.apache:clsLdr=*,group=SPIs,name=TcpCommunicationSpi",
          "object_alias" : "TcpCommunicationSpi",
  	  "attributes" : ["ConnectTimeout","LocalNodeId","LocalPort"]
      }	
   ]
}

You have two options to specify JMX port:
1. set environment variable  IGNITE_JMX_PORT
2. pass the following system parameters to your JVM:
    -Dcom.sun.management.jmxremote
    -Dcom.sun.management.jmxremote.port={preferred_port}
    -Dcom.sun.management.jmxremote.authenticate=false
    -Dcom.sun.management.jmxremote.ssl=false

And it works good:
[2017-08-08T14:25:45,614][INFO ][logstash.inputs.jmx      ] Loading
configuration files in path {:path=>"/home/slava/logstash-5.5.1/jmx"}
{
    "metric_value_number" => 0,
                   "path" => "/home/slava/logstash-5.5.1/jmx",
             "@timestamp" => 2017-08-08T11:25:45.630Z,
               "@version" => "1",
                   "host" => "localhost",
            "metric_path" =>
"localhost_49117.CacheStatistics.StatisticsEnabled_bool",
                   "type" => "jmx"
}
{
    "metric_value_number" => 0,
                   "path" => "/home/slava/logstash-5.5.1/jmx",
             "@timestamp" => 2017-08-08T11:25:45.635Z,
               "@version" => "1",
                   "host" => "localhost",
            "metric_path" => "localhost_49117.CacheStatistics.Size",
                   "type" => "jmx"
}
{
                   "path" => "/home/slava/logstash-5.5.1/jmx",
             "@timestamp" => 2017-08-08T11:25:45.639Z,
               "@version" => "1",
                   "host" => "localhost",
            "metric_path" => "localhost_49117.TcpDiscoverySpi.Coordinator",
                   "type" => "jmx",
    "metric_value_string" => "f642dc26-3af0-4ba1-ba13-1fb361e7c6f5"
}
{
                   "path" => "/home/slava/logstash-5.5.1/jmx",
             "@timestamp" => 2017-08-08T11:25:45.640Z,
               "@version" => "1",
                   "host" => "localhost",
            "metric_path" => "localhost_49117.TcpDiscoverySpi.IgniteHome",
                   "type" => "jmx",
    "metric_value_string" => "/projects/binaries/fabric.2.1.0"
}
{
    "metric_value_number" => 0,
                   "path" => "/home/slava/logstash-5.5.1/jmx",
             "@timestamp" => 2017-08-08T11:25:45.640Z,
               "@version" => "1",
                   "host" => "localhost",
            "metric_path" =>
"localhost_49117.TcpDiscoverySpi.ClientMode_bool",
                   "type" => "jmx"
}
{
    "metric_value_number" => 5000,
                   "path" => "/home/slava/logstash-5.5.1/jmx",
             "@timestamp" => 2017-08-08T11:25:45.661Z,
               "@version" => "1",
                   "host" => "localhost",
            "metric_path" =>
"localhost_49117.TcpCommunicationSpi.ConnectTimeout",
                   "type" => "jmx"
}
{
                   "path" => "/home/slava/logstash-5.5.1/jmx",
             "@timestamp" => 2017-08-08T11:25:45.662Z,
               "@version" => "1",
                   "host" => "localhost",
            "metric_path" =>
"localhost_49117.TcpCommunicationSpi.LocalNodeId",
                   "type" => "jmx",
    "metric_value_string" => "f642dc26-3af0-4ba1-ba13-1fb361e7c6f5"
}
{
    "metric_value_number" => 47100,
                   "path" => "/home/slava/logstash-5.5.1/jmx",
             "@timestamp" => 2017-08-08T11:25:45.663Z,
               "@version" => "1",
                   "host" => "localhost",
            "metric_path" =>
"localhost_49117.TcpCommunicationSpi.LocalPort",
                   "type" => "jmx"
}

Thanks,
Slava.



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/I-am-not-able-to-read-mxbean-values-of-ignite-tp16022p16049.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: I am not able to read mxbean values of ignite

Posted by neerajbhatt <ne...@gmail.com>.
mxbean in MBeaninfo of a particluar cache is coming as false, because of
which logstash jmx plugin is not able to get data.

I am also facing the same problem

we have used
cacheCfg.setStatisticsEnabled(true);
cacheCfg.setManagementEnabled(true);

Attributes values are coming in jconsole but probably becuase in MBeaninfo
mxbean is false we are not able to fetch values in logstash



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/I-am-not-able-to-read-mxbean-values-of-ignite-tp16022p16042.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: I am not able to read mxbean values of ignite

Posted by karunakarsingh <ka...@timesinternet.in>.
Thanks slava.koptilin,

Yes the attribute have the values as per shared source. 

but I am not able to get it through while fetching with logstash and json.
please suggest!  



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/I-am-not-able-to-read-mxbean-values-of-ignite-tp16022p16034.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: I am not able to read mxbean values of ignite

Posted by "slava.koptilin" <sl...@gmail.com>.
Hello,

Could you please check that statistics gathering is enabled?
Please take a look at this method
org.apache.ignite.configuration.CacheConfiguration#setStatisticsEnabled(boolean)

The metrics will be available under "Attributes"
<http://apache-ignite-users.70518.x6.nabble.com/file/n16029/metrics.png> 



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/I-am-not-able-to-read-mxbean-values-of-ignite-tp16022p16029.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.