Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created 02-26-2016 03:34 PM
I have included my following connection method, which just ends up outputting a stack trace of:
16/02/26 14:46:41 ERROR StackTrace: Full Stack Trace: java.net.SocketTimeoutException: Receive timed out at java.net.AbstractPlainDatagramSocketImpl.receive(AbstractPlainDatagramSocketImpl.java:146) at java.net.DatagramSocket.receive(DatagramSocket.java:817) at com.sun.security.auth.module.Krb5LoginModule.attemptAuthentication(Krb5LoginModule.java:735) at com.sun.security.auth.module.Krb5LoginModule.login(Krb5LoginModule.java:584) at javax.security.auth.login.LoginContext.invoke(LoginContext.java:762) at javax.security.auth.login.LoginContext.access$000(LoginContext.java:203) at javax.security.auth.login.LoginContext$4.run(LoginContext.java:690) at javax.security.auth.login.LoginContext$4.run(LoginContext.java:688) at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:687) at javax.security.auth.login.LoginContext.login(LoginContext.java:595) at org.apache.hadoop.security.UserGroupInformation.loginUserFromKeytab(UserGroupInformation.java:926) at com.zirous.alertsView.ETLService.getConnection(ETLService.groovy:419) at com.zirous.alertsView.ETLService.getRecentEtlByDate(ETLService.groovy:311) at com.zirous.etlView.ETLController.recent(ETLController.groovy:79) at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:198) at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745)
Does anyone have any experience with these kinds of connections or see an error in the way I am going about creating the connection?
private static getConnection() {
try {
Configuration conf = new Configuration();
conf.set("hadoop.security.authentication", "Kerberos");
UserGroupInformation.setConfiguration(conf);
UserGroupInformation.loginUserFromKeytab("<principal>", "<keytab location>");
Class.forName("org.apache.hive.jdbc.HiveDriver");
System.out.print("Getting Connection");
Connection con = DriverManager.getConnection("jdbc:hive2://<hiveserver2_host>:10000/;principal=" +
"<principal>;transportMode=http;httpPath=cliservice;auth=KERBEROS");
return con
} catch (Exception e) {
e.printStackTrace()
throw e
}
}
Created 03-07-2016 02:22 AM
@Colton Rodgers Can you try adding hive-site.xml as resource.
conf.addResource(new Path("/etc/hive/conf/hive-site.xml"));
Created 03-07-2016 02:22 AM
@Colton Rodgers Can you try adding hive-site.xml as resource.
conf.addResource(new Path("/etc/hive/conf/hive-site.xml"));
Created 03-07-2016 03:15 AM
Thank you! That did it for me, the application host is separate from the HDP Cluster, so I had to scp the .xml over, but it then worked as planned.