色偷偷91综合久久噜噜-色偷偷成人-色偷偷尼玛图亚洲综合-色偷偷人人澡久久天天-国内精品视频一区-国内精品视频一区二区三区

Hello! 歡迎來到小浪云!


使用 Redis Exporter 服務(wù)監(jiān)控 Redis Droplet


有效監(jiān)控 redis 數(shù)據(jù)庫對(duì)于保持最佳性能、識(shí)別潛在瓶頸和確保整體系統(tǒng)可靠性至關(guān)重要。 Redis Exporter Service 是一個(gè)強(qiáng)大的實(shí)用程序,旨在使用 Prometheus 監(jiān)控 Redis 數(shù)據(jù)庫。 本教程將指導(dǎo)您完成 Redis Exporter Service 的完整設(shè)置和配置,確保您無縫建立監(jiān)控解決方案。通過學(xué)習(xí)本教程,您將實(shí)現(xiàn)完全可操作的監(jiān)控設(shè)置

使用 Redis Exporter 服務(wù)監(jiān)控 Redis Droplet

方法一:手動(dòng)配置

我們繼續(xù)本節(jié)的手動(dòng)配置方法。

創(chuàng)建Prometheus系統(tǒng)用戶和組

創(chuàng)建一個(gè)名為的系統(tǒng)用戶和組“prometheus”來管理導(dǎo)出器

sudo groupadd --system prometheus
sudo useradd -s /sbin/nologin --system -g prometheus prometheus

下載并安裝 Redis Exporter

下載從 gitHub 提取最新版本的 Redis Exporter 下載的文件,并將二進(jìn)制文件移動(dòng)到 /usr/local/bin/ 目錄。

curl -s https://api.github.com/repos/oliver006/redis_exporter/releases/latest | grep browser_download_url | grep Linux-amd64 | cut -d '"' -f 4 | wget -qi -
tar xvf redis_exporter-*.linux-amd64.tar.gz
sudo mv redis_exporter-*.linux-amd64/redis_exporter /usr/local/bin/

驗(yàn)證 Redis 導(dǎo)出器安裝

redis_exporter --version

這是示例輸出:

使用 Redis Exporter 服務(wù)監(jiān)控 Redis Droplet

為 Redis Exporter 配置 systemd 服務(wù)

創(chuàng)建 systemd 服務(wù)單元文件來管理 Redis Exporter

sudo vim /etc/systemd/system/redis_exporter.service

將以下內(nèi)容添加到file:

redis_exporter.service
[Unit]Description=Prometheus Redis ExporterDocumentation=https://github.com/oliver006/redis_exporterWants=network-online.targetAfter=network-online.target[Service]Type=simpleUser=prometheusGroup=prometheusExecReload=/bin/kill -HUP $MaiNPIDExecStart=/usr/local/bin/redis_exporter    --log-format=txt    --namespace=redis    --web.listen-address=:9121    --web.telemetry-path=/metricssyslogIdentifier=redis_exporterRestart=always[Install]WantedBy=multi-user.target

重新加載 systemd 并啟動(dòng) Redis Exporter服務(wù)

sudo systemctl daemon-reload
sudo systemctl enable redis_exporter
sudo systemctl start redis_exporter

配置 Prometheus Droplet(手動(dòng)方法)

讓我們手動(dòng)配置 Prometheous Droplet。

備份 prometheus.yml 文件

cp /etc/prometheus/prometheus.yml /etc/prometheus/prometheus.yml-$(date  '%d%b%Y-%H:%M')

添加 Redis Exporter 端點(diǎn)scraped

登錄到您的 Prometheus 服務(wù)器并添加要抓取的 Redis Exporter 端點(diǎn)。

將 IP 地址和端口替換為您的 Redis Exporter 端點(diǎn)(9121 是 Redis Exporter 的默認(rèn)端口)服務(wù))。

vi /etc/prometheus/prometheus.yml
prometheus.yml
scrape_configs:   - job_name: server1_db     static_configs:       - targets: ['10.10.1.10:9121']         labels:           alias: db1    - job_name: server2_db     static_configs:       - targets: ['10.10.1.11:9121']         labels:

手動(dòng)配置到此結(jié)束。現(xiàn)在,讓我們繼續(xù)基于腳本的配置。

方法 2:使用腳本進(jìn)行配置

您還可以通過運(yùn)行兩個(gè)腳本來實(shí)現(xiàn)此目的 – 一個(gè)用于目標(biāo) Droplet,另一個(gè)用于 Prometheus Droplet。

讓我們從配置目標(biāo) Droplet 開始。

通過 ssh 連接到目標(biāo)Droplet。

使用以下命令下載目標(biāo)配置腳本:

wget https://solutions-files.ams3.digitaloceanspaces.com/Redis-Monitoring/DO_Redis_Target_Config.sh

