You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hadoop.apache.org by Sanjeevv Sriram <sa...@gmail.com> on 2014/05/18 22:59:49 UTC

Unable to connect Hive using JDBC program

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.<init>(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*

<property>
    <name>hive.metastore.uris</name>
    <value>thrift://localhost.localdomain:10000</value>
  </property>

<property>
<name>javax.jdo.option.ConnectionURL</name>

<value>jdbc:mysql://localhost:3306/metastore?createDatabaseIfNotExist=true</value>
  <description>the URL of the MySQL database</description>
</property>

<property>
  <name>javax.jdo.option.ConnectionDriverName</name>
  <value>com.mysql.jdbc.Driver</value>
</property>

<property>
  <name>javax.jdo.option.ConnectionUserName</name>
  <value>hiveuser1</value>
</property>

<property>
  <name>javax.jdo.option.ConnectionPassword</name>
  <value>hiveuser1</value>
</property>


Thanks,
Sanjeevv

Re: Unable to connect Hive using JDBC program

Posted by Sanjeevv Sriram <sa...@gmail.com>.
Yes, I can connect to Hive


On Mon, May 19, 2014 at 12:36 AM, Shengjun Xin <sx...@gopivotal.com> wrote:

> Can you use command line to connect hive?
>
>
> On Mon, May 19, 2014 at 4:59 AM, Sanjeevv Sriram <sa...@gmail.com>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.<init>(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*
>>
>> <property>
>>     <name>hive.metastore.uris</name>
>>     <value>thrift://localhost.localdomain:10000</value>
>>   </property>
>>
>> <property>
>> <name>javax.jdo.option.ConnectionURL</name>
>>
>> <value>jdbc:mysql://localhost:3306/metastore?createDatabaseIfNotExist=true</value>
>>   <description>the URL of the MySQL database</description>
>> </property>
>>
>> <property>
>>   <name>javax.jdo.option.ConnectionDriverName</name>
>>   <value>com.mysql.jdbc.Driver</value>
>> </property>
>>
>> <property>
>>   <name>javax.jdo.option.ConnectionUserName</name>
>>   <value>hiveuser1</value>
>> </property>
>>
>> <property>
>>   <name>javax.jdo.option.ConnectionPassword</name>
>>   <value>hiveuser1</value>
>> </property>
>>
>>
>> Thanks,
>> Sanjeevv
>>
>
>
>
> --
> Regards
> Shengjun
>

Re: Unable to connect Hive using JDBC program

Posted by sunitha penakalapati <s_...@yahoo.com>.
Hi,
 
Please try this out..
 
 
To Start Hive on a perticular port----->
[training@localhost hive]$ hive --service hiveserver 9999
Starting Hive Thrift Server
Hive history file=/tmp/training/hive_job_log_training_201405212357_1347630673.txt
OK

 
Sample Java Code to connect to hive --->
 
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;

public class HiveConn {
 private static String driverName = "org.apache.hadoop.hive.jdbc.HiveDriver";
 
 public static void test()
 {
  try{
   Class.forName(driverName);
   Connection con = DriverManager.getConnection("jdbc:hive://localhost:9999/default","","");
     
   Statement stmt = con.createStatement();
   
   // show tables
      String sql = "show tables ";
      System.out.println("Running: " + sql);
      ResultSet res = stmt.executeQuery(sql);
      if (res.next()) {
        System.out.println("Table Names===="+res.getString(1));
      }
  }catch(Exception e)
  {
   System.out.println(""+e.getMessage());
  }
 }
 
 public static void main(String args[])
 {
  test();
}}
 
Regards,
Sunitha.
 
 
 

From: Sanjeevv Sriram <sa...@gmail.com>
To: user@hadoop.apache.org 
Sent: Wednesday, May 21, 2014 11:44 PM
Subject: Re: Unable to connect Hive using JDBC program





When I try to start hive server with out any port, I am getting below exception

[cloudera@localhost lib]$ hive --service hiveserver
Starting Hive Thrift Server
14/05/21 21:20:26 INFO Configuration.deprecation: mapred.input.dir.recursive is deprecated. Instead, use mapreduce.input.fileinputformat.input.dir.recursive
14/05/21 21:20:26 INFO Configuration.deprecation: mapred.max.split.size is deprecated. Instead, use mapreduce.input.fileinputformat.split.maxsize
14/05/21 21:20:26 INFO Configuration.deprecation: mapred.min.split.size is deprecated. Instead, use mapreduce.input.fileinputformat.split.minsize
14/05/21 21:20:26 INFO Configuration.deprecation: mapred.min.split.size.per.rack is deprecated. Instead, use mapreduce.input.fileinputformat.split.minsize.per.rack
14/05/21 21:20:26 INFO Configuration.deprecation: mapred.min.split.size.per.node is deprecated. Instead, use mapreduce.input.fileinputformat.split.minsize.per.node
14/05/21 21:20:26 INFO Configuration.deprecation: mapred.reduce.tasks is deprecated. Instead, use mapreduce.job.reduces
14/05/21 21:20:26 INFO Configuration.deprecation: mapred.reduce.tasks.speculative.execution is deprecated. Instead, use mapreduce.reduce.speculative
14/05/21 21:20:26 WARN conf.HiveConf: DEPRECATED: Configuration property hive.metastore.local no longer has any effect. Make sure to provide a valid value for hive.metastore.uris if you are connecting to a remote metastore.
org.apache.thrift.transport.TTransportException: Could not create ServerSocket on address 0.0.0.0/0.0.0.0:10000.
    at org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:93)
    at org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:75)
    at org.apache.hadoop.hive.metastore.TServerSocketKeepAlive.<init>(TServerSocketKeepAlive.java:34)
    at org.apache.hadoop.hive.service.HiveServer.main(HiveServer.java:674)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.hadoop.util.RunJar.main(RunJar.java:212)

I am attaching hive-site.xml. 

I am using CDH 5 verson.

Thanks,
Sanjeevv 



