使用grafana+prometheus+node_exporter+influxdb 从零开始搭建服务器监控平台

Prometheus数据存储、集群和高可用 文章目录1. Prometheus 储存瓶颈2. 本地存储2.1 本地存储配置2.2 从失败中恢复3. 远程存储3.1 Remote Write3.2 Remote Read3.3 配置文件3.4 使用Influxdb作为远程存储3.4.1 Influxdb部署3.4.2 创建数据库3.4.3 Prometheus指定存储路径3.4.4 添加远程读写3.4.5 验证influxdb数据4. 联邦集群4.1 使用联邦集群4.2 功能分区5. Prometheus高可用部署5.1 基本HA:服务可用性5.2 基 阅读详情

前言

最近公司有对服务器进行性能监控的需求在查阅大量资料后。本人将从零开始一步步演示在Centos上搭建监控系统平台

1. node_exporter

为监控线上服务器CPU、内存、磁盘、IO等信息需要借助node_exporter完成以上机器信息收集在下面你将会了解到:

  • 本地搭建一个node_exporter
  • 将搭建好的node_exporter与prometheus配合使用

我们可以从github查找自己需要的node_exporter版本进行下载。
在这里插入图片描述

下载地址如下:

wget https://github.com/prometheus/node_exporter/releases/download/v0.18.1/node_exporter-0.18.1.linux-amd64.tar.gz

解压安装:

tar -zxvf node_exporter-0.18.1.linux-amd64.tar.gz -C /soft/service
mv node_exporter-0.18.1.linux-amd64 node_exporter

进入node_exporter目录运行服务:

cd node_exporter
./node_exporter

启动后你将会看到下面的显示的界面且可以清晰看到此服务运行绑定端口号为9100如下所示:
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-GXAzbciG-1590235006889)(/Users/codegeekgao/Library/Application Support/typora-user-images/image-20200523160301303.png)]
浏览器可以访问此端口以查看效果(需开放此端口或者关闭防火墙):
在这里插入图片描述

2. prometheus

Prometheus是一个开源的系统监控和警报工具包,rometheus使用Go语言开发,是Google BorgMon监控系统的开源版本。

官方文档展示的架构图如下所示:
在这里插入图片描述
官方下载地址:https://prometheus.io/download/
下载prometheus安装包:

wget https://github.com/prometheus/prometheus/releases/download/v2.18.1/prometheus-2.18.1.linux-amd64.tar.gz

解压安装:

tar -zxvf prometheus-2.18.1.linux-amd64.tar.gz -C /soft/service
mv prometheus-2.18.1.linux-amd64 prometheus

配置 prometheus监控目标:

cd prometheus
vim prometheus.yml

在配置文件中添加如下内容:

  - job_name: 'export_test2'
    static_configs:
      - targets: ['10.211.55.5:9100']
        labels:
          instance: 'node2'

然后我们浏览器访问此9100端口如果出现以下界面,恭喜你已经成功安装好了prometheus。
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-jmNkml5z-1590235006895)(/Users/codegeekgao/Library/Application Support/typora-user-images/image-20200523162721718.png)]

然后我们输入一个 node_cpu_seconds_total 命令并点击Execute 查看是否有数据输出如下所示:
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-l7NMS9wQ-1590235006897)(/Users/codegeekgao/Library/Application Support/typora-user-images/image-20200523163137768.png)]

注意事项

  1. prometheus默认采用的是本地磁盘做数据存储,本地存储的优势就是运维简单但是缺点就是无法海量的metrics持久化和数据存在丢失的风险,数据写入可能造成wal文件损坏导致采集数据无法再写入的问题。

  2. 为了解决单节点存储的限制,prometheus没有自己实现集群存储,而是提供了远程读写的接口,让用户自己选择合适的时序数据库来实现prometheus的扩展性。

  3. Prometheus 提供接口将数据写入到第三方存储系统亦提供接口读取第三方存储系统存储的数据原理如下所示:
    在这里插入图片描述
    接下来我们将node_exporter收集到Prometheus的数据持久化到influxdb数据库中。

3. influxdb

InfluxDB(时序数据库)常用的一种使用场景:服务器监控数据统计然后将数据统计汇总并借助Grafana进行图形化展示

官方下载地址:https://portal.influxdata.com/downloads/
在这里插入图片描述
下载安装包:

wget https://dl.influxdata.com/influxdb/releases/influxdb-1.5.2.x86_64.rpm

安装rpm包

sudo yum localinstal linfluxdb-1.5.2.x86_64.rpm

启动服务并设置开机启动:

# 启动InfluxDB服务、添加开机启动:
systemctl start influxdb
systemctl enable influxdb

当安装完毕后输入influx 然后就弹出如下界面:
在这里插入图片描述
接下来可以创建数据库以及用户

# 创建名称为prometheus的数据库实例
1.create database prometheus
# 切换数据库实例prometheus
2. use prometheus
# 创建用户名和密码都为node的用户,注意密码只能用''字符否则influxdb将会报错
3.create user "node" with password 'node'

4. Remote storage adapter

这个是prometheus 官方提供的写适配器插件,通过Prometheus的远程写协议接收样本,并将它们存储在Graphite, InfluxDB, or OpenTSDB 中。

下载此插件需要机器拥有go环境,这样就可以自主编译remote_storage_adapter插件,关于go环境配置这里就不过多介绍读者可以从网上很多博客找到相关素材。
编译好后即可运行插件,如果没有go环境也不想编译此组件,也可以下载这个编译好的组件:remote_storage_adapter:

./remote_storage_adapter --influxdb-url=http://127.0.0.1:8086/ --influxdb.database="prometheus" --influxdb.retention-policy=autogen

在这里插入图片描述
配置 prometheus.yml

# 远程写配置
remote_write:
  - url: "http://localhost:9201/write"
  # 配置连接influxdb连接的用户名与密码
    basic_auth:
      username: node
      password: node
# 远程读配置
remote_read:
  - url: "http://localhost:9201/read"
    basic_auth:
      username: node
      password: node

然后重启prometheus 然后可以在启动日志可以看到如下输出:
在这里插入图片描述
然后我们在进入influx查看是否已拥有数据:

[root@donniegao prometheus-2.17.1.linux-amd64]# influx
Connected to http://localhost:8086 version 1.5.2
InfluxDB shell version: 1.5.2
> use prometheus
Using database prometheus
> show measurements
name: measurements
name
----
_
go_gc_duration_seconds
go_gc_duration_seconds_count
go_gc_duration_seconds_sum
go_goroutines
go_info
go_memstats_alloc_bytes
go_memstats_alloc_bytes_total
go_memstats_buck_hash_sys_bytes
go_memstats_frees_total
go_memstats_gc_cpu_fraction
go_memstats_gc_sys_bytes
go_memstats_heap_alloc_bytes
go_memstats_heap_idle_bytes
go_memstats_heap_inuse_bytes
go_memstats_heap_objects
go_memstats_heap_released_bytes
go_memstats_heap_sys_bytes
go_memstats_last_gc_time_seconds
go_memstats_lookups_total
go_memstats_mallocs_total
go_memstats_mcache_inuse_bytes
go_memstats_mcache_sys_bytes
go_memstats_mspan_inuse_bytes
go_memstats_mspan_sys_bytes
go_memstats_next_gc_bytes
go_memstats_other_sys_bytes
go_memstats_stack_inuse_bytes
go_memstats_stack_sys_bytes
go_memstats_sys_bytes
go_threads
net_conntrack_dialer_conn_attempted_total
net_conntrack_dialer_conn_closed_total
net_conntrack_dialer_conn_established_total
net_conntrack_dialer_conn_failed_total
net_conntrack_listener_conn_accepted_total
net_conntrack_listener_conn_closed_total
node_arp_entries
node_boot_time_seconds
node_context_switches_total
node_cpu_guest_seconds_total
node_cpu_seconds_total
node_disk_io_now
node_disk_io_time_seconds_total
node_disk_io_time_weighted_seconds_total
node_disk_read_bytes_total
node_disk_read_time_seconds_total
node_disk_reads_completed_total
node_disk_reads_merged_total
node_disk_write_time_seconds_total
node_disk_writes_completed_total
node_disk_writes_merged_total
node_disk_written_bytes_total
node_entropy_available_bits
node_exporter_build_info
node_filefd_allocated
node_filefd_maximum
node_filesystem_avail_bytes
node_filesystem_device_error
node_filesystem_files
node_filesystem_files_free
node_filesystem_free_bytes
node_filesystem_readonly
node_filesystem_size_bytes
node_forks_total
node_hwmon_chip_names
node_hwmon_sensor_label
node_hwmon_temp_celsius
node_hwmon_temp_crit_alarm_celsius
node_hwmon_temp_crit_celsius
node_hwmon_temp_max_celsius
node_intr_total
node_load1
node_load15
node_load5
node_memory_Active_anon_bytes
node_memory_Active_bytes
node_memory_Active_file_bytes
node_memory_AnonHugePages_bytes
node_memory_AnonPages_bytes
node_memory_Bounce_bytes
node_memory_Buffers_bytes
node_memory_Cached_bytes
node_memory_CmaFree_bytes
node_memory_CmaTotal_bytes
node_memory_CommitLimit_bytes
node_memory_Committed_AS_bytes
node_memory_DirectMap2M_bytes
node_memory_DirectMap4k_bytes
node_memory_Dirty_bytes
node_memory_HardwareCorrupted_bytes
node_memory_HugePages_Free
node_memory_HugePages_Rsvd
node_memory_HugePages_Surp
node_memory_HugePages_Total
node_memory_Hugepagesize_bytes
node_memory_Inactive_anon_bytes
node_memory_Inactive_bytes
node_memory_Inactive_file_bytes
node_memory_KernelStack_bytes
node_memory_Mapped_bytes
node_memory_MemAvailable_bytes
node_memory_MemFree_bytes
node_memory_MemTotal_bytes
node_memory_Mlocked_bytes
node_memory_NFS_Unstable_bytes
node_memory_PageTables_bytes
node_memory_SReclaimable_bytes
node_memory_SUnreclaim_bytes
node_memory_Shmem_bytes
node_memory_Slab_bytes
node_memory_SwapCached_bytes
node_memory_SwapFree_bytes
node_memory_SwapTotal_bytes
node_memory_Unevictable_bytes
node_memory_VmallocChunk_bytes
node_memory_VmallocTotal_bytes
node_memory_VmallocUsed_bytes
node_memory_WritebackTmp_bytes
node_memory_Writeback_bytes
node_netstat_Icmp6_InErrors
node_netstat_Icmp6_InMsgs
node_netstat_Icmp6_OutMsgs
node_netstat_Icmp_InErrors
node_netstat_Icmp_InMsgs
node_netstat_Icmp_OutMsgs
node_netstat_Ip6_InOctets
node_netstat_Ip6_OutOctets
node_netstat_IpExt_InOctets
node_netstat_IpExt_OutOctets
node_netstat_Ip_Forwarding
node_netstat_TcpExt_ListenDrops
node_netstat_TcpExt_ListenOverflows
node_netstat_TcpExt_SyncookiesFailed
node_netstat_TcpExt_SyncookiesRecv
node_netstat_TcpExt_SyncookiesSent
node_netstat_TcpExt_TCPSynRetrans
node_netstat_Tcp_ActiveOpens
node_netstat_Tcp_CurrEstab
node_netstat_Tcp_InErrs
node_netstat_Tcp_InSegs
node_netstat_Tcp_OutSegs
node_netstat_Tcp_PassiveOpens
node_netstat_Tcp_RetransSegs
node_netstat_Udp6_InDatagrams
node_netstat_Udp6_InErrors
node_netstat_Udp6_NoPorts
node_netstat_Udp6_OutDatagrams
node_netstat_UdpLite6_InErrors
node_netstat_UdpLite_InErrors
node_netstat_Udp_InDatagrams
node_netstat_Udp_InErrors
node_netstat_Udp_NoPorts
node_netstat_Udp_OutDatagrams
node_network_address_assign_type
node_network_carrier
node_network_carrier_changes_total
node_network_device_id
node_network_dormant
node_network_flags
node_network_iface_id
node_network_iface_link
node_network_iface_link_mode
node_network_info
node_network_mtu_bytes
node_network_net_dev_group
node_network_protocol_type
node_network_receive_bytes_total
node_network_receive_compressed_total
node_network_receive_drop_total
node_network_receive_errs_total
node_network_receive_fifo_total
node_network_receive_frame_total
node_network_receive_multicast_total
node_network_receive_packets_total
node_network_transmit_bytes_total
node_network_transmit_carrier_total
node_network_transmit_colls_total
node_network_transmit_compressed_total
node_network_transmit_drop_total
node_network_transmit_errs_total
node_network_transmit_fifo_total
node_network_transmit_packets_total
node_network_transmit_queue_length
node_network_up
node_procs_blocked
node_procs_running
node_scrape_collector_duration_seconds
node_scrape_collector_success
node_sockstat_FRAG_inuse
node_sockstat_FRAG_memory
node_sockstat_RAW_inuse
node_sockstat_TCP_alloc
node_sockstat_TCP_inuse
node_sockstat_TCP_mem
node_sockstat_TCP_mem_bytes
node_sockstat_TCP_orphan
node_sockstat_TCP_tw
node_sockstat_UDPLITE_inuse
node_sockstat_UDP_inuse
node_sockstat_UDP_mem
node_sockstat_UDP_mem_bytes
node_sockstat_sockets_used
node_textfile_scrape_error
node_time_seconds
node_timex_estimated_error_seconds
node_timex_frequency_adjustment_ratio
node_timex_loop_time_constant
node_timex_maxerror_seconds
node_timex_offset_seconds
node_timex_pps_calibration_total
node_timex_pps_error_total
node_timex_pps_frequency_hertz
node_timex_pps_jitter_seconds
node_timex_pps_jitter_total
node_timex_pps_shift_seconds
node_timex_pps_stability_exceeded_total
node_timex_pps_stability_hertz
node_timex_status
node_timex_sync_status
node_timex_tai_offset_seconds
node_timex_tick_seconds
node_uname_info
node_vmstat_pgfault
node_vmstat_pgmajfault
node_vmstat_pgpgin
node_vmstat_pgpgout
node_vmstat_pswpin
node_vmstat_pswpout
node_xfs_allocation_btree_compares_total
node_xfs_allocation_btree_lookups_total
node_xfs_allocation_btree_records_deleted_total
node_xfs_allocation_btree_records_inserted_total
node_xfs_block_map_btree_compares_total
node_xfs_block_map_btree_lookups_total
node_xfs_block_map_btree_records_deleted_total
node_xfs_block_map_btree_records_inserted_total
node_xfs_block_mapping_extent_list_compares_total
node_xfs_block_mapping_extent_list_deletions_total
node_xfs_block_mapping_extent_list_insertions_total
node_xfs_block_mapping_extent_list_lookups_total
node_xfs_block_mapping_reads_total
node_xfs_block_mapping_unmaps_total
node_xfs_block_mapping_writes_total
node_xfs_extent_allocation_blocks_allocated_total
node_xfs_extent_allocation_blocks_freed_total
node_xfs_extent_allocation_extents_allocated_total
node_xfs_extent_allocation_extents_freed_total
process_cpu_seconds_total
process_max_fds
process_open_fds
process_resident_memory_bytes
process_start_time_seconds
process_virtual_memory_bytes
process_virtual_memory_max_bytes
prometheus_api_remote_read_queries
prometheus_build_info
prometheus_config_last_reload_success_timestamp_seconds
prometheus_config_last_reload_successful
prometheus_engine_queries
prometheus_engine_queries_concurrent_max
prometheus_engine_query_duration_seconds
prometheus_engine_query_duration_seconds_count
prometheus_engine_query_duration_seconds_sum
prometheus_engine_query_log_enabled
prometheus_engine_query_log_failures_total
prometheus_http_request_duration_seconds_bucket
prometheus_http_request_duration_seconds_count
prometheus_http_request_duration_seconds_sum
prometheus_http_requests_total
prometheus_http_response_size_bytes_bucket
prometheus_http_response_size_bytes_count
prometheus_http_response_size_bytes_sum
prometheus_notifications_alertmanagers_discovered
prometheus_notifications_dropped_total
prometheus_notifications_queue_capacity
prometheus_notifications_queue_length
prometheus_remote_storage_dropped_samples_total
prometheus_remote_storage_enqueue_retries_total
prometheus_remote_storage_failed_samples_total
prometheus_remote_storage_highest_timestamp_in_seconds
prometheus_remote_storage_pending_samples
prometheus_remote_storage_queue_highest_sent_timestamp_seconds
prometheus_remote_storage_remote_read_queries
prometheus_remote_storage_retried_samples_total
prometheus_remote_storage_samples_in_total
prometheus_remote_storage_sent_batch_duration_seconds_bucket
prometheus_remote_storage_sent_batch_duration_seconds_count
prometheus_remote_storage_sent_batch_duration_seconds_sum
prometheus_remote_storage_sent_bytes_total
prometheus_remote_storage_shard_capacity
prometheus_remote_storage_shards
prometheus_remote_storage_shards_desired
prometheus_remote_storage_shards_max
prometheus_remote_storage_shards_min
prometheus_remote_storage_string_interner_zero_reference_releases_total
prometheus_remote_storage_succeeded_samples_total
prometheus_rule_evaluation_duration_seconds_count
prometheus_rule_evaluation_duration_seconds_sum
prometheus_rule_evaluation_failures_total
prometheus_rule_evaluations_total
prometheus_rule_group_duration_seconds_count
prometheus_rule_group_duration_seconds_sum
prometheus_rule_group_iterations_missed_total
prometheus_rule_group_iterations_total
prometheus_sd_consul_rpc_duration_seconds_count
prometheus_sd_consul_rpc_duration_seconds_sum
prometheus_sd_consul_rpc_failures_total
prometheus_sd_discovered_targets
prometheus_sd_dns_lookup_failures_total
prometheus_sd_dns_lookups_total
prometheus_sd_failed_configs
prometheus_sd_file_read_errors_total
prometheus_sd_file_scan_duration_seconds_count
prometheus_sd_file_scan_duration_seconds_sum
prometheus_sd_kubernetes_events_total
prometheus_sd_received_updates_total
prometheus_sd_updates_total
prometheus_target_interval_length_seconds
prometheus_target_interval_length_seconds_count
prometheus_target_interval_length_seconds_sum
prometheus_target_metadata_cache_bytes
prometheus_target_metadata_cache_entries
prometheus_target_scrape_pool_reloads_failed_total
prometheus_target_scrape_pool_reloads_total
prometheus_target_scrape_pool_sync_total
prometheus_target_scrape_pools_failed_total
prometheus_target_scrape_pools_total
prometheus_target_scrapes_cache_flush_forced_total
prometheus_target_scrapes_exceeded_sample_limit_total
prometheus_target_scrapes_sample_duplicate_timestamp_total
prometheus_target_scrapes_sample_out_of_bounds_total
prometheus_target_scrapes_sample_out_of_order_total
prometheus_target_sync_length_seconds
prometheus_target_sync_length_seconds_count
prometheus_target_sync_length_seconds_sum
prometheus_template_text_expansion_failures_total
prometheus_template_text_expansions_total
prometheus_treecache_watcher_goroutines
prometheus_treecache_zookeeper_failures_total
prometheus_tsdb_blocks_loaded
prometheus_tsdb_checkpoint_creations_failed_total
prometheus_tsdb_checkpoint_creations_total
prometheus_tsdb_checkpoint_deletions_failed_total
prometheus_tsdb_checkpoint_deletions_total
prometheus_tsdb_compaction_chunk_range_seconds_bucket
prometheus_tsdb_compaction_chunk_range_seconds_count
prometheus_tsdb_compaction_chunk_range_seconds_sum
prometheus_tsdb_compaction_chunk_samples_bucket
prometheus_tsdb_compaction_chunk_samples_count
prometheus_tsdb_compaction_chunk_samples_sum
prometheus_tsdb_compaction_chunk_size_bytes_bucket
prometheus_tsdb_compaction_chunk_size_bytes_count
prometheus_tsdb_compaction_chunk_size_bytes_sum
prometheus_tsdb_compaction_duration_seconds_bucket
prometheus_tsdb_compaction_duration_seconds_count
prometheus_tsdb_compaction_duration_seconds_sum
prometheus_tsdb_compaction_populating_block
prometheus_tsdb_compactions_failed_total
prometheus_tsdb_compactions_skipped_total
prometheus_tsdb_compactions_total
prometheus_tsdb_compactions_triggered_total
prometheus_tsdb_head_active_appenders
prometheus_tsdb_head_chunks
prometheus_tsdb_head_chunks_created_total
prometheus_tsdb_head_chunks_removed_total
prometheus_tsdb_head_gc_duration_seconds_count
prometheus_tsdb_head_gc_duration_seconds_sum
prometheus_tsdb_head_max_time
prometheus_tsdb_head_max_time_seconds
prometheus_tsdb_head_min_time
prometheus_tsdb_head_min_time_seconds
prometheus_tsdb_head_samples_appended_total
prometheus_tsdb_head_series
prometheus_tsdb_head_series_created_total
prometheus_tsdb_head_series_not_found_total
prometheus_tsdb_head_series_removed_total
prometheus_tsdb_head_truncations_failed_total
prometheus_tsdb_head_truncations_total
prometheus_tsdb_isolation_high_watermark
prometheus_tsdb_isolation_low_watermark
prometheus_tsdb_lowest_timestamp
prometheus_tsdb_lowest_timestamp_seconds
prometheus_tsdb_reloads_failures_total
prometheus_tsdb_reloads_total
prometheus_tsdb_retention_limit_bytes
prometheus_tsdb_size_retentions_total
prometheus_tsdb_storage_blocks_bytes
prometheus_tsdb_symbol_table_size_bytes
prometheus_tsdb_time_retentions_total
prometheus_tsdb_tombstone_cleanup_seconds_bucket
prometheus_tsdb_tombstone_cleanup_seconds_count
prometheus_tsdb_tombstone_cleanup_seconds_sum
prometheus_tsdb_vertical_compactions_total
prometheus_tsdb_wal_completed_pages_total
prometheus_tsdb_wal_corruptions_total
prometheus_tsdb_wal_fsync_duration_seconds
prometheus_tsdb_wal_fsync_duration_seconds_count
prometheus_tsdb_wal_fsync_duration_seconds_sum
prometheus_tsdb_wal_page_flushes_total
prometheus_tsdb_wal_segment_current
prometheus_tsdb_wal_truncate_duration_seconds_count
prometheus_tsdb_wal_truncate_duration_seconds_sum
prometheus_tsdb_wal_truncations_failed_total
prometheus_tsdb_wal_truncations_total
prometheus_tsdb_wal_writes_failed_total
prometheus_wal_watcher_current_segment
prometheus_wal_watcher_record_decode_failures_total
prometheus_wal_watcher_records_read_total
prometheus_wal_watcher_samples_sent_pre_tailing_total
promhttp_metric_handler_requests_in_flight
promhttp_metric_handler_requests_total
scrape_duration_seconds
scrape_samples_post_metric_relabeling
scrape_samples_scraped
scrape_series_added
up
>

