Re: Problem with client node creation on localhost


(Shay Banon) #1

Hard to help..., you tried to provide a lot of information, but its really
hard to follow what happens... . Is there a chance you can simplify things?
You start an elasticsearch server node, and then connect to it using a
client node, and what fails?

On Mon, Nov 7, 2011 at 11:12 PM, steam grandebuzon@gmail.com wrote:

Hi all.
I have a problem with client node creation on localhost.
I start elasticsearch.bat from elastic folder, to intent create server node
to store in it the indexes. Then i start a client node from my java main
class with spring configuration and want recover indexes from server node.
Both nodes works on localhost and with same jdk1.6

My snippets code and logs with my comments:

Spring applicationContext.xml

   <bean id="searchNode"

class="com.web.project.elasticsearch.ElasticSearchNodeFactoryBean">

   <bean id="searchClient" factory-bean="searchNode"

factory-method="client"
/>

elasticsearch.properties

   name=MyNode
   node.client=true
   node.local=true
   node.data=false
   index.number_of_shards=3
   index.store.fs.memory.enabled=false
   index.analysis.analyzer.projectx_standard.type=standard
   index.analysis.analyzer.projectx_standard.filter=[lowercase]

And code to get index:

   ClassPathXmlApplicationContext ctx =
           new

ClassPathXmlApplicationContext("classpath:/spring/applicationContext.xml");

   Client client = (Client) ctx.getBean("searchClient");

           GetResponse response = client.prepareGet("twitter",

"tweet", "1")
.execute()
.actionGet();

   System.out.println("End get ..."+response.sourceAsString());

It seems that the client node is created but does not recognizes by the
server node and client node falls with the IndexMissingException -


21:20:49 [main] INFO org.elasticsearch.node - [MyNode] {0.18.2}[2404]:
initializing ...
21:20:49 [main] INFO org.elasticsearch.plugins - [MyNode] loaded [], sites
[]
21:20:49 [main] TRACE org.elasticsearch.monitor - failed to load sigar
java.lang.ClassNotFoundException: org.hyperic.sigar.Sigar
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
[na:1.6.0_22]
at java.security.AccessController.doPrivileged(Native Method)
[na:1.6.0_22]
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
[na:1.6.0_22]
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
[na:1.6.0_22]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
[na:1.6.0_22]
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
[na:1.6.0_22]
at
org.elasticsearch.monitor.MonitorModule.configure(MonitorModule.java:75)
[elasticsearch-0.18.2.jar:na]
.....
mtu [-1] multicast [true] ptp [false] loopback
[false] up [false] virtual
[false]
eth21 display_name [Bluetooth PAN Network Adapter - AvFw Packet Filter
Miniport-WFP LightWeight Filter-0000]
address
mtu [-1] multicast [true] ptp [false] loopback [false] up
[false] virtual
[false]

21:20:50 [main] TRACE org.elasticsearch.monitor.network - [MyNode] ifconfig

