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 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: Schema(fieldSchemas:[FieldSchema(name:tab_name, type:string, comment:from deserializer)], properties:null)
13/04/02 17:10:26 INFO ql.Driver: </PERFLOG method=compile start=1364947825805 end=1364947826183 duration=378>
13/04/02 17:10:26 INFO ql.Driver: <PERFLOG method=Driver.execute>
13/04/02 17:10:26 INFO ql.Driver: Starting command: show tables
13/04/02 17:10:26 INFO ql.Driver: </PERFLOG method=TimeToSubmit start=1364947825805 end=1364947826197 duration=392>
13/04/02 17:10:26 INFO hive.metastore: Trying to connect to metastore with URI thrift://10.240.81.72:3306<http://10.240.81.72:3306>
13/04/02 17:10:26 INFO hive.metastore: Waiting 1 seconds before next connection attempt.
13/04/02 17:10:27 INFO hive.metastore: Connected to metastore.
13/04/02 17:10:28 WARN metastore.RetryingMetaStoreClient: MetaStoreClient lost connection. Attempting to reconnect.
org.apache.thrift.transport.TTransportException
        at org.apache.thrift.transport.TIOStreamTransport.read(TIOStreamTransport.java:132)
        at org.apache.thrift.transport.TTransport.readAll(TTransport.java:84)
        at org.apache.thrift.protocol.TBinaryProtocol.readStringBody(TBinaryProtocol.java:354)
        at org.apache.thrift.protocol.TBinaryProtocol.readMessageBegin(TBinaryProtocol.java:215)
        at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:69)
        at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.recv_get_database(ThriftHiveMetastore.java:412)
        at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.get_database(ThriftHiveMetastore.java:399)
        at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.getDatabase(HiveMetaStoreClient.java:736)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.invoke(RetryingMetaStoreClient.java:74)
        at $Proxy9.getDatabase(Unknown Source)
        at org.apache.hadoop.hive.ql.metadata.Hive.getDatabase(Hive.java:1114)
        at org.apache.hadoop.hive.ql.metadata.Hive.databaseExists(Hive.java:1103)
        at org.apache.hadoop.hive.ql.exec.DDLTask.showTables(DDLTask.java:2206)
        at org.apache.hadoop.hive.ql.exec.DDLTask.execute(DDLTask.java:334)
        at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:138)
        at org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:57)
        at org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:1352)
        at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:1138)
        at org.apache.hadoop.hive.ql.Driver.run(Driver.java:951)
        at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:259)
        at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:216)
        at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:412)
        at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:755)
        at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:613)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:208)
13/04/02 17:10:29 INFO hive.metastore: Trying to connect to metastore with URI thrift://10.240.81.72:3306<http://10.240.81.72:3306>
13/04/02 17:10:29 INFO hive.metasto