最近考虑为公司的saas平台添加elasticsearch,增强其搜索功能。
下载了
unzip -d . elasticsearch-1.5.0.zip
cd elasticsearch-1.5.0/bin
./elasticsearch
提示
Can't start up: not enough memory
我当时就傻了,这台服务器可是16G内存,至少一半空闲。
判断了一下 应该jdk的问题,这台centos 默认安装gnu的gij没有删除。
elasticsearch脚本中
添加了
export JAVA_HOME=/software/jdk1.7.0_40
再次运行
./elasticsearch
提示
{1.5.0}: Initialization Failed ...
- RuntimeException[Java version: 1.7.0_40 suffers from critical bug which can cause data corruption.
Please upgrade the JVM, see http://www.elastic.co/guide/en/elasticsearch/reference/current/_installation.html for current recommendations.
If you absolutely cannot upgrade, please add -XX:-UseSuperWord to the JVM_OPTS environment variable.
Upgrading is preferred, this workaround will result in degraded performance.]
提示太诡异,jdk 1.7 是我的线上系统的jdk,会有严重的bug?
看了一下,elasticsearch install guide,
Elasticsearch requires Java 7. Specifically as of this writing, it is recommended that you use the Oracle JDK version 1.8.0_25.
你还毛推荐啊,应该在运行前,判断一下jdk版本,强制使用jdk8 就行了。
初步感觉启动shell 写的 太业余了。
继续修改 JAVA_HOME
export JAVA_HOME=/software/jdk1.8.0_40
运行
./elasticsearch
输入
看到
{
"status" : 200,
"name" : "Mephisto",
"cluster_name" : "elasticsearch",
"version" : {
"number" : "1.5.0",
"build_hash" : "544816042d40151d3ce4ba4f95399d7860dc2e92",
"build_timestamp" : "2015-03-23T14:30:58Z",
"build_snapshot" : false,
"lucene_version" : "4.10.4"
},
"tagline" : "You Know, for Search"
}
安装完毕
阅读(10697) | 评论(1) | 转发(0) |