Run Metabase without using JAR

#1

Hi everyone.

Has anyone tried or successfully got Metabase running without the use of the JAR?

Having it all packaged in the JAR is fine for ease of install but for a production deployment we’d like to try and run it natively with our own web servers instead of the error prone and not particularly scalable Jetty web server. As far as I can tell Metabase is basically a Nodejs backend with a javascript frontend - so this should be doable - right?

We’re also seeing a lot of the dreaded “can’t allocate thread” errors and other crashes with no error output and I think a lot of these may be in part due to the Jetty service. But running it without Jetty would probably be much easier to then diagnose other potential sources of issues.

Thanks in advance.

Jonathan

#2

Hi, anyone got any ideas about this? We’d like to run metabase on our own infra running our own services and don’t need/want to use jetty etc. How can we run metabase itself without all the other pieces? Or how can we separate out the pieces and pick and choose what services to provision for each bit.

Thanks,
Rob

#3

The Metabase frontend is a React webapp, but it gets all data through the API of the backend written in the Clojure language running on the JVM. So entirely getting rid of the JVM isn’t feasible, at least not until all Java libraries you need involved in Metabase can run on GraalVM - e.g. there still seems to be work to be done to connect to Postgres via JDBC on GraalVM: https://github.com/pgjdbc/pgjdbc/issues/1189

You can of course rip the backend apart and replace pieces in there with something else, but my hunch is it will quickly become a bit of coding effort over “just configuration”.

If it’s about a dislike for/dissatisfaction with Jetty I guess the place for you to start is to look into how the Clojure backend web API is built with compojure, on top of ring as you can gather from project.clj below:

It appears from the ring wiki pages https://github.com/ring-clojure/ring/wiki/Setup-for-production you can plug in different JVM based web servers or servlets.

Curious as to:

  • what exactly you want to achieve though?
  • why?
  • and how it goes if you step out on this journey?
1 Like