1

I'm just starting with boxfuse and can't seem to find a way to get my dev database to be provisioned.

In my boxfuse.yml I have (for the database section):

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

If I try running it (boxfuse run), my application doesn't work at all.

boxfuse info produces the following:

oxfuse client v.1.18.7.938 Copyright 2016 Boxfuse GmbH. All rights reserved.

Account: mlr11 (mlr11)

Info about mlr11/dms-service in the dev environment:

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

Which is very different than what I was expecting. URL, Database, User, Password) are not matching my boxfuse.yml file.

What I am missing. I know it must be something simple. I did all kind of search and read the doc a few times. I can't seem to find what's wrong. Any pointers will be appreciated.

mlr11
  • 77
  • 1
  • 6

1 Answers1

0

From the config file you posted I am assuming this is a dropwizard app.

Since your Boxfuse app was configured to use a MySQL database, Boxfuse automatically provisions a database in each environment when you first deploy your application there. In your case you can see the connection info for that database in the dev environment in the output you post in your question.

Boxfuse exposes these values (db url, user, password, ...) as environment variables (https://cloudcaptain.sh/docs/databases#envvars) and automatically configures your framework (Dropwizard I assume) to use those instead of the ones included in your config file. It will do so by passing -Ddw.database.url=$BOXFUSE_DATABASE_URL -Ddw.database.user=$BOXFUSE_DATABASE_USER -Ddw.database.password=$BOXFUSE_DATABASE_PASSWORD as arguments to the JVM.

Also doublecheck in the VirtualBox GUI that your VirtualBox installation is fully functional and able to start VMs and that both the Boxfuse Dev VM and the instance of your application are started properly.

Axel Fontaine
  • 34,542
  • 16
  • 106
  • 137
  • I have only 2 VMs listed and both are running. I have boxfuse-dev-hdd-2016.02.09_mlr11-dms-service and vb-5012d157. That's all I can see in Oracle VM VirtualBox Manager. I originally had issues with the VMs starting and had to enable VT-x for it to work. Do I need MySQL Server to be installed on the machine I am running boxfuse? It is currently not installed, MySQL currently runs on a different computer. – mlr11 Apr 14 '16 at 14:33
  • No. The Boxfuse Dev VM comes with MySQL pre-installed and fully configured. Does your application throw an exception? If so, please post it here. (You can get the logs using `boxfuse logs`). Also, which version of Dropwizard are you using? – Axel Fontaine Apr 14 '16 at 14:41
  • 1
    I am using dropwizard 0.9.1. I changed some permission in my database and I am now getting totally different messages. The ones I am getting now are promising ("! java.sql.SQLWarning: Table 'boxfuse-dev-db.addrstate' doesn't exist") and I know how to deal with them. Yesterday I was getting messages about connection related things. I am going to play with this a bit more. Now that I know there a new database. I'll create my tables and move my data there. – mlr11 Apr 14 '16 at 14:59
  • 1
    Thanks Axel. With the info I got from you and a simple change of privilege in the database, I was able to get the dev environment going. I'm having AWS issues now but I need to do my due diligence before I post any questions. – mlr11 Apr 16 '16 at 00:25