On Wed, May 21, 2014 at 7:40 AM, harish tangella <ha...@gmail.com> wrote:

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 <sa...@gmail.com> wrote:
>
>I tried with different ports... still I am getting the same issue
>>
>>
>>
>>On Mon, May 19, 2014 at 8:02 AM, harish tangella <ha...@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 <sx...@gopivotal.com> wrote:
>>>
>>>Can you use command line to connect hive?
>>>>
>>>>
>>>>
>>>>
>>>>On Mon, May 19, 2014 at 4:59 AM, Sanjeevv Sriram <sa...@gmail.com> 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.<init>(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
>>>>>
>>>>>
>>>>><property>
>>>>>    <name>hive.metastore.uris</name>
>>>>>    <value>thrift://localhost.localdomain:10000</value>
>>>>>  </property>
>>>>>
>>>>><property> 
>>>>><name>javax.jdo.option.ConnectionURL</name>
>>>>>  <value>jdbc:mysql://localhost:3306/metastore?createDatabaseIfNotExist=true</value>
>>>>>  <description>the URL of the MySQL database</description>
>>>>></property>
>>>>>
>>>>><property>
>>>>>  <name>javax.jdo.option.ConnectionDriverName</name>
>>>>>  <value>com.mysql.jdbc.Driver</value>
>>>>></property>
>>>>>
>>>>><property>
>>>>>  <name>javax.jdo.option.ConnectionUserName</name>
>>>>>  <value>hiveuser1</value>
>>>>></property>
>>>>>
>>>>><property>
>>>>>  <name>javax.jdo.option.ConnectionPassword</name>
>>>>>  <value>hiveuser1</value>
>>>>></property>
>>>>>
>>>>>
>>>>>Thanks,
>>>>>Sanjeevv
>>>>>
>>>>
>>>>
>>>>-- 
>>>>
>>>>Regards 
>>>>Shengjun
>>>>
>>>
>>
>

Re: Unable to connect Hive using JDBC program

Posted by Abhishek Girish <ag...@ncsu.edu>.
Could you try the following sequence of commands:

*$ sudo lsof -i :<port>*   (Try for 9083, 10000 and other previous ports
you may have attempted to use)

If there already exists a process, it would be listed. You could then kill
the same and then attempt to restart metastore followed by hiveserver as
shown below:

*$ hive --service metastore &*

*$ hive --service hiveserver & *


-Abhishek


On Wed, May 21, 2014 at 4:15 PM, Mohammad Tariq <do...@gmail.com> wrote:

> Could you please show me your code?
>
> *Warm regards,*
> *Mohammad Tariq*
> *cloudfront.blogspot.com <http://cloudfront.blogspot.com>*
>
>
> On Wed, May 21, 2014 at 11:44 PM, Sanjeevv Sriram <sa...@gmail.com>wrote:
>
>>
>>
>> When I try to start hive server with out any port, I am getting below
>> exception
>>
>> [cloudera@localhost lib]$ hive --service hiveserver
>> Starting Hive Thrift Server
>> 14/05/21 21:20:26 INFO Configuration.deprecation:
>> mapred.input.dir.recursive is deprecated. Instead, use
>> mapreduce.input.fileinputformat.input.dir.recursive
>> 14/05/21 21:20:26 INFO Configuration.deprecation: mapred.max.split.size
>> is deprecated. Instead, use mapreduce.input.fileinputformat.split.maxsize
>> 14/05/21 21:20:26 INFO Configuration.deprecation: mapred.min.split.size
>> is deprecated. Instead, use mapreduce.input.fileinputformat.split.minsize
>> 14/05/21 21:20:26 INFO Configuration.deprecation:
>> mapred.min.split.size.per.rack is deprecated. Instead, use
>> mapreduce.input.fileinputformat.split.minsize.per.rack
>> 14/05/21 21:20:26 INFO Configuration.deprecation:
>> mapred.min.split.size.per.node is deprecated. Instead, use
>> mapreduce.input.fileinputformat.split.minsize.per.node
>> 14/05/21 21:20:26 INFO Configuration.deprecation: mapred.reduce.tasks is
>> deprecated. Instead, use mapreduce.job.reduces
>> 14/05/21 21:20:26 INFO Configuration.deprecation:
>> mapred.reduce.tasks.speculative.execution is deprecated. Instead, use
>> mapreduce.reduce.speculative
>> 14/05/21 21:20:26 WARN conf.HiveConf: DEPRECATED: Configuration property
>> hive.metastore.local no longer has any effect. Make sure to provide a valid
>> value for hive.metastore.uris if you are connecting to a remote metastore.
>> org.apache.thrift.transport.TTransportException: Could not create
>> ServerSocket on address 0.0.0.0/0.0.0.0:10000.
>>     at
>> org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:93)
>>     at
>> org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:75)
>>     at
>> org.apache.hadoop.hive.metastore.TServerSocketKeepAlive.<init>(TServerSocketKeepAlive.java:34)
>>     at org.apache.hadoop.hive.service.HiveServer.main(HiveServer.java:674)
>>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>     at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>     at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>     at java.lang.reflect.Method.invoke(Method.java:606)
>>     at org.apache.hadoop.util.RunJar.main(RunJar.java:212)
>>
>> I am attaching hive-site.xml.
>>
>> I am using CDH 5 verson.
>>
>> Thanks,
>> Sanjeevv
>>
>>
>> On Wed, May 21, 2014 at 7:40 AM, harish tangella <
>> harish.tangella@gmail.com> wrote:
>>
>>> 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 <sa...@gmail.com>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 <sx...@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 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.<init>(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*
>>>>>>>
>>>>>>> <property>
>>>>>>>     <name>hive.metastore.uris</name>
>>>>>>>     <value>thrift://localhost.localdomain:10000</value>
>>>>>>>   </property>
>>>>>>>
>>>>>>> <property>
>>>>>>> <name>javax.jdo.option.ConnectionURL</name>
>>>>>>>
>>>>>>> <value>jdbc:mysql://localhost:3306/metastore?createDatabaseIfNotExist=true</value>
>>>>>>>   <description>the URL of the MySQL database</description>
>>>>>>> </property>
>>>>>>>
>>>>>>> <property>
>>>>>>>   <name>javax.jdo.option.ConnectionDriverName</name>
>>>>>>>   <value>com.mysql.jdbc.Driver</value>
>>>>>>> </property>
>>>>>>>
>>>>>>> <property>
>>>>>>>   <name>javax.jdo.option.ConnectionUserName</name>
>>>>>>>   <value>hiveuser1</value>
>>>>>>> </property>
>>>>>>>
>>>>>>> <property>
>>>>>>>   <name>javax.jdo.option.ConnectionPassword</name>
>>>>>>>   <value>hiveuser1</value>
>>>>>>> </property>
>>>>>>>
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Sanjeevv
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>>  Regards
>>>>>> Shengjun
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>
>

Re: Unable to connect Hive using JDBC program

Posted by Abhishek Girish <ag...@ncsu.edu>.
Could you try the following sequence of commands:

*$ sudo lsof -i :<port>*   (Try for 9083, 10000 and other previous ports
you may have attempted to use)

If there already exists a process, it would be listed. You could then kill
the same and then attempt to restart metastore followed by hiveserver as
shown below:

*$ hive --service metastore &*

*$ hive --service hiveserver & *


-Abhishek


On Wed, May 21, 2014 at 4:15 PM, Mohammad Tariq <do...@gmail.com> wrote:

> Could you please show me your code?
>
> *Warm regards,*
> *Mohammad Tariq*
> *cloudfront.blogspot.com <http://cloudfront.blogspot.com>*
>
>
> On Wed, May 21, 2014 at 11:44 PM, Sanjeevv Sriram <sa...@gmail.com>wrote:
>
>>
>>
>> When I try to start hive server with out any port, I am getting below
>> exception
>>
>> [cloudera@localhost lib]$ hive --service hiveserver
>> Starting Hive Thrift Server
>> 14/05/21 21:20:26 INFO Configuration.deprecation:
>> mapred.input.dir.recursive is deprecated. Instead, use
>> mapreduce.input.fileinputformat.input.dir.recursive
>> 14/05/21 21:20:26 INFO Configuration.deprecation: mapred.max.split.size
>> is deprecated. Instead, use mapreduce.input.fileinputformat.split.maxsize
>> 14/05/21 21:20:26 INFO Configuration.deprecation: mapred.min.split.size
>> is deprecated. Instead, use mapreduce.input.fileinputformat.split.minsize
>> 14/05/21 21:20:26 INFO Configuration.deprecation:
>> mapred.min.split.size.per.rack is deprecated. Instead, use
>> mapreduce.input.fileinputformat.split.minsize.per.rack
>> 14/05/21 21:20:26 INFO Configuration.deprecation:
>> mapred.min.split.size.per.node is deprecated. Instead, use
>> mapreduce.input.fileinputformat.split.minsize.per.node
>> 14/05/21 21:20:26 INFO Configuration.deprecation: mapred.reduce.tasks is
>> deprecated. Instead, use mapreduce.job.reduces
>> 14/05/21 21:20:26 INFO Configuration.deprecation:
>> mapred.reduce.tasks.speculative.execution is deprecated. Instead, use
>> mapreduce.reduce.speculative
>> 14/05/21 21:20:26 WARN conf.HiveConf: DEPRECATED: Configuration property
>> hive.metastore.local no longer has any effect. Make sure to provide a valid
>> value for hive.metastore.uris if you are connecting to a remote metastore.
>> org.apache.thrift.transport.TTransportException: Could not create
>> ServerSocket on address 0.0.0.0/0.0.0.0:10000.
>>     at
>> org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:93)
>>     at
>> org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:75)
>>     at
>> org.apache.hadoop.hive.metastore.TServerSocketKeepAlive.<init>(TServerSocketKeepAlive.java:34)
>>     at org.apache.hadoop.hive.service.HiveServer.main(HiveServer.java:674)
>>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>     at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>     at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>     at java.lang.reflect.Method.invoke(Method.java:606)
>>     at org.apache.hadoop.util.RunJar.main(RunJar.java:212)
>>
>> I am attaching hive-site.xml.
>>
>> I am using CDH 5 verson.
>>
>> Thanks,
>> Sanjeevv
>>
>>
>> On Wed, May 21, 2014 at 7:40 AM, harish tangella <
>> harish.tangella@gmail.com> wrote:
>>
>>> 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 <sa...@gmail.com>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 <sx...@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 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.<init>(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*
>>>>>>>
>>>>>>> <property>
>>>>>>>     <name>hive.metastore.uris</name>
>>>>>>>     <value>thrift://localhost.localdomain:10000</value>
>>>>>>>   </property>
>>>>>>>
>>>>>>> <property>
>>>>>>> <name>javax.jdo.option.ConnectionURL</name>
>>>>>>>
>>>>>>> <value>jdbc:mysql://localhost:3306/metastore?createDatabaseIfNotExist=true</value>
>>>>>>>   <description>the URL of the MySQL database</description>
>>>>>>> </property>
>>>>>>>
>>>>>>> <property>
>>>>>>>   <name>javax.jdo.option.ConnectionDriverName</name>
>>>>>>>   <value>com.mysql.jdbc.Driver</value>
>>>>>>> </property>
>>>>>>>
>>>>>>> <property>
>>>>>>>   <name>javax.jdo.option.ConnectionUserName</name>
>>>>>>>   <value>hiveuser1</value>
>>>>>>> </property>
>>>>>>>
>>>>>>> <property>
>>>>>>>   <name>javax.jdo.option.ConnectionPassword</name>
>>>>>>>   <value>hiveuser1</value>
>>>>>>> </property>
>>>>>>>
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Sanjeevv
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>>  Regards
>>>>>> Shengjun
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>
>

Re: Unable to connect Hive using JDBC program

Posted by Abhishek Girish <ag...@ncsu.edu>.
Could you try the following sequence of commands:

*$ sudo lsof -i :<port>*   (Try for 9083, 10000 and other previous ports
you may have attempted to use)

If there already exists a process, it would be listed. You could then kill
the same and then attempt to restart metastore followed by hiveserver as
shown below:

*$ hive --service metastore &*

*$ hive --service hiveserver & *


-Abhishek


On Wed, May 21, 2014 at 4:15 PM, Mohammad Tariq <do...@gmail.com> wrote:

> Could you please show me your code?
>
> *Warm regards,*
> *Mohammad Tariq*
> *cloudfront.blogspot.com <http://cloudfront.blogspot.com>*
>
>
> On Wed, May 21, 2014 at 11:44 PM, Sanjeevv Sriram <sa...@gmail.com>wrote:
>
>>
>>
>> When I try to start hive server with out any port, I am getting below
>> exception
>>
>> [cloudera@localhost lib]$ hive --service hiveserver
>> Starting Hive Thrift Server
>> 14/05/21 21:20:26 INFO Configuration.deprecation:
>> mapred.input.dir.recursive is deprecated. Instead, use
>> mapreduce.input.fileinputformat.input.dir.recursive
>> 14/05/21 21:20:26 INFO Configuration.deprecation: mapred.max.split.size
>> is deprecated. Instead, use mapreduce.input.fileinputformat.split.maxsize
>> 14/05/21 21:20:26 INFO Configuration.deprecation: mapred.min.split.size
>> is deprecated. Instead, use mapreduce.input.fileinputformat.split.minsize
>> 14/05/21 21:20:26 INFO Configuration.deprecation:
>> mapred.min.split.size.per.rack is deprecated. Instead, use
>> mapreduce.input.fileinputformat.split.minsize.per.rack
>> 14/05/21 21:20:26 INFO Configuration.deprecation:
>> mapred.min.split.size.per.node is deprecated. Instead, use
>> mapreduce.input.fileinputformat.split.minsize.per.node
>> 14/05/21 21:20:26 INFO Configuration.deprecation: mapred.reduce.tasks is
>> deprecated. Instead, use mapreduce.job.reduces
>> 14/05/21 21:20:26 INFO Configuration.deprecation:
>> mapred.reduce.tasks.speculative.execution is deprecated. Instead, use
>> mapreduce.reduce.speculative
>> 14/05/21 21:20:26 WARN conf.HiveConf: DEPRECATED: Configuration property
>> hive.metastore.local no longer has any effect. Make sure to provide a valid
>> value for hive.metastore.uris if you are connecting to a remote metastore.
>> org.apache.thrift.transport.TTransportException: Could not create
>> ServerSocket on address 0.0.0.0/0.0.0.0:10000.
>>     at
>> org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:93)
>>     at
>> org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:75)
>>     at
>> org.apache.hadoop.hive.metastore.TServerSocketKeepAlive.<init>(TServerSocketKeepAlive.java:34)
>>     at org.apache.hadoop.hive.service.HiveServer.main(HiveServer.java:674)
>>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>     at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>     at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>     at java.lang.reflect.Method.invoke(Method.java:606)
>>     at org.apache.hadoop.util.RunJar.main(RunJar.java:212)
>>
>> I am attaching hive-site.xml.
>>
>> I am using CDH 5 verson.
>>
>> Thanks,
>> Sanjeevv
>>
>>
>> On Wed, May 21, 2014 at 7:40 AM, harish tangella <
>> harish.tangella@gmail.com> wrote:
>>
>>> 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 <sa...@gmail.com>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 <sx...@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 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.<init>(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*
>>>>>>>
>>>>>>> <property>
>>>>>>>     <name>hive.metastore.uris</name>
>>>>>>>     <value>thrift://localhost.localdomain:10000</value>
>>>>>>>   </property>
>>>>>>>
>>>>>>> <property>
>>>>>>> <name>javax.jdo.option.ConnectionURL</name>
>>>>>>>
>>>>>>> <value>jdbc:mysql://localhost:3306/metastore?createDatabaseIfNotExist=true</value>
>>>>>>>   <description>the URL of the MySQL database</description>
>>>>>>> </property>
>>>>>>>
>>>>>>> <property>
>>>>>>>   <name>javax.jdo.option.ConnectionDriverName</name>
>>>>>>>   <value>com.mysql.jdbc.Driver</value>
>>>>>>> </property>
>>>>>>>
>>>>>>> <property>
>>>>>>>   <name>javax.jdo.option.ConnectionUserName</name>
>>>>>>>   <value>hiveuser1</value>
>>>>>>> </property>
>>>>>>>
>>>>>>> <property>
>>>>>>>   <name>javax.jdo.option.ConnectionPassword</name>
>>>>>>>   <value>hiveuser1</value>
>>>>>>> </property>
>>>>>>>
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Sanjeevv
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>>  Regards
>>>>>> Shengjun
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>
>

Re: Unable to connect Hive using JDBC program

Posted by Abhishek Girish <ag...@ncsu.edu>.
Could you try the following sequence of commands:

*$ sudo lsof -i :<port>*   (Try for 9083, 10000 and other previous ports
you may have attempted to use)

If there already exists a process, it would be listed. You could then kill
the same and then attempt to restart metastore followed by hiveserver as
shown below:

*$ hive --service metastore &*

*$ hive --service hiveserver & *


-Abhishek


On Wed, May 21, 2014 at 4:15 PM, Mohammad Tariq <do...@gmail.com> wrote:

> Could you please show me your code?
>
> *Warm regards,*
> *Mohammad Tariq*
> *cloudfront.blogspot.com <http://cloudfront.blogspot.com>*
>
>
> On Wed, May 21, 2014 at 11:44 PM, Sanjeevv Sriram <sa...@gmail.com>wrote:
>
>>
>>
>> When I try to start hive server with out any port, I am getting below
>> exception
>>
>> [cloudera@localhost lib]$ hive --service hiveserver
>> Starting Hive Thrift Server
>> 14/05/21 21:20:26 INFO Configuration.deprecation:
>> mapred.input.dir.recursive is deprecated. Instead, use
>> mapreduce.input.fileinputformat.input.dir.recursive
>> 14/05/21 21:20:26 INFO Configuration.deprecation: mapred.max.split.size
>> is deprecated. Instead, use mapreduce.input.fileinputformat.split.maxsize
>> 14/05/21 21:20:26 INFO Configuration.deprecation: mapred.min.split.size
>> is deprecated. Instead, use mapreduce.input.fileinputformat.split.minsize
>> 14/05/21 21:20:26 INFO Configuration.deprecation:
>> mapred.min.split.size.per.rack is deprecated. Instead, use
>> mapreduce.input.fileinputformat.split.minsize.per.rack
>> 14/05/21 21:20:26 INFO Configuration.deprecation:
>> mapred.min.split.size.per.node is deprecated. Instead, use
>> mapreduce.input.fileinputformat.split.minsize.per.node
>> 14/05/21 21:20:26 INFO Configuration.deprecation: mapred.reduce.tasks is
>> deprecated. Instead, use mapreduce.job.reduces
>> 14/05/21 21:20:26 INFO Configuration.deprecation:
>> mapred.reduce.tasks.speculative.execution is deprecated. Instead, use
>> mapreduce.reduce.speculative
>> 14/05/21 21:20:26 WARN conf.HiveConf: DEPRECATED: Configuration property
>> hive.metastore.local no longer has any effect. Make sure to provide a valid
>> value for hive.metastore.uris if you are connecting to a remote metastore.
>> org.apache.thrift.transport.TTransportException: Could not create
>> ServerSocket on address 0.0.0.0/0.0.0.0:10000.
>>     at
>> org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:93)
>>     at
>> org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:75)
>>     at
>> org.apache.hadoop.hive.metastore.TServerSocketKeepAlive.<init>(TServerSocketKeepAlive.java:34)
>>     at org.apache.hadoop.hive.service.HiveServer.main(HiveServer.java:674)
>>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>     at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>     at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>     at java.lang.reflect.Method.invoke(Method.java:606)
>>     at org.apache.hadoop.util.RunJar.main(RunJar.java:212)
>>
>> I am attaching hive-site.xml.
>>
>> I am using CDH 5 verson.
>>
>> Thanks,
>> Sanjeevv
>>
>>
>> On Wed, May 21, 2014 at 7:40 AM, harish tangella <
>> harish.tangella@gmail.com> wrote:
>>
>>> 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 <sa...@gmail.com>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 <sx...@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 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.<init>(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*
>>>>>>>
>>>>>>> <property>
>>>>>>>     <name>hive.metastore.uris</name>
>>>>>>>     <value>thrift://localhost.localdomain:10000</value>
>>>>>>>   </property>
>>>>>>>
>>>>>>> <property>
>>>>>>> <name>javax.jdo.option.ConnectionURL</name>
>>>>>>>
>>>>>>> <value>jdbc:mysql://localhost:3306/metastore?createDatabaseIfNotExist=true</value>
>>>>>>>   <description>the URL of the MySQL database</description>
>>>>>>> </property>
>>>>>>>
>>>>>>> <property>
>>>>>>>   <name>javax.jdo.option.ConnectionDriverName</name>
>>>>>>>   <value>com.mysql.jdbc.Driver</value>
>>>>>>> </property>
>>>>>>>
>>>>>>> <property>
>>>>>>>   <name>javax.jdo.option.ConnectionUserName</name>
>>>>>>>   <value>hiveuser1</value>
>>>>>>> </property>
>>>>>>>
>>>>>>> <property>
>>>>>>>   <name>javax.jdo.option.ConnectionPassword</name>
>>>>>>>   <value>hiveuser1</value>
>>>>>>> </property>
>>>>>>>
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Sanjeevv
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>>  Regards
>>>>>> Shengjun
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>
>

Re: Unable to connect Hive using JDBC program

Posted by Mohammad Tariq <do...@gmail.com>.
Could you please show me your code?

*Warm regards,*
*Mohammad Tariq*
*cloudfront.blogspot.com <http://cloudfront.blogspot.com>*


On Wed, May 21, 2014 at 11:44 PM, Sanjeevv Sriram <sa...@gmail.com>wrote:

>
>
> When I try to start hive server with out any port, I am getting below
> exception
>
> [cloudera@localhost lib]$ hive --service hiveserver
> Starting Hive Thrift Server
> 14/05/21 21:20:26 INFO Configuration.deprecation:
> mapred.input.dir.recursive is deprecated. Instead, use
> mapreduce.input.fileinputformat.input.dir.recursive
> 14/05/21 21:20:26 INFO Configuration.deprecation: mapred.max.split.size is
> deprecated. Instead, use mapreduce.input.fileinputformat.split.maxsize
> 14/05/21 21:20:26 INFO Configuration.deprecation: mapred.min.split.size is
> deprecated. Instead, use mapreduce.input.fileinputformat.split.minsize
> 14/05/21 21:20:26 INFO Configuration.deprecation:
> mapred.min.split.size.per.rack is deprecated. Instead, use
> mapreduce.input.fileinputformat.split.minsize.per.rack
> 14/05/21 21:20:26 INFO Configuration.deprecation:
> mapred.min.split.size.per.node is deprecated. Instead, use
> mapreduce.input.fileinputformat.split.minsize.per.node
> 14/05/21 21:20:26 INFO Configuration.deprecation: mapred.reduce.tasks is
> deprecated. Instead, use mapreduce.job.reduces
> 14/05/21 21:20:26 INFO Configuration.deprecation:
> mapred.reduce.tasks.speculative.execution is deprecated. Instead, use
> mapreduce.reduce.speculative
> 14/05/21 21:20:26 WARN conf.HiveConf: DEPRECATED: Configuration property
> hive.metastore.local no longer has any effect. Make sure to provide a valid
> value for hive.metastore.uris if you are connecting to a remote metastore.
> org.apache.thrift.transport.TTransportException: Could not create
> ServerSocket on address 0.0.0.0/0.0.0.0:10000.
>     at
> org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:93)
>     at
> org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:75)
>     at
> org.apache.hadoop.hive.metastore.TServerSocketKeepAlive.<init>(TServerSocketKeepAlive.java:34)
>     at org.apache.hadoop.hive.service.HiveServer.main(HiveServer.java:674)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>     at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>     at java.lang.reflect.Method.invoke(Method.java:606)
>     at org.apache.hadoop.util.RunJar.main(RunJar.java:212)
>
> I am attaching hive-site.xml.
>
> I am using CDH 5 verson.
>
> Thanks,
> Sanjeevv
>
>
> On Wed, May 21, 2014 at 7:40 AM, harish tangella <
> harish.tangella@gmail.com> wrote:
>
>> 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 <sa...@gmail.com>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 <sx...@gopivotal.com>wrote:
>>>>
>>>>>  Can you use command line to connect hive?
>>>>>
>>>>>
>>>>> On Mon, May 19, 2014 at 4:59 AM, Sanjeevv Sriram <sa...@gmail.com>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.<init>(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*
>>>>>>
>>>>>> <property>
>>>>>>     <name>hive.metastore.uris</name>
>>>>>>     <value>thrift://localhost.localdomain:10000</value>
>>>>>>   </property>
>>>>>>
>>>>>> <property>
>>>>>> <name>javax.jdo.option.ConnectionURL</name>
>>>>>>
>>>>>> <value>jdbc:mysql://localhost:3306/metastore?createDatabaseIfNotExist=true</value>
>>>>>>   <description>the URL of the MySQL database</description>
>>>>>> </property>
>>>>>>
>>>>>> <property>
>>>>>>   <name>javax.jdo.option.ConnectionDriverName</name>
>>>>>>   <value>com.mysql.jdbc.Driver</value>
>>>>>> </property>
>>>>>>
>>>>>> <property>
>>>>>>   <name>javax.jdo.option.ConnectionUserName</name>
>>>>>>   <value>hiveuser1</value>
>>>>>> </property>
>>>>>>
>>>>>> <property>
>>>>>>   <name>javax.jdo.option.ConnectionPassword</name>
>>>>>>   <value>hiveuser1</value>
>>>>>> </property>
>>>>>>
>>>>>>
>>>>>> Thanks,
>>>>>> Sanjeevv
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>>  Regards
>>>>> Shengjun
>>>>>
>>>>
>>>>
>>>
>>
>

Re: Unable to connect Hive using JDBC program

Posted by Mohammad Tariq <do...@gmail.com>.
Could you please show me your code?

*Warm regards,*
*Mohammad Tariq*
*cloudfront.blogspot.com <http://cloudfront.blogspot.com>*


On Wed, May 21, 2014 at 11:44 PM, Sanjeevv Sriram <sa...@gmail.com>wrote:

>
>
> When I try to start hive server with out any port, I am getting below
> exception
>
> [cloudera@localhost lib]$ hive --service hiveserver
> Starting Hive Thrift Server
> 14/05/21 21:20:26 INFO Configuration.deprecation:
> mapred.input.dir.recursive is deprecated. Instead, use
> mapreduce.input.fileinputformat.input.dir.recursive
> 14/05/21 21:20:26 INFO Configuration.deprecation: mapred.max.split.size is
> deprecated. Instead, use mapreduce.input.fileinputformat.split.maxsize
> 14/05/21 21:20:26 INFO Configuration.deprecation: mapred.min.split.size is
> deprecated. Instead, use mapreduce.input.fileinputformat.split.minsize
> 14/05/21 21:20:26 INFO Configuration.deprecation:
> mapred.min.split.size.per.rack is deprecated. Instead, use
> mapreduce.input.fileinputformat.split.minsize.per.rack
> 14/05/21 21:20:26 INFO Configuration.deprecation:
> mapred.min.split.size.per.node is deprecated. Instead, use
> mapreduce.input.fileinputformat.split.minsize.per.node
> 14/05/21 21:20:26 INFO Configuration.deprecation: mapred.reduce.tasks is
> deprecated. Instead, use mapreduce.job.reduces
> 14/05/21 21:20:26 INFO Configuration.deprecation:
> mapred.reduce.tasks.speculative.execution is deprecated. Instead, use
> mapreduce.reduce.speculative
> 14/05/21 21:20:26 WARN conf.HiveConf: DEPRECATED: Configuration property
> hive.metastore.local no longer has any effect. Make sure to provide a valid
> value for hive.metastore.uris if you are connecting to a remote metastore.
> org.apache.thrift.transport.TTransportException: Could not create
> ServerSocket on address 0.0.0.0/0.0.0.0:10000.
>     at
> org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:93)
>     at
> org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:75)
>     at
> org.apache.hadoop.hive.metastore.TServerSocketKeepAlive.<init>(TServerSocketKeepAlive.java:34)
>     at org.apache.hadoop.hive.service.HiveServer.main(HiveServer.java:674)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>     at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>     at java.lang.reflect.Method.invoke(Method.java:606)
>     at org.apache.hadoop.util.RunJar.main(RunJar.java:212)
>
> I am attaching hive-site.xml.
>
> I am using CDH 5 verson.
>
> Thanks,
> Sanjeevv
>
>
> On Wed, May 21, 2014 at 7:40 AM, harish tangella <
> harish.tangella@gmail.com> wrote:
>
>> 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 <sa...@gmail.com>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 <sx...@gopivotal.com>wrote:
>>>>
>>>>>  Can you use command line to connect hive?
>>>>>
>>>>>
>>>>> On Mon, May 19, 2014 at 4:59 AM, Sanjeevv Sriram <sa...@gmail.com>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.<init>(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*
>>>>>>
>>>>>> <property>
>>>>>>     <name>hive.metastore.uris</name>
>>>>>>     <value>thrift://localhost.localdomain:10000</value>
>>>>>>   </property>
>>>>>>
>>>>>> <property>
>>>>>> <name>javax.jdo.option.ConnectionURL</name>
>>>>>>
>>>>>> <value>jdbc:mysql://localhost:3306/metastore?createDatabaseIfNotExist=true</value>
>>>>>>   <description>the URL of the MySQL database</description>
>>>>>> </property>
>>>>>>
>>>>>> <property>
>>>>>>   <name>javax.jdo.option.ConnectionDriverName</name>
>>>>>>   <value>com.mysql.jdbc.Driver</value>
>>>>>> </property>
>>>>>>
>>>>>> <property>
>>>>>>   <name>javax.jdo.option.ConnectionUserName</name>
>>>>>>   <value>hiveuser1</value>
>>>>>> </property>
>>>>>>
>>>>>> <property>
>>>>>>   <name>javax.jdo.option.ConnectionPassword</name>
>>>>>>   <value>hiveuser1</value>
>>>>>> </property>
>>>>>>
>>>>>>
>>>>>> Thanks,
>>>>>> Sanjeevv
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>>  Regards
>>>>> Shengjun
>>>>>
>>>>
>>>>
>>>
>>
>

Re: Unable to connect Hive using JDBC program

Posted by sunitha penakalapati <s_...@yahoo.com>.
Hi,
 
Please try this out..
 
 
To Start Hive on a perticular port----->
[training@localhost hive]$ hive --service hiveserver 9999
Starting Hive Thrift Server
Hive history file=/tmp/training/hive_job_log_training_201405212357_1347630673.txt
OK

 
Sample Java Code to connect to hive --->
 
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;

public class HiveConn {
 private static String driverName = "org.apache.hadoop.hive.jdbc.HiveDriver";
 
 public static void test()
 {
  try{
   Class.forName(driverName);
   Connection con = DriverManager.getConnection("jdbc:hive://localhost:9999/default","","");
     
   Statement stmt = con.createStatement();
   
   // show tables
      String sql = "show tables ";
      System.out.println("Running: " + sql);
      ResultSet res = stmt.executeQuery(sql);
      if (res.next()) {
        System.out.println("Table Names===="+res.getString(1));
      }
  }catch(Exception e)
  {
   System.out.println(""+e.getMessage());
  }
 }
 
 public static void main(String args[])
 {
  test();
}}
 
Regards,
Sunitha.
 
 
 

From: Sanjeevv Sriram <sa...@gmail.com>
To: user@hadoop.apache.org 
Sent: Wednesday, May 21, 2014 11:44 PM
Subject: Re: Unable to connect Hive using JDBC program





When I try to start hive server with out any port, I am getting below exception

[cloudera@localhost lib]$ hive --service hiveserver
Starting Hive Thrift Server
14/05/21 21:20:26 INFO Configuration.deprecation: mapred.input.dir.recursive is deprecated. Instead, use mapreduce.input.fileinputformat.input.dir.recursive
14/05/21 21:20:26 INFO Configuration.deprecation: mapred.max.split.size is deprecated. Instead, use mapreduce.input.fileinputformat.split.maxsize
14/05/21 21:20:26 INFO Configuration.deprecation: mapred.min.split.size is deprecated. Instead, use mapreduce.input.fileinputformat.split.minsize
14/05/21 21:20:26 INFO Configuration.deprecation: mapred.min.split.size.per.rack is deprecated. Instead, use mapreduce.input.fileinputformat.split.minsize.per.rack
14/05/21 21:20:26 INFO Configuration.deprecation: mapred.min.split.size.per.node is deprecated. Instead, use mapreduce.input.fileinputformat.split.minsize.per.node
14/05/21 21:20:26 INFO Configuration.deprecation: mapred.reduce.tasks is deprecated. Instead, use mapreduce.job.reduces
14/05/21 21:20:26 INFO Configuration.deprecation: mapred.reduce.tasks.speculative.execution is deprecated. Instead, use mapreduce.reduce.speculative
14/05/21 21:20:26 WARN conf.HiveConf: DEPRECATED: Configuration property hive.metastore.local no longer has any effect. Make sure to provide a valid value for hive.metastore.uris if you are connecting to a remote metastore.
org.apache.thrift.transport.TTransportException: Could not create ServerSocket on address 0.0.0.0/0.0.0.0:10000.
    at org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:93)
    at org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:75)
    at org.apache.hadoop.hive.metastore.TServerSocketKeepAlive.<init>(TServerSocketKeepAlive.java:34)
    at org.apache.hadoop.hive.service.HiveServer.main(HiveServer.java:674)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.hadoop.util.RunJar.main(RunJar.java:212)

