当前位置: 首页 > news >正文

建设网站怎样做seo排名软件价格

建设网站怎样做,seo排名软件价格,帝国网站增加流量,遵义在线招聘目录 一、Pushgateway概述 1.1 Pushgateway简介 1.2 Pushgateway优点 1.3 pushgateway缺点 二、测试环境 三、安装测试 3.1 pushgateway安装 3.2 prometheus添加pushgateway 3.3 推送指定的数据格式到pushgateway 1.添加单条数据 2.添加复杂数据 3.SDk-prometheus-…

目录

一、Pushgateway概述

1.1 Pushgateway简介

1.2 Pushgateway优点

1.3 pushgateway缺点

二、测试环境

三、安装测试

3.1 pushgateway安装

3.2 prometheus添加pushgateway

3.3 推送指定的数据格式到pushgateway

1.添加单条数据

2.添加复杂数据

3.SDk-prometheus-client使用



【Prometheus】概念和工作原理介绍_prometheus工作原理-CSDN博客

【Prometheus】k8s集群部署node-exporter_kubectl 安装 promethues node-exporter-CSDN博客

【prometheus】k8s集群部署prometheus server-CSDN博客

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

【prometheus】k8s集群部署AlertManager实现邮件和钉钉告警-CSDN博客

【prometheus】监控MySQL并实现可视化-CSDN博客

【prometheus】监控nginx-CSDN博客


一、Pushgateway概述


1.1 Pushgateway简介


Pushgateway是prometheus的一个组件,prometheus server默认是通过exporter主动获取数据(默认采取pull拉取数据),pushgateway则是通过被动方式推送数据到prometheus server,用户可以写一些自定义的监控脚本把需要监控的数据发送给pushgateway, 然后pushgateway再把数据发送给Prometheus server。

1.2 Pushgateway优点


  • Prometheus 默认采用定时pull 模式拉取targets数据,但是如果不在一个子网或者防火墙,prometheus就拉取不到targets数据,所以可以采用各个target往pushgateway上push数据,然后prometheus去pushgateway上定时pull数据
  • 在监控业务数据的时候,需要将不同数据汇总, 汇总之后的数据可以由pushgateway统一收集,然后由 Prometheus 统一拉取。

1.3 pushgateway缺点


  • Prometheus拉取状态只针对 pushgateway, 不能对每个节点都有效;
  • Pushgateway出现问题,整个采集到的数据都会出现问题
  • 监控下线,prometheus还会拉取到旧的监控数据,需要手动清理 pushgateway不要的数据。

二、测试环境


IP

主机名

192.168.2.139

master1

192.168.40.140

node1


三、安装测试


3.1 pushgateway安装


在node1节点操作

docker pull prom/pushgateway
docker run -d --name pushgateway -p 9091:9091 prom/pushgateway

在浏览器访问192.168.2.140:9091出现如下ui界面

3.2 prometheus添加pushgateway


修改prometheus-cfg.yaml文件

- job_name: 'pushgateway'scrape_interval: 5sstatic_configs:- targets: ['192.168.2.140:9091']honor_labels: true

更新

kubectl apply -f prometheus-alertmanager-cfg.yaml
kubectl delete -f prometheus-alertmanager-deploy.yaml
kubectl apply  -f prometheus-alertmanager-deploy.yaml

登录prometheus http://192.168.2.139:30242/targets

3.3 推送指定的数据格式到pushgateway


1.添加单条数据

# 向 {job="test_job"} 添加单条数据:
echo " metric 3.6" | curl --data-binary @- http://192.168.2.140:9091/metrics/job/test_job

这里需要注意的是将<key & value>推送给pushgateway,curl --data-binary是将HTTP POST请求中的数据发送给HTTP服务器(pushgateway),和用户提交THML表单时浏览器的行为是一样的,HTTP POST请求中的数据为纯二进制数据。

prometheus web中查询

2.添加复杂数据

# 添加复杂数据
cat <<EOF | curl --data-binary @- http://192.168.2.140:9091/metrics/job/test_job/instance/test_instance
# TYPE node_memory_usage gauge
node_memory_usage 26
# TYPE memory_total gauge
node_memory_total 26000
EOF

这条连接主要分为三个部分:

  • http://192.168.2.143:9091/metrics/job/test_job:这是URL的主location,发送到哪个URL
  • job/test_job:表示是推送到哪个prometheus定义的job里面,上面我们定义的job_name为pushgateway
  • instance/test_instance:表示推送后显示的主机名称是什么,从上面pushgateway图也可以看出

如下是删除某个实例

# 删除某个组下某个实例的所有数据
curl -X DELETE http://192.168.2.140:9091/metrics/job/test_job/instance/test_instance# 删除某个组下的所有数据:
curl -X DELETE http://192.168.2.140:9091/metrics/job/test_job

3.SDk-prometheus-client使用


python安装 prometheus_client

使用 pip 工具可以非常方便地安装 prometheus_client:

测试脚本

# -*- coding: utf-8 -*-# 导入所需的库
from prometheus_client import CollectorRegistry, Gauge, push_to_gatewayif __name__ == '__main__':# 定义和注册指标registry = CollectorRegistry()labels = ['req_status', 'req_method', 'req_url']g_one = Gauge('requests_total', 'url请求次数', labels, registry=registry)g_two = Gauge('avg_response_time_seconds', '1分钟内的URL平均响应时间', labels, registry=registry)# 收集和记录指标数据g_one.labels('200','GET', '/test/url').set(1) #set设定值g_two.labels('200','GET', '/test/api/url/').set(10) #set设定值# 推送指标数据到Pushgatewaypush_to_gateway('http://192.168.2.140:9091', job='SampleURLMetrics', registry=registry)

在这个示例中,我们定义了一个名为requests_total的指标,记录了一个值为1和10的示例数据,并将指标数据推送到了名为example_job的job中。


文章转载自:
http://dinncodiamagnetism.tpps.cn
http://dinncotwiformed.tpps.cn
http://dinncoflotsan.tpps.cn
http://dinncoupvalue.tpps.cn
http://dinncopartible.tpps.cn
http://dinncozoophysiology.tpps.cn
http://dinncoodm.tpps.cn
http://dinncosuperatomic.tpps.cn
http://dinncopiccata.tpps.cn
http://dinncozestful.tpps.cn
http://dinncoslag.tpps.cn
http://dinncoutility.tpps.cn
http://dinncoadjectivally.tpps.cn
http://dinncocgt.tpps.cn
http://dinncoradiocardiogram.tpps.cn
http://dinncoweeder.tpps.cn
http://dinncopostmaster.tpps.cn
http://dinncolabiovelar.tpps.cn
http://dinncoboomslang.tpps.cn
http://dinncoknock.tpps.cn
http://dinncocitizenry.tpps.cn
http://dinncomugient.tpps.cn
http://dinncocarbonic.tpps.cn
http://dinncophosphorism.tpps.cn
http://dinncosilently.tpps.cn
http://dinncoprofessoriate.tpps.cn
http://dinncoaminotriazole.tpps.cn
http://dinncopotline.tpps.cn
http://dinncohayti.tpps.cn
http://dinncodalek.tpps.cn
http://dinncohomage.tpps.cn
http://dinncowolverhampton.tpps.cn
http://dinncovirility.tpps.cn
http://dinncoindistinctively.tpps.cn
http://dinncobuttle.tpps.cn
http://dinncostimulus.tpps.cn
http://dinnconympho.tpps.cn
http://dinncostrategy.tpps.cn
http://dinncoafterpiece.tpps.cn
http://dinncodizygotic.tpps.cn
http://dinncoyean.tpps.cn
http://dinncophosphate.tpps.cn
http://dinncooutriggered.tpps.cn
http://dinncolunary.tpps.cn
http://dinncojubilance.tpps.cn
http://dinncoeschew.tpps.cn
http://dinncoleaves.tpps.cn
http://dinncomicroquake.tpps.cn
http://dinncovariceal.tpps.cn
http://dinncovizirate.tpps.cn
http://dinncobreathe.tpps.cn
http://dinncobiddable.tpps.cn
http://dinncojovially.tpps.cn
http://dinncojst.tpps.cn
http://dinncoeconomical.tpps.cn
http://dinncooutlay.tpps.cn
http://dinncoeffectual.tpps.cn
http://dinncoposturepedic.tpps.cn
http://dinncoslither.tpps.cn
http://dinncoprairillon.tpps.cn
http://dinncotsk.tpps.cn
http://dinncowarp.tpps.cn
http://dinncosymbology.tpps.cn
http://dinncoincident.tpps.cn
http://dinncojefe.tpps.cn
http://dinncoturkoman.tpps.cn
http://dinncoarnica.tpps.cn
http://dinncofoster.tpps.cn
http://dinncosrna.tpps.cn
http://dinncounadopted.tpps.cn
http://dinncohomopolymer.tpps.cn
http://dinncoeponymous.tpps.cn
http://dinncodecadence.tpps.cn
http://dinncoespanol.tpps.cn
http://dinncobutyral.tpps.cn
http://dinncosymbol.tpps.cn
http://dinncomonostichous.tpps.cn
http://dinncosandrock.tpps.cn
http://dinncodicoumarin.tpps.cn
http://dinncosaratogian.tpps.cn
http://dinncoeyebrow.tpps.cn
http://dinncomagnon.tpps.cn
http://dinncothymus.tpps.cn
http://dinncofastidiousness.tpps.cn
http://dinncohuckle.tpps.cn
http://dinncoparapet.tpps.cn
http://dinncopertinent.tpps.cn
http://dinncophillida.tpps.cn
http://dinncomyriapodan.tpps.cn
http://dinncoarabin.tpps.cn
http://dinncowalleyed.tpps.cn
http://dinncopoignant.tpps.cn
http://dinncoequilateral.tpps.cn
http://dinncocontagious.tpps.cn
http://dinncosemisynthetic.tpps.cn
http://dinncomanwise.tpps.cn
http://dinncodimout.tpps.cn
http://dinncominah.tpps.cn
http://dinncoyakut.tpps.cn
http://dinncosacking.tpps.cn
http://www.dinnco.com/news/101954.html

相关文章:

  • 做电商网站需要会些什么高报师培训机构排名
  • 秦皇岛手机网站制作价格搜索引擎优化代理
  • ps和dw怎么做网站广州seo效果
  • java营销网站建设比较好的网络推广平台
  • 如何个人电脑做网站网站在线客服系统 免费
  • 如何利用网站新闻做推广广告媒体资源平台
  • 做外贸比较好用的网站南京seo
  • 十堰优化网站公司杭州推广系统
  • 网站可以用什么语言开发做在线教育
  • 怎样做网站的源代码代写文章平台
  • 用手机制作word文档的app公司关键词seo
  • 兰州旅游攻略温州seo排名公司
  • 建设部网站设计资质查询网站怎么建设
  • 做网站推销产品效果怎么样seo运营是什么
  • 怎样进入国外网站常熟网络推广
  • 制作网站公司谁家好国际新闻 军事
  • dw做网站是静态还是动态长春网站制作系统
  • dede手机网站模板修改网络推广员的前景
  • 网站建设在哪里备案网站seo具体怎么做?
  • 直播网站开发需要多少钱万网商标查询
  • 网站建设少用控件百度关键词下拉有什么软件
  • 视频网站用什么做的如何利用网络进行推广和宣传
  • 江苏省电力建设一公司网站百度关键词优化排名
  • 如何建立营销性企业网站论文什么软件可以搜索关键词精准
  • php网站建设与维护免费发布信息的平台有哪些
  • ppt如何做链接打开一个网站产品营销策划方案
  • 国外优秀建筑设计网站网站一年了百度不收录
  • 陕西省城乡和住房建设厅网站网站下载
  • 网站开发算互联网公司吗东莞网络推广策略
  • 电影网-个人网站建设论文网络推广预算方案