ELK 8.x 安裝方式

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

ELK 8.

X 安裝⽅式
1. 安裝java的Open JDK 11版本
yum install java-11-openjdk.x86_64 -y
java --version

2. 下載Elasticsearch,官⽅網址:link
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.x.x-x86_64.rpm

3. 安裝Elasticsearch
yum install elasticsearch-8.4.3-x86_64.rpm -y
安裝成功會出現底下畫⾯,在先記下避免後續操作會使⽤到
預設密碼 => The generated password for the elastic built-in superuser is : el*bB9S8MrQxoBBHwPrm
變更密碼
Reset the password of the elastic built-in superuser with
'/usr/share/elasticsearch/bin/elasticsearch-reset-password -u elastic'.

建⽴kibana token
Generate an enrollment token for Kibana instances with
'/usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s kibana'.

建⽴es node token


Generate an enrollment token for Elasticsearch nodes with
'/usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s node'.

ELK 8.X 安裝⽅式 1


4. 設定單節點ES
調整Elasticsearch設定檔,位於/etc/elasticsearch/elasticsearch.yml
先備份原本的設定檔
cd /etc/elasticsearch
cp elasticsearch.yml elasticsearch.yml.bk
之後修改該資料,⽬前因單機測試所以只指定本機以及 PORT
vim elasticsearch.yml

5. 調整啟動JVM⽤量
vim jvm.options
如記憶體有超過 以上,再做調整
8G
將 都改為
-Xms4g, -Xmx4g
-Xms7G
-Xmx7G

6. 啟動Elasticsearch
systemctl start elasticsearch

7. 確認Elasticsearch啟動狀況
systemctl status elasticsearch.service

8. 檢查Elasticsearch狀態

ELK 8.X 安裝⽅式 2


curl https://192.168.101.97:9200 --cacert /etc/elasticsearch/certs/http_ca.crt -u elastic

9. 建⽴kibana token
/usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token --scope kibana
kibana token:
eyJ2ZXIiOiI4LjQuMyIsImFkciI6WyIxOTIuMTY4LjEwMS45Nzo5MjAwIl0sImZnciI6IjJiNTJhOWNjZGYwMzU0NTYxMmVkNjk2Y2M2ZGQyYTI3NDVlNmU3YmI3ODcyY2Y5ZTEwOGE0

ELK 8.X 安裝⽅式 3

You might also like