1

I'm trying to run hive from the command prompt it is working absolutely fine. But when I try running hiveserver using "hive --service hiveserver" command, I'm getting the following exception.

Starting Hive Thrift Server
Exception in thread "main" java.lang.ClassNotFoundException: org.apache.hadoop.hive.service.HiveServer
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:278)
    at org.apache.hadoop.util.RunJar.run(RunJar.java:214)
    at org.apache.hadoop.util.RunJar.main(RunJar.java:136)

So I then tried with the command "hive --service hiveserver2"; still I'm not finding any solution.

Can anybody please suggest a solution for this problem.

Martin Evans
  • 45,791
  • 17
  • 81
  • 97
Gazal Begum
  • 41
  • 1
  • 2
  • 4

2 Answers2

1

May be another process (another hiveserver) already listening on port 10000.

can you check it by : netstat -ntulp | grep ':10000' to see it and if found then kill the process.

Otherwise start the server on another port.

By the way which version you are using ?

Stacey Morgan
  • 202
  • 1
  • 7
  • I tried out the suggestion but there is no process or hiveserver listening to this port. And I'm using Apache Hive 1.1.0 – Gazal Begum May 21 '15 at 04:54
0

This error occurred to me when it can't find hive-service-*.jar in hadoop classpath. Just copy the hive-service-*.jar to your hadoop lib folder or export classpath in hadoop-env.sh. I have mentioned how to add classpath below.

Add this line in hadoop-env.sh:

export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:/usr/local/hive/lib/hive-*.jar

I have mentioned the path for hive as /usr/local/hive since i have hive installed at that location. Change it to point to your hive installation.

Rajesh N
  • 2,554
  • 1
  • 13
  • 17