ELK企業級日志分析平臺——ES集群監控

啟用xpack認證

官網:https://www.elastic.co/guide/en/elasticsearch/reference/7.6/configuring-tls.html#node-certificates

在elk1上生成證書

[root@elk1 ~]# cd /usr/share/elasticsearch/[root@elk1 elasticsearch]# bin/elasticsearch-certutil ca[root@elk1 elasticsearch]# bin/elasticsearch-certutil cert --ca elastic-stack-ca.p12[root@elk1 elasticsearch]# cp elastic-certificates.p12 /etc/elasticsearch[root@elk1 elasticsearch]# cd /etc/elasticsearch/[root@elk1 elasticsearch]# chown elasticsearch elastic-certificates.p12
[root@elk1 elasticsearch]# vim elasticsearch.yml...
http.cors.allow-headers: Authorization,X-Requested-With,Content-Length,Content-Typexpack.security.enabled: true
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.keystore.path: /etc/elasticsearch/elastic-certificates.p12
xpack.security.transport.ssl.truststore.path: /etc/elasticsearch/elastic-certificates.p12

[root@elk1 elasticsearch]# systemctl  restart elasticsearch.service

拷貝證書到其它集群節點

[root@elk1 elasticsearch]# scp elastic-certificates.p12 server2:/etc/elasticsearch/[root@elk1 elasticsearch]# scp elastic-certificates.p12 server3:/etc/elasticsearch/

elk2配置

[root@elk2 ~]# chown elasticsearch /etc/elasticsearch/elastic-certificates.p12[root@elk2 ~]# vim /etc/elasticsearch/elasticsearch.yml...
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.keystore.path: /etc/elasticsearch/elastic-certificates.p12
xpack.security.transport.ssl.truststore.path: /etc/elasticsearch/elastic-certificates.p12[root@elk2 ~]# systemctl  restart elasticsearch.service

elk3配置

[root@elk3 ~]# chown elasticsearch /etc/elasticsearch/elastic-certificates.p12[root@elk3 ~]# vim /etc/elasticsearch/elasticsearch.yml...
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.keystore.path: /etc/elasticsearch/elastic-certificates.p12
xpack.security.transport.ssl.truststore.path: /etc/elasticsearch/elastic-certificates.p12[root@elk3 ~]# systemctl  restart elasticsearch.service

等待所有集群節點重啟成功后,設置認證賬戶密碼

[root@elk1 elasticsearch]# cd /usr/share/elasticsearch/[root@elk1 elasticsearch]# bin/elasticsearch-setup-passwords interactive

交互式輸入密碼

ES啟用xpack之后,其它服務都需要配置認證

elasticsearch-head插件

head插件在訪問時,需要在url中輸入用戶和密碼

[root@k8s1 ~]# cd elasticsearch-head-master/[root@k8s1 elasticsearch-head-master]# npm run start &

訪問:192.168.92.11:9100/?auth_user=elastic&auth_password=westos

cerebro插件

cerebro訪問:

[root@k8s1 ~]# docker start cerebro

訪問:192.168.92.11:9000

?

kibana訪問

[root@elk5 kibana]# vim kibana.yml
...
elasticsearch.username: "kibana"
elasticsearch.password: "westos"[root@elk5 kibana]# systemctl  restart kibana.service

?

metricbeat監控

官網:https://www.elastic.co/guide/en/elasticsearch/reference/7.6/configuring-metricbeat.html

首先使用內部檢測,然后進入設置模式

?

選擇啟動metricbeat的節點,然后根據提示步驟操作

安裝軟件

[root@elk1 ~]# rpm -ivh metricbeat-7.6.1-x86_64.rpm

啟動elasticsearch-xpack模塊

[root@elk1 ~]# cd /etc/metricbeat/modules.d[root@elk1 modules.d]# metricbeat modules enable elasticsearch-xpack

編輯elasticsearch-xpack模塊配置文件

