How to setup Kerberos in rhdfs?
I got "Can't get Kerberos realm" error when run the code as bellows, but it works that I run the MR by java.
===============
ERROR INFO
===============
> source("/home/gwzh/program/R/test/hadoop1.R")
Loading required package: rJava
HADOOP_CMD=/opt/xdata/c3/hadoop-2.4.0-mdh2.0.7/bin/hadoop
Be sure to run hdfs.init()
15/01/07 15:17:31 ERROR security.UserGroupInformation: Unable to find JAAS classes:com.sun.security.auth.UnixPrincipal not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:/usr/lib64/R/library/rJava/java/boot/], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl, :
java.lang.IllegalArgumentException: Can't get Kerberos realm
=====================
code of hadoop1.R
========================
Sys.setenv("HADOOP_PREFIX"="/opt/xdata/c3/hadoop-2.4.0-mdh2.0.7")
Sys.setenv("HADOOP_CMD"="/opt/xdata/c3/hadoop-2.4.0-mdh2.0.7/bin/hadoop")
Sys.setenv("HADOOP_STREAMING"="/opt/xdata/c3/hadoop-2.4.0-mdh2.0.7/share/hadoop/tools/lib/hadoop-streaming-2.4.0-mdh2.0.7.jar")
library(rhdfs)
hdfs.init()
modelfile = hdfs.file("/user/h_b2c_dc/findsoleextentions/part-r-00395", "r")
m <- hdfs.read(modelfile)
results <- as.data.frame(m, stringsAsFactors=F)
hdfs.close(modelfile)
Thanks,
Weizhan Guo