Not sure what I'm doing wrong here as I'm following the instructions. I have a java app running on one server and ELK stack on a second machine. In the conf file I'm setting the connection details
{
"host" : "datahub",
"port" : 20030,
"url" : "service:jmx:rmi:///jndi/rmi://datahub:20030/jmxrmi",
"alias" : "datahub",
"queries" : [
{
"object_name" : "java.lang:type=Memory",
"object_alias" : "Memory"
}, {
"object_name" : "java.lang:type=Runtime",
"attributes" : [ "Uptime", "StartTime" ],
"object_alias" : "Runtime"
}, {
"object_name" : "java.lang:type=GarbageCollector,name=",
"attributes" : [ "CollectionCount", "CollectionTime" ],
"object_alias" : "${type}.${name}"
}, {
"object_name" : "java.nio:type=BufferPool,name=",
"object_alias" : "${type}.${name}"
}
]
}
but when I start logstash I get connection errors in the log and no messages are indexed in Elasticsearch. (Note, I have tried this with and without the url config and get the same errors)
{:timestamp=>"2016-04-19T14:55:55.218000+0000", :message=>"Loading configuration files in path", :path=>"/opt/logstash/config/jmxconf", :level=>:info, :file=>"logstash/inputs/jmx.rb", :line=>"325", :method=>"run"}
{:timestamp=>"2016-04-19T14:55:55.219000+0000", :message=>"Loading configuration from file", :file=>"logstash/inputs/jmx.rb", :level=>:debug, :line=>"330", :method=>"run"}
{:timestamp=>"2016-04-19T14:55:55.219000+0000", :message=>"Add configuration to the queue", :config=>{"host"=>"datahub", "port"=>20030, "url"=>"service:jmx:rmi:///jndi/rmi://datahub:20030/jmxrmi", "alias"=>"datahub", "queries"=>[{"object_name"=>"java.lang:type=Memory", "object_alias"=>"Memory"}, {"object_name"=>"java.lang:type=Runtime", "attributes"=>["Uptime", "StartTime"], "object_alias"=>"Runtime"}, {"object_name"=>"java.lang:type=GarbageCollector,name=", "attributes"=>["CollectionCount", "CollectionTime"], "object_alias"=>"${type}.${name}"}, {"object_name"=>"java.nio:type=BufferPool,name=", "object_alias"=>"${type}.${name}"}]}, :level=>:debug, :file=>"logstash/inputs/jmx.rb", :line=>"335", :method=>"run"}
{:timestamp=>"2016-04-19T14:55:55.220000+0000", :message=>"Wait until the queue conf is empty", :level=>:debug, :file=>"logstash/inputs/jmx.rb", :line=>"346", :method=>"run"}
{:timestamp=>"2016-04-19T14:55:55.220000+0000", :message=>"Retrieve config {"host"=>"datahub", "port"=>20030, "url"=>"service:jmx:rmi:///jndi/rmi://datahub:20030/jmxrmi", "alias"=>"datahub", "queries"=>[{"object_name"=>"java.lang:type=Memory", "object_alias"=>"Memory"}, {"object_name"=>"java.lang:type=Runtime", "attributes"=>["Uptime", "StartTime"], "object_alias"=>"Runtime"}, {"object_name"=>"java.lang:type=GarbageCollector,name=", "attributes"=>["CollectionCount", "CollectionTime"], "object_alias"=>"${type}.${name}"}, {"object_name"=>"java.nio:type=BufferPool,name=", "object_alias"=>"${type}.${name}"}]} from queue conf", :level=>:debug, :file=>"logstash/inputs/jmx.rb", :line=>"205", :method=>"thread_jmx"}
{:timestamp=>"2016-04-19T14:55:55.220000+0000", :message=>"Check if jmx connection need a user/password", :level=>:debug, :file=>"logstash/inputs/jmx.rb", :line=>"207", :method=>"thread_jmx"}
{:timestamp=>"2016-04-19T14:55:55.220000+0000", :message=>"Wait 15s (15-0(seconds wait until queue conf empty)) before to launch again a new jmx metrics collection", :level=>:debug, :file=>"logstash/inputs/jmx.rb", :line=>"355", :method=>"run"}
{:timestamp=>"2016-04-19T14:55:55.220000+0000", :message=>"Connect to datahub:20030", :level=>:debug, :file=>"logstash/inputs/jmx.rb", :line=>"216", :method=>"thread_jmx"}
{:timestamp=>"2016-04-19T14:55:55.229000+0000", :message=>"Connection refused to host: localhost; nested exception is: \n\tjava.net.ConnectException: Connection refused", :level=>:error, :file=>"logstash/inputs/jmx.rb", :line=>"297", :method=>"thread_jmx"}
{:timestamp=>"2016-04-19T14:55:55.229000+0000", :message=>"sun.rmi.transport.tcp.TCPEndpoint.newSocket(sun/rmi/transport/tcp/TCPEndpoint.java:619)\nsun.rmi.transport.tcp.TCPChannel.createConnection(sun/rmi/transport/tcp/TCPChannel.java:216)\nsun.rmi.transport.tcp.TCPChannel.newConnection(sun/rmi/transport/tcp/TCPChannel.java:202)\nsun.rmi.server.UnicastRef.invoke(sun/rmi/server/UnicastRef.java:130)\njavax.management.remote.rmi.RMIConnector.getConnection(javax/management/remote/rmi/RMIConnector.java:2430)\njavax.management.remote.rmi.RMIConnector.connect(javax/management/remote/rmi/RMIConnector.java:308)\njavax.management.remote.JMXConnectorFactory.connect(javax/management/remote/JMXConnectorFactory.java:270)\njava.lang.reflect.Method.invoke(java/lang/reflect/Method.java:498)\nRUBY.create_connection(/opt/logstash/vendor/bundle/jruby/1.9/gems/jmx4r-0.1.4/lib/jmx4r.rb:220)\nRUBY.connection(/opt/logstash/vendor/bundle/jruby/1.9/gems/jmx4r-0.1.4/lib/jmx4r.rb:137)\nRUBY.thread_jmx(/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-jmx-2.0.4/lib/logstash/inputs/jmx.rb:217)\nRUBY.run(/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-jmx-2.0.4/lib/logstash/inputs/jmx.rb:321)\njava.lang.Thread.run(java/lang/Thread.java:745)", :level=>:error, :file=>"logstash/inputs/jmx.rb", :line=>"298", :method=>"thread_jmx"}
{:timestamp=>"2016-04-19T14:55:55.230000+0000", :message=>"Wait config to retrieve from queue conf", :level=>:debug, :file=>"logstash/inputs/jmx.rb", :line=>"203", :method=>"thread_jmx"}
Am I missing something from my config file?