Node not available Exception when using GClient (wrapping TransportClient)

Hi,

I'm experiencing "No node available exception" when I use GClient that is
created by wrapping a configured TransportClient.

def settings = ImmutableSettings.settingsBuilder()
def client = new TransportClient(settings)

client.addTransportAddress(new InetSocketTransportAddress('localhost', 9200
))

def gClient = new GClient(client)

gClient.index {
index "test"
type "type1"
id "1"
source {
test = "value"
complex {
value1 = "value1"
value2 = "value2"
}
}
}

It works fine if I create the GClient using GNodeBuilder. But the code
would be difficult to maintain.
So I'm trying to wrap it inside a Grails Plugin. What I want to achive is
to use the same GClient instance across multiple modules.

Is there any better way of doing this?

--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Don't forget to set the same cluster name.

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 21 juin 2013 à 08:20, "Donny A. Wijaya" slickwolf@gmail.com a écrit :

Hi,

I'm experiencing "No node available exception" when I use GClient that is created by wrapping a configured TransportClient.

def settings = ImmutableSettings.settingsBuilder()
def client = new TransportClient(settings)

client.addTransportAddress(new InetSocketTransportAddress('localhost', 9200))

def gClient = new GClient(client)

gClient.index {
index "test"
type "type1"
id "1"
source {
test = "value"
complex {
value1 = "value1"
value2 = "value2"
}
}
}

It works fine if I create the GClient using GNodeBuilder. But the code would be difficult to maintain.
So I'm trying to wrap it inside a Grails Plugin. What I want to achive is to use the same GClient instance across multiple modules.

Is there any better way of doing this?

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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hi David,

Thanks for the reply.

I just set the "cluster.name" settings to "elasticsearch"

(Note: I have the elasticsearch service running on my local on port 9200
with the cluster.name configured to "elasticsearch"):

def settings = ImmutableSettings.settingsBuilder()
.put("cluster.name", "elasticsearch")
.build()

But it still throws the same Exception.

Thanks,

Donny

On Friday, June 21, 2013 2:28:20 PM UTC+8, David Pilato wrote:

Don't forget to set the same cluster name.

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 21 juin 2013 à 08:20, "Donny A. Wijaya" <slic...@gmail.com<javascript:>>
a écrit :

Hi,

I'm experiencing "No node available exception" when I use GClient that is
created by wrapping a configured TransportClient.

def settings = ImmutableSettings.settingsBuilder()
def client = new TransportClient(settings)

client.addTransportAddress(new InetSocketTransportAddress('localhost',
9200))

def gClient = new GClient(client)

gClient.index {
index "test"
type "type1"
id "1"
source {
test = "value"
complex {
value1 = "value1"
value2 = "value2"
}
}
}

It works fine if I create the GClient using GNodeBuilder. But the code
would be difficult to maintain.
So I'm trying to wrap it inside a Grails Plugin. What I want to achive is
to use the same GClient instance across multiple modules.

Is there any better way of doing this?

--
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 elasticsearc...@googlegroups.com <javascript:>.
For more options, visit https://groups.google.com/groups/opt_out.

--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ok. So your cluster is using default cluster name. Adding cluster.name won't help here.
I only pointed that because it's a really common mistake most of us are doing…

Found it! Rereading your conf. Use 9300 and not 9200 port!

David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet | @elasticsearchfr | @scrutmydocs

Le 21 juin 2013 à 09:22, "Donny A. Wijaya" slickwolf@gmail.com a écrit :

Hi David,

Thanks for the reply.

I just set the "cluster.name" settings to "elasticsearch"

(Note: I have the elasticsearch service running on my local on port 9200 with the cluster.name configured to "elasticsearch"):

def settings = ImmutableSettings.settingsBuilder()
.put("cluster.name", "elasticsearch")
.build()

But it still throws the same Exception.

Thanks,

Donny

On Friday, June 21, 2013 2:28:20 PM UTC+8, David Pilato wrote:
Don't forget to set the same cluster name.

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 21 juin 2013 à 08:20, "Donny A. Wijaya" slic...@gmail.com a écrit :

Hi,

I'm experiencing "No node available exception" when I use GClient that is created by wrapping a configured TransportClient.

def settings = ImmutableSettings.settingsBuilder()
def client = new TransportClient(settings)

client.addTransportAddress(new InetSocketTransportAddress('localhost', 9200))

def gClient = new GClient(client)

gClient.index {
index "test"
type "type1"
id "1"
source {
test = "value"
complex {
value1 = "value1"
value2 = "value2"
}
}
}

It works fine if I create the GClient using GNodeBuilder. But the code would be difficult to maintain.
So I'm trying to wrap it inside a Grails Plugin. What I want to achive is to use the same GClient instance across multiple modules.

Is there any better way of doing this?

--
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 elasticsearc...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hi David,

You're right!! My mistake!!

Thank you very much!!

Donny

On Friday, June 21, 2013 3:27:59 PM UTC+8, David Pilato wrote:

Ok. So your cluster is using default cluster name. Adding cluster.namewon't help here.
I only pointed that because it's a really common mistake most of us are
doing…

Found it! Rereading your conf. Use 9300 and not 9200 port!

David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet https://twitter.com/dadoonet | @elasticsearchfrhttps://twitter.com/elasticsearchfr
| @scrutmydocs https://twitter.com/scrutmydocs

Le 21 juin 2013 à 09:22, "Donny A. Wijaya" <slic...@gmail.com<javascript:>>
a écrit :

Hi David,

Thanks for the reply.

I just set the "cluster.name" settings to "elasticsearch"

(Note: I have the elasticsearch service running on my local on port 9200
with the cluster.name configured to "elasticsearch"):

def settings = ImmutableSettings.settingsBuilder()
.put("cluster.name", "elasticsearch")
.build()

But it still throws the same Exception.

Thanks,

Donny

On Friday, June 21, 2013 2:28:20 PM UTC+8, David Pilato wrote:

Don't forget to set the same cluster name.

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 21 juin 2013 à 08:20, "Donny A. Wijaya" slic...@gmail.com a écrit :

Hi,

I'm experiencing "No node available exception" when I use GClient that is
created by wrapping a configured TransportClient.

def settings = ImmutableSettings.settingsBuilder()
def client = new TransportClient(settings)

client.addTransportAddress(new InetSocketTransportAddress('localhost',
9200))

def gClient = new GClient(client)

gClient.index {
index "test"
type "type1"
id "1"
source {
test = "value"
complex {
value1 = "value1"
value2 = "value2"
}
}
}

It works fine if I create the GClient using GNodeBuilder. But the code
would be difficult to maintain.
So I'm trying to wrap it inside a Grails Plugin. What I want to achive is
to use the same GClient instance across multiple modules.

Is there any better way of doing this?

--
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 elasticsearc...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
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 elasticsearc...@googlegroups.com <javascript:>.
For more options, visit https://groups.google.com/groups/opt_out.

--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.