Issue regarding gateway


(Sam-4) #1

Hi

I configured gateway using elastic Java API with following settings:

Settings settings = ImmutableSettings.settingsBuilder()
.put("index.number_of_shards",1)
.put("gateway.type","fs")
.put("gateway.fs.location","c:/
gateway")
.build();
Node node =
NodeBuilder.nodeBuilder().settings(settings).node();

and gateway snapshort with following settings:

GatewaySnapshotRequest gsr=new GatewaySnapshotRequest("test");

node.client().admin().indices().gatewaySnapshot(gsr).actionGet();

but gateway is created when i shutdown the server and it consists
following (__0,__1,__2,commit-0,commit-1,snapshot.lock) files.
and how can i check that my gateway is working?

Thanks


(Shay Banon) #2

If you shutdown the node, and start it back it and it has all the data, then
its working. Any reason you are not using the default local gateway?

On Wed, Dec 29, 2010 at 1:55 PM, sam mishra.sameek@gmail.com wrote:

Hi

I configured gateway using elastic Java API with following settings:

Settings settings = ImmutableSettings.settingsBuilder()
.put("index.number_of_shards",1)
.put("gateway.type","fs")
.put("gateway.fs.location","c:/
gateway")
.build();
Node node =
NodeBuilder.nodeBuilder().settings(settings).node();

and gateway snapshort with following settings:

GatewaySnapshotRequest gsr=new GatewaySnapshotRequest("test");

node.client().admin().indices().gatewaySnapshot(gsr).actionGet();

but gateway is created when i shutdown the server and it consists
following (__0,__1,__2,commit-0,commit-1,snapshot.lock) files.
and how can i check that my gateway is working?

Thanks


(Sam-4) #3

Thanks for reply and focusing me on local gateway.the main theme of
using gateway is storing index permanently in file system.

"Local gateway allowing for zero conf persistent storage (the
default)"
please clear above line and where recovery files are created which is
using local gateway to recover states.when i try to configured local
gateway with following settings :

Settings settings = ImmutableSettings.settingsBuilder()
.put("gateway.type","local")
.put("gateway.recover_after_nodes",
1)
.put("gateway.recover_after_time","1m")
.put("index.gateway.snapshot_interval","10s")
.build();

    Node node =

NodeBuilder.nodeBuilder().settings(settings).node();

I got following error:

Exception in thread "main"
org.elasticsearch.cluster.block.ClusterBlockException: blocked by: [1/
not recovered from gateway];
at
org.elasticsearch.cluster.block.ClusterBlocks.indexBlockedRaiseException(ClusterBlocks.java:
112)
at
org.elasticsearch.action.admin.indices.create.TransportCreateIndexAction.checkBlock(TransportCreateIndexAction.java:
65)
at
org.elasticsearch.action.admin.indices.create.TransportCreateIndexAction.checkBlock(TransportCreateIndexAction.java:
42)
at
org.elasticsearch.action.support.master.TransportMasterNodeOperationAction
$1.run(TransportMasterNodeOperationAction.java:91)
at java.util.concurrent.ThreadPoolExecutor
$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Java Result: 1

Please point out where i am wrong?

Thanks

On Dec 29, 5:09 pm, Shay Banon shay.ba...@elasticsearch.com wrote:

If you shutdown the node, and start it back it and it has all the data, then
its working. Any reason you are not using the default local gateway?

On Wed, Dec 29, 2010 at 1:55 PM, sam mishra.sam...@gmail.com wrote:

Hi

I configured gateway using elastic Java API with following settings:

Settings settings = ImmutableSettings.settingsBuilder()
.put("index.number_of_shards",1)
.put("gateway.type","fs")
.put("gateway.fs.location","c:/
gateway")
.build();
Node node =
NodeBuilder.nodeBuilder().settings(settings).node();

and gateway snapshort with following settings:

GatewaySnapshotRequest gsr=new GatewaySnapshotRequest("test");

node.client().admin().indices().gatewaySnapshot(gsr).actionGet();

but gateway is created when i shutdown the server and it consists
following (__0,__1,__2,commit-0,commit-1,snapshot.lock) files.
and how can i check that my gateway is working?

Thanks


(Shay Banon) #4

First, snapshot operation is not relevant when using the local gateway.

Second, on what operation does this happen? When a node starts, it does the
recovery phase from the gateway in the background, you can use the cluster
health api to wait till its done. A simple test just to check if things
work, you can add a sleep of, lets say, 1 second, after the node starts up
and see if things work for you.

On Fri, Dec 31, 2010 at 12:29 PM, sam mishra.sameek@gmail.com wrote:

Thanks for reply and focusing me on local gateway.the main theme of
using gateway is storing index permanently in file system.

"Local gateway allowing for zero conf persistent storage (the
default)"
please clear above line and where recovery files are created which is
using local gateway to recover states.when i try to configured local
gateway with following settings :

Settings settings = ImmutableSettings.settingsBuilder()
.put("gateway.type","local")
.put("gateway.recover_after_nodes",
1)
.put("gateway.recover_after_time","1m")

.put("index.gateway.snapshot_interval","10s")
.build();

   Node node =

NodeBuilder.nodeBuilder().settings(settings).node();

I got following error:

Exception in thread "main"
org.elasticsearch.cluster.block.ClusterBlockException: blocked by: [1/
not recovered from gateway];
at

org.elasticsearch.cluster.block.ClusterBlocks.indexBlockedRaiseException(ClusterBlocks.java:
112)
at

org.elasticsearch.action.admin.indices.create.TransportCreateIndexAction.checkBlock(TransportCreateIndexAction.java:
65)
at

org.elasticsearch.action.admin.indices.create.TransportCreateIndexAction.checkBlock(TransportCreateIndexAction.java:
42)
at
org.elasticsearch.action.support.master.TransportMasterNodeOperationAction
$1.run(TransportMasterNodeOperationAction.java:91)
at java.util.concurrent.ThreadPoolExecutor
$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Java Result: 1

Please point out where i am wrong?

Thanks

On Dec 29, 5:09 pm, Shay Banon shay.ba...@elasticsearch.com wrote:

If you shutdown the node, and start it back it and it has all the data,
then
its working. Any reason you are not using the default local gateway?

On Wed, Dec 29, 2010 at 1:55 PM, sam mishra.sam...@gmail.com wrote:

Hi

I configured gateway using elastic Java API with following settings:

Settings settings = ImmutableSettings.settingsBuilder()
.put("index.number_of_shards",1)
.put("gateway.type","fs")
.put("gateway.fs.location","c:/
gateway")
.build();
Node node =
NodeBuilder.nodeBuilder().settings(settings).node();

and gateway snapshort with following settings:

GatewaySnapshotRequest gsr=new GatewaySnapshotRequest("test");

node.client().admin().indices().gatewaySnapshot(gsr).actionGet();

but gateway is created when i shutdown the server and it consists
following (__0,__1,__2,commit-0,commit-1,snapshot.lock) files.
and how can i check that my gateway is working?

Thanks


(system) #5