Installing InfluxDB on OrangePI Zero (OPI)


  • MOD

    Below is a small tutorial on how to install InfluxDB on the OrangePI Zero.
    The image used is Armbian 5.36 (Jesse)

    
     ___                               ____  _   _____              
     / _ \ _ __ __ _ _ __   __ _  ___  |  _ \(_) |__  /___ _ __ ___  
    | | | | '__/ _` | '_ \ / _` |/ _ \ | |_) | |   / // _ \ '__/ _ \ 
    | |_| | | | (_| | | | | (_| |  __/ |  __/| |  / /|  __/ | | (_) |
     \___/|_|  \__,_|_| |_|\__, |\___| |_|   |_| /____\___|_|  \___/ 
                           |___/                                     
    
    Welcome to ARMBIAN 5.36 user-built Debian GNU/Linux 8 (jessie) 3.4.113-sun8i   
    System load:   0.40 0.37 0.32   Up time:       10 days
    Memory usage:  65 % of 494MB    IP:            xxx.xxx.xxx.xxx
    CPU temp:      55°C           
    Usage of /:    12% of 15G       storage/:      4% of 7.5G   
    
    [ 0 security updates available, 8 updates total: apt upgrade ]
    Last check: 2017-12-06 00:00
    
    [ General system configuration (beta): armbian-config ]
    
    root@orangepizero:~# uname -a
    Linux orangepizero 3.4.113-sun8i #4 SMP PREEMPT Wed Nov 22 13:45:28 CET 2017 armv7l GNU/Linux
    root@orangepizero:~# cat /etc/issue
    Debian GNU/Linux 8 \n \l
    

    Step 1:
    Add the InfluxDB repository to the the OS:

    curl -sL https://repos.influxdata.com/influxdb.key | sudo apt-key add -
    source /etc/os-release
    

    and:

    sudo echo "deb https://repos.influxdata.com/debian jessie stable" | sudo  tee  /etc/apt/sources.list.d/influxdb.list
    

    Step 2:
    Install the influxDB database

    sudo apt-get update
    

    And get InfluxDB installed:

    apt-get install influxdb
    

    If all is successfull you should see similar output like this:

    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    The following NEW packages will be installed:
      influxdb
    0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
    Need to get 19.1 MB of archives.
    After this operation, 57.1 MB of additional disk space will be used.
    Get:1 https://repos.influxdata.com/debian/ jessie/stable influxdb armhf 1.4.2-1 [19.1 MB]
    Fetched 19.1 MB in 6s (3,071 kB/s)                                                                                    
    Selecting previously unselected package influxdb.
    (Reading database ... 44212 files and directories currently installed.)
    Preparing to unpack .../influxdb_1.4.2-1_armhf.deb ...
    Unpacking influxdb (1.4.2-1) ...
    Processing triggers for man-db (2.7.0.2-5) ...
    Setting up influxdb (1.4.2-1) ...
    Created symlink from /etc/systemd/system/influxd.service to /lib/systemd/system/influxdb.service.
    Created symlink from /etc/systemd/system/multi-user.target.wants/influxdb.service to /lib/systemd/system/influxdb.service.
    root@orangepizero:~#
    

    Step 3:
    Start InfluxDB

    service influxdb start
    

    and test if you are able to connect to the database:

    root@orangepizero:~# influx
    Connected to http://localhost:8086 version 1.4.2
    InfluxDB shell version: 1.4.2
    > 
    

    The 'TICK' stack also contains other parts which can be used incombination with InfluxDB like:

    • Telegraf (Agent for collecting and reporting metrics and events)
    • InfluxDB (Time series database)
    • Chronograf (Complete interface to the TICK stack)
    • Kapacitor (Realtime streaming data processing engine)

    This page was a great help to get influxdb installed

    Howto create a database
    Logon with the influx shell,

    orangepizero:~# influx
    Connected to http://localhost:8086 version 1.4.2
    InfluxDB shell version: 1.4.2
    >
    

    Then first see what databases already exist with the command "SHOW DATABASES". for a new installation only "_internal" should be there. Then pick a name that is not in use, in my case i used "mysensors"

    > CREATE DATABASE mysensors
    > show databases
    name: databases
    name
    ----
    _internal
    mysensors
    

    After the DB is successfully created, it needs to be "used"

    > USE mysensors
    Using database mydb
    >
    

    more info here

    How to create a user account in influxdb
    Connect to the influx shell

    orangepizero:/mnt/usb-disk/influxdb# influx
    Connected to http://localhost:8086 version 1.4.2
    InfluxDB shell version: 1.4.2
    > 
    

    Then create a user with the command:

    CREATE USER <username> WITH PASSWORD '<password>' WITH ALL PRIVILEGES
    

    This will create a secondary admin user

    See this link for more info


 

10
Online

2.2k
Users

302
Topics

1.8k
Posts

Looks like your connection to MYCONTROLLER.ORG was lost, please wait while we try to reconnect.