分享

solr如何实现索引恢复

NEOGX 发表于 2015-7-22 19:25:56 [显示全部楼层] 回帖奖励 阅读模式 关闭右栏 1 8813
solr如何实现索引恢复
欢迎加入about云群371358502、39327136,云计算爱好者群

已有(1)人评论

跳转到指定楼层
NEOGX 发表于 2015-7-22 19:26:40



这个内容,分享给大家:
solr 备份索引
     最简单的方式是使用 Replication Handler。在使用Replication Handler之前,需要将solrconfig.xml中Solr.ReplicationHandler的注释去掉:
如下在master中:
  <requestHandler name="/replication" class="solr.ReplicationHandler" >
       <lst name="master">
         <str name="replicateAfter">commit</str>
         <str name="replicateAfter">startup</str>
         <str name="confFiles">schema.xml,stopwords.txt</str>
       </lst>
    <!-- 这里是配置Repeater用,备份不需要
       <lst name="slave">
         <str name="masterUrl">http://localhost:8080/solr/replication</str>
         <str name="pollInterval">00:00:60</str>
       </lst>
    -->
  </requestHandler>
  重启后执行:http://localhost:8080/solr/replication?command=backup
  正常返回结果如下:
  <response><lst name="responseHeader"><int name="status">0</int><int name="QTime">1</int></lst><str name="status">OK</str></response>
  成功后会在 solr/home的core中的 data目录下,生成类似snapshot.20131127105721594的目录,该目录就是备份出来的索引库。

solr 索引恢复
没有相关的命令,手工恢复。solr 索引恢复步骤如下:
1、停止solr 服务器 (可选)
2、复制备份的索引到对应的core打data目录下,名称为index
3、重启solr服务器。
Restoring Solr Indexes
To restore Solr indexes, use the following steps:
1、Stop the Solr server.
2、Copy a backup index to the data directory for each core.Remember to use a backup created from the same core instance.
3、Restart the Solr server. Solr will start to track the indexes based on the state of the restored index.

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条