1、安装jdk
[root@k8smaster soft]# tar -zxvf jdk-8u191-linux-x64.tar.gz
2、配置参数,打开配置环境变量的文件 vi/etc/profile
添加以下配置
export JAVA_HOME=/opt/soft/jdk1.8.0_191
export CLASSPATH=$JAVA_HOME/bin
export PATH=.:$JAVA_HOME/bin:$PATH
[root@k8smaster soft]# vim /etc/profile
[root@k8smaster soft]# source /etc/profile
[root@k8smaster soft]# java -versin
Unrecognized option: -versin
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
[root@k8smaster soft]# java -version
java version "1.8.0_191"
Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)
3、下载elasticsearch
下载地址:https://www.elastic.co/cn/downloads/past-releases#elasticsearch
https://www.elastic.co/cn/downloads/past-releases/elasticsearch-6-8-7
[root@k8smaster soft]# tar -zxvf jdk-8u191-linux-x64.tar.gz
4、安装elasticsearch
[root@k8smaster ~]# useradd elk
[root@k8smaster ~]# passwd elk
[root@k8smaster bin]# chown -R elk:elk /opt/soft/elasticsearch-6.8.7
[root@k8smaster bin]# su elk
[elk@k8smaster bin]$ ./elasticsearch
5、检查是否正常工作
curl localhost:9200