Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where does Elasticsearch store its data?

So I have this Elasticsearch installation, in insert data with logstash, visualize them with kibana.

Everything in the conf file is commented, so it's using the default folders which are relative to the elastic search folder.

1/ I store data with logstash
2/ I look at them with kibana
3/ I close the instance of elastic seach, kibana and logstash
4/ I DELETE their folders
5/ I re-extract everything and reconfigure them
6/ I go into kibana and the data are still there

How is this possible?

This command will however delete the data : curl -XDELETE 'http://127.0.0.1:9200/_all'

Thanks.

ps : forgot to say that I'm on windows

like image 240
sliders_alpha Avatar asked Oct 23 '15 13:10

sliders_alpha


People also ask

Where is the Elasticsearch data stored?

According to the documentation the data is stored in a folder called "data" in the elastic search root directory.

How is Elasticsearch data stored?

Elasticsearch stores data as JSON documents. Each document correlates a set of keys (names of fields or properties) with their corresponding values (strings, numbers, Booleans, dates, arrays of values, geolocations, or other types of data).

Does Elasticsearch store data in memory or disk?

Elasticsearch indexes are just files and they effectively cached in RAM by system.

Is Elasticsearch in memory database?

The Elasticsearch process is very memory intensive. Elasticsearch uses a JVM (Java Virtual Machine), and close to 50% of the memory available on a node should be allocated to JVM. The JVM machine uses memory because the Lucene process needs to know where to look for index values on disk.

Is Elasticsearch a distributed database?

Information out: search and analyze » Elasticsearch is a distributed document store. Instead of storing information as rows of columnar data, Elasticsearch stores complex data structures that have been serialized as JSON documents.

Can I store JSON data in Elasticsearch?

Storing JSON data in Elasticsearch By default, Elasticsearch keeps a copy of all the JSON documents you offer it for indexing in a field called _source. You get a copy of this stored data on each query that matches the document. So yes: you are able to store your data in Elasticsearch and retrieve it too.

How to find the path of a replica in Elasticsearch?

Look to configuration elasticsearch.yml and search for path 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).

How long does it take Elasticsearch to index documents?

When a document is stored, it is indexed and fully searchable in near real-time --within 1 second. Elasticsearch uses a data structure called an inverted index that supports very fast full-text searches. An inverted index lists every unique word that appears in any document and identifies all of the documents each word occurs in.


5 Answers

If you've installed ES on Linux, the default data folder is in /var/lib/elasticsearch (CentOS) or /var/lib/elasticsearch/data (Ubuntu)

If you're on Windows or if you've simply extracted ES from the ZIP/TGZ file, then you should have a data sub-folder in the extraction folder.

like image 119
Val Avatar answered Oct 19 '22 21:10

Val


Have a look into the Nodes Stats and try

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

On Windows 10 with ElasticSearch 7 it shows:

"path" : "C:\\ProgramData\\Elastic\\Elasticsearch\\data\\nodes\\0"
like image 29
C-Jay Avatar answered Oct 19 '22 21:10

C-Jay


According to the documentation the data is stored in a folder called "data" in the elastic search root directory.

like image 6
Andrew Smith Avatar answered Oct 19 '22 19:10

Andrew Smith


If you run the Windows MSI installer (at least for 5.5.x), the default location for data files is:

C:\ProgramData\Elastic\Elasticsearch\data

The config and logs directories are siblings of data.

like image 5
Noah Heldman Avatar answered Oct 19 '22 21:10

Noah Heldman


Elastic search is storing data under the folder 'Data' as mentioned above answers. Is there any other elastic search instance available on your local network? If yes, please check the cluster name. If you use same cluster name in the same network it will share data.

Refer this link for more info.

like image 2
Jamsheer Avatar answered Oct 19 '22 21:10

Jamsheer