02.elasticsearch-monitor使用独立的集群存储监控data
文章目錄
- 1. es的exporter
- 1.1 exporter主要功能
- 1.2 exporter分為兩類
- 1.3 es文檔中的route的含義
- 1.4 使用http exporter配置separated monitoring-cluster
- 1.4.1 production-cluster
- 1.4.2 monitoring-cluster
- 1.5 使用exporter設(shè)置seperated monitoring-cluster總結(jié)
- 2. 使用metricbeat監(jiān)控
??之前討論的都是使用當(dāng)前存數(shù)據(jù)的cluster作為monitor cluster,但是在生產(chǎn)上一般都推薦使用sepatate cluster用戶存儲data cluster的監(jiān)控數(shù)據(jù),使用separate monitoring-cluster有兩種方式
1. es的exporter
??es的exporter的收集邏輯終于是基本上明白了,exporter主要是存在于es上,他的功能是接收由當(dāng)前節(jié)點(diǎn)的es轉(zhuǎn)發(fā)過來的消息再寫入目標(biāo)es(監(jiān)控數(shù)據(jù)存儲的es)
1.1 exporter主要功能
1.2 exporter分為兩類
當(dāng)es配置了
xpack.monitoring.collection.enabled: false那么exporter就不會工作了,對應(yīng)的當(dāng)前es的monitor-data,從logstash,kibana等上報到當(dāng)前集群的monitor-data都會不再被收集。
1.3 es文檔中的route的含義
??這個時候終于懂了es文檔中總是會提到的production-cluster route monitor data to monitoring-cluster是啥意思了,這里
The Elasticsearch cluster that is configured for use with X-Pack monitoring for Logstash is expected to be the production cluster. This configuration enables the production Elasticsearch cluster to add metadata (for example, its cluster UUID) to the Logstash monitoring data then route it to the monitoring clusters.??就是logstash將數(shù)據(jù)發(fā)送到production-cluster 然后可以通過production-cluster轉(zhuǎn)發(fā)給他http-exporter 再由exporter轉(zhuǎn)發(fā)給monitoring-cluster,因?yàn)閜roduction會加一些信息,可以更好的區(qū)分logstash是和這個集群相關(guān)的。
1.4 使用http exporter配置separated monitoring-cluster
1.4.1 production-cluster
production-cluster-es
cluster.name: dev-log node.name: ES01 bootstrap.system_call_filter: false network.host: 10.76.0.98 http.port: 12200 transport.port: 12300 discovery.seed_hosts: ["10.76.0.98:12300","10.76.3.145:12300","10.76.0.129:12300"]cluster.initial_master_nodes: ["ES01", "ES02","ES03"]xpack.monitoring.elasticsearch.collection.enabled: truexpack.monitoring.enabled: true xpack.monitoring.collection.enabled: true# 這里的host是monitoring-cluster的地址 xpack.monitoring.exporters:my_remote:type: httphost: ["10.76.0.98:13200","10.76.3.145:13200","10.76.0.129:13200"]productiong-kibana
server.name: following-search-dev server.port: 45601 server.host: 10.76.0.129 elasticsearch.hosts: ["http://10.76.0.98:12200"] xpack.monitoring.kibana.collection.enabled: true xpack.monitoring.enabled: true xpack.monitoring.elasticsearch.hosts: ["http://10.76.0.98:12200"]1.4.2 monitoring-cluster
monitoring-es
cluster.name: monitor-log node.name: ES01 bootstrap.system_call_filter: false network.host: 10.76.0.98 http.port: 13200 transport.port: 13300 discovery.seed_hosts: ["10.76.0.98:13300","10.76.3.145:13300","10.76.0.129:13300"]cluster.initial_master_nodes: ["ES01", "ES02","ES03"]xpack.monitoring.elasticsearch.collection.enabled: truexpack.monitoring.enabled: true## 這個地方設(shè)置為了false,禁止收集當(dāng)前集群的信息,禁止了exporter功能 xpack.monitoring.collection.enabled: falsemonitor-kibana
server.name: monitor-search-dev server.port: 55601 server.host: 10.76.0.129 elasticsearch.hosts: ["http://10.76.0.98:13200"] # 禁止收集當(dāng)前kibana的監(jiān)控信息 xpack.monitoring.kibana.collection.enabled: false#xpack.monitoring.enabled: true采用上面的配置,在production-kibana的監(jiān)控面板中就沒有信息了,只需要使用kibana的其他功能就好了,比如創(chuàng)建圖表等功能
在monitor-kibana的監(jiān)控面板中顯示的是production-es 和production-kibana的monitor-data,
在上面的配置,假如將production-kibana中的
直接配置為,monitor-es的地址的話,反而會出現(xiàn)無法收集production-kibana monitor-data的情況,因?yàn)閙onitor-es已經(jīng)設(shè)置了
xpack.monitoring.collection.enabled: falseexporter不再接受由es轉(zhuǎn)發(fā)而來的信息。
1.5 使用exporter設(shè)置seperated monitoring-cluster總結(jié)
??使用exporter設(shè)置監(jiān)控數(shù)據(jù)的獨(dú)立data的集群的方式,除了es的數(shù)據(jù)是通過collector–>http exporter到monitoer-es的,其他的集群組件都是通過production-es route到http-exporter然后再到monitor-es的。
所以集群中的kibana,logstash,filbeat等都要配置monitor-data的目的地是production-es才行,直接配置monitoer-es會導(dǎo)致monitoer數(shù)據(jù)無法收集的情況。
2. 使用metricbeat監(jiān)控
這個其實(shí)就是metribeat的使用,這個需要在每個節(jié)點(diǎn)上都裝metricbeat,看起來比較麻煩,后期再整吧
總結(jié)
以上是生活随笔為你收集整理的02.elasticsearch-monitor使用独立的集群存储监控data的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 01. elastcsearch-mon
- 下一篇: 01.elasticsearch-sec