boxfuse 开发数据库未正确配置
boxfuse dev db not provisioned correctly
我刚开始使用 boxfuse,似乎无法找到配置我的开发数据库的方法。
在我的 boxfuse.yml 我有(对于数据库部分):
database:
# the name of your JDBC driver
driverClass: com.mysql.jdbc.Driver
# the username
user: root
# the password
password: <password>
# the JDBC URL
url: jdbc:mysql://10.0.0.84:3306/dmsdb
# any properties specific to your JDBC driver:
properties:
charSet: UTF-8
hibernate.dialect: org.hibernate.dialect.MySQLInnoDBDialect
# the maximum amount of time to wait on an empty pool before throwing an exception
maxWaitForConnection: 1s
# the SQL query to run when validating a connection's liveness
validationQuery: "/* MyApplication Health Check */ SELECT 1"
# the minimum number of connections to keep open
minSize: 8
# the maximum number of connections to keep open
maxSize: 32
# whether or not idle connections should be validated
checkConnectionWhileIdle: false
如果我尝试 运行ning 它 (boxfuse 运行),我的应用程序根本无法运行。
boxfuse 信息生成以下内容:
oxfuse 客户端 v.1.18.7.938
版权所有 2016 Boxfuse GmbH。保留所有权利。
账户:mlr11 (mlr11)
关于 mlr11/dms-service 在开发环境中的信息:
App Type : Single Instance with Zero Downtime updates
App URL : http://127.0.0.1:8082
DB Type : MySQL database
DB URL : jdbc:mysql://localhost:3306/boxfuse-dev-db
DB Host : localhost
DB Port : 3306
DB Database : boxfuse-dev-db
DB User : boxfuse-dev-db
DB Password : boxfuse-dev-db
DB Status : available
这与我的预期大相径庭。 URL、数据库、用户、密码)与我的 boxfuse.yml 文件不匹配。
我错过了什么。我知道这一定很简单。我进行了各种搜索并阅读了几次文档。我似乎找不到问题所在。任何指针将不胜感激。
根据您 post 的配置文件,我假设这是一个 dropwizard 应用程序。
由于您的 Boxfuse 应用程序配置为使用 MySQL 数据库,因此当您首次在每个环境中部署应用程序时,Boxfuse 会自动在每个环境中配置一个数据库。在你的情况下,你可以在你的问题 post 的输出中看到开发环境中该数据库的连接信息。
Boxfuse 将这些值(db url、用户、密码...)公开为环境变量(https://cloudcaptain.sh/docs/databases#envvars)并自动配置您的框架(我假设是 Dropwizard)以使用这些值而不是配置文件中包含的那些。它将通过将 -Ddw.database.url=$BOXFUSE_DATABASE_URL -Ddw.database.user=$BOXFUSE_DATABASE_USER -Ddw.database.password=$BOXFUSE_DATABASE_PASSWORD
作为参数传递给 JVM 来实现。
还要在 VirtualBox GUI 中仔细检查您的 VirtualBox 安装是否功能齐全并且能够启动 VM,并且 Boxfuse Dev VM 和您的应用程序实例都已正确启动。
我刚开始使用 boxfuse,似乎无法找到配置我的开发数据库的方法。
在我的 boxfuse.yml 我有(对于数据库部分):
database:
# the name of your JDBC driver
driverClass: com.mysql.jdbc.Driver
# the username
user: root
# the password
password: <password>
# the JDBC URL
url: jdbc:mysql://10.0.0.84:3306/dmsdb
# any properties specific to your JDBC driver:
properties:
charSet: UTF-8
hibernate.dialect: org.hibernate.dialect.MySQLInnoDBDialect
# the maximum amount of time to wait on an empty pool before throwing an exception
maxWaitForConnection: 1s
# the SQL query to run when validating a connection's liveness
validationQuery: "/* MyApplication Health Check */ SELECT 1"
# the minimum number of connections to keep open
minSize: 8
# the maximum number of connections to keep open
maxSize: 32
# whether or not idle connections should be validated
checkConnectionWhileIdle: false
如果我尝试 运行ning 它 (boxfuse 运行),我的应用程序根本无法运行。
boxfuse 信息生成以下内容:
oxfuse 客户端 v.1.18.7.938 版权所有 2016 Boxfuse GmbH。保留所有权利。
账户:mlr11 (mlr11)
关于 mlr11/dms-service 在开发环境中的信息:
App Type : Single Instance with Zero Downtime updates
App URL : http://127.0.0.1:8082
DB Type : MySQL database
DB URL : jdbc:mysql://localhost:3306/boxfuse-dev-db
DB Host : localhost
DB Port : 3306
DB Database : boxfuse-dev-db
DB User : boxfuse-dev-db
DB Password : boxfuse-dev-db
DB Status : available
这与我的预期大相径庭。 URL、数据库、用户、密码)与我的 boxfuse.yml 文件不匹配。
我错过了什么。我知道这一定很简单。我进行了各种搜索并阅读了几次文档。我似乎找不到问题所在。任何指针将不胜感激。
根据您 post 的配置文件,我假设这是一个 dropwizard 应用程序。
由于您的 Boxfuse 应用程序配置为使用 MySQL 数据库,因此当您首次在每个环境中部署应用程序时,Boxfuse 会自动在每个环境中配置一个数据库。在你的情况下,你可以在你的问题 post 的输出中看到开发环境中该数据库的连接信息。
Boxfuse 将这些值(db url、用户、密码...)公开为环境变量(https://cloudcaptain.sh/docs/databases#envvars)并自动配置您的框架(我假设是 Dropwizard)以使用这些值而不是配置文件中包含的那些。它将通过将 -Ddw.database.url=$BOXFUSE_DATABASE_URL -Ddw.database.user=$BOXFUSE_DATABASE_USER -Ddw.database.password=$BOXFUSE_DATABASE_PASSWORD
作为参数传递给 JVM 来实现。
还要在 VirtualBox GUI 中仔细检查您的 VirtualBox 安装是否功能齐全并且能够启动 VM,并且 Boxfuse Dev VM 和您的应用程序实例都已正确启动。