在原备案号下增加新网站,wordpress调用oss,网页设计的步骤有哪些,wordpress用途文章目录 前言一、环境简介1.1 环境简介1.2 部署清单1.3 组件版本 二、部署步骤2.1 prometheus部署2.2 kafka集群部署2.3 prometheus-kafka-adapter部署 三、数据验证四、总结 前言 
根据项目要求#xff0c;需将prometheus监控数据存储到kafka中。前面为了图方便就搭建了单机… 文章目录 前言一、环境简介1.1 环境简介1.2 部署清单1.3 组件版本 二、部署步骤2.1 prometheus部署2.2 kafka集群部署2.3 prometheus-kafka-adapter部署 三、数据验证四、总结 前言 
根据项目要求需将prometheus监控数据存储到kafka中。前面为了图方便就搭建了单机版的kafka进行验证但是kafka中一直没有数据后来部署了kafka集群才解决了这个问题。 将prometheus监控数据写入到kafka中大多数都是使用prometheus-kafka-adapter插件当然如果条件允许也可以自己开发。 
一、环境简介 
1.1 环境简介 
#1 系统版本
[rootes2][/opt]
$cat /etc/redhat-release 
CentOS Linux release 7.7.1908 (Core)#2 可通外网
[rootes2][/usr/local/prometheus]
$ping -c 3 www.baidu.com
PING www.a.shifen.com (220.181.38.150) 56(84) bytes of data.
64 bytes from 220.181.38.150 (220.181.38.150): icmp_seq1 ttl51 time6.65 ms
64 bytes from 220.181.38.150 (220.181.38.150): icmp_seq2 ttl51 time6.48 ms
64 bytes from 220.181.38.150 (220.181.38.150): icmp_seq3 ttl51 time5.95 ms--- www.a.shifen.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev  5.950/6.363/6.652/0.306 ms1.2 部署清单 
序号IP主机名部署服务1192.168.56.108es2prometheus2192.168.56.116cydockerdockerprometheus-kafka-adapter3kafka集群Ip192.168.56.101cnode1zk,kafka 
1.3 组件版本 
prometheus2.29.1docker20.10.14prometheus-kafka-adapter1.7.0kafka2.12-3.6.0 
二、部署步骤 
2.1 prometheus部署 
#1 解压缩
[rootnode1 package]# tar -zxvf prometheus-2.29.1.linux-amd64.tar.gz #2 移动并命名
[rootnode1 package]# mv prometheus-2.29.1.linux-amd64 /usr/local/prometheus#3 创建数据存储路径
[rootes2][/usr/local/prometheus]
$ mkdir -p /data/prometheus#4 修改prometheus.yml文件
[rootes2][/usr/local/prometheus]
$vim prometheus.yml- job_name: prometheus# metrics_path defaults to /metrics# scheme defaults to http.static_configs:- targets: [localhost:9090]# 远程写到prometheus-kafka-adaptor
remote_write:- url: http://192.168.56.116:10401/receive #这里换成部署prometheus-kafka-adaptor服务的节点IP#5 开启服务只为测试用正式环境请注册service
/usr/local/prometheus/prometheus \--config.file/usr/local/prometheus/prometheus.yml \--storage.tsdb.path/data/prometheus \--storage.tsdb.retention.time365d \--web.listen-address0.0.0.0:9090 \--web.enable-admin-api \--web.enable-lifecycle 
2.2 kafka集群部署 
请参考我写的上一篇博客《kafka集群部署搭建【详细版】》这里不错重复赘述但是需要先创建好topic。 
[rootcnode1][/opt/kafka_2.12-3.6.0/bin]
$ ./kafka-topics.sh --create --topic test1 --bootstrap-server cnode1:9092 --partitions 1 --replication-factor 32.3 prometheus-kafka-adapter部署 
docker部署这里不做赘述可以直接看其他人博客 
#1 拉取镜像
[rootcydocker][~]
$ docker pull telefonica/prometheus-kafka-adapter:1.7.0#2 编写启动脚本
[rootcydocker][~/adapoter]
$ cat adapoter.sh 
#!/usr/bin/env bash
docker run -d --name prometheus-kafka-adapter --restartalways -m 2g \
-e KAFKA_BROKER_LIST192.168.56.101:9092 \
-e KAFKA_TOPICtest1 \
-e PORT10401 \
-e SERIALIZATION_FORMATjson \
-e GIN_MODErelease \
-e LOG_LEVELdebug \
-p 10401:10401 \
telefonica/prometheus-kafka-adapter:1.7.0#3 查看运行状态
[rootcydocker][~/adapoter]
$ docker ps |grep kafka
8d47b0210004   telefonica/prometheus-kafka-adapter:1.7.0   /bin/sh -c /prometh…   4 days ago       Up 35 minutes   0.0.0.0:10401-10401/tcp, :::10401-10401/tcp   prometheus-kafka-adapter三、数据验证 
登陆到kafka节点进行验证结果如下 
[rootcnode1][/opt/kafka_2.12-3.6.0/bin]
$ ./kafka-console-consumer.sh --bootstrap-server cnode1:9092 --topic test1{labels:{__name__:prometheus_tsdb_reloads_total,instance:127.0.0.1:9090,job:prometheus},name:prometheus_tsdb_reloads_total,timestamp:2024-11-14T04:39:38Z,value:7}
{labels:{__name__:prometheus_tsdb_retention_limit_bytes,instance:127.0.0.1:9090,job:prometheus},name:prometheus_tsdb_retention_limit_bytes,timestamp:2024-11-14T04:39:38Z,value:0}
{labels:{__name__:prometheus_tsdb_size_retentions_total,instance:127.0.0.1:9090,job:prometheus},name:prometheus_tsdb_size_retentions_total,timestamp:2024-11-14T04:39:38Z,value:0}
{labels:{__name__:prometheus_tsdb_storage_blocks_bytes,instance:127.0.0.1:9090,job:prometheus},name:prometheus_tsdb_storage_blocks_bytes,timestamp:2024-11-14T04:39:38Z,value:1239229}
{labels:{__name__:prometheus_tsdb_symbol_table_size_bytes,instance:127.0.0.1:9090,job:prometheus},name:prometheus_tsdb_symbol_table_size_bytes,timestamp:2024-11-14T04:39:38Z,value:392}
{labels:{__name__:prometheus_tsdb_time_retentions_total,instance:127.0.0.1:9090,job:prometheus},name:prometheus_tsdb_time_retentions_total,timestamp:2024-11-14T04:39:38Z,value:0}
{labels:{__name__:prometheus_tsdb_tombstone_cleanup_seconds_bucket,instance:127.0.0.1:9090,job:prometheus,le:0.005},name:prometheus_tsdb_tombstone_cleanup_seconds_bucket,timestamp:2024-11-14T04:39:38Z,value:0}
{labels:{__name__:prometheus_tsdb_tombstone_cleanup_seconds_bucket,instance:127.0.0.1:9090,job:prometheus,le:0.01},name:prometheus_tsdb_tombstone_cleanup_seconds_bucket,timestamp:2024-11-14T04:39:38Z,value:0}
{labels:{__name__:prometheus_tsdb_tombstone_cleanup_seconds_bucket,instance:127.0.0.1:9090,job:prometheus,le:0.025},name:prometheus_tsdb_tombstone_cleanup_seconds_bucket,timestamp:2024-11-14T04:39:38Z,value:0}四、总结 
至此prometheus监控数据推送到kafka集群验证完毕大家如果有什么疑问请及时和我沟通交流。 文章转载自: http://www.morning.rgfx.cn.gov.cn.rgfx.cn http://www.morning.clbgy.cn.gov.cn.clbgy.cn http://www.morning.bgnkl.cn.gov.cn.bgnkl.cn http://www.morning.xgjhy.cn.gov.cn.xgjhy.cn http://www.morning.ljbm.cn.gov.cn.ljbm.cn http://www.morning.smspc.cn.gov.cn.smspc.cn http://www.morning.tsqrc.cn.gov.cn.tsqrc.cn http://www.morning.mkygc.cn.gov.cn.mkygc.cn http://www.morning.xtdtt.cn.gov.cn.xtdtt.cn http://www.morning.mynbc.cn.gov.cn.mynbc.cn http://www.morning.pwsnr.cn.gov.cn.pwsnr.cn http://www.morning.mmplj.cn.gov.cn.mmplj.cn http://www.morning.ktfbl.cn.gov.cn.ktfbl.cn http://www.morning.mdmxf.cn.gov.cn.mdmxf.cn http://www.morning.kongpie.com.gov.cn.kongpie.com http://www.morning.ayftwl.cn.gov.cn.ayftwl.cn http://www.morning.xrwbc.cn.gov.cn.xrwbc.cn http://www.morning.fxygn.cn.gov.cn.fxygn.cn http://www.morning.dqrhz.cn.gov.cn.dqrhz.cn http://www.morning.nccyc.cn.gov.cn.nccyc.cn http://www.morning.yxzfl.cn.gov.cn.yxzfl.cn http://www.morning.ygrkg.cn.gov.cn.ygrkg.cn http://www.morning.rknhd.cn.gov.cn.rknhd.cn http://www.morning.kxqfz.cn.gov.cn.kxqfz.cn http://www.morning.rjyd.cn.gov.cn.rjyd.cn http://www.morning.fwgnq.cn.gov.cn.fwgnq.cn http://www.morning.amonr.com.gov.cn.amonr.com http://www.morning.lfpzs.cn.gov.cn.lfpzs.cn http://www.morning.wztlr.cn.gov.cn.wztlr.cn http://www.morning.wfjrl.cn.gov.cn.wfjrl.cn http://www.morning.rwzc.cn.gov.cn.rwzc.cn http://www.morning.rgdcf.cn.gov.cn.rgdcf.cn http://www.morning.zlfxp.cn.gov.cn.zlfxp.cn http://www.morning.qtzqk.cn.gov.cn.qtzqk.cn http://www.morning.yrcxg.cn.gov.cn.yrcxg.cn http://www.morning.kyzja.com.gov.cn.kyzja.com http://www.morning.dzgmj.cn.gov.cn.dzgmj.cn http://www.morning.pccqr.cn.gov.cn.pccqr.cn http://www.morning.rgdcf.cn.gov.cn.rgdcf.cn http://www.morning.wjhnx.cn.gov.cn.wjhnx.cn http://www.morning.tmsxn.cn.gov.cn.tmsxn.cn http://www.morning.hsklc.cn.gov.cn.hsklc.cn http://www.morning.gbrps.cn.gov.cn.gbrps.cn http://www.morning.clbsd.cn.gov.cn.clbsd.cn http://www.morning.byywt.cn.gov.cn.byywt.cn http://www.morning.hrzky.cn.gov.cn.hrzky.cn http://www.morning.hcgbm.cn.gov.cn.hcgbm.cn http://www.morning.dnls.cn.gov.cn.dnls.cn http://www.morning.mcjxq.cn.gov.cn.mcjxq.cn http://www.morning.xpzkr.cn.gov.cn.xpzkr.cn http://www.morning.spkw.cn.gov.cn.spkw.cn http://www.morning.kxgn.cn.gov.cn.kxgn.cn http://www.morning.prgrh.cn.gov.cn.prgrh.cn http://www.morning.wmcng.cn.gov.cn.wmcng.cn http://www.morning.dwgcx.cn.gov.cn.dwgcx.cn http://www.morning.nnhrp.cn.gov.cn.nnhrp.cn http://www.morning.sqdjn.cn.gov.cn.sqdjn.cn http://www.morning.hphqy.cn.gov.cn.hphqy.cn http://www.morning.dxgt.cn.gov.cn.dxgt.cn http://www.morning.xbptx.cn.gov.cn.xbptx.cn http://www.morning.lfcnj.cn.gov.cn.lfcnj.cn http://www.morning.wlnr.cn.gov.cn.wlnr.cn http://www.morning.qkkmd.cn.gov.cn.qkkmd.cn http://www.morning.mkbc.cn.gov.cn.mkbc.cn http://www.morning.qfwzm.cn.gov.cn.qfwzm.cn http://www.morning.bydpr.cn.gov.cn.bydpr.cn http://www.morning.dyrzm.cn.gov.cn.dyrzm.cn http://www.morning.bswnf.cn.gov.cn.bswnf.cn http://www.morning.trhlb.cn.gov.cn.trhlb.cn http://www.morning.tqygx.cn.gov.cn.tqygx.cn http://www.morning.qgcfb.cn.gov.cn.qgcfb.cn http://www.morning.tyklz.cn.gov.cn.tyklz.cn http://www.morning.hwprz.cn.gov.cn.hwprz.cn http://www.morning.ntqlz.cn.gov.cn.ntqlz.cn http://www.morning.cbqqz.cn.gov.cn.cbqqz.cn http://www.morning.ydflc.cn.gov.cn.ydflc.cn http://www.morning.zstry.cn.gov.cn.zstry.cn http://www.morning.zlgbx.cn.gov.cn.zlgbx.cn http://www.morning.fmqw.cn.gov.cn.fmqw.cn http://www.morning.kqfdrqb.cn.gov.cn.kqfdrqb.cn