Failed to install template: waited for [30s]

Hi All,

My ES (1.7.4) is running well, but when I start logstash (1.5.2), something wrong with my logstash conf?

ES Status
$curl localhost:9200/_nodes/process?pretty

{
  "cluster_name" : "es_course_master",
  "nodes" : {
    "iAqkfDv5Ql2UPoykTjwcTg" : {
      "name" : "Sharon Friedlander",
      "transport_address" : "inet[/140.92.25.241:9300]",
      "host" : "es_course",
      "ip" : "140.92.25.241",
      "version" : "1.7.4",
      "build" : "0d3159b",
      "http_address" : "inet[/140.92.25.241:9200]",
      "process" : {
        "refresh_interval_in_millis" : 1000,
        "id" : 26714,
        "max_file_descriptors" : 65535,
        "mlockall" : false
      }
    }
  }
}

/etc/hosts
140.92.25.241 es_course

/etc/logstash/conf.d/logstash.conf
    input {
      file {
        path => "/var/log/test.log"
      }
    }

output {
  elasticsearch {
    host => "140.92.25.241"
    codec => "json"
    index => "logstash-%{+YYYY.MM.dd}"
  }
  stdout { codec => rubydebug }
}

Run following command will be occurs some errors
$/opt/logstash/bin/logstash --config /etc/logstash/conf.d/logstash.conf

Dec 28, 2015 3:05:31 PM org.elasticsearch.node.internal.InternalNode
INFO: [logstash-es_course-27073-13456] version[1.5.1], pid[27073], build[5e38401/2015-04-09T13:41:35Z]
Dec 28, 2015 3:05:31 PM org.elasticsearch.node.internal.InternalNode
INFO: [logstash-es_course-27073-13456] initializing ...
Dec 28, 2015 3:05:31 PM org.elasticsearch.plugins.PluginsService
INFO: [logstash-es_course-27073-13456] loaded , sites
Dec 28, 2015 3:05:33 PM org.elasticsearch.node.internal.InternalNode
INFO: [logstash-es_course-27073-13456] initialized
Dec 28, 2015 3:05:33 PM org.elasticsearch.node.internal.InternalNode start
INFO: [logstash-es_course-27073-13456] starting ...
Dec 28, 2015 3:05:33 PM org.elasticsearch.transport.TransportService doStart
INFO: [logstash-es_course-27073-13456] bound_address {inet[/0:0:0:0:0:0:0:0:9301]}, publish_address {inet[/140.92.25.241:9301]}
Dec 28, 2015 3:05:33 PM org.elasticsearch.discovery.DiscoveryService doStart
INFO: [logstash-es_course-27073-13456] elasticsearch/Ifid6K90RYWPQzNCLCgVqg
Dec 28, 2015 3:06:03 PM org.elasticsearch.discovery.DiscoveryService waitForInitialState
WARNING: [logstash-es_course-27073-13456] waited for 30s and no initial state was set by the discovery
Dec 28, 2015 3:06:03 PM org.elasticsearch.node.internal.InternalNode start
INFO: [logstash-es_course-27073-13456] started
Failed to install template: waited for [30s] {:level=>:error}
Logstash startup completed

Any one can help?

Jason

It looks like LS just can't reach ES. Try using the HTTP protocol and making sure you can reach ES from the LS box.

Hi Mark,

Its resolved by adding 'protocol => http', why must added this property to elasticsearch of output of logstash configure file? (the ELK stack is installed on all in 1)

another problem is occurs on start logstash, the error log is

Sending logstash logs to /var/log/logstash/logstash.log.
The error reported is:
the scheme http does not accept registry part: es_course:9200 (or bad hostname?)

Its happened if I change from host => "140.92.25.241" to host => "es_course" of logstash config file

/etc/hosts configure as following

140.92.25.241 es_course

I don't know whyit never happened before elasticsearch cluster

Thanks.

Because if you use the default protocol (node), you also need the cluster name.
But 2.X has moved to HTTP by default, so you might as well jump on the bandwagon now!

Hi Mark,

Thanks, 2.x seems to be better

I have another question as previous said as following

another problem is occurs on start logstash, the error log is

Sending logstash logs to /var/log/logstash/logstash.log.
The error reported is:
the scheme http does not accept registry part: es_course:9200 (or bad hostname?)

Its happened if I change from host => "140.92.25.241" to host => "es_course" of logstash config file

/etc/hosts configure as following

140.92.25.241 es_course

I don't know whyit never happened before elasticsearch cluster

Check https://www.elastic.co/guide/en/logstash/2.1/plugins-outputs-elasticsearch.html#plugins-outputs-elasticsearch-hosts

Hi Mark,

As the document said, if protocol used default, it should tell port 9300 to logstash (host specified in 'es_course')

Case by if the logstash has installed in different with elasticsearch, following setting works fine

    elasticsearch {
            host => "es_course"
            codec => "json"
            protocol => "http"
            index => "logstash-%{+YYYY.MM.dd}"
    }

else if logstash and elasticsearch are installed on the same host, it is not work fine with the following configuration

output {
elasticsearch {
host => "es_course"
port => 9300
codec => "json"
#protocol => "http"
index => "logstash-%{+YYYY.MM.dd}"
}
stdout { codec => rubydebug }
}