Skip to content
Stand with Ukraine flag

Installing Trendz Analytics on CentOS/RHEL

This guide explains how to install Trendz Analytics on RHEL/CentOS 7, 8, or 9.

Hardware: Minimum 4 GB of RAM and 2 CPU cores. In small and medium deployments, Trendz can be installed on the same server as ThingsBoard.

Software:

CentOS 7 only — install wget, nano, and the EPEL repository before proceeding:

Terminal window
sudo yum install -y nano wget
sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
Terminal window
sudo dnf install java-17-openjdk-headless

Set Java 17 as the default version:

Terminal window
sudo update-alternatives --config java

Verify the installation:

Terminal window
java -version

Expected output:

openjdk version "17.x.xx"
OpenJDK Runtime Environment (...)
OpenJDK 64-Bit Server VM (build ...)

Download the installation package:

Terminal window
wget https://dist.thingsboard.io/trendz-1.15.1.rpm

Install Trendz Analytics as a service:

Terminal window
sudo rpm -Uvh trendz-1.15.1.rpm

Trendz uses PostgreSQL. You can install it on the same server or use a managed PostgreSQL service.

Install PostgreSQL 16:

Terminal window
sudo dnf update
sudo dnf -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm
sudo dnf -qy module disable postgresql
sudo dnf -y install postgresql16 postgresql16-server postgresql16-contrib
Terminal window
sudo /usr/pgsql-16/bin/postgresql-16-setup initdb
sudo systemctl start postgresql-16
sudo systemctl enable --now postgresql-16

Set a password for the postgres user:

Terminal window
sudo -u postgres psql -c "\password"

Enter and confirm the password when prompted.

Configure MD5 authentication:

Edit pg_hba.conf:

Terminal window
sudo nano /var/lib/pgsql/16/data/pg_hba.conf

Locate the IPv4 local connections line and replace ident with md5:

# IPv4 local connections:
host all all 127.0.0.1/32 md5

Restart PostgreSQL to apply the change:

Terminal window
sudo systemctl restart postgresql-16.service

Create the Trendz database:

Terminal window
psql -U postgres -d postgres -h 127.0.0.1 -W
CREATE DATABASE trendz;

Press Ctrl+D to exit.

Configure the database connection:

Terminal window
sudo nano /etc/trendz/conf/trendz.conf

Add the following lines. Replace PUT_YOUR_POSTGRESQL_PASSWORD_HERE with your actual password:

Terminal window
# DB Configuration
export SPRING_DATASOURCE_URL=jdbc:postgresql://localhost:5432/trendz
export SPRING_DATASOURCE_USERNAME=postgres
export SPRING_DATASOURCE_PASSWORD=PUT_YOUR_POSTGRESQL_PASSWORD_HERE
Terminal window
sudo /usr/share/trendz/bin/install/install.sh
Terminal window
sudo service trendz start

Log in to ThingsBoard as a Sysadmin and open the Trendz Settings page.

If you see “Synchronization completed successfully”, no further action is needed.

If you see an error message:

  1. Make sure Trendz is running.
  2. Enter the correct Trendz internal URL (must be reachable from ThingsBoard).
  3. Enter the correct ThingsBoard internal URL (must be reachable from Trendz).
  4. Click Save configuration.
  5. Click Retry discovery.

To use Python Calculation Fields and Prediction Models, install the Trendz Python Executor.

See the Python Executor Setup guide for instructions.

Access Trendz UI at http://localhost:8888.

Trendz uses ThingsBoard as its authentication provider — log in with your Tenant Administrator credentials from ThingsBoard.

After the first login, discover the topology so Trendz can learn about your assets, devices, profiles, and relations:

See Business Entities for more on how Trendz uses this topology.

You can configure HTTPS access using HAProxy when Trendz is hosted in the cloud with a valid DNS name.

If HAProxy and Let’s Encrypt are already set up for ThingsBoard, open the HAProxy configuration file:

Terminal window
sudo nano /etc/haproxy/haproxy.cfg

In the frontend https_in section, add an ACL rule and backend reference:

Terminal window
acl trendz_http hdr(host) -i new-trendz-domain.com
use_backend tb-trendz if trendz_http

Register the Trendz backend:

Terminal window
backend tb-trendz
balance leastconn
option tcp-check
option log-health-checks
server tbTrendz1 127.0.0.1:8888 check inter 5s
http-request set-header X-Forwarded-Port %[dst_port]

Generate an SSL certificate:

Terminal window
sudo certbot-certonly --domain new-trendz-domain.com --email [email protected]

Reload HAProxy:

Terminal window
sudo haproxy-refresh

Trendz is now available at https://new-trendz-domain.com.

See the HAProxy on Ubuntu guide to install HAProxy and generate an SSL certificate using Let’s Encrypt.

ThingsBoard and Trendz can share a single domain — ThingsBoard at https://{my-domain}/ and Trendz at https://{my-domain}/trendz/.

In the frontend https_in section, add:

Terminal window
acl trendz_acl path_beg /trendz/ path_beg /apiTrendz/
use_backend tb-trendz if trendz_acl

See the Upgrade Instructions for detailed steps.

Trendz logs are stored in /var/log/trendz. Check for errors with:

Terminal window
cat /var/log/trendz/trendz.log | grep ERROR