Cloudbooklet
  • News
  • Artificial Intelligence
  • Applications
  • Linux
No Result
View All Result
Cloudbooklet
  • News
  • Artificial Intelligence
  • Applications
  • Linux
No Result
View All Result
Cloudbooklet
No Result
View All Result
Home Google Cloud

Install Metabase on Google Cloud with Docker – App Engine

by Cloudbooklet
4 years ago
in Google Cloud, App Engine
Install Metabase On Google Cloud With Docker App Engine
ShareTweetSendShare
Readers like you help support Cloudbooklet. When you make a purchase using links on our site, we may earn an affiliate commission.

Install Metabase on Google Cloud with Docker on Google App Engine. In this tutorial you are going to learn how to install Metabase and connect it with Cloud SQL with CloudSQL proxy. This guide demonstrates how to install Java using Docker in App Engine Flexible Environment with app.yaml and Dockerfile which is easily scalable. Prerequisites […]

ADVERTISEMENT

Install Metabase on Google Cloud with Docker on Google App Engine. In this tutorial you are going to learn how to install Metabase and connect it with Cloud SQL with CloudSQL proxy.

This guide demonstrates how to install Java using Docker in App Engine Flexible Environment with app.yaml and Dockerfile which is easily scalable.

Prerequisites

  1. Google Cloud account with billing activated.
  2. Cloud SQL setup as described here Cloud SQL Second Generation Instance.
  3. Enable Cloud SQL and Cloud SQL Admin API.
  4. Install GCloud SDK in your local computer.

Enable APIs and Create New Service account

Go to APIs and Services and click Enable APIs and Services and enable Cloud SQL API and Cloud SQL Admin API

ADVERTISEMENT

Go to IAM & Admin >> Service accounts and click Create service account.

You might also like

How To Setup Ssh Keys On Ubuntu

How to Setup SSH Keys on Ubuntu 20.04

4 months ago
Draggan Ai Editing Tool Install And Use Draggan Photo Editor

DragGAN AI Editing Tool Install and Use DragGAN Photo Editor

4 months ago

In step 1

Enter Service account Name.

ADVERTISEMENT

Click Create.

In step 2

ADVERTISEMENT

Select Role.

Cloud SQL >> Cloud SQL Admin
Project >> Editor

Click Continue.

ADVERTISEMENT

In step 3

Click Create Key.

ADVERTISEMENT

Choose Key type as JSON

Click Create.

Create Cloud SQL Instance

Follow this tutorial to create a new Cloud SQL Second Generation Instance.

Once you have created a user and a database you can proceed to set up the yaml file and Docker file in the local computer.

Setup Cloud SDK

Once you have installed the cloud SDK, run the below command to configure it and choose the project to deploy the Metabase.

Open command prompt or terminal in your local computer and run the following the command.

gcloud init

Follow the onscreen instructions to configure it.

Create Yaml File for Metabase

Create a new directory in your computer named metabase

Open your favorite editor and create a file named app.yaml inside the metabase directory.

Copy the below code and add this in your app.yaml file.

runtime: custom
env: flex

manual_scaling:
   instances: 1

env_variables:
   MB_DB_TYPE: mysql
   MB_DB_DBNAME: cloudsql_db_name
   MB_DB_USER: cloudsql_user_name
   MB_DB_PASS: cloudsql_password
   MB_DB_HOST: 127.0.0.1

beta_settings:
   cloud_sql_instances: cloudsql_connection_name

Replace the cloudsql_db_name, cloudsql_user_name, cloudsql_password, and cloudsql_connection_name with the values of your Cloud SQL instance.

Save your file.

Create Dockerfile for Metabase

Create a new file in the same metabase directory and name it as Dockerfile

Copy the below code and add this in your Dockerfile file.

FROM gcr.io/google-appengine/openjdk

EXPOSE 8080

ENV PORT 8080
ENV MB_PORT 8080
ENV MB_JETTY_PORT 8080
ENV MB_DB_PORT 5432
ENV METABASE_SQL_INSTANCE cloudsql_connection_name
ENV JAVA_OPTS "-XX:+IgnoreUnrecognizedVMOptions -Dfile.encoding=UTF-8 --add-opens=java.base/java.net=ALL-UNNAMED --add-modules=java.xml.bind"

ADD https://dl.google.com/cloudsql/cloud_sql_proxy.linux.amd64 ./cloud_sql_proxy
ADD http://downloads.metabase.com/v0.32.9/metabase.jar ./metabase.jar

RUN chmod +x ./cloud_sql_proxy

CMD ./cloud_sql_proxy -instances=$METABASE_SQL_INSTANCE=tcp:$MB_DB_PORT & java -jar ./metabase.jar

Replace the cloudsql_connection_name with your Cloud SQL instance connection name.

Save the file.

Deploy Metabase to App Engine

