New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Embedded ElasticSearch instance to install plugins like cloud-aws, cloud-gce, etc. #1328

Closed
shurane opened this Issue May 5, 2014 · 11 comments

Comments

Projects
None yet
5 participants
@shurane
Contributor

shurane commented May 5, 2014

Request

Expose and document embedded ElasticSearch instance to install plugins (cloud-aws, cloud-gce, etc) inside Logstash.

Motivation

I tried connecting my Logstash node to an ElasticSearch cluster over AWS. I connect the ES nodes in the ES cluster using the cloud-aws plugin. Connecting my LS node took a bit more time, mainly because I couldn't find a way to install the cloud-aws plugin from Logstash. While the ES nodes connected to each other happily, my Logstash node just refused to connect. Even running a separate local instance of ES connected to the cluster fine, but LS did not communicate to the local instance of ES (using output { elasticsearch { host => localhost cluster => "logstash" } }). I did eventually resolve this issue by rsyncing over the cloud-aws/ plugin into logstash-1.4.0/vendor/jar/elasticsearch-1.0.1/plugins/.

Alternatively, I could have just rsynced the elasticsearch-1.0.1/bin/ directory over to logstash-1.4.0/vendor/jar/elasticsearch-1.0.1/bin/, and then install plugins and treat it as if it was a regular version of elasticsearch.

My Approach

Some terminal output

ehtesh@ackee:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 12.04.4 LTS
Release:        12.04
Codename:       precise
ehtesh@ackee:~$ ls
cloud-aws elasticsearch-1.0.1  elasticsearch-1.0.1.tar.gz  logstash-1.4.0  logstash-1.4.0.tar.gz  logstash.conf configs
ehtesh@ackee:~$ elasticsearch-1.0.1/bin/plugin -install elasticsearch/elasticsearch-cloud-aws/2.0.0.RC1
Trying http://download.elasticsearch.org/elasticsearch/elasticsearch-cloud-aws/elasticsearch-cloud-aws-2.0.0.RC1.zip...
Downloading ......................................................................................................................................................................................................................................................................
..................................................................................................................................................................................................................................................................................
..................................................................................................................................................................................................................................................................................
..................................................................................................................................................................................................................................................................................
..............................................................................................................................................................DONE
Installed elasticsearch/elasticsearch-cloud-aws/2.0.0.RC1 into /home/ubuntu/elasticsearch-1.0.1/plugins/cloud-aws
ehtesh@ackee:~$ cat configs/elasticsearch.yml
node.name: logstash-indexer
cluster.name: logstash
plugin.mandatory: cloud-aws

cloud:
    aws:
        access_key: <snipped>
        secret_key: <snipped>
        region: us-east
discovery:
    type: ec2
    ec2:
        groups: prod-logstash
ehtesh@ackee:~$ cat logstash.conf
input {
    stdin { type => "foo" }
}