如果你的influxdb数据库有数据那么接下来就可以安装grafana了。

5. grafana

grafana 是一款采用 go 语言编写的开源应用,主要用于大规模指标数据的可视化展现,是网络架构和应用分析中最流行的时序数据展示工具,

官方下载地址:https://grafana.com/grafana/download
在这里插入图片描述

下载安装包:

wget https://dl.grafana.com/oss/release/grafana-6.7.2-1.x86_64.rpm

安装grafana

 yum localinstall -y grafana-6.7.2-1.x86_64.rpm

启动服务并添加开机启动

systemctl start grafana-server
systemctl enablegrafana-server.service

浏览器访问3000端口如下:
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-LUpgqcVv-1590235006902)(/Users/codegeekgao/Library/Application Support/typora-user-images/image-20200523174104670.png)]接下来需配置一下grafana的prometheus数据源

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-FOHJdl1q-1590235006902)(/Users/codegeekgao/Library/Application Support/typora-user-images/image-20200523180651756.png)]
这里我已经进行了配置如下:
在这里插入图片描述
然后我们在配置influxdb
在这里插入图片描述
选择influxdb并设置连接属性如下:
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-GU5lVyQT-1590235006904)(/Users/codegeekgao/Library/Application Support/typora-user-images/image-20200523184529931.png)]
在这里插入图片描述
接下来我们访问 https://grafana.com/grafana/dashboards下载自己需要的dashborad模版如下所示:

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-qoWYBkH0-1590235006906)(/Users/codegeekgao/Library/Application Support/typora-user-images/image-20200523174307269.png)]
我们这里点击上图 Node Exporter for Prometheus Dashboard CN v20191102 并下载这个模版

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-t18JkBOz-1590235006906)(/Users/codegeekgao/Library/Application Support/typora-user-images/image-20200523174508784.png)]
接下来我们需要导入此模版详细步骤截图如下所示:
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-hNaYGmdl-1590235006907)(/Users/codegeekgao/Library/Application Support/typora-user-images/image-20200523174636444.png)]
选择上传json文件如下所示:
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-6kwUwEba-1590235006907)(/Users/codegeekgao/Library/Application Support/typora-user-images/image-20200523174741924.png)]
然后这里我们使用刚刚下载的模版json文件如下所示:
在这里插入图片描述