NA
21:20:50 [main] DEBUG org.elasticsearch.cache.memory - [MyNode] using
bytebuffer cache with small_buffer_size [1kb], large_buffer_size [1mb],
small_cache_size [10mb], large_cache_size [500mb], direct [true]
21:20:50 [main] DEBUG o.e.c.routing.allocation.decider - [MyNode] using
node_concurrent_recoveries [2], node_initial_primaries_recoveries [4]
21:20:50 [main] DEBUG o.e.c.routing.allocation.decider - [MyNode] using
[cluster.routing.allocation.allow_rebalance] with [indices_all_active]
21:20:50 [main] DEBUG o.e.c.routing.allocation.decider - [MyNode] using
[cluster_concurrent_rebalance] with [2]
21:20:50 [main] DEBUG org.elasticsearch.gateway.local - [MyNode] using
initial_shards [quorum], list_timeout [30s]
21:20:50 [main] DEBUG org.elasticsearch.indices.recovery - [MyNode] using
max_size_per_sec[0b], concurrent_streams [5], file_chunk_size [100kb],
translog_size [100kb], translog_ops [1000], and compress [true]
21:20:50 [main] TRACE org.elasticsearch.jmx - [MyNode] Attribute
TotalNumberOfRequests[r=true,w=false,is=false,type=long]
21:20:50 [main] TRACE org.elasticsearch.jmx - [MyNode] Attribute
BoundAddress[r=true,w=false,is=false,type=java.lang.String]
21:20:50 [main] TRACE org.elasticsearch.jmx - [MyNode] Attribute
PublishAddress[r=true,w=false,is=false,type=java.lang.String]
21:20:50 [main] DEBUG org.elasticsearch.http.netty - [MyNode] using
max_chunk_size[8kb], max_header_size[8kb], max_initial_line_length[4kb],
max_content_length[100mb]
21:20:50 [main] DEBUG org.elasticsearch.indices.memory - [MyNode] using
index_buffer_size [182mb], with min_shard_index_buffer_size [4mb],
max_shard_index_buffer_size [512mb], shard_inactive_time [30m]
21:20:50 [main] DEBUG o.elasticsearch.indices.cache.filter - [MyNode] using
[node] filter cache with size [20%], actual_size [364mb]
21:20:50 [main] INFO org.elasticsearch.node - [MyNode] {0.18.2}[2404]:
initialized
21:20:50 [main] INFO org.elasticsearch.node - [MyNode] {0.18.2}[2404]:
starting ...
21:20:50 [main] INFO org.elasticsearch.transport - [MyNode] bound_address
{local[1]}, publish_address {local[1]}
21:20:50 [main] DEBUG org.elasticsearch.discovery.local - [MyNode]
Connected
to cluster [Cluster [elasticsearch]]
21:20:50 [main] TRACE org.elasticsearch.discovery - [MyNode] waiting for
30s
for the initial state to be set by the discovery
21:21:20 [main] WARN org.elasticsearch.discovery - [MyNode] waited for 30s
and no initial state was set by the discovery
21:21:20 [main] INFO org.elasticsearch.discovery - [MyNode]
elasticsearch/1
21:21:20 [main] DEBUG org.elasticsearch.gateway - [MyNode] can't wait on
start for (possibly) reading state from gateway, will do it asynchronously
21:21:20 [main] DEBUG n.c.socket.nio.NioProviderMetadata - Using the
autodetected NIO constraint level: 0
21:21:21 [main] INFO org.elasticsearch.http - [MyNode] bound_address
{inet[/0.0.0.0:9201]}, publish_address {inet[/192.168.2.100:9201]}
21:21:21 [main] TRACE org.elasticsearch.jmx - [MyNode] Registered
org.elasticsearch.jmx.ResourceDMBean@39b1ff47 under
org.elasticsearch:service=transport
21:21:21 [main] INFO org.elasticsearch.node - [MyNode] {0.18.2}[2404]:
started
org.elasticsearch.indices.IndexMissingException: [twitter] missing
at

org.elasticsearch.cluster.metadata.MetaData.concreteIndex(MetaData.java:529)
at

org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction$AsyncSingleAction.(TransportShardSingleOperationAction.java:113)
at

org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction$AsyncSingleAction.(TransportShardSingleOperationAction.java:95)
at

org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction.doExecute(TransportShardSingleOperationAction.java:74)
at

org.elasticsearch.action.get.TransportGetAction.doExecute(TransportGetAction.java:93)
at

org.elasticsearch.action.get.TransportGetAction.doExecute(TransportGetAction.java:47)
at
org.elasticsearch.action.support.BaseAction.execute(BaseAction.java:61)
at org.elasticsearch.client.node.NodeClient.get(NodeClient.java:162)
at

org.elasticsearch.client.action.get.GetRequestBuilder.doExecute(GetRequestBuilder.java:125)
at

org.elasticsearch.client.action.support.BaseRequestBuilder.execute(BaseRequestBuilder.java:56)
at

org.elasticsearch.client.action.support.BaseRequestBuilder.execute(BaseRequestBuilder.java:51)
at

com.web.project.test.elasticsearch.ElasticSearchTest.main(ElasticSearchTest.java:61)


If i comment elasticsearch.properties on spring bean declaration like:

   <bean id="searchNode"

class="com.web.project.elasticsearch.ElasticSearchNodeFactoryBean">

   </bean>

node will be create with default configuration and works.


