- Prerequisites
- Installation Steps
- Authentication
- Detaching, stop and start commands
- Upgrade Trendz Service
- Troubleshooting
- Next steps
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: Make sure that:
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: Add the following configuration to the YAML file. Where:
|
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.
Click the Discover Topology button to start topology discovery process.
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
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:
-
Change the version of the
thingsboard/trendzandthingsboard/trendz-python-executorin thedocker-compose.ymlfile to the 1.15.0. -
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.