Qiita投稿テストも兼ねて、
以前Gistに非公開で作成したメモの
Markdownをいじりつつ投稿。
1. インストール済みプラグインを確認
$ curl -XGET 'http://localhost:9200/_nodes/_all?plugin=true&pretty'
実行結果例
{
"ok" : true,
"cluster_name" : "elasticsearch",
"nodes" : {
"<何かランダムな文字列>" : {
"name" : "Doctor Sun",
"transport_address" : "inet[/<サーバのIPアドレス>:9300]",
"hostname" : "<ホスト名>",
"version" : "0.90.13",
"http_address" : "inet[/<サーバのIPアドレス>:9200]",
"plugins" : [ {
"name" : "analysis-kuromoji",
"description" : "Kuromoji analysis support",
"jvm" : true,
"site" : false
} ]
}
}
}
"plugins" の 各プラグインの "site" が false の場合、プラグイン更新後にElasticsearchの再起動が必要。
(この例ではkuromojiしか入れていない)
2. サービスの停止
それぞれ改行を除いて入力する方が無難かも。改行込みは試してない。
$ curl -XPUT localhost:9200/_cluster/settings -d '{
"transient" : {
"cluster.routing.allocation.enable" : "none"
}
}'
$ curl -XPUT 'http://localhost:9200/_cluster/settings' -d '{
"transient" : {
"cluster.routing.allocation.disable_allocation": "true"
}
}'
$ curl -XPUT 'http://localhost:9200/_all/_settings' -d '{
"index": {
"translog.disable_flush": "false"
}
}'
$ curl -XPUT 'http://localhost:9200/_cluster/settings' -d '{
"transient" : {
"cluster.routing.allocation.disable_allocation": "false"
}
}'
$ service elasticsearch stop
3. リポジトリ書き換え
(元々のインストール手段により適宜アップグレード手順を変更すること)
元のやつの書き換えが必要かどうかは試してない。
$ vi /etc/yum.repos.d/elasticsearch.repo
[elasticsearch-1.3] name=Elasticsearch repository for 1.3.x packages baseurl=http://packages.elasticsearch.org/elasticsearch/1.3/centos gpgcheck=1 gpgkey=http://packages.elasticsearch.org/GPG-KEY-elasticsearch enabled=1
4. Elasticsearchアップグレード
$ yum undate elasticsearch
5. kuromojiのアップグレード
5-1. 古いkuromojiの削除
$ /usr/share/elasticsearch/bin/plugins -remove elasticsearch/elasticsearch-analysis-kuromoji
5-2. 新しいkuromojiのインストール
$ /usr/share/elasticsearch/bin/plugins -install elasticsearch/elasticsearch-analysis-kuromoji/2.3.0
6. Elasticsearch立ち上げ
$ service elasticsearch start
サービス立ち上げて少しの間はリクエストを受け付けないらしい。
馴染ませてる?
(自分の時は特に問題は無かった)
$ curl -XGET 'http://localhost:9200/'
これで何か返ってきたら完了。
ダウングレードの方法は不明。
どこかのサイトで「入れ直せ」みたいなやり取りを見た気がする。