org.elasticsearch.bootstrap.Elasticsearch V5.0.0 How to configure?


#1

Hi,

I'm having trouble to run org.elasticsearch.bootstrap.Bootstrap class in the newest 5.0.0 version (in a former 2.x version everything worked like a charme).

I think I have a configuration failure, but can't figure it out - plz help!

In my sample project I added the elastic dependency and the log4j2 dependencies in the pom.xml:

<dependencies>
        <dependency>
            <groupId>org.elasticsearch</groupId>
            <artifactId>elasticsearch</artifactId>
            <version>5.0.0</version>
        </dependency>

I created a log4j2.properties and an elasticsearch.yml with the simple content:
http.port: "9201"

Besides I created a simple java security policy file:
grant {
permission java.security.AllPermission;
};

I try to run the Elasticsearch class with the arguments:
VM options: -Djava.security.policy="/home/tmp/elasticconfig/config/test.policy" Program arguments: -Epath.home="/home/tmp/elasticconfig"

But then the exception occurs:

[WARN ] 2016-11-08 22:46:59.587 [main] ElasticsearchUncaughtExceptionHandler - uncaught exception in thread [main] org.elasticsearch.bootstrap.StartupException: java.lang.IllegalArgumentException: Unknown [transport] type [] possible values: [local] at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:116) ~[elasticsearch-5.0.0.jar:5.0.0] at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:103) ~[elasticsearch-5.0.0.jar:5.0.0] at org.elasticsearch.cli.SettingCommand.execute(SettingCommand.java:54) ~[elasticsearch-5.0.0.jar:5.0.0] at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:96) ~[elasticsearch-5.0.0.jar:5.0.0] at org.elasticsearch.cli.Command.main(Command.java:62) ~[elasticsearch-5.0.0.jar:5.0.0] at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:80) ~[elasticsearch-5.0.0.jar:5.0.0] at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:73) ~[elasticsearch-5.0.0.jar:5.0.0] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_102] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_102] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_102] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_102] at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147) ~[idea_rt.jar:?] Caused by: java.lang.IllegalArgumentException: Unknown [transport] type [] possible values: [local] at org.elasticsearch.common.util.ExtensionPoint$SelectedType.bindType(ExtensionPoint.java:151) ~[elasticsearch-5.0.0.jar:5.0.0] at org.elasticsearch.common.network.NetworkModule.configure(NetworkModule.java:148) ~[elasticsearch-5.0.0.jar:5.0.0] at org.elasticsearch.common.inject.AbstractModule.configure(AbstractModule.java:60) ~[elasticsearch-5.0.0.jar:5.0.0] at org.elasticsearch.common.inject.spi.Elements$RecordingBinder.install(Elements.java:221) ~[elasticsearch-5.0.0.jar:5.0.0] at org.elasticsearch.common.inject.spi.Elements.getElements(Elements.java:96) ~[elasticsearch-5.0.0.jar:5.0.0] at org.elasticsearch.common.inject.InjectorShell$Builder.build(InjectorShell.java:142) ~[elasticsearch-5.0.0.jar:5.0.0] at org.elasticsearch.common.inject.InjectorBuilder.build(InjectorBuilder.java:90) ~[elasticsearch-5.0.0.jar:5.0.0] at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:96) ~[elasticsearch-5.0.0.jar:5.0.0] at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:70) ~[elasticsearch-5.0.0.jar:5.0.0] at org.elasticsearch.common.inject.ModulesBuilder.createInjector(ModulesBuilder.java:43) ~[elasticsearch-5.0.0.jar:5.0.0] at org.elasticsearch.node.Node.<init>(Node.java:403) ~[elasticsearch-5.0.0.jar:5.0.0] at org.elasticsearch.node.Node.<init>(Node.java:220) ~[elasticsearch-5.0.0.jar:5.0.0] at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:191) ~[elasticsearch-5.0.0.jar:5.0.0] at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:191) ~[elasticsearch-5.0.0.jar:5.0.0] at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:286) ~[elasticsearch-5.0.0.jar:5.0.0] at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:112) ~[elasticsearch-5.0.0.jar:5.0.0] ... 11 more
Whats wrong??


(Yannick Welsch) #2

Have a look at https://www.elastic.co/blog/elasticsearch-the-server
especially the last section "Embedded Elasticsearch not supported".

What's the reason for embedding Elasticsearch in your application? Isn't it sufficient to use the transport client to connect to a properly packaged ES instance?


#3

Thanks for the reply.
I don't want to embed Elasticsearch in my application, the reason why I want to start Elasticsearch like this it, that I want to be able to debug Elasticsearch, e.g. when I develop plugins for it.


(Yannick Welsch) #4

For plugin development you can use Elasticsearch's own testing framework (see http://david.pilato.fr/blog/2016/10/16/creating-a-plugin-for-elasticsearch-5-dot-0-using-maven-updated-for-ga/ for an example on how to do this with Maven).


(system) #5

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.