<pre id="x1lxd"><del id="x1lxd"></del></pre>
    <track id="x1lxd"></track>
    <output id="x1lxd"></output>

      
      

          <video id="x1lxd"></video>
            <strike id="x1lxd"><ol id="x1lxd"><ins id="x1lxd"></ins></ol></strike>

            上海政均電子科技有限公司主營:??低暠O控攝像機,??低曢T禁系統,??低\噲鱿到y,網絡攝像機等產品,歡迎咨詢!

            搜索
            您當前所在位置:網站首頁 > 新聞動態 > 行業新聞
            上海政均電子科技有限公司是一家專業從事數字化、網絡化、智能化產品經營的高科技安防公司。

            如何打造漂亮的監控系統

            發布時間:2020-03-23

            瀏覽次數:435


              監控系統在一家公司是尤為重要的,它能幫你在7x24小時的實時的關注線上服務器的運行情況,當有問題的時候第一時間通知給相應的人員今天說下我們的主角就是我們prometheus+grafana+node_exporter


            如何打造漂亮的監控系統

              Prometheus介紹

              Prometheus 是一套開源的系統監控報警框架。它啟發于 Google 的 borgmon 監控系統,由工作在 SoundCloud 的 google 前員工在 2012 年創建,作為社區開源項目進行開發,并于 2015 年正式發布。2016 年,Prometheus 正式加入 Cloud Native Computing Foundation,成為受歡迎度僅次于 Kubernetes 的項目。

              Prometheus作為TSDB具有以下特點:

              具有由指標名稱和鍵/值對標識的時間序列數據的多維度數據模型。PromQL靈活的查詢語言。不依賴分布式存儲,單個服務器節點是自主的。通過基于HTTP的pull方式采集時序數據??梢酝ㄟ^中間網關(Pushgateway)進行時序列數據推送。通過服務發現或者靜態配置來發現目標服務對象。支持多種多樣的圖表和界面展示,比如Grafana等。

              Prometheus的安裝

              下載二進制安裝包

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

              解壓prometheus壓縮包

              $ tar zxvf prometheus-2.16.0.linux-amd64.tar.gz -C /usr/local/prometheus

              添加prometheus 用戶

              $ groupadd prometheus$ useradd -g prometheus -s /sbin/nologin prometheus

              創建prometheus 啟動文件

              cat > /usr/lib/systemd/system/prometheus.service << EOF[Unit]Description=PrometheusDocumentation=https://prometheus.io/After=network.target[Service]Type=simpleUser=prometheusExecStart=/usr/local/prometheus/prometheus --config.file=/usr/local/prometheus/prometheus.yml --storage.tsdb.path=/var/lib/prometheusRestart=on-failure[Install]WantedBy=multi-user.targetEOF

              啟動服務并設為開機啟動

              $ systemctl start prometheus$ systemctl enable prometheus

              以下為一個簡單的prometheus.yml示例:

              # Prometheus全局配置項global: scrape_interval: 15s # 設定抓取數據的周期,默認為1min evaluation_interval: 15s # 設定更新rules文件的周期,默認為1min scrape_timeout: 15s # 設定抓取數據的超時時間,默認為10s external_labels: # 額外的屬性,會添加到拉取得數據并存到數據庫中 monitor: 'codelab_monitor'# Alertmanager配置alerting: alertmanagers: - static_configs: - targets: ["localhost:9093"] # 設定alertmanager和prometheus交互的接口,即alertmanager監聽的ip地址和端口# rule配置,首次讀取默認加載,之后根據evaluation_interval設定的周期加載rule_files: - "alertmanager_rules.yml" - "prometheus_rules.yml"# scrape配置scrape_configs:- job_name: 'prometheus' # job_name默認寫入timeseries的labels中,可以用于查詢使用 scrape_interval: 15s # 抓取周期,默認采用global配置 static_configs: # 靜態配置 - targets: ['localhost:9090'] # prometheus所要抓取數據的地址,即instance實例項 - job_name: 'node_exporter' # job_name默認寫入timeseries的labels中,可以用于查詢使用 scrape_interval: 15s # 抓取周期,默認采用global配置 static_configs: # 靜態配置 - targets: ['localhost:9100'] # prometheus所要抓取數據的地址,即instance實例項

              安裝 node_exporter

              RHEL/CentOS

              $ curl -Lo /etc/yum.repos.d/_copr_ibotty-prometheus-exporters.repo https://copr.fedorainfracloud.org/coprs/ibotty/prometheus-exporters/repo/epel-7/ibotty-prometheus-exporters-epel-7.repo$ yum install node_exporter$ systemctl start node_exporter

              配置grafana

              1.添加 prometheus 數據源


            如何打造漂亮的監控系統

              ?

              導入node_exporter 模板 ?


            如何打造漂亮的監控系統

              接下來就能看到實際的效果了,今天只給大家簡單的介紹一下,接下來會為大家詳細的介紹,prometheus 的語法 自動發現 告警 以及怎么實現數據的長時間存儲。

            我是分類列表
              新聞動態
              相關新聞

                 以上是【上海政均電子科技有限公司】為大家分享的相關新聞。我司是一家專業從事數字化、網絡化、智能化產品經營的高科技安防公司。業務核心為:閉路數字監控、公共廣播、防盜報警、門禁系統、小區智能化改造、企業一卡通管理系統等產品銷售、安裝和售后服務。為用戶提供各種性能可靠、技術先進的產品和解決方案始終是我們的業務重點?!?a href="http://www.swty891.com" target="_blank">http://www.swty891.com】歡迎大家進入官網點擊查看!

              久久综合久久鬼色_中文精品无码中文字幕无码专区_国产91色综合久久免费分享_国产污污污在线精品观看
                <pre id="x1lxd"><del id="x1lxd"></del></pre>
                <track id="x1lxd"></track>
                <output id="x1lxd"></output>

                  
                  

                      <video id="x1lxd"></video>
                        <strike id="x1lxd"><ol id="x1lxd"><ins id="x1lxd"></ins></ol></strike>