ThingsBoard部署
平台:windows10,idea2022,postgres15
maven仓库
进入thingsboard源码下载目录:
主要执行以下两个命令:
mvn编译:
mvn clean install -Dmaven.test.skip=true
编译报错时:
清除java进程
taskkill /f /im java.exe
镜像
解决maven拉取仓库过慢
<mirror>
<id>nexus-public-snapshots</id>
<mirrorOf>public-snapshots</mirrorOf>
<url>http://maven.aliyun.com/nexus/content/repositories/snapshots/</url>
</mirror>
<mirror>
<id>nexus</id>
<name>internal nexus repository</name>
<url>https://repo.maven.apache.org/maven2</url>
<mirrorOf>central</mirrorOf>
</mirror>
<mirror>
<id>maven-central</id>
<name>central</name>
<url>https://repo1.maven.org/maven2/</url>
<mirrorOf>central</mirrorOf>
</mirror>
<mirror>
<id>uk</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://uk.maven.org/maven2/</url>
</mirror>
<mirror>
<id>CN</id>
<name>OSChina Central</name>
<url>http://maven.oschina.net/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
ssl
OpenSSL SSL_read: Connection was reset, errno 10054
git config --global http.sslVerify "false"
jekins
报错:3
拉取jenkins 测试包目录错误
源存储库已经更改位置 : org. thingsboard: dao: jar: tests:3. 1. 1 was not found in
解决
第一步:
1.注释dependencies D:\Work\Course\IOT\thingsboard-3.1.1\application\pom.xml
记得编译成功之后取消注释!
第二步:
2.更改仓库地址:Index of releases/ (jenkins-ci.org)
https://repo.jenkins-ci.org/artifactory/releases/
再次编译
报错4:
本地缓存缺少fetched-v10.15.3-linux-x64和fetched-v10.15.3-win-x64
download link
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.0:npm (npm install) on project js-executor: Failed to run task: ‘npm install’ failed. (error code 2) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume(重新开始) the build with the command
[ERROR] mvn -rf :js-executor
download link
https://github.com/vercel/pkg-fetch/releases/download/v2.6/uploaded-v2.6-node-v12.18.1-win-x64
https://github.com/vercel/pkg-fetch/releases/download/v2.6/uploaded-v2.6-node-v12.18.1-win-x64
步骤2: 将下载的两个文件放到:放到:C:\Users\你的用户名.pkg-cache\v2.6。并将名字分别修改为:fetched-v12.18.1-linux-x64和fetched-v12.18.1-win-x64
编译成功之后
撤销注释dependencies D:\Work\Course\IOT\thingsboard-3.1.1\application\pom.xml
安装postgres
去官网下载
https://www.postgresql.org/
下载地址:
https://www.enterprisedb.com/downloads/postgres-postgresql-downloads
保存安装:
安装教程:
win10安装postgresql以及简单配置
postgres
sql包更改位置
D:\Work\Course\IOT\thingsboard-3.1.1\dao\src\main\resources\sql
更改后的位置
D:\Work\Course\IOT\thingsboard-3.1.1\application\src\main\data\sql
原因:安装到本机数据库
运行thingsboard 启动类报错:
2.启动报错
Caused by: org.postgresql.util.PSQLException: 不支援 10 验证类型。请核对您已经组态 pg_hba.conf 文件包含客户端的IP位址或网路区段,以及驱动程序所支援的验证架构模式已被支援。
原因:
允许本机访问:
IPv4 local connections:
host all all 127.0.0.1/32 trust
找到postgres安装目录
D:your installed directory\PostgreSQL15\data
然后将下述代码粘贴到pg_hba.conf中
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust
修改:
idea 连接postgres
新建数据库 配置application.yml和初始化数据库
# SQL DAO Configuration
spring: data: jpa: repositories: enabled: "true"
jpa:
open-in-view: "false"
hibernate:
ddl-auto: "none"
database-platform: "${SPRING_JPA_DATABASE_PLATFORM:org.hibernate.dialect.Postg
datasource:
driverClassName: "${SPRING_DRIVER_CLASS_NAME:org.postgresql.Driver}"
url: "${SPRING_DATASOURCE_URL:jdbc:postgresql://localhost:5432/tb}"
username: "${SPRING_DATASOURCE_USERNAME:adg_user}"
password: "${SPRING_DATASOURCE_PASSWORD:adg123456}"
hikari:
maximumPoolSize: "${SPRING_DATASOURCE_MAXIMUM_POOL_SIZE:16}"
系统管理员:添加用户
激活租户链接
-
系统管理员: sysadmin@thingsboard.org / sysadmin
-
租户
your_email
username:
Bruce Lee
password:
123456
-
-
租户管理员: tenant@thingsboard.org / tenant
-
客户: customer@thingsboard.org / customer
img-JBHxbN9B-1727946731471)]
-
系统管理员: sysadmin@thingsboard.org / sysadmin
-
租户
your_email
username:
Bruce Lee
password:
123456
-
-
租户管理员: tenant@thingsboard.org / tenant
-
客户: customer@thingsboard.org / customer
postgres account password credentials