Support Questions

Find answers, ask questions, and share your expertise
Celebrating as our community reaches 100,000 members! Thank you!

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

Rising Star

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



Query 20180810_005352_00000_umgac failed: Failed connecting to Hive metastore: []

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

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

@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.

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.

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).


@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.

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

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
docker pull hortonworks/sandbox-hdp-standalone:2.6.4
docker run --name sandbox-hdp --hostname "" --privileged -d \
-p 9083:9083 \ 

Start Docker