1. IntroductionPresto 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 install1) 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 FileEnter 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 connectionEnter 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:
|
<<: JavaScript exquisite snake implementation process
>>: Sample code for implementing 3D book effect with CSS
Nexus provides RestApi, but some APIs still need ...
Table of contents Introduction to NFS Service Wha...
Brief description <br />In IE6 and 7, in a ...
Gird layout has some similarities with Flex layou...
Meta tag function The META tag is a key tag in th...
Drag the mouse to take a screenshot of the page (...
1. Introduction Oracle has released MySQL 8.0GA. ...
In higher versions of Tomcat, the default mode is...
1. Add skip-grant-tables to the my.ini file and r...
Table of contents Overview 1. Test for null value...
Table of contents Create a vue + ts project using...
Install Filebeat has completely replaced Logstash...
Table of contents 1. Scenario 2. Solution 3. Conc...
See the effect first Implementation Code <div ...
Table of contents Stabilization Throttling Summar...