# Pure in-memory option for running elasticsearch?

**URL:** <https://discuss.elastic.co/t/pure-in-memory-option-for-running-elasticsearch/6587>\
**Category:** Elasticsearch\
**Created:** [February 3, 2012, 7:47pm UTC](https://discuss.elastic.co/t/pure-in-memory-option-for-running-elasticsearch/6587 "2012-02-03T19:47:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eric\_Jain](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eric_jain/32/834_2.png) [@Eric\_Jain](https://discuss.elastic.co/u/Eric_Jain)\
**Post date:** [February 3, 2012, 7:47pm UTC](https://discuss.elastic.co/t/pure-in-memory-option-for-running-elasticsearch/6587/1 "2012-02-03T19:47:23Z")

</div>

I've tried the following, which still results in the creation of two  
files (data/elasticsearch/nodes/0/\_state/metadata-3 and shards-3), as  
well as an empty directory for each index.

Settings settings = ImmutableSettings.settingsBuilder()  
.put("node.http.enabled", false)  
.put("index.gateway.type", "none")  
.put("index.store.type", "memory")  
.put("index.number\_of\_shards", 1)  
.put("index.number\_of\_replicas", 0).build();  
node =  
NodeBuilder.nodeBuilder().local(true).settings(settings).node();  
client = node.client();  
...

Is there an option to use elasticsearch without touching the file  
system at all? This would simplify certain unit tests...

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 3, 2012, 8:11pm UTC](https://discuss.elastic.co/t/pure-in-memory-option-for-running-elasticsearch/6587/2 "2012-02-03T20:11:51Z")

</div>

If you use maven, you can specify your path to be in target/es/data for  
example.  
So mvn clean will clean your test files.  
But if there is any option for it, I will be pleased to see it also... 😉

David.

Le 3 février 2012 à 20:47, Eric Jain [eric.jain@gmail.com](mailto:eric.jain@gmail.com) a écrit :

> I've tried the following, which still results in the creation of two  
> files (data/elasticsearch/nodes/0/\_state/metadata-3 and shards-3), as  
> well as an empty directory for each index.
> 
> Settings settings = ImmutableSettings.settingsBuilder()  
> .put("node.http.enabled", false)  
> .put("index.gateway.type", "none")  
> .put("index.store.type", "memory")  
> .put("index.number\_of\_shards", 1)  
> .put("index.number\_of\_replicas", 0).build();  
> node =  
> NodeBuilder.nodeBuilder().local(true).settings(settings).node();  
> client = node.client();  
> ...
> 
> Is there an option to use elasticsearch without touching the file  
> system at all? This would simplify certain unit tests...

--  
David Pilato  
[http://dev.david.pilato.fr/](http://dev.david.pilato.fr/)  
Twitter : @dadoonet

---

<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:** [February 5, 2012, 4:22pm UTC](https://discuss.elastic.co/t/pure-in-memory-option-for-running-elasticsearch/6587/3 "2012-02-05T16:22:15Z")

</div>

You need to set the gateway.type to none, which will automatically set the index gateway to none. But, there will still be a need for file system since the transaction log only implementation is file system based (there is no in memory transaction log).

On Friday, February 3, 2012 at 9:47 PM, Eric Jain wrote:

> I've tried the following, which still results in the creation of two  
> files (data/elasticsearch/nodes/0/\_state/metadata-3 and shards-3), as  
> well as an empty directory for each index.
> 
> Settings settings = ImmutableSettings.settingsBuilder()  
> .put("node.http.enabled", false)  
> .put("index.gateway.type", "none")  
> .put("index.store.type", "memory")  
> .put("index.number\_of\_shards", 1)  
> .put("index.number\_of\_replicas", 0).build();  
> node =  
> NodeBuilder.nodeBuilder().local(true).settings(settings).node();  
> client = node.client();  
> ...
> 
> Is there an option to use elasticsearch without touching the file  
> system at all? This would simplify certain unit tests...

---

<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, 3:40am UTC](https://discuss.elastic.co/t/pure-in-memory-option-for-running-elasticsearch/6587/4 "2017-07-06T03:40:33Z")

</div>


