展示效果
实现步骤
1)采集ES监控数据
通过java程序或者spark任务采集es集群数据,并将采集数据存储到es索引history_metrics_test中
采集地址http://20.24.12.11:9200/_cluster/health
数据格式如下:
{
“metrics_type”:“clusterstats”,
“cluster_name”:“sccses_elasticsearch-6.2.4”,
“status”:“green”,
“timed_out”:false,
“number_of_nodes”:10,
“number_of_data_nodes”:9,
“active_primary_shards”:4472,
“active_shards”:8939,
“relocating_shards”:0,
“initializing_shards”:0,
“unassigned_shards”:0,
“delayed_unassigned_shards”:0,
“number_of_pending_tasks”:0,
“number_of_in_flight_fetch”:0,
“task_max_waiting_in_queue_millis”:0,
“active_shards_percent_as_number”:100
}
2)配置grafana elasticsearch数据源
2.1 新增数据源
2.2 选择elasticsearch源类型
2.3 配置elasticsearch源信息
3)新建DashBoards
选择形状
配置显示属性
折线图
柱状图