Integrations & Setup
Factry Historian
Installing Factry Historian for production use
this guide will help you install factry historian with standard settings for a production ready installation it is written for technical users who are comfortable working with a terminal and know basic networking concepts at the end of this guide, you will find additional steps to configure tls certificates, external authentication providers, proxy servers, and other settings during this guide, you will have to configure users, passwords and secrets we recommend storing these secrets securly, for example in your password manager prerequisites before you start, make sure you have the following in place license infrastructure system resources networking license to download factry historian and install it for production use, make sure you have obtained a license key and signed a license agreement with factry if you have not done so already, please contact factry to obtain a license once both are in place, factry will provide you with access to the factry historian portal on the portal, you will be able to download all binaries needed for this guide infrastructure a supported version of ubuntu server lts ( download latest ubuntu lts image ) terminal access with administrative privileges system resources load writes / second queries / second low < 5 000 < 5 moderate < 100 000 < 25 high >= 100 000 >= 25 low cpu 4 cores memory 8 gb ram database disk >= 500 iops moderate cpu 8 cores memory 16 gb ram database disk >= 1 000 iops high high loads should be tested before being deployed to production cpu 16 cores memory 64 gb ram database disk >= 1 000 iops required disk space starts at 100gb and should be expanded based on expected write load networking to install and access the services using this guide internet access to download factry historian and prerequisities a fixed (local) ip adress for the server for a standard setup, the following ports should be available before starting the setup factry historian tcp port 8000 (http) and 8001 ( {{grpc}} ) grafana tcp port 3000 install dependencies 1\ update package list and download wget sudo apt get update && sudo apt get install wget 2\ postgresql install postgresql sudo apt get install y postgresql postgresql contrib verify if postgresql is running sudo systemctl status postgresql create postgresql superuser replace \<username> with your desired username (e g factry ) you will be prompted to enter and confirm the password for the postgresql superuser sudo u postgres createuser s \<username> p create grafana database and administrator user open the postgresql cli sudo u postgres psql then perform the following commands replace <'password'> with your desired password (e g 'my password' , keep the surrounding ' ) create user grafana with encrypted password <'password'>; create database grafana owner grafana; exit the first line creates the grafana user the second line creates the database grafana with the grafana user as the owner the third line exits the postgresql cli 3\ influxdb download and install influxdb the first line downloads and installs the influxdb ( v1 8 10 ) database which stores the time series data points and logs collected via factry historian cd /tmp wget https //dl influxdata com/influxdb/releases/influxdb 1 8 10 amd64 deb sudo apt get install y /influxdb 1 8 10 amd64 deb sudo systemctl enable now influxdb verify if influxdb is running sudo systemctl status influxdb create influxdb users open the influxdb client cli influx create a user with administrative privileges in influxdb replace \<admin username> with your desired administrator username (e g factry ) and replace \<password> with your desired password (keep the ' around the password) you will be prompted to enter and confirm the password create user \<admin username> with password '\<password>' with all privileges; shows the users available in influxdb, check if the admin user is created show users; exit the influxdb cli exit configure influxdb open your text editor of choice and make the following changes sudo vi /etc/influxdb/influxdb conf in the \[data] section edit query log enabled to false to disable (an abundance of) queries being captured in the logs in the \[http] section edit auth enabled to true to enable authentication on influxdb edit log enabled to false to disable (an abundance of) api queries being captured in the logs make sure to remove the # before the indicated lines for them to be picked up as configuration and not as a comment \[data] query log enabled = false \[http] auth enabled = true log enabled = false after making changes, restart influxdb for the changes to take effect sudo systemctl restart influxdb 4\ grafana download and install grafana download the latest supported version of grafana, by following their guide e g for version 12 1 1, use the following commands sudo apt get install y adduser libfontconfig1 musl wget https //dl grafana com/grafana/release/12 1 1/grafana 12 1 1 16903967602 linux amd64 deb sudo dpkg i grafana 12 1 1 16903967602 linux amd64 deb sudo systemctl enable now grafana server configure grafana open your text editor of choice and make the following changes sudo vi /etc/grafana/grafana ini in the \[database] section edit type to postgres to setup the grafana internal database with postgresql set host to localhost 5432 (or the host\ ip of your postgresql database) set name to grafana to set the database name set user to grafana to set the user to connect (user created in installing factry historian for production use /#2 postgresql ) set password to the password of that user (replace \<my password> with the password and keep the surrounding """ to allow special characters) set ssl mode to disable to successfully connect with the postgresql database over localhost make sure to remove the ; before the indicated lines for them to be picked up as configuration and not as a comment \[database] type = postgres host = localhost 5432 name = grafana user = grafana password = """\<my password>""" ssl mode = disable after making changes, restart grafana for the changes to take effect sudo systemctl restart grafana server verify if grafana is running sudo systemctl status grafana server install factry historian datasource in grafana install the factry historian datasource plugin in grafana to easily fetch historian data in grafana, and restart grafana for the changes to take effect sudo u grafana grafana cli plugins install factry historian datasource sudo systemctl restart grafana server 5\ lock dependency versions (optional) lock the versions of the installed services to prevent unintentional updates to the installed services when (automated) patches are performed on the server sudo apt mark hold postgresql influxdb grafana 6\ install factry historian login to the factry historian portal and download the factry historian installation executable for your cpu architecture navigate to https //portal factry cloud login with your credentials once logged in, click downloads in the header menu in the downloads panel select a release channel (stable) select a product (factry historian) select a version select an os/platform (linux/amd64) for an offline installation, click download to download the binary and manually copy it to the host system for installation on a system with internet access, click copy uri to copy the link and download it with e g wget place to executable on a location where you have write access e g your home folder replace the factry historian server vx x x linux x64 filename with the filename of your executable perform the command(s) in the cli chmod a+x factry historian server vx x x linux x64 sudo /factry historian server vx x x linux x64 install verify if factry historian is running sudo systemctl status factry historian server for more options and details, follow downloading and installing factry historian server docid\ swkcayy17f7tl9mntidrj 7\ synchronize server time with ntp (recommended) show the time and date on the server and the state of {{ntp}} synchronization timedatectl check if the time and date are set correctly note that the timezone is typically set in utc compare time between different timezones check if ntp service states active , which indicates that the server is synchronized with an ntp server is the date and time not correct or the ntp service is not active? see the troubleshooting section 8\ confirm service availability verify if you can access factry historian and grafana in the browser historian http //xx xx xx xx 8000 grafana http //xx xx xx xx 3000 if that is not the case, see the troubleshooting section make sure to use http // in your browser some browsers override it automatically to https // , in which case use an incognito window 🎉 congratulations! you have successfully installed factry historian and grafana next steps security for additional security, we recommend the following additional steps add https reverse proxy factry historian and grafana and configure certificates on the proxy webserver configure firewall configure external authentication providers docid\ tmrvaihp5fxu5o0z5tgbd configuration further configure factry historian according to your preferences consult the configuration data collection installing a collector docid\ iv4 sd56tdxcqkrkcj4kv troubleshooting services see logs these lines show the service logs of the according service unit with u , and with r sorted in reversed time order (newest logs on top) journalctl u postgresql r journalctl u influxdb r journalctl u grafana server r journalctl u factry historian server r services verify if port is accessible check if the server is accepting tcp connections (replace xx xx xx xx with your factry historian ubuntu server ip address) on the appropriate port for example, with telnet telnet xx xx xx xx 8000 if successful, the output states connected to press ctrl + ] and ctrl + c to exit the command ntp synchronization for correct date and time open the ntp synchronization settings using your editor of choice vi /etc/systemd/timesyncd conf change the configuration to point to public ntp servers, or configure your company's ntp servers an example with ubuntu's ntp servers save the file and exit your editor restarts the timesyncd service for the changes to take effect next, enables ntp synchronization then check if the status of the timesync service is set to active systemctl restart systemd timesyncd timedatectl set ntp true systemctl status systemd timesyncd need help? contact factry for licenses, support, or migrating from legacy historians