title: Connect to kerberised hive using jdbc from remote windows system
body: <p>I have setup a hive environment with Kerberos security enabled on a Linux server (Red Hat). And I need to connect from a remote windows machine to hive using JDBC.</p>
  
  <p>So, I have hiveserver2 running in the linux machine, and I have done "kinit".</p>
  
  <p>Now I try to connect from a java program on the windows side with a test program like this,</p>
  
  <pre><code>Class.forName("org.apache.hive.jdbc.HiveDriver");
  String url = "jdbc:hive2://&lt;host&gt;:10000/default;principal=hive/_HOST@&lt;YOUR-REALM.COM&gt;"
  Connection con = DriverManager.getConnection(url);
  </code></pre>
  
  <p>And I got the following error,</p>
  
  <pre><code>Exception due to: Could not open client transport with JDBC Uri:
   jdbc:hive2://&lt;host&gt;:10000/;principal=hive/_HOST@YOUR-REALM.COM&gt;: 
  GSS initiate failed
  </code></pre>
  
  <p>What am I doing here wrong ? I checked many forums, but couldn't get a proper solution. Any answer will be appreciated.</p>
  
  <p>Thanks</p>