output {
    elasticsearch { cluster => "logstash" }
    stdout { codec => rubydebug }
}
ehtesh@ackee:~$ logstash-1.4.0/bin/logstash -f logstash.conf
... <snipped warnings> ...
log4j, [2014-05-05T03:51:27.690]  WARN: org.elasticsearch.discovery: [logstash-ackee-14405-2026] waited for 30s and no initial state was set by the discovery
Exception in thread ">output" org.elasticsearch.discovery.MasterNotDiscoveredException: waited for [30s]
        at org.elasticsearch.action.support.master.TransportMasterNodeOperationAction$3.onTimeout(org/elasticsearch/action/support/master/TransportMasterNodeOperationAction.java:180)
        at org.elasticsearch.cluster.service.InternalClusterService$NotifyTimeout.run(org/elasticsearch/cluster/service/InternalClusterService.java:491)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(java/util/concurrent/ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(java/util/concurrent/ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(java/lang/Thread.java:744)
^C
ehtesh@ackee:~$ cp configs/elasticsearch.yml .
ehtesh@ackee:~$ logstash-1.4.0/bin/logstash -f logstash.conf
... <snipped warnings> ...
Exception in thread ">output" org.elasticsearch.ElasticsearchException: Missing mandatory plugins [cloud-aws]
        at org.elasticsearch.plugins.PluginsService.<init>(org/elasticsearch/plugins/PluginsService.java:130)
        at org.elasticsearch.node.internal.InternalNode.<init>(org/elasticsearch/node/internal/InternalNode.java:143)
        at org.elasticsearch.node.NodeBuilder.build(org/elasticsearch/node/NodeBuilder.java:159)
        at org.elasticsearch.node.NodeBuilder.node(org/elasticsearch/node/NodeBuilder.java:166)
        at java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:606)
        at RUBY.build_client(/home/ubuntu/logstash-1.4.0/lib/logstash/outputs/elasticsearch/protocol.rb:198)
        at RUBY.client(/home/ubuntu/logstash-1.4.0/lib/logstash/outputs/elasticsearch/protocol.rb:15)
        at RUBY.initialize(/home/ubuntu/logstash-1.4.0/lib/logstash/outputs/elasticsearch/protocol.rb:157)
        at RUBY.register(/home/ubuntu/logstash-1.4.0/lib/logstash/outputs/elasticsearch.rb:238)
        at org.jruby.RubyArray.each(org/jruby/RubyArray.java:1613)
        at RUBY.outputworker(/home/ubuntu/logstash-1.4.0/lib/logstash/pipeline.rb:220)
        at RUBY.start_outputs(/home/ubuntu/logstash-1.4.0/lib/logstash/pipeline.rb:152)
^C
ehtesh@ackee:~$ grep -v "plugin.mandatory" elasticsearch.yml > temp && mv temp elasticsearch.yml
ehtesh@ackee:~$ logstash-1.4.0/bin/logstash -f logstash.conf
... <snipped warnings> ...
Exception in thread ">output" org.elasticsearch.common.settings.NoClassSettingsException: Failed to load class setting [discovery.type] with value [ec2]
        at org.elasticsearch.common.settings.ImmutableSettings.loadClass(org/elasticsearch/common/settings/ImmutableSettings.java:448)
        at org.elasticsearch.common.settings.ImmutableSettings.getAsClass(org/elasticsearch/common/settings/ImmutableSettings.java:436)
        at org.elasticsearch.discovery.DiscoveryModule.spawnModules(org/elasticsearch/discovery/DiscoveryModule.java:51)
        at org.elasticsearch.common.inject.ModulesBuilder.add(org/elasticsearch/common/inject/ModulesBuilder.java:44)
        at org.elasticsearch.node.internal.InternalNode.<init>(org/elasticsearch/node/internal/InternalNode.java:166)
        at org.elasticsearch.node.NodeBuilder.build(org/elasticsearch/node/NodeBuilder.java:159)
        at org.elasticsearch.node.NodeBuilder.node(org/elasticsearch/node/NodeBuilder.java:166)
        at java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:606)
        at RUBY.build_client(/home/ubuntu/logstash-1.4.0/lib/logstash/outputs/elasticsearch/protocol.rb:198)
        at RUBY.client(/home/ubuntu/logstash-1.4.0/lib/logstash/outputs/elasticsearch/protocol.rb:15)
        at RUBY.initialize(/home/ubuntu/logstash-1.4.0/lib/logstash/outputs/elasticsearch/protocol.rb:157)
        at RUBY.register(/home/ubuntu/logstash-1.4.0/lib/logstash/outputs/elasticsearch.rb:238)
        at org.jruby.RubyArray.each(org/jruby/RubyArray.java:1613)
        at RUBY.outputworker(/home/ubuntu/logstash-1.4.0/lib/logstash/pipeline.rb:220)
        at RUBY.start_outputs(/home/ubuntu/logstash-1.4.0/lib/logstash/pipeline.rb:152)
        at java.lang.Thread.run(java/lang/Thread.java:744)