I am attaching hive-site.xml. 

I am using CDH 5 verson.

Thanks,
Sanjeevv 



On Wed, May 21, 2014 at 7:40 AM, harish tangella <ha...@gmail.com> wrote:

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 <sa...@gmail.com> wrote:
>
>I tried with different ports... still I am getting the same issue
>>
>>
>>
>>On Mon, May 19, 2014 at 8:02 AM, harish tangella <ha...@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 <sx...@gopivotal.com> wrote:
>>>
>>>Can you use command line to connect hive?
>>>>
>>>>
>>>>
>>>>
>>>>On Mon, May 19, 2014 at 4:59 AM, Sanjeevv Sriram <sa...@gmail.com> 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.<init>(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
>>>>>
>>>>>
>>>>><property>
>>>>>    <name>hive.metastore.uris</name>
>>>>>    <value>thrift://localhost.localdomain:10000</value>
>>>>>  </property>
>>>>>
>>>>><property> 
>>>>><name>javax.jdo.option.ConnectionURL</name>
>>>>>  <value>jdbc:mysql://localhost:3306/metastore?createDatabaseIfNotExist=true</value>
>>>>>  <description>the URL of the MySQL database</description>
>>>>></property>
>>>>>
>>>>><property>
>>>>>  <name>javax.jdo.option.ConnectionDriverName</name>
>>>>>  <value>com.mysql.jdbc.Driver</value>
>>>>></property>
>>>>>
>>>>><property>
>>>>>  <name>javax.jdo.option.ConnectionUserName</name>
>>>>>  <value>hiveuser1</value>
>>>>></property>
>>>>>
>>>>><property>
>>>>>  <name>javax.jdo.option.ConnectionPassword</name>
>>>>>  <value>hiveuser1</value>
>>>>></property>
>>>>>
>>>>>
>>>>>Thanks,
>>>>>Sanjeevv
>>>>>
>>>>
>>>>
>>>>-- 
>>>>
>>>>Regards 
>>>>Shengjun
>>>>
>>>
>>
>

Re: Unable to connect Hive using JDBC program

Posted by sunitha penakalapati <s_...@yahoo.com>.
Hi,
 
Please try this out..
 
 
To Start Hive on a perticular port----->
[training@localhost hive]$ hive --service hiveserver 9999
Starting Hive Thrift Server
Hive history file=/tmp/training/hive_job_log_training_201405212357_1347630673.txt
OK

 
Sample Java Code to connect to hive --->
 
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;

public class HiveConn {
 private static String driverName = "org.apache.hadoop.hive.jdbc.HiveDriver";
 
 public static void test()
 {
  try{
   Class.forName(driverName);
   Connection con = DriverManager.getConnection("jdbc:hive://localhost:9999/default","","");
     
   Statement stmt = con.createStatement();
   
   // show tables
      String sql = "show tables ";
      System.out.println("Running: " + sql);
      ResultSet res = stmt.executeQuery(sql);
      if (res.next()) {
        System.out.println("Table Names===="+res.getString(1));
      }
  }catch(Exception e)
  {
   System.out.println(""+e.getMessage());
  }
 }
 
 public static void main(String args[])
 {
  test();
}}
 
Regards,
Sunitha.
 
 
 

From: Sanjeevv Sriram <sa...@gmail.com>
To: user@hadoop.apache.org 
Sent: Wednesday, May 21, 2014 11:44 PM
Subject: Re: Unable to connect Hive using JDBC program





When I try to start hive server with out any port, I am getting below exception

[cloudera@localhost lib]$ hive --service hiveserver
Starting Hive Thrift Server
14/05/21 21:20:26 INFO Configuration.deprecation: mapred.input.dir.recursive is deprecated. Instead, use mapreduce.input.fileinputformat.input.dir.recursive
14/05/21 21:20:26 INFO Configuration.deprecation: mapred.max.split.size is deprecated. Instead, use mapreduce.input.fileinputformat.split.maxsize
14/05/21 21:20:26 INFO Configuration.deprecation: mapred.min.split.size is deprecated. Instead, use mapreduce.input.fileinputformat.split.minsize
14/05/21 21:20:26 INFO Configuration.deprecation: mapred.min.split.size.per.rack is deprecated. Instead, use mapreduce.input.fileinputformat.split.minsize.per.rack
14/05/21 21:20:26 INFO Configuration.deprecation: mapred.min.split.size.per.node is deprecated. Instead, use mapreduce.input.fileinputformat.split.minsize.per.node
14/05/21 21:20:26 INFO Configuration.deprecation: mapred.reduce.tasks is deprecated. Instead, use mapreduce.job.reduces
14/05/21 21:20:26 INFO Configuration.deprecation: mapred.reduce.tasks.speculative.execution is deprecated. Instead, use mapreduce.reduce.speculative
14/05/21 21:20:26 WARN conf.HiveConf: DEPRECATED: Configuration property hive.metastore.local no longer has any effect. Make sure to provide a valid value for hive.metastore.uris if you are connecting to a remote metastore.
org.apache.thrift.transport.TTransportException: Could not create ServerSocket on address 0.0.0.0/0.0.0.0:10000.
    at org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:93)
    at org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:75)
    at org.apache.hadoop.hive.metastore.TServerSocketKeepAlive.<init>(TServerSocketKeepAlive.java:34)
    at org.apache.hadoop.hive.service.HiveServer.main(HiveServer.java:674)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.hadoop.util.RunJar.main(RunJar.java:212)

