码迷,mamicode.com
首页 > 其他好文 > 详细

Prometheus安装

时间:2020-06-29 17:09:15      阅读:88      评论:0      收藏:0      [点我收藏+]

标签:useradd   number   cst   enable   service   启动   systemd   sys   pre   

环境

系统:CentOS 7.5
软件:prometheus-2.18.1.linux-amd64.tar.gz

安装

  • 下载二进制包
    地址:https://prometheus.io/download/

  • 安装

    # tar -xzvf prometheus-2.18.1.linux-amd64.tar.gz
    # mkdir /usr/local/prometheus
    # mv prometheus-2.18.1.linux-amd64 /usr/local/prometheus/prometheus
    
  • 创建数据目录

    # mkdir -p /data/prometheus/prometheus/data
    
  • 创建用户并授权

    # useradd prometheus
    # chown -R prometheus:prometheus /usr/local/prometheus /data/prometheus
    

启动

  • 添加启动服务

    # vim /usr/lib/systemd/system/prometheus.service
    [Unit]
    Description= Prometheus
    After=network.target
    
    [Service]
    Type=simple
    User=prometheus
    ExecStart=/usr/local/prometheus/prometheus/prometheus --config.file=/usr/local/prometheus/prometheus/prometheus.yml --storage.tsdb.path=/data/prometheus/prometheus/data
    ExecReload=/bin/kill -HUP $MAINPID
    Restart=on-failure
    
    [Install]
    WantedBy=multi-user.target
    
  • 启动

    # systemctl enable prometheus.service
    # systemctl start prometheus.service
    
  • 访问
    web地址:http://ip:9090




Prometheus安装

标签:useradd   number   cst   enable   service   启动   systemd   sys   pre   

原文地址:https://www.cnblogs.com/Python-K8S/p/13208637.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!