centos7+prometheus+Grafana (一)

env: centos7

        prometheus-2.3.1.linux-amd64.tar.gz

        grafana-5.2.1-1.x86_64.rpm

install:

1. prometheus

    wget https://prometheus.io/download/prometheus-2.3.1.linux-amd64.tar.gz

    tar -C /usr/local/ -zxvf prometheus-2.3.1.linux-amd64.tar.gz

    cd /usr/local/prometheus-2.3.1.linux-amd64/

    启动

    ./prometheus --config.file=prometheus.yml

[root@big prometheus-2.3.1.linux-amd64]# ./prometheus --config.file=prometheus.yml 
level=info ts=2018-07-02T01:05:51.057382195Z caller=main.go:222 msg="Starting Prometheus" version="(version=2.3.1, branch=HEAD, revision=188ca45bd85ce843071e768d855722a9d9dabe03)"
level=info ts=2018-07-02T01:05:51.057471899Z caller=main.go:223 build_context="(go=go1.10.3, user=root@82ef94f1b8f7, date=20180619-15:56:22)"
level=info ts=2018-07-02T01:05:51.057503285Z caller=main.go:224 host_details="(Linux 3.10.0-862.el7.x86_64 #1 SMP Fri Apr 20 16:44:24 UTC 2018 x86_64 big.local (none))"
level=info ts=2018-07-02T01:05:51.057530036Z caller=main.go:225 fd_limits="(soft=1024, hard=4096)"
level=info ts=2018-07-02T01:05:51.058562976Z caller=main.go:514 msg="Starting TSDB ..."
level=info ts=2018-07-02T01:05:51.058918317Z caller=repair.go:39 component=tsdb msg="found healthy block" mint=1530259200000 maxt=1530316800000 ulid=01CH7GZYM7RDRDRSZ9FJGPYBD1
level=info ts=2018-07-02T01:05:51.059099628Z caller=repair.go:39 component=tsdb msg="found healthy block" mint=1530316800000 maxt=1530381600000 ulid=01CH97XRNA8402H5JD9CGGVYVN
level=info ts=2018-07-02T01:05:51.059255732Z caller=repair.go:39 component=tsdb msg="found healthy block" mint=1530381600000 maxt=1530446400000 ulid=01CHB5Q9XA6G341CR306J323HW
level=info ts=2018-07-02T01:05:51.059401796Z caller=repair.go:39 component=tsdb msg="found healthy block" mint=1530468000000 maxt=1530475200000 ulid=01CHBTAFJTGT4NMQERK4Y294NN
level=info ts=2018-07-02T01:05:51.059521724Z caller=repair.go:39 component=tsdb msg="found healthy block" mint=1530446400000 maxt=1530468000000 ulid=01CHBTAFM532E0TY6T3FK4DAVQ
level=info ts=2018-07-02T01:05:51.059631118Z caller=repair.go:39 component=tsdb msg="found healthy block" mint=1530475200000 maxt=1530482400000 ulid=01CHC166TVXT38T11ERMZQ85WS
level=info ts=2018-07-02T01:05:51.059738709Z caller=repair.go:39 component=tsdb msg="found healthy block" mint=1530482400000 maxt=1530489600000 ulid=01CHC81Y2Y1PVNCZM1EE5CE6SX
level=info ts=2018-07-02T01:05:51.06137254Z caller=web.go:415 component=web msg="Start listening for connections" address=0.0.0.0:9090
level=info ts=2018-07-02T01:05:51.886033753Z caller=main.go:524 msg="TSDB started"
level=info ts=2018-07-02T01:05:51.886132948Z caller=main.go:603 msg="Loading configuration file" filename=prometheus.yml
level=info ts=2018-07-02T01:05:51.887684956Z caller=main.go:500 msg="Server is ready to receive web requests."

    查看版本信息

    ./prometheus --version

[root@big prometheus-2.3.1.linux-amd64]# ./prometheus --version
prometheus, version 2.3.1 (branch: HEAD, revision: 188ca45bd85ce843071e768d855722a9d9dabe03)
  build user:       root@82ef94f1b8f7
  build date:       20180619-15:56:22
  go version:       go1.10.3
[root@big prometheus-2.3.1.linux-amd64]# 

    访问页面http://localhost:9090

2. grafana

   wget https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-5.2.1-1.x86_64.rpm

    yum localinstall grafana-5.2.1-1.x86_64.rpm

    启动

    service grafana-server start

    验证

    netstat -tunlp|grep 3000

[root@big prometheus-2.3.1.linux-amd64]# netstat -tunlp|grep 300
tcp6       0      0 :::3000                 :::*                    LISTEN      12443/grafana-serve 
[root@big prometheus-2.3.1.linux-amd64]# 

    访问页面http://localhost:3000 ,默认账号、密码admin/admin

tips:

 

grafana安装信息

二进制文件: /usr/sbin/grafana-server

init.d 脚本: /etc/init.d/grafana-server
环境变量文件: /etc/sysconfig/grafana-server
配置文件: /etc/grafana/grafana.ini
启动项: grafana-server.service
日志文件:/var/log/grafana/grafana.log
默认配置的sqlite3数据库:/var/lib/grafana/grafana.db

 

你可能感兴趣的:(prometheus)