プロメテウスのインストールとGrafana

(A)取付プロメテウスインストール

$ wgetのhttps://github.com/prometheus/prometheus/releases/download/v2.4.3/prometheus-2.4.3.linux-amd64.tar.gz

$タールzxvfプロメテウス-2.4.3.linux-amd64.tar.gz

$のCDプロメテウス-2.4.3.linux、AMD64

あなたが新しいジョブを追加する必要がある場合は、このファイルを追加

$ Vimのprometheus.yml   

global:
  scrape_interval:     15s
  evaluation_interval: 15s
  # scrape_timeout is set to the global default (10s).
alerting:
  alertmanagers:
  - static_configs:
    - targets:
      # - alertmanager:9093
rule_files:

scrape_configs:

  - job_name: 'prometheus'
    # metrics_path defaults to '/metrics'
    # scheme defaults to 'http'.
    static_configs:
    - targets: ['localhost:9090']

  - job_name: 'linux1'
    static_configs:
      - targets: ['192.xxx.xx.xx:9100']
        labels:
          instance: server1
  - job_name: 'linux2'
    static_configs:
      - targets: ['192.xxx.xx.xx:9100']
        labels:
          instance: server2
运行 start Prometheus
$ nohup ./prometheus &

サービスにsystemdに

$ cd ..
$ sudo mv prometheus-2.4.3.linux-amd64 /usr/local/prometheus

$ sudo groupadd prometheus
$ sudo useradd -g prometheus -m -d /usr/local/prometheus -s /sbin/nologin prometheus

$ sudo chown -R prometheus:prometheus /usr/local/prometheus

$ sudo vim /etc/systemd/system/prometheus.service  # 写入如下内容
[Unit]
Description=prometheus
After=network.target
[Service]
Type=simple
User=prometheus
ExecStart=/usr/local/prometheus/prometheus --config.file=/usr/local/prometheus/prometheus.yml --storage.tsdb.path=/usr/local/prometheus
Restart=on-failure
[Install]
WantedBy=multi-user.target

プロメテウスは、Webサイトが付属して、デフォルトのポートは9090で、のhttp:// IP :. 9090式は結果、アラーム設定、プロメテウス構成、輸出国の地位を検索表示することができます。 

(B)実装構成Grafana

公式インストールマニュアル:https://grafana.com/grafana/download?platform=linux

http://docs.grafana.org/installation/

$ wget https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana_5.3.0_amd64.deb 
$ sudo dpkg -i grafana_5.3.0_amd64.deb 

$ sudo systemctl status grafana-server    #默认进入了运行的状态

$ sudo systemctl enable grafana-server

ポート3000へのアクセスを開く必要があります  https://blog.csdn.net/zbljz98/article/details/80464761

$ iptablesの-A 3000 --dport TCP -p INPUTはACCEPT -j

私は、このステップを行うことができないだけで起動したIP失格:3000件のポートアクセスを

ログインページを入力し、ユーザー名は管理者の最初の訪問で、パスワードはadminです

初めてログインした後、あなたのパスワードを変更するように求められます

 

おすすめ

転載: www.cnblogs.com/iwangzheng/p/11104287.html