I am attaching hive-site.xml. 

I am using CDH 5 verson.

Thanks,
Sanjeevv 



On Wed, May 21, 2014 at 7:40 AM, harish tangella <ha...@gmail.com> wrote:

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 <sa...@gmail.com> wrote:
>
>I tried with different ports... still I am getting the same issue
>>
>>
>>
>>On Mon, May 19, 2014 at 8:02 AM, harish tangella <ha...@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 <sx...@gopivotal.com> wrote:
>>>
>>>Can you use command line to connect hive?
>>>>
>>>>
>>>>
>>>>
>>>>On Mon, May 19, 2014 at 4:59 AM, Sanjeevv Sriram <sa...@gmail.com> 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.<init>(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
>>>>>
>>>>>
>>>>><property>
>>>>>    <name>hive.metastore.uris</name>
>>>>>    <value>thrift://localhost.localdomain:10000</value>
>>>>>  </property>
>>>>>
>>>>><property> 
>>>>><name>javax.jdo.option.ConnectionURL</name>
>>>>>  <value>jdbc:mysql://localhost:3306/metastore?createDatabaseIfNotExist=true</value>
>>>>>  <description>the URL of the MySQL database</description>
>>>>></property>
>>>>>
>>>>><property>
>>>>>  <name>javax.jdo.option.ConnectionDriverName</name>
>>>>>  <value>com.mysql.jdbc.Driver</value>
>>>>></property>
>>>>>
>>>>><property>
>>>>>  <name>javax.jdo.option.ConnectionUserName</name>
>>>>>  <value>hiveuser1</value>
>>>>></property>
>>>>>
>>>>><property>
>>>>>  <name>javax.jdo.option.ConnectionPassword</name>
>>>>>  <value>hiveuser1</value>
>>>>></property>
>>>>>
>>>>>
>>>>>Thanks,
>>>>>Sanjeevv
>>>>>
>>>>
>>>>
>>>>-- 
>>>>
>>>>Regards 
>>>>Shengjun
>>>>
>>>
>>
>

Re: Unable to connect Hive using JDBC program

Posted by Mohammad Tariq <do...@gmail.com>.
Could you please show me your code?

*Warm regards,*
*Mohammad Tariq*
*cloudfront.blogspot.com <http://cloudfront.blogspot.com>*


On Wed, May 21, 2014 at 11:44 PM, Sanjeevv Sriram <sa...@gmail.com>wrote:

>
>
> When I try to start hive server with out any port, I am getting below
> exception
>
> [cloudera@localhost lib]$ hive --service hiveserver
> Starting Hive Thrift Server
> 14/05/21 21:20:26 INFO Configuration.deprecation:
> mapred.input.dir.recursive is deprecated. Instead, use
> mapreduce.input.fileinputformat.input.dir.recursive
> 14/05/21 21:20:26 INFO Configuration.deprecation: mapred.max.split.size is
> deprecated. Instead, use mapreduce.input.fileinputformat.split.maxsize
> 14/05/21 21:20:26 INFO Configuration.deprecation: mapred.min.split.size is
> deprecated. Instead, use mapreduce.input.fileinputformat.split.minsize
> 14/05/21 21:20:26 INFO Configuration.deprecation:
> mapred.min.split.size.per.rack is deprecated. Instead, use
> mapreduce.input.fileinputformat.split.minsize.per.rack
> 14/05/21 21:20:26 INFO Configuration.deprecation:
> mapred.min.split.size.per.node is deprecated. Instead, use
> mapreduce.input.fileinputformat.split.minsize.per.node
> 14/05/21 21:20:26 INFO Configuration.deprecation: mapred.reduce.tasks is
> deprecated. Instead, use mapreduce.job.reduces
> 14/05/21 21:20:26 INFO Configuration.deprecation:
> mapred.reduce.tasks.speculative.execution is deprecated. Instead, use
> mapreduce.reduce.speculative
> 14/05/21 21:20:26 WARN conf.HiveConf: DEPRECATED: Configuration property
> hive.metastore.local no longer has any effect. Make sure to provide a valid
> value for hive.metastore.uris if you are connecting to a remote metastore.
> org.apache.thrift.transport.TTransportException: Could not create
> ServerSocket on address 0.0.0.0/0.0.0.0:10000.
>     at
> org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:93)
>     at
> org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:75)
>     at
> org.apache.hadoop.hive.metastore.TServerSocketKeepAlive.<init>(TServerSocketKeepAlive.java:34)
>     at org.apache.hadoop.hive.service.HiveServer.main(HiveServer.java:674)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>     at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>     at java.lang.reflect.Method.invoke(Method.java:606)
>     at org.apache.hadoop.util.RunJar.main(RunJar.java:212)
>
> I am attaching hive-site.xml.
>
> I am using CDH 5 verson.
>
> Thanks,
> Sanjeevv
>
>
> On Wed, May 21, 2014 at 7:40 AM, harish tangella <
> harish.tangella@gmail.com> wrote:
>
>> 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 <sa...@gmail.com>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 <sx...@gopivotal.com>wrote:
>>>>
>>>>>  Can you use command line to connect hive?
>>>>>
>>>>>
>>>>> On Mon, May 19, 2014 at 4:59 AM, Sanjeevv Sriram <sa...@gmail.com>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.<init>(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*
>>>>>>
>>>>>> <property>
>>>>>>     <name>hive.metastore.uris</name>
>>>>>>     <value>thrift://localhost.localdomain:10000</value>
>>>>>>   </property>
>>>>>>
>>>>>> <property>
>>>>>> <name>javax.jdo.option.ConnectionURL</name>
>>>>>>
>>>>>> <value>jdbc:mysql://localhost:3306/metastore?createDatabaseIfNotExist=true</value>
>>>>>>   <description>the URL of the MySQL database</description>
>>>>>> </property>
>>>>>>
>>>>>> <property>
>>>>>>   <name>javax.jdo.option.ConnectionDriverName</name>
>>>>>>   <value>com.mysql.jdbc.Driver</value>
>>>>>> </property>
>>>>>>
>>>>>> <property>
>>>>>>   <name>javax.jdo.option.ConnectionUserName</name>
>>>>>>   <value>hiveuser1</value>
>>>>>> </property>
>>>>>>
>>>>>> <property>
>>>>>>   <name>javax.jdo.option.ConnectionPassword</name>
>>>>>>   <value>hiveuser1</value>
>>>>>> </property>
>>>>>>
>>>>>>
>>>>>> Thanks,
>>>>>> Sanjeevv
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>>  Regards
>>>>> Shengjun
>>>>>
>>>>
>>>>
>>>
>>
>

Re: Unable to connect Hive using JDBC program

Posted by Mohammad Tariq <do...@gmail.com>.
Could you please show me your code?

*Warm regards,*
*Mohammad Tariq*
*cloudfront.blogspot.com <http://cloudfront.blogspot.com>*


On Wed, May 21, 2014 at 11:44 PM, Sanjeevv Sriram <sa...@gmail.com>wrote:

>
>
> When I try to start hive server with out any port, I am getting below
> exception
>
> [cloudera@localhost lib]$ hive --service hiveserver
> Starting Hive Thrift Server
> 14/05/21 21:20:26 INFO Configuration.deprecation:
> mapred.input.dir.recursive is deprecated. Instead, use
> mapreduce.input.fileinputformat.input.dir.recursive
> 14/05/21 21:20:26 INFO Configuration.deprecation: mapred.max.split.size is
> deprecated. Instead, use mapreduce.input.fileinputformat.split.maxsize
> 14/05/21 21:20:26 INFO Configuration.deprecation: mapred.min.split.size is
> deprecated. Instead, use mapreduce.input.fileinputformat.split.minsize
> 14/05/21 21:20:26 INFO Configuration.deprecation:
> mapred.min.split.size.per.rack is deprecated. Instead, use
> mapreduce.input.fileinputformat.split.minsize.per.rack
> 14/05/21 21:20:26 INFO Configuration.deprecation:
> mapred.min.split.size.per.node is deprecated. Instead, use
> mapreduce.input.fileinputformat.split.minsize.per.node
> 14/05/21 21:20:26 INFO Configuration.deprecation: mapred.reduce.tasks is
> deprecated. Instead, use mapreduce.job.reduces
> 14/05/21 21:20:26 INFO Configuration.deprecation:
> mapred.reduce.tasks.speculative.execution is deprecated. Instead, use
> mapreduce.reduce.speculative
> 14/05/21 21:20:26 WARN conf.HiveConf: DEPRECATED: Configuration property
> hive.metastore.local no longer has any effect. Make sure to provide a valid
> value for hive.metastore.uris if you are connecting to a remote metastore.
> org.apache.thrift.transport.TTransportException: Could not create
> ServerSocket on address 0.0.0.0/0.0.0.0:10000.
>     at
> org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:93)
>     at
> org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:75)
>     at
> org.apache.hadoop.hive.metastore.TServerSocketKeepAlive.<init>(TServerSocketKeepAlive.java:34)
>     at org.apache.hadoop.hive.service.HiveServer.main(HiveServer.java:674)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>     at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>     at java.lang.reflect.Method.invoke(Method.java:606)
>     at org.apache.hadoop.util.RunJar.main(RunJar.java:212)
>
> I am attaching hive-site.xml.
>
> I am using CDH 5 verson.
>
> Thanks,
> Sanjeevv
>
>
> On Wed, May 21, 2014 at 7:40 AM, harish tangella <
> harish.tangella@gmail.com> wrote:
>
>> 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 <sa...@gmail.com>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 <sx...@gopivotal.com>wrote:
>>>>
>>>>>  Can you use command line to connect hive?
>>>>>
>>>>>
>>>>> On Mon, May 19, 2014 at 4:59 AM, Sanjeevv Sriram <sa...@gmail.com>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.<init>(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*
>>>>>>
>>>>>> <property>
>>>>>>     <name>hive.metastore.uris</name>
>>>>>>     <value>thrift://localhost.localdomain:10000</value>
>>>>>>   </property>
>>>>>>
>>>>>> <property>
>>>>>> <name>javax.jdo.option.ConnectionURL</name>
>>>>>>
>>>>>> <value>jdbc:mysql://localhost:3306/metastore?createDatabaseIfNotExist=true</value>
>>>>>>   <description>the URL of the MySQL database</description>
>>>>>> </property>
>>>>>>
>>>>>> <property>
>>>>>>   <name>javax.jdo.option.ConnectionDriverName</name>
>>>>>>   <value>com.mysql.jdbc.Driver</value>
>>>>>> </property>
>>>>>>
>>>>>> <property>
>>>>>>   <name>javax.jdo.option.ConnectionUserName</name>
>>>>>>   <value>hiveuser1</value>
>>>>>> </property>
>>>>>>
>>>>>> <property>
>>>>>>   <name>javax.jdo.option.ConnectionPassword</name>
>>>>>>   <value>hiveuser1</value>
>>>>>> </property>
>>>>>>
>>>>>>
>>>>>> Thanks,
>>>>>> Sanjeevv
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>>  Regards
>>>>> Shengjun
>>>>>
>>>>
>>>>
>>>
>>
>

Re: Unable to connect Hive using JDBC program

Posted by sunitha penakalapati <s_...@yahoo.com>.
Hi,
 
Please try this out..
 
 
To Start Hive on a perticular port----->
[training@localhost hive]$ hive --service hiveserver 9999
Starting Hive Thrift Server
Hive history file=/tmp/training/hive_job_log_training_201405212357_1347630673.txt
OK

 
Sample Java Code to connect to hive --->
 
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;

public class HiveConn {
 private static String driverName = "org.apache.hadoop.hive.jdbc.HiveDriver";
 
 public static void test()
 {
  try{
   Class.forName(driverName);
   Connection con = DriverManager.getConnection("jdbc:hive://localhost:9999/default","","");
     
   Statement stmt = con.createStatement();
   
   // show tables
      String sql = "show tables ";
      System.out.println("Running: " + sql);
      ResultSet res = stmt.executeQuery(sql);
      if (res.next()) {
        System.out.println("Table Names===="+res.getString(1));
      }
  }catch(Exception e)
  {
   System.out.println(""+e.getMessage());
  }
 }
 
 public static void main(String args[])
 {
  test();
}}
 
Regards,
Sunitha.
 
 
 

From: Sanjeevv Sriram <sa...@gmail.com>
To: user@hadoop.apache.org 
Sent: Wednesday, May 21, 2014 11:44 PM
Subject: Re: Unable to connect Hive using JDBC program





When I try to start hive server with out any port, I am getting below exception

[cloudera@localhost lib]$ hive --service hiveserver
Starting Hive Thrift Server
14/05/21 21:20:26 INFO Configuration.deprecation: mapred.input.dir.recursive is deprecated. Instead, use mapreduce.input.fileinputformat.input.dir.recursive
14/05/21 21:20:26 INFO Configuration.deprecation: mapred.max.split.size is deprecated. Instead, use mapreduce.input.fileinputformat.split.maxsize
14/05/21 21:20:26 INFO Configuration.deprecation: mapred.min.split.size is deprecated. Instead, use mapreduce.input.fileinputformat.split.minsize
14/05/21 21:20:26 INFO Configuration.deprecation: mapred.min.split.size.per.rack is deprecated. Instead, use mapreduce.input.fileinputformat.split.minsize.per.rack
14/05/21 21:20:26 INFO Configuration.deprecation: mapred.min.split.size.per.node is deprecated. Instead, use mapreduce.input.fileinputformat.split.minsize.per.node
14/05/21 21:20:26 INFO Configuration.deprecation: mapred.reduce.tasks is deprecated. Instead, use mapreduce.job.reduces
14/05/21 21:20:26 INFO Configuration.deprecation: mapred.reduce.tasks.speculative.execution is deprecated. Instead, use mapreduce.reduce.speculative
14/05/21 21:20:26 WARN conf.HiveConf: DEPRECATED: Configuration property hive.metastore.local no longer has any effect. Make sure to provide a valid value for hive.metastore.uris if you are connecting to a remote metastore.
org.apache.thrift.transport.TTransportException: Could not create ServerSocket on address 0.0.0.0/0.0.0.0:10000.
    at org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:93)
    at org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:75)
    at org.apache.hadoop.hive.metastore.TServerSocketKeepAlive.<init>(TServerSocketKeepAlive.java:34)
    at org.apache.hadoop.hive.service.HiveServer.main(HiveServer.java:674)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.hadoop.util.RunJar.main(RunJar.java:212)

