# Issue regarding gateway

**URL:** <https://discuss.elastic.co/t/issue-regarding-gateway/3708>\
**Category:** Elasticsearch\
**Created:** [December 29, 2010, 11:55am UTC](https://discuss.elastic.co/t/issue-regarding-gateway/3708 "2010-12-29T11:55:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sam\_4](https://avatars.discourse-cdn.com/v4/letter/s/db5fbb/32.png) [@Sam\_4](https://discuss.elastic.co/u/Sam_4)\
**Post date:** [December 29, 2010, 11:55am UTC](https://discuss.elastic.co/t/issue-regarding-gateway/3708/1 "2010-12-29T11:55:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [December 29, 2010, 12:09pm UTC](https://discuss.elastic.co/t/issue-regarding-gateway/3708/2 "2010-12-29T12:09:50Z")

</div>

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](mailto: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

---

<div class="post-metadata">

**Author:** ![Sam\_4](https://avatars.discourse-cdn.com/v4/letter/s/db5fbb/32.png) [@Sam\_4](https://discuss.elastic.co/u/Sam_4)\
**Post date:** [December 31, 2010, 10:29am UTC](https://discuss.elastic.co/t/issue-regarding-gateway/3708/3 "2010-12-31T10:29:34Z")

</div>

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](mailto: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](mailto: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

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [December 31, 2010, 10:42am UTC](https://discuss.elastic.co/t/issue-regarding-gateway/3708/4 "2010-12-31T10:42:58Z")

</div>

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](mailto: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](mailto: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](mailto: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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 4:14am UTC](https://discuss.elastic.co/t/issue-regarding-gateway/3708/5 "2017-07-06T04:14:35Z")

</div>


