Stand with Ukraine flag
Pricing Try it now
Trendz Analytics
Installation > On-premises > Docker (Windows)
Getting Started Documentation Guides
How To Activate Trendz
On this page

Installing ThingsBoard Trendz Analytics using Docker (Windows)

This guide will help you to install and start Trendz Analytics using Docker on Windows.

Prerequisites

  • Have Docker Desktop for Windows. You can find out how to install it here

  • ThingsBoard version 4.3.0 or newer. In case you have ThingsBoard version 4.2.1 or older, you could connect Trendz to ThingsBoard following the next guide.
  • Active Trendz Analytics addon. To find out how to activate it, please follow the next guide.

Installation Steps

Step 1. Docker Compose setup

Trendz can be run either in the same Docker Compose file as ThingsBoard or in a separate Docker Compose file.

For small and medium installations, we recommend installing Trendz in the same Docker Compose file as ThingsBoard.

Open the Docker Compose file with ThingsBoard services:

1
docker-compose.yml

Make sure that:

  • the following services are present in the file:
    • trendz
    • trendz-python-executor
    • trendz-postgres
  • the following volumes are present in the file:
    • trendz-conf
    • trendz-data
    • trendz-python-executor-conf
    • trendz-python-executor-data
    • trendz-postgres-data

If any of them are missing, update your Docker Compose file according to the ThingsBoard Docker installation instructions.

Your Docker Compose file should be similar to the one shown in the instructions.

Create a docker compose file for Trendz Analytics service:

1
docker-compose.yml

Add the following configuration to the YAML file.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
services:
  trendz:
    profiles: ['trendz']
    restart: always
    image: "thingsboard/trendz:1.14.0"
    ports:
      - "8888:8888"
    environment:
      SPRING_DATASOURCE_URL: jdbc:postgresql://trendz-postgres:5432/trendz
      SPRING_DATASOURCE_USERNAME: postgres
      SPRING_DATASOURCE_PASSWORD: postgres
      SCRIPT_ENGINE_DOCKER_PROVIDER_URL: trendz-python-executor:8181
      SCRIPT_ENGINE_TIMEOUT: 30000
    volumes:
      - trendz-conf:/trendz-config-files
      - trendz-data:/data
    depends_on:
      - trendz-postgres
  trendz-python-executor:
    profiles: ['trendz']
    restart: always
    image: "thingsboard/trendz-python-executor:1.14.0"
    ports:
      - "8181:8181"
    environment:
      EXECUTOR_MANAGER: 1
      EXECUTOR_SCRIPT_ENGINE: 6
      THROTTLING_QUEUE_CAPACITY: 10
      THROTTLING_THREAD_POOL_SIZE: 6
      NETWORK_BUFFER_SIZE: 5242880
    volumes:
      - trendz-python-executor-conf:/python-executor-config-files
      - trendz-python-executor-data:/data
  trendz-postgres:
    profiles: ['trendz']
    restart: always
    image: "postgres:16"
    ports:
      - "5432:5432"
    environment:
      POSTGRES_DB: trendz
      POSTGRES_PASSWORD: postgres
    volumes:
      - trendz-postgres-data:/var/lib/postgresql/data
volumes:
  trendz-conf:
    name: trendz-conf
    driver: local
  trendz-data:
    name: trendz-data
    driver: local
  trendz-python-executor-conf:
    name: trendz-python-executor-conf
    driver: local
  trendz-python-executor-data:
    name: trendz-python-executor-data
    driver: local
  trendz-postgres-data:
    name: trendz-postgres-data
    driver: local

Where:

  • 8888:8888 - connect local port 8888 to exposed internal HTTP port 8888
  • trendz-conf:/trendz-config-files - mounts the volume trendz-conf to Trendz directory with the configuration files
  • trendz-data:/data - mounts the volume trendz-data to Trendz data directory
  • trendz-postgres-data:/var/lib/postgresql/data - mounts the volume trendz-postgres-data to Postgres data directory
  • trendz - name of the Trendz Docker service
  • --restart always - automatically start Trendz in case of system reboot and restart in case of failure.
  • thingsboard/trendz:1.15.0 - Trendz docker image
  • thingsboard/trendz-python-executor:1.15.0 - Trendz python script executor docker image
  • SCRIPT_ENGINE_TIMEOUT - Python script execution timeout

