How to move Data and Logs to new directory?

Thanks Mark, but I was looking for more detailed steps. Here's what I ended up doing in case anyone else is looking for this information the future. >

• Determine current location of data files > curl "localhost:9200/_nodes/settings?pretty=true"

• Create new directory structure - e.g; > cd /spare > mkdir data

• Stop ntopng service > systemctl stop ntopng.service

• Stop ES service > systemctl stop elasticsearch.service

• Navigate to the current Data Directory determined in step 1 and copy files to new location > cp -RP * /spare/data/

• Change ownership on new directory to elasticsearch > chown -R elasticsearch:elasticsearch /spare/data

• Edit data path > vi /etc/elasticsearch/elasticsearch.yml
*Edit data parameter “path.data:” to “path.data:/spare/data

• Start ES > systemctl start elasticsearch.service

• Start ntopng > ntopng -F "es;flows;ntopng-%Y.%m.%d;http://127.0.0.1:9200/_bulk;" -e -i 1
*careful on this command as your input interface may not be -e -i 1 and your IP may be different.

Worked!!

15 Likes