02.elasticsearch-monitor使用独立的集群存储监控data


  之前讨论的都是使用当前存数据的cluster作为monitor cluster,但是在生产上一般都推荐使用sepatate cluster用户存储data cluster的监控数据,使用separate monitoring-cluster有两种方式

  1. 使用http-exporter
  2. 使用metric-beat

1. es的exporter

  es的exporter的收集逻辑终于是基本上明白了,exporter主要是存在于es上,他的功能是接收由当前节点的es转发过来的消息再写入目标es(监控数据存储的es)

1.1 exporter主要功能

  1. 接收集群接收到的其他组件kibana,logstash,filebeat等的监控数据,这些监控数据会转发给exporter,然后由exporter决定发送到哪个集群
  2. 接收本地es的collector搜集到的数据,发送monitoring es集群

1.2 exporter分为两类

  1. local-exporter: 主要是将collector的数据和es转发过来的数据发送到当前节点的es当中
  2. http-exporter: 将1中的数据发送到配置的http路径下的es集群当中,进而可以实现monitoring-cluster的separated

当es配置了

 xpack.monitoring.collection.enabled: false

那么exporter就不会工作了,对应的当前es的monitor-data,从logstash,kibana等上报到当前集群的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将数据发送到production-cluster 然后可以通过production-cluster转发给他http-exporter 再由exporter转发给monitoring-cluster,因为production会加一些信息,可以更好的区分logstash是和这个集群相关的。

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: true

xpack.monitoring.enabled: true
xpack.monitoring.collection.enabled: true


# 这里的host是monitoring-cluster的地址
xpack.monitoring.exporters:
  my_remote:
    type: http
    host: ["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: true

xpack.monitoring.enabled: true

## 这个地方设置为了false,禁止收集当前集群的信息,禁止了exporter功能
xpack.monitoring.collection.enabled: false

monitor-kibana


server.name: monitor-search-dev
server.port: 55601
server.host: 10.76.0.129
elasticsearch.hosts: ["http://10.76.0.98:13200"]
# 禁止收集当前kibana的监控信息
xpack.monitoring.kibana.collection.enabled: false

#xpack.monitoring.enabled: true

采用上面的配置,在production-kibana的监控面板中就没有信息了,只需要使用kibana的其他功能就好了,比如创建图表等功能
在这里插入图片描述
在monitor-kibana的监控面板中显示的是production-es 和production-kibana的monitor-data,
在上面的配置,假如将production-kibana中的

xpack.monitoring.elasticsearch.hosts: ["http://10.76.0.98:12200"]

直接配置为,monitor-es的地址的话,反而会出现无法收集production-kibana monitor-data的情况,因为monitor-es已经设置了

xpack.monitoring.collection.enabled: false

exporter不再接受由es转发而来的信息。

1.5 使用exporter设置seperated monitoring-cluster总结

  使用exporter设置监控数据的独立data的集群的方式,除了es的数据是通过collector–>http exporter到monitoer-es的,其他的集群组件都是通过production-es route到http-exporter然后再到monitor-es的。
所以集群中的kibana,logstash,filbeat等都要配置monitor-data的目的地是production-es才行,直接配置monitoer-es会导致monitoer数据无法收集的情况。

2. 使用metricbeat监控

这个其实就是metribeat的使用,这个需要在每个节点上都装metricbeat,看起来比较麻烦,后期再整吧

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
ey Features Understand common performance and reliability pitfalls in ElasticSearch Use popular monitoring tools such as ElasticSearch-head, BigDesk, Marvel, Kibana, and more This is a step-by-step guide with lots of case studies on solving real-world ElasticSearch cluster issues Book Description ElasticSearch is a distributed search server similar to Apache Solr with a focus on large datasets, a schema-less setup, and high availability. This schema-free architecture allows ElasticSearch to index and search unstructured content, making it perfectly suited for both small projects and large big data warehouses with petabytes of unstructured data. This book is your toolkit to teach you how to keep your cluster in good health, and show you how to diagnose and treat unexpected issues along the way. You will start by getting introduced to ElasticSearch, and look at some common performance issues that pop up when using the system. You will then see how to install and configure ElasticSearch and the ElasticSearch monitoring plugins. Then, you will proceed to install and use the Marvel dashboard to monitor ElasticSearch. You will find out how to troubleshoot some of the common performance and reliability issues that come up when using ElasticSearch. Finally, you will analyze your cluster's historical performance, and get to know how to get to the bottom of and recover from system failures. This book will guide you through several monitoring tools, and utilizes real-world cases and dilemmas faced when using ElasticSearch, showing you how to solve them simply, quickly, and cleanly. What you will learn Explore your cluster with ElasticSearch-head and BigDesk Access the underlying data of the ElasticSearch monitoring plugins using the ElasticSearch API Analyze your cluster's performance with Marvel Troubleshoot some of the common performance and reliability issues that come up when using ElasticSearch Analyze a cluster's historical performance, and get to the bottom of and recover from system failures Use and install various other tools and plugins such as Kibana and Kopf, which is helpful to monitor ElasticSearch About the Author Dan Noble is a software engineer with a passion for writing secure, clean, and articulate code. He enjoys working with a variety of programming languages and software frameworks, particularly Python, Elasticsearch, and frontend technologies. Dan currently works on geospatial web applications and data processing systems. Dan has been a user and advocate of Elasticsearch since 2011. He has given talks about Elasticsearch at various meetup groups, and is the author of the Python Elasticsearch client rawes. Dan was also a technical reviewer for the Elasticsearch Cookbook, Second Edition, by Alberto Paro. Table of Contents Chapter 1. Introduction to Monitoring Elasticsearch Chapter 2. Installation and the Requirements for Elasticsearch Chapter 3. Elasticsearch-head and Bigdesk Chapter 4. Marvel Dashboard Chapter 5. System Monitoring Chapter 6. Troubleshooting Performance and Reliability Issues Chapter 7. Node Failure and Post-Mortem Analysis Chapter 8. Looking Forward

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值