Local client with FS gateway type


(Barak Yaish) #1

I would like to embed IS in my app, so I’m trying local client with FS
gateway. I’ve an app (a simple main, java client ) that index data, I can
see on the file system that indices indeed created:

ImmutableSettings.Builder settings = NodeBuilder.nodeBuilder().settings();

settings.put( "gateway.type", "fs" );

settings.put( "path.data", "c:/tmp/" );

Node node = NodeBuilder.nodeBuilder().settings(settings).local( false).build();

node.start();

Client client = node.client();

//create the index

//index the data

node.stop();

After this, I ran a second app with the same node configuration (a second
jvm invocation) to search the indexed data, but an exception is raised:

org.elasticsearch.action.search.SearchPhaseExecutionException: Failed to
execute phase [dfs], total failure; shardFailures {[na][twitter][0]: No
active shards}{[na][twitter][1]: No active shards}{[na][twitter][2]: No
active shards}{[na][twitter][3]: No active shards}{[na][twitter][4]: No
active shards}

   at 

org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.onFirstPhaseResult(
TransportSearchTypeAction.java:248)

   at 

org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.start(
TransportSearchTypeAction.java:138)

   at 

org.elasticsearch.action.search.type.TransportSearchDfsQueryAndFetchAction.doExecute(
TransportSearchDfsQueryAndFetchAction.java:58)

   at 

org.elasticsearch.action.search.type.TransportSearchDfsQueryAndFetchAction.doExecute(
TransportSearchDfsQueryAndFetchAction.java:50)

   at org.elasticsearch.action.support.BaseAction.execute(*

BaseAction.java:61*)

   at org.elasticsearch.action.search.TransportSearchAction.doExecute(*

TransportSearchAction.java:106*)

   at org.elasticsearch.action.search.TransportSearchAction.doExecute(*

TransportSearchAction.java:42*)

   at org.elasticsearch.action.support.BaseAction.execute(*

BaseAction.java:61*)

   at org.elasticsearch.client.node.NodeClient.search(*

NodeClient.java:168*)

   at 

org.elasticsearch.client.action.search.SearchRequestBuilder.doExecute(*
SearchRequestBuilder.java:579*)

   at 

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

   at 

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

   at com.peer39.es.EsEmbedded.main(*EsEmbedded.java:85*)

Is there some config I missed?

Thanks.

--


(Barak Yaish) #2

A typo, should be: Node node = NodeBuilder.nodeBuilder
().settings(settings).local( true).build();

On Tuesday, September 4, 2012 3:15:58 PM UTC+3, barak wrote:

I would like to embed IS in my app, so I’m trying local client with FS
gateway. I’ve an app (a simple main, java client ) that index data, I can
see on the file system that indices indeed created:

ImmutableSettings.Builder settings = NodeBuilder.nodeBuilder
().settings();

settings.put( "gateway.type", "fs" );

settings.put( "path.data", "c:/tmp/" );

Node node = NodeBuilder.nodeBuilder().settings(settings).local( false).build();

node.start();

Client client = node.client();

//create the index

//index the data

node.stop();

After this, I ran a second app with the same node configuration (a second
jvm invocation) to search the indexed data, but an exception is raised:

org.elasticsearch.action.search.SearchPhaseExecutionException: Failed
to execute phase [dfs], total failure; shardFailures {[na][twitter][0]:
No active shards}{[na][twitter][1]: No active shards}{[na][twitter][2]:
No active shards}{[na][twitter][3]: No active shards}{[na][twitter][4]:
No active shards}

   at 

org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.onFirstPhaseResult(
TransportSearchTypeAction.java:248)

   at 

org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.start(
TransportSearchTypeAction.java:138)

   at 

org.elasticsearch.action.search.type.TransportSearchDfsQueryAndFetchAction.doExecute(
TransportSearchDfsQueryAndFetchAction.java:58)

   at 

org.elasticsearch.action.search.type.TransportSearchDfsQueryAndFetchAction.doExecute(
TransportSearchDfsQueryAndFetchAction.java:50)

   at org.elasticsearch.action.support.BaseAction.execute(*

BaseAction.java:61*)

   at org.elasticsearch.action.search.TransportSearchAction.doExecute(

TransportSearchAction.java:106)

   at org.elasticsearch.action.search.TransportSearchAction.doExecute(

TransportSearchAction.java:42)

   at org.elasticsearch.action.support.BaseAction.execute(*

BaseAction.java:61*)

   at org.elasticsearch.client.node.NodeClient.search(*

NodeClient.java:168*)

   at 

org.elasticsearch.client.action.search.SearchRequestBuilder.doExecute(*
SearchRequestBuilder.java:579*)

   at 

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

   at 

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

   at com.peer39.es.EsEmbedded.main(*EsEmbedded.java:85*)

Is there some config I missed?

Thanks.

--


(system) #3