1. 安装jar8
yum list java-1.8*
sudo yum install java-1.8.0-openjdk* -y
java --version
2. 安装elasticsearch
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.5.1.zip
unzip elasticsearch-5.5.1.zip
cd elasticsearch-5.5.1/
进入解压后的目录执行:
./bin/elasticsearch
报错:
OpenJDK Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N
OpenJDK Server VM warning: INFO: os::commit_memory(0x2ac00000, 2080374784, 0) failed; error='Cannot allocate memory' (errno=12)
解决方式:
sudo find / -name jvm.options
报错是内存不足的意思,需要修改配置文件内容, 将下面的文件路径改为上一步获取到的路径。
vim /your/path/jvm.options
-Xms2g
-Xmx2g
修改为
-Xms512m
-Xmx512m
然后继续在解压后的目录执行:
./bin/elasticsearch
成功!
参考:
全文搜索引擎 Elasticsearch 入门教程
Elasticsearch1.1 安装(好多坑)
centos7通过yum安装JDK1.8