用户名
Email
论坛
潜水/灌水快乐,沉淀知识,认识更多同行。
ToB圈子
加入IT圈,遇到更多同好之人。
朋友圈
看朋友圈动态,了解ToB世界。
ToB门户
了解全球最新的ToB事件
博客
Blog
排行榜
Ranklist
文库
业界最专业的IT文库,上传资料也可以赚钱
下载
分享
Share
导读
Guide
相册
Album
记录
Doing
应用中心
帖子
本版
文章
帖子
ToB圈子
用户
免费入驻
产品入驻
解决方案入驻
公司入驻
案例入驻
登录
·
注册
只需一步,快速开始
账号登录
立即注册
找回密码
用户名
自动登录
找回密码
密码
登录
立即注册
首页
找靠谱产品
找解决方案
找靠谱公司
找案例
找对的人
专家智库
悬赏任务
圈子
SAAS
IT评测·应用市场-qidao123.com技术社区
»
论坛
›
数据库
›
Oracle
›
Ubantu安装Prometheus、Grafana、node_exporter、elasti ...
Ubantu安装Prometheus、Grafana、node_exporter、elasticsearch_exporter监 ...
惊落一身雪
论坛元老
|
2025-2-22 02:23:47
|
显示全部楼层
|
阅读模式
楼主
主题
1742
|
帖子
1742
|
积分
5226
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要
登录
才可以下载或查看,没有账号?
立即注册
x
Prometheus安装
更新体系包索引:apt-get update && apt-get upgrade -y
官网下载Prometheus: Prometheus
命令下载:wget https://github.com/prometheus/prometheus/releases/download/vX.X.X/prometheus-X.X.X.linux-amd64.tar.gz
上传并解压
修改prometheus.yml
scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
- job_name: "prometheus"
# metrics_path defaults to '/metrics'
# scheme defaults to 'http'.
static_configs:
- targets: ["localhost:9090"]
- job_name: 'elasticsearch' # 监控ElasticSearch的job名称,自定义即可
scrape_interval: 60s
scrape_timeout: 30s
metrics_path: "/metrics" # 监控后缀
static_configs:
- targets: ["192.168.xxx.xxx:9114"] # 刚刚配置的elasticsearch_exporter监控地址
- job_name: 'Linux'
scrape_interval: 60s
scrape_timeout: 30s
metrics_path: "/metrics"
static_configs:
- targets: ["192.168.xxx.xxx:9100"]
复制代码
后台启动:nohup ./prometheus --config.file=prometheus.yml & (留意这里–有两个)
prometheus 默认端口为9090,假如想切换一个端口,可以在启动的时间直接指定,如下:
./prometheus --config.file=prometheus.yml --web.listen-address=:9091 &
复制代码
验证:http:ip:9090 点击targets
设置快速启动:
vim /etc/systemd/system/prometheus .service
复制代码
[Unit]
Requires=network.target
After=network.target
[Service]
Type=simple
WorkingDirectory=/usr/local/prometheus
ExecStart=/usr/local/prometheus/prometheus --log.level=info
TimeoutSec=30
Restart=always
[Install]
WantedBy=multi-user.target
复制代码
systemctl daemon-reload
systemctl start prometheus.service
systemctl status prometheus.service
复制代码
Grafana安装
直接官网安装:Grafana安装
验证:http:ip:3000 默认账号暗码:admin 不改就点击skip
在Grafana Web界面中,点击“Connections” > “Data Sources”。添加一个新的数据源并选择Prometheus。提供你的Prometheus服务器的URL(例如,http://your_domain:9090)并保存设置。
创建仪表盘dashboards
Grafana 的模板商店:Grafana模板商店
设置快速启动:
sudo vim /lib/systemd/system/grafana-server.service
复制代码
[Unit]
Description=Grafana
After=network-online.target
[Service]
ExecStart=/usr/local/grafana/bin/grafana-server -homepath /usr/local/grafana
[Install]
WantedBy=multi-user.target
复制代码
sudo systemctl daemon-reload
sudo systemctl start grafana-server
sudo systemctl enable grafana-server
复制代码
node_exporter安装
下载地址:node_exporter
上传并解压然后启动: nohup ./node_exporter &
需要重启Prometheus
设置快速启动:
vim /etc/systemd/system/node_exporter.service
复制代码
[Unit]
Description=prometheus node_exporter Daemon
Documentation=https://github.com/prometheus/node_exporter
Requires=network.target
After=network.target
[Service]
Type=simple
WorkingDirectory=/usr/local/node_exporter
ExecStart=/usr/local/node_exporter/node_exporter --log.level=info
TimeoutSec=30
Restart=always
[Install]
WantedBy=multi-user.target
复制代码
systemctl daemon-reload
systemctl start node_exporter.service
systemctl status node_exporter.service
复制代码
elasticsearch_exporter安装
下载地址:elasticsearch_exporter
上传并解压
设置文件是deployment.yml 一般不用改啥
然后启动: nohup ./elasticsearch_exporter &
需要重启Prometheus
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
回复
举报
0 个回复
倒序浏览
返回列表
快速回复
高级模式
B
Color
Image
Link
Quote
Code
Smilies
您需要登录后才可以回帖
登录
or
立即注册
本版积分规则
发表回复
回帖并转播
回帖后跳转到最后一页
发新帖
回复
惊落一身雪
论坛元老
这个人很懒什么都没写!
楼主热帖
看完这个,还不会DVMA,请你吃瓜 ...
腾讯叶聪:朋友圈爆款背后的计算机视觉 ...
聊一聊 TLS/SSL
数据湖选型指南|Hudi vs Iceberg 数据 ...
人工智能对软件测试的影响
rust中的超时处理
图文结合带你搞懂InnoDB MVCC
处理接口幂等性的两种常见方案 ...
一个故事看懂CPU的SIMD技术
Kubernetes(k8s)CNI(flannel)网络 ...
标签云
集成商
AI
运维
CIO
存储
服务器
浏览过的版块
网络安全
登录参与点评抽奖加入IT实名职场社区
下次自动登录
忘记密码?点此找回!
登陆
新用户注册
用其它账号登录:
关闭
快速回复
返回顶部
返回列表