- Prerequisites
- Step 1. Pull ThingsBoard PE Image
- Step 2. Obtain the license key
- Step 3. Choose ThingsBoard queue service
- Step 4. Running
- Detaching, stop and start commands
- Upgrading
- Troubleshooting
- Next steps
This guide will help you to install and start ThingsBoard Professional Edition (PE) using Docker on Windows. This guide covers standalone ThingsBoard PE installation. If you are looking for a cluster installation instruction, please visit cluster setup page.
Prerequisites
Step 1. Pull ThingsBoard PE Image
1
docker pull thingsboard/tb-pe:3.5.1PE
Step 2. Obtain the license key
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.
Note: We will reference the license key you have obtained during this step as PUT_YOUR_LICENSE_SECRET_HERE later in this guide.
Step 3. Choose ThingsBoard queue service
ThingsBoard使用消息系统存储服务之间的通信,请正确选择队列?
-
内存 适用于开发环境(开发)
-
Kafka 适用于生产环境(集群)
-
RabbitMQ 适用生产环境(单体)
-
AWS SQS 适用生产环境(AWS公有云)
-
Google发布/订阅 适用生产环境(Google公有云)
-
Azure服务总线 适用生产环境(Azure公有云)
-
Confluent云 适用于生产环境(托管)
ThingsBoard默认使用内存队列服务无需额外设置。 创建docker compose文件:
Add the following line to the yml file. Don’t forget to replace “PUT_YOUR_LICENSE_SECRET_HERE” with your license secret obtained on the first step:
|
Apache Kafka是一个开源的流式数据处理平台。 创建docker compose文件:
Add the following line to the yml file. Don’t forget to replace “PUT_YOUR_LICENSE_SECRET_HERE” with your license secret obtained on the first step:
|
AWS SQS配置首先需要创建AWS账户然后访问AWS SQS服务。 使用此说明创建AWS SQS服务凭证。
创建docker compose文件:
添加配置将”YOUR_KEY”和”YOUR_SECRET”替换为真实的AWS用户凭证并将”YOUR_REGION”替换成AWS SQS帐户区域:and “PUT_YOUR_LICENSE_SECRET_HERE” with your license secret obtained on the first step:
可以使用UI更新默认规则引擎队列配置(轮询间隔和分区)有关ThingsBoard规则引擎队列的更多信息请参阅文档。 |
Google发布/订阅配置创建一个Google帐户并访问发布/订阅服务。 使用此说明创建一个项目并使用发布/订阅服务。 使用此说明创建服务帐户凭据并编辑角色或管理员后保存json凭据步骤9的文件此处。 创建docker compose文件:
添加下面配置内容使用真正用户密码替换“YOUR_PROJECT_ID”, “YOUR_SERVICE_ACCOUNT”:and “PUT_YOUR_LICENSE_SECRET_HERE” with your license secret obtained on the first step:
可以使用UI更新默认规则引擎队列配置(轮询间隔和分区)有关ThingsBoard规则引擎队列的更多信息请参阅文档。 |
Azure服务总线配置创建Azure帐户并访问Azure服务总线。 通过使用说明了解并使用总线服务。 使用说明创建共享访问签名。 创建docker compose文件:
添加下面配置内容使用真正的服务总线名称空间替换”YOUR_NAMESPACE_NAME”和”YOUR_SAS_KEY_NAME”及”YOUR_SAS_KEY”:and “PUT_YOUR_LICENSE_SECRET_HERE” with your license secret obtained on the first step:
可以使用UI更新默认规则引擎队列配置(轮询间隔和分区)有关ThingsBoard规则引擎队列的更多信息请参阅文档。 |
For installing RabbitMQ use this instruction. 创建docker compose文件:
Add the following line to the yml file. Don’t forget to replace “YOUR_USERNAME” and “YOUR_PASSWORD” with your real user credentials, “localhost” and “5672” with your real RabbitMQ host and port, and “PUT_YOUR_LICENSE_SECRET_HERE” with your license secret obtained on the first step:
|
Confluent配置你应该创建一个帐户后访问Confluent云然后创建一个Kafka集群和 API Key。 创建docker compose文件:
添加下面配置内容使用真正的Confluent云服务器地址替换”CLUSTER_API_KEY”, “CLUSTER_API_SECRET”和”localhost:9092”:
可以使用UI更新默认规则引擎队列配置(轮询间隔和分区)有关ThingsBoard规则引擎队列的更多信息请参阅文档。F |
Where:
8080:8080
- connect local port 8080 to exposed internal HTTP port 80801883:1883
- connect local port 1883 to exposed internal MQTT port 18837070:7070
- connect local port 7070 to exposed internal Edge RPC port 70705683-5688:5683-5688/udp
- connect local UDP ports 5683-5688 to exposed internal COAP and LwM2M portsmytbpe-data:/data
- mounts the volumemytb-data
to ThingsBoard data directorymytbpe-data-db:/var/lib/postgresql/data
- mounts the volumemytbpe-data-db
to Postgres data directory;mytb-logs:/var/log/thingsboard
- mounts the volumemytb-logs
to ThingsBoard logs directorymytbpe
- friendly local name of this machinerestart: always
- automatically start ThingsBoard in case of system reboot and restart in case of failure.image: thingsboard/tb-pe:3.5.1PE
- docker image.
Step 4. Running
Windows users should use docker managed volume for ThingsBoard DataBase.
Create docker volume (for ex. mytbpe-data
) before executing docker run command:
Open “Docker Quickstart Terminal”. Execute the following command to create docker volume:
1
2
3
docker volume create mytbpe-data
docker volume create mytbpe-data-db
docker volume create mytbpe-logs
在包含该文件的目录终端中执行以下命令启动此docker compos:docker-compose.yml
1
2
3
docker compose pull
docker compose up -d
docker compose logs -f mytbpe
In order to get access to necessary resources from external IP/Host on Windows machine, please execute the following commands:
1
2
3
4
5
6
7
8
9
10
set PATH=%PATH%;"C:\Program Files\Oracle\VirtualBox"
VBoxManage controlvm "default" natpf1 "tcp-port8080,tcp,,8080,,8080"
VBoxManage controlvm "default" natpf1 "tcp-port1883,tcp,,1883,,1883"
VBoxManage controlvm "default" natpf1 "tcp-port7070,tcp,,7070,,7070"
VBoxManage controlvm "default" natpf1 "udp-port5683,udp,,5683,,5683"
VBoxManage controlvm "default" natpf1 "udp-port5684,udp,,5684,,5684"
VBoxManage controlvm "default" natpf1 "udp-port5685,udp,,5685,,5685"
VBoxManage controlvm "default" natpf1 "udp-port5686,udp,,5686,,5686"
VBoxManage controlvm "default" natpf1 "udp-port5687,udp,,5687,,5687"
VBoxManage controlvm "default" natpf1 "udp-port5688,udp,,5688,,5688"
Where:
C:\Program Files\Oracle\VirtualBox
- path to your VirtualBox installation directory
After executing this command you can open http://{your-host-ip}:8080
in you browser (for ex. http://localhost:8080
). You should see ThingsBoard login page.
Use the following default credentials:
- System Administrator: sysadmin@thingsboard.org / sysadmin
- Tenant Administrator: tenant@thingsboard.org / tenant
- Customer User: customer@thingsboard.org / customer
可以在帐户详情页面中更改每个帐户的密码。
Detaching, stop and start commands
你可以使用Ctrl-p
Ctrl-q
与会话终端分离容器将继续在后台运行。
如果出现任何问题可以检查服务日志中的错误例如:要查看ThingsBoard容器日志。
请执行以下命令:
1
docker compose logs -f mytbpe
停止容器:
1
docker compose stop mytbpe
启动容器:
1
docker compose start mytbpe
Upgrading
In case when database upgrade is needed, execute the following commands:
1
2
3
$ docker compose stop tb-node
$ docker compose run mytbpe upgrade-tb.sh
$ docker compose start mytbpe
Troubleshooting
DNS issues
注意:如果你发现与DNS问题相关的错误,例如
1
127.0.1.1:53: cannot unmarshal DNS message
你可以配置系统以使用Google公用DNS服务
Next steps
-
入门指南 - 快速学习ThingsBoard相关功能。
-
连接设备 - 学习如何根据你的连接方式或解决方案连接设备。
-
可 视 化 - 学习如何配置复杂的ThingsBoard仪表板说明。
-
数据处理 - 学习如何使用ThingsBoard规则引擎。
-
数据分析 - 学习如何使用规则引擎执行基本的分析任务。
-
硬件样品 - 学习如何将各种硬件平台连接到ThingsBoard。
-
高级功能 - 学习高级ThingsBoard功能。
-
开发指南 - 学习ThingsBoard中的贡献和开发。