Linux Commands

METABASE

1) Installing metabase as service on ubuntu 16.04

1. Download the metabase metabase.jar file from the link https://www.metabase.com/start/other.html
2. The most basic way of running Metabase is to open up a terminal and use Java to launch the application. This is the only command you’ll need:
java -jar metabase.jar

This will launch a Metabase server on port 3000 by default.

 

2) Metabase as Service:
1. Go to the path /etc/systemd/system
2. Create a file with the name metabase.service
3. Inside the file write below code:

[Unit]
Description=Metabase service
[Service]
User=root
# The configuration file application.properties should be here:
#change this to your workspace
WorkingDirectory=/var/www/html/chart
#path to executable: executable is a bash script which calls jar file
ExecStart=/var/www/html/chart/metabase
SuccessExitStatus=143
TimeoutStopSec=10
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target

4. Save the file by typing command wq!

5. The start the service using the below command:
service metabase start

6. Check the status of metabase service using the command below:
service metabase status

Metabase requires that you have Java 7 or higher available on your system. We have run Metabase with both the OpenJDK and Oracle JDK, so feel free to use either.

 

3) Metabase run from Mysql Run below commands:

export MB_DB_TYPE=mysql
export MB_DB_DBNAME=metabase
export MB_DB_PORT=3306
export MB_DB_USER=<username>
export MB_DB_PASS=<password>
export MB_DB_HOST=localhost

 

4) Running Metabase database migrations manually

When Metabase is starting up it will typically attempt to determine if any changes are required to the application database and it will execute those changes automatically. If for some reason you wanted to see what these changes are and run them manually on your database then we let you do that.

Simply set the following environment variable before launching Metabase:

export MB_DB_AUTOMIGRATE=false

 

5) Backing up Metabase Application Data

H2 Embedded Database (default)
If you launched Metabase on a laptop or PC the application will create an embedded H2 database in the directory it is being run in. Navigate to the directory where you started Metabase from and find the file named metabase.db.h2.db. Simply copy that file somewhere safe and you are all backed up!

NOTE: If your Metabase is currently running it’s best to shut down the Metabase process before making a backup copy of the file. Then, restart the application.

 

6) Running Metabase on another port
By default Metabase will launch on port 3000, but if you prefer to run the application on another port you can do so by setting the following environment variable:
export MB_JETTY_PORT=12345
java -jar metabase.jar

 

7)  Using HTTPS with Metabase
If you have an ssl certificate and would prefer to have Metabase run over HTTPS directly using its webserver you can do so by using the following environment variables:

export MB_JETTY_SSL=”true”
export MB_JETTY_SSL_Port=”8443″
export MB_JETTY_SSL_Keystore=”path/to/keystore.jks”
export MB_JETTY_SSL_Keystore_Password=”storepass”
java -jar metabase.jar

 

8) Changing Metabase password complexity
Metabase offers a couple controls for administrators who prefer to increase the password requirements on their user accounts.

export MB_PASSWORD_COMPLEXITY=strong
export MB_PASSWORD_LENGTH=10

The settings above can be used independently, so it’s fine to use only one or the other. By default Metabase use complexity = normal and a password length of 6. The following options are available for complexity choice:

weak = no character constraints
normal = at least 1 digit
strong = minimum 8 characters w/ 2 lowercase, 2 uppercase, 1 digit, and 1 special character

Leave a Reply

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