立即试用 商务报价
Trendz分析
Installation > 本地环境 > Windows

本页目录

Installing ThingsBoard Trendz Analytics on Windows

Prerequisites

This guide describes how to install Trendz Analytics on a Windows machine. Instructions below are provided for Windows 10/8.1/8/7 32-bit/64-bit.

Hardware requirements depend on amount of analyzed data and amount of devices connected to the system. To run Trendz Analytics on a single machine you will need at least 1Gb of free RAM.

In small and medium installations Trendz can be installed on the same server with ThingsBoard.

Step 1. Install Java 11 (OpenJDK)

ThingsBoard基于Java11运行按照以下说明安装OpenJDK 11。

  • 访问Open JDK页面下载最新的OpenJDK 11(LTS) MSI软件包
  • 运行下载的MSI软件包勾选”Add to PATH“和”Set JAVA_HOME variable“选项进行安装
  • 访问PostgreSQL JDBC页面下载驱动程序
  • 复制C:\Program Files\AdoptOpenJDK\jdk-11.0.10.9-hotspot\jre\lib\ext路径添加CLASSPATH变量值为“C:\Program Files\AdoptOpenJDK\jdk-11.0.10.9-hotspot\jre\lib\ext\postgresql-42.2.18.jar”
  • 如果jre路径不存在“C:\Program Files\AdoptOpenJDK\jdk-11.0.10.9-hotspot”请创建文件夹

可以使用以下命令(使用命令提示符)检查安装:

1
java -version

命令输出结果:

1
2
3
4
C:\Users\User>java -version
openjdk version "11.0.xx"
OpenJDK Runtime Environment (AdoptOpenJDK)(...)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(...)

Step 2. Trendz Analytics service installation

Download and extract the package.

1
https://dist.thingsboard.io/trendz-windows-1.9.2-HF2.zip

Note: We assume you have extracted Trendz package to default location: C:\Program Files (x86)\trendz

Step 3. Obtain and configure license key

We assume you have already chosen subscription plan for Trendz and have license key. If not, please get your Free Trial license before you proceed. See How-to get pay-as-you-go subscription for more details.

Once you get the license secret, you should put it to the trendz configuration file. 以管理员用户身份打开记事本或其他编辑器(右键单击应用程序图标,然后选择“以管理员身份运行”)。
打开以下文件进行编辑(在文件选择对话框中选择“所有文件”而不是“文本文档”,编码为UTF-8):

1
C:\Program Files (x86)\trendz\conf\trendz.yml

Scroll to the bottom of the file and locate the following configuration block:

1
2
license:
    secret: "${TRENDZ_LICENSE_SECRET:YOUR_LICENSE_SECRET_HERE}" # license secret obtained from ThingsBoard License Portal (https://license.thingsboard.io)

Step 4. Configure connection with ThingsBoard Platform

You can connect Trendz Analytics to the ThingsBoard Community Edition or ThingsBoard Professional Edition.

以管理员用户身份打开记事本或其他编辑器(右键单击应用程序图标,然后选择“以管理员身份运行”)。
打开以下文件进行编辑(在文件选择对话框中选择“所有文件”而不是“文本文档”,编码为UTF-8):

1
C:\Program Files (x86)\trendz\conf\trendz.yml

Add ThingsBoard REST API URL that would be used for communicating with ThingsBoard Platform. In most cases, when Trendz installed in the same server with ThingsBoard, API_URL would be http://localhost:8080. Otherwise you should use ThingsBoard domain name.

1
tb.api.url: "${TB_API_URL:http://localhost:8080}"

Step 5. Configure Trendz database

Trendz uses PostgreSQL as a database. You can install PostgreSQL on the same serverfor Trendz or use managed PostgreSQL service from your cloud vendor.

PostgreSQL Installation

Download the installation file (PostgreSQL 11.7 or newer releases) here and follow the installation instructions.