下載腳本后,確保它具有可執(zhí)行權(quán)限運(yùn)行:

chmod  x DO_Redis_Target_Config.sh

通過運(yùn)行以下命令執(zhí)行腳本:

./DO_Redis_Target_Config.sh

配置

使用 Redis Exporter 服務(wù)監(jiān)控 Redis Droplet

注意:如果redis_exporter.service文件已經(jīng)存在,腳本將不會(huì)運(yùn)行。

使用 Redis Exporter 服務(wù)監(jiān)控 Redis Droplet

配置 Prometheus Droplet(腳本方法)

SSH 到 Prometheus Droplet 并使用以下命令下載腳本:

wget https://solutions-files.ams3.digitaloceanspaces.com/Redis-Monitoring/DO_Redis_Prometheus_Config.sh

下載腳本后,請(qǐng)確保它具有可執(zhí)行權(quán)限運(yùn)行:

chmod  x DO_Redis_Prometheus_Config.sh

執(zhí)行腳本running:

./DO_Redis_Prometheus_Config.sh

輸入要添加到監(jiān)控的 Droplet 數(shù)量。

輸入主機(jī)名和IP地址。

使用 Redis Exporter 服務(wù)監(jiān)控 Redis Droplet

配置完成。

添加后,通過訪問 URL prometheushostname:9090/targets 檢查目標(biāo)是否更新。

注意:如果您輸入的 IP 地址已添加到 監(jiān)控時(shí),您將被要求再次輸入詳細(xì)信息。另外,如果 您沒有更多服務(wù)器可以添加,可以輸入 0 退出 script

使用 Redis Exporter 服務(wù)監(jiān)控 Redis Droplet

配置 grafana

通過瀏覽器訪問 Grafana-IP:3000 登錄 Grafana 儀表板。

Go到配置 > 數(shù)據(jù)來源。

使用 Redis Exporter 服務(wù)監(jiān)控 Redis Droplet

單擊“添加數(shù)據(jù)源”。

使用 Redis Exporter 服務(wù)監(jiān)控 Redis Droplet

搜索并選擇 Prometheus。

使用 Redis Exporter 服務(wù)監(jiān)控 Redis Droplet

輸入名稱 Prometheus 和 URL (Prometheus主機(jī)名:9090)并單擊“保存并測(cè)試”。如果看到“數(shù)據(jù)源正在運(yùn)行”,則說明您已成功添加數(shù)據(jù)源。完成后,轉(zhuǎn)到創(chuàng)建 > 導(dǎo)入。

使用 Redis Exporter 服務(wù)監(jiān)控 Redis Droplet

您可以手動(dòng)配置儀表板或通過以下方式導(dǎo)入儀表板 上傳 JSON 文件。用于 Redis 監(jiān)控的 json 模板可以是 在以下鏈接中找到:

https://solutions-files.ams3.digitaloceanspaces.com/Redis-Monitoring/DO_Grafana-Redis_Monitoring.json

填寫字段并導(dǎo)入。

使用 Redis Exporter 服務(wù)監(jiān)控 Redis Droplet

Grafana 儀表板是 準(zhǔn)備好。選擇主機(jī)并檢查是否 指標(biāo)是可見的。請(qǐng)隨意修改和編輯儀表板 根據(jù)需要。

使用 Redis Exporter 服務(wù)監(jiān)控 Redis Droplet

相關(guān)閱讀

主站蜘蛛池模板: 日本xxxⅹ色视频在线观看网站 | 日产一区至六区免费看 | 日日干日日射 | 亚洲美女久久 | 亚洲丝袜中文字幕 | 欧美在线精品一区二区三区 | 色五婷婷 | 天天干天天曰 | 久久免费看片 | 日本操美女| 狠狠的干综合网 | 国内精品免费在线观看 | 国产图片一区 | 激情影院在线 | 亚洲欧美一区二区三区二厂 | 伊人情涩网 | 免费人成网 | 久久久久免费 | 免费国产一区 | 国产伦理一区 | 久久夜色tv网站 | 污污的视频在线观看 | 2017亚洲男人天堂 | 激情综合六月 | 国产精品亚洲玖玖玖在线靠爱 | 狠狠色丁香婷婷综合久久片 | 国产日韩视频 | 色噜噜 男人的天堂在线观看 | 婷婷综合在线 | 亚洲经典在线观看 | 日日碰夜夜操 | 天天操导航 | 婷婷亚洲综合 | 好爽毛片一区二区三区四 | 8050午夜一级全黄毛片 | 日本人69xxⅹ69 | 97人人模人人爽视频一区二区 | 一级毛片一级毛片一级毛片 | 久久夫妻视频 | 久久鲁视频 | 色噜噜噜噜色 |