5

I am relatively new to elasticsearch, and I was wondering where does Elasticsearch store its records. I installed Elasticsearch on /var/lib/elasticsearch, and see index being created in this directory. For example, an index

logstash-2016.11.11

creates

/var/lib/elasticsearch/nodes/0/indices/logstash-2016.11.11

I also set replication to 1 so that each record will have two copies.

Later on I deleted the /var/lib/elasticsearch/nodes folder, and rerun elasticseach again, but find out interestingly the old record still exist with just one copy.

Is Elasticsearch storing the copy somewhere else? Where can I find the other copies. Thank you.

root
  • 3,517
  • 2
  • 19
  • 25
Willam Marston
  • 97
  • 2
  • 12

2 Answers2

5

Have a look into the Nodes Stats and try

http://localhost:9200/_nodes/stats/fs?pretty

On Windows 10 with ElasticSearch 7 it shows:

"path" : "C:\\ProgramData\\Elastic\\Elasticsearch\\data\\nodes\\0"
C-Jay
  • 621
  • 1
  • 11
  • 22
1

It depends on configuration but to find location of your data you can look to:

  1. look firstly to default folder structure
  2. Look to configuration elasticsearch.yml and search for path

Replicas is a bit different

When you set replica to 1 it means that it will be stored as copy but not on the same instance. One instance is storing shards (Part of data), but replicas must go to other instance(Its because if your main server crashed you have one more copy of your data). So if you have one server it means that you will not have 2 copies of your data. And cluster status will be yellow since your data are not replicated

Vova Bilyachat
  • 18,765
  • 4
  • 55
  • 80
  • I'm using Elasticsearch 5.5 and in my "C:\Program Files\Elastic\Elasticsearch" there is no folder named data. I've looked in the documentation there is no mention of such data files. I need to transfer my data from old laptop to new laptop. How can I do it? – SOUPTIK BANERJEE Mar 30 '18 at 11:25