[root@elk1 modules.d]# vim elasticsearch-xpack.yml- module: elasticsearchmetricsets:- ccr- cluster_stats- enrich- index- index_recovery- index_summary- ml_job- node_stats- shardperiod: 10shosts: ["http://localhost:9200"]username: "remote_monitoring_user"password: "westos"xpack.enabled: true

編輯metricbeat配置文件

[root@elk1 modules.d]# cd ..[root@elk1 metricbeat]# vim metricbeat.yml...
output.elasticsearch:hosts: ["http://192.168.56.11:9200"]username: "elastic"password: "westos"

啟動metricbeat服務

[root@elk1 metricbeat]# systemctl enable --now metricbeat.service

?

其它節點依次類推

?

最后退出設置模式

kibana?監控

安裝軟件

[root@elk5 ~]# rpm -ivh metricbeat-7.6.1-x86_64.rpm

啟動kibana-xpack模塊

[root@elk5 ~]# cd /etc/metricbeat/modules.d/[root@elk5 ~]# metricbeat modules enable kibana-xpack

編輯kibana-xpack模塊配置文件

[root@elk5 modules.d]# vim kibana-xpack.ymlusername: "elastic"password: "westos"

編輯metricbeat配置文件

[root@elk5 modules.d]# cd ..[root@elk5 metricbeat]# vim metricbeat.ymlhosts: ["http://192.168.92.31:9200"]username: "elastic"
password: "westos"

啟動metricbeat服務

[root@elk5 ~]# systemctl enable --now metricbeat.service

禁用內部檢測

[root@elk5 ~]# vim /etc/kibana/kibana.ymlxpack.monitoring.kibana.collection.enabled: false

重啟kibana服務

[root@elk5 ~]# systemctl restart kibana.service

filebeat日志采集

文檔:https://www.elastic.co/guide/en/beats/filebeat/7.6/filebeat-module-elasticsearch.html

安裝軟件

[root@elk1 ~]# rpm -ivh filebeat-7.6.1-x86_64.rpm

啟動elasticsearch模塊

[root@elk1 ~]# cd /etc/filebeat/modules.d[root@elk1 modules.d]# filebeat modules enable elasticsearch

編輯elasticsearch模塊配置文件

[root@elk1 modules.d]# vim elasticsearch.yml- module: elasticsearch# Server logserver:enabled: true# Set custom paths for the log files. If left empty,# Filebeat will choose the paths depending on your OS.var.paths:- /var/log/elasticsearch/*.log          # Plain text logs- /var/log/elasticsearch/*_server.json  # JSON logsgc:enabled: true# Set custom paths for the log files. If left empty,# Filebeat will choose the paths depending on your OS.var.paths:- /var/log/elasticsearch/gc.log.[0-9]*- /var/log/elasticsearch/gc.logaudit:enabled: true# Set custom paths for the log files. If left empty,# Filebeat will choose the paths depending on your OS.var.paths:- /var/log/elasticsearch/*_access.log  # Plain text logs- /var/log/elasticsearch/*_audit.json  # JSON logsslowlog:enabled: true# Set custom paths for the log files. If left empty,# Filebeat will choose the paths depending on your OS.var.paths:- /var/log/elasticsearch/*_index_search_slowlog.log     # Plain text logs- /var/log/elasticsearch/*_index_indexing_slowlog.log   # Plain text logs- /var/log/elasticsearch/*_index_search_slowlog.json    # JSON logs- /var/log/elasticsearch/*_index_indexing_slowlog.json  # JSON logsdeprecation:enabled: true# Set custom paths for the log files. If left empty,# Filebeat will choose the paths depending on your OS.var.paths:- /var/log/elasticsearch/*_deprecation.log   # Plain text logs- /var/log/elasticsearch/*_deprecation.json  # JSON logs

編輯filebeat配置文件

