metabase
Have been trying to add my Google Cloud PostgreSQL database to metabase..
Installing Metabase
There are currently at least 2-3 different methods of installing mb. I downloaded the .jar
file.
Running it on my localhost, port 3000:
java -jar metabase.jar
The UI is so pretty! Create an account and log in!
Adding database
I ran into many issues:
- Because my db instance was configured with SSL on, sslmode=verify-ca, I needed 3
.pem
files to connect to the db - As a result, I kept getting authentication errors
Some of my workarounds I had was,
- Try to add the filepaths of the
.pem
files as additional JDBC connection string options [x] - Attempted to add the
.pem
files as a keystore [It was too complicated for my simple tiny brain] - Cri
So in the end, I found this site which thankfully pointed me in the right direction!
Google SQL Proxy
So the idea is that the cloud SQL Proxy would provide secure access to your db instances without having to whitelist IP or configure SSL!
Follow the instructions for sql or postgres.
After setting up, run in one terminal:
./cloud_sql_proxy -instances=<instance-name>=tcp:5432
Make sure you stop your own postgres server on your local machine (I'm using MacOS)
brew services stop postgres
Run in another terminal:
java -jar metabase.jar
When you add database, use localhost
for the hostname. Key in the username, password and all and the db will be added!!!
Metabase for Production
- Do the same thing on a separate VM
- Use a compute engine VM in the same project as the Google Cloud SQL instance
Ok back to work. hehe.
Did you know this was built with 11ty and tailwind? And works even with Javascript disabled? Yeah I don't care either.