国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

關(guān)于k8s中的node_exporter異常write: broken pipe問題排查

這篇具有很好參考價值的文章主要介紹了關(guān)于k8s中的node_exporter異常write: broken pipe問題排查。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

公司網(wǎng)絡(luò)更改重啟服務(wù)器后,發(fā)現(xiàn)Prometheus監(jiān)控中node節(jié)點三個掛掉了,實際上節(jié)點服務(wù)器是正常的,但是監(jiān)控的node_exporter請求http://IP:9100/metrics超過10秒沒有獲取返回數(shù)據(jù)則認(rèn)為服務(wù)掛掉。

關(guān)于k8s中的node_exporter異常write: broken pipe問題排查

到各個節(jié)點服務(wù)器用curl命令檢測多久返回數(shù)據(jù)

curl -o /dev/null -s -w '%{time_connect}:%{time_starttransfer}:%{time_total}\n' 'http://NodeIP:9100/metrics'
time_connect :連接時間,從開始到TCP三次握手完成時間,這里面包括DNS解析的時候,如果想求連接時間,需要減去上面的解析時間;
time_starttransfer :開始傳輸時間,從發(fā)起請求開始,到服務(wù)器返回第一個字段的時間;
time_total :總時間;
關(guān)于k8s中的node_exporter異常write: broken pipe問題排查
可以看到time_connect時間是很快的,排除網(wǎng)絡(luò)問題。除了167返回時間正常其他幾個節(jié)點都是有問題的。

查看pod日志

關(guān)于k8s中的node_exporter異常write: broken pipe問題排查
ts=2023-01-11T06:11:08.189Z caller=stdlib.go:105 level=error caller="error encoding and sending metric family: write tcp 163:9100" msg="-> 167:40743: write: broken pipe"
ts=2023-01-11T06:11:08.189Z caller=stdlib.go:105 level=error caller="error encoding and sending metric family: write tcp 163:9100" msg="->.167:40743: write: broken pipe"

可以看到有大量的這種日志

參考資料: https://asktug.com/t/topic/153284/36 和 https://blog.csdn.net/lyf0327/article/details/99971590

有些說可以調(diào)大scrape_timeout這個時間,但是這個不是解決問題的根本

關(guān)于k8s中的node_exporter異常write: broken pipe問題排查

也有說調(diào)大node_exporter的yaml中的limit內(nèi)存和CPU,但是我這邊的node_exporter是沒有配置request和limit資源的,也不是這個問題,最后參考別人的配置文件

apiVersion: apps/v1
kind: DaemonSet
metadata:
  annotations:
    deprecated.daemonset.template.generation: "5"
    prometheus.io/scrape: "true"
  generation: 5
  labels:
    app: node-exporter
  name: node-exporter
  namespace: monitoring
spec:
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app: node-exporter
  template:
    metadata:
      creationTimestamp: null
      labels:
        app: node-exporter
      name: node-exporter
    spec:
      containers:
      - args:
        - --web.listen-address=$(HOSTIP):9100
        - --path.procfs=/host/proc
        - --path.sysfs=/host/sys
        - --path.rootfs=/host   # 修改了這個原來是/host/root
        - --collector.filesystem.ignored-mount-points=^/(dev|proc|sys|var/lib/docker/.+)($|/)
        - --collector.filesystem.ignored-fs-types=^(autofs|binfmt_misc|cgroup|configfs|debugfs|devpts|devtmpfs|fusectl|hugetlbfs|mqueue|overlay|proc|procfs|pstore|rpc_pipefs|securityfs|sysfs|tracefs)$
        - --log.level=debug
        env:
        - name: HOSTIP
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: status.hostIP
        image: prom/node-exporter:latest
        imagePullPolicy: IfNotPresent
        name: node-exporter
        ports:
        - containerPort: 9100
          hostPort: 9100
          protocol: TCP
        resources: {}
        securityContext:
          privileged: true
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        volumeMounts:
        - mountPath: /host/proc
          name: proc
        - mountPath: /host/sys
          name: sys
        - mountPath: /host     # 修改了這個原來是/rootfs
          name: rootfs
      dnsPolicy: ClusterFirst
      hostIPC: true
      hostNetwork: true
      hostPID: true
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      terminationGracePeriodSeconds: 30
      tolerations:
      - effect: NoSchedule
        key: node-role.kubernetes.io/master
        operator: Exists
      volumes:
      - hostPath:
          path: /proc
        name: proc
      - hostPath:
          path: /sys
        name: sys
      - hostPath:
          path: /    
        name: rootfs
  updateStrategy:
    rollingUpdate:
      maxSurge: 0
      maxUnavailable: 1
    type: RollingUpdate

