1、對應(yīng)版本

2、elasticeseach安裝
https://blog.csdn.net/weixin_48687824/article/details/123902319
問題1---權(quán)限問題

chown -R? elk:elk /data/elasticserach? 解決
問題2--網(wǎng)絡(luò)不通?

network.host: 0.0.0.0? ?---修改網(wǎng)卡地址
http.port: 9200? ---放開服務(wù)端口
問題3--elasticsearch用戶擁有的內(nèi)存權(quán)限太小,至少需要262144

在/etc/sysctl.conf文件最后添加一行
vm.max_map_count=262144
需要使其立即生效
/sbin/sysctl -p
/sbin/sysctl -w net.ipv4.route.flush=1
至此啟動成功~~~~


3、部署kibana
錯誤原因---未設(shè)置用戶名及密碼


重新啟動?ctrl + z? 可退出讓進程在后臺運行
端口被占用??netstat -tpln

查了了云服務(wù)器 ip 需用內(nèi)網(wǎng)IP
至此kiaba啟動成功

后臺運行? nohup ./kibana &
4.Logstash安裝
安裝成功

5.springboot 日志接入
springboot項目配置?logging.config=classpath:logback-spring.xml 文件
日志成功采集


6.整合IK分詞器
創(chuàng)建IK目錄,將IK分詞器解壓至插件目錄下---版本需與ES一致

7.springboot 整合
application.properties
# 指定默認集群名和ip端口
spring.data.elasticsearch.cluster-name=elasticsearch
spring.data.elasticsearch.cluster-nodes=ip:9300
pom.xml
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-elasticsearch</artifactId>
</dependency>
<dependency>
<groupId>net.logstash.logback</groupId>
<artifactId>logstash-logback-encoder</artifactId>
<version>5.3</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>



