Centos8安装ElasticSearch

安装JDK1.8

官网下载jdk1.8,接着上传JDK后进行安装:

rpm -ivh jdk-8u211-linux-x64.rpm

下载ElasticSearch6.7.2并解压

cd /usr/local
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.7.2.tar.gz
tar -zxvf elasticsearch-6.7.2.tar.gz
mv ./elasticsearch-6.7.2 ./elasticsearch

修改配置文件

vim /usr/local/elasticsearch/config/elasticsearch.yml

如下内容需要根据需求进行更改:

cluster.name: yeqinfang
node.name: node-1
network.host: 0.0.0.0
http.port: 9244
transport.tcp.port: 9366
transport.publish_port: 9366
transport.bind_host: 0.0.0.0
transport.publish_host: 0.0.0.0
transport.host: 0.0.0.0
discovery.zen.ping.unicast.hosts: [“10.88.1.119:9300”]
http.cors.enabled: true
http.cors.allow-origin: “*”

创建ELK用户和组

创建

groupadd elk
useradd -g elk elk
chown -R elk:elk /usr/local/elasticsearch

启动ElasticSearch

启动

su elk
/usr/local/elasticsearch/bin/elasticsearch -d

设置开机启动(root操作)

cd /usr/local/elasticsearch

输入一下内容:
/usr/local/elasticsearch/startup.sh

Centos8安装ElasticSearch_第1张图片验证

ps -aux|grep elasticsearch

在这里插入图片描述

你可能感兴趣的:(Linux)