Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Hive >> mail # user >> Problem when trying to connect to hive server using jdbc


Copy link to this message
-
Re: Problem when trying to connect to hive server using jdbc
I just modified the hive batch file to echo some variables. These are what the variables are set to when I execute /usr/lib/hive/bin/hive

HADOOP=/usr/bin/../bin/hadoop
HADOOP_HOME=/usr/bin/..
HADOOP_VERSION=2.0.0-cdh4.1.2

R these variables set correctly for u  ?
HADOOP_MAPRED_HOME=/usr/lib/hadoop-mapreduce
HIVE_HOME=/usr/lib/hive

Which linux  are u running ?

From: demian rosas <[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>>
Reply-To: "[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>" <[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>>
Date: Tuesday, April 2, 2013 6:18 PM
To: "[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>" <[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>>
Subject: Re: Problem when trying to connect to hive server using jdbc

The content of the indicated file on line 179 "area" is

# Save the regex to a var to workaround quoting incompatabilities
# between Bash 3.1 and 3.2
hadoop_version_re="^([[:digit:]]+)\.([[:digit:]]+)(\.([[:digit:]]+))?.*$"

if [[ "$HADOOP_VERSION" =~ $hadoop_version_re ]]; then #--------------------------------------------------------------------------------------> This is line 179
    hadoop_major_ver=${BASH_REMATCH[1]}
    hadoop_minor_ver=${BASH_REMATCH[2]}
    hadoop_patch_ver=${BASH_REMATCH[4]}
else
    echo "Unable to determine Hadoop version information."
    echo "'hadoop version' returned:"
    echo `$HADOOP version`
    exit 5
fi

I do not see anything particularly wrong there.

What do you think?

On 2 April 2013 18:09, Sanjay Subramanian <[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>> wrote:
In the hive batch file
There seem to be some errors on 179…can u verify
sanjay

From: demian rosas <[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>>
Reply-To: "[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>" <[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>>
Date: Tuesday, April 2, 2013 5:56 PM

To: "[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>" <[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>>
Subject: Re: Problem when trying to connect to hive server using jdbc

Yes,

I restart all Hadoop/Hive services every time I change something.

The content of my /var/log/hive/hive-metastore.log file is

-------------------------------------------------------------------------------------------------------------------------------------------------------
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/util/VersionInfo
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.util.VersionInfo
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class: org.apache.hadoop.util.VersionInfo. Program will exit.
/usr/lib/hive/bin/hive: line 179: conditional binary operator expected
/usr/lib/hive/bin/hive: line 179: syntax error near unexpected token `=~'
/usr/lib/hive/bin/hive: line 179: `if [[ "$HADOOP_VERSION" =~ $hadoop_version_re ]]; then'
-------------------------------------------------------------------------------------------------------------------------------------------------------

 /var/log/hive/hive-server.log and  /var/log/hive/hive-server2.log have the same content. But I do not think these seem to be outdated logs.

ll /var/log/hive/
total 24
4 drwxr-xr-x  2 hive 4096 Feb 15 12:16 ./
8 drwxr-xr-x 41 root 4096 Apr  1 21:02 ../
4 -rw-r--r--  1 hive  863 Apr  2 17:06 hive-metastore.log
4 -rw-r--r--  1 hive  863 Mar 28 14:01 hive-server.log
4 -rw-r--r--  1 hive  863 Mar 29 19:10 hive-server2.log
I suppose there must be others containing recent operations.

On 2 April 2013 17:38, Sanjay Subramanian <[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>> wrote:
I assume u Restarted all services
Sequence
Stop hive-server2; hive-server1; Hive-meta-store
Stop Hive-meta-store, hive-server1; hive-server2;

We should see  /var/log/hive/*.log to see any startup errors…we need to fix those first
From: demian rosas <[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>>
Reply-To: "[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>" <[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>>
Date: Tuesday, April 2, 2013 5:30 PM

To: "[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>" <[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>>
Subject: Re: Problem when trying to connect to hive server using jdbc

By the way, I have hive-metastore and hive-server services running
On 2 April 2013 17:26, demian rosas <[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>> wrote:
Thanks for the hints.

I have tried everything suggested.

Configured for using hive-server 1, got mysql connector 5.1.22, set  hive.server.thrift.port in hive-site.xml have also double checked the CLASSPATH.

My mysql server is in the same machine as my hadoop/hive configuration.

I can connect to mysql using jdbc with the credentials set in hive-site.xml.

I fixed hive.metastore.uris to contain the IP address of my machine instead of "localhost". Now when I run "show tables" with debug messages in the hive console I get this:

hive> show tables;
13/04/02 17:10:25 INFO ql.Driver: <PERFLOG method=Driver.run>
13/04/02 17:10:25 INFO ql.Driver: <PERFLOG method=TimeToSubmit>
13/04/02 17:10:25 INFO ql.Driver: <PERFLOG method=compile>
13/04/02 17:10:25 INFO parse.ParseDriver: Parsing command: show tables
13/04/02 17:10:25 INFO parse.ParseDriver: Parse Completed
13/04/02 17:10:26 INFO ql.Driver: Semantic Analysis Completed
13/04/02 17:10:26 INFO exec.ListSinkOperator: Initializing Self 0 OP
13/04/02 17:10:26 INFO exec.ListSinkOperator: Operator 0 OP initialized
13/04/02 17:10:26 INFO exec.ListSinkOperator: Initialization Done 0 OP
13/04/02 17:10:26 INFO ql.Driver: Returning Hive schema: