MetaBase UI Console(1)Run from Jar File

阅读更多
MetaBase UI Console(1)Run from Jar File

Metabase source codes are here
https://github.com/metabase/metabase

How to Build the Metabase Jar
Get the source code
> git clone https://github.com/metabase/metabase

Here is my Blog to install the ENV
http://sillycat.iteye.com/blog/2400566

> brew update
> brew search clojure
==> Formulae
clojure                                clojurescript

> brew install leiningen
> brew install clojurescript

Verify the installation
> lein repl
nREPL server started on port 63805 on host 127.0.0.1 - nrepl://127.0.0.1:63805
REPL-y 0.3.7, nREPL 0.2.12
Clojure 1.8.0
Java HotSpot(TM) 64-Bit Server VM 1.8.0_161-b12
    Docs: (doc function-name-here)
          (find-doc "part-of-name-here")
  Source: (source function-name-here)
Javadoc: (javadoc java-object-or-class-here)
    Exit: Control+D or (exit) or (quit)
Results: Stored in vars *1, *2, *3, an exception in *e
user=> (+ 1 2 3 4 5 6)
21

Set Up that on Eclipse
https://dev.clojure.org/display/doc/Getting+Started+with+Eclipse+and+Counterclockwise
Search this “Counterclockwise”, Install the PLUGIN

Try to run the build command on MAC
>bin/build

Exception:
Building translation resources failed, please install 'gettext', or build without translations by running './bin/build no-translations'.
Cannot find module 'underscore'

Solution:
> npm install

Check my ENV
> java -version
java version "1.8.0_161"

> node --version
v8.11.3

> brew install yarn
> yarn --version
1.12.3

Exception:

> error [email protected]: The engine "node" is incompatible with this module. Expected version ">=8.11.4". Got "8.11.3"

Solution:
Upgrade NODE
> wget https://nodejs.org/dist/v8.13.0/node-v8.13.0.tar.gz
> wget https://nodejs.org/dist/v9.9.0/node-v9.9.0.tar.gz

For example
> ./configure --prefix=/Users/hluo/tool/node-v8.13.0

Then make and make install the version 8.13.0, it works pretty well
I get met abase build here
Created /Users/hluo/install/metabase/target/uberjar/metabase-metabase-SNAPSHOT.jar
Created /Users/hluo/install/metabase/target/uberjar/metabase.jar

Try with nodeJS 9.9.0, It works well. All different versions of NODEJS are here https://nodejs.org/dist/

Copy the file  metabase-metabase-SNAPSHOT.jar

Create the directory
> mkdir ~/tool/metabase-master
> mv metabase-metabase-SNAPSHOT.jar ~/tool/metabase-master/metabase-metabase-2018-11-27.jar

Simple command to start metabase
> java -jar ./metabase-metabase-2018-11-27.jar

Exception:
Exception in thread "main" java.lang.NoClassDefFoundError: clojure/lang/Var
at metabase.core.(Unknown Source)
Caused by: java.lang.ClassNotFoundException: clojure.lang.Var
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

Solution:
Change to use the other JAR file
> cp metabase.jar ~/tool/metabase-master/metabase-metabase-2018-11-27.jar

Or we can directly download the JAR file from here http://downloads.metabase.com/v0.31.1/metabase.jar

More options for start the command
#H2
export MB_DB_TYPE=h2
export MB_DB_FILE=/path/to/my/h2.db

#mysql
export MB_DB_TYPE=mysql
export MB_DB_DBNAME=metabase
export MB_DB_PORT=3306
export MB_DB_USER=metabase
export MB_DB_PASS=xxxxxxx
export MB_DB_HOST=localhost

#general
export MB_JETTY_PORT=3000
export MB_JETTY_HOST=0.0.0.0
#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”

Start the metabase again
> java -jar -Xms2048M -Xmx2048M -XX:NewSize=512m -XX:MaxNewSize=1024m metabase-metabase-2018-11-27.jar


Then I can visit the UI console now
http://localhost:3000/setup

Change to use MySQL as Persistence Layer
https://www.jianshu.com/p/f6b5cf74f57d

How to Setup Metabase
https://www.metabase.com/docs/latest/setting-up-metabase.html

We can start 2 metabase and connect to 1 MySQL database in the backend.

References:
http://www.jianshu.com/p/f6b5cf74f57d
http://www.jianshu.com/p/2qimbD
https://github.com/metabase/metabase

Old blog
http://sillycat.iteye.com/blog/2400566
https://www.metabase.com/docs/latest/operations-guide/start.html#installing-and-running-metabase
https://github.com/metabase/metabase/blob/master/Dockerfile

你可能感兴趣的:(MetaBase UI Console(1)Run from Jar File)