下載軟體
Java: Java Downloads | Oracle
Logstash: Download Logstash Free | Get Started Now | Elastic
Elasticsearch: Download Elasticsearch | Elastic
Kibana: Download Kibana Free | Get Started Now | Elastic
Nxlog: NXLog Community Edition - Downloads | nxlog.co
Nssm: NSSM - the Non-Sucking Service Manager
幫助檔案
Logstash Codec plugins | Logstash Reference [8.0] | Elastic
Elasticsearch Elasticsearch: The Definitive Guide [2.x] | Elastic
Kibana Kibana Guide [8.0] | Elastic
Nxlog Documentation | nxlog.co
nssm:NSSM - the Non-Sucking Service Manager
安裝java
下載 Java SE Downloads,我下載的是jdk-8u65-windows-x64.exe
安裝完成后添加JAVA_HOME 環境變數

Path添加 %JAVA_HOME%\bin
1.2 Elasticsearch安裝并使用
Elasticsearch是個開源分布式搜索引擎,它的特點有:分布式,零配置,自動發現,索引自動分片,索引副本機制,restful風格介面,多資料源,自動搜索負載等,
1、編輯ES組態檔:
進入目錄:
E:\software\elasticsearch-7.1.0\config\elasticsearch.yml,修改如下配置:(備注:根據個人自己路徑修改配置)
# 監聽地址和埠
network.host: 127.0.0.1 #es的網路IP
http.port: 9200 #es服務默認埠
#跨域配置
http.cors.enabled: true
http.cors.allow-origin: "*"
2、啟動ES
進入目錄E:\software\elasticsearch-7.1.0\bin執行
elasticsearch.bat
兩種方法:
1、進入E:\software\elasticsearch-7.1.0\bin 直接雙擊elasticsearch.bat
2、打開Windows PowerShell 進入E:\software\elasticsearch-7.1.0\bin 執行 .\elasticsearch.bat或者.\elasticsearch 執行完成,

打開瀏覽器訪問地址:http://127.0.0.1:9200,展現如下資訊表示成功,

3、elasticsearch-head安裝
elasticsearch-head是一個用于管理Elasticsearch的web前端插件
GitHub - mobz/elasticsearch-head: A web front end for an elastic search cluster
運行環境準備node.js,Grunt
npm install -g grunt-cli
git clone git://github.com/mobz/elasticsearch-head.git
cd elasticsearch-head
npm install
注:這邊有可能會報錯

執行:npm audit fix --force
npm install -g

修改elasticsearch.yml,增加跨域的配置(需要重啟es才能生效)
http.cors.enabled: true
http.cors.allow-origin: "*"
編輯elasticsearch-head/Gruntfile.js,修改服務器監聽地址,connect節點增加hostname屬性,將其值設定為*
connect: {
server: {
options: {
hostname:'*',
port: 9100,
base: '.',
keepalive: true
}
}
}
編輯elasticsearch-head/_site/app.js, 修改默認es地址為http://127.0.0.1:9200/, 也可以不修改,
啟動
npm run start
瀏覽器打開http://127.0.0.1:9100/
注意下列資訊需要在Logstash連接ES上后才可以展現,

ES資料默認存盤位置:
E:\software\elasticsearch-7.1.0\data
1.3 Logstash安裝并使用
Logstash是一個接收,處理,轉發日志的工具,支持各種型別的日志,
進入 E:\software\logstash-7.1.0\config,然后新建Logstash日志分析組態檔logstash.conf,內容如下:

2、啟動Logstash
進入D:\elk\logstash-7.17.0\bin
logstash.bat -f ..\config\logstash.conf
并在file->path檔案中添加資料,
到ES查看資料同步情況,
1.4 Kibana安裝并使用
kibana 是一個開源和免費的工具,它可以為 Logstash 和 ElasticSearch 提供的日志分析友好的 Web 界面,可以幫助您匯總、分析和搜索重要資料日志,
1、編輯Kibana組態檔:
E:\software\kibana-7.1.0-windows-x86_64\config\kibana.yml 修改如下配置
server.port: 5601 #本機的埠
server.host: 192.168.1.102 #本機IP地址
elasticsearch.url: http://192.168.1.102:9200 #ES的服務IP+埠
2、啟動Kibana
E:\software\kibana-7.1.0-windows-x86_64\bin 執行
kibana.bat
3、瀏覽Kibana資料
kibana: http://127.0.0.1:5601/
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/431482.html
標籤:其他
上一篇:error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or