[root@elk1 modules.d]# cd ..[root@elk1 filebeat]# vim filebeat.yml...
output.elasticsearch:hosts: ["http://192.168.92.31:9200"]username: "elastic"password: "westos"

啟動filebeat服務

[root@elk1 filebeat]# systemctl  enable --now filebeat.service

?

其它節點依次類推

?

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/164599.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/164599.shtml
英文地址,請注明出處:http://en.pswp.cn/news/164599.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

GB/T 29498-2013 木門窗檢測

木門窗是指以木材、木質復合材料為主要材料制作框和扇的門窗。 GB/T 29498-2013 木門窗檢測項目 測試項目 測試標準 外觀質量 GB/T 29498 尺寸 GB/T 29498 裝配質量 GB/T 29498 含水率 GB/T 17657 附著力 GB/T 4893.4 外門窗耐冷熱循環 GB/T 4893.7 耐劃痕 GB/…

Volcano3D繪制3D火山圖

一邊學習,一邊總結,一邊分享! 本期教程內容 **注:**本教程詳細內容 Volcano3D繪制3D火山圖 一、前言 火山圖是做差異分析中最常用到的圖形,在前面的推文中,我們也推出了好幾期火山圖的繪制教程&#xff0…

【代數學習題4.2】從零理解范數與跡 —— 求數域元素的范數與跡

從零理解范數與跡 —— 求數域元素的范數與跡 寫在最前面題目解答 2. 范數 N N N思路求解過程python求解 3. 數域 K K K 的范數 N K N_K NK?思路求解過程Python求解分析解題步驟 4. 跡 T T T求解過程共軛元素計算跡 python求解分析解題步驟 5. 數域 K K K 的跡 T K T_K …

讀書筆記——《黑猩猩的政治》

前言 弗朗斯德瓦爾(Frans de Waal)的代表作《黑猩猩政治》成書于1982年,是它的首部書籍作品,也是美國國會新任議員的被推薦讀物。之前看的他另一部作品的《萬智有靈》是2016年的作品,時間跨度居然這么大。《萬智有靈》介紹了許多…

代碼隨想錄 135. 分發糖果

題目 n 個孩子站成一排。給你一個整數數組 ratings 表示每個孩子的評分。 你需要按照以下要求,給這些孩子分發糖果: 每個孩子至少分配到 1 個糖果。 相鄰兩個孩子評分更高的孩子會獲得更多的糖果。 請你給每個孩子分發糖果,計算并返回需要準…

SDK廣告類型及其作用與收益分析

在移動應用開發領域,軟件開發工具包(SDK)廣告已經成為應用開發者們獲取收益的一種重要途徑。不同類型的SDK廣告提供了多樣化的選擇,以滿足開發者的需求。本文將介紹幾種常見的SDK廣告類型,并深入探討它們的作用及對開發…

SPASS-信度分析

信度分析概述 效度 效度指的是量表是否真正反映了我們希望測量的東西。一般來說,有4種類型的效度:內容效度、標準效度、結構效度和區分效度。內容效度是一種基于概念的評價指標,其他三種效度是基于經驗的評價指標。如果一個量表實際上是有效…

【亞太杯前兩問論文】2023年第十三屆APMCM亞太地區大學生數學建模競賽——(文末領取方式)

2023年第十三屆APMCM亞太地區大學生數學建模競賽——論文無償分享!!! C題前兩問論文代碼已出,其他賽題及后續論文代碼會持續更新。 祝各位小伙伴都能在比賽中發揮出色,取得心儀的成績呦!一起加油&#xff…

vscode在運行c語言時,無法scanf輸入

