Telegraf は、データの収集と監視に使用されるオープンソースのエージェントです。 Telegraf が提供するプラグインを使用して、サービスを構築し、さまざまなサードパーティコンポーネントからメトリクスを収集できます。 Telegraf を LindormTSDB に接続し、Telegraf が提供する InfluxDB プラグインを使用して、LindormTSDB にデータをレポートできます。このトピックでは、Telegraf を使用して LindormTSDB にデータをレポートする方法について説明します。
前提条件
- The IP address of your client is added to the whitelist of the Lindorm instance. For more information, see Configure whitelists. クライアントの IP アドレスが Lindorm インスタンスのホワイトリストに追加されていること。詳細については、「ホワイトリストの設定」をご参照ください。
クライアントの IP アドレスが Lindorm インスタンスのホワイトリストに追加されます。詳細については、「ホワイトリストを構成する」をご参照ください。
インターネットエンドポイントが LindormTSDB で有効になっています。詳細については、「LindormTSDB のエンドポイントの表示」をご参照ください。
Telegraf のインストール
Install Telegraf by using a method that is suitable to your operating system. For more information about how to select a suitable installation method, see Telegraf documentation.ご使用のオペレーティングシステムに適した方法で Telegraf をインストールします。適切なインストール方法の選択方法の詳細については、Telegraf ドキュメント を参照してください。
Telegraf を LindormTSDB に接続する
Modify the content in the OUTPUT PLUGINS section of the telegraf.conf configuration file.telegraf.conf
設定ファイルの OUTPUT PLUGINS
セクションの内容を変更します。
outputs.influxdb
プラグインを有効にするには、コメント記号(#)を削除し、プラグインの構成でLindormTSDBへの接続に使用する情報を指定します。次の例は、構成ファイルで接続情報を構成する方法を示しています。
[[outputs.influxdb]]
......
# ## 単一のクラスターに複数の URL を指定できます。各間隔で書き込まれる URL は 1 つだけです。
urls = ["http://ld-bp1jyu376daqi****-proxy-tsdb-pub.lindorm.aliyuncs.com:8242"]
......
database = "default"
......
## HTTP ベーシック認証
username = "test"
password = "test"
パラメーター
パラメーター | 説明 |
urls | インターネット Lindorm TSDB HTTPエンドポイント。エンドポイントの取得方法については、[エンドポイントの表示] をご参照ください。 |
database | 接続先のデータベースの名前。 |
username | Lindorm TSDB への接続に使用するユーザー名とパスワード。 説明 Lindorm インスタンスでユーザー認証と権限検証機能が有効になっていない場合は、username パラメーターと password パラメーターを指定する必要はありません。詳細については、「ユーザー認証と権限検証機能を有効にする」をご参照ください。 |
password |
その他の構成項目の詳細については、「Telegraf ドキュメント」をご参照ください。
plug-in by removing the comment signs (#) and specify the information used to connect to LindormTSDB in the configurations of the plug-in. The following example shows how to configure connection information in the configuration file:ParametersLindormTSDB にデータをレポートする
Start the Telegraf service. The following command shows how to start Telegraf in Linux:Telegraf サービスを開始します。Linux で Telegraf を開始する方法の例を次に示します。
sudo systemctl start telegraf
After Telegraf is started, it automatically reports data written by using the InfluxDB line protocol to LindormTSDB. For more information about the InfluxDB line protocol, see Write data by using the InfluxDB line protocol. Telegraf が起動すると、InfluxDB ラインプロトコルを使用して書き込まれたデータが LindormTSDB に自動的にレポートされます。 InfluxDB ラインプロトコルの詳細については、「InfluxDB ラインプロトコルを使用してデータを書き込む」をご参照ください。
データを監視する
You can view the data written to LindormTSDB in the CloudMonitor console.CloudMonitor コンソールで LindormTSDB に書き込まれたデータを表示できます。
- Log on to the Lindorm console. In the upper-left corner of the page, select the region where the instance is deployed. On the [インスタンス] page, click the ID of the instance that you want to manage or click [管理] in the [アクション] column corresponding to the instance.
Lindorm コンソール にログオンします。ページの左上隅で、インスタンスがデプロイされているリージョンを選択します。インスタンス一覧 ページで、管理するインスタンスの ID をクリックするか、インスタンスに対応する [アクション] 列の [管理] をクリックします。
In the left-side navigation pane, click 左側のナビゲーションペインで、[インスタンス監視] をクリックします。
表示されるページで、[cloudmonitor] をクリックします。
CloudMonitor ページで、LindormTSDB に関連するメトリクスを表示します。
. 左側のナビゲーションペインで、 をクリックします。On the CloudMonitor page, view the metrics related to LindormTSDB.