supriya
(prasad)
June 6, 2016, 2:10pm
1
Hi,
We had ElasticSearch with 1.4.2 and had code using TransportClient.
We are now trying to upgrade to ES 2.3.2 but I am facing several issues with the jar files.
This is the code used to connect to ES server using TransportClient
Settings settings = Settings.settingsBuilder()
.put( "cluster.name ", OnedataProperties.ES_CLUSTER_NAME )
.put( "node.http.enabled", nodeHttpEnable ).put( "gateway.type", gatewaytype )
.put( "client.transport.sniff", transportSnif ).put( "index.store.type", indexStortype )
.build();
client = TransportClient.builder().settings( settings ).build();
( (TransportClient) client ).addTransportAddress( new InetSocketTransportAddress( InetAddress
.getByName( "XX.XX.XX.XX" ), 9300 ) );
With 1.4.2, I had included only lucene-core, lucene-analyzers-common, guava and elasticsearch jar files in my client application and it was working fine. After upgrade, I have upgraded the version of the 4 jar files to use the ones in sync with ES 2.3.2. However, when I run my application, it keeps throwing me dependency errors one by one - stating that it needs jsr166e-1.1.0.jar, t-digest-3.0.jar, netty.jar etc. The list is growing and seems endless.
Can you please let me know
Is there a thin client version of the ElasticSearch library that can be included in the client application?
What is the complete list of jar files that I need to include in my client application to work with ES 2.3.2?
I have used the default elasticsearch.yml file that comes with the installation. Are there any changes that need to be done in the yml file?
Thanks,
Supriya
dadoonet
(David Pilato)
June 6, 2016, 6:49pm
2
supriya:
Is there a thin client version of the Elasticsearch library that can be included in the client application?
Not yet.
elastic:master
← javanna:feature/http_client
opened 11:29PM - 03 Jun 16 UTC
The low level RestClient can be created by simply providing the hosts that it sh… ould point to: `RestClient.builder().setHosts(new HttpHost("localhost", 9200).build()`.
It also allows to provide a `CloseableHttpClient` instance to be used, otherwise one with default settings is going to be created.
It exposes a `performRequest` method, that accepts all the needed arguments to send an http request: method, endpoint, parameters, body, and headers.
It supports trace logging like all other language clients, to log each request and response in curl format.
`client` is a new gradle submodule that depends on apache http client and only a few other transitive deps.
`client-sniffer` is an additional gradle submodule that depends on `client` and jackson, as it's able to parse the nodes info api response and inject hosts into an existing RestClient instance. Sniffer comes also with a listener that gets notified on failure and can optionally sniff hosts on failure.
Both new modules are java 7 compatible and get compiled with source 1.7 & target 1.7.
This PR also makes our Rest tests use the new RestClient, and it also replaces any usage of apache http client in tests with the new low level RestClient.
What's left, which can probably be worked on after this PR gets in:
- write some more tests, especially around custom http clients, concurrency and sniffing task.
- javadocs should be ok but we need some docs page on how to use it and configuration for common scenarios like ssl, proxy, basic auth etc. (although we can refer to apache http client documentation)
- add async variant of performRequest method
Closes #7743
You should use Maven or Gradle to get the dependencies.
Here we go:
$ mvn dependency:tree
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Elasticsearch: Core 2.3.4-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ elasticsearch ---
[INFO] org.elasticsearch:elasticsearch:jar:2.3.4-SNAPSHOT
[INFO] +- org.hamcrest:hamcrest-all:jar:1.3:test
[INFO] +- com.carrotsearch.randomizedtesting:randomizedtesting-runner:jar:2.3.2:test
[INFO] | \- junit:junit:jar:4.11:test
[INFO] +- org.apache.lucene:lucene-test-framework:jar:5.5.0:test
[INFO] | \- org.apache.lucene:lucene-codecs:jar:5.5.0:test
[INFO] +- org.apache.httpcomponents:httpclient:jar:4.3.6:test
[INFO] | +- org.apache.httpcomponents:httpcore:jar:4.3.3:test
[INFO] | +- commons-logging:commons-logging:jar:1.1.3:test
[INFO] | \- commons-codec:commons-codec:jar:1.6:test
[INFO] +- com.google.jimfs:jimfs:jar:1.0:test
[INFO] +- org.apache.lucene:lucene-core:jar:5.5.0:compile
[INFO] +- org.apache.lucene:lucene-backward-codecs:jar:5.5.0:compile
[INFO] +- org.apache.lucene:lucene-analyzers-common:jar:5.5.0:compile
[INFO] +- org.apache.lucene:lucene-queries:jar:5.5.0:compile
[INFO] +- org.apache.lucene:lucene-memory:jar:5.5.0:compile
[INFO] +- org.apache.lucene:lucene-highlighter:jar:5.5.0:compile
[INFO] +- org.apache.lucene:lucene-queryparser:jar:5.5.0:compile
[INFO] | \- org.apache.lucene:lucene-sandbox:jar:5.5.0:compile
[INFO] +- org.apache.lucene:lucene-suggest:jar:5.5.0:compile
[INFO] | \- org.apache.lucene:lucene-misc:jar:5.5.0:compile
[INFO] +- org.apache.lucene:lucene-join:jar:5.5.0:compile
[INFO] | \- org.apache.lucene:lucene-grouping:jar:5.5.0:compile
[INFO] +- org.apache.lucene:lucene-spatial:jar:5.5.0:compile
[INFO] | \- org.apache.lucene:lucene-spatial3d:jar:5.5.0:compile
[INFO] +- com.spatial4j:spatial4j:jar:0.5:compile
[INFO] +- com.vividsolutions:jts:jar:1.13:compile
[INFO] +- com.github.spullara.mustache.java:compiler:jar:0.8.13:compile
[INFO] +- com.google.guava:guava:jar:18.0:compile
[INFO] +- org.elasticsearch:securesm:jar:1.0:compile
[INFO] +- com.carrotsearch:hppc:jar:0.7.1:compile
[INFO] +- joda-time:joda-time:jar:2.9.4:compile
[INFO] +- org.joda:joda-convert:jar:1.2:compile
[INFO] +- com.fasterxml.jackson.core:jackson-core:jar:2.6.6:compile
[INFO] +- com.fasterxml.jackson.dataformat:jackson-dataformat-smile:jar:2.6.6:compile
[INFO] +- com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:jar:2.6.6:compile
[INFO] | \- org.yaml:snakeyaml:jar:1.15:compile
[INFO] +- com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:jar:2.6.6:compile
[INFO] +- io.netty:netty:jar:3.10.5.Final:compile
[INFO] +- com.ning:compress-lzf:jar:1.0.2:compile
[INFO] +- com.tdunning:t-digest:jar:3.0:compile
[INFO] +- org.hdrhistogram:HdrHistogram:jar:2.1.6:compile
[INFO] +- commons-cli:commons-cli:jar:1.3.1:compile
[INFO] +- log4j:log4j:jar:1.2.17:compile
[INFO] +- log4j:apache-log4j-extras:jar:1.2.17:compile
[INFO] +- org.slf4j:slf4j-api:jar:1.6.2:compile
[INFO] +- net.java.dev.jna:jna:jar:4.1.0:compile
[INFO] \- com.twitter:jsr166e:jar:1.1.0:compile
If you want to be able to access elasticsearch from another machine, you'll have to define network.host
.
HTH
where should i use "mvn dependency:tree"?
Have you sloved your issue?would you please list the dependcy jar what are needed to run elaticsearch .
dadoonet
(David Pilato)
June 24, 2016, 10:01am
5
Have you sloved your issue?would you please list the dependcy jar what are needed to run elaticsearch .
I already gave that list Issues faced during ES upgrade from 1.4.2 to 2.3.2 - #2 by dadoonet
where should i use "mvn dependency:tree"?
Download the source code. git checkout the version you need. Then run the command.