首页 > 系统相关 >性能测试——性能测试-linux监控工具-Centos7.x安装Prometheus

性能测试——性能测试-linux监控工具-Centos7.x安装Prometheus

时间:2024-04-20 13:44:40浏览次数:31  
标签:https -- 性能 Centos7 prometheus systemctl 测试 data target

此处参考小菠萝文档:https://www.cnblogs.com/poloyy/p/12375039.html

 

下载安装Prometheus

PROM_PATH='/data/prometheus'
mkdir -p ${PROM_PATH}
mkdir -p ${PROM_PATH}/{data,conf,logs,bin}
useradd prometheus
cd /usr/local/src
wget https://github.com/prometheus/prometheus/releases/download/v2.13.0/prometheus-2.13.0.linux-amd64.tar.gz
tar -xvf prometheus-2.13.0.linux-amd64.tar.gz
cd prometheus-2.13.0.linux-amd64/
cp prometheus promtool ${PROM_PATH}/bin/
cp prometheus.yml ${PROM_PATH}/conf/
chown -R prometheus.prometheus /data/prometheus
# Setting Variables
cat >> /etc/profile <<EOF
PATH=/data/prometheus/bin:$PATH:$HOME/bin
EOF

 

 

 

 

将Prometheus配置系统服务

cat >>/etc/systemd/system/prometheus.service <<EOF
[Unit]
Description=Prometheus
Documentation=https://prometheus.io/
After=network.target

[Service]
Type=simple
User=prometheus
ExecStart=/data/prometheus/bin/prometheus --config.file=/data/prometheus/conf/prometheus.yml --storage.tsdb.path=/data/prometheus/data --storage.tsdb.retention=90d
Restart=on-failure

[Install]
WantedBy=multi-user.target
EOF

 

 

 

 

现在使用下面的systemctl命令重新加载systemd系统,并查看服务是否启动

systemctl daemon-reload
systemctl enable prometheus.service
systemctl start prometheus.service
systemctl status prometheus.servic

 

 

 

查看端口是否正常

netstat -plntu |grep 9090 

 

这里需要放行9090端口,也可以直接关闭防火墙

systemctl stop firewalld
systemctl status firewall

 

访问http://IP:9090

出现上图就是成功了!!

 

 

 

 

=======================================================================

 

 

 

 

 

 

 

 

 

[Unit]
Description=Prometheus
Documentation=https://prometheus.io/
After=network.target

[Service]
Type=simple
User=prometheus
ExecStart=/data/prometheus/bin/prometheus --config.file=/data/prometheus/conf/prometheus.yml --storage.tsdb.path=/data/prometheus/data --storage.tsdb.retention=90d
Restart=on-failure

[Install]
WantedBy=multi-user.target
[Unit]
Description=Prometheus
Documentation=https://prometheus.io/
After=network.target

 

 

执行:

vim /etc/systemd/system/prometheus.service      命令

[Unit]
Description=Prometheus
Documentation=https://prometheus.io/
After=network.target

[Service]
Type=simple
User=prometheus
ExecStart=/data/prometheus/bin/prometheus --config.file=/data/prometheus/conf/prometheus.yml --storage.tsdb.path=/data/prometheus/data --storage.tsdb.retention=90d
Restart=on-failure

[Install]
WantedBy=multi-user.target
[Unit]
Description=Prometheus
Documentation=https://prometheus.io/
After=network.target

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

==========================================================

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

标签:https,--,性能,Centos7,prometheus,systemctl,测试,data,target
From: https://www.cnblogs.com/xiaobaibailongma/p/18147629

相关文章

  • 涛思数据 TDengine 征稿— 利用python脚本做TDengine性能测试
    【本文正在参与“拥抱开源|涛思数据TDengine有奖征稿】https://marketing.csdn.net/p/0ada836ca30caa924b9baae0fd33857c设备上传的数据具有很明显的物联网特点,通常是时序性的,按时间先后顺序上报,而且写入后,几乎不会修改,主要是查询和统计。针对这些特点,时序数据库TDengine将......
  • 利用预测不确定性提高安卓恶意软件检测模型性能
    文献简介文献标题:MalCertainEnhancingDeepNeuralNetworkBasedAndroidMalwareDetectionbyTacklingPredictionUncertainty引用:Yang,Liminetal."BODMAS:AnOpenDatasetforLearningbasedTemporalAnalysisofPEMalware",IEEESymposiumonSecurity......
  • 性能测试——性能测试-linux监控工具——Jmeter插件之ServerAgent服务器性能监控工具
    安装插件1、在Jmeter官网:https://jmeter-plugins.org/wiki/PluginsManager/下载插件管理器Plugins-manager.jar  参考博客地址:https://blog.csdn.net/qq_45664055/article/details/105979481              需要先安装java,设置环境变量: ......
  • 测试1
    随着npm包越来越多,而且包名也只能是唯一的,如果一个名字被别人占了,那你就不能再使用这个名字;假设我想要开发一个utils包,但是张三已经发布了一个utils包,那我的包名就不能叫utils了;此时我们可以加一些连接符或者其他的字符进行区分,但是这样就会让包名不具备可读性。在npm的......
  • 测试10
    随着npm包越来越多,而且包名也只能是唯一的,如果一个名字被别人占了,那你就不能再使用这个名字;假设我想要开发一个utils包,但是张三已经发布了一个utils包,那我的包名就不能叫utils了;此时我们可以加一些连接符或者其他的字符进行区分,但是这样就会让包名不具备可读性。在npm的包......
  • 测试9
    随着npm包越来越多,而且包名也只能是唯一的,如果一个名字被别人占了,那你就不能再使用这个名字;假设我想要开发一个utils包,但是张三已经发布了一个utils包,那我的包名就不能叫utils了;此时我们可以加一些连接符或者其他的字符进行区分,但是这样就会让包名不具备可读性。在npm的包......
  • 测试8
    随着npm包越来越多,而且包名也只能是唯一的,如果一个名字被别人占了,那你就不能再使用这个名字;假设我想要开发一个utils包,但是张三已经发布了一个utils包,那我的包名就不能叫utils了;此时我们可以加一些连接符或者其他的字符进行区分,但是这样就会让包名不具备可读性。在npm的包......
  • 测试7
    随着npm包越来越多,而且包名也只能是唯一的,如果一个名字被别人占了,那你就不能再使用这个名字;假设我想要开发一个utils包,但是张三已经发布了一个utils包,那我的包名就不能叫utils了;此时我们可以加一些连接符或者其他的字符进行区分,但是这样就会让包名不具备可读性。在npm的包......
  • 测试6
    随着npm包越来越多,而且包名也只能是唯一的,如果一个名字被别人占了,那你就不能再使用这个名字;假设我想要开发一个utils包,但是张三已经发布了一个utils包,那我的包名就不能叫utils了;此时我们可以加一些连接符或者其他的字符进行区分,但是这样就会让包名不具备可读性。在npm的包......
  • 测试5
    随着npm包越来越多,而且包名也只能是唯一的,如果一个名字被别人占了,那你就不能再使用这个名字;假设我想要开发一个utils包,但是张三已经发布了一个utils包,那我的包名就不能叫utils了;此时我们可以加一些连接符或者其他的字符进行区分,但是这样就会让包名不具备可读性。在npm的包......