Step 2. Start Trendz service

Set the terminal in the directory which contains the docker-compose.yml file and execute the following commands to up this docker compose directly:

1
docker compose --profile trendz up -d && docker compose logs -f trendz

After executing this command you can open http://{your-host-ip}:8888 in your browser (for ex. http://localhost:8888). You should see Trendz login page.

Step 3. Sync ThingsBoard With Trendz

The final step is to verify that ThingsBoard is synchronized with Trendz. To do this:

  • Log in to ThingsBoard as a Sysadmin.
  • Open the Trendz Settings page.

If you see the message “Synchronization completed successfully”, the synchronization has been completed automatically and no further action is required.

If you see an error message, follow these steps:

  • Make sure that Trendz is running.
  • Enter the correct Trendz internal URL. It must be accessible from the ThingsBoard service.
  • Enter the correct ThingsBoard internal URL. It must be accessible from the Trendz service.
  • Click Save configuration.
  • Click Retry discovery.

Once the message “Synchronization completed successfully” appears, the synchronization is complete.

Authentication

You can access Trendz UI by default at http://localhost:8888

Trendz uses ThingsBoard as an authentication service, so for first authentication, you need to use Tenant Administrator credentials from your ThingsBoard.

Topology Discovery

After the first login to Trendz, you need to discover topology to allow Trendz to know about assets, devices, their profiles and relations:

  • Click the Discover Topology button to start topology discovery process.
  • Wait until your topology will be discovered.
  • Click the Finish button to close topology discovery page and unlock the main Trendz functionality.

You could read more about how Trendz uses this topology here.

Detaching, stop and start commands

You can detach from session terminal using Ctrl-p Ctrl-q key sequence - the container will keep running in the background.

In case of any issues, you can examine service logs for errors. For example, to see Trendz container logs, execute the following command:

1
docker compose logs -f trendz

To stop the container:

1
docker compose stop trendz

To start the container:

1
docker compose start trendz

Upgrade Trendz Service

Doc info icon

Note, that you can upgrade Trendz from any version to the latest at once (for example, 1.2.0 -> 1.15.0 ,etc).

Below is an example of how to upgrade from any Trendz version to 1.15.0

  • Create a dump of your database:
1
docker compose exec trendz-postgres sh -c "pg_dump -U postgres trendz > /var/lib/postgresql/data/trendz_dump"

When a new Trendz release is available, follow these steps to update your installation without losing data:

doc warn icon

If you are upgrading using previous version of deployment files, make sure to follow steps described in this instruction first.

  1. Change the version of the thingsboard/trendz and thingsboard/trendz-python-executor in the docker-compose.yml file to the 1.15.0.

  2. Execute the following commands:

1
2
3
4
docker pull thingsboard/trendz:1.15.0
docker compose stop trendz
docker compose run --rm -e UPGRADE_TRENDZ=true trendz
docker compose up -d

Troubleshooting

DNS issues

NOTE If you observe errors related to DNS issues, for example

1
127.0.1.1:53: cannot unmarshal DNS message

You may configure your system to use Google public DNS servers

Next steps

  • Getting started guide - These guide provide quick overview of main Trendz features.

  • Metric Explorer - Learn how to explore and create new metrics with Trendz Metric Explorer.

  • Anomaly Detection - Learn how to identify anomalies in the data.

  • Calculated Fields - Learn about Calculated fields and how to use them.

  • States - Learn how to define and analyse states for assets based on raw telemetry.

  • Prediction - Learn how to make forecasts and predict telemetry behavior.

  • Filters - Learn how filter dataset during analysis.

  • Available Visualizations - Learn about visualization widgets available in Trendz and how to configure them.

  • Share and embed Visualizations - Learn how to add Trendz visualizations on ThingsBoard dashboard or 3rd party web pages.

  • AI Assistant - Learn how to utilize Trendz AI capabilities.