将Elasticsearch从0.90.x升级到1.3.x
为了测试Qiita的发布功能,
同时修改了之前以非公开方式创建的备忘录的Markdown,并进行了发布。
确认已安装的插件
$ 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. 服务的停止 de
也许不考虑换行输入可能更为稳妥。至于包含换行的输入则未经尝试。
$ 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=1.3.x版本的Elasticsearch软件包库
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的升级 (Kuromoji’s upgrade)
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/'
只要有什么回应,就完成了。
降级的具体方法不清楚。
我记得在某个网站上看到过类似于”重新安装”这样的交流。