Caused by: java.lang.ClassNotFoundException: org.elasticsearch.discovery.ec2.Ec2DiscoveryModule
        at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at org.jruby.util.JRubyClassLoader.findClass(JRubyClassLoader.java:128)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
        at org.elasticsearch.common.settings.ImmutableSettings.loadClass(ImmutableSettings.java:446)
        at org.elasticsearch.common.settings.ImmutableSettings.getAsClass(ImmutableSettings.java:436)
        at org.elasticsearch.discovery.DiscoveryModule.spawnModules(DiscoveryModule.java:51)
        at org.elasticsearch.common.inject.ModulesBuilder.add(ModulesBuilder.java:44)
        at org.elasticsearch.node.internal.InternalNode.<init>(InternalNode.java:166)
        at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:159)
        at org.elasticsearch.node.NodeBuilder.node(NodeBuilder.java:166)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(JavaMethod.java:440
        at org.jruby.javasupport.JavaMethod.invokeDirect(JavaMethod.java:304)
        at org.jruby.java.invokers.InstanceMethodInvoker.call(InstanceMethodInvoker.java:52)
        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:306)
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:136)
        at org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:60)
        at org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:60)
        at org.jruby.ast.ReturnNode.interpret(ReturnNode.java:92)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
        at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
        at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74)
        at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:182)
        at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:198)
        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:326)
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:170)
        at org.jruby.ast.FCallOneArgNode.interpret(FCallOneArgNode.java:36)
        at org.jruby.ast.InstAsgnNode.interpret(InstAsgnNode.java:95)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
        at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
        at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74)
        at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:139)
        at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:182)
        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:306)
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:136)
        at org.jruby.ast.VCallNode.interpret(VCallNode.java:88)
        at org.jruby.ast.InstAsgnNode.interpret(InstAsgnNode.java:95)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
        at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
        at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74)
        at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:204)
        at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:206)
        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:336)
        at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:179)
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:183)
        at org.jruby.RubyClass.newInstance(RubyClass.java:804)
        at org.jruby.RubyClass$INVOKER$i$newInstance.call(RubyClass$INVOKER$i$newInstance.gen)
        at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodZeroOrOneOrNBlock.call(JavaMethod.java:297)
        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:326)
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:170)
        at org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
        at org.jruby.ast.InstAsgnNode.interpret(InstAsgnNode.java:95)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
        at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
        at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74)
        at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:112)
        at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:164)
        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:286)
        at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:81)
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:85)
        at org.jruby.RubySymbol$1.yieldInner(RubySymbol.java:445)
        at org.jruby.RubySymbol$1.yield(RubySymbol.java:465)
        at org.jruby.runtime.Block.yield(Block.java:142)
        at org.jruby.RubyArray.eachCommon(RubyArray.java:1606)
        at org.jruby.RubyArray.each(RubyArray.java:1613)
        at org.jruby.RubyArray$INVOKER$i$0$0$each.call(RubyArray$INVOKER$i$0$0$each.gen)
        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:316)
        at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:145)
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:149)
        at org.jruby.ast.CallNoArgBlockPassNode.interpret(CallNoArgBlockPassNode.java:53)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
        at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
        at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74)
        at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:139)
        at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:182)
        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:306)
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:136)
        at org.jruby.ast.VCallNode.interpret(VCallNode.java:88)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
        at org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:112)
        at org.jruby.runtime.Interpreted19Block.evalBlockBody(Interpreted19Block.java:206)
        at org.jruby.runtime.Interpreted19Block.yield(Interpreted19Block.java:194)
        at org.jruby.runtime.Interpreted19Block.call(Interpreted19Block.java:125)
        at org.jruby.runtime.Block.call(Block.java:101)
        at org.jruby.RubyProc.call(RubyProc.java:290)
        at org.jruby.RubyProc.call(RubyProc.java:228)
        at org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:99)
        at java.lang.Thread.run(Thread.java:744)