模版导入后可以查看grafana模版效果如下所示:
在这里插入图片描述
到这里一个完整的监控平台已经全部搭建成功。

(三)性能实时监控平台搭建(Grafana+Prometheus+Node_explorer+Jmeter) 前言 前面两章讲过如何根据Grafana+Prometheus+influxdb+Jmeter搭建可视化监控平台,相信有很多同学已经搭建完成啦!这章就讲解根据Grafana+Prometheus+Node explorer+Jmeter搭建可视化监控平台,很多同学都想知道如何监控服务器的资源比如CPU、内存、网络的使用情况,就跟着我们一起操作吧! 创建Grafana容器和Prometheus容器前面两节都讲过啦!这章就不絮叨啦! (一)性能实时监控平台搭建(Grafana+Influxdb+Jmet 阅读详情

相关推荐

性能监控平台 | Prometheus+InfluxDB + Grafana!

为什么要解释数据的逻辑呢?因为最近在工作中遇到一些情况,有人觉得有了 Prometheus + Grafana + Exportor 这样的组合工具之后,基本上都不再用手工执行什么命令了。但我们要了解的是,对于监控平台来说,它取的所有的数据必然是被监控者可以提供的数据,像 node_exporter 这样小巧的监控收集器,它可以获取的监控数据,并不是整个系统全部的性能数据,只是取到了常见的计数器而已。这些计数器不管是用命令查看,还是用这样炫酷的工具查看,它的值本身都不会变。

m0_73409141的博客 1498

prometheus查询合并标签

有查询语句1(得到温度传感器的名称): node_hwmon_sensor_label{instance="192.168.1.100", label=~"core_.*"} 得到结果: node_hwmon_sensor_label{chip="platform_coretemp_0", instance="192.168.1.100", job="node-development", label="core_0", sensor="temp2"} 1 node_hwmon_sensor_lab

weixin_43620243的博客 3160

grafana+influxdb+prometheus+node exporter+jmeter实时监控.docx

grafana+influxdb+prometheus+node exporter+jmeter实时监控.docx 个人整理,适合新手快速入门,捣鼓几天的结果。。

Prometheus部分监控项

Prometheus监控主机指标信息

weixin_39546259的博客 4037

Win10蓝屏代码critical process died的解决方法

critical process died”蓝屏错误是Win10操作系统中较为常见的问题之一。当遇到这一问题时,可以尝试通过修复当前系统、检查硬盘槽位或重新安装系统等方法来解决。本文详细介绍了这三种方法的操作步骤和注意事项,希望能帮助大家摆脱这一困扰。同时,也建议大家在日常使用中注意系统的维护和更新,以减少类似问题的发生。

mmoo_python的博客 9551

实战指南:基于Windows Server构建企业级AAA认证体系

本文详细介绍了如何在Windows Server环境下构建企业级AAA认证体系,涵盖AD域服务部署、NPS服务器配置及华为设备对接实战。通过整合Radius协议与AD域账号管理,实现网络设备的统一认证与权限控制,提升企业IT安全管理效率。特别适用于需要零成本实现AAA认证的中大型企业。

weixin_28304023的博客 432

基于Docker搭建node-exporter+Prometheus+Grafana服务器监控平台

目录一、前言二、node-exporter安装三、Prometheus安装及配置3.1 设置配置文件3.2 Docker安装Prometheus四、Grafana安装及配置4.1 Grafana安装4.2 Grafana配置Prometheus4.3 下载模板并创建仪表盘 一、前言 在前面 Linux服务器监控:Grafana+InfluxDB+Telegraf监控平台搭建这篇中讲到一种服务器监控的方式。下面给大家说一下另一种服务器监控的方式,使用node-exporter+Prometheus+Graf

一个Tester的博客 1万+

Chatbox使用指南

Chatbox使用指南

weixin_65289420的博客 2万+

InfluxDB、Grafana、node_exporter、Prometheus搭建压测平台

本文介绍了使用InfluxDB、Grafana、node_exporter、Prometheus搭建压测平台的过程。

随机的未知——用已知去面对未知 1983

动力锂电池-二阶RC模型等效电路-RLS参数辨识-Simulink

1.锂电池二阶RC等效电路模型

QQ1978009424的博客 1万+

基于MCP协议为AI编程助手集成Codecks任务看板

Model Context Protocol(MCP)作为AI助手与外部工具集成的标准化协议,其核心原理是通过定义统一的服务器-客户端通信规范,实现大模型对第三方服务的安全访问。这一架构的技术价值在于解耦了AI工具与具体服务的集成逻辑,开发者只需按照MCP规范实现服务端,即可让所有兼容客户端获得该服务的操作能力。在工程实践中,MCP协议常被用于将项目管理、代码仓库等开发工具接入AI工作流。本文聚焦于codecks-mcp这一具体实现,详细解析如何通过MCP服务器让Cursor、Claude等AI编程助手直接

weixin_26750831的博客 540

【运维监控】Prometheus+grafana监控tomcat运行情况

通过jmx_exporter收集tomcat的运行情况,将数据收集到prometheus中,然后通过grafana的dashboard导入模板进行可视化

alanchanchn的专栏 4万+

Coze 上 OpenClaw 完整使用攻略(零代码 + 24 小时在线 + 飞书 / 微信接入)

Coze(扣子)是目前国内零门槛部署 OpenClaw 最友好的平台,无需服务器、不用命令行,5 分钟即可拥有可执行本地 / 云端任务的 AI 助手,还能一键发布到飞书、微信、钉钉等 IM。

hy行者勇哥的博客 2944

【运维监控】Prometheus+grafana监控spring boot 3运行情况

通过spring boot自带的监控信息暴露出来,然后将数据收集到prometheus中,最后通过grafana的dashboard导入模板进行可视化

alanchanchn的专栏 4万+

运行时安全引擎RSE

该博客重点介绍了运行时安全引擎(Runtime Security Engine,简称 RSE)与应用处理器(Application Processor,简称 AP)之间的关系。 根据 ARM 的参考设计,RSE 是位于同一芯片(die)上的一个独立核心,与 AP 和系统控制处理器(System Control Processor,简称 SCP)并列存在。RSE 为整个系统提供基本的安全保障和运行时服务,例如:可信启动(trusted boot)、度量启动(measured boot)、平台认证(platf

AI-安全-功耗 1380

《QGIS快速入门与应用基础》010:下载过程中常见问题(如网速慢、文件损坏)

针对QGIS下载过程中的常见问题提供了系统解决方案。主要解决下载速度慢(≤100KB/s)和文件损坏两大核心问题:通过切换国内镜像源(如清华大学、阿里云)、使用专业下载工具提升速度;采用MD5/SHA256校验确保文件完整性,并排查存储介质和杀毒软件干扰。文章还包含macOS权限问题、Linux依赖缺失等高频问题的速解方案,并附详细的排查流程图和预防技巧,帮助用户顺利完成QGIS下载。后续将详细介绍安装流程,适合零基础用户参考。

LuckyHanMo的博客 503

【prometheus】k8s集群部署Grafana安装和配置|Prometheus监控K8S

Grafana是一款用Go语言开发的开源数据可视化工具,可以做数据监控和数据统计,带有告警功能。目前使用grafana的公司有很多,如paypal、ebay、intel等。

康师傅没有眼泪 9024

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

性能监控平台:基于 Prometheus+InfluxDB + Grafana|果断收藏

为什么要解释数据的逻辑呢?因为最近在工作中遇到一些情况,有人觉得有了 Prometheus + Grafana + Exportor 这样的组合工具之后,基本上都不再用手工执行什么命令了。但我们要了解的是,对于监控平台来说,它取的所有的数据必然是被监控者可以提供的数据,像 node_exporter 这样小巧的监控收集器,它可以获取的监控数据,并不是整个系统全部的性能数据,只是取到了常见的计数器而已。这些计数器不管是用命令查看,还是用这样炫酷的工具查看,它的值本身都不会变。

2301_77645834的博客 1022

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

华为的C语言编程规范.pdf

华为技术有限公司内部技术规范。本规范制定了编写C语言程序的基本原则、规则和建议。从代码的清晰、简洁、可测试、安全、程序效率、可移植各个方面对C语言编程作出了具体指导。

性能监控体系:InfluxDB & Grafana & Prometheus

Grafana(官网)是一个跨平台的、开源的度量分析和可视化工具,可以通过将采集的数据查询然后可视化的展示,并及时通知。展示方式:快速灵活的客户端图表,面板插件有许多不同方式的可视化指标和日志,官方库中具有丰富的仪表盘插件,比如热图、折线图、图表等多种展示方式;支持多种数据源:Graphite、InfluxDB、OpenTSDB、Prometheus、Elasticsearch、CloudWatch 和 KairosDB 等;通知提醒。

GDYY3721的博客 3396

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

Prometheus+Grafana监控安装及配置

Prometheus简介与安装配置 Prometheus是一款开源的监控系统,采用多维度数据模型和灵活的查询语言,支持服务发现和多种数据展示方式。其核心组件包括Prometheus Server、客户端库、告警管理器等,多数由Go语言编写。安装时需下载二进制包并解压,通过配置文件prometheus.yml定义抓取目标与规则。文章提供了自编启动脚本示例,包含启停功能,并说明如何通过--web.external-url参数配合Nginx反向代理访问。

风向决定发型丶的博客 1372

Prometheus+influxdb1.8实现高可用监控系统

Prometheus+influxdb1.8实现高可用监控体系

热气球 2342

基于 Prometheus、InfluxDB 与 Grafana 打造监控平台

在本文中,我将把几个常用的监控部分给梳理一下。前面我们提到过,在性能监控图谱中,有操作系统、应用服务器、中间件、队列、缓存、数据库、网络、前端、负载均衡、Web 服务器、存储、代码等很多需...

架构师小秘圈 914
上一篇: Spring5框架之lookup-method与replaced-method方法实现依赖注入(四)
下一篇: Spring5框架之AOP-ProxyFactory底层实现(五)
Galen-gao
博客等级 码龄9年 932粉丝 137原创
评论 9
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值
⌂ 换网址