title: connection to Cloudera Impala / Hive outside the cluster
body: <p>i am working with cloudera impala server version 5.4.7
  first to make sure the port is open i have validate it with telnet.</p>
  
  <pre><code>        Class.forName("org.apache.hive.jdbc.HiveDriver");
          DriverManager.setLoginTimeout(30);
  try (java.sql.Connection connection = DriverManager.getConnection("jdbc:hive2://12.23.56.789:123456/someName;auth=noSasl"))
  {    System.out.println("connected");      }
  </code></pre>
  
  <p><strong>But i never succeed to connect</strong> </p>
  
  <p>all i get is this error from timeout:</p>
  
  <p>what could be the problem ?
  i am using the exact same hive version as the cloudera version </p>
  
  <pre><code>  [14 Apr 2016 06:27:26,797] [ERROR] [main] [org.apache.hive.jdbc.HiveConnection] - Error opening session
  org.apache.thrift.transport.TTransportException: java.net.SocketTimeoutException: Read timed out
      at org.apache.thrift.transport.TIOStreamTransport.read(TIOStreamTransport.java:129)
      at org.apache.thrift.transport.TTransport.readAll(TTransport.java:86)
      at org.apache.thrift.protocol.TBinaryProtocol.readAll(TBinaryProtocol.java:429)
      at org.apache.thrift.protocol.TBinaryProtocol.readI32(TBinaryProtocol.java:318)
      at org.apache.thrift.protocol.TBinaryProtocol.readMessageBegin(TBinaryProtocol.java:219)
      at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:69)
      at org.apache.hive.service.cli.thrift.TCLIService$Client.recv_OpenSession(TCLIService.java:156)
      at org.apache.hive.service.cli.thrift.TCLIService$Client.OpenSession(TCLIService.java:143)
      at org.apache.hive.jdbc.HiveConnection.openSession(HiveConnection.java:475)
      at org.apache.hive.jdbc.HiveConnection.&lt;init&gt;(HiveConnection.java:181)
      at org.apache.hive.jdbc.HiveDriver.connect(HiveDriver.java:105)
      at java.sql.DriverManager.getConnection(Unknown Source)
      at java.sql.DriverManager.getConnection(Unknown Source)
      at com.datorama.core.service.delivery.providers.DatabaseProvider.main(DatabaseProvider.java:330)
  Caused by: java.net.SocketTimeoutException: Read timed out
      at java.net.SocketInputStream.socketRead0(Native Method)
      at java.net.SocketInputStream.socketRead(Unknown Source)
      at java.net.SocketInputStream.read(Unknown Source)
      at java.net.SocketInputStream.read(Unknown Source)
      at java.io.BufferedInputStream.fill(Unknown Source)
      at java.io.BufferedInputStream.read1(Unknown Source)
      at java.io.BufferedInputStream.read(Unknown Source)
      at org.apache.thrift.transport.TIOStreamTransport.read(TIOStreamTransport.java:127)
      ... 13 more
  Exception in thread "main" java.sql.SQLException: Could not establish connection to jdbc:hive2://54.69.2.250:21050/sage_global;auth=noSasl: java.net.SocketTimeoutException: Read timed out
      at org.apache.hive.jdbc.HiveConnection.openSession(HiveConnection.java:486)
      at org.apache.hive.jdbc.HiveConnection.&lt;init&gt;(HiveConnection.java:181)
      at org.apache.hive.jdbc.HiveDriver.connect(HiveDriver.java:105)
      at java.sql.DriverManager.getConnection(Unknown Source)
      at java.sql.DriverManager.getConnection(Unknown Source)
      at com.datorama.core.service.delivery.providers.DatabaseProvider.main(DatabaseProvider.java:330)
  Caused by: org.apache.thrift.transport.TTransportException: java.net.SocketTimeoutException: Read timed out
      at org.apache.thrift.transport.TIOStreamTransport.read(TIOStreamTransport.java:129)
      at org.apache.thrift.transport.TTransport.readAll(TTransport.java:86)
      at org.apache.thrift.protocol.TBinaryProtocol.readAll(TBinaryProtocol.java:429)
      at org.apache.thrift.protocol.TBinaryProtocol.readI32(TBinaryProtocol.java:318)
      at org.apache.thrift.protocol.TBinaryProtocol.readMessageBegin(TBinaryProtocol.java:219)
      at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:69)
      at org.apache.hive.service.cli.thrift.TCLIService$Client.recv_OpenSession(TCLIService.java:156)
      at org.apache.hive.service.cli.thrift.TCLIService$Client.OpenSession(TCLIService.java:143)
      at org.apache.hive.jdbc.HiveConnection.openSession(HiveConnection.java:475)
      ... 5 more
  Caused by: java.net.SocketTimeoutException: Read timed out
      at java.net.SocketInputStream.socketRead0(Native Method)
      at java.net.SocketInputStream.socketRead(Unknown Source)
      at java.net.SocketInputStream.read(Unknown Source)
      at java.net.SocketInputStream.read(Unknown Source)
      at java.io.BufferedInputStream.fill(Unknown Source)
      at java.io.BufferedInputStream.read1(Unknown Source)
      at java.io.BufferedInputStream.read(Unknown Source)
      at org.apache.thrift.transport.TIOStreamTransport.read(TIOStreamTransport.java:127)
      ... 13 more
  </code></pre>