ES 5.0 breaking changes documentation says
Path to data on disk
In prior versions of Elasticsearch, the path.data directory included a folder for the cluster name, so that data was in a folder such as $DATA_DIR/$CLUSTER_NAME/nodes/$nodeOrdinal. In 5.0 the cluster name as a directory is deprecated. Data will now be stored in $DATA_DIR/nodes/$nodeOrdinal if there is no existing data. Upon startup, Elasticsearch will check to see if the cluster folder exists and has data, and will read from it if necessary. In Elasticsearch 6.0 this backwards-compatible behavior will be removed.
If you are using a multi-cluster setup with both instances of Elasticsearch pointing to the same data path, you will need to add the cluster name to the data path so that different clusters do not overwrite data.
so I upgraded ES from 2.4 to 5.0 and before starting it I moved my old indices
from: /var/data/elasticsearch/elasticsearch/nodes/0/indices/
to: /var/data/elasticsearch/nodes/0/indices/
However after starting ES I noticed that no shards were seen by the cluster, then I realized ES created a new index inside the old path $DATA_DIR/$CLUSTER_NAME/nodes/$nodeOrdinal
What's happening?
Details as follows:
path.data: /var/data/elasticsearch
cluster.name: elasticsearch
[root@server1 ~]# ls -la /var/data/elasticsearch/
total 32
drwxr-xr-x. 5 elasticsearch elasticsearch 4096 15 nov 18:59 .
drwxr-xr-x. 3 root root 4096 25 lug 10:54 ..
drwxr-xr-x. 3 elasticsearch elasticsearch 4096 15 nov 18:59 elasticsearch
drwx------. 2 elasticsearch elasticsearch 16384 31 mar 2016 lost+found
drwxr-xr-x. 3 elasticsearch elasticsearch 4096 31 mar 2016 nodes
[root@server1 ~]# ls -la /var/data/elasticsearch/nodes/0/indices/ #the place where I moved my indices
total 364
drwxr-xr-x. 89 elasticsearch elasticsearch 12288 15 nov 13:16 .
drwxr-xr-x. 4 elasticsearch elasticsearch 4096 15 nov 13:09 ..
drwxr-xr-x. 6 elasticsearch elasticsearch 4096 15 nov 13:10 elastalert_status
drwxr-xr-x. 4 elasticsearch elasticsearch 4096 15 nov 13:15 .kibana-2.3.2
drwxr-xr-x. 6 elasticsearch elasticsearch 4096 19 ott 03:14 logstash-2016.10.17
drwxr-xr-x. 6 elasticsearch elasticsearch 4096 20 ott 09:39 logstash-2016.10.18
drwxr-xr-x. 6 elasticsearch elasticsearch 4096 19 ott 11:28 logstash-2016.10.19
[root@server1 ~]# ls -la /var/data/elasticsearch/elasticsearch/nodes/0/indices/ #the place where ES 5.0 created a new index, it even created the directories under /var/data/elasticsearch/
total 12
drwxr-xr-x. 3 elasticsearch elasticsearch 4096 15 nov 19:12 .
drwxr-xr-x. 4 elasticsearch elasticsearch 4096 16 nov 12:45 ..
drwxr-xr-x. 3 elasticsearch elasticsearch 4096 16 nov 12:45 FTBTyPP4Rky92RKXKHfaxw
Thanks for your help,
Daniele