I'm trying run elasticsearch as part of my jruby tests. Here's some of the
code I use to do that:
Settings settings = ImmutableSettings.settingsBuilder()
.put("name", nodeName)
.put("cluster.name", "linko-dev-cluster")
.put("index.gateway.type", "none")
.put("gateway.type", "none")
.put("discovery.zen.ping.multicast.enabled", "false")
.put("path.data", indexDir)
.put("path.logs", logDir)
.put("foreground", "true")
.put("http.port", esPort)
.build();
NodeBuilder nodeBuilder = NodeBuilder.nodeBuilder()
.settings(settings)
.loadConfigSettings(false);
node = nodeBuilder
.build();
// register a shutdown hook
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
node.close();
}
});
node.start();
>From my IDE and maven this works fine but when I call this from within
jruby in my rspec, elasticsearch hangs when I try to start it. A kill -QUIT
shows that it hangs on some initialization code related to tribe
functionality:
"main" #1 prio=5 os_prio=31 tid=0x00007fefe9801000 nid=0x1903 waiting on
condition [0x0000000108eb8000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x0000000795b61a58> (a
java.util.concurrent.CountDownLatch$Sync)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at
java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:836)
at
java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:997)
at
java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1304)
at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:231)
at org.elasticsearch.tribe.TribeService.doStart(TribeService.java:171)
at
org.elasticsearch.common.component.AbstractLifecycleComponent.start(AbstractLifecycleComponent.java:85)
at org.elasticsearch.node.internal.InternalNode.start(InternalNode.java:240)
at io.linko.ng.es.EsTestLauncher.start(EsTestLauncher.java:108)
I'd really appreciate any workarounds. I don't really need the transport
running or tribe. I just need to be able to connect via http. I'm using
jruby 1.7.12, java 1.8, and elasticsearch 1.1.1 pulled in via a maven
dependency.
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/51c219a1-e96b-4f5c-81b5-d8728c7471e3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.