Modify EBS for MySQL rather than Postgres?

The Elastic Beanstalk zip appears pre-configured to use Postgres from a few sample lines of error logs below, any way to use MySQL instead?

https://downloads.metabase.com/v0.34.2/metabase-aws-eb.zip


/var/log/eb-docker/containers/eb-current-app/eb-9becca33e021-stdouterr.log

at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:192)
at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
at org.postgresql.jdbc.PgConnection.(PgConnection.java:195)
at org.postgresql.Driver.makeConnection(Driver.java:458)
at org.postgresql.Driver.connect(Driver.java:260)

02-18 23:48:26 e[1mERROR metabase.coree[0m :: Metabase Initialization FAILED
java.lang.Exception: Protocol error. Session setup failed.

Caused by: org.postgresql.util.PSQLException: Protocol error. Session setup failed.

02-18 23:48:26 e[1mINFO metabase.coree[0m :: Metabase Shutting Down …
02-18 23:48:26 e[1mINFO metabase.servere[0m :: Shutting Down Embedded Jetty Webserver
02-18 23:48:26 e[1mINFO metabase.coree[0m :: Metabase Shutdown COMPLETE

Hi @mesquest
Haven’t we been through this before? Didn’t you get it working my doing manual modifications to the JSON?
https://github.com/metabase/metabase/issues/9021
Protocol error for Metabase Postgres installation on Elastic Beanstalk

@flamber, That’s what stumped me last time, if indeed the JSON is the where a selection of DB can be affected, it isn’t in the zip explicitly, only a handful of small files. Having looked thru their contents it’s not obvious to me what they’re all doing, is an image being pulled from somewhere, Docker, Github?

From the Configuring RDS for Metabase, “… Metabase also supports MySQL/Maria DB as backing databases…” it should be possible. But it’s not a simple matter of customizing the beanstalk environment such as with a dropdown, for example, as implied here in #9021. Choice of backing DB apparently takes the manipulation of code somewhere, but where, how, and does it take learning how to use Docker, Github, or some combination to do that?

There is also an after the fact migration option from Configuring RDS for Metabase that may or may not be possible or at least rather complicated in a beanstalk environment.

Attaching to an existing DB as discussed in Best practice for having RDS as part of EB environment may offer another avenue. Adding to the 01_metabase.config file is intriguing but Amazon’s decoupling method is just plain nuts!

Why does it have to be this hard to do a simple database selection? At some point this would be an excellent candidate for a one click, one dropdown type of solution, something accessible to everyone.

In the meantime, just point me in the right direction, how can MySQL be the backing database for a Metabase beanstalk environment?

@mesquest
I don’t use EBS, but do you know of any other project that has a dropdown setup for their EBS setup? That’s a good way to figure out how simple it would be.

I know there’s other obstacles than just the things you point out:
https://github.com/metabase/metabase/blob/master/bin/docker/run_metabase.sh#L11-L25

It feels like there would need to be a larger re-write to be able to do this correctly. And it doesn’t seem like a lot of people a wanting MySQL instead of Postgres on their RDS.

Perhaps instead of hardcoding Postgres as the only option write an “if-else if” type of syntax in the Metabase code to permit the Elastic Beanstalk configuration dropdowns to do the actual selection. Thanks @flamber for pointing out other potential code locations, this does feel like a bit of a re-write to do it properly. Why users haven’t brought this issue up much maybe comes down to how many are using EBS and how they’re applying it.

For the time being I’ll have to settle on a more manual method of extracting from Postgres to MySQL periodically. Another option may be running the Metabase jar file on an EC2 instance instead. That’s been mentioned if I recall, I’ll look into that as well.