To install the Apache Gravitino Trino connector, you should first deploy the Trino environment, and then install the Gravitino Trino connector plugin into Trino. Please refer to the Deploying Trino documentation and do the following steps:
gravitino-trino-connector-<version>
, which called the connector directory.Trino-server-<version>/plugin
, and the directory contains other catalogs used by Trino.-Dlog4j.configurationFile=file:////etc/trino/log4j2.properties
to enable logging for the Gravitino Trino connector.catalog.management=dynamic
, The config location is Trino-server-<version>/etc/config.properteis
, and the contents like:coordinator=true node-scheduler.include-coordinator=true http-server.http.port=8080 catalog.management=dynamic discovery.uri=http://0.0.0.0:8080
Alternatively, you can build the Gravitino Trino connector package from the sources and obtain the gravitino-trino-connector-<version>.tar.gz
file in the $PROJECT/distribution
directory. Please refer to the Gravitino Development documentation
You can install the Gravitino Trino connector in Trino office docker images step by step.
Use the docker command to create a container from the trinodb/trino
image. Assign it the trino-gravitino name. Run it in the background, and map the default Trino port, which is 8080, from inside the container to port 8080 on your machine.
docker run --name trino-gravitino -d -p 8080:8080 trinodb/trino:435
Run docker ps
to check whether the container is running.
Download the Gravitino Trino connector tarball and unpack it.
cd /tmp wget https://github.com/apache/gravitino/releases/gravitino-trino-connector-<version>.tar.gz tar -zxvf gravitino-trino-connector-<version>.tar.gz
You can see the connector directory gravitino-trino-connector-<version>
after unpacking.
Copy the connector directory to the Trino container's plugin directory.
docker cp /tmp/gravitino-trino-connector-<version> trino-gravitino:/lib/trino/plugin
Check the plugin directory in the container.
docker exec -it trino-gravitino /bin/bash cd /lib/trino/plugin
Now you can see the Gravitino Trino connector directory in the plugin directory.
You can find the Trino configuration file config.properties
in the directory /etc/trino
. You need changed the file like this:
#single node install config coordinator=true node-scheduler.include-coordinator=true http-server.http.port=8080 discovery.uri=http://localhost:8080 catalog.management=dynamic
Assuming you have now started the Gravitino server on the host gravitino-server-host
and already created a metalake named test
, if those have not been prepared, please refer to the Gravitino getting started.
To configure Gravitino Trino connector correctly, you need to put the following configurations to the Trino configuration file /etc/trino/catalog/gravitino.properties
.
connector.name=gravitino gravitino.uri=http://gravitino-server-host:8090 gravitino.metalake=test
gravitino.name
defines which Gravitino Trino connector is used. It must be gravitino
.gravitino.metalake
defines which metalake are used. It should exist in the Gravitino server.gravitino.uri
defines the connection information about Gravitino server. Make sure your container can access the Gravitino server.Full configurations for Apache Gravitino Trino connector can be seen here
If you haven't created the metalake named test
, you can use the following command to create it.
curl -X POST -H "Content-Type: application/json" -d '{"name":"test","comment":"comment","properties":{}}' http://gravitino-server-host:8090/api/metalakes
And then restart the Trino container to load the Gravitino Trino connector.
docker restart trino-gravitino
Use the Trino CLI to connect to the Trino container and run a query.
docker exec -it trino-gravitino trino trino> SHOW CATALOGS; Catalog ------------------------ gravitino jmx memory tpcds tpch system
You can see the gravitino
catalog in the result set. This signifies the successful installation of the Gravitino Trino connector.
Assuming you have created a catalog named test.jdbc-mysql
in the Gravitino server, or please refer to Create a Catalog. Then you can use the Trino CLI to connect to the Trino container and run a query like this.
docker exec -it trino-gravitino trino trino> SHOW CATALOGS; Catalog ------------------------ gravitino jmx memory tpcds tpch system jdbc-mysql
The catalog named ‘jdbc-mysql’ is the catalog that you created by gravitino server, and you can use it to access the mysql database like other Trino catalogs.