How to move elasticsearch data directory?

前端 未结 4 897
甜味超标
甜味超标 2020-12-05 06:43

I have a default installation of Elasticsearch. It seems to be storing it\'s data in

/var/lib/elasticsearch/elasticsearch/nodes

So two qu

4条回答
  •  猫巷女王i
    2020-12-05 07:23

    If you are more cautious about moving your critical data, cp with preserving all attributes (owner, group, timestamp, etc.) can help.

    cp -r --preserve=all /var/lib/elasticsearch/ /foo/bar/
    

    Open elasticsearch.yml and set path.data to new location

    path.data: /foo/bar/elasticsearch/
    

    Restart elasticsearch server. now you can safely remove source data.

    rm -rf /var/lib/elasticsearch/
    

提交回复
热议问题