During PostgreSQL installation, you will be prompted for superuser (postgres) password. Don’t forget this password. It will be used later. For simplicity, we will substitute it with “postgres”.

Create Database for Trendz

Once installed, launch the “pgAdmin” software and login as superuser (postgres). Open your server and create database “trendz” with owner “postgres”.

Configure database connection for Trendz

以管理员用户身份打开记事本或其他编辑器(右键单击应用程序图标,然后选择“以管理员身份运行”)。
打开以下文件进行编辑(在文件选择对话框中选择“所有文件”而不是“文本文档”,编码为UTF-8):

1
C:\Program Files (x86)\trendz\conf\trendz.yml

and locate “datasource” block. Replace SPRING_DATASOURCE_URL, SPRING_DATASOURCE_USERNAME and SPRING_DATASOURCE_PASSWORD properties with valid values. Don’t forget to replace “postgres” with your real postgres user password:

1
2
3
4
5
6
7
datasource:
    driverClassName: "${SPRING_DRIVER_CLASS_NAME:org.postgresql.Driver}"
    url: "${SPRING_DATASOURCE_URL:jdbc:postgresql://localhost:5432/trendz}"
    username: "${SPRING_DATASOURCE_USERNAME:postgres}"
    password: "${SPRING_DATASOURCE_PASSWORD:postgres}"
    hikari:
      maximumPoolSize: "${SPRING_DATASOURCE_MAXIMUM_POOL_SIZE:5}"

Step 6. Run installation script

Launch windows shell (Command Prompt) as Administrator. Change directory to your Trendz installation directory.

Execute install.bat script to install Trendz as a Windows service. This means it will be automatically started on system startup. Similar, uninstall.bat will remove Trendz from Windows services. The output should be similar to this one:

1
2
3
4
5
6
7
C:\Program Files (x86)\trendz>install.bat
Detecting Java version installed.
CurrentVersion 11
Java 11 found!
Installing Trendz Analytics...
...
Trendz Analytics installed successfully!

Step 7. Start Trendz service

Now let’s start the Trendz service! 以管理员身份打开命令提示符并执行以下命令:

1
net start trendz

执行输出结果:

1
2
The Trendz Analytics service is starting.
The Trendz Analytics service was started successfully.

In order to restart the Trendz service you can execute following commands:

1
2
net stop trendz
net start trendz

启动后使用以下链接打开Web UI:

1
http://localhost:8888/trendz

Note: If Trendz installed on a remote server, you have to replace localhost with the public IP address of the server or with a domain name. Also, check that port 8888 opened for public access.

Authentication

For first authentication you need to use Tenant Administrator credentials from your ThingsBoard

Trendz uses ThingsBoard as an authentication service. During first sign in ThingsBoard service should be also available to validate credentials.

Troubleshooting

The log files are located in logs folder (“C:\Program Files (x86)\trendz\logs” in our case).

The trendz.log file should contain following line:

1
2
YYYY-MM-DD HH:mm:ss,sss [main] INFO  o.t.t.TrendzApplication - Started TrendzApplication in x.xxx seconds (JVM running for x.xxx)

In case of any unclear errors, use general troubleshooting guide or contact us.

Windows firewall settings

In order to have external access to Trendz Web UI you need to create a new inbound rule with Windows Firewall with Advanced Security.

  • Open “Windows Firewall” from “Control Panel”:

image

  • Click “Advanced settings” on the left panel:

image

  • Select “Inbound Rules” on the left panel, then click “New Rule…” on the right “Actions” panel:

image

  • Now new “New Inbound Rule Wizard” window will open. On the first step “Rule Type” select “Port” option:

image

  • On the “Protocol and Ports” step select “TCP” protocol and enter port 8888 in the “Specific local ports” field:

image

  • On the “Action” step leave “Allow the connection” option selected:

image

  • On the “Profile” step select Windows network profiles when to apply this rule:

image

  • Finally, give the name to this rule (for ex. “Trendz Service Networking”) and click “Finish”.

image

Next steps