Open terminal in the metabase directory.

Run the following command to deploy Metabase to App Engine.

gcloud app deploy

Now, Metabase will be installed on Google App Engine and connected with Cloud SQL.

Once the deployment is completed you will get the url to view your application on the browser.

Install Metabase On Google Cloud With Docker - App Engine

Conclusion

Now you have learned how to deploy Metabase on Google App Engine Flexible environment.

Tags: DockerGoogle Cloud Platform
Share2Tweet1SendShare
Cloudbooklet

Cloudbooklet

Comments 8

  1. Avatar Of Dan Dan says:
    3 years ago

    Installed it all correctly some time ago but I’m not that familiar with GCP and not sure how to update to the latest version of metabase.

    Reply
  2. Avatar Of Akira Akira says:
    4 years ago

    I’m having trouble with 502 Bad Gateway
    nginx

    Reply
    • Avatar Of Pedro Pedro says:
      4 years ago

      Me too, you fixed this problem?

      Reply
      • Avatar Of Alex Alex says:
        3 years ago

        Same Here, nothing seems to work

        Reply
    • Avatar Of Meeps meeps says:
      3 years ago

      This sounds like the App Engine service is not being properly hosted, perhaps you didn’t expose port 8080 in the dockerfile, or you didn’t include it as an ENV variable in the app.yaml like so (the author didn’t include this bit, not sure why, but it seems essential):

      env_variables:
      MB_DB_DBNAME: ‘metabase’
      MB_DB_TYPE: ”
      MB_DB_HOST: ‘172.17.0.1’
      MB_DB_PORT: ‘3306’ or ‘5432’
      MB_DB_USER: ‘metabase’
      MB_DB_PASS: ‘metabase’
      MB_JETTY_PORT: ‘8080’

      Reply
      • Avatar Of Alex Alex says:
        3 years ago

        Done, but still I got the 502 message, I’m installing the latest version of Metabase, using Postgres.

        Reply
  3. Avatar Of Rafael Rafael says:
    4 years ago

    hi thank you for this post,

    I am getting this error, is there something that I might have not set?

    ERROR metabase.core :: Metabase Initialization FAILED
    java.lang.Exception: Connection to 127.0.0.1:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.

    Reply
    • Avatar Of Meeps meeps says:
      3 years ago

      This is simply that App Engine was unable to connect metabase to the backend db. You’ve ensured the app engine service account has Cloud SQL Client or Admin role? And that there is a db in your sql instance named metabase, with the matching user and password combination?

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Related Posts

Set Up Deep Learning With Nvidia, Cuda, Cudnn On Ubuntu

How to Set Up Deep Learning with Nvidia, CUDA, cuDNN on Ubuntu 22.04

7 months ago
How To Install Or Upgrade Php 8.2 On Ubuntu 22.04

How to Install or Upgrade PHP 8.2 on Ubuntu 22.04

9 months ago
How To Change Timezone On Ubuntu 22.04

How to Change Timezone on Ubuntu 22.04

1 year ago
How To Install Ansible On Ubuntu 22.04

How to Install Ansible on Ubuntu 22.04

1 year ago

Follow Us

Trending Articles

Block Youtube Ads

How to Block YouTube Ads on Android TV in 2023 (6 Easy Methods)

September 20, 2023

How to Delete Netflix Account Permanently

AI Statistics and Trends: What You Need to Know in 2023

Amazon Prime Big Deal Days 2023: Best Deals

How to Create and Customize Stunning Contact Poster on iPhone

10 Best Minecraft Server Hosting Providers in 2023

Popular Articles

Google Dark Web Report

Google Dark Web Report: Protect Your Personal Information

September 14, 2023

10 Best AI Video Generator Free of 2023

Microsoft Designer: AI Design Tool Now Available in Edge

How to Upscale Image with Stable Diffusion Models

10 Best Email Autoresponder Tool for Lead Generation

Ideogram AI Art Generator: The Ultimate Tool for Generating Amazing Artworks

Subscribe Now

loader

Subscribe to our mailing list to receives daily updates!

Email Address*

Name

Cloudbooklet Logo

Welcome to our technology blog, where we explore the latest advancements in the field of artificial intelligence (AI) and how they are revolutionizing cloud computing. In this blog, we dive into the powerful capabilities of cloud platforms like Google Cloud Platform (GCP), Amazon Web Services (AWS), and Microsoft Azure, and how they are accelerating the adoption and deployment of AI solutions across various industries. Join us on this exciting journey as we explore the endless possibilities of AI and cloud computing.

  • About
  • Contact
  • Disclaimer
  • Privacy Policy

Cloudbooklet © 2023 All rights reserved.

No Result
View All Result
  • News
  • Artificial Intelligence
  • Applications
  • Linux

Cloudbooklet © 2023 All rights reserved.