^C
ehtesh@ackee:~$ rsync -av --quiet elasticsearch-1.0.1/plugins/cloud-aws/ logstash-1.4.0/vendor/jar/elasticsearch-1.0.1/plugins/cloud-aws/
ehtesh@ackee:~$ logstash-1.4.0/bin/logstash -f logstash.conf
... <snipped warnings> ...
cool
{
       "message" => "cool",
      "@version" => "1",
    "@timestamp" => "2014-05-05T15:46:35.664Z",
          "type" => "foo",
          "host" => "ackee"
}
^C
ehtesh@ackee:~$ rsync -av --quiet elasticsearch-1.0.1/bin/ logstash-1.4.0/vendor/jar/elasticsearch-1.0.1/bin/
ehtesh@ackee:~$ logstash-1.4.0/vendor/jar/elasticsearch-1.0.1/bin/plugin -install lmenezes/elasticsearch-kopf
-> Installing lmenezes/elasticsearch-kopf...
Trying https://github.com/lmenezes/elasticsearch-kopf/archive/master.zip...
Downloading ......................................................................................................................................................................................................................................................................
..................................................................................................................................................................................................................................................................................
..................................................................................................................................................................................................................................................................................
..................................................................................................................................................................................................................................................................................
..............................................................................................................................................................DONE
Installed lmenezes/elasticsearch-kopf into /home/ubuntu/logstash-1.4.0/vendor/jar/elasticsearch-1.0.1/plugins/kopf
Identified as a _site plugin, moving to _site structure ...
ehtesh@ackee:~$

@shurane shurane changed the title from Allow Embedded ElasticSearch instance to install plugins to Allow Embedded ElasticSearch instance to install plugins like cloud-aws, cloud-gce, etc. May 6, 2014

@colinsurprenant

This comment has been minimized.

Show comment
Hide comment
@colinsurprenant

colinsurprenant May 10, 2014

Contributor

thanks for documenting your workaround for this. running embedded elasticseach is typically only meant for local quick & easy prototyping and testing, it wasn't mean for connecting to a cluster or even installing plugins. I suggest you install an external elasticsearch instance and use it to install your plugins and connect to your cluster. Let me know if this makes sense.

Contributor

colinsurprenant commented May 10, 2014

thanks for documenting your workaround for this. running embedded elasticseach is typically only meant for local quick & easy prototyping and testing, it wasn't mean for connecting to a cluster or even installing plugins. I suggest you install an external elasticsearch instance and use it to install your plugins and connect to your cluster. Let me know if this makes sense.

@colinsurprenant

This comment has been minimized.

Show comment
Hide comment
@colinsurprenant

colinsurprenant May 10, 2014

Contributor

Will go ahead and close this.

Contributor

colinsurprenant commented May 10, 2014

Will go ahead and close this.

@shurane

This comment has been minimized.

Show comment
Hide comment
@shurane

shurane May 13, 2014

Contributor

So Logstash uses ES to connect to a cluster anyhow. I'm talking about:

output {
    elasticsearch { cluster => "logstash" }
    stdout { codec => rubydebug }
}

That relies on the ES that's bundled with Logstash, as far as I can tell.

I'm not sure how else Logstash is supposed to connect to an ES cluster on AWS or GCE.

Although, I know that @imperialwicket from IRC got it up and running another way, though.

Contributor

shurane commented May 13, 2014

So Logstash uses ES to connect to a cluster anyhow. I'm talking about:

output {
    elasticsearch { cluster => "logstash" }
    stdout { codec => rubydebug }
}

That relies on the ES that's bundled with Logstash, as far as I can tell.

I'm not sure how else Logstash is supposed to connect to an ES cluster on AWS or GCE.

Although, I know that @imperialwicket from IRC got it up and running another way, though.

@colinsurprenant

This comment has been minimized.

Show comment
Hide comment
@colinsurprenant

colinsurprenant May 15, 2014

Contributor

Ok, there are 2 things here:

  • starting/using an embedded ES server. A local ES server will be started locally and data can be indexed in this local ES.
  • logstash using the ES libraries (known as the node or transport protocols) to communicate with a remote ES server.

when using:

output {
  elasticsearch {
    host => "some_host"
    cluster => "logstash"
  }
}

