通过prometheus插件elasticsearch_exporter实现
-
在需要挂起监控的es集群下载安装elasticsearch_exporter插件
下载地址:https://github.com/prometheus-community/elasticsearch_exporter/releases -
下载后解压
tar -zxvf elasticsearch_exporter-1.1.0.linux-amd64.tar.gz -
启动插件
cd elasticsearch_exporter-1.1.0.linux-amd64/
nohup ./elasticsearch_exporter --es.all --es.indices --es.cluster_settings --es.indices_settings --es.shards --es.snapshots --es.timeout=10s --web.listen-address=“:9116” --web.telemetry-path=“/metrics” --es.uri http://username:[email protected]:9200 &
参数解释:
–es.uri 默认http://localhost:9200,连接到的Elasticsearch节点的地址(主机和端口)。 这可以是本地节点(例如localhost:9200),也可以是远程Elasticsearch服务器的地址
–es.all 默认flase,如果为true,则查询群集中所有节点的统计信息,而不仅仅是查询我们连接到的节点。
–es.cluster_settings 默认flase,如果为true,请在统计信息中查询集群设置
–