Return-Path: X-Original-To: apmail-hadoop-hdfs-user-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AEADC111E4 for ; Wed, 21 May 2014 12:41:19 +0000 (UTC) Received: (qmail 24019 invoked by uid 500); 21 May 2014 12:41:15 -0000 Delivered-To: apmail-hadoop-hdfs-user-archive@hadoop.apache.org Received: (qmail 23888 invoked by uid 500); 21 May 2014 12:41:15 -0000 Mailing-List: contact user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hadoop.apache.org Delivered-To: mailing list user@hadoop.apache.org Received: (qmail 23881 invoked by uid 99); 21 May 2014 12:41:14 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 May 2014 12:41:14 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of harish.tangella@gmail.com designates 209.85.213.41 as permitted sender) Received: from [209.85.213.41] (HELO mail-yh0-f41.google.com) (209.85.213.41) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 May 2014 12:41:11 +0000 Received: by mail-yh0-f41.google.com with SMTP id f73so1590868yha.14 for ; Wed, 21 May 2014 05:40:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=CYK9f1XaWgJ29TndwZeVw+iohnT5Cb8KaCWObm4IDkM=; b=lhcELwZJTGneqY63in/VdP16ZTkYh6TrE8FNchOI+zbEj91h8PpTrO/92rD2I2ACyk aJ/nqLp3711xs1yanWtkc22dRFX4mIHFtOTLU6U9pNDOQCB+hvGhxmnb0mpNw6mMKIuG igDLSs+769RgVc5q92sKGBdbIxIKjMmr2htWhxfi6t36qILFYmfZAluvV/Pnzsw1/yNd tuN6YyGnP0NzPb3kg55Kw23M9/ujcdmxt8eACMPGjJbQBNim6oQLWVxhR0CBWtmRrBss qi8WDgFPfoBWNaGVGClMLfm1uBR3RP1m8kl5BT+rataeAavuRpJtWRS74wmLAiVJeJpc gwIA== MIME-Version: 1.0 X-Received: by 10.236.74.33 with SMTP id w21mr21109042yhd.87.1400676047581; Wed, 21 May 2014 05:40:47 -0700 (PDT) Received: by 10.170.189.132 with HTTP; Wed, 21 May 2014 05:40:47 -0700 (PDT) In-Reply-To: References: Date: Wed, 21 May 2014 18:10:47 +0530 Message-ID: Subject: Re: Unable to connect Hive using JDBC program From: harish tangella To: user@hadoop.apache.org Content-Type: multipart/alternative; boundary=20cf30050c7242f79704f9e84e8b X-Virus-Checked: Checked by ClamAV on apache.org --20cf30050c7242f79704f9e84e8b Content-Type: text/plain; charset=UTF-8 Hi, Close the hive terminal and start the new without giving port number the command is hive --service hiveserver don't give any port number hope it will works On Mon, May 19, 2014 at 11:27 PM, Sanjeevv Sriram wrote: > I tried with different ports... still I am getting the same issue > > > On Mon, May 19, 2014 at 8:02 AM, harish tangella < > harish.tangella@gmail.com> wrote: > >> Hi, >> >> >> Start Hive server on a different port number,and try to connect using >> JDBC connection >> >> On Mon, May 19, 2014 at 11:06 AM, Shengjun Xin wrote: >> >>> Can you use command line to connect hive? >>> >>> >>> On Mon, May 19, 2014 at 4:59 AM, Sanjeevv Sriram wrote: >>> >>>> Hi, >>>> >>>> Please help me I am unable to connect Hive using JDBC program. >>>> >>>> I am getting below exception: >>>> >>>> Exception in thread "main" java.sql.SQLException: >>>> org.apache.thrift.transport.TTransportException: java.net.SocketException: >>>> Connection reset >>>> at >>>> org.apache.hadoop.hive.jdbc.HiveStatement.executeQuery(HiveStatement.java:196) >>>> at >>>> org.apache.hadoop.hive.jdbc.HiveStatement.execute(HiveStatement.java:132) >>>> at >>>> org.apache.hadoop.hive.jdbc.HiveConnection.configureConnection(HiveConnection.java:132) >>>> at >>>> org.apache.hadoop.hive.jdbc.HiveConnection.(HiveConnection.java:122) >>>> at >>>> org.apache.hadoop.hive.jdbc.HiveDriver.connect(HiveDriver.java:106) >>>> at java.sql.DriverManager.getConnection(DriverManager.java:571) >>>> at java.sql.DriverManager.getConnection(DriverManager.java:215) >>>> at com.hivejdbc.Con.main(Con.java:16) >>>> >>>> >>>> My connection program: >>>> >>>> Class.forName("org.apache.hadoop.hive.jdbc.HiveDriver"); >>>> Connection conn = >>>> DriverManager.getConnection("jdbc:hive://localhost:10000/poc", "hiveuser1", >>>> "hiveuser1"); >>>> >>>> >>>> *I am started Hive thrift server:* >>>> $ hive --service hiveserver -p 10000 >>>> >>>> (tried with ports 10000 ans 10001) >>>> >>>> >>>> >>>> *Hive-site.xml* >>>> >>>> >>>> hive.metastore.uris >>>> thrift://localhost.localdomain:10000 >>>> >>>> >>>> >>>> javax.jdo.option.ConnectionURL >>>> >>>> jdbc:mysql://localhost:3306/metastore?createDatabaseIfNotExist=true >>>> the URL of the MySQL database >>>> >>>> >>>> >>>> javax.jdo.option.ConnectionDriverName >>>> com.mysql.jdbc.Driver >>>> >>>> >>>> >>>> javax.jdo.option.ConnectionUserName >>>> hiveuser1 >>>> >>>> >>>> >>>> javax.jdo.option.ConnectionPassword >>>> hiveuser1 >>>> >>>> >>>> >>>> Thanks, >>>> Sanjeevv >>>> >>> >>> >>> >>> -- >>> Regards >>> Shengjun >>> >> >> > --20cf30050c7242f79704f9e84e8b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi,
=C2=A0
=C2=A0 Close the hive terminal and start the new without giving port n= umber the command is
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0
hive --service hiveserver don't give any port number hope it will = works

On Mon, May 19, 2014 at 11:27 PM, Sanjeevv Srira= m <sanj2eevv@gmail.com> wrote:
I tried with different ports... still I am getting the sam= e issue


On Mon, May 19, 2014 at 8:02 AM, harish tangella= <harish.tangella@gmail.com> wrote:
Hi,
=C2=A0
=C2=A0
Start Hive server on a different port number,and try to connect using = JDBC connection

On Mon, May 19, 2014 at 11:06 AM, Shengjun Xin <= span dir=3D"ltr"><sxin@gopivotal.com> wrote:
Can you use command = line to connect hive?


On Mon, May 19, 2014 at 4:59 AM, Sanjeevv Sriram= <sanj2eevv@gmail.com> wrote:
Hi,

Please help me I am unable to connect Hive using JDBC= program.

I am getting below exception:

Exception in th= read "main" java.sql.SQLException: org.apache.thrift.transport.TT= ransportException: java.net.SocketException: Connection reset
=C2=A0=C2=A0=C2=A0 at org.apache.hadoop.hive.jdbc.HiveStatement.executeQuer= y(HiveStatement.java:196)
=C2=A0=C2=A0=C2=A0 at org.apache.hadoop.hive.j= dbc.HiveStatement.execute(HiveStatement.java:132)
=C2=A0=C2=A0=C2=A0 at = org.apache.hadoop.hive.jdbc.HiveConnection.configureConnection(HiveConnecti= on.java:132)
=C2=A0=C2=A0=C2=A0 at org.apache.hadoop.hive.jdbc.HiveConnection.<init&g= t;(HiveConnection.java:122)
=C2=A0=C2=A0=C2=A0 at org.apache.hadoop.hive= .jdbc.HiveDriver.connect(HiveDriver.java:106)
=C2=A0=C2=A0=C2=A0 at java= .sql.DriverManager.getConnection(DriverManager.java:571)
=C2=A0=C2=A0=C2=A0 at java.sql.DriverManager.getConnection(DriverManager.ja= va:215)
=C2=A0=C2=A0=C2=A0 at com.hivejdbc.Con.main(Con.java:16)

=

My connection program:

=C2=A0 Class.forName("org.apache.ha= doop.hive.jdbc.HiveDriver");
=C2=A0 Connection conn =3D DriverManag= er.getConnection("jdbc:hive://localhost:10000/poc", "hiveuse= r1", "hiveuser1");


I am started Hive thrift server:
$ hive --service hiveserver= -p 10000

(tried with ports 10000 ans 10001)



Hive-site.xml

<property>
=C2=A0=C2=A0=C2=A0 <name>hive.metastore.= uris</name>
=C2=A0=C2=A0=C2=A0 <value>thrift://localhost.loc= aldomain:10000</value>
=C2=A0 </property>

<propert= y>
<name>javax.jdo.option.ConnectionURL</name>
=C2=A0 <value>jdbc:mysql://localhost:3306/metastore?createDatabaseIfN= otExist=3Dtrue</value>
=C2=A0 <description>the URL of the My= SQL database</description>
</property>

<property&g= t;
=C2=A0 <name>javax.jdo.option.ConnectionDriverName</name>=
=C2=A0 <value>com.mysql.jdbc.Driver</value>
</property>= ;

<property>
=C2=A0 <name>javax.jdo.option.Connection= UserName</name>
=C2=A0 <value>hiveuser1</value>
<= ;/property>

<property>
=C2=A0 <name>javax.jdo.option.ConnectionPassw= ord</name>
=C2=A0 <value>hiveuser1</value>
</pro= perty>


Thanks,
Sanjeevv
=



--
Regards
Shengjun
<= /div>

=

--20cf30050c7242f79704f9e84e8b--