Elasticsearch - node client does not connect to cluster

2015-03-17 Thread Александр Свиридов

I have one physical server and I work only on it (no other servers).
At this server I have running elastic 1.4.2 - I use this version as this is the 
last version elastic osgi bundle is ready for. Also at this server I have 
glassfish 4.1 as java-ee server.
I run elastic node client inside my java-ee application. And I do it this way:
Node node = nodeBuilder().local(true).clusterName(elasticsearch).node();
Client client = node.client();
GetResponse getResponse = 
client.prepareGet(my.index-0.2.2,post,1).execute().actionGet();
MapString,Object source = getResponse.getSource();
System.out.println(--);
System.out.println(Index: + getResponse.getIndex());
System.out.println(Type: + getResponse.getType());
System.out.println(Id: + getResponse.getId());
System.out.println(Version: + getResponse.getVersion());
System.out.println(source);

In log I see the following:
[2015-03-17T12:57:44.447+0400] [glassfish 4.1] [INFO] [] 
[org.elasticsearch.discovery] [tid: _ThreadID=30 
_ThreadName=http-listener-1(1)] [timeMillis: 1426582664447] [levelValue: 800] 
[[ [Pistol] elasticsearch/SCKIrGHQTaC5eEYmYfZ0Iw]]
[2015-03-17T12:57:44.449+0400] [glassfish 4.1] [INFO] [] 
[org.elasticsearch.cluster.service] [tid: _ThreadID=128 
_ThreadName=elasticsearch[Pistol][clusterService#updateTask][T#1]] 
[timeMillis: 1426582664449] [levelValue: 800] [[ [Pistol] master {new 
[Pistol][SCKIrGHQTaC5eEYmYfZ0Iw][ webserver1.com ][local[1]]{local=true}}, 
removed {[Pistol][uwaWFb6KTy2Sdoc8TNwdSQ][ webserver1.com 
][local[1]]{local=true},}, reason: local-disco-initial_connect(master)]]
[2015-03-17T12:57:44.502+0400] [glassfish 4.1] [INFO] [] 
[org.elasticsearch.http] [tid: _ThreadID=30 _ThreadName=http-listener-1(1)] 
[timeMillis: 1426582664502] [levelValue: 800] [[ [Pistol] bound_address 
{inet[/0:0:0:0:0:0:0:0:9202]}, publish_address {inet[/SERVER IP:9202]}]]
[2015-03-17T12:57:44.502+0400] [glassfish 4.1] [INFO] [] 
[org.elasticsearch.node] [tid: _ThreadID=30 _ThreadName=http-listener-1(1)] 
[timeMillis: 1426582664502] [levelValue: 800] [[ [Pistol] started]]
and I get this exeption: ...
Caused by: org.elasticsearch.indices.IndexMissingException:[my.index-0.2.2] 
missing
at 
org.elasticsearch.cluster.metadata.MetaData.concreteIndices(MetaData.java:768)
at 
org.elasticsearch.cluster.metadata.MetaData.concreteIndices(MetaData.java:691)
at 
org.elasticsearch.cluster.metadata.MetaData.concreteSingleIndex(MetaData.java:748)
at 
org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction$AsyncSingleAction.init(TransportShardSingleOperationAction.java:139)
at 
org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction$AsyncSingleAction.init(TransportShardSingleOperationAction.java:116)
at 
org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction.doExecute(TransportShardSingleOperationAction.java:89)
at 
org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction.doExecute(TransportShardSingleOperationAction.java:55)
at 
org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:75)
at org.elasticsearch.client.node.NodeClient.execute(NodeClient.java:98)
at 
org.elasticsearch.client.support.AbstractClient.get(AbstractClient.java:193)
at 
org.elasticsearch.action.get.GetRequestBuilder.doExecute(GetRequestBuilder.java:201)
at 
org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:91)
at 
org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:65)

So it can't find the index - my.index-0.2.2. However this index exists! 
Besides, when I do  curl -XGET ' http://localhost:9200/_cluster/state?pretty=1 
' I see there only one node and this  is not SCKIrGHQTaC5eEYmYfZ0Iw. I suppose 
that the node I create using java API creates new cluster and dosn't connect to 
my existing cluster - that's why it says - it's master. Or I don't understand 
something I have problem with code. Besides I've checked tha name of cluster 
it's  elasticsearch . So, how can I connect to my existing elasticsearch 
cluster?

-- 
You received this message because you are subscribed to the Google Groups 
elasticsearch group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elasticsearch+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/1426605929.302531214%40f430.i.mail.ru.
For more options, visit https://groups.google.com/d/optout.


