一区二区三区在线-一区二区三区亚洲视频-一区二区三区亚洲-一区二区三区午夜-一区二区三区四区在线视频-一区二区三区四区在线免费观看

服務器之家:專注于服務器技術及軟件下載分享
分類導航

云服務器|WEB服務器|FTP服務器|郵件服務器|虛擬主機|服務器安全|DNS服務器|服務器知識|Nginx|IIS|Tomcat|

服務器之家 - 服務器技術 - Nginx - Prometheus監控實戰篇Nginx、Hbase操作詳解

Prometheus監控實戰篇Nginx、Hbase操作詳解

2022-02-28 23:27袁勝的博客 Nginx

這篇文章主要介紹了Prometheus監控實戰篇Nginx、Hbase,本文通過圖文并茂的形式給大家介紹的非常詳細,對大家的學習或工作具有一定的參考借鑒價值,需要的朋友可以參考下

 

一、Prometheus監控Nginx

 

1、監控Nginx相關插件下載地址

nginx_exporter下載地址
Nginx_module-vts下載地址
nginx-release下載地址

Prometheus(8.3.3)和grafana(2.32.1)我使用的是官網最新版

 

2、編譯Nginx

注意:我這邊是使用rpm安裝的Nginx。所以要進行編譯一下,可以根據自己的實際情況進行操作

 

2.1 下載 nginx-release 并解壓

如果有這兩個目錄將其刪除掉

rm -rf Makefile objs

Prometheus監控實戰篇Nginx、Hbase操作詳解

 

2.2 解壓 Nginx-module-vts,到/opt/nginx/

Prometheus監控實戰篇Nginx、Hbase操作詳解

 

2.3 執行以下命令,進行編譯Nginx

./configure --prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/tmp/client_body --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi --http-scgi-temp-path=/var/lib/nginx/tmp/scgi --pid-path=/run/nginx.pid --lock-path=/run/lock/subsys/nginx --user=nginx --group=nginx --with-compat --with-debug --with-file-aio --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_degradation_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_image_filter_module=dynamic --with-http_mp4_module --with-http_perl_module=dynamic --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-http_xslt_module=dynamic --with-mail=dynamic --with-mail_ssl_module --with-pcre --with-pcre-jit --with-stream=dynamic --with-stream_ssl_module --with-stream_ssl_preread_module --with-threads --with-cc-opt="-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic" --with-ld-opt="-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,-E" --add-module=/opt/nginx/nginx-module-vts-0.1.18

 

2.4 再執行 make 命令

注意: 不要執行make install

make

2.5 將編譯后的二進制文件以及模塊放到對應的目錄下,并將原來的做備份

Prometheus監控實戰篇Nginx、Hbase操作詳解

Prometheus監控實戰篇Nginx、Hbase操作詳解

Prometheus監控實戰篇Nginx、Hbase操作詳解

 

2.6 在Nginx 添加以下內容到Nginx配置文件中

location /status {
    vhost_traffic_status_display;
    vhost_traffic_status_display_format html;
}

 

2.7 重新啟動Nginx,并檢查服務是否正常

http://127.0.0.1:80/status/

Prometheus監控實戰篇Nginx、Hbase操作詳解

 

2.8 解壓Nginx-vts-exporter,并啟動

Prometheus監控實戰篇Nginx、Hbase操作詳解

啟動nginx-vts-exporter(默認端口為9913)

nohup ./nginx-vts-exporter -nginx.scrape_uri=http://127.0.0.1:80/status/format/json &

 

2.9 在Prometheus中添加Nginx-vts-exporter,并重啟Prometheus

vim promethues.yml
  - job_name: "nginx_exporter"
    static_configs:
      - targets: ["localhost:9913"]

 

2.10 在grafana 中添加模塊 使用的模塊是2949,也可以自己定義

Prometheus監控實戰篇Nginx、Hbase操作詳解

Prometheus監控實戰篇Nginx、Hbase操作詳解

數據展示

Prometheus監控實戰篇Nginx、Hbase操作詳解

 

二、Prometheus監控hbase

 

1. 監控hbase插件下載地址

jmx_prometheus_javaagent
grafana模塊

 

2. 部署

 

2.1 將下載好的jmx_prometheus_javaagent 移動到hbase的lib下

