How to shutdown metabase gracefully

Greetings Forum Members,

I’m new to metabase and my question might seem very trivial, but how can I gracefully shutdown metabase ?
Whenever I reboot the server running metabase, I have to resort to running command ‘java -Dh2.bindAddress=localhost -jar metabase.jar’ which I found on one of the forums.

I would greatly appreciate your suggestion.

Thanks,
Rishi

1 Like

It seems like you’re asking about getting Metabase to automatically start? If so, it depends on what kind of system you’re running… I don’t think there’s any special procedure for stopping the service.

Really need to know how to shutdown. I just started using it and was playing with it, creating questions… dashboards. Very cool tool.

A couple hours later my PC crashed. An abrupt ungraceful shutdown of everything. :slight_smile:

When I relaunched windows, restarted MetaBase… half the things I had done were missing, indicating things aren’t getting stored to disk in real time when “saving”.

So how do I gracefully stop metabase so that it saves and closes up the database nicely?

As a test I just killed the task. When I restarted metabase it came up as a brand new install wanting to run me through the setup process. My play dashboards gone.

How do we gracefully close metabase?

What are you running this on?

Most of the core team regularly kill and restart servers all day and we never experience what you’re describing. It sounds like the process and/or filesystem permissions are off and the server isn’t able to write back to disk.

Hi,

I launch the jar file on a centos 7 and I have the same problem as yodaclan.
When I shutdown the application “Ctrl+C”, when I start the application I have to setup the application again : create my account and all of my dashboard and questions.
What is the name of the process ? In which files or directories should I grant him permissions ?
I’m sorry but I’m a newbie with linux …

Just running it on a plain Windows 10 box.

Just “kill” (not kill -9) the Java process.

Works without any issue for me.

thanks for your answers, I’ll try it
But what if we have to reboot the server and we can’t kill the java process gracefully ?
Will we lose that we’ve done since the last time that we killed the java process gracefully ?

1 Like

Hi, I'm an MB user, experiencing the same problem I believe.
Java 11 and MB v 0.40. H2 database and not running MB as a service. The command window in Windows 10 is where java+metabase lives. if I close that window or ctrl-c, the ...db.mv.db file gets reset to 19kb. every time. Additional complication is that cannot backup the db.mv.db file before closing the window since its locked. a real quandary here that the help desk should elaborate on in more detail.

I believe the solution, is to run mb as a service, where it can be stopped without wiping out the apps db.. this worked very nicely for me with Java8 using nssm.exe (a free download) as a tool to run an app as a service, but now using nssm with java 11 upgrade as needed to support mb 0.40+ doesn't work anymore. I was advised to migrate away from H2 to postgress, solite or maria db. That's where i am now. Forget postgres, its complex and heavy. now loading sqlite where ability to create the MB app file in a user specified folder and then migrateg the metabase apps database is simpler