springboot整合elasticsearch kibana Logstash

1、對應(yīng)版本

springboot與elasticserach對應(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

至此啟動成功~~~~

ip:9200

3、部署kibana

錯誤原因---未設(shè)置用戶名及密碼


設(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>


dao






最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容