Re[2]: Elasticsearch - node client does not connect to cluster

2015-03-17 Thread Александр Свиридов
 I am quite newbie to elactis. Could you explain with java code what you mean?


Вторник, 17 марта 2015, 9:46 -07:00 от aa...@definemg.com:
Is there a reason not to just specify the IP address and to try and rely on 
multicast?

I realize this is all on one node as you have stated that, but that seems even 
more reason that it would be little issue to specify the IP.  While multicast 
makes it easy to stand up a cluster in an ideal situation, my experience has 
been that it leads to more problems down the road, and things generally work 
better when not using multicast.   I heard the same suggestion repeatedly at 
Elastic{on}.

Aaron

On Tuesday, March 17, 2015 at 9:25:46 AM UTC-6, ooo_saturn7 wrote:
I have one physical server and I work only on it (no other servers).
At this server I have running elastic 1.4.2 - I use this version as this is 
the last version elastic osgi bundle is ready for. Also at this server I have 
glassfish 4.1 as java-ee server.
I run elastic node client inside my java-ee application. And I do it this way:
Node node = nodeBuilder().local(true).clusterName(elasticsearch).node();
Client client = node.client();
GetResponse getResponse = 
client.prepareGet(my.index-0.2.2,post,1).execute().actionGet();
MapString,Object source = getResponse.getSource();
System.out.println(--);
System.out.println(Index: + getResponse.getIndex());
System.out.println(Type: + getResponse.getType());
System.out.println(Id: + getResponse.getId());
System.out.println(Version: + getResponse.getVersion());
System.out.println(source);

In log I see the following:
[2015-03-17T12:57:44.447+0400] [glassfish 4.1] [INFO] [] 
[org.elasticsearch.discovery] [tid: _ThreadID=30 
_ThreadName=http-listener-1(1)] [timeMillis: 1426582664447] [levelValue: 
800] [[ [Pistol] elasticsearch/SCKIrGHQTaC5eEYmYfZ0Iw]]
[2015-03-17T12:57:44.449+0400] [glassfish 4.1] [INFO] [] 
[org.elasticsearch.cluster.service] [tid: _ThreadID=128 
_ThreadName=elasticsearch[Pistol][clusterService#updateTask][T#1]] 
[timeMillis: 1426582664449] [levelValue: 800] [[ [Pistol] master {new 
[Pistol][SCKIrGHQTaC5eEYmYfZ0Iw][ webserver1.com ][local[1]]{local=true}}, 
removed {[Pistol][uwaWFb6KTy2Sdoc8TNwdSQ][ webserver1.com 
][local[1]]{local=true},}, reason: local-disco-initial_connect(master)]]
[2015-03-17T12:57:44.502+0400] [glassfish 4.1] [INFO] [] 
[org.elasticsearch.http] [tid: _ThreadID=30 _ThreadName=http-listener-1(1)] 
[timeMillis: 1426582664502] [levelValue: 800] [[ [Pistol] bound_address 
{inet[/0:0:0:0:0:0:0:0:9202]}, publish_address {inet[/SERVER IP:9202]}]]
[2015-03-17T12:57:44.502+0400] [glassfish 4.1] [INFO] [] 
[org.elasticsearch.node] [tid: _ThreadID=30 _ThreadName=http-listener-1(1)] 
[timeMillis: 1426582664502] [levelValue: 800] [[ [Pistol] started]]
and I get this exeption: ...
Caused by: 
 org.elasticsearch.indices.IndexMissingException:[my.index-0.2.2] missing
at 
org.elasticsearch.cluster.metadata.MetaData.concreteIndices(MetaData.java:768)
at 
org.elasticsearch.cluster.metadata.MetaData.concreteIndices(MetaData.java:691)
at 
org.elasticsearch.cluster.metadata.MetaData.concreteSingleIndex(MetaData.java:748)
at 
org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction$AsyncSingleAction.init(TransportShardSingleOperationAction.java:139)
at 
org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction$AsyncSingleAction.init(TransportShardSingleOperationAction.java:116)
at 
org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction.doExecute(TransportShardSingleOperationAction.java:89)
at 
org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction.doExecute(TransportShardSingleOperationAction.java:55)
at 
org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:75)
at org.elasticsearch.client.node.NodeClient.execute(NodeClient.java:98)
at 
org.elasticsearch.client.support.AbstractClient.get(AbstractClient.java:193)
at 
org.elasticsearch.action.get.GetRequestBuilder.doExecute(GetRequestBuilder.java:201)
at 
org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:91)
at 
org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:65)

So it can't find the index - my.index-0.2.2. However this index exists! 
Besides, when I do curl -XGET ' http://localhost:9200/_cluster/state?pretty=1 
' I see there only one node and this  is not SCKIrGHQTaC5eEYmYfZ0Iw. I 
suppose that the node I create using java API creates new cluster and dosn't 
connect to my existing cluster - that's why it says - it's master. Or I don't 
understand something I have problem with code. Besides I've checked tha name 
of cluster it's elasticsearch. So, how can I connect to my existing 
elasticsearch cluster?
-- 
You received this message because you are subscribed to the Google Groups 
elasticsearch group.
To unsubscribe from this group 

Re: Elasticsearch - node client does not connect to cluster

2015-03-17 Thread Mark Walkom
We do recommend to use unicast in production.

On 17 March 2015 at 09:46, aa...@definemg.com wrote:

 Is there a reason not to just specify the IP address and to try and rely
 on multicast?

 I realize this is all on one node as you have stated that, but that seems
 even more reason that it would be little issue to specify the IP.  While
 multicast makes it easy to stand up a cluster in an ideal situation, my
 experience has been that it leads to more problems down the road, and
 things generally work better when not using multicast.   I heard the same
 suggestion repeatedly at Elastic{on}.

 Aaron

 On Tuesday, March 17, 2015 at 9:25:46 AM UTC-6, ooo_saturn7 wrote:

 I have one physical server and I work only on it (no other servers).

 At this server I have running elastic 1.4.2 - I use this version as this
 is the last version elastic osgi bundle is ready for. Also at this server I
 have glassfish 4.1 as java-ee server.

 I run elastic node client inside my java-ee application. And I do it this
 way:

 Node node = nodeBuilder().local(true).clusterName(elasticsearch).node();
 Client client = node.client();
 GetResponse getResponse = 
 client.prepareGet(my.index-0.2.2,post,1).execute().actionGet();
 MapString,Object source = getResponse.getSource();
 System.out.println(--);
 System.out.println(Index: + getResponse.getIndex());
 System.out.println(Type: + getResponse.getType());
 System.out.println(Id: + getResponse.getId());
 System.out.println(Version: + getResponse.getVersion());
 System.out.println(source);



 In log I see the following:

 [2015-03-17T12:57:44.447+0400] [glassfish 4.1] [INFO] []
 [org.elasticsearch.discovery] [tid: _ThreadID=30
 _ThreadName=http-listener-1(1)] [timeMillis: 1426582664447] [levelValue:
 800] [[ [Pistol] elasticsearch/SCKIrGHQTaC5eEYmYfZ0Iw]]

 [2015-03-17T12:57:44.449+0400] [glassfish 4.1] [INFO] []
 [org.elasticsearch.cluster.service] [tid: _ThreadID=128
 _ThreadName=elasticsearch[Pistol][clusterService#updateTask][T#1]]
 [timeMillis: 1426582664449] [levelValue: 800] [[ [Pistol] master {new
 [Pistol][SCKIrGHQTaC5eEYmYfZ0Iw][webserver1.com][local[1]]{local=true}},
 removed {[Pistol][uwaWFb6KTy2Sdoc8TNwdSQ][webserver1.com
 ][local[1]]{local=true},}, reason: local-disco-initial_connect(master)]]

 [2015-03-17T12:57:44.502+0400] [glassfish 4.1] [INFO] []
 [org.elasticsearch.http] [tid: _ThreadID=30 _ThreadName=http-listener-1(1)]
 [timeMillis: 1426582664502] [levelValue: 800] [[ [Pistol] bound_address
 {inet[/0:0:0:0:0:0:0:0:9202]}, publish_address {inet[/SERVER IP:9202]}]]

 [2015-03-17T12:57:44.502+0400] [glassfish 4.1] [INFO] []
 [org.elasticsearch.node] [tid: _ThreadID=30 _ThreadName=http-listener-1(1)]
 [timeMillis: 1426582664502] [levelValue: 800] [[ [Pistol] started]]

 and I get this exeption: ...

 Caused by: 
 org.elasticsearch.indices.IndexMissingException:[my.index-0.2.2] missing
 at 
 org.elasticsearch.cluster.metadata.MetaData.concreteIndices(MetaData.java:768)
 at 
 org.elasticsearch.cluster.metadata.MetaData.concreteIndices(MetaData.java:691)
 at 
 org.elasticsearch.cluster.metadata.MetaData.concreteSingleIndex(MetaData.java:748)
 at 
 org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction$AsyncSingleAction.init(TransportShardSingleOperationAction.java:139)
 at 
 org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction$AsyncSingleAction.init(TransportShardSingleOperationAction.java:116)
 at 
 org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction.doExecute(TransportShardSingleOperationAction.java:89)
 at 
 org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction.doExecute(TransportShardSingleOperationAction.java:55)
 at 
 org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:75)
 at org.elasticsearch.client.node.NodeClient.execute(NodeClient.java:98)
 at 
 org.elasticsearch.client.support.AbstractClient.get(AbstractClient.java:193)
 at 
 org.elasticsearch.action.get.GetRequestBuilder.doExecute(GetRequestBuilder.java:201)
 at 
 org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:91)
 at 
 org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:65)

 So it can't find the index - my.index-0.2.2. However this index exists!
 Besides, when I do curl -XGET 'http://localhost:9200/_
 cluster/state?pretty=1' I see there only one node and this *is not*
 SCKIrGHQTaC5eEYmYfZ0Iw. I suppose that the node I create using java API
 creates new cluster and dosn't connect to my existing cluster - that's why
 it says - it's master. Or I don't understand something I have problem with
 code. Besides I've checked tha name of cluster it's elasticsearch. So,
 how can I connect to my existing elasticsearch cluster?

  --
 You received this message because you are subscribed to the Google Groups
 elasticsearch group.
 To 