I am attaching hive-site.xml. 

I am using CDH 5 verson.

Thanks,
Sanjeevv 



On Wed, May 21, 2014 at 7:40 AM, harish tangella <ha...@gmail.com> wrote:

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 <sa...@gmail.com> wrote:
>
>I tried with different ports... still I am getting the same issue
>>
>>
>>
>>On Mon, May 19, 2014 at 8:02 AM, harish tangella <ha...@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 <sx...@gopivotal.com> wrote:
>>>
>>>Can you use command line to connect hive?
>>>>
>>>>
>>>>
>>>>
>>>>On Mon, May 19, 2014 at 4:59 AM, Sanjeevv Sriram <sa...@gmail.com> 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.<init>(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
>>>>>
>>>>>
>>>>><property>
>>>>>    <name>hive.metastore.uris</name>
>>>>>    <value>thrift://localhost.localdomain:10000</value>
>>>>>  </property>
>>>>>
>>>>><property> 
>>>>><name>javax.jdo.option.ConnectionURL</name>
>>>>>  <value>jdbc:mysql://localhost:3306/metastore?createDatabaseIfNotExist=true</value>
>>>>>  <description>the URL of the MySQL database</description>
>>>>></property>
>>>>>
>>>>><property>
>>>>>  <name>javax.jdo.option.ConnectionDriverName</name>
>>>>>  <value>com.mysql.jdbc.Driver</value>
>>>>></property>
>>>>>
>>>>><property>
>>>>>  <name>javax.jdo.option.ConnectionUserName</name>
>>>>>  <value>hiveuser1</value>
>>>>></property>
>>>>>
>>>>><property>
>>>>>  <name>javax.jdo.option.ConnectionPassword</name>
>>>>>  <value>hiveuser1</value>
>>>>></property>
>>>>>
>>>>>
>>>>>Thanks,
>>>>>Sanjeevv
>>>>>
>>>>
>>>>
>>>>-- 
>>>>
>>>>Regards 
>>>>Shengjun
>>>>
>>>
>>
>

Re: Unable to connect Hive using JDBC program

Posted by Sanjeevv Sriram <sa...@gmail.com>.
When I try to start hive server with out any port, I am getting below
exception

[cloudera@localhost lib]$ hive --service hiveserver
Starting Hive Thrift Server
14/05/21 21:20:26 INFO Configuration.deprecation:
mapred.input.dir.recursive is deprecated. Instead, use
mapreduce.input.fileinputformat.input.dir.recursive
14/05/21 21:20:26 INFO Configuration.deprecation: mapred.max.split.size is
deprecated. Instead, use mapreduce.input.fileinputformat.split.maxsize
14/05/21 21:20:26 INFO Configuration.deprecation: mapred.min.split.size is
deprecated. Instead, use mapreduce.input.fileinputformat.split.minsize
14/05/21 21:20:26 INFO Configuration.deprecation:
mapred.min.split.size.per.rack is deprecated. Instead, use
mapreduce.input.fileinputformat.split.minsize.per.rack
14/05/21 21:20:26 INFO Configuration.deprecation:
mapred.min.split.size.per.node is deprecated. Instead, use
mapreduce.input.fileinputformat.split.minsize.per.node
14/05/21 21:20:26 INFO Configuration.deprecation: mapred.reduce.tasks is
deprecated. Instead, use mapreduce.job.reduces
14/05/21 21:20:26 INFO Configuration.deprecation:
mapred.reduce.tasks.speculative.execution is deprecated. Instead, use
mapreduce.reduce.speculative
14/05/21 21:20:26 WARN conf.HiveConf: DEPRECATED: Configuration property
hive.metastore.local no longer has any effect. Make sure to provide a valid
value for hive.metastore.uris if you are connecting to a remote metastore.
org.apache.thrift.transport.TTransportException: Could not create
ServerSocket on address 0.0.0.0/0.0.0.0:10000.
    at
org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:93)
    at
org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:75)
    at
org.apache.hadoop.hive.metastore.TServerSocketKeepAlive.<init>(TServerSocketKeepAlive.java:34)
    at org.apache.hadoop.hive.service.HiveServer.main(HiveServer.java:674)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.hadoop.util.RunJar.main(RunJar.java:212)

I am attaching hive-site.xml.

I am using CDH 5 verson.

Thanks,
Sanjeevv


On Wed, May 21, 2014 at 7:40 AM, harish tangella
<ha...@gmail.com>wrote:

> 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 <sa...@gmail.com>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 <sx...@gopivotal.com>wrote:
>>>
>>>>  Can you use command line to connect hive?
>>>>
>>>>
>>>> On Mon, May 19, 2014 at 4:59 AM, Sanjeevv Sriram <sa...@gmail.com>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.<init>(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*
>>>>>
>>>>> <property>
>>>>>     <name>hive.metastore.uris</name>
>>>>>     <value>thrift://localhost.localdomain:10000</value>
>>>>>   </property>
>>>>>
>>>>> <property>
>>>>> <name>javax.jdo.option.ConnectionURL</name>
>>>>>
>>>>> <value>jdbc:mysql://localhost:3306/metastore?createDatabaseIfNotExist=true</value>
>>>>>   <description>the URL of the MySQL database</description>
>>>>> </property>
>>>>>
>>>>> <property>
>>>>>   <name>javax.jdo.option.ConnectionDriverName</name>
>>>>>   <value>com.mysql.jdbc.Driver</value>
>>>>> </property>
>>>>>
>>>>> <property>
>>>>>   <name>javax.jdo.option.ConnectionUserName</name>
>>>>>   <value>hiveuser1</value>
>>>>> </property>
>>>>>
>>>>> <property>
>>>>>   <name>javax.jdo.option.ConnectionPassword</name>
>>>>>   <value>hiveuser1</value>
>>>>> </property>
>>>>>
>>>>>
>>>>> Thanks,
>>>>> Sanjeevv
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>>  Regards
>>>> Shengjun
>>>>
>>>
>>>
>>
>

Re: Unable to connect Hive using JDBC program

Posted by Sanjeevv Sriram <sa...@gmail.com>.
When I try to start hive server with out any port, I am getting below
exception

[cloudera@localhost lib]$ hive --service hiveserver
Starting Hive Thrift Server
14/05/21 21:20:26 INFO Configuration.deprecation:
mapred.input.dir.recursive is deprecated. Instead, use
mapreduce.input.fileinputformat.input.dir.recursive
14/05/21 21:20:26 INFO Configuration.deprecation: mapred.max.split.size is
deprecated. Instead, use mapreduce.input.fileinputformat.split.maxsize
14/05/21 21:20:26 INFO Configuration.deprecation: mapred.min.split.size is
deprecated. Instead, use mapreduce.input.fileinputformat.split.minsize
14/05/21 21:20:26 INFO Configuration.deprecation:
mapred.min.split.size.per.rack is deprecated. Instead, use
mapreduce.input.fileinputformat.split.minsize.per.rack
14/05/21 21:20:26 INFO Configuration.deprecation:
mapred.min.split.size.per.node is deprecated. Instead, use
mapreduce.input.fileinputformat.split.minsize.per.node
14/05/21 21:20:26 INFO Configuration.deprecation: mapred.reduce.tasks is
deprecated. Instead, use mapreduce.job.reduces
14/05/21 21:20:26 INFO Configuration.deprecation:
mapred.reduce.tasks.speculative.execution is deprecated. Instead, use
mapreduce.reduce.speculative
14/05/21 21:20:26 WARN conf.HiveConf: DEPRECATED: Configuration property
hive.metastore.local no longer has any effect. Make sure to provide a valid
value for hive.metastore.uris if you are connecting to a remote metastore.
org.apache.thrift.transport.TTransportException: Could not create
ServerSocket on address 0.0.0.0/0.0.0.0:10000.
    at
org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:93)
    at
org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:75)
    at
org.apache.hadoop.hive.metastore.TServerSocketKeepAlive.<init>(TServerSocketKeepAlive.java:34)
    at org.apache.hadoop.hive.service.HiveServer.main(HiveServer.java:674)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.hadoop.util.RunJar.main(RunJar.java:212)

I am attaching hive-site.xml.

I am using CDH 5 verson.

Thanks,
Sanjeevv


On Wed, May 21, 2014 at 7:40 AM, harish tangella
<ha...@gmail.com>wrote:

> 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 <sa...@gmail.com>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 <sx...@gopivotal.com>wrote:
>>>
>>>>  Can you use command line to connect hive?
>>>>
>>>>
>>>> On Mon, May 19, 2014 at 4:59 AM, Sanjeevv Sriram <sa...@gmail.com>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.<init>(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*
>>>>>
>>>>> <property>
>>>>>     <name>hive.metastore.uris</name>
>>>>>     <value>thrift://localhost.localdomain:10000</value>
>>>>>   </property>
>>>>>
>>>>> <property>
>>>>> <name>javax.jdo.option.ConnectionURL</name>
>>>>>
>>>>> <value>jdbc:mysql://localhost:3306/metastore?createDatabaseIfNotExist=true</value>
>>>>>   <description>the URL of the MySQL database</description>
>>>>> </property>
>>>>>
>>>>> <property>
>>>>>   <name>javax.jdo.option.ConnectionDriverName</name>
>>>>>   <value>com.mysql.jdbc.Driver</value>
>>>>> </property>
>>>>>
>>>>> <property>
>>>>>   <name>javax.jdo.option.ConnectionUserName</name>
>>>>>   <value>hiveuser1</value>
>>>>> </property>
>>>>>
>>>>> <property>
>>>>>   <name>javax.jdo.option.ConnectionPassword</name>
>>>>>   <value>hiveuser1</value>
>>>>> </property>
>>>>>
>>>>>
>>>>> Thanks,
>>>>> Sanjeevv
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>>  Regards
>>>> Shengjun
>>>>
>>>
>>>
>>
>

Re: Unable to connect Hive using JDBC program

Posted by Sanjeevv Sriram <sa...@gmail.com>.
When I try to start hive server with out any port, I am getting below
exception

[cloudera@localhost lib]$ hive --service hiveserver
Starting Hive Thrift Server
14/05/21 21:20:26 INFO Configuration.deprecation:
mapred.input.dir.recursive is deprecated. Instead, use
mapreduce.input.fileinputformat.input.dir.recursive
14/05/21 21:20:26 INFO Configuration.deprecation: mapred.max.split.size is
deprecated. Instead, use mapreduce.input.fileinputformat.split.maxsize
14/05/21 21:20:26 INFO Configuration.deprecation: mapred.min.split.size is
deprecated. Instead, use mapreduce.input.fileinputformat.split.minsize
14/05/21 21:20:26 INFO Configuration.deprecation:
mapred.min.split.size.per.rack is deprecated. Instead, use
mapreduce.input.fileinputformat.split.minsize.per.rack
14/05/21 21:20:26 INFO Configuration.deprecation:
mapred.min.split.size.per.node is deprecated. Instead, use
mapreduce.input.fileinputformat.split.minsize.per.node
14/05/21 21:20:26 INFO Configuration.deprecation: mapred.reduce.tasks is
deprecated. Instead, use mapreduce.job.reduces
14/05/21 21:20:26 INFO Configuration.deprecation:
mapred.reduce.tasks.speculative.execution is deprecated. Instead, use
mapreduce.reduce.speculative
14/05/21 21:20:26 WARN conf.HiveConf: DEPRECATED: Configuration property
hive.metastore.local no longer has any effect. Make sure to provide a valid
value for hive.metastore.uris if you are connecting to a remote metastore.
org.apache.thrift.transport.TTransportException: Could not create
ServerSocket on address 0.0.0.0/0.0.0.0:10000.
    at
org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:93)
    at
org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:75)
    at
org.apache.hadoop.hive.metastore.TServerSocketKeepAlive.<init>(TServerSocketKeepAlive.java:34)
    at org.apache.hadoop.hive.service.HiveServer.main(HiveServer.java:674)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.hadoop.util.RunJar.main(RunJar.java:212)

I am attaching hive-site.xml.

I am using CDH 5 verson.

Thanks,
Sanjeevv


On Wed, May 21, 2014 at 7:40 AM, harish tangella
<ha...@gmail.com>wrote:

> 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 <sa...@gmail.com>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 <sx...@gopivotal.com>wrote:
>>>
>>>>  Can you use command line to connect hive?
>>>>
>>>>
>>>> On Mon, May 19, 2014 at 4:59 AM, Sanjeevv Sriram <sa...@gmail.com>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.<init>(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*
>>>>>
>>>>> <property>
>>>>>     <name>hive.metastore.uris</name>
>>>>>     <value>thrift://localhost.localdomain:10000</value>
>>>>>   </property>
>>>>>
>>>>> <property>
>>>>> <name>javax.jdo.option.ConnectionURL</name>
>>>>>
>>>>> <value>jdbc:mysql://localhost:3306/metastore?createDatabaseIfNotExist=true</value>
>>>>>   <description>the URL of the MySQL database</description>
>>>>> </property>
>>>>>
>>>>> <property>
>>>>>   <name>javax.jdo.option.ConnectionDriverName</name>
>>>>>   <value>com.mysql.jdbc.Driver</value>
>>>>> </property>
>>>>>
>>>>> <property>
>>>>>   <name>javax.jdo.option.ConnectionUserName</name>
>>>>>   <value>hiveuser1</value>
>>>>> </property>
>>>>>
>>>>> <property>
>>>>>   <name>javax.jdo.option.ConnectionPassword</name>
>>>>>   <value>hiveuser1</value>
>>>>> </property>
>>>>>
>>>>>
>>>>> Thanks,
>>>>> Sanjeevv
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>>  Regards
>>>> Shengjun
>>>>
>>>
>>>
>>
>

Re: Unable to connect Hive using JDBC program

Posted by Sanjeevv Sriram <sa...@gmail.com>.
When I try to start hive server with out any port, I am getting below
exception

[cloudera@localhost lib]$ hive --service hiveserver
Starting Hive Thrift Server
14/05/21 21:20:26 INFO Configuration.deprecation:
mapred.input.dir.recursive is deprecated. Instead, use
mapreduce.input.fileinputformat.input.dir.recursive
14/05/21 21:20:26 INFO Configuration.deprecation: mapred.max.split.size is
deprecated. Instead, use mapreduce.input.fileinputformat.split.maxsize
14/05/21 21:20:26 INFO Configuration.deprecation: mapred.min.split.size is
deprecated. Instead, use mapreduce.input.fileinputformat.split.minsize
14/05/21 21:20:26 INFO Configuration.deprecation:
mapred.min.split.size.per.rack is deprecated. Instead, use
mapreduce.input.fileinputformat.split.minsize.per.rack
14/05/21 21:20:26 INFO Configuration.deprecation:
mapred.min.split.size.per.node is deprecated. Instead, use
mapreduce.input.fileinputformat.split.minsize.per.node
14/05/21 21:20:26 INFO Configuration.deprecation: mapred.reduce.tasks is
deprecated. Instead, use mapreduce.job.reduces
14/05/21 21:20:26 INFO Configuration.deprecation:
mapred.reduce.tasks.speculative.execution is deprecated. Instead, use
mapreduce.reduce.speculative
14/05/21 21:20:26 WARN conf.HiveConf: DEPRECATED: Configuration property
hive.metastore.local no longer has any effect. Make sure to provide a valid
value for hive.metastore.uris if you are connecting to a remote metastore.
org.apache.thrift.transport.TTransportException: Could not create
ServerSocket on address 0.0.0.0/0.0.0.0:10000.
    at
org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:93)
    at
org.apache.thrift.transport.TServerSocket.<init>(TServerSocket.java:75)
    at
org.apache.hadoop.hive.metastore.TServerSocketKeepAlive.<init>(TServerSocketKeepAlive.java:34)
    at org.apache.hadoop.hive.service.HiveServer.main(HiveServer.java:674)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.hadoop.util.RunJar.main(RunJar.java:212)

I am attaching hive-site.xml.

I am using CDH 5 verson.

Thanks,
Sanjeevv


On Wed, May 21, 2014 at 7:40 AM, harish tangella
<ha...@gmail.com>wrote:

