Title
Create new category
Edit page index title
Edit category
Edit link
Trino Installation on VM with OpenLineage
This guide explains how to install Trino on a Linux virtual machine and configure OpenLineage integration for capturing query lineage events.
The document covers:
System preparation
Trino installation
Trino configuration
OpenLineage plugin setup
Starting and validating Trino
Installing the Trino CLI
Running Trino as a system service.
1. System Preparation
Before installing Trino, update the system and install the required dependencies.
Update the System
sudo apt update && sudo apt upgrade -yInstall Java (Required for Trino)
sudo apt install -y openjdk-17-jdkjava -versionInstall Additional Utilities
sudo apt install -y wget curl jq2. Install Trino
Create the installation directory
sudo mkdir -p /opt/trinocd /opt/trinoDownload the Trino server package
sudo wget https://repo1.maven.org/maven2/io/trino/trino-server/438/trino-server-438.tar.gzExtract and organize the installation
sudo tar -xzf trino-server-438.tar.gzsudo mv trino-server-438 serversudo rm trino-server-438.tar.gzCreate required directories
sudo mkdir -p /var/trino/datasudo mkdir -p /opt/trino/server/etcsudo mkdir -p /opt/trino/server/etc/catalog3. Configure Trino
Trino requires several configuration files located under:
/opt/trino/server/etcCreate node.properties
This file defines node identity and data directory.
sudo tee /opt/trino/server/etc/node.properties > /dev/null << 'EOF'node.environment=productionnode.id=trino-single-nodenode.data-dir=/var/trino/dataEOFCreate jvm.config
Configure JVM memory settings and adjust the -Xmx value according to your VM memory.
Example for an 8GB memory allocation:
sudo tee /opt/trino/server/etc/jvm.config > /dev/null << 'EOF'-server-Xmx8G-XX:InitialRAMPercentage=80-XX:MaxRAMPercentage=80-XX:+ExplicitGCInvokesConcurrent-XX:+ExitOnOutOfMemoryError-XX:+HeapDumpOnOutOfMemoryErrorEOFCreate config.properties
Defines Trino server behavior.
sudo tee /opt/trino/server/etc/config.properties > /dev/null << 'EOF'coordinator=truenode-scheduler.include-coordinator=truehttp-server.http.port=8080discovery.uri=http://localhost:8080EOFConfigure Logging
sudo tee /opt/trino/server/etc/log.properties > /dev/null << 'EOF'io.trino=INFOEOFConfigure a Test Catalog (TPC-H)
This creates a sample catalog for testing queries.
sudo tee /opt/trino/server/etc/catalog/tpch.properties > /dev/null << 'EOF'connector.name=tpchEOF4. Install the OpenLineage Plugin
The OpenLineage plugin allows Trino to send lineage events to external systems.
Navigate to the plugin directory
cd /opt/trino/server/pluginCreate a directory for the OpenLineage plugin
sudo mkdir -p openlineagecd openlineageDownload the Plugin
sudo wget https://repo1.maven.org/maven2/io/openlineage/openlineage-trino/1.23.0/openlineage-trino-1.23.0.jarVerify the Installation
ls -lhExpected Output: openlineage-trino-1.23.0.jar
5. Configure OpenLineage Event Listener
Create the event listener configuration file.
sudo tee /opt/trino/server/etc/event-listener.properties > /dev/null << 'EOF'event-listener.name=openlineage# Trino server URIopenlineage-event-listener.trino.uri=http://<YOUR_TRINO_HOST>:8080# Transport configurationopenlineage-event-listener.transport.type=httpopenlineage-event-listener.transport.url=https://<TENANT_NAME>.acceldata.app/torch-pipeline/api/v1/lineage# Authentication headersopenlineage-event-listener.transport.headers=accessKey:<YOUR_ACCESS_KEY>,secretKey:<YOUR_SECRET_KEY># Query types to captureopenlineage-event-listener.trino.include-query-types=INSERT,MERGE,DELETE,UPDATE# Namespace for lineage eventsopenlineage-event-listener.namespace=trino-productionEOFReplace the following placeholders with your environment values:
| Place Holder | Description |
|---|---|
<YOUR_TRINO_HOST> | Hostname or IP of the Trino server |
<TENANT_NAME> | Acceldata tenant name |
<YOUR_ACCESS_KEY> | Acceldata access key |
<YOUR_SECRET_KEY> | Acceldata secret key |
6. Set Directory Ownership
Ensure the correct user owns the directories.
sudo chown -R $USER:$USER /opt/trinosudo chown -R $USER:$USER /var/trino7. Start Trino
Navigate to the Trino installation
cd /opt/trino/serverStart the server
./bin/launcher startCheck the server status
./bin/launcher statusWait for the server to initialize.
sleep 308. Verify OpenLineage Initialization
Check logs to confirm the OpenLineage listener is registered.
grep -i "openlineage" /var/trino/data/var/log/server.logExpected log message:
Registered event listener openlineage9. Verify Trino is Running
sudo netstat -tlnp | grep 8080If successful, the output should show port 8080 listening.
10. Install Trino CLI
The CLI allows you to run queries from the command line.
Download the CLI
cd /tmpwget https://repo1.maven.org/maven2/io/trino/trino-cli/438/trino-cli-438-executable.jarInstall the CLI
sudo mv trino-cli-438-executable.jar /usr/local/bin/trinosudo chmod +x /usr/local/bin/trinoVerify installation
trino --version11. Connect to Trino
Run the following command to connect to the server.
trino --server localhost:8080 --catalog tpch --schema tinyYou can now run SQL queries.
Example:
SELECT * FROM nation;12. Run Trino as a systemd Service (Recommended)
Running Trino as a system service ensures it automatically starts after system reboot.
Create a Trino Service User
sudo useradd -r -s /bin/false trinAssign Ownership
sudo chown -R trino:trino /opt/trinosudo chown -R trino:trino /var/trinoStop the Manually Running Instance
cd /opt/trino/server./bin/launcher stopCreate the systemd Service File
sudo tee /etc/systemd/system/trino.service > /dev/null << 'EOF'[Unit]Description=Trino ServerAfter=network.target[Service]Type=forkingUser=trinoGroup=trinoExecStart=/opt/trino/server/bin/launcher startExecStop=/opt/trino/server/bin/launcher stopRestart=on-failureRestartSec=10[Install]WantedBy=multi-user.targetEOFEnable and Start the Service
Reload systemd:
sudo systemctl daemon-reloadEnable Trino at boot:
sudo systemctl enable trinoStart the service:
sudo systemctl start trinoVerify Service Status
sudo systemctl status trinoInstallation Complete
You have successfully:
- Installed Trino
- Configured TPC-H test catalog
- Integrated OpenLineage
- Installed the Trino CLI
- Configured Trino as a system service
Trino is now ready for running queries and emitting lineage events to your configured OpenLineage endpoint.
For additional help, contact www.acceldata.force.com OR call our service desk +1 844 9433282
Copyright © 2025