觀察了一天

根據(jù)上述修改后仍有問題,其中一個報權(quán)限不足

apiVersion: apps/v1
kind: DaemonSet
metadata:
  annotations:
    deprecated.daemonset.template.generation: "5"
    prometheus.io/scrape: "true"
  generation: 5
  labels:
    app: node-exporter
  name: node-exporter
  namespace: monitoring
spec:
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app: node-exporter
  template:
    metadata:
      creationTimestamp: null
      labels:
        app: node-exporter
      name: node-exporter
    spec:
      containers:
      - args:
        - --web.listen-address=$(HOSTIP):9100
        - --path.procfs=/host/proc
        - --path.sysfs=/host/sys
        - --path.rootfs=/host
        - --collector.filesystem.ignored-mount-points=^/(dev|proc|sys|var/lib/docker/.+)($|/)
        - --collector.filesystem.ignored-fs-types=^(autofs|binfmt_misc|cgroup|configfs|debugfs|devpts|devtmpfs|fusectl|hugetlbfs|mqueue|overlay|proc|procfs|pstore|rpc_pipefs|securityfs|sysfs|tracefs)$
        - --log.level=debug
        env:
        - name: HOSTIP
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: status.hostIP
        image: prom/node-exporter:latest
        imagePullPolicy: IfNotPresent
        name: node-exporter
        ports:
        - containerPort: 9100
          hostPort: 9100
          protocol: TCP
        resources: {}
        securityContext:
          privileged: true
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        volumeMounts:
        - mountPath: /host/proc
          name: proc
        - mountPath: /host/sys
          name: sys
        - mountPath: /host
          name: rootfs
      dnsPolicy: ClusterFirst
      hostIPC: true
      hostNetwork: true
      hostPID: true
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: 
        runAsUser: 0   # 添加該選項 默認(rèn)是nobody用戶 65534的uid
      terminationGracePeriodSeconds: 30
      tolerations:
      - effect: NoSchedule
        key: node-role.kubernetes.io/master
        operator: Exists
      volumes:
      - hostPath:
          path: /proc
        name: proc
      - hostPath:
          path: /sys
        name: sys
      - hostPath:
          path: /
        name: rootfs
  updateStrategy:
    rollingUpdate:
      maxSurge: 0
      maxUnavailable: 1
    type: RollingUpdate

再觀察一天最新的問題有重新出現(xiàn)

關(guān)于k8s中的node_exporter異常write: broken pipe問題排查
報大量的error encoding and sending metric family: write tcp 10.37.0.163:9100" msg="->10.37.0.167:50266: write: broken pip

查了很多資料最后一個資料比較有用

地址:https://github.com/prometheus/node_exporter/issues/2500文章來源地址http://www.zghlxwxcb.cn/news/detail-498567.html

關(guān)于k8s中的node_exporter異常write: broken pipe問題排查
我這邊的節(jié)點3個內(nèi)核是5.4.0-132,三個都是有問題的,而更高版本的內(nèi)核5.15.0是沒問題的
最終結(jié)論是內(nèi)核版本問題;
臨時解決方案是在node_exporter中添加環(huán)境變量GOMAXPROCS=1
永久解決是升級內(nèi)核

到了這里,關(guān)于關(guān)于k8s中的node_exporter異常write: broken pipe問題排查的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實不符,請點擊違法舉報進(jìn)行投訴反饋,一經(jīng)查實,立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費用

相關(guān)文章

  • Kibana+Prometheus+node_exporter 監(jiān)控告警部署

    Kibana+Prometheus+node_exporter 監(jiān)控告警部署

    下載好三個軟件包 一、prometheus安裝部署 1、解壓 ?2、修改配置文件的IP地址 3、運行Prometheus 4、打開瀏覽器根據(jù)配置文件的地址和端口訪問,如果狀態(tài)欄看到的跟下圖不一樣,記得在標(biāo)簽欄中的Status狀態(tài)選擇Targets ?二、node_exporter 安裝部署 1、解壓,運行 ?2、打開瀏覽器輸入

    2024年02月15日
    瀏覽(20)
  • 【大數(shù)據(jù)監(jiān)控】Prometheus、Node_exporter、Graphite_exporter安裝部署詳細(xì)文檔

    【大數(shù)據(jù)監(jiān)控】Prometheus、Node_exporter、Graphite_exporter安裝部署詳細(xì)文檔

    Prometheus是一個開源的系統(tǒng)監(jiān)控和報警系統(tǒng),現(xiàn)在已經(jīng)加入到CNCF基金會,成為繼k8s之后第二個在CNCF托管的項目,在kubernetes容器管理系統(tǒng)中,通常會搭配prometheus進(jìn)行監(jiān)控,同時也支持多種exporter采集數(shù)據(jù),還支持pushgateway進(jìn)行數(shù)據(jù)上報,Prometheus性能足夠支撐上萬臺規(guī)模的集群。

    2023年04月08日
    瀏覽(74)
  • 關(guān)于java k8s容器環(huán)境中的jvm配置與優(yōu)化

    關(guān)于java k8s容器環(huán)境中的jvm配置與優(yōu)化

    環(huán)境 版本 備注 k8s v1.22+ 配置cpu/mem limit、健康/就緒檢查 openjdk 8 openjdk version \\\"1.8.0_342\\\" k8s容器化(docker)環(huán)境更好的解決了 java app 運行環(huán)境的封裝問題。但存在著一些限制,比如 Java 并不能發(fā)現(xiàn) pod 設(shè)置的內(nèi)存限制(mem limit,java 默認(rèn)以宿主機的內(nèi)存為基準(zhǔn)),當(dāng) java 內(nèi)存占用

    2024年02月16日
    瀏覽(23)
  • (mac)Prometheus監(jiān)控之Node_exporter(CPU、內(nèi)存、磁盤、網(wǎng)絡(luò)等)

    (mac)Prometheus監(jiān)控之Node_exporter(CPU、內(nèi)存、磁盤、網(wǎng)絡(luò)等)

    1.啟動 Prometheus 普羅米修斯? 瀏覽器訪問? http://localhost:9090/targets ?2.啟動Node_exporter? 訪問: http://localhost:9100 ?? 3.啟動grafana 訪問 http://localhost: 3000? 4.添加數(shù)據(jù)源 5.查看Dashboard? ?普羅米修斯是后端數(shù)據(jù)監(jiān)控平臺,通過Node_exporter收集數(shù)據(jù),Grafana將數(shù)據(jù)用圖形的方式展示出來

    2024年04月26日
    瀏覽(30)
  • 運維學(xué)習(xí)之采集器 node_exporter 1.3.1安裝并使用

    運維學(xué)習(xí)之采集器 node_exporter 1.3.1安裝并使用

    參考《監(jiān)控系統(tǒng)部署prometheus基本功能》先完成prometheus部署。 wget https://github.com/prometheus/node_exporter/releases/download/v1.3.1/node_exporter-1.3.1.linux-amd64.tar.gz 下載壓縮包。 tar -zxf node_exporter-1.3.1.linux-amd64.tar.gz 進(jìn)行解壓。 cp node_exporter-1.3.1.linux-amd64/* /opt/prometheus/ 進(jìn)行復(fù)制。 nohup /opt/pr

    2024年02月09日
    瀏覽(21)
  • 免費開源服務(wù)器資源監(jiān)控系統(tǒng)grafana+prometheus+node_exporter

    免費開源服務(wù)器資源監(jiān)控系統(tǒng)grafana+prometheus+node_exporter

    有項目做測試的時候需要查詢服務(wù)器資源利用情況,自己又沒寫相應(yīng)的模塊,此時就需要一套好用的資源監(jiān)控系統(tǒng),,咨詢了運維人員給推薦了一套,裝完后真的很好用。 就是grafana+prometheus+ node_exporter(linux)或者windows_exporter(wins) 具體介紹不多說: 1、grafana是對數(shù)據(jù)做展

    2024年02月12日
    瀏覽(21)
  • Linux部署docker以及prometheus+node_exporter+mysqld-exporter+grafana+cadvisor+Alertmanager(告警)

    Linux部署docker以及prometheus+node_exporter+mysqld-exporter+grafana+cadvisor+Alertmanager(告警)

    Linux安裝docker以及部署prometheus+node_exporter+mysqld-exporter+grafana+cadvisor+Alertmanager(告警) 1、官方安裝腳本自動安裝docker curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun 2、啟動docker systemctl start docker 3、搜索鏡像-例如搜索prometheus docker search prom/prometheus 4、拉取鏡像--這里僅列出我

    2024年03月15日
    瀏覽(28)
  • prometheus使用node_exporter監(jiān)控Linux主機CPU、內(nèi)存、磁盤、服務(wù)運行狀況

    prometheus使用node_exporter監(jiān)控Linux主機CPU、內(nèi)存、磁盤、服務(wù)運行狀況

    目錄 1.node_exporter簡介 2.部署node_exporter 2.1.安裝node_exporter 2.2.編寫system啟動腳本 3.prometheus監(jiān)控Linux主機 3.1.修改配置文件增加主機節(jié)點 3.2.主機添加成功 4.監(jiān)控Linux主機CPU、內(nèi)存、磁盤使用率 4.1.監(jiān)控CPU使用率 4.1.1.獲取空閑CPU監(jiān)控數(shù)據(jù) 4.1.2.獲取5分鐘內(nèi)的監(jiān)控數(shù)據(jù) 4.1.3.獲取5分鐘

    2024年04月16日
    瀏覽(52)
  • K8s: 關(guān)于Kubernetes中的Pod的生命周期(狀態(tài))以及生命周期的鉤子函數(shù)處理

    pod 的生命周期 1 ) pod 幾種常用狀態(tài) 1.1 )Pending(掛起) Pod 已被 Kubernetes 系統(tǒng)接受,但有一個或者多個容器尚未創(chuàng)建亦未運行 此階段包括等待 Pod 被調(diào)度的時間和通過網(wǎng)絡(luò)下載鏡像的時間。 1.2 )Running(運行中) Pod 已經(jīng)綁定到了某個節(jié)點,Pod 中所有的容器都已被創(chuàng)建 至少有

    2024年04月22日
    瀏覽(42)
  • 助力工業(yè)物聯(lián)網(wǎng),工業(yè)大數(shù)據(jù)之服務(wù)域:node_exporter插件【三十七】_node_expoter 電源(1)

    助力工業(yè)物聯(lián)網(wǎng),工業(yè)大數(shù)據(jù)之服務(wù)域:node_exporter插件【三十七】_node_expoter 電源(1)

    小結(jié) 實現(xiàn)node_exporter插件的安裝監(jiān)控Linux指標(biāo) 07:mysqld_exportor插件 目標(biāo) : 實現(xiàn)mysqld_exportor插件的安裝監(jiān)控MySQL指標(biāo) 實施 上傳安裝 配置MySQL用戶授權(quán) 注冊服務(wù) 啟動服務(wù) 配置Prometheus 自我介紹一下,小編13年上海交大畢業(yè),曾經(jīng)在小公司待過,也去過華為、OPPO等大廠,18年進(jìn)入

    2024年04月15日
    瀏覽(25)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包