InfluxDB is a time series database written in the Golang programming language. It is easy to install for use in specific purposes, use SQL-like query language. It supports HTTP API, also can use InfluxDB to store metrics of our Internet of Things (IoT) projects. InfluxDB is optimized for fast, high-availability storage and retrieval of time series data in fields. It supports processing data from Graphite. InfluxDB uses the TCP port 8083, and Admin Panel is at TCP port 8086. 2003 is the default TCP port on which the Graphite service runs.
The default TCP port on which the OpenTSDB service runs is 4242. The default TCP port on which the UDP service runs is 8089. The default TCP port on which the Collect service runs is 25826. InfluxDB has own website with repo and documentation :
1 2 3 4 5 | # https://www.influxdata.com/ # |
Update and upgrade :
---
1 2 3 4 | # sudo apt-get -y update sudo apt-get -y upgrade # |
Add the repository key & the repo :
1 2 3 4 5 | # wget -qO- https://repos.influxdata.com/influxdb.key | sudo apt-key add - source /etc/lsb-release echo "deb https://repos.influxdata.com/${DISTRIB_ID,,} ${DISTRIB_CODENAME} stable" | sudo tee /etc/apt/sources.list.d/influxdb.list # |
On newer Ubuntu, there will be an automatic update after running the above command. However, on older Ubuntu we need to update, upgrade :
1 2 3 4 | # sudo apt-get -y update sudo apt-get -y upgrade # |
Now install InfluxDB :
1 2 3 | # sudo apt-get -y install influxdb # |
Run these commands :
1 2 3 4 5 | # sudo systemctl unmask influxdb.service sudo systemctl start influxdb sudo systemctl unmask influxdb.service # |
You can view the default configuration settings by running influxd config
command. Run :
1 2 3 4 5 | # influxd -config /etc/influxdb/influxdb.conf echo $INFLUXDB_CONFIG_PATH # /etc/influxdb/influxdb.conf # |
By default, InfluxDB will report to m.influxdb.com
about OS, architecture and version to track the number of instances running and the versions. We ll disable this feature :
1 2 3 4 5 6 7 8 | # nano /etc/influxdb/influxdb.conf ## find the below line and edit like below to make true # reporting-disabled = true ## sudo service influxdb restart sudo netstat -naptu | grep LISTEN | grep influxd # |
Command-line of InfluxDB can be evoked by the command influx
. Create an admin user and a normal non-admin user :
1 2 3 4 5 6 7 8 | # CREATE USER "admin" WITH PASSWORD 'own random password' WITH ALL PRIVILEGES CREATE USER "example" WITH PASSWORD 'own random password' # SHOW USERS # |
InfluxDB comes with web-based admin panel. We can it by pointing our browser to http://ip-address:8083
. You’ll find the configuration documentation at https://docs.influxdata.com/influxdb/v1.7/administration/config/
.