Lucene index backup

前端 未结 4 1821
悲哀的现实
悲哀的现实 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:10

    In my opinion it would typically be enough to stop any ongoing indexing operation and simply take a file copy of your index files. Also look at the snapshooter script from Solr which can be found in apache-solr-1.4.1/src/scripts, which essentially does:

    cp -lr indexLocation backupLocation
    

    Another options might be to have a look at the Directory.copy(..) routine for a progammatic approach (e.g., using the same Directory given as constructor parameter to the IndexWriter. You might also be interested in Snapshooter.java which does the equivalent of the script.

提交回复
热议问题