Detailed process of installing Presto and connecting Hive in Docker

Detailed process of installing Presto and connecting Hive in Docker

1. Introduction

Presto is an open source distributed SQL query engine for running interactive analytical queries against data sources ranging from gigabytes to petabytes. Presto allows you to query data wherever it resides, including Hive, Cassandra, relational databases, and even proprietary data stores. A single Presto query can combine data from multiple sources, allowing analysis across your entire organization.

2. Download and install

1) Download the image

docker pull starburstdata/presto

2) Download the client jar

Because the pulled image is a server and does not have the presto-cli command, you need to download presto-cli-0.260.1-executable.jar and then pull the downloaded jar package into the Linux system.

After the download is complete, run the container:

#The port number is 8080, please modify it yourself, the name is presto
docker run -d -p 8080:8080 --name presto starburstdata/presto

Copy the client jar package to the bin directory in the container:

docker cp [linux path where the client jar package is located] [container name]:/bin

Go to the hadoop configuration file directory and copy core-site.xml and hdfs-site.xml to the container

cd ${HADOOP_HOME}/etc/hadoop
docker cp core-site.xml presto:/usr/lib/presto/etc/
docker cp core-site.xml presto:/usr/lib/presto/etc/

Enter the container (the following operations not marked are all performed in the container):

#Enter the container as root user to prevent unauthorized file operations docker exec --user=root -it presto /bin/bash

Rename the client jar package and grant executable permissions:

cd bin
mv presto-cli-0.260.1-executable.jar presto-cli
chmod a+x presto-cli

3. Configuration File

Enter the configuration file directory and create the hive configuration file:

cd /usr/lib/presto/etc/catalog
vi hive.properties

hive.properties:

#Connection name, fixed connector.name=hive-hadoop2
#hive metadata uri, can be found in hive-site.xml, please modify the ip and port yourself hive.metastore.uri=thrift://192.168.10.51:9083
#Hive configuration resources core-site.xml and hdfs-site.xml, please modify according to the configuration file path in your cluster, separated by commas hive.config.resources=/usr/lib/presto/etc/core-site.xml,/usr/lib/presto/etc/hdfs-site.xml

wqSave and exit

Restart the container (on the Linux command line):

docker restart presto

4. Test the connection

Enter the container:

#Enter the container as root user to prevent unauthorized file operations docker exec --user=root -it presto /bin/bash
#Enter the bin directory cd bin
#Execute the command line script and test the hive connection, connect to the hive configuration file, the database is default
./presto-cli --server localhost:8080 --catalog hive --schema default
presto>show tables;

This is the end of this article about the detailed process of installing Presto on Docker to connect to Hive. For more information about installing Presto on Docker, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Docker installs ClickHouse and initializes data testing
  • How to install docker and portainer in kali
  • Installing Docker Desktop reports an error message: WSL 2 installation is incomplete (Solve the error message)
  • Detailed process of installing and deploying onlyoffice in docker
  • A detailed tutorial on how to install Jenkins on Docker for beginners

<<:  JavaScript exquisite snake implementation process

>>:  Sample code for implementing 3D book effect with CSS

Recommend

Nexus uses API to operate

Nexus provides RestApi, but some APIs still need ...

Analysis and solution of a.getAttribute(href,2) problem in IE6/7

Brief description <br />In IE6 and 7, in a ...

Detailed explanation of Grid layout and Flex layout of display in CSS3

Gird layout has some similarities with Flex layou...

Summary of the use of html meta tags (recommended)

Meta tag function The META tag is a key tag in th...

A simple way to implement Vue's drag screenshot function

Drag the mouse to take a screenshot of the page (...

What to do if you forget your password in MySQL 5.7.17

1. Add skip-grant-tables to the my.ini file and r...

Stop using absolute equality operators everywhere in JS

Table of contents Overview 1. Test for null value...

Vue3+script setup+ts+Vite+Volar project

Table of contents Create a vue + ts project using...

Docker Compose one-click ELK deployment method implementation

Install Filebeat has completely replaced Logstash...

Implementation of services in docker accessing host services

Table of contents 1. Scenario 2. Solution 3. Conc...

CSS3 realizes the graphic falling animation effect

See the effect first Implementation Code <div ...

JavaScript anti-shake and throttling explained

Table of contents Stabilization Throttling Summar...