脳汁portal

アメリカ在住(だった)新米エンジニアがその日学んだIT知識を書き綴るブログ

raspberryPiにinfluxdb1.2をinstallする

以前v1.0.2のinstall方法を書きましたが、今回は最新版のinfluxdb1.2をraspberryPiにインストールする方法です。
必要であれば前のパッケージは以下のコマンドで削除しておきましょう

$ sudo dpkg --purge influxdb

手順

repositoryの設定

$ sudo apt-get update
$ sudo apt-get install apt-transport-https

$ curl -sL https://repos.influxdata.com/influxdb.key | sudo apt-key add -
$ source /etc/os-release
$ test $VERSION_ID = "7" && echo "deb https://repos.influxdata.com/debian wheezy stable" | sudo tee /etc/apt/sources.list.d/influxdb.list
$ test $VERSION_ID = "8" && echo "deb https://repos.influxdata.com/debian jessie stable" | sudo tee /etc/apt/sources.list.d/influxdb.list

$ sudo apt-get update

install influxdb

$ sudo apt-get install influxdb

influxdb 起動

$ sudo service influxdb start

確認

### プロセス確認
$ ps aux | grep influx
    influxdb 14488  0.3  2.1 800724 18936 ?        Ssl  12:55   0:07 /usr/bin/influxd -config /etc/influxdb/influxdb.conf
    pi       14569  0.0  0.2   4280  1852 pts/0    S+   13:31   0:00 grep influx

### port確認
$ ss -lntp | grep 808
    LISTEN     0      128                      :::8086                    :::*
    LISTEN     0      128                      :::8088                    :::*

### pingチェック
$ curl -sl -I  http://localhost:8086/ping
    HTTP/1.1 204 No Content
    Content-Type: application/json
    Request-Id: 93e1c7d3-edb7-11e6-800a-000000000000
    X-Influxdb-Version: 1.2.0
    Date: Wed, 08 Feb 2017 04:32:19 GMT

### queryチェック
$ curl http://localhost:8086/query?pretty=true --data-urlencode "q=SHOW DATABASES"
{
    "results": [
        {
            "statement_id": 0,
            "series": [
                {
                    "name": "databases",
                    "columns": [
                        "name"
                    ],
                    "values": [
                        [
                            "_internal"
                        ]
                    ]
                }
            ]
        }
    ]
}

※ちなみに今までport8083で立ち上がっていたweb interfaceは廃止されたようです
InfluxData | Documentation | Web Admin Interface