Skip to content

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

[MINOR] doc: Rewrite getting started to remove the duplications (#1058)

Jerry Shaoee1eb8072309
diff --git a/docs/getting-started.md b/docs/getting-started.md
index 4607467c4b..52de30eb33 100644
--- a/docs/getting-started.md
+++ b/docs/getting-started.md
@@ -1,17 +1,23 @@
---
-title: "Getting Started with Gravitino"
-date: 2023-11-20
+title: "Getting started with Gravitino"
+slug: /getting-started
license: "Copyright 2023 Datastrato Pvt Ltd.
This software is licensed under the Apache License version 2."
---
There are several options for getting started with Gravitino. Installing and configuring Hive and Trino can be a little complex, so if you are unfamiliar with the technologies it would be best to use Docker.
-If you want to download and compile Gravitino, on AWS see [Getting started on Amazon Web Services](#getting-started-on-amazon-web-services) or Google Cloud Platform see [Getting started on Google Cloud Platform](#getting-started-on-google-cloud-platform) or on OSX see [Getting started locally on OSX](#getting-started-locally-on-osx).
+If you want to download and install Gravitino, on AWS see [Getting started on Amazon Web Services](#getting-started-on-amazon-web-services)
+or Google Cloud Platform see [Getting started on Google Cloud Platform](#getting-started-on-google-cloud-platform)
+or locally see [Getting started locally](#getting-started-locally).
-If you have your own Gravitino setup and want to use Apache Hive in Docker on AWS or Google Cloud Platform see [Installing Apache Hive Trino and Gravitino on AWS or Google Cloud Platform](#installing-apache-hive-trino-and-gravitino-on-aws-or-google-cloud-platform) or locally on OSX see [Installing Apache Hive Trino and Gravitino on OSX](#installing-apache-hive-trino-and-gravitino-on-osx).
+If you have your own Gravitino setup and want to use Apache Hive on AWS or Google
+Cloud Platform see [Installing Apache Hive on AWS or Google Cloud Platform](#installing-apache-hive-on-aws-or-google-cloud-platform) or locally see
+[Installing Apache Hive locally](#installing-apache-hive-locally).
-If you prefer to get started quickly and use Docker for Gravitino, Apache Hive and Trino on AWS or Google Cloud Platform see [Installing Apache Hive on AWS or Google Cloud Platform](#installing-apache-hive-on-aws-or-google-cloud-platform) or locally on OSX see [Installing Apache Hive on OSX](#installing-apache-hive-on-osx). Gravitino requires JDK8 for compilation.
+If you prefer to get started quickly and use Docker for Gravitino, Apache Hive, Trino, and others on
+AWS or Google Cloud Platform see [Installing Gravitino playground on AWS or Google Cloud Platform](#installing-gravitino-playground-on-aws-or-google-cloud-platform) or locally see
+or locally see [Installing Gravitino playground locally](#installing-gravitino-playground-locally).
If you are using AWS and want to access the instance remotely, be sure to read [Accessing Gravitino on AWS externally](#accessing-gravitino-on-aws-externally)
@@ -30,7 +36,7 @@ To begin using Gravitino on AWS, follow these steps:
Note you may need to adjust the permissions on your .pem file using `chmod 400` to enable SSH connections.
-3. Update the Ubuntu OS to ensure it's up to date:
+3. Update the Ubuntu OS to ensure it's up-to-date:
```shell
sudo apt update
@@ -53,60 +59,29 @@ To begin using Gravitino on AWS, follow these steps:
You should see information about OpenJDK 8.
-5. Clone the Gravitino source from GitHub:
+5. Install Gravitino on the instance:
- ```shell
- git clone [email protected]:datastrato/gravitino.git
- cd gravitino
- ```
-
- Or, download the latest Gravitino release and extract the source:
-
- ```shell
- curl -L https://github.com/datastrato/gravitino/releases/download/v0.2.0/gravitino.0.2.0.tar.gz > gravitino.0.2.0.tar.gz
- tar -xvf gravitino.0.2.0.tar.gz
- cd gravitino.0.2.0
- ```
-
- Or, download, and copy the release to your AWS instance via `scp`.
-
- ```shell
- scp -i ~/Downloads/Gravitino.pem ~/Downloads/gravitino.zip ubuntu@<IP address>:~
- unzip gravitino.zip
- cd gravitino
- ```
-
-6. Build Gravitino and run tests:
-
- ```shell
- ./gradlew build
- ```
-
- You can ignore the tests if you want by appending `-x test`.
-
-7. Build a runnable distribution:
-
- ```shell
- ./gradlew compileDistribution
- ```
+ You can install Gravitino from the binary release package or Docker image, please follow the
+ [how-to-install](./how-to-install) to install Gravitino.
- Again, you can ignore the tests if you want by appending `-x test`.
+ Or, you can install Gravitino from scratch, please follow the documentation of
+ [how-to-build](./how-to-build) and [how-to-install](./how-to-install) to install Gravitino.
-8. Start Gravitino using the gravitino.sh script:
+6. Start Gravitino using the gravitino.sh script:
```shell
- distribution/package/bin/gravitino.sh start
+ <path-to-gravitino>/bin/gravitino.sh start
```
## Getting started on Google Cloud Platform
-To begin using Gravitino on AWS, follow these steps:
+To begin using Gravitino on GCP, follow these steps:
1. In the Google Cloud console, launch a new instance. Select `e2-standard-4` as the instance type and 20 GB for the boot disk size. Allow HTTP and HTTPS traffic, if you want to connect to the instance remotely. Leave all other settings as their defaults. Other operating systems and instance types may work, but they have yet to be fully tested.
2. Start the instance and connect to it via the SSH-in-browser tool.
-3. Update the Debian OS to ensure it's up to date:
+3. Update the Debian OS to ensure it's up-to-date:
```shell
sudo apt update
@@ -131,100 +106,62 @@ To begin using Gravitino on AWS, follow these steps:
You should see information about OpenJDK 8.
-5. Clone the Gravitino source from GitHub:
-
- ```shell
- git clone [email protected]:datastrato/gravitino.git
- cd gravitino
- ```
-
- Or, download the latest Gravitino release and extract the source:
-
- ```shell
- curl -L https://github.com/datastrato/gravitino/releases/download/v0.2.0/gravitino.0.2.0.tar.gz > gravitino.0.2.0.tar.gz
- tar -xvf gravitino.0.2.0.tar.gz
- cd gravitino.0.2.0
- ```
-
- Or, download, and copy the release to your instance via File upload in the SSH-in-browser tool.
-
-6. Build Gravitino and run tests:
-
- ```shell
- ./gradlew build
- ```
+5. Install Gravitino on the instance:
- You can ignore the tests if you want by appending `-x test`.
-
-7. Build a runnable distribution:
-
- ```shell
- ./gradlew compileDistribution
- ```
+ You can install Gravitino from the binary release package or Docker image, please follow the
+ [how-to-install](./how-to-install) to install Gravitino.
- Again, you can ignore the tests if you want by appending `-x test`.
+ Or, you can install Gravitino from scratch, please follow the documentation of
+ [how-to-build](./how-to-build) and [how-to-install](./how-to-install) to install Gravitino.
-8. Start Gravitino using the gravitino.sh script:
+6. Start Gravitino using the gravitino.sh script:
```shell
- distribution/package/bin/gravitino.sh start
+ <path-to-gravitino>/bin/gravitino.sh start
```
-## Getting started locally on OSX
+## Getting started locally
-To use Gravitino locally on OSX, follow similar steps:
+To use Gravitino locally on macOS or Linux, follow similar steps:
-1. Install the required Java Development Kit using Homebrew:
+1. Install the required Java Development Kit using [sdkman](https://sdkman.io/) for example:
```shell
- brew install openjdk@8
+ sdk install java 8.0.392-amzn
```
-2. Clone the Gravitino source from GitHub:
+ You can also use different package managers to install JDK, for example,
+ [Homebrew](https://brew.sh/) on macOS, `apt` on Ubuntu/Debian, `yum` on CentOS/RedHat, etc.
- ```shell
- git clone [email protected]:datastrato/gravitino.git
- cd gravitino
- ```
-
- Or, download the latest Gravitino release and extract the source:
+2. Install Gravitino:
- ```shell
- curl -L https://github.com/datastrato/gravitino/releases/download/v0.2.0/gravitino.0.2.0.tar.gz > gravitino.0.2.0.tar.gz
- tar -xvf gravitino.0.2.0.tar.gz
- cd gravitino.0.2.0
- ```
-
-3. Build Gravitino and run tests:
-
- ```shell
- ./gradlew build
- ```
+ You can install Gravitino from the binary release package or Docker image, please follow the
+ [how-to-install](./how-to-install) to install Gravitino.
- You can ignore the tests if you want by appending `-x test`.
+ Or, you can install Gravitino from scratch, please follow the documentation of
+ [how-to-build](./how-to-build) and [how-to-install](./how-to-install) to install Gravitino.
-4. Build a runnable distribution:
+3. Start Gravitino using the gravitino.sh script:
```shell
- ./gradlew compileDistribution
+ <path-to-gravitino>/bin/gravitino.sh start
```
- Again, you can ignore the tests if you want by appending `-x test`.
+## Installing Apache Hive on AWS or Google Cloud Platform
-5. Start Gravitino using the gravitino.sh script:
+If you already have Apache Hive, Apache Hadoop in your environment, you can ignore this section
+and use them with Gravitino.
- ```shell
- distribution/package/bin/gravitino.sh start
- ```
-
-## Installing Apache Hive on AWS or Google Cloud Platform
+You can install Apache Hive and Hadoop on AWS or Google Cloud Platform manually, please follow
+the steps of how to install [Apache Hive](https://cwiki.apache.org/confluence/display/Hive/) and
+[Hadoop](https://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-common/SingleCluster.html) instructions on their websites.
Installing and configuring Hive can be a little complex. If you don't already have Hive setup and running you can use the Docker container Datastrato provide to get Gravitino up and running.
You can follow the instructions for setting up [Docker on Ubuntu](https://docs.docker.com/engine/install/ubuntu/).
```shell
-sudo docker run --name gravitino-container -d -p 9000:9000 -p 8088:8088 -p 50010:50010 -p 50070:50070 -p 50075:50075 -p 10000:10000 -p 10002:10002 -p 8888:8888 -p 9083:9083 -p 8022:22 datastrato/gravitino-ci-hive
+sudo docker run --name gravitino-container -d -p 9000:9000 -p 8088:8088 -p 50010:50010 -p 50070:50070 -p 50075:50075 -p 10000:10000 -p 10002:10002 -p 8888:8888 -p 9083:9083 -p 8022:22 datastrato/hive:2.7.3-no-yarn
```
Once installed, you can start the container with the command:
@@ -233,15 +170,16 @@ Once installed, you can start the container with the command:
sudo docker start gravitino-container
```
-## Installing Apache Hive on OSX
+## Installing Apache Hive locally
-The same Docker container operates on OSX.
+The same steps apply for installing Hive locally as on AWS or Google Cloud Platform. You can
+follow the instructions for [Installing Apache Hive on AWS or Google Cloud Platform](#installing-apache-hive-on-aws-or-google-cloud-platform).
-```shell
-docker run --name gravitino-container -d -p 9000:9000 -p 8088:8088 -p 50010:50010 -p 50070:50070 -p 50075:50075 -p 10000:10000 -p 10002:10002 -p 8888:8888 -p 9083:9083 -p 8022:22 datastrato/gravitino-ci-hive
-```
+## Installing Gravitino playground on AWS or Google Cloud Platform
-## Installing Apache Hive Trino and Gravitino on AWS or Google Cloud Platform
+Gravitino provides a bundle of Docker images to launch a Gravitino playground, which
+includes Apache Hive, Apache Hadoop, Trino, MySQL, PostgresSQL, and Gravitino. You can use
+Docker compose to start them all.
Installing Docker and Docker Compose is a requirement to using the playground.
@@ -251,21 +189,14 @@ sudo gpasswd -a $USER docker
newgrp docker
```
-You can install and run all three programs as Docker containers by using the playground.
-
-```shell
-cd ~/gravitino/dev/docker/playground
-docker-compose up
-```
-
-## Installing Apache Hive Trino and Gravitino on OSX
+You can install and run all the programs as Docker containers by using the
+[gravitino-playground](https://github.com/datastrato/gravitino-playground). For the details of
+how to run the playground, please see [how-to-use-the-playground](./how-to-use-the-playground)
-You can install and run all three programs as Docker containers by using the playground.
+## Installing Gravitino playground locally
-```shell
-cd ~/gravitino/dev/docker/playground
-docker-compose up
-```
+The same steps apply for installing the playground locally as on AWS or Google Cloud Platform. You
+can follow the instructions for [Installing Gravitino playground on AWS or Google Cloud Platform](#installing-gravitino-playground-on-aws-or-google-cloud-platform).
## Using REST to interact with Gravitino
@@ -273,43 +204,60 @@ After starting the Gravitino distribution, issue REST commands to create and mod
1. Create a Metalake
-```shell
-curl -X POST -H "Content-Type: application/json" -d '{"name":"metalake","comment":"Test metalake"}' http://localhost:8090/api/metalakes
-```
+ ```shell
+ curl -X POST -H "Accept: application/vnd.gravitino.v1+json" \
+ -H "Content-Type: application/json" \
+ -d '{"name":"metalake","comment":"Test metalake"}' http://localhost:8090/api/metalakes
+ ```
-Verify the MetaLakes creation
+ Verify the MetaLakes creation
-```shell
-curl http://localhost:8090/api/metalakes
-curl http://localhost:8090/api/metalakes/metalake
-```
+ ```shell
+ curl -X GET -H "Accept: application/vnd.gravitino.v1+json" \
+ -H "Content-Type: application/json" \
+ http://localhost:8090/api/metalakes
-Note that if you request a Metalake that doesn't exist you get an *NoSuchMetalakeException* error.
+ curl -X GET -H "Accept: application/vnd.gravitino.v1+json" \
+ -H "Content-Type: application/json" \
+ http://localhost:8090/api/metalakes/metalake
+ ```
-```shell
-curl http://localhost:8090/api/metalakes/none
-```
+ Note that if you request a Metalake that doesn't exist you get an *NoSuchMetalakeException* error.
+
+ ```shell
+ curl -X GET -H "Accept: application/vnd.gravitino.v1+json" \
+ -H "Content-Type: application/json" \
+ http://localhost:8090/api/metalakes/none
+ ```
2. Create a catalog in Hive
-First, list the current catalogs to show that no catalogs exist.
+ First, list the current catalogs to show that no catalogs exist.
-```shell
-curl http://localhost:8090/api/metalakes/metalake/catalogs
-```
+ ```shell
+ curl -X GET -H "Accept: application/vnd.gravitino.v1+json" \
+ -H "Content-Type: application/json" \
+ http://localhost:8090/api/metalakes/metalake/catalogs
+ ```
-Create a new Hive catalog.
+ Create a new Hive catalog.
-```shell
-curl -X POST -H "Content-Type: application/json" -d '{"name":"test","comment":"Test catalog","type":"RELATIONAL", "provider":"hive","properties":{"metastore.uris":"thrift://localhost:9083"}}' http://localhost:8090/api/metalakes/metalake/catalogs
-```
+ ```shell
+ curl -X POST -H "Accept: application/vnd.gravitino.v1+json" \
+ -H "Content-Type: application/json" \
+ -d '{"name":"test","comment":"Test catalog", "type":"RELATIONAL", "provider":"hive", "properties":{"metastore.uris":"thrift://localhost:9083"}}' \
+ http://localhost:8090/api/metalakes/metalake/catalogs
+ ```
-Verify the creation of the catalog.
-```shell
-curl http://localhost:8090/api/metalakes/metalake/catalogs
-```
+ Verify the creation of the catalog.
+
+ ```shell
+ curl -X GET -H "Accept: application/vnd.gravitino.v1+json" \
+ -H "Content-Type: application/json" \
+ http://localhost:8090/api/metalakes/metalake/catalogs
+ ```
-Note that the metastore.uris used for the catalog and would need updating if you change your configuration.
+ Note that the metastore.uris used for the Hive catalog and would need updating if you change your configuration.
## Accessing Gravitino on AWS externally
@@ -321,10 +269,12 @@ AWS assigns your instance a public IP address, but Gravitino can't bind to that
ip a
```
-Once you have identified the internal address, edit the Gravitino configuration to bind to that address. Open the file `distribution/package/conf/gravitino.conf` and modify the `gravitino.server.webserver.host` parameter from `127.0.0.1` to your AWS instance's private IP4 address or you can use '0.0.0.0'. '0.0.0.0' in this context means the host's IP address. Restart the Gravitino server for the change to take effect.
+Once you have identified the internal address, edit the Gravitino configuration to bind to that
+address. Open the file `<path-to-gravitino>/conf/gravitino.conf` and modify the `gravitino.server.
+webserver.host` parameter from `127.0.0.1` to your AWS instance's private IP4 address, or you can use '0.0.0.0'. '0.0.0.0' in this context means the host's IP address. Restart the Gravitino server for the change to take effect.
```shell
-distribution/package/bin/gravitino.sh restart
+<path-to-gravitino>/bin/gravitino.sh restart
```
You'll also need to open port 8090 in the security group of your AWS instance to access Gravitino. To access Hive you need to open port 10000 in the security group.