ubuntuupstartmetabase

Use Metabase on Ubuntu Service


I have tried to create an Ubuntu Upstart Service to Metabase, but I'm having trouble addressing the following points:

1) Set up database environment variables (port, ip and password):

MB_DB_TYPE=mysql
MB_DB_DBNAME=metabase
MB_DB_PORT=3306
MB_DB_USER=root
MB_DB_PASS=root
MB_DB_HOST=99.99.999.99

2) Restart service if it fails

3) Start on the boot

4) Execute metabase .jar program

`java -jar metabase.jar`

Solution

  • I recently wrote a tutorial about how to setup metabase on Ubuntu, for a more detailed description of the process I would recommend giving it a look. Given the information that you have provided, I will try my best to help you.

    Step One: Service Config Files

    There are two ways to set up a java application as a service; however, I will explore the one mentioned in metabase's documentation. For their recommended method you will need to setup two config files:

    1. /etc/init.d/metabase
    2. /etc/default/metabase

    You can set up these files based off of the metabase documentation provided. Note: I needed to make some changes to init.d so that the config variables were imported before the service executed java -jar, you can find more details in my blog above if you are interested.

    Step Two: Setup Proxy

    After that, you will need to set up a proxy so that the server knows how to redirect traffic to port 3000 so that metabase can be activated. (Again, directions on how to do this can be found in my blog.)

    Step Three: Setup Metabase as a Service

    chmod +x /etc/init.d/metabase
    touch /var/log/metabase
    chown metabase_user:<group> /var/log/metabase.log
    update-rc.d metabase defaults
    

    Note it is important for metabase to have access to write to the log file, or you will try to deploy blind.

    Additional Things I would check:

    1. Ensure that the port that you are using on 99.99.999.99:3306 is allowing the connection you are trying to do (http, https, or ssh).
    2. Ensure that www-data/metabase_user has access to execute the metabase.jar file. If not the service will not be able to start metabase when you sudo service metabase start

    I hope this helps, and if you would like more details about any step please checkout out: https://codymyers93.wordpress.com/2018/05/07/metabase-on-ubuntu-with-flask-integration/

    Feel free to message me with any questions.