Lucene index backup

前端 未结 4 1810
悲哀的现实
悲哀的现实 2020-12-16 13:37

What is the best practice to backup a lucene index without taking the index offline (hot backup)?

4条回答
  •  离开以前
    2020-12-16 14:27

    This answer depends upon (a) how big your index is and (b) what OS you are using. It is suitable for large indexes hosted on Unix operating systems, and is based upon the Solr 1.3 replication strategy.

    Once a file has been created, Lucene will not change it, it will only delete it. Therefore, you can use a hard link strategy to make a backup. The approach would be:

    • stop indexing (and do a commit?), so that you can be sure you won't snapshot mid write
    • create a hard link copy of your index files (using cp -lr)
    • restart indexing

    The cp -lr will only copy the directory structure and not the files, so even a 100Gb index should copy in less than a second.

提交回复
热议问题