logstash will send data to a ES server running on some_host using the node protocol (which is the default, using port 9300). You can also use the http protocol to talk to a remote ES server using the protocol => "http" option.

Does this make sense?

Contributor

colinsurprenant commented May 15, 2014

Ok, there are 2 things here:

  • starting/using an embedded ES server. A local ES server will be started locally and data can be indexed in this local ES.
  • logstash using the ES libraries (known as the node or transport protocols) to communicate with a remote ES server.

when using:

output {
  elasticsearch {
    host => "some_host"
    cluster => "logstash"
  }
}

logstash will send data to a ES server running on some_host using the node protocol (which is the default, using port 9300). You can also use the http protocol to talk to a remote ES server using the protocol => "http" option.

Does this make sense?

@shurane

This comment has been minimized.

Show comment
Hide comment
@shurane

shurane May 16, 2014

Contributor

Alright, that does make more sense. The embedded ES server uses the same ES libraries that are used for the node or transport protocols when logstash communicates to an ES cluster, correct? Thanks, clears up a bit.

I think what I was trying to say is that with an ES cluster on AWS EC2, logstash cannot discover the cluster using the ES libraries, as by default, the ES cluster on AWS EC2 discovers each other not with multicast/unicast/IP addresses, but using the cloud-aws plugin.

I hope that clears things up a bit.

Contributor

shurane commented May 16, 2014

Alright, that does make more sense. The embedded ES server uses the same ES libraries that are used for the node or transport protocols when logstash communicates to an ES cluster, correct? Thanks, clears up a bit.

I think what I was trying to say is that with an ES cluster on AWS EC2, logstash cannot discover the cluster using the ES libraries, as by default, the ES cluster on AWS EC2 discovers each other not with multicast/unicast/IP addresses, but using the cloud-aws plugin.

I hope that clears things up a bit.

@colinsurprenant

This comment has been minimized.

Show comment
Hide comment
@colinsurprenant

colinsurprenant May 17, 2014

Contributor

That's right, logstash includes the ES jars which are used either to spin an embedded ES server or for providing the node/transport protocol.

For speaking to your AWS cluster, you should be able to connect with both node/transport or http, given you expose the correct tcp ports (by default 9200 for http and 9300 for node/transport). Unless you have particular reason for using node/transport, I'd suggest you use http when connecting to a remote cluster.

Let me know if that help.

Contributor

colinsurprenant commented May 17, 2014

That's right, logstash includes the ES jars which are used either to spin an embedded ES server or for providing the node/transport protocol.

For speaking to your AWS cluster, you should be able to connect with both node/transport or http, given you expose the correct tcp ports (by default 9200 for http and 9300 for node/transport). Unless you have particular reason for using node/transport, I'd suggest you use http when connecting to a remote cluster.

Let me know if that help.

@joekiller

This comment has been minimized.

Show comment
Hide comment
@joekiller

joekiller Jul 11, 2014

Contributor

For anyone trying to run the cloud-aws plugin I solved it via: elastic/elasticsearch-cloud-aws#71 (comment)

Contributor

joekiller commented Jul 11, 2014

For anyone trying to run the cloud-aws plugin I solved it via: elastic/elasticsearch-cloud-aws#71 (comment)

@jlintz

This comment has been minimized.

Show comment
Hide comment
@jlintz

jlintz Aug 1, 2014

Just ran into this issue as well. Would really love the ability to easily install the cloud-aws plugin to have it connect to my existing ES cluster. Was unable to find any documentation on how to go about doing so, and this github issue was the only reference I've found

jlintz commented Aug 1, 2014

Just ran into this issue as well. Would really love the ability to easily install the cloud-aws plugin to have it connect to my existing ES cluster. Was unable to find any documentation on how to go about doing so, and this github issue was the only reference I've found

@vdbrooks

This comment has been minimized.

Show comment
Hide comment
@vdbrooks

vdbrooks Aug 1, 2014