21:31:50 [main] DEBUG o.elasticsearch.indices.cache.filter - [Persuader]
using [node] filter cache with size [20%], actual_size [364mb]
21:31:50 [main] INFO org.elasticsearch.node - [Persuader] {0.18.2}[320]:
initialized
21:31:50 [main] INFO org.elasticsearch.node - [Persuader] {0.18.2}[320]:
starting ...
21:31:50 [main] DEBUG n.c.socket.nio.NioProviderMetadata - Using the
autodetected NIO constraint level: 0
21:31:50 [main] DEBUG org.elasticsearch.transport.netty - [Persuader] Bound
to address [/0.0.0.0:9301]
21:31:50 [main] INFO org.elasticsearch.transport - [Persuader]
bound_address {inet[/0.0.0.0:9301]}, publish_address
{inet[/192.168.2.100:9301]}
21:31:50 [main] TRACE org.elasticsearch.discovery - [Persuader] waiting for
30s for the initial state to be set by the discovery
21:31:50 [elasticsearch[cached]-pool-1-thread-1] TRACE
o.e.discovery.zen.ping.multicast - [Persuader] [1] sending ping request
21:31:50 [New I/O server worker #1-4] TRACE
o.e.discovery.zen.ping.multicast

  • [Persuader] [1] received ping_response{target [[Storm,
    Franklin][1wWn1gnVROWeQz1BiGDjqw][inet[/192.168.2.100:9300]]], master
    [[Storm, Franklin][1wWn1gnVROWeQz1BiGDjqw][inet[/192.168.2.100:9300]]],
    cluster_name[elasticsearch]}
    21:31:52 [elasticsearch[cached]-pool-1-thread-2] TRACE
    o.e.discovery.zen.ping.multicast - [Persuader] [1] sending ping request
    21:31:52 [New I/O server worker #1-1] TRACE
    o.e.discovery.zen.ping.multicast
  • [Persuader] [1] received ping_response{target [[Storm,
    Franklin][1wWn1gnVROWeQz1BiGDjqw][inet[/192.168.2.100:9300]]], master
    [[Storm, Franklin][1wWn1gnVROWeQz1BiGDjqw][inet[/192.168.2.100:9300]]],
    cluster_name[elasticsearch]}
    21:31:53 [elasticsearch[cached]-pool-1-thread-1] DEBUG
    org.elasticsearch.discovery.zen - [Persuader] ping responses:
    --> target [[Storm,
    Franklin][1wWn1gnVROWeQz1BiGDjqw][inet[/192.168.2.100:9300]]], master
    [[Storm, Franklin][1wWn1gnVROWeQz1BiGDjqw][inet[/192.168.2.100:9300]]]
    21:31:53 [elasticsearch[cached]-pool-1-thread-1] DEBUG
    org.elasticsearch.transport.netty - [Persuader] Connected to node [[Storm,
    Franklin][1wWn1gnVROWeQz1BiGDjqw][inet[/192.168.2.100:9300]]]
    21:31:53 [New I/O server worker #1-3] DEBUG org.elasticsearch.discovery.zen
  • [Persuader] got a new state from master node, though we are already
    trying
    to rejoin the cluster
    21:31:53 [elasticsearch[cached]-pool-1-thread-1] DEBUG
    org.elasticsearch.discovery.zen.fd - [Persuader] [master] starting fault
    detection against master [[Storm,
    Franklin][1wWn1gnVROWeQz1BiGDjqw][inet[/192.168.2.100:9300]]], reason
    [initial_join]
    21:31:53
    [elasticsearch[Persuader]clusterService#updateTask-pool-11-thread-1] DEBUG
    org.elasticsearch.cluster.service - [Persuader] processing
    [zen-disco-receive(from master [[Storm,
    Franklin][1wWn1gnVROWeQz1BiGDjqw][inet[/192.168.2.100:9300]]])]: execute
    21:31:53
    [elasticsearch[Persuader]clusterService#updateTask-pool-11-thread-1] TRACE
    org.elasticsearch.cluster.service - [Persuader] cluster state updated:
    version [19], source [zen-disco-receive(from master [[Storm,
    Franklin][1wWn1gnVROWeQz1BiGDjqw][inet[/192.168.2.100:9300]]])]
    nodes:
    [Storm, Franklin][1wWn1gnVROWeQz1BiGDjqw][inet[/192.168.2.100:9300]],
    master
    [Persuader][BeV6cmJQTRazODWe_nrzDA][inet[/192.168.2.100:9301]], local
    routing_table:
    -- index [twitter]
    ----shard_id [twitter][0]

...

routing_nodes:
-----node_id[1wWn1gnVROWeQz1BiGDjqw]
--------[twitter][0], node[1wWn1gnVROWeQz1BiGDjqw], [P], s[STARTED]
--------[twitter][1], node[1wWn1gnVROWeQz1BiGDjqw], [P], s[STARTED]
--------[twitter][2], node[1wWn1gnVROWeQz1BiGDjqw], [P], s[STARTED]
--------[twitter][3], node[1wWn1gnVROWeQz1BiGDjqw], [P], s[STARTED]
--------[twitter][4], node[1wWn1gnVROWeQz1BiGDjqw], [P], s[STARTED]
---- unassigned
--------[twitter][0], node[null], [R], s[UNASSIGNED]
--------[twitter][1], node[null], [R], s[UNASSIGNED]
--------[twitter][2], node[null], [R], s[UNASSIGNED]
--------[twitter][3], node[null], [R], s[UNASSIGNED]
--------[twitter][4], node[null], [R], s[UNASSIGNED]

21:31:53
[elasticsearch[Persuader]clusterService#updateTask-pool-11-thread-1] INFO
org.elasticsearch.cluster.service - [Persuader] detected_master [Storm,
Franklin][1wWn1gnVROWeQz1BiGDjqw][inet[/192.168.2.100:9300]], added
{[Storm,
Franklin][1wWn1gnVROWeQz1BiGDjqw][inet[/192.168.2.100:9300]],}, reason:
zen-disco-receive(from master [[Storm,
Franklin][1wWn1gnVROWeQz1BiGDjqw][inet[/192.168.2.100:9300]]])
21:31:53
[elasticsearch[Persuader]clusterService#updateTask-pool-11-thread-1] DEBUG
org.elasticsearch.transport.netty - [Persuader] Connected to node
[[Persuader][BeV6cmJQTRazODWe_nrzDA][inet[/192.168.2.100:9301]]]
21:31:53
[elasticsearch[Persuader]clusterService#updateTask-pool-11-thread-1] DEBUG
org.elasticsearch.indices.store - [Persuader] [.svn] deleting index that is
no longer in the cluster meta_date from

[D:\my_workspace\desarrollo\workspace\webproject_\data\elasticsearch\nodes\0\indices.svn]
21:31:53
[elasticsearch[Persuader]clusterService#updateTask-pool-11-thread-1] DEBUG
org.elasticsearch.indices.store - [Persuader] [tweetindex] deleting index
that is no longer in the cluster meta_date from

[D:\my_workspace\desarrollo\workspace\webproject_\data\elasticsearch\nodes\0\indices\tweetindex]
21:31:53
[elasticsearch[Persuader]clusterService#updateTask-pool-11-thread-1] DEBUG
org.elasticsearch.indices.store - [Persuader] [tweetindex2] deleting index
that is no longer in the cluster meta_date from

[D:\my_workspace\desarrollo\workspace\webproject_\data\elasticsearch\nodes\0\indices\tweetindex2]
21:31:53 [main] TRACE org.elasticsearch.discovery - [Persuader] initial
state set from discovery
21:31:53
[elasticsearch[Persuader]clusterService#updateTask-pool-11-thread-1] DEBUG
org.elasticsearch.cluster.service - [Persuader] processing
[zen-disco-receive(from master [[Storm,
Franklin][1wWn1gnVROWeQz1BiGDjqw][inet[/192.168.2.100:9300]]])]: done
applying updated cluster_state
21:31:53 [main] INFO org.elasticsearch.discovery - [Persuader]
elasticsearch/BeV6cmJQTRazODWe_nrzDA
21:31:53
[elasticsearch[Persuader]clusterService#updateTask-pool-11-thread-1] DEBUG
org.elasticsearch.cluster.service - [Persuader] processing [zen-disco-join
(detected master)]: execute
21:31:53
[elasticsearch[Persuader]clusterService#updateTask-pool-11-thread-1] DEBUG
org.elasticsearch.cluster.service - [Persuader] got old cluster state
[18<19] from source [zen-disco-join (detected master)], ignoring
21:31:53 [main] TRACE org.elasticsearch.gateway.local - [Persuader]
[find_latest_state]: processing [.svn]
21:31:53 [main] TRACE org.elasticsearch.gateway.local - [Persuader]
[find_latest_state]: processing [metadata-9]
21:31:53 [main] TRACE org.elasticsearch.gateway.local - [Persuader]
[find_latest_state]: processing [shards-14]
21:31:53 [main] DEBUG org.elasticsearch.gateway.local - [Persuader]
[find_latest_state]: loading metadata from

[D:\my_workspace\desarrollo\workspace\webproject_\data\elasticsearch\nodes\0_state\metadata-9]
21:31:53 [main] TRACE org.elasticsearch.gateway.local - [Persuader]
[find_latest_state]: processing [.svn]
21:31:53 [main] TRACE org.elasticsearch.gateway.local - [Persuader]
[find_latest_state]: processing [metadata-9]
21:31:53 [main] TRACE org.elasticsearch.gateway.local - [Persuader]
[find_latest_state]: processing [shards-14]
21:31:53 [main] DEBUG org.elasticsearch.gateway.local - [Persuader]
[find_latest_state]: loading started shards from

[D:\my_workspace\desarrollo\workspace\webproject_\data\elasticsearch\nodes\0_state\shards-14]
21:31:54 [main] INFO org.elasticsearch.http - [Persuader] bound_address
{inet[/0.0.0.0:9201]}, publish_address {inet[/192.168.2.100:9201]}
21:31:54 [main] TRACE org.elasticsearch.jmx - [Persuader] Registered
org.elasticsearch.jmx.ResourceDMBean@3643b5bb under
org.elasticsearch:service=transport
21:31:54 [main] TRACE org.elasticsearch.jmx - [Persuader] Registered
org.elasticsearch.jmx.ResourceDMBean@175023d2 under
org.elasticsearch:service=transport,transportType=netty
21:31:54 [main] INFO org.elasticsearch.node - [Persuader] {0.18.2}[320]:
started

End get
...{"user":"kimchy","postDate":"2011-11-06T14:12:13.416Z","message":"trying
out Elastic Search"}

And finally get index information...

But on server node i have a lot of exeptions:


.18.2}[1756]: initialized
[2011-11-07 21:13:17,965][INFO ][node ] [Storm,
Franklin] {0
.18.2}[1756]: starting ...
[2011-11-07 21:13:18,192][INFO ][transport ] [Storm,
Franklin] bo
und_address {inet[/0.0.0.0:9300]}, publish_address
{inet[/192.168.2.100:9300]}
[2011-11-07 21:13:21,395][INFO ][cluster.service ] [Storm,
Franklin] ne
w_master [Storm,
Franklin][1wWn1gnVROWeQz1BiGDjqw][inet[/192.168.2.100:9300]], r
eason: zen-disco-join (elected_as_master)
[2011-11-07 21:13:21,446][INFO ][discovery ] [Storm,
Franklin] el
asticsearch/1wWn1gnVROWeQz1BiGDjqw
[2011-11-07 21:13:21,638][INFO ][http ] [Storm,
Franklin] bo
und_address {inet[/0.0.0.0:9200]}, publish_address
{inet[/192.168.2.100:9200]}
[2011-11-07 21:13:21,640][INFO ][node ] [Storm,
Franklin] {0
.18.2}[1756]: started
[2011-11-07 21:13:22,932][INFO ][gateway ] [Storm,
Franklin] re
covered [1] indices into cluster_state
[2011-11-07 21:31:53,611][INFO ][cluster.service ] [Storm,
Franklin] ad
ded {[Persuader][BeV6cmJQTRazODWe_nrzDA][inet[/192.168.2.100:9301]],},
reason: z
en-disco-receive(join from
node[[Persuader][BeV6cmJQTRazODWe_nrzDA][inet[/192.16
8.2.100:9301]]])
[2011-11-07 21:31:54,449][WARN ][transport.netty ] [Storm,
Franklin] Ex
ception caught on netty layer [[id: 0x3ceb7830, /192.168.2.100:49826 =>
/192.168
.2.100:9300]]
java.io.IOException: ????????? ???? ????????????? ???????? ????????????
????????
???
at sun.nio.ch.SocketDispatcher.read0(Native Method)
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:25)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:237)
at sun.nio.ch.IOUtil.read(IOUtil.java:204)
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:236)
at
org.elasticsearch.common.netty.channel.socket.nio.NioWorker.read(NioW
orker.java:321)
at
org.elasticsearch.common.netty.channel.socket.nio.NioWorker.processSe
lectedKeys(NioWorker.java:280)
at
org.elasticsearch.common.netty.channel.socket.nio.NioWorker.run(NioWo
rker.java:200)
at
org.elasticsearch.common.netty.util.ThreadRenamingRunnable.run(Thread
RenamingRunnable.java:108)
at
org.elasticsearch.common.netty.util.internal.DeadLockProofWorker$1.ru
n(DeadLockProofWorker.java:44)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
utor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:908)
at java.lang.Thread.run(Thread.java:662)
[2011-11-07 21:31:54,453][WARN ][transport.netty ] [Storm,
Franklin] Ex
ception caught on netty layer [[id: 0x3ac58af4, /192.168.2.100:49832 =>
/192.168
.2.100:9300]]
java.io.IOException: ????????? ???? ????????????? ???????? ????????????
????????
???


Only if i create client node like an api:

   Node node = nodeBuilder().client(true).node();
   Client client = node.client();

   GetResponse response = client.prepareGet("twitter", "tweet", "1")
           .execute()
           .actionGet();

   System.out.println("End get ..."+response.sourceAsString());

and then take index, all works fine, without errors...

I don't understand what i'm doing wrong.
Please help me. Advance thank you very much.

--
View this message in context:
http://elasticsearch-users.115913.n3.nabble.com/Problem-with-client-node-creation-on-localhost-tp3488259p3488259.html
Sent from the ElasticSearch Users mailing list archive at Nabble.com.


(system) #2