This guide describes how to install ThingsBoard on a Windows machine. Instructions below are provided for Windows 10/8.1/8/7 32-bit/64-bit. Hardware requirements depend on chosen database and amount of devices connected to the system. To run ThingsBoard and PostgreSQL on a single machine you will need at least 2Gb of RAM. To run ThingsBoard and Cassandra on a single machine you will need at least 8Gb of RAM.
ThingsBoard服务运行在Java 8上。请按照以下说明安装OpenJDK 8。
您可以使用以下命令(使用命令提示符)检查安装:
java -version
命令输出结果:
C:\Users\User>java -version
openjdk version "1.8.0_212"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_212-b04)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.212-b04, mixed mode)
Download and run the installation package.
https://dist.thingsboard.io/thingsboard-windows-setup-3.1.1pe.exe
Note: We assume you have installed ThingsBoard to default location: C:\Program Files (x86)\thingsboard
We assume you have already chosen your subscription plan or decided to purchase a perpetual license. If not, please navigate to pricing page to select the best license option for your case and get your license. See How-to get pay-as-you-go subscription or How-to get perpetual license for more details.
Once you get the license secret, you should put it to the thingsboard configuration file.
Open the Notepad or other editor as administrator user (right click on the app icon and select “Run as administrator”).
Open the following file for editing (select “All Files” instead of “Text Documents” in file choosing dialog, the encoding is UTF-8):
C:\Program Files (x86)\thingsboard\conf\thingsboard.yml
Scroll to the bottom of the file and locate the following configuration block:
license:
secret: "${TB_LICENSE_SECRET:}" # license secret obtained from ThingsBoard License Portal (https://license.thingsboard.io)
and put your license secret. See example below:
license:
secret: "${TB_LICENSE_SECRET:YOUR_LICENSE_SECRET_HERE}" # license secret obtained from ThingsBoard License Portal (https://license.thingsboard.io)
ThingsBoard能够使用SQL或hybrid数据库方式。 有关更多详细信息请参见相应的体系结构页面 。
PostgreSQL安装下载安装文件(PostgreSQL 11.7或更高版本此处并按照安装说明进行操作。 在PostgreSQL安装时系统将提示您输入超级用户(postgres)密码。 请一定牢记此密码,为了方便记忆我们将密码替换为postgres。 创建ThingsBoard数据库安装成功后启动”pgAdmin”并使用超级用户(postgres)身份登录。 打开服务器并用”postgres”用户创建数据库”thingsboard”。 ThingsBoard配置如果您已将PostgreSQL超级用户密码指定为”postgres”则可以跳过此步骤。 以管理员用户身份打开记事本或其他编辑器(右键单击应用程序图标然后选择”以管理员身份运行”)。 打开以下文件进行编辑(在文件选择对话框中选择“所有文件”而不是“文本文档”,编码为UTF-8):
找到”SQL DAO Configuration”代码块将postgres用户密码替换”postgres”:
找到”SQL_POSTGRES_TS_KV_PARTITIONING”参数以覆盖时间戳键值存储分区大小的默认值:
|
PostgreSQL安装下载安装文件(PostgreSQL 11.7或更高版本此处并按照安装说明进行操作。 在PostgreSQL安装时系统将提示您输入超级用户(postgres)密码。 请一定牢记此密码,为了方便记忆我们将密码替换为postgres。 创建ThingsBoard数据库安装成功后启动“pgAdmin”并使用超级用户(postgres)身份登录。 打开服务器并用“postgres”用户创建数据库“thingsboard”。 Cassandra安装下面列出的说明将帮助您安装Cassandra。
ThingsBoard配置如果您已将PostgreSQL超级用户密码指定为”postgres”,则可以跳过此步骤。 以管理员用户身份打开记事本或其他编辑器(右键单击应用程序图标,然后选择“以管理员身份运行”)。 打开以下文件进行编辑(在文件选择对话框中选择“所有文件”而不是“文本文档”,编码为UTF-8):
找到”SQL DAO Configuration”代码块将postgres用户密码替换”postgres”:
找到“ DATABASE_TS_TYPE”参数。将“sql”替换为“ cassandra”。
您可以选择在“cassandra”代码块中调整参数。
|
PostgreSQL安装下载安装文件(PostgreSQL 11.7或更高版本此处并按照安装说明进行操作。 在PostgreSQL安装期间系统将提示您输入超级用户(postgres)密码。 我们将其设置为”postgres”。 创建ThingsBoard数据库安装后启动”pgAdmin”软件并以超级用户(postgres)身份登录。 打开服务器并使用所有者”postgres”创建数据库”thingsboard”。 TimescaleDB安装请参考CentOS发行版的官方TimescaleDB安装页面并按照说明进行操作已安装PostgreSQL版本。 ThingsBoard配置以管理员用户身份打开记事本或其他编辑器(右键单击应用程序图标,然后选择“以管理员身份运行”)。 打开以下文件进行编辑(在文件选择对话框中选择“所有文件”而不是“文本文档”编码为UTF-8):
并找到”# SQL DAO Configuration”代码块填写真实postgres用户密码替换”postgres”:
找到”DATABASE_TS_TYPE”参数将”sql”替换为”timescale”。
您可以选择调整引用Timescale DB配置的参数”sql”配置块中的”timescale”配置块。
|
选择下面消息中间件代理服务之前的通信。
内存 默认队列适用于开发环境很有用请勿用于生产环境。
Kafka 对于本地和私有云部署可以独立于云服务供应商生产环境中使用。
RabbitMQ 如果没有太多负载并且已经具备一定的使用经验建议使用此方式。
AWS SQS 如是你打算在AWS上使用ThingsBoard则可以使用此消息队列。
Google发布/订阅 如果你打算在Google Cloud上部署ThingsBoard则可以使用此消息队列。
Azure服务总线 如果你打算在Azure上部署ThingsBoard则可以使用此消息队列。
Confluent云 基于Kafka的完全托管的事件流平台。
默认使用内置的内存队列无需其他配置。 |
KafkaApache Kafka是一个开放源代码的流处理软件平台。 安装Kafka使用此说明在Docker容器中安装Kafka。 ThingsBoard配置以管理员用户身份打开记事本或其他编辑器(右键单击应用程序图标然后选择“以管理员身份运行”)。 打开以下文件进行编辑(在文件选择对话框中选择“所有文件”而不是“文本文档”编码为UTF-8):
并找到”queue”块确保type的值是kafka修改下面配置文件并将”localhost:9092”替换成真实的Kafka服务器地址:
|
AWS SQS配置首先需要创建一个AWS账户然后访问AWS SQS服务。 要使用AWS SQS服务您将需要使用此说明创建下一个凭证。
ThingsBoard配置以管理员用户身份打开记事本或其他编辑器(右键单击应用程序图标然后选择“以管理员身份运行”)。 打开以下文件进行编辑(在文件选择对话框中选择“所有文件”而不是“文本文档”编码为UTF-8):
并找到”queue”块确保type的值是aws-sqs修改配置文件将”YOUR_KEY”和”YOUR_SECRET”替换为真实的AWS用户凭证并将”YOUR_REGION”替换成AWS SQS帐户区域:
These params affect the number of requests per second from each partitions per each queue. Number of requests to particular Message Queue calculated based on the formula: ((Number of Rule Engine and Core Queues) * (Number of partitions per Queue) + (Number of transport queues) + (Number of microservices) + (Number of JS executors)) * 1000 / POLL_INTERVAL_MS For example, number of requests based on default parameters is: Rule Engine queues: Main 10 partitions + HighPriority 10 partitions + SequentialByOriginator 10 partitions = 30 Core queue 10 partitions Transport request Queue + response Queue = 2 Rule Engine Transport notifications Queue + Core Transport notifications Queue = 2 Total = 44 Number of requests per second = 44 * 1000 / 25 = 1760 requests Based on the use case, you can compromise latency and decrease number of partitions/requests to the queue, if the message load is low. Sample parameters to fit into 10 requests per second on a “monolith” deployment:
|
Google发布/订阅配置创建一个Google云帐户并访问发布/订阅服务。 使用此说明创建一个项目并使用发布/订阅服务。 使用此说明创建服务帐户凭据并编辑角色或管理员后保存json凭据步骤9的文件此处。 ThingsBoard配置以管理员用户身份打开记事本或其他编辑器(右键单击应用程序图标然后选择“以管理员身份运行”)。 打开以下文件进行编辑(在文件选择对话框中选择“所有文件”而不是“文本文档”编码为UTF-8):
并找到”queue”块确保type的值是pubsub修改下面配置内容使用真正用户密码替换”YOUR_PROJECT_ID”, “YOUR_SERVICE_ACCOUNT”:
These params affect the number of requests per second from each partitions per each queue. Number of requests to particular Message Queue calculated based on the formula: ((Number of Rule Engine and Core Queues) * (Number of partitions per Queue) + (Number of transport queues) + (Number of microservices) + (Number of JS executors)) * 1000 / POLL_INTERVAL_MS For example, number of requests based on default parameters is: Rule Engine queues: Main 10 partitions + HighPriority 10 partitions + SequentialByOriginator 10 partitions = 30 Core queue 10 partitions Transport request Queue + response Queue = 2 Rule Engine Transport notifications Queue + Core Transport notifications Queue = 2 Total = 44 Number of requests per second = 44 * 1000 / 25 = 1760 requests Based on the use case, you can compromise latency and decrease number of partitions/requests to the queue, if the message load is low. Sample parameters to fit into 10 requests per second on a “monolith” deployment:
|
Azure服务总线配置创建一个Azure帐户并访问Azure服务总线。 通过使用说明了解并使用总线服务。 使用说明创建共享访问签名。 ThingsBoard配置以管理员用户身份打开记事本或其他编辑器(右键单击应用程序图标然后选择“以管理员身份运行”)。 打开以下文件进行编辑(在文件选择对话框中选择“所有文件”而不是“文本文档”编码为UTF-8):
并找到”queue”块确保type的值是service-bus修改下面配置内容使用真正的服务总线名称空间替换”YOUR_NAMESPACE_NAME”和”YOUR_SAS_KEY_NAME”及”YOUR_SAS_KEY”:
These params affect the number of requests per second from each partitions per each queue. Number of requests to particular Message Queue calculated based on the formula: ((Number of Rule Engine and Core Queues) * (Number of partitions per Queue) + (Number of transport queues) + (Number of microservices) + (Number of JS executors)) * 1000 / POLL_INTERVAL_MS For example, number of requests based on default parameters is: Rule Engine queues: Main 10 partitions + HighPriority 10 partitions + SequentialByOriginator 10 partitions = 30 Core queue 10 partitions Transport request Queue + response Queue = 2 Rule Engine Transport notifications Queue + Core Transport notifications Queue = 2 Total = 44 Number of requests per second = 44 * 1000 / 25 = 1760 requests Based on the use case, you can compromise latency and decrease number of partitions/requests to the queue, if the message load is low. Sample parameters to fit into 10 requests per second on a “monolith” deployment:
|
RabbitMQ安装请使用此说明安装RabbitMQ。 ThingsBoard配置以管理员用户身份打开记事本或其他编辑器(右键单击应用程序图标然后选择“以管理员身份运行”)。 打开以下文件进行编辑(在文件选择对话框中选择“所有文件”而不是“文本文档”编码为UTF-8):
并找到”queue”块确保type的值是rabbitmq修改下面配置内容使用真正的用户凭据替换”YOUR_USERNAME”和”YOUR_PASSWORD”以及”localhost”、”5672”:
|
Confluent云配置你应该创建一个帐户后访问Confluent云然后创建一个Kafka集群和 API Key。 ThingsBoard配置以管理员用户身份打开记事本或其他编辑器(右键单击应用程序图标然后选择“以管理员身份运行”)。 打开以下文件进行编辑(在文件选择对话框中选择“所有文件”而不是“文本文档”编码为UTF-8):
并找到”queue”代码块确保队列类型为”kafka”和factor的值是”3”并且使用confluent云为”true”。 用真正的Confluent云服务器替换”CLUSTER_API_KEY”, “CLUSTER_API_SECRET”和”localhost:9092”:
这些参数应用于每个队列每个分区每秒的请求数。 根据以下公式计算的对特定Message Queue的请求数: ((规则引擎和核心队数) * (队列分区数) + (传输队列数) + (微服务数) + (JS执行器数)) * 1000 / POLL_INTERVAL_MS 例如:基于默认参数的请求数为: 规则引擎队列: 10分区+高优先级10分区+SequentialByOriginator10分区 =30 核心队列10分区 传输请求队列+响应队列=2 规则引擎传输通知队列+核心传输通知队列=2 总计=44 每秒请求数=44*1000/25=1760请求 根据用例如果消息负载较低则可以降低延迟并减少对队列的分区/请求数。 在“整体”部署中每秒可满足10个请求的示例参数:
|
以管理员用户身份打开记事本或其他编辑器(右键单击应用程序图标,然后选择“以管理员身份运行”)。
打开以下文件进行编辑(在文件选择对话框中选择“所有文件”而不是“文本文档”,编码为UTF-8):
C:\Program Files (x86)\thingsboard\thingsboard.xml
在配置文件中找到以下几行。
<startargument>-Xms512m</startargument>
<startargument>-Xmx1024m</startargument>
并将它们更改为
<startargument>-Xms256m</startargument>
<startargument>-Xmx256m</startargument>
Launch windows shell (Command Prompt) as Administrator. Change directory to your ThingsBoard installation directory.
Execute install.bat script to install ThingsBoard as a Windows service (or run “install.bat –loadDemo” to install and add demo data). This means it will be automatically started on system startup. Similar, uninstall.bat will remove ThingsBoard from Windows services. The output should be similar to this one:
C:\Program Files (x86)\thingsboard>install.bat --loadDemo
Detecting Java version installed.
CurrentVersion 18
Java 1.8 found!
Installing thingsboard ...
...
ThingsBoard installed successfully!
现在开始启动ThingsBoard服务!
以管理员身份打开命令提示符并执行以下命令:
net start thingsboard
执行输出结果:
The ThingsBoard Server Application service is starting.
The ThingsBoard Server Application service was started successfully.
您可以执行以下命令重新启动ThingsBoard服务:
net stop thingsboard
net start thingsboard
启动后您将可以使用以下链接打开Web UI:
http://localhost:8080/
如果在安装脚本的执行过程中指定了-loadDemo则可以使用以下默认凭据:
您始终可以在帐户详情页面中更改每个帐户的密码。
Download and extract the installation package.
https://dist.thingsboard.io/tb-web-report-windows-3.1.1pe.zip
Note: We assume you have extracted ThingsBoard Web Report Server to default location: C:\Program Files (x86)\tb-web-report
Launch windows shell (Command Prompt) as Administrator. Change directory to your ThingsBoard installation directory.
Execute install.bat script to install ThingsBoard Web Report Server as a Windows service. This means it will be automatically started on system startup. Similar, uninstall.bat will remove ThingsBoard from Windows services. The output should be like:
C:\Program Files (x86)\tb-web-report>install.bat
Installing tb-web-report ...
tb-web-report installed successfully!
Now let’s start the ThingsBoard service! Open the command prompt as an Administrator and execute the following command:
net start tb-web-report
Expected output:
C:\Program Files (x86)\tb-web-report>net start tb-web-report
The Thingsboard Web Report Microservice service is starting.
The Thingsboard Web Report Microservice service was started successfully.
The log files are located in logs folder (“C:\Program Files (x86)\thingsboard\logs” in our case).
The thingsboard.log file should contain following line:
YYYY-MM-DD HH:mm:ss,sss [main] INFO o.t.s.ThingsboardServerApplication - Started ThingsboardServerApplication in x.xxx seconds (JVM running for x.xxx)
In case of any unclear errors, use general troubleshooting guide or contact us.
In order to have external access to ThingsBoard Web UI and device connectivity (HTTP, MQTT, CoAP) you need to create a new inbound rule with Windows Firewall with Advanced Security.
入门指南 - 这些指南提供了ThingsBoard主要功能的快速概述。
设备连接 - 了解如何根据您的连接方式或解决方案连接设备。
数据看板 - 这些指南包含有关如何配置复杂的ThingsBoard仪表板的说明。
数据处理 - 了解如何使用ThingsBoard规则引擎。
数据分析 - 了解如何使用规则引擎执行基本的分析任务。
硬件样品 - 了解如何将各种硬件平台连接到ThingsBoard。
高级功能 - 了解高级ThingsBoard功能。
开发指南 - 了解ThingsBoard中的贡献和开发。