Unable to start beeline client

I installed spark-1.5.1-bin-without-hadoop and trying to start beeline using the following command from spark install directory. ./bin/beeline I get "Error: Could not find or load main class org.apache.hive.beeline.BeeLine".

Upvotes: 0

Views: 3602

Answers (2)

Sruthi Poddutur
Sruthi Poddutur

Reputation: 1501

I had exactly same problem. For me setting SPARK_HOME environment variable did it!

export SPARK_HOME=/Users/../Downloads/spark-2.1.1-bin-hadoop2.7

This is because if you actually open and see "bin/beeline" script file, you'll find this line:

Figure out if SPARK_HOME is set

So, after setting SPARK_HOME to proper location, beeline started working fine.

Upvotes: 0

Anthony
Anthony

Reputation: 1543

Not sure why the classpath is not working. I ran into same issue and ended up running java with the jars under lib_managed directory. Note that verbose option is used because no errors are shown in some NoClassDef cases.

java -cp lib_managed/jars/hive-exec-1.2.1.spark.jar:lib_managed/jars/hive-metastore-1.2.1.spark.jar:lib_managed/jars/httpcore-4.3.1.jar:lib_managed/jars/httpclient-4.3.2.jar:lib_managed/jars/libthrift-0.9.2.jar:lib_managed/jars/hive-beeline-1.2.1.spark.jar:lib_managed/jars/jline-2.12.jar:lib_managed/jars/commons-cli-1.2.jar:lib_managed/jars/super-csv-2.2.0.jar:lib_managed/jars/commons-logging-1.1.3.jar:lib_managed/jars/hive-jdbc-1.2.1.spark.jar:lib_managed/jars/hive-cli-1.2.1.spark.jar:lib_managed/jars/hive-service-1.2.1.spark.jar:assembly/target/scala-2.10/spark-assembly-1.5.3-SNAPSHOT-hadoop2.2.0.jar org.apache.hive.beeline.BeeLine -u jdbc:hive2://<thrift server public address>:10000/default --verbose=true

Upvotes: 1

Related Questions