1 安装wget
2 安装JDK
进入java官网下载jdk
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
使用 jdk-8u191-linux-x64.tar.gz
1
| wget https://download.oracle.com/otn-pub/java/jdk/8u191-b12/2787e4a523244c269598db4e85c51e0c/jdk-8u191-linux-x64.tar.gz?AuthParam=1545469560_2e48f0e88b95e6414505d6bf5ff4cefb
|
或者 jdk-8u191-linux-x64.rpm
1
| rpm -ivh jdk-8u191-linux-x64.rpm
|
安装后查看java版本
设置环境变量
1 2 3 4
| vi .bash_profile
在最后添加 export JAVA_HOME=/usr/java/default
|
3 安装ES
1
| rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
|
在/etc/yum.repos.d/ 中编辑elasticsearch5x.repo
1 2 3 4 5 6 7 8
| [elasticsearch-5.x] name=Elasticsearch repository for 5.x packages baseurl=https://artifacts.elastic.co/packages/5.x/yum gpgcheck=1 gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch enabled=1 autorefresh=1 type=rpm-md
|
执行安装
1
| sudo yum install elasticsearch
|
4 启动
1 2 3
| sudo systemctl enable elasticsearch.service
sudo systemctl start elasticsearch.service
|
5 安装ik中文分析器
1 2 3
| cd /usr/share/elasticsearch
./bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v5.6.13/elasticsearch-analysis-ik-5.6.13.zip
|
重启es服务
1
| sudo systemctl restart elasticsearch
|