首页 > 解决方案 > 使用 docker 从 1.3.1 升级到 2.0

问题描述

我正在使用 thingsboard 1.3.1 运行 docker 我想迁移到 2.0 但我无法让它工作。

我试图在容器内触发升级脚本。我得到了错误:

Connector configured to listen on port 8080 failed to start
ThingsBoard upgrade failed!

我试图在容器外运行脚本。我得到了错误:

Error creating bean with name 'thingsboardInstallService': Unsatisfied 
dependency expressed through field 'databaseSchemaService'; nested exception 
is org.springframework.beans.factory.UnsatisfiedDependencyException: Error 
creating bean with name 'sqlDatabaseSchemaService': Unsatisfied dependency 
expressed through field 'installScripts'; nested exception is 
org.springframework.beans.factory.UnsatisfiedDependencyException: Error 
creating bean with name 'installScripts': Unsatisfied dependency expressed 
through field 'ruleChainService'; nested exception is 
org.springframework.beans.factory.UnsatisfiedDependencyException: Error 
creating bean with name 'baseRuleChainService': Unsatisfied dependency 
expressed through field 'relationService'; nested exception is 
org.springframework.beans.factory.UnsatisfiedDependencyException: Error 
creating bean with name 'baseRelationService': Unsatisfied dependency 
expressed through field 'entityService'; nested exception is 
org.springframework.beans.factory.UnsatisfiedDependencyException: Error 
creating bean with name 'baseEntityService': Unsatisfied dependency expressed 
through field 'deviceService'; nested exception is 
org.springframework.beans.factory.UnsatisfiedDependencyException: Error 
creating bean with name 'deviceServiceImpl': Unsatisfied dependency expressed 
through field 'cacheManager'; nested exception is 
org.springframework.beans.factory.BeanCreationException: Error creating bean 
with name 'cacheManager' defined in class path resource [org/thingsboard
/server/dao/cache/CaffeineCacheConfiguration.class]: Invocation of init method 
failed; nested exception is java.lang.NullPointerException
ThingsBoard upgrade failed!

感谢帮助

标签: dockerthingsboard

解决方案


问题是 Thingsboard 数据库。替换 Docker 镜像不会更新数据库。所以我发现更新平台的唯一方法是:在 docker 容器外安装 Thingsboard 1.4.0 并使用“$ sudo /usr/share/thingsboard/bin/install/upgrade.sh --fromVersion=1.4 启动更新脚本.0"(Linux 示例)。这会更新 Thingsboard 的数据库。之后,可以简单地将 Docker 容器替换为预构建的 Thingsboard 2.0 映像。我找不到从容器内部更新数据库的方法。


推荐阅读