問題: 在學習c語言中,我在使用scanf和cin時無法在終端進行輸入(運行了但是無法輸入),在網上尋找答案,并寫下筆記 解決方法 選擇左上角 文件->首選項(preferences)->設置(settings&#xf…

網關和鏈路追蹤

Spring Cloud的網關 在Spring Cloud中,網關(Gateway)是一種用于管理和路由微服務請求的中間層服務。它充當了整個微服務架構的入口點,負責將來自外部的請求轉發到相應的微服務上。常見的網關包括Spring Cloud Gateway和Netflix Zu…

Java類加載那些事

Java源文件(.java文件)被編譯器編譯后變為字節碼形式的類文件(.class文件),Java類加載的過程就是JVM加載.class的二進制文件并且放到內存中,將數據放到方法區,并且在堆區構造一個java.lang.clas…

動態規劃從入門到精通

目錄 動態規劃的詳解 動態規劃的應用 機器人到達指定位置數 換錢的最少貨幣數 排成一條線的紙牌博弈問題 象棋中馬的跳法 Bob的生存概率 換錢的方法數 動態規劃的總結 動態規劃的詳解 暴力嘗試遞歸操作中有很多重復計算的操作,浪費時間。動態規劃就是減少暴力…

大模型增量預訓練參數說明

在增量預訓練過程中通常需要設置三類或四類參數,模型參數,數據參數,訓練參數,額外參數。 下面分別針對這四種參數進行說明。 歡迎關注公眾號 模型參數 model_type模型類型,例如bloom,llama,baichuan,qwen等。 model_name_or_path模型名稱或者路徑。 tokenizer_name_or…

JS數組常用的20種方法詳解(每一個方法都有例子,超全面,超好理解的教程,干貨滿滿)

目錄 1.會改變原數組的方法(7種) 1.push() 2.pop() 3.unshift() 4.shift() 5.reverse() 6.sort() 7.splice() 2.不改變原數組的方法(13種,返回的新數組是從原數組淺拷貝來的) 1.concat() 2.join() 3.slice…

12個最佳WordPress投票插件

您是否正在為您的網站尋找WordPress投票插件? WordPress投票插件可讓您輕松地在您的網站上進行民意調查,用戶可以投票。這是在收集見解的同時建立用戶參與度的有效策略。 在本文中,我們精心挑選了最好的WordPress投票插件,可幫助…

代碼隨想錄算法訓練營第五十二天|300.最長遞增子序列 674. 最長連續遞增序列 718. 最長重復子數組

文檔講解:代碼隨想錄 視頻講解:代碼隨想錄B站賬號 狀態:看了視頻題解和文章解析后做出來了 300.最長遞增子序列 class Solution: # 2516 ms, faster than 64.96%def lengthOfLIS(self, nums: List[int]) -> int:n len(nums)dp [1] * n…

從Discord的做法中學習 — 使用Golang進行請求合并

正如你可能之前看到的,Discord去年發布了一篇有價值的文章,討論了他們成功存儲了數萬億條消息。雖然有很多關于這篇文章的YouTube視頻和文章,但我認為這篇文章中一個名為“數據服務為數據服務”的部分沒有得到足夠的關注。在這篇文章中&#…

QT項目移植到VS+QT(RTI-DDS)

QT中.pro文件中include(./xxx.pri) pri文件如下定義 unset(FILENAMES)for(FILENAME, FILENAMES) {HEADERFILE $$PWD/$${FILENAME}.hif(exists($$HEADERFILE)) {HEADERS * $$HEADERFILE}SOURCEFILE $$PWD/$${FILENAME}.cppif(exists($$SOURCEFILE)) {SOURCES * $$SOURCEFILE}…

CSS-鼠標屬性篇

屬性名:cursor 功能:設置鼠標光標的樣式 屬性值: pointer:小手move:移動圖標text:文字選擇器crosshair:十字架wait:等待help:幫助 eg.html{ cursor: wait;}(此處使用css改…

SpringBoot——MVC原理

優質博文:IT-BLOG-CN 一、SpringMVC自動配置 SpringMVC auto-configuration:SpringBoot自動配置好了SpringMVC。以下是SpringBoot對SpringMVC的默認配置:[WebMvcAutoConfiguration] 【1】包括ContentNegotiatingViewResolver和BeanNameView…