docker - 使用 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!
感谢帮助
解决方案
问题是 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 映像。我找不到从容器内部更新数据库的方法。
推荐阅读
- github-actions - 如何在 github 操作中的作业之间共享 docker 图像
- android - 如何在android studio中放置原始颜色的图像?
- node.js - 反应:AWS Elastic Beanstalk 上的 502 Bad Gateway
- r - R Shiny SlickR 更改背景颜色
- java - 如何在 Java 中使用 DBCursor 获取数值?
- reactjs - 元数据库如何在本地主机上运行反应前端?
- python - 为什么以下代码中的 python 列表元素分配不起作用?
- maven - 是否可以在没有凭据的情况下从 maven-github 安装依赖项?
- angular - 如何根据日期选择器禁用 mat-select 的某些选项?
- vue.js - Vuex:无法正确初始化存储