> 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 <sa...@gmail.com>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 <sx...@gopivotal.com>wrote:
>>>
>>>>  Can you use command line to connect hive?
>>>>
>>>>
>>>> On Mon, May 19, 2014 at 4:59 AM, Sanjeevv Sriram <sa...@gmail.com>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.<init>(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*
>>>>>
>>>>> <property>
>>>>>     <name>hive.metastore.uris</name>
>>>>>     <value>thrift://localhost.localdomain:10000</value>
>>>>>   </property>
>>>>>
>>>>> <property>
>>>>> <name>javax.jdo.option.ConnectionURL</name>
>>>>>
>>>>> <value>jdbc:mysql://localhost:3306/metastore?createDatabaseIfNotExist=true</value>
>>>>>   <description>the URL of the MySQL database</description>
>>>>> </property>
>>>>>
>>>>> <property>
>>>>>   <name>javax.jdo.option.ConnectionDriverName</name>
>>>>>   <value>com.mysql.jdbc.Driver</value>
>>>>> </property>
>>>>>
>>>>> <property>
>>>>>   <name>javax.jdo.option.ConnectionUserName</name>
>>>>>   <value>hiveuser1</value>
>>>>> </property>
>>>>>
>>>>> <property>
>>>>>   <name>javax.jdo.option.ConnectionPassword</name>
>>>>>   <value>hiveuser1</value>
>>>>> </property>
>>>>>
>>>>>
>>>>> Thanks,
>>>>> Sanjeevv
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>>  Regards
>>>> Shengjun
>>>>
>>>
>>>
>>
>

Re: Unable to connect Hive using JDBC program

Posted by harish tangella <ha...@gmail.com>.
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 <sa...@gmail.com>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 <sx...@gopivotal.com>wrote:
>>
>>>  Can you use command line to connect hive?
>>>
>>>
>>> On Mon, May 19, 2014 at 4:59 AM, Sanjeevv Sriram <sa...@gmail.com>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.<init>(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*
>>>>
>>>> <property>
>>>>     <name>hive.metastore.uris</name>
>>>>     <value>thrift://localhost.localdomain:10000</value>
>>>>   </property>
>>>>
>>>> <property>
>>>> <name>javax.jdo.option.ConnectionURL</name>
>>>>
>>>> <value>jdbc:mysql://localhost:3306/metastore?createDatabaseIfNotExist=true</value>
>>>>   <description>the URL of the MySQL database</description>
>>>> </property>
>>>>
>>>> <property>
>>>>   <name>javax.jdo.option.ConnectionDriverName</name>
>>>>   <value>com.mysql.jdbc.Driver</value>
>>>> </property>
>>>>
>>>> <property>
>>>>   <name>javax.jdo.option.ConnectionUserName</name>
>>>>   <value>hiveuser1</value>
>>>> </property>
>>>>
>>>> <property>
>>>>   <name>javax.jdo.option.ConnectionPassword</name>
>>>>   <value>hiveuser1</value>
>>>> </property>
>>>>
>>>>
>>>> Thanks,
>>>> Sanjeevv
>>>>
>>>
>>>
>>>
>>> --
>>>  Regards
>>> Shengjun
>>>
>>
>>
>

Re: Unable to connect Hive using JDBC program

Posted by harish tangella <ha...@gmail.com>.
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 <sa...@gmail.com>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 <sx...@gopivotal.com>wrote:
>>
>>>  Can you use command line to connect hive?
>>>
>>>
>>> On Mon, May 19, 2014 at 4:59 AM, Sanjeevv Sriram <sa...@gmail.com>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.<init>(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*
>>>>
>>>> <property>
>>>>     <name>hive.metastore.uris</name>
>>>>     <value>thrift://localhost.localdomain:10000</value>
>>>>   </property>
>>>>
>>>> <property>
>>>> <name>javax.jdo.option.ConnectionURL</name>
>>>>
>>>> <value>jdbc:mysql://localhost:3306/metastore?createDatabaseIfNotExist=true</value>
>>>>   <description>the URL of the MySQL database</description>
>>>> </property>
>>>>
>>>> <property>
>>>>   <name>javax.jdo.option.ConnectionDriverName</name>
>>>>   <value>com.mysql.jdbc.Driver</value>
>>>> </property>
>>>>
>>>> <property>
>>>>   <name>javax.jdo.option.ConnectionUserName</name>
>>>>   <value>hiveuser1</value>
>>>> </property>
>>>>
>>>> <property>
>>>>   <name>javax.jdo.option.ConnectionPassword</name>
>>>>   <value>hiveuser1</value>
>>>> </property>
>>>>
>>>>
>>>> Thanks,
>>>> Sanjeevv
>>>>
>>>
>>>
>>>
>>> --
>>>  Regards
>>> Shengjun
>>>
>>
>>
>

Re: Unable to connect Hive using JDBC program

Posted by harish tangella <ha...@gmail.com>.
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 <sa...@gmail.com>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 <sx...@gopivotal.com>wrote:
>>
>>>  Can you use command line to connect hive?
>>>
>>>
>>> On Mon, May 19, 2014 at 4:59 AM, Sanjeevv Sriram <sa...@gmail.com>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.<init>(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*
>>>>
>>>> <property>
>>>>     <name>hive.metastore.uris</name>
>>>>     <value>thrift://localhost.localdomain:10000</value>
>>>>   </property>
>>>>
>>>> <property>
>>>> <name>javax.jdo.option.ConnectionURL</name>
>>>>
>>>> <value>jdbc:mysql://localhost:3306/metastore?createDatabaseIfNotExist=true</value>
>>>>   <description>the URL of the MySQL database</description>
>>>> </property>
>>>>
>>>> <property>
>>>>   <name>javax.jdo.option.ConnectionDriverName</name>
>>>>   <value>com.mysql.jdbc.Driver</value>
>>>> </property>
>>>>
>>>> <property>
>>>>   <name>javax.jdo.option.ConnectionUserName</name>
>>>>   <value>hiveuser1</value>
>>>> </property>
>>>>
>>>> <property>
>>>>   <name>javax.jdo.option.ConnectionPassword</name>
>>>>   <value>hiveuser1</value>
>>>> </property>
>>>>
>>>>
>>>> Thanks,
>>>> Sanjeevv
>>>>
>>>
>>>
>>>
>>> --
>>>  Regards
>>> Shengjun
>>>
>>
>>
>

Re: Unable to connect Hive using JDBC program

Posted by harish tangella <ha...@gmail.com>.
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 <sa...@gmail.com>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 <sx...@gopivotal.com>wrote:
>>
>>>  Can you use command line to connect hive?
>>>
>>>
>>> On Mon, May 19, 2014 at 4:59 AM, Sanjeevv Sriram <sa...@gmail.com>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.<init>(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*
>>>>
>>>> <property>
>>>>     <name>hive.metastore.uris</name>
>>>>     <value>thrift://localhost.localdomain:10000</value>
>>>>   </property>
>>>>
>>>> <property>
>>>> <name>javax.jdo.option.ConnectionURL</name>
>>>>
>>>> <value>jdbc:mysql://localhost:3306/metastore?createDatabaseIfNotExist=true</value>
>>>>   <description>the URL of the MySQL database</description>
>>>> </property>
>>>>
>>>> <property>
>>>>   <name>javax.jdo.option.ConnectionDriverName</name>
>>>>   <value>com.mysql.jdbc.Driver</value>
>>>> </property>
>>>>
>>>> <property>
>>>>   <name>javax.jdo.option.ConnectionUserName</name>
>>>>   <value>hiveuser1</value>
>>>> </property>
>>>>
>>>> <property>
>>>>   <name>javax.jdo.option.ConnectionPassword</name>
>>>>   <value>hiveuser1</value>
>>>> </property>
>>>>
>>>>
>>>> Thanks,
>>>> Sanjeevv
>>>>
>>>
>>>
>>>
>>> --
>>>  Regards
>>> Shengjun
>>>
>>
>>
>

Re: Unable to connect Hive using JDBC program

Posted by Sanjeevv Sriram <sa...@gmail.com>.
I tried with different ports... still I am getting the same issue


On Mon, May 19, 2014 at 8:02 AM, harish tangella
<ha...@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 <sx...@gopivotal.com> wrote:
>
>>  Can you use command line to connect hive?
>>
>>
>> On Mon, May 19, 2014 at 4:59 AM, Sanjeevv Sriram <sa...@gmail.com>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.<init>(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*
>>>
>>> <property>
>>>     <name>hive.metastore.uris</name>
>>>     <value>thrift://localhost.localdomain:10000</value>
>>>   </property>
>>>
>>> <property>
>>> <name>javax.jdo.option.ConnectionURL</name>
>>>
>>> <value>jdbc:mysql://localhost:3306/metastore?createDatabaseIfNotExist=true</value>
>>>   <description>the URL of the MySQL database</description>
>>> </property>
>>>
>>> <property>
>>>   <name>javax.jdo.option.ConnectionDriverName</name>
>>>   <value>com.mysql.jdbc.Driver</value>
>>> </property>
>>>
>>> <property>
>>>   <name>javax.jdo.option.ConnectionUserName</name>
>>>   <value>hiveuser1</value>
>>> </property>
>>>
>>> <property>
>>>   <name>javax.jdo.option.ConnectionPassword</name>
>>>   <value>hiveuser1</value>
>>> </property>
>>>
>>>
>>> Thanks,
>>> Sanjeevv
>>>
>>
>>
>>
>> --
>>  Regards
>> Shengjun
>>
>
>

Re: Unable to connect Hive using JDBC program

Posted by Sanjeevv Sriram <sa...@gmail.com>.
I tried with different ports... still I am getting the same issue


On Mon, May 19, 2014 at 8:02 AM, harish tangella
<ha...@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 <sx...@gopivotal.com> wrote:
>
>>  Can you use command line to connect hive?
>>
>>
>> On Mon, May 19, 2014 at 4:59 AM, Sanjeevv Sriram <sa...@gmail.com>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.<init>(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*
>>>
>>> <property>
>>>     <name>hive.metastore.uris</name>
>>>     <value>thrift://localhost.localdomain:10000</value>
>>>   </property>
>>>
>>> <property>
>>> <name>javax.jdo.option.ConnectionURL</name>
>>>
>>> <value>jdbc:mysql://localhost:3306/metastore?createDatabaseIfNotExist=true</value>
>>>   <description>the URL of the MySQL database</description>
>>> </property>
>>>
>>> <property>
>>>   <name>javax.jdo.option.ConnectionDriverName</name>
>>>   <value>com.mysql.jdbc.Driver</value>
>>> </property>
>>>
>>> <property>
>>>   <name>javax.jdo.option.ConnectionUserName</name>
>>>   <value>hiveuser1</value>
>>> </property>
>>>
>>> <property>
>>>   <name>javax.jdo.option.ConnectionPassword</name>
>>>   <value>hiveuser1</value>
>>> </property>
>>>
>>>
>>> Thanks,
>>> Sanjeevv
>>>
>>
>>
>>
>> --
>>  Regards
>> Shengjun
>>
>
>

Re: Unable to connect Hive using JDBC program

Posted by Sanjeevv Sriram <sa...@gmail.com>.
I tried with different ports... still I am getting the same issue


On Mon, May 19, 2014 at 8:02 AM, harish tangella
<ha...@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 <sx...@gopivotal.com> wrote:
>
>>  Can you use command line to connect hive?
>>
>>
>> On Mon, May 19, 2014 at 4:59 AM, Sanjeevv Sriram <sa...@gmail.com>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.<init>(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*
>>>
>>> <property>
>>>     <name>hive.metastore.uris</name>
>>>     <value>thrift://localhost.localdomain:10000</value>
>>>   </property>
>>>
>>> <property>
>>> <name>javax.jdo.option.ConnectionURL</name>
>>>
>>> <value>jdbc:mysql://localhost:3306/metastore?createDatabaseIfNotExist=true</value>
>>>   <description>the URL of the MySQL database</description>
>>> </property>
>>>
>>> <property>
>>>   <name>javax.jdo.option.ConnectionDriverName</name>
>>>   <value>com.mysql.jdbc.Driver</value>
>>> </property>
>>>
>>> <property>
>>>   <name>javax.jdo.option.ConnectionUserName</name>
>>>   <value>hiveuser1</value>
>>> </property>
>>>
>>> <property>
>>>   <name>javax.jdo.option.ConnectionPassword</name>
>>>   <value>hiveuser1</value>
>>> </property>
>>>
>>>
>>> Thanks,
>>> Sanjeevv
>>>
>>
>>
>>
>> --
>>  Regards
>> Shengjun
>>
>
>

Re: Unable to connect Hive using JDBC program

Posted by Sanjeevv Sriram <sa...@gmail.com>.
I tried with different ports... still I am getting the same issue


On Mon, May 19, 2014 at 8:02 AM, harish tangella
<ha...@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 <sx...@gopivotal.com> wrote:
>
>>  Can you use command line to connect hive?
>>
>>
>> On Mon, May 19, 2014 at 4:59 AM, Sanjeevv Sriram <sa...@gmail.com>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.<init>(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*
>>>
>>> <property>
>>>     <name>hive.metastore.uris</name>
>>>     <value>thrift://localhost.localdomain:10000</value>
>>>   </property>
>>>
>>> <property>
>>> <name>javax.jdo.option.ConnectionURL</name>
>>>
>>> <value>jdbc:mysql://localhost:3306/metastore?createDatabaseIfNotExist=true</value>
>>>   <description>the URL of the MySQL database</description>
>>> </property>
>>>
>>> <property>
>>>   <name>javax.jdo.option.ConnectionDriverName</name>
>>>   <value>com.mysql.jdbc.Driver</value>
>>> </property>
>>>
>>> <property>
>>>   <name>javax.jdo.option.ConnectionUserName</name>
>>>   <value>hiveuser1</value>
>>> </property>
>>>
>>> <property>
>>>   <name>javax.jdo.option.ConnectionPassword</name>
>>>   <value>hiveuser1</value>
>>> </property>
>>>
>>>
>>> Thanks,
>>> Sanjeevv
>>>
>>
>>
>>
>> --
>>  Regards
>> Shengjun
>>
>
>

Re: Unable to connect Hive using JDBC program

Posted by harish tangella <ha...@gmail.com>.
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 <sx...@gopivotal.com> wrote:

>  Can you use command line to connect hive?
>
>
> On Mon, May 19, 2014 at 4:59 AM, Sanjeevv Sriram <sa...@gmail.com>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.<init>(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*
>>
>> <property>
>>     <name>hive.metastore.uris</name>
>>     <value>thrift://localhost.localdomain:10000</value>
>>   </property>
>>
>> <property>
>> <name>javax.jdo.option.ConnectionURL</name>
>>
>> <value>jdbc:mysql://localhost:3306/metastore?createDatabaseIfNotExist=true</value>
>>   <description>the URL of the MySQL database</description>
>> </property>
>>
>> <property>
>>   <name>javax.jdo.option.ConnectionDriverName</name>
>>   <value>com.mysql.jdbc.Driver</value>
>> </property>
>>
>> <property>
>>   <name>javax.jdo.option.ConnectionUserName</name>
>>   <value>hiveuser1</value>
>> </property>
>>
>> <property>
>>   <name>javax.jdo.option.ConnectionPassword</name>
>>   <value>hiveuser1</value>
>> </property>
>>
>>
>> Thanks,
>> Sanjeevv
>>
>
>
>
> --
>  Regards
> Shengjun
>

Re: Unable to connect Hive using JDBC program

Posted by Sanjeevv Sriram <sa...@gmail.com>.
Yes, I can connect to Hive


On Mon, May 19, 2014 at 12:36 AM, Shengjun Xin <sx...@gopivotal.com> wrote:

> Can you use command line to connect hive?
>
>
> On Mon, May 19, 2014 at 4:59 AM, Sanjeevv Sriram <sa...@gmail.com>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.<init>(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*
>>
>> <property>
>>     <name>hive.metastore.uris</name>
>>     <value>thrift://localhost.localdomain:10000</value>
>>   </property>
>>
>> <property>
>> <name>javax.jdo.option.ConnectionURL</name>
>>
>> <value>jdbc:mysql://localhost:3306/metastore?createDatabaseIfNotExist=true</value>
>>   <description>the URL of the MySQL database</description>
>> </property>
>>
>> <property>
>>   <name>javax.jdo.option.ConnectionDriverName</name>
>>   <value>com.mysql.jdbc.Driver</value>
>> </property>
>>
>> <property>
>>   <name>javax.jdo.option.ConnectionUserName</name>
>>   <value>hiveuser1</value>
>> </property>
>>
>> <property>
>>   <name>javax.jdo.option.ConnectionPassword</name>
>>   <value>hiveuser1</value>
>> </property>
>>
>>
>> Thanks,
>> Sanjeevv
>>
>
>
>
> --
> Regards
> Shengjun
>

Re: Unable to connect Hive using JDBC program

Posted by Sanjeevv Sriram <sa...@gmail.com>.
Yes, I can connect to Hive


On Mon, May 19, 2014 at 12:36 AM, Shengjun Xin <sx...@gopivotal.com> wrote:

> Can you use command line to connect hive?
>
>
> On Mon, May 19, 2014 at 4:59 AM, Sanjeevv Sriram <sa...@gmail.com>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.<init>(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*
>>
>> <property>
>>     <name>hive.metastore.uris</name>
>>     <value>thrift://localhost.localdomain:10000</value>
>>   </property>
>>
>> <property>
>> <name>javax.jdo.option.ConnectionURL</name>
>>
>> <value>jdbc:mysql://localhost:3306/metastore?createDatabaseIfNotExist=true</value>
>>   <description>the URL of the MySQL database</description>
>> </property>
>>
>> <property>
>>   <name>javax.jdo.option.ConnectionDriverName</name>
>>   <value>com.mysql.jdbc.Driver</value>
>> </property>
>>
>> <property>
>>   <name>javax.jdo.option.ConnectionUserName</name>
>>   <value>hiveuser1</value>
>> </property>
>>
>> <property>
>>   <name>javax.jdo.option.ConnectionPassword</name>
>>   <value>hiveuser1</value>
>> </property>
>>
>>
>> Thanks,
>> Sanjeevv
>>
>
>
>
> --
> Regards
> Shengjun
>

Re: Unable to connect Hive using JDBC program

Posted by Sanjeevv Sriram <sa...@gmail.com>.
Yes, I can connect to Hive


On Mon, May 19, 2014 at 12:36 AM, Shengjun Xin <sx...@gopivotal.com> wrote:

> Can you use command line to connect hive?
>
>
> On Mon, May 19, 2014 at 4:59 AM, Sanjeevv Sriram <sa...@gmail.com>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.<init>(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*
>>
>> <property>
>>     <name>hive.metastore.uris</name>
>>     <value>thrift://localhost.localdomain:10000</value>
>>   </property>
>>
>> <property>
>> <name>javax.jdo.option.ConnectionURL</name>
>>
>> <value>jdbc:mysql://localhost:3306/metastore?createDatabaseIfNotExist=true</value>
>>   <description>the URL of the MySQL database</description>
>> </property>
>>
>> <property>
>>   <name>javax.jdo.option.ConnectionDriverName</name>
>>   <value>com.mysql.jdbc.Driver</value>
>> </property>
>>
>> <property>
>>   <name>javax.jdo.option.ConnectionUserName</name>
>>   <value>hiveuser1</value>
>> </property>
>>
>> <property>
>>   <name>javax.jdo.option.ConnectionPassword</name>
>>   <value>hiveuser1</value>
>> </property>
>>
>>
>> Thanks,
>> Sanjeevv
>>
>
>
>
> --
> Regards
> Shengjun
>

Re: Unable to connect Hive using JDBC program

Posted by harish tangella <ha...@gmail.com>.
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 <sx...@gopivotal.com> wrote:

>  Can you use command line to connect hive?
>
>
> On Mon, May 19, 2014 at 4:59 AM, Sanjeevv Sriram <sa...@gmail.com>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.<init>(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*
>>
>> <property>
>>     <name>hive.metastore.uris</name>
>>     <value>thrift://localhost.localdomain:10000</value>
>>   </property>
>>
>> <property>
>> <name>javax.jdo.option.ConnectionURL</name>
>>
>> <value>jdbc:mysql://localhost:3306/metastore?createDatabaseIfNotExist=true</value>
>>   <description>the URL of the MySQL database</description>
>> </property>
>>
>> <property>
>>   <name>javax.jdo.option.ConnectionDriverName</name>
>>   <value>com.mysql.jdbc.Driver</value>
>> </property>
>>
>> <property>
>>   <name>javax.jdo.option.ConnectionUserName</name>
>>   <value>hiveuser1</value>
>> </property>
>>
>> <property>
>>   <name>javax.jdo.option.ConnectionPassword</name>
>>   <value>hiveuser1</value>
>> </property>
>>
>>
>> Thanks,
>> Sanjeevv
>>
>
>
>
> --
>  Regards
> Shengjun
>

Re: Unable to connect Hive using JDBC program

Posted by harish tangella <ha...@gmail.com>.
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 <sx...@gopivotal.com> wrote:

>  Can you use command line to connect hive?
>
>
> On Mon, May 19, 2014 at 4:59 AM, Sanjeevv Sriram <sa...@gmail.com>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.<init>(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*
>>
>> <property>
>>     <name>hive.metastore.uris</name>
>>     <value>thrift://localhost.localdomain:10000</value>
>>   </property>
>>
>> <property>
>> <name>javax.jdo.option.ConnectionURL</name>
>>
>> <value>jdbc:mysql://localhost:3306/metastore?createDatabaseIfNotExist=true</value>
>>   <description>the URL of the MySQL database</description>
>> </property>
>>
>> <property>
>>   <name>javax.jdo.option.ConnectionDriverName</name>
>>   <value>com.mysql.jdbc.Driver</value>
>> </property>
>>
>> <property>
>>   <name>javax.jdo.option.ConnectionUserName</name>
>>   <value>hiveuser1</value>
>> </property>
>>
>> <property>
>>   <name>javax.jdo.option.ConnectionPassword</name>
>>   <value>hiveuser1</value>
>> </property>
>>
>>
>> Thanks,
>> Sanjeevv
>>
>
>
>
> --
>  Regards
> Shengjun
>

Re: Unable to connect Hive using JDBC program

Posted by harish tangella <ha...@gmail.com>.
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 <sx...@gopivotal.com> wrote:

>  Can you use command line to connect hive?
>
>
> On Mon, May 19, 2014 at 4:59 AM, Sanjeevv Sriram <sa...@gmail.com>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.<init>(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*
>>
>> <property>
>>     <name>hive.metastore.uris</name>
>>     <value>thrift://localhost.localdomain:10000</value>
>>   </property>
>>
>> <property>
>> <name>javax.jdo.option.ConnectionURL</name>
>>
>> <value>jdbc:mysql://localhost:3306/metastore?createDatabaseIfNotExist=true</value>
>>   <description>the URL of the MySQL database</description>
>> </property>
>>
>> <property>
>>   <name>javax.jdo.option.ConnectionDriverName</name>
>>   <value>com.mysql.jdbc.Driver</value>
>> </property>
>>
>> <property>
>>   <name>javax.jdo.option.ConnectionUserName</name>
>>   <value>hiveuser1</value>
>> </property>
>>
>> <property>
>>   <name>javax.jdo.option.ConnectionPassword</name>
>>   <value>hiveuser1</value>
>> </property>
>>
>>
>> Thanks,
>> Sanjeevv
>>
>
>
>
> --
>  Regards
> Shengjun
>

Re: Unable to connect Hive using JDBC program

Posted by Shengjun Xin <sx...@gopivotal.com>.
Can you use command line to connect hive?


On Mon, May 19, 2014 at 4:59 AM, Sanjeevv Sriram <sa...@gmail.com>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.<init>(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*
>
> <property>
>     <name>hive.metastore.uris</name>
>     <value>thrift://localhost.localdomain:10000</value>
>   </property>
>
> <property>
> <name>javax.jdo.option.ConnectionURL</name>
>
> <value>jdbc:mysql://localhost:3306/metastore?createDatabaseIfNotExist=true</value>
>   <description>the URL of the MySQL database</description>
> </property>
>
> <property>
>   <name>javax.jdo.option.ConnectionDriverName</name>
>   <value>com.mysql.jdbc.Driver</value>
> </property>
>
> <property>
>   <name>javax.jdo.option.ConnectionUserName</name>
>   <value>hiveuser1</value>
> </property>
>
> <property>
>   <name>javax.jdo.option.ConnectionPassword</name>
>   <value>hiveuser1</value>
> </property>
>
>
> Thanks,
> Sanjeevv
>



-- 
Regards
Shengjun

Re: Unable to connect Hive using JDBC program

Posted by Shengjun Xin <sx...@gopivotal.com>.
Can you use command line to connect hive?


On Mon, May 19, 2014 at 4:59 AM, Sanjeevv Sriram <sa...@gmail.com>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.<init>(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*
>
> <property>
>     <name>hive.metastore.uris</name>
>     <value>thrift://localhost.localdomain:10000</value>
>   </property>
>
> <property>
> <name>javax.jdo.option.ConnectionURL</name>
>
> <value>jdbc:mysql://localhost:3306/metastore?createDatabaseIfNotExist=true</value>
>   <description>the URL of the MySQL database</description>
> </property>
>
> <property>
>   <name>javax.jdo.option.ConnectionDriverName</name>
>   <value>com.mysql.jdbc.Driver</value>
> </property>
>
> <property>
>   <name>javax.jdo.option.ConnectionUserName</name>
>   <value>hiveuser1</value>
> </property>
>
> <property>
>   <name>javax.jdo.option.ConnectionPassword</name>
>   <value>hiveuser1</value>
> </property>
>
>
> Thanks,
> Sanjeevv
>



-- 
Regards
Shengjun

Re: Unable to connect Hive using JDBC program

Posted by Shengjun Xin <sx...@gopivotal.com>.
Can you use command line to connect hive?


On Mon, May 19, 2014 at 4:59 AM, Sanjeevv Sriram <sa...@gmail.com>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.<init>(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*
>
> <property>
>     <name>hive.metastore.uris</name>
>     <value>thrift://localhost.localdomain:10000</value>
>   </property>
>
> <property>
> <name>javax.jdo.option.ConnectionURL</name>
>
> <value>jdbc:mysql://localhost:3306/metastore?createDatabaseIfNotExist=true</value>
>   <description>the URL of the MySQL database</description>
> </property>
>
> <property>
>   <name>javax.jdo.option.ConnectionDriverName</name>
>   <value>com.mysql.jdbc.Driver</value>
> </property>
>
> <property>
>   <name>javax.jdo.option.ConnectionUserName</name>
>   <value>hiveuser1</value>
> </property>
>
> <property>
>   <name>javax.jdo.option.ConnectionPassword</name>
>   <value>hiveuser1</value>
> </property>
>
>
> Thanks,
> Sanjeevv
>



-- 
Regards
Shengjun

Re: Unable to connect Hive using JDBC program

Posted by Shengjun Xin <sx...@gopivotal.com>.
Can you use command line to connect hive?


On Mon, May 19, 2014 at 4:59 AM, Sanjeevv Sriram <sa...@gmail.com>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.<init>(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*
>
> <property>
>     <name>hive.metastore.uris</name>
>     <value>thrift://localhost.localdomain:10000</value>
>   </property>
>
> <property>
> <name>javax.jdo.option.ConnectionURL</name>
>
> <value>jdbc:mysql://localhost:3306/metastore?createDatabaseIfNotExist=true</value>
>   <description>the URL of the MySQL database</description>
> </property>
>
> <property>
>   <name>javax.jdo.option.ConnectionDriverName</name>
>   <value>com.mysql.jdbc.Driver</value>
> </property>
>
> <property>
>   <name>javax.jdo.option.ConnectionUserName</name>
>   <value>hiveuser1</value>
> </property>
>
> <property>
>   <name>javax.jdo.option.ConnectionPassword</name>
>   <value>hiveuser1</value>
> </property>
>
>
> Thanks,
> Sanjeevv
>



-- 
Regards
Shengjun