Prometheus監控實戰篇Nginx、Hbase操作詳解

 

2.2 配置 hbase_jmx_config.yaml

vim /usr/hbase/conf/ hbase_jmx_config.yaml

---
lowercaseOutputName: true
lowercaseOutputLabelNames: true
rules:
- pattern: Hadoop<service=HBase, name=RegionServer, sub=Regions><>Namespace_([^W_]+)_table_([^W_]+)_region_([^W_]+)_metric_(w+)
  name: HBase_metric_$4
  labels:
    namespace: "$1"
    table: "$2"
    region: "$3"
- pattern: Hadoop<service=(w+), name=(w+), sub=(w+)><>([w._]+)
  name: hadoop_$1_$4
  labels:
    "name": "$2"
    "sub": "$3"
- pattern: .+

Prometheus監控實戰篇Nginx、Hbase操作詳解

 

2.3 在hbase-env.sh 中添加以下參數,并重啟hbase

注意:分別在master和regionserver 都要添加,但是要注意端口不可以相同。(每臺服務都做以上操作)

master

-javaagent:$HBASE_HOME/lib/jmx_prometheus_javaagent-0.16.1.jar=17000:$HBASE_HOME/conf/hbase_jmx_config.yaml

regionserver

-javaagent:$HBASE_HOME/lib/jmx_prometheus_javaagent-0.16.1.jar=18000:$HBASE_HOME/conf/hbase_jmx_config.yaml

Prometheus監控實戰篇Nginx、Hbase操作詳解

 

2.4 查看是否采集數據

http://127.0.0.1:17000/metrics

Prometheus監控實戰篇Nginx、Hbase操作詳解

 

2.5 配置Prometheus server,并重啟服務

IP地址根據實際情況改寫

vim prometheus.yml
  - job_name: "hbase_exporter"
    static_configs:
      - targets: ["127.0.0.1:17000"]
      - targets: ["127.0.0.1:18000"]
      - targets: ["127.0.0.1:18000"]
      - targets: ["127.0.0.1:18000"]
      - targets: ["127.0.0.1:18000"]

 

2.6 在granfan中添加模塊

grafana模塊

Prometheus監控實戰篇Nginx、Hbase操作詳解

Prometheus監控實戰篇Nginx、Hbase操作詳解

數據展示

Prometheus監控實戰篇Nginx、Hbase操作詳解

到此這篇關于Prometheus監控實戰篇Nginx、Hbase的文章就介紹到這了,更多相關Prometheus監控Nginx、Hbase內容請搜索服務器之家以前的文章或繼續瀏覽下面的相關文章希望大家以后多多支持服務器之家!

原文地址:https://blog.csdn.net/yuansheng730/article/details/123114061

延伸 · 閱讀

精彩推薦
主站蜘蛛池模板: 黄a一级 | 久久免费特黄毛片 | 娇小性色 | 国产亚洲玖玖玖在线观看 | 亚洲国产精品久久精品怡红院 | 精品无码久久久久久久久 | 先锋资源av | 婷婷久久精品 | 欧美精品一二三区 | 国产美女屁股直流白浆视频无遮挡 | 四虎在线最新地址公告 | 手机跑分排行最新排名 | 日韩 国产 欧美 | 亚洲精品第五页中文字幕 | 草嫩社区 | 骚虎最新网址 | 日韩欧一级毛片在线播无遮挡 | 日本不卡一区二区三区在线观看 | a男人天堂| 十六以下岁女子毛片免费 | 香蕉久久一区二区不卡无毒影院 | 男人猛戳女人下部30分钟 | 好大好湿好硬好爽好深免费视频 | 特黄特色大片免费高清视频 | 亚洲激情欧美 | 99热这里有免费国产精品 | 7个黑人玩北条麻妃 | 国产午夜精品久久久久小说 | 日本中文字幕永久在线 | 国产suv精品 | 国产日韩精品一区二区在线观看 | 国产午夜精品福利久久 | 男人与雌性宠物交啪啪小说 | 成人网视频免费播放 | 青青热久麻豆精品视频在线观看 | 日本一级不卡一二三区免费 | 男女xxoo做爰猛烈动态一 | 国产成人精品午夜免费 | 欧美bbxx| 亚洲AV国产精品无码精 | 亚洲欧美日韩综合在线 |