GNU/Linux >> Linux の 問題 >  >> Ubuntu

Ubuntu18.04LTSにPrometheusをインストールする方法

Prometheusは、無料のオープンソースソフトウェアエコシステムであり、アプリケーションからメトリックを収集し、それらをデータベース、特に時系列ベースのDBに保存できます。動的な環境に適した非常に強力な監視システムです。 PrometheusはGoで記述されており、データ処理にクエリ言語を使用します。 Prometheusは、CPU、メモリ、ディスク使用量、I / O、ネットワーク統計、MySQLサーバーおよびNginxのメトリックを提供します。

このチュートリアルでは、Ubuntu18.04サーバーにPrometheusをインストールする方法を説明します。

要件
  • Ubuntu18.04LTSを実行しているサーバー。
  • sudo権限を持つroot以外のユーザー。
プロメテウスをインストール

デフォルトでは、PrometheusはUbuntu 18.04 LTS(Bionic Beaver)のデフォルトリポジトリでは使用できません。そのため、そのためのリポジトリを追加する必要があります。

まず、次のコマンドを使用してGPGキーをダウンロードして追加します。

wget https://s3-eu-west-1.amazonaws.com/deb.robustperception.io/41EFC99D.gpg | sudo apt-key add -

次に、リポジトリを更新し、次のコマンドを使用してPrometheusをインストールします。

sudo apt-get update -y
sudo apt-get install prometheus prometheus-node-exporter prometheus-pushgateway prometheus-alertmanager-y

インストールが完了したら、次のコマンドを使用してPrometheusサービスを開始し、起動時に開始できるようにします。

sudo systemctl start prometheus
sudo systemctl enable prometheus

次のコマンドを使用して、Prometheusサービスのステータスを確認することもできます。

sudo systemctl status prometheus

出力:

? prometheus.service - Monitoring system and time series database
   Loaded: loaded (/lib/systemd/system/prometheus.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2018-08-10 17:04:20 UTC; 9s ago
     Docs: https://prometheus.io/docs/introduction/overview/
 Main PID: 16885 (prometheus)
    Tasks: 7 (limit: 1114)
   CGroup: /system.slice/prometheus.service
           ??16885 /usr/bin/prometheus

Aug 10 17:04:20 ubuntu1804 prometheus[16885]: level=info ts=2018-08-10T17:04:20.350218887Z caller=main.go:218 msg="Starting Prometheus" version
Aug 10 17:04:20 ubuntu1804 prometheus[16885]: level=info ts=2018-08-10T17:04:20.351807036Z caller=main.go:219 build_context="(go=go1.9.2, user=
Aug 10 17:04:20 ubuntu1804 prometheus[16885]: level=info ts=2018-08-10T17:04:20.35248264Z caller=main.go:220 host_details="(Linux 4.15.0-20-gen
Aug 10 17:04:20 ubuntu1804 prometheus[16885]: level=info ts=2018-08-10T17:04:20.353074121Z caller=main.go:221 fd_limits="(soft=1024, hard=4096)
Aug 10 17:04:20 ubuntu1804 prometheus[16885]: level=info ts=2018-08-10T17:04:20.392570017Z caller=main.go:492 msg="Starting TSDB ..."
Aug 10 17:04:20 ubuntu1804 prometheus[16885]: level=info ts=2018-08-10T17:04:20.432567016Z caller=web.go:359 component=web msg="Start listening
Aug 10 17:04:20 ubuntu1804 prometheus[16885]: level=info ts=2018-08-10T17:04:20.49325436Z caller=main.go:502 msg="TSDB started"
Aug 10 17:04:20 ubuntu1804 prometheus[16885]: level=info ts=2018-08-10T17:04:20.497888806Z caller=main.go:578 msg="Loading configuration file" 
Aug 10 17:04:20 ubuntu1804 prometheus[16885]: level=info ts=2018-08-10T17:04:20.511419604Z caller=main.go:479 msg="Server is ready to receive w
Aug 10 17:04:20 ubuntu1804 prometheus[16885]: level=info ts=2018-08-10T17:04:20.554879161Z caller=manager.go:59 component="scrape manager" msg=
アクセスプロメテウス

Prometheusがインストールされ、ポート 9090でリッスンしています 。 Webブラウザーを開き、URL http:// your-server-ip:9090を入力します 。 Prometheusダッシュボードにリダイレクトされます:

データクエリの例の結果。

  • https://prometheus.io/

Ubuntu
  1. Ubuntu 22.04 /20.04LTSにDockerをインストールする方法

  2. Ubuntu20.04LTSにPlayOnLinuxをインストールする方法

  3. Ubuntu20.04にPrometheusをインストールする方法

  1. Ubuntu20.04LTSにMariaDBをインストールする方法

  2. Ubuntu 20.04 LTS/21.04にAnsibleをインストールする方法

  3. Ubuntu 20.04 LTS/21.04にMinikubeをインストールする方法

  1. Ubuntu18.04LTSにSpotifyをインストールする方法

  2. Ubuntu18.04LTSにMemcachedをインストールする方法

  3. Ubuntu18.04LTSにVestaCPをインストールする方法