Reference:
- Download the .zip archive for Elasticsearch 8.6.2 from:
- 解壓縮到 C:\elasticsearch-8.6.2
- 設定環境變數 ES_HOME = C:\elasticsearch-8.6.2
- 執行 C:\elasticsearch-8.6.2\bin\elasticsearch.bat 開始安裝
- 保存產生的 elastic password, fingerprint, enrollment token,之後會用到
- 測試 https://localhost:9200 用 elastic password 登入
- install Elasticsearch as a service
elasticsearch-service.bat install
elasticsearch-service.bat start
- 重設 elastic 密碼的指令
elasticsearch-reset-password -u elastic
- 如果有憑證檔要查詢SHA-256 fingerprint的方法
openssl x509 -noout -fingerprint -sha256 -inform pem -in [certificate-file.crt]
- Download the .zip windows archive for Kibana v8.6.2 from
- 解壓縮到 C:\kibana-8.6.2
- 設定環境變數 KIBANA_HOME = C:\kibana-8.6.2
- 執行 C:\kibana-8.6.2\bin\kibana.bat 會產生一個和 elasticsearch 連結的網址
這 token 只有30分鐘效期,如果過期可以用 C:\elasticsearch-8.6.2\bin\elasticsearch-create-enrollment-token -s kibana 重新產生
- 用 linux 的 openssl 產生憑證給 kibana
將這兩個檔案放到 C:\kibana-8.6.2\certs
- 修改 C:\kibana-8.6.2\config\kibana.yml 這幾行
server.host: W2022 #輸入hostname or IP
server.ssl.enabled: true
server.ssl.certificate: 'C:\kibana-8.6.2\certs\kibana.crt'
server.ssl.key: 'C:\kibana-8.6.2\certs\kibana.key'
- 執行 C:\kibana-8.6.2\bin\kibana.bat 啟動 Kibana
如果要把 kibana 做成 service,可測試 NSSM
- 安裝Winlogbeat將event log傳到Elasticsearch
https://www.elastic.co/downloads/beats/winlogbeat
- 將zip檔解壓縮到 C:\Program Files\Winlogbeat
- 用administrator權限開一個 powershell,執行這兩個指令
cd "C:\Program Files\Winlogbeat"
.\install-service-winlogbeat.ps1
.\install-service-winlogbeat.ps1
- 修改檔案 C:\Program Files\Winlogbeat\winlogbeat.yml
output.elasticsearch:
hosts: ["https://<elk01>:9200"]
protocol: "https"
username: "elastic"
password: "<password>"
ssl.ca_trusted_fingerprint: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
protocol: "https"
username: "elastic"
password: "<password>"
ssl.ca_trusted_fingerprint: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
setup.kibana:
host: "https://<elk01>:5601"
ssl.verification_mode: none
ssl.verification_mode: none
- Start Winlogbeat
.\winlogbeat.exe setup
Start-Service winlogbeat
Start-Service winlogbeat
沒有留言:
張貼留言