Skip to content

World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.

[#842] feat(doc): Add how to install page (#1042)

Jerry Shao1f2601d8cbf8
diff --git a/docs/how-to-build.md b/docs/how-to-build.md
index c6406774c9..0dc86d294f 100644
--- a/docs/how-to-build.md
+++ b/docs/how-to-build.md
@@ -1,10 +1,9 @@
---
-title: "How to Build Gravitino"
-date: 2023-10-03T09:03:20-08:00
+title: How to build Gravitino
+slug: /how-to-build
license: "Copyright 2023 Datastrato Pvt Ltd.
This software is licensed under the Apache License version 2."
---
-## How to build Gravitino
## Prerequisites
@@ -13,8 +12,7 @@ This software is licensed under the Apache License version 2."
+ A Java Development Kit version 8 to 17 installed in your environment to launch Gradle
+ Optionally Docker to run integration tests
-Note:
-
+:::info Please read the following notes first
+ Gravitino requires at least JDK8 and at most JDK17 to run Gradle, so you need to
install JDK8 to 17 version to launch the build environment.
@@ -32,6 +30,7 @@ Note:
Alternatively, you can use OrbStack to replace Docker for macOS, please see
[OrbStack](https://orbstack.dev/), with OrbStack you can run Gravitino integration tests
without needing to install "docker-connector".
+:::
## Quick start
@@ -48,9 +47,12 @@ Note:
./gradlew build
```
- > Note: The first time you build the project, downloading the dependencies may take a while. You can add `-x test` to skip the test, like `./gradlew build -x test`.
+:::note
+The first time you build the project, downloading the dependencies may take a while. You can add
+`-x test` to skip the tests, by using `./gradlew build -x test`.
+:::
-3. Deploy the Gravitino project in your local environment.
+3. Get the Gravitino binary package.
```shell
./gradlew compileDistribution
@@ -60,49 +62,11 @@ Note:
The directory structure of the `distribution` directory is as follows:
- ```text
- ├── ...
- └── distribution/package
- ├── bin/gravitino.sh # Gravitino Server Launching scripts.
- ├── catalogs
- │ └── hive/ # Hive catalog dependencies and configurations.
- │ └── lakehouse-iceberg/ # Apache Iceberg catalog dependencies and configurations.
- ├── conf/ # All configuration for Gravitino.
- | ├── gravitino.conf # Gravitino Server configuration.
- | ├── gravitino-env.sh # Environment variables, etc., JAVA_HOME, GRAVITINO_HOME, and more.
- | └── log4j2.properties # log4j configuration for Gravitino Server.
- ├── libs/ # Gravitino Server dependencies libraries.
- └── logs/ # Gravitino Server logs. Automatically created after the Gravitino server starts.
- └── data/ # Default directory for Gravitino Server to store data.
- ```
-
- > Note: The `./gradlew clean` command deletes the `distribution` directory.
-
-4. Run Gravitino Server.
-
- ```shell
- distribution/package/bin/gravitino.sh start
- ```
-
- You can access the Gravitino Web UI by typing http://localhost:8090 in your browser
-
- > Note:
- >
- > If you need to debug the Gravitino server, enable the `GRAVITINO_DEBUG_OPTS` environment
- > variable in the `conf/gravitino-env.sh` file. Then you can create a `Remote JVM Debug`
- > configuration in `IntelliJ IDEA` and debug `gravitino.server.main`.
- >
- > Currently, Gravitino server can only run with JDK8 due to some dependencies. Please
- > make sure you have JDK8 installed and `JAVA_HOME` configured correctly. To check the Java
- > version, you can simply run `${JAVA_HOME}/bin/java -version` command.
-
-5. Stop Gravitino Server.
-
- ```shell
- distribution/package/bin/gravitino.sh stop
- ```
+:::note
+The `./gradlew clean` command deletes the `distribution` directory.
+:::
-6. Assemble the Gravitino distribution package.
+4. Assemble the Gravitino distribution package.
```shell
./gradlew assembleDistribution
@@ -112,9 +76,13 @@ Note:
You can deploy them to your production environment.
- > Note: The `gravitino-{version}-bin.tar.gz` file is the Gravitino Server distribution package, and the `gravitino-{version}-bin.tar.gz.sha256` file is the sha256 checksum file for the Gravitino Server distribution package.
+:::note
+The `gravitino-{version}-bin.tar.gz` file is the Gravitino server distribution package, and the
+`gravitino-{version}-bin.tar.gz.sha256` file is the sha256 checksum file for the Gravitino
+server distribution package.
+:::
-7. Assemble Gravitino Trino connector package
+5. Assemble Gravitino Trino connector package
```shell
./gradlew assembleTrinoConnector
diff --git a/docs/how-to-install.md b/docs/how-to-install.md
new file mode 100644
index 0000000000..41fb058049
--- /dev/null
+++ b/docs/how-to-install.md
@@ -0,0 +1,145 @@
+---
+title: How to install Gravitino
+slug: /how-to-install
+license: "Copyright 2023 Datastrato Pvt Ltd.
+This software is licensed under the Apache License version 2."
+---
+
+## Install Gravitino from scratch
+
+:::note
+Gravitino requires JDK8 to run, please make sure you have JDK8 installed and `JAVA_HOME`
+configured correctly. To confirm the Java version, you can simply run `${JAVA_HOME}/bin/java -version` command.
+:::
+
+### Get the Gravitino binary distribution package
+
+Before installing Gravitino, make sure you have Gravitino binary distribution package. You can
+download the latest Gravitino binary distribution Package from [GitHub](https://github.com/datastrato/gravitino/releases),
+or you can build it yourself by following the instructions in [How to Build Gravitino](./how-to-build).
+
+If you build Gravitino yourself by `./gradlew compileDistribution` command, you can find the
+Gravitino binary distribution package in `distribution/package` directory.
+
+If you build Gravitino yourself by `./gradlew assembleDistribution` command, you can get the
+compressed Gravitino binary distribution package with name `gravitino-<version>-bin.tar.gz` in
+`distribution` directory with sha256 checksum file `gravitino-<version>-bin.tar.gz.sha256`.
+
+The Gravitino binary distribution package contains the following files:
+
+```text
+|── ...
+└── distribution/package
+ |── bin/gravitino.sh # Gravitino server Launching scripts.
+ |── catalogs
+ | └── hive/ # Hive catalog dependencies and configurations.
+ | └── lakehouse-iceberg/ # Apache Iceberg catalog dependencies and configurations.
+ | └── jdbc-mysql/ # JDBC MySQL catalog dependencies and configurations.
+ | └── jdbc-postgresql/ # JDBC PostgreSQL catalog dependencies and configurations.
+ |── conf/ # All configuration for Gravitino.
+ | ├── gravitino.conf # Gravitino server configuration.
+ | ├── gravitino-env.sh # Environment variables, etc., JAVA_HOME, GRAVITINO_HOME, and more.
+ | └── log4j2.properties # log4j configuration for Gravitino server.
+ |── libs/ # Gravitino server dependencies libraries.
+ |── logs/ # Gravitino server logs. Automatically created after the Gravitino server starts.
+ └── data/ # Default directory for Gravitino server to store data.
+```
+
+#### Configure Gravitino server
+
+The Gravitino server configuration file is `conf/gravitino.conf`. You can configure the Gravitino
+server by modifying this file. Basic configurations are already added to this file, all the
+configurations list in [Gravitino Server Configurations](./gravitino-server-config).
+
+#### Configure Gravitino server log
+
+The Gravitino server log configuration file is `conf/log4j2.properties`. Gravitino uses Log4j2 as
+the Logging system. You can [Log4j2](https://logging.apache.org/log4j/2.x/) to
+do the log configuration.
+
+#### Configure Gravitino server environment
+
+The Gravitino server environment configuration file is `conf/gravitino-env.sh`. Gravitino exposes
+several environment variables, you can modify this file to reconfigure.
+
+#### Configure Gravitino catalogs
+
+Gravitino supports multiple catalogs, you can configure the catalog level configurations by
+modifying the related configuration file in `catalogs/<catalog-provider>/conf` directory. The
+configurations you set here apply to all the catalogs of the same type you create.
+
+For example, if you want to configure the Hive catalog, you can modify the file
+`catalogs/hive/conf/hive.conf`. The detailed configurations list in the specific catalog
+documentation.
+
+:::note
+Gravitino takes the catalog configurations in the following order:
+
+1. Catalog `properties` specified in catalog creation API or REST API.
+2. Catalog configurations specified in the catalog configuration file.
+
+The catalog `properties` can override the catalog configurations specified in the configuration
+file.
+:::
+
+Gravitino supports pass in catalog specific configurations by adding `gravitino.bypass.`. For
+example, if you want to pass in HMS specific configuration
+`hive.metastore.client.capability.check` to the underlying Hive client in Hive catalog, you can
+simply add `gravitino.bypass.` prefix to it.
+
+Also, Gravitino supports loading catalog specific configurations from external files. For example,
+you can put your own `hive-site.xml` file in `catalogs/hive/conf` directory, Gravitino loads
+it automatically.
+
+#### Start Gravitino server
+
+After configuring the Gravitino server, you can start the Gravitino server by running:
+
+```shell
+./bin/gravitino.sh start
+```
+
+You can access the Gravitino Web UI by typing `http://localhost:8090` in your browser. or you
+can run
+
+```shell
+curl -v -X GET -H "Accept: application/vnd.gravitino.v1+json" -H "Content-Type: application/json" http://localhost:8090/api/version
+```
+
+to make sure Gravitino is running.
+
+:::info
+If you need to debug the Gravitino server, enable the `GRAVITINO_DEBUG_OPTS` environment
+variable in the `conf/gravitino-env.sh` file. Then you can create a `Remote JVM Debug`
+configuration in `IntelliJ IDEA` and debug `gravitino.server.main`.
+:::
+
+## Install Gravitino using Docker
+
+### Get the Gravitino Docker image
+
+Gravitino publishes the Docker image to [Docker Hub](https://hub.docker.com/r/datastrato/gravitino/tags).
+You can run the Gravitino Docker image by:
+
+```shell
+docker run -d -i -p 8090:8090 datastrato/gravitino:0.3.0-SNAPSHOT
+```
+
+You can access the Gravitino Web UI by typing `http://localhost:8090` in your browser. or you
+can run
+
+```shell
+curl -v -X GET -H "Accept: application/vnd.gravitino.v1+json" -H "Content-Type: application/json" http://localhost:8090/api/version
+```
+
+to make sure Gravitino is running.
+
+## Install Gravitino using Docker compose
+
+The published Gravitino Docker image only contains Gravitino server with basic configurations. If
+you want to experience the whole Gravitino system with other components, you can use the Docker
+compose file.
+
+For the details, you can review the
+[Gravitino playground repository](https://github.com/datastrato/gravitino-playground) and
+[playground example](./how-to-use-the-playground).
diff --git a/docs/how-to-test.md b/docs/how-to-test.md
index d001eaa339..077c391048 100644
--- a/docs/how-to-test.md
+++ b/docs/how-to-test.md
@@ -162,4 +162,4 @@ If a test fails, you can retrieve valuable information from the logs and test re
3. Look for the Artifacts item on the summary page and download the archive from there.
- ![summary page Image](assets/test-fail-summary.png)
\ No newline at end of file
+ ![summary page Image](assets/test-fail-summary.png)