Re[4]: Elasticsearch - node client does not connect to cluster

2015-03-17 Thread Александр Свиридов
 Thank you. I did this way:

 Settings settings = ImmutableSettings.settingsBuilder()
    .put(cluster.name, elasticsearch)
    .put(client.transport.sniff, true).build();

    Client client = new TransportClient(settings)
    .addTransportAddress(new 
InetSocketTransportAddress(localhost,9300));

And everything works fine. So, both cluster and index exist.

However, as I understand it is not node client. What you sugget is transport 
client. Now I want to understand how to make node client work. 


Вторник, 17 марта 2015, 11:26 -06:00 от Aaron Mefford aa...@definemg.com:
This is what I use in my code, not sure how correct it is given the abysmal 
state of the the Java API documentation.

import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.settings.ImmutableSettings;
import org.elasticsearch.client.Client;
import org.elasticsearch.client.transport.TransportClient;
import org.elasticsearch.common.transport.InetSocketTransportAddress;



        Settings settings = ImmutableSettings.settingsBuilder()
                                .put( cluster.name , elasticClusterName)
                                .put(client.transport.sniff, true).build();

        esClient = new TransportClient(settings)
            .addTransportAddress(new 
InetSocketTransportAddress(elasticHost,elasticPort));


On Tue, Mar 17, 2015 at 11:19 AM, Александр Свиридов   ooo_satu...@mail.ru  
wrote:
I am quite newbie to elactis. Could you explain with java code what you mean?


Вторник, 17 марта 2015, 9:46 -07:00 от  aa...@definemg.com :
Is there a reason not to just specify the IP address and to try and rely on 
multicast?

I realize this is all on one node as you have stated that, but that seems 
even more reason that it would be little issue to specify the IP.  While 
multicast makes it easy to stand up a cluster in an ideal situation, my 
experience has been that it leads to more problems down the road, and things 
generally work better when not using multicast.   I heard the same 
suggestion repeatedly at Elastic{on}.

Aaron

On Tuesday, March 17, 2015 at 9:25:46 AM UTC-6, ooo_saturn7 wrote:
I have one physical server and I work only on it (no other servers).
At this server I have running elastic 1.4.2 - I use this version as this is 
the last version elastic osgi bundle is ready for. Also at this server I 
have glassfish 4.1 as java-ee server.
I run elastic node client inside my java-ee application. And I do it this 
way:
Node node = nodeBuilder().local(true).clusterName(elasticsearch).node();
Client client = node.client();
GetResponse getResponse = 
client.prepareGet(my.index-0.2.2,post,1).execute().actionGet();
MapString,Object source = getResponse.getSource();
System.out.println(--);
System.out.println(Index: + getResponse.getIndex());
System.out.println(Type: + getResponse.getType());
System.out.println(Id: + getResponse.getId());
System.out.println(Version: + getResponse.getVersion());
System.out.println(source);

