Installing Trino in linux server

Posted on by By admin, in Big Data, Business Intelligence | 0

Trino requires a 64-bit version of Java 17, with a minimum required version of 17.0. 3. Earlier major versions such as Java 8 or Java 11 do not work.

Make sure to install java and follow below steps in order to install trino :

1. Download the trino installer using below link

https://repo1.maven.org/maven2/io/trino/trino-server/418/trino-server-418.tar.gz

Once you download trino-server-418.tar.gz , upload into your server path

Trino needs a data directory for storing logs, etc. We recommend creating a data directory outside of the installation directory, which allows it to be easily preserved when upgrading Trino.

2. We have uploaded trin into below path

/usr/local/trino-server-418

3. Create a data directory in the below path

/var/trino/data/

4. Download etc folder and extract it then upload into below trino path

/usr/local/trino-server-418

5. Open “node.properties” file and provide node-data-dir

Installing Trino in linux server

6. In order to configure database we need to create a properties(the database which you want to configure) file and should keep in below path

/usr/local/trino-server-418/etc/catalog

Installing Trino in linux server

Example 1 :

mongodb.properties
connector.name=mongodb
mongodb.connection-url=mongodb+srv://username:password@hostname
mongodb.case-insensitive-name-matching=true
mongodb.tls.enabled=true

Example2 :

connector.name=sqlserver
connection-url=jdbc:sqlserver://=localhost:1433;databaseName=DBName;encrypt=false
connection-user=provide database username
connection-password=provide database password
case-insensitive-name-matching=false

7. Starting the trino server
Connect server via putty and navigate to the path :

/usr/local/trino-server-418/bin

Run this command :

./launcher start

Installing Trino in linux server

Note : To stop server use

./launcher stop

While starting trino if you get any python related error , run this command in putty

sudo ln -s /usr/bin/python3 /usr/bin/python

and try again it will work.

With the above steps Trino will get installed, but we also need to ensure that it is added as a background service so that even if server restarts Trino service automatically restarts as well. In order to add that as a background service plz follow the below steps.

In order to run trino as background service we need to follow the following steps.

1. We first need to create the .service file in Linux here we have named our file as trino.service
2. We need to mention following command in the file

[Unit]
Description=Trino Service
After=network.target

[Service]
ExecStart=/usr/local/trino-server-418/bin/launcher start
ExecStop=/usr/local/trino-server-418/bin/launcher stop
Type=forking


[Install]
WantedBy=default.target

If you want to learn more about this command please follow this link
https://linuxhandbook.com/create-systemd-services/

3. Now we need to copy this file to

/etc/systemd/system

4. To tell the system to read our service file we need to issue the following command

sudo  systemctl deamon-reload

5. To Enable our service we need to run following command.

sudo systemctl enable service-name.service which is in our case 
sudo systemctl enable trino.service

6. Now we need to run

service trino start this should start your trino without going into /usr/local/trino-server-418

7. We can verify if the service is enabled using following command

sudo systemctl is-enable trino.service

Installing Trino in linux server

Please Note we need to reboot in order verify if this service got created successfully or not

Thank You
Anjaneyulu
Helical IT Solutions

logo

Best Open Source Business Intelligence Software Helical Insight is Here

logo

A Business Intelligence Framework

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments