Support Questions

Find answers, ask questions, and share your expertise

Presto not able to connect to hive: Failed connecting to Hive metastore:

avatar
Rising Star

I am trying to connect to hive metastore to my HDP sandbox. However it's throwing following error.

Hive Catalogonnector.name=hive-hadoop2
hive.metastore.uri=thrift://sandbox-hdp.hortonworks.com:9083
hive.metastore.authentication.type=NONE

Error:

Query 20180810_005352_00000_umgac failed: Failed connecting to Hive metastore: [sandbox-hdp.hortonworks.com:9083]

I tried using following values for hive.metastore.uri however I am gettting the same error.

  • thrift://localhost:9083
  • thrift://127.0.0.1:9083
  • thrift://<IP of docker container>:9083
  • thrift://<IP of local machine>:9083
4 REPLIES 4

avatar
@Gaurang Shah

Is your metastore up and running? if it is up and running in the in the same machine you shouldn't be seeing this error.

Do post the complete stacktrace.

avatar
Rising Star
@Sandeep Nemuri

how do i check if metastore is up and running from my local machine. I logged into docker container and I can see I am able to telnet into the 9083 port. However if I try to do that from my local machine, it doesn't work.

The one thing I realized is the port is not exposed in docker image or mentioned in webpage anywhere.

https://hortonworks.com/tutorial/hortonworks-sandbox-guide/section/3/

I exposed the port and restarted the docker container however, I am still not able to connect to that port using telnet from my local machine or from presto server ( which also on my local machine).

avatar

@Gaurang Shah

I don't think you will be able to connect form the presto outside of sandbox. One easy solution i can think of is to install presto service within sandbox docker.

avatar
Rising Star

I found the solution, so posting here.

The problem I was having is I was just stopping the docker container after making change in the command I was using to start the HDP image, didn't realize need to remove container as well.

Following command helped.

Save docker Work

docker commit <hdp_container_id> <hdp_container_id>

Stop and Remove docker.

docker stop <hdp_container_id>
docker rm <hdp_container_id>

Open 9083 port (hive metastore) by modifying start-sandbox-hdp-standalone_2-6-4.sh

#!/bin/bash
echo "Waiting for docker daemon to start up:"
until docker ps 2>&1| grep STATUS>/dev/null; do  sleep 1; done;  >/dev/null
docker ps -a | grep sandbox-hdp
if [ $? -eq 0 ]; then
 docker start sandbox-hdp
else
docker pull hortonworks/sandbox-hdp-standalone:2.6.4
docker run --name sandbox-hdp --hostname "sandbox-hdp.hortonworks.com" --privileged -d \
-p 9083:9083 \ 
-

Start Docker

./start-sandbox-hdp-standalone_2-6-4.sh