InfluxDB¶
概要¶
T.B.D.
操作¶
コマンドライン¶
influxコマンドで操作を行います。書式: influx [command]
auth¶
authコマンドには、さらに create, delete, list, active, inactive コマンドがあります。
tokenを確認するには、influx auth ls
を実行します。
REST API¶
InfluxDBへの問い合わせには、REST APIが使えます。
トラブルシュート¶
ユーザー・パスワード指定で接続がエラー¶
$ curl -G http://www.torutk.com:8086/query -u <ユーザー名>:<パスワード> --data-urlencode "q=SHOW DATABASES" {"code":"unauthorized","message":"Unauthorized"}
InfluxDB 2.xでは、ユーザー・パスワード指定でREST APIがエラーを返しています。
そこで、Tokenを使用して接続します。
$ curl -G http://www.torutk.com:8086/query --data-urlencode "q=SHOW DATABASES" \ --header "Authorization: Token <トークン文字列>" {"results":[{"statement_id":0,"series":[{"name":"databases","columns":["name"],"values":[["_monitoring"],["_tasks"],["mybucket"]]}]}]}