+1 for @jlintz comment. I am implementing this today on AWS and also need the ability to install the cloud-aws plugin via Logstash. Have some hope that @joekiller solution will be the answer.

vdbrooks commented Aug 1, 2014

+1 for @jlintz comment. I am implementing this today on AWS and also need the ability to install the cloud-aws plugin via Logstash. Have some hope that @joekiller solution will be the answer.

@jlintz

This comment has been minimized.

Show comment
Hide comment
@jlintz

jlintz Aug 1, 2014

@vdbrooks I ended up just setting up a non-data ES instance with the cloud-aws plugin configured and then pointed logstash at localhost to workaround this. It was a bit more straight forward to handle with the puppet modules

jlintz commented Aug 1, 2014

@vdbrooks I ended up just setting up a non-data ES instance with the cloud-aws plugin configured and then pointed logstash at localhost to workaround this. It was a bit more straight forward to handle with the puppet modules

@joekiller

This comment has been minimized.

Show comment
Hide comment
@joekiller

joekiller Aug 1, 2014

Contributor

The easiest way for me to make this work is to install ElasticSearch 1.1.1 from the binaries, install the cloud-aws plugin via their bin/plugin script and then add to my /etc/sysconfig/logstash entry the following:

LS_JAVA_OPTS="$LS_JAVA_OPTS -Des.path.home=/usr/local/elasticsearch -Des.config=/opt/logstash/elasticsearch.yml"

The LS_JAVA_OPTS is picked up by bin/logstash and appended to the startup. You can modify anything that ElasticSearch is looking for by checking out the following reference: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/setup-dir-layout.html

I just set my es.path.home to the root of the elasticsearch install because that allows it to resolve the {es.home}/plugins path as well which is easier than copying stuff all over the place.

YOU MUST MATCH ES BINARY VERSIONS FOR THIS TO WORK. IE ES 1.1.1 is what Logstash 1.4.2 uses. This all works because logstash's internal ElasticSearch jar file is referenced first so the only jars that are loaded afterwards are those which are not present at startup.

Side note you can see from elasticsearch's bin/plugin file that it is really just a java call that they are executing (https://github.com/elasticsearch/elasticsearch/blob/master/bin/plugin). Someone could feasibly use the jar files in logstash's vendor/jar/elasticsearch/lib directory to make the proper org.elasticsearch.plugins.PluginManager call but I'm not bothering because I'm installing a mirror ES 1.1.1 binary on the machine along with logstash to get the plugin. Different strokes people but in the end, use the java opts to make logstash do your dance.

Contributor

joekiller commented Aug 1, 2014

The easiest way for me to make this work is to install ElasticSearch 1.1.1 from the binaries, install the cloud-aws plugin via their bin/plugin script and then add to my /etc/sysconfig/logstash entry the following:

LS_JAVA_OPTS="$LS_JAVA_OPTS -Des.path.home=/usr/local/elasticsearch -Des.config=/opt/logstash/elasticsearch.yml"

The LS_JAVA_OPTS is picked up by bin/logstash and appended to the startup. You can modify anything that ElasticSearch is looking for by checking out the following reference: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/setup-dir-layout.html

I just set my es.path.home to the root of the elasticsearch install because that allows it to resolve the {es.home}/plugins path as well which is easier than copying stuff all over the place.

YOU MUST MATCH ES BINARY VERSIONS FOR THIS TO WORK. IE ES 1.1.1 is what Logstash 1.4.2 uses. This all works because logstash's internal ElasticSearch jar file is referenced first so the only jars that are loaded afterwards are those which are not present at startup.

Side note you can see from elasticsearch's bin/plugin file that it is really just a java call that they are executing (https://github.com/elasticsearch/elasticsearch/blob/master/bin/plugin). Someone could feasibly use the jar files in logstash's vendor/jar/elasticsearch/lib directory to make the proper org.elasticsearch.plugins.PluginManager call but I'm not bothering because I'm installing a mirror ES 1.1.1 binary on the machine along with logstash to get the plugin. Different strokes people but in the end, use the java opts to make logstash do your dance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment