mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 06:37:19 -04:00
Merge pull request #1263 from elasticsearch/bug/fix-es-embedded-startup-delay
Start ES embedded server before creating a client.
This commit is contained in:
commit
066a3b7e1c
1 changed files with 7 additions and 6 deletions
|
@ -234,12 +234,6 @@ class LogStash::Outputs::ElasticSearch < LogStash::Outputs::Base
|
|||
LogStash::Outputs::Elasticsearch::Protocols::HTTPClient
|
||||
end
|
||||
|
||||
@client = client_class.new(options)
|
||||
|
||||
@logger.info("New Elasticsearch output", :cluster => @cluster,
|
||||
:host => @host, :port => @port, :embedded => @embedded,
|
||||
:protocol => @protocol)
|
||||
|
||||
if @embedded
|
||||
raise(LogStash::ConfigurationError, "The 'embedded => true' setting is only valid for the elasticsearch output under JRuby. You are running #{RUBY_DESCRIPTION}") unless LogStash::Environment.jruby?
|
||||
LogStash::Environment.load_elasticsearch_jars!
|
||||
|
@ -253,6 +247,12 @@ class LogStash::Outputs::ElasticSearch < LogStash::Outputs::Base
|
|||
start_local_elasticsearch
|
||||
end
|
||||
|
||||
@client = client_class.new(options)
|
||||
|
||||
@logger.info("New Elasticsearch output", :cluster => @cluster,
|
||||
:host => @host, :port => @port, :embedded => @embedded,
|
||||
:protocol => @protocol)
|
||||
|
||||
|
||||
if @manage_template
|
||||
@logger.info("Automatic template management enabled", :manage_template => @manage_template.to_s)
|
||||
|
@ -303,6 +303,7 @@ class LogStash::Outputs::ElasticSearch < LogStash::Outputs::Base
|
|||
#builder.local(true)
|
||||
builder.settings.put("cluster.name", @cluster) if @cluster
|
||||
builder.settings.put("node.name", @node_name) if @node_name
|
||||
builder.settings.put("network.host", @bind_host) if @bind_host
|
||||
builder.settings.put("http.port", @embedded_http_port)
|
||||
|
||||
@embedded_elasticsearch = builder.node
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue