Skip to content

Installing t6

mathcoll edited this page May 13, 2021 · 27 revisions

t6 Installation

## Install dependencies t6 require the following packages running:

  • Influxdb - v1.8.x are known to be working fine.
  • Telegraf optional - v1.18 is known to be working fine.
  • nodejs - the latest available version should be great
  • npm - the latest available version should be great

Note that t6 is able to store Datapoints also to InfluxData Cloud Storage.

## Install t6 Do not use sudo/root to install t6, this is not necessary, and so, not recommended.

$ git clone https://github.com/mathcoll/t6.git & cd ./t6
$ npm install
$ rename "settings-hostname.js" according to your server _hostname_ and edit the file.
$ rename "rules-hostname.js" according to your server _hostname_.
$ rename "sensors-hostname.js" according to your server _hostname_.
$ rename "db-hostname.json" according to your server _hostname_.

✨ On linux, to identify your hostname, you can run the following command:

$ hostname

Please have a look at the options in settings-hostname.js, there are some secrets to be customized.

t6 as a startup service (Linux)

There are probably better way and more modern service implementation. Please sahre any alternative options.

Note: ✨ Any more elegant way to manage server enviroment is welcome. :-)

You can add the server running as a service, tested with Ubuntu and Debian:

  • First: install the server as service:
$ sudo ln -s /var/www/t6/etc/init.d/t6 /etc/init.d/t6
  • And then, start t6 using:
$ sudo /etc/init.d/t6 (re)start|stop|status
  • Finally, set the service to run at startup:
$ sudo update-rc.d t6 defaults

t6 timeseries settings

Once the setting are done, you can initialize the influxDb databases:

CREATE DATABASE "t6"
CREATE RETENTION POLICY "quota7d" on "t6" DURATION 7d REPLICATION 1 SHARD DURATION 1d

Database will contains the following measurements:

  • data: All timeseries for measures;
  • events: events happening in t6 Api; not really used, except for few logs;
  • requests: Allows to manage quotas and limits; this is the one using the quota7d retention policy

t6 Troobleshooting after installation

Q: sudo /etc/init.d/t6 start does not return any output, what should I do?

A: Try to set chmod +x to file /var/www/t6/bin/www and then, have a look at log files. Please note "logLevel" should be "LOG|DEBUG|INFO|WARNING|ERROR" to turn ALL debug mode.

Q: Do I need to install sqlite3?

A: Well, NO. Sqlite3 is deprecated. You can't use it anymore since b93fb1a449f19427dc82ba815368cb39ab43a429.

Clone this wiki locally