1、下载ElasticSearch8.9并安装

https://www.elastic.co/guide/en/elasticsearch/reference/8.9/rpm.html#rpm-repo

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.9.0-x86_64.rpm
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.9.0-x86_64.rpm.sha512
shasum -a 512 -c elasticsearch-8.9.0-x86_64.rpm.sha512 
sudo rpm --install elasticsearch-8.9.0-x86_64.rpm

2、添加服务并启动服务

sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable elasticsearch.service

sudo systemctl start elasticsearch.service
sudo systemctl stop elasticsearch.service

3、下载Kibana8.9并安装

https://www.elastic.co/guide/en/kibana/8.9/rpm.html#rpm-repo

wget https://artifacts.elastic.co/downloads/kibana/kibana-8.9.0-x86_64.rpm
wget https://artifacts.elastic.co/downloads/kibana/kibana-8.9.0-x86_64.rpm.sha512
shasum -a 512 -c kibana-8.9.0-x86_64.rpm.sha512 
sudo rpm --install kibana-8.9.0-x86_64.rpm

4、添加服务并启动服务

sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable kibana.service

sudo systemctl start kibana.service
sudo systemctl stop kibana.service

5、配置地址

/etc/elasticsearch                /etc/kibana

6、应用地址

/usr/share/elasticsearch                /usr/share/kibana

7、登录kibana

第一步 获取es的token
cd /usr/share/elasticsearch bin/elasticsearch-create-enrollment-token -s kibana --url "https://localhost:9200"
第二步 获取kibana的验证码
cd /usr/share/kibana
bin/kibana-verification-code
等待kibana自动配置(但是貌似会卡在“completing setup”)
第三步 重置elastic的密码
cd /usr/share/elasticsearch/bin
elasticsearch-reset-password -u elastic
第四步 修改成自己的常用密码(非必须)
cd /usr/share/elasticsearch/bin
elasticsearch-reset-password -u elastic -i

 8、加入新的集群

生成节点类型token
docker exec -it es01 /usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s node
启动新节点
docker run -e ENROLLMENT_TOKEN="<token>" -e ES_JAVA_OPTS="-Xms1g -Xmx1g" --name es02 --net elastic -p 9202:9200 -p 9302:9300 -it docker.elastic.co/elasticsearch/elasticsearch:8.9.1