In log I see the following:
[2015-03-17T12:57:44.447+0400] [glassfish 4.1] [INFO] [] 
[org.elasticsearch.discovery] [tid: _ThreadID=30 
_ThreadName=http-listener-1(1)] [timeMillis: 1426582664447] [levelValue: 
800] [[ [Pistol] elasticsearch/SCKIrGHQTaC5eEYmYfZ0Iw]]
[2015-03-17T12:57:44.449+0400] [glassfish 4.1] [INFO] [] 
[org.elasticsearch.cluster.service] [tid: _ThreadID=128 
_ThreadName=elasticsearch[Pistol][clusterService#updateTask][T#1]] 
[timeMillis: 1426582664449] [levelValue: 800] [[ [Pistol] master {new 
[Pistol][SCKIrGHQTaC5eEYmYfZ0Iw][ webserver1.com ][local[1]]{local=true}}, 
removed {[Pistol][uwaWFb6KTy2Sdoc8TNwdSQ][ webserver1.com 
][local[1]]{local=true},}, reason: local-disco-initial_connect(master)]]
[2015-03-17T12:57:44.502+0400] [glassfish 4.1] [INFO] [] 
[org.elasticsearch.http] [tid: _ThreadID=30 
_ThreadName=http-listener-1(1)] [timeMillis: 1426582664502] [levelValue: 
800] [[ [Pistol] bound_address {inet[/0:0:0:0:0:0:0:0:9202]}, 
publish_address {inet[/SERVER IP:9202]}]]
[2015-03-17T12:57:44.502+0400] [glassfish 4.1] [INFO] [] 
[org.elasticsearch.node] [tid: _ThreadID=30 
_ThreadName=http-listener-1(1)] [timeMillis: 1426582664502] [levelValue: 
800] [[ [Pistol] started]]
and I get this exeption: ...
Caused by: 
 org.elasticsearch.indices.IndexMissingException:[my.index-0.2.2] missing
at 
org.elasticsearch.cluster.metadata.MetaData.concreteIndices(MetaData.java:768)
at 
org.elasticsearch.cluster.metadata.MetaData.concreteIndices(MetaData.java:691)
at 
org.elasticsearch.cluster.metadata.MetaData.concreteSingleIndex(MetaData.java:748)
at 
org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction$AsyncSingleAction.init(TransportShardSingleOperationAction.java:139)
at 
org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction$AsyncSingleAction.init(TransportShardSingleOperationAction.java:116)
at 

Re[6]: Elasticsearch - node client does not connect to cluster

2015-03-17 Thread Александр Свиридов
 I agree with you that in single node environment only transport layer should 
be used. But I want to know how to make node client work because maybe I will 
need it in future and I want to know what I can do with elastic java api.


Вторник, 17 марта 2015, 11:56 -06:00 от Aaron Mefford aa...@definemg.com:
What is the advantage you expect from using the Node client, especially in a 
single node environment?

With client.transport.sniff true it should discover the other nodes, if other 
nodes exist.

On Tue, Mar 17, 2015 at 11:42 AM, Александр Свиридов   ooo_satu...@mail.ru  
wrote:
Thank you. I did this way:

 Settings settings = ImmutableSettings.settingsBuilder()
    .put( cluster.name , elasticsearch)
    .put(client.transport.sniff, true).build();

    Client client = new TransportClient(settings)
    .addTransportAddress(new 
InetSocketTransportAddress(localhost,9300));

And everything works fine. So, both cluster and index exist.

However, as I understand it is not node client. What you sugget is transport 
client. Now I want to understand how to make node client work. 


Вторник, 17 марта 2015, 11:26 -06:00 от Aaron Mefford  aa...@definemg.com :
This is what I use in my code, not sure how correct it is given the abysmal 
state of the the Java API documentation.

import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.settings.ImmutableSettings;
import org.elasticsearch.client.Client;
import org.elasticsearch.client.transport.TransportClient;
import org.elasticsearch.common.transport.InetSocketTransportAddress;



        Settings settings = ImmutableSettings.settingsBuilder()
                                .put( cluster.name , elasticClusterName)
                                .put(client.transport.sniff, true).build();

        esClient = new TransportClient(settings)
            .addTransportAddress(new 
InetSocketTransportAddress(elasticHost,elasticPort));


On Tue, Mar 17, 2015 at 11:19 AM, Александр Свиридов   ooo_satu...@mail.ru 
 wrote:
I am quite newbie to elactis. Could you explain with java code what you 
mean?


Вторник, 17 марта 2015, 9:46 -07:00 от  aa...@definemg.com :
Is there a reason not to just specify the IP address and to try and rely 
on multicast?

I realize this is all on one node as you have stated that, but that seems 
even more reason that it would be little issue to specify the IP.  While 
multicast makes it easy to stand up a cluster in an ideal situation, my 
experience has been that it leads to more problems down the road, and 
things generally work better when not using multicast.   I heard the same 
suggestion repeatedly at Elastic{on}.

Aaron

On Tuesday, March 17, 2015 at 9:25:46 AM UTC-6, ooo_saturn7 wrote:
I have one physical server and I work only on it (no other servers).
At this server I have running elastic 1.4.2 - I use this version as this 
is the last version elastic osgi bundle is ready for. Also at this server 
I have glassfish 4.1 as java-ee server.
I run elastic node client inside my java-ee application. And I do it this 
way:
Node node = nodeBuilder().local(true).clusterName(elasticsearch).node();
Client client = node.client();
GetResponse getResponse = 
client.prepareGet(my.index-0.2.2,post,1).execute().actionGet();
MapString,Object source = getResponse.getSource();
System.out.println(--);
System.out.println(Index: + getResponse.getIndex());
System.out.println(Type: + getResponse.getType());
System.out.println(Id: + getResponse.getId());
System.out.println(Version: + getResponse.getVersion());
System.out.println(source);

In log I see the following:
[2015-03-17T12:57:44.447+0400] [glassfish 4.1] [INFO] [] 
[org.elasticsearch.discovery] [tid: _ThreadID=30 
_ThreadName=http-listener-1(1)] [timeMillis: 1426582664447] [levelValue: 
800] [[ [Pistol] elasticsearch/SCKIrGHQTaC5eEYmYfZ0Iw]]
[2015-03-17T12:57:44.449+0400] [glassfish 4.1] [INFO] [] 
[org.elasticsearch.cluster.service] [tid: _ThreadID=128 
_ThreadName=elasticsearch[Pistol][clusterService#updateTask][T#1]] 
[timeMillis: 1426582664449] [levelValue: 800] [[ [Pistol] master {new 
[Pistol][SCKIrGHQTaC5eEYmYfZ0Iw][ webserver1.com 
][local[1]]{local=true}}, removed {[Pistol][uwaWFb6KTy2Sdoc8TNwdSQ][ 
webserver1.com ][local[1]]{local=true},}, reason: 
local-disco-initial_connect(master)]]
[2015-03-17T12:57:44.502+0400] [glassfish 4.1] [INFO] [] 
[org.elasticsearch.http] [tid: _ThreadID=30 
_ThreadName=http-listener-1(1)] [timeMillis: 1426582664502] [levelValue: 
800] [[ [Pistol] bound_address {inet[/0:0:0:0:0:0:0:0:9202]}, 
publish_address {inet[/SERVER IP:9202]}]]
[2015-03-17T12:57:44.502+0400] [glassfish 4.1] [INFO] [] 
[org.elasticsearch.node] [tid: _ThreadID=30 
_ThreadName=http-listener-1(1)] [timeMillis: 1426582664502] [levelValue: 
800] [[ [Pistol] started]]
and I get this exeption: ...
Caused by: 
 org.elasticsearch.indices.IndexMissingException:[my.index-0.2.2] 

Re: Re[2]: Elasticsearch - node client does not connect to cluster

2015-03-17 Thread Aaron Mefford
This is what I use in my code, not sure how correct it is given the abysmal
state of the the Java API documentation.

import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.settings.ImmutableSettings;
import org.elasticsearch.client.Client;
import org.elasticsearch.client.transport.TransportClient;
import org.elasticsearch.common.transport.InetSocketTransportAddress;



Settings settings = ImmutableSettings.settingsBuilder()
.put(cluster.name, elasticClusterName)
.put(client.transport.sniff,
true).build();

esClient = new TransportClient(settings)
.addTransportAddress(new
InetSocketTransportAddress(elasticHost,elasticPort));


On Tue, Mar 17, 2015 at 11:19 AM, Александр Свиридов ooo_satu...@mail.ru
wrote:

 I am quite newbie to elactis. Could you explain with java code what you
 mean?


 Вторник, 17 марта 2015, 9:46 -07:00 от aa...@definemg.com:

   Is there a reason not to just specify the IP address and to try and
 rely on multicast?

 I realize this is all on one node as you have stated that, but that seems
 even more reason that it would be little issue to specify the IP.  While
 multicast makes it easy to stand up a cluster in an ideal situation, my
 experience has been that it leads to more problems down the road, and
 things generally work better when not using multicast.   I heard the same
 suggestion repeatedly at Elastic{on}.

 Aaron

 On Tuesday, March 17, 2015 at 9:25:46 AM UTC-6, ooo_saturn7 wrote:

 I have one physical server and I work only on it (no other servers).

 At this server I have running elastic 1.4.2 - I use this version as this
 is the last version elastic osgi bundle is ready for. Also at this server I
 have glassfish 4.1 as java-ee server.

 I run elastic node client inside my java-ee application. And I do it this
 way:

 Node node = nodeBuilder().local(true).clusterName(elasticsearch).node();
 Client client = node.client();
 GetResponse getResponse = 
 client.prepareGet(my.index-0.2.2,post,1).execute().actionGet();
 MapString,Object source = getResponse.getSource();
 System.out.println(--);
 System.out.println(Index: + getResponse.getIndex());
 System.out.println(Type: + getResponse.getType());
 System.out.println(Id: + getResponse.getId());
 System.out.println(Version: + getResponse.getVersion());
 System.out.println(source);



 In log I see the following:

 [2015-03-17T12:57:44.447+0400] [glassfish 4.1] [INFO] []
 [org.elasticsearch.discovery] [tid: _ThreadID=30
 _ThreadName=http-listener-1(1)] [timeMillis: 1426582664447] [levelValue:
 800] [[ [Pistol] elasticsearch/SCKIrGHQTaC5eEYmYfZ0Iw]]

 [2015-03-17T12:57:44.449+0400] [glassfish 4.1] [INFO] []
 [org.elasticsearch.cluster.service] [tid: _ThreadID=128
 _ThreadName=elasticsearch[Pistol][clusterService#updateTask][T#1]]
 [timeMillis: 1426582664449] [levelValue: 800] [[ [Pistol] master {new
 [Pistol][SCKIrGHQTaC5eEYmYfZ0Iw][webserver1.com][local[1]]{local=true}},
 removed 
 {[Pistol][uwaWFb6KTy2Sdoc8TNwdSQ][webserver1.com][local[1]]{local=true},},
 reason: local-disco-initial_connect(master)]]

 [2015-03-17T12:57:44.502+0400] [glassfish 4.1] [INFO] []
 [org.elasticsearch.http] [tid: _ThreadID=30 _ThreadName=http-listener-1(1)]
 [timeMillis: 1426582664502] [levelValue: 800] [[ [Pistol] bound_address
 {inet[/0:0:0:0:0:0:0:0:9202]}, publish_address {inet[/SERVER IP:9202]}]]

 [2015-03-17T12:57:44.502+0400] [glassfish 4.1] [INFO] []
 [org.elasticsearch.node] [tid: _ThreadID=30 _ThreadName=http-listener-1(1)]
 [timeMillis: 1426582664502] [levelValue: 800] [[ [Pistol] started]]

 and I get this exeption: ...

 Caused by: 
 org.elasticsearch.indices.IndexMissingException:[my.index-0.2.2] missing
 at 
 org.elasticsearch.cluster.metadata.MetaData.concreteIndices(MetaData.java:768)
 at 
 org.elasticsearch.cluster.metadata.MetaData.concreteIndices(MetaData.java:691)
 at 
 org.elasticsearch.cluster.metadata.MetaData.concreteSingleIndex(MetaData.java:748)
 at 
 org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction$AsyncSingleAction.init(TransportShardSingleOperationAction.java:139)
 at 
 org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction$AsyncSingleAction.init(TransportShardSingleOperationAction.java:116)
 at 
 org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction.doExecute(TransportShardSingleOperationAction.java:89)
 at 
 org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction.doExecute(TransportShardSingleOperationAction.java:55)
 at 
 org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:75)
 at org.elasticsearch.client.node.NodeClient.execute(NodeClient.java:98)
 at 
 org.elasticsearch.client.support.AbstractClient.get(AbstractClient.java:193)
 at 
 

Re: Elasticsearch - node client does not connect to cluster

2015-03-17 Thread aaron
Is there a reason not to just specify the IP address and to try and rely on 
multicast?

I realize this is all on one node as you have stated that, but that seems 
even more reason that it would be little issue to specify the IP.  While 
multicast makes it easy to stand up a cluster in an ideal situation, my 
experience has been that it leads to more problems down the road, and 
things generally work better when not using multicast.   I heard the same 
suggestion repeatedly at Elastic{on}.

Aaron

On Tuesday, March 17, 2015 at 9:25:46 AM UTC-6, ooo_saturn7 wrote:

 I have one physical server and I work only on it (no other servers).

 At this server I have running elastic 1.4.2 - I use this version as this 
 is the last version elastic osgi bundle is ready for. Also at this server I 
 have glassfish 4.1 as java-ee server.

 I run elastic node client inside my java-ee application. And I do it this 
 way:

 Node node = nodeBuilder().local(true).clusterName(elasticsearch).node();
 Client client = node.client();
 GetResponse getResponse = 
 client.prepareGet(my.index-0.2.2,post,1).execute().actionGet();
 MapString,Object source = getResponse.getSource();
 System.out.println(--);
 System.out.println(Index: + getResponse.getIndex());
 System.out.println(Type: + getResponse.getType());
 System.out.println(Id: + getResponse.getId());
 System.out.println(Version: + getResponse.getVersion());
 System.out.println(source);



 In log I see the following:

 [2015-03-17T12:57:44.447+0400] [glassfish 4.1] [INFO] [] 
 [org.elasticsearch.discovery] [tid: _ThreadID=30 
 _ThreadName=http-listener-1(1)] [timeMillis: 1426582664447] [levelValue: 
 800] [[ [Pistol] elasticsearch/SCKIrGHQTaC5eEYmYfZ0Iw]]

 [2015-03-17T12:57:44.449+0400] [glassfish 4.1] [INFO] [] 
 [org.elasticsearch.cluster.service] [tid: _ThreadID=128 
 _ThreadName=elasticsearch[Pistol][clusterService#updateTask][T#1]] 
 [timeMillis: 1426582664449] [levelValue: 800] [[ [Pistol] master {new 
 [Pistol][SCKIrGHQTaC5eEYmYfZ0Iw][webserver1.com][local[1]]{local=true}}, 
 removed 
 {[Pistol][uwaWFb6KTy2Sdoc8TNwdSQ][webserver1.com][local[1]]{local=true},}, 
 reason: local-disco-initial_connect(master)]]

 [2015-03-17T12:57:44.502+0400] [glassfish 4.1] [INFO] [] 
 [org.elasticsearch.http] [tid: _ThreadID=30 _ThreadName=http-listener-1(1)] 
 [timeMillis: 1426582664502] [levelValue: 800] [[ [Pistol] bound_address 
 {inet[/0:0:0:0:0:0:0:0:9202]}, publish_address {inet[/SERVER IP:9202]}]]

 [2015-03-17T12:57:44.502+0400] [glassfish 4.1] [INFO] [] 
 [org.elasticsearch.node] [tid: _ThreadID=30 _ThreadName=http-listener-1(1)] 
 [timeMillis: 1426582664502] [levelValue: 800] [[ [Pistol] started]]

 and I get this exeption: ...

 Caused by: 
 org.elasticsearch.indices.IndexMissingException:[my.index-0.2.2] missing
 at 
 org.elasticsearch.cluster.metadata.MetaData.concreteIndices(MetaData.java:768)
 at 
 org.elasticsearch.cluster.metadata.MetaData.concreteIndices(MetaData.java:691)
 at 
 org.elasticsearch.cluster.metadata.MetaData.concreteSingleIndex(MetaData.java:748)
 at 
 org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction$AsyncSingleAction.init(TransportShardSingleOperationAction.java:139)
 at 
 org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction$AsyncSingleAction.init(TransportShardSingleOperationAction.java:116)
 at 
 org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction.doExecute(TransportShardSingleOperationAction.java:89)
 at 
 org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction.doExecute(TransportShardSingleOperationAction.java:55)
 at 
 org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:75)
 at org.elasticsearch.client.node.NodeClient.execute(NodeClient.java:98)
 at 
 org.elasticsearch.client.support.AbstractClient.get(AbstractClient.java:193)
 at 
 org.elasticsearch.action.get.GetRequestBuilder.doExecute(GetRequestBuilder.java:201)
 at 
 org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:91)
 at 
 org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:65)

 So it can't find the index - my.index-0.2.2. However this index exists! 
 Besides, when I do curl -XGET '
 http://localhost:9200/_cluster/state?pretty=1' I see there only one node 
 and this *is not* SCKIrGHQTaC5eEYmYfZ0Iw. I suppose that the node I 
 create using java API creates new cluster and dosn't connect to my existing 
 cluster - that's why it says - it's master. Or I don't understand something 
 I have problem with code. Besides I've checked tha name of cluster it's 
 elasticsearch. So, how can I connect to my existing elasticsearch cluster?


-- 
You received this message because you are subscribed to the Google Groups 
elasticsearch group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to