0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Solr 5.4でインデックスのレストア

Last updated at Posted at 2016-02-16

レストアAPIの使い方で微妙につまずいたのでメモ。

使い方

公式サイトのドキュメントをよく読めばよかったのですが、nameの指定がちょっと注意です。
https://cwiki.apache.org/confluence/display/solr/Making+and+Restoring+Backups+of+SolrCores

6.3でURL変更
https://cwiki.apache.org/confluence/display/solr/Making+and+Restoring+Backups

Backup APIでsnapshot.20160216120000という、スナップショットができたとします。
最初は、name=snapshot.20160216120000と指定していたのですが、これだとうまくいかず。
ログを見ると、snapshot.snapshot.20160216120000にインデックスがありませんというエラーがでる。

つまり、snapshot.<name>のを指定するということですね。Backup APIでもそこの箇所が指定できるとあったので、冷静に考えればそういうことだと・・・

結論

curl "http://localhost:8983/solr/core1/replication?command=restore&name=20160216120000"

という感じでOK。

蛇足

backup,restoreともに、locationでスナップショットがあるディレクトリを絶対パス・相対パスで指定できます。

backupの方はlocation=/backupとしたら、そういった形でログがでるのですが、restoreの方はsnapshot.20160216120000 //backup という風に表示されるという。GETメソッドでもparamsのところでは/backupと表示されているので、そこのログメッセージの表示の仕方が問題かな。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?