我正在尝试将 hadoop 与 R 一起使用到 cloudera 虚拟机中。我将 rhdfs 库加载到 R 中并且运行良好,但是当我尝试执行 hdfs.init() 时,这不起作用并给我以下错误:
> hdfs.init()
14/12/10 05:48:20 ERROR security.UserGroupInformation: Unable to find JAAS classes:com.sun.security.auth.UnixPrincipal
not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:/home/cloudera/R/x86_64-redhat-linux-gnu-library/3.1/rJava/java/boot/],
parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
14/12/10 05:48:20 WARN util.NativeCodeLoader: Unable to load native-hadoop library for
your platform... using builtin-java classes where applicable
Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl, :
java.io.IOException: failure to login
这是我的代码:
Sys.setenv("HADOOP_CMD"="/usr/lib/hadoop/bin/hadoop") Sys.setenv("HADOOP_STREAMING"="/usr/lib/hadoop-0.20-mapreduce/contrib/streaming/hadoop-streaming-2.5 .0-mr1-cdh5.2.0.jar") Sys.setenv("HADOOP_HOME"="/usr/lib/hadoop") Sys.setenv("HADOOP_CONF_DIR"="/etc/hadoop/conf")
库(rhdfs)加载所需的包:rJava
HADOOP_CMD=/usr/lib/hadoop/bin/hadoop
确保运行 hdfs.init() hdfs.init() 14/12/11 05:55:21 错误 security.UserGroupInformation: Unable to find JAAS classes:com.sun.security.auth.UnixPrincipal not found in gnu.gcj .runtime.SystemClassLoader{urls=[file:/home/cloudera/R/x86_64-redhat-linux-gnu-library/3.1/rJava/java/boot/], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[ ], parent=null}} 14/12/11 05:55:21 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable Error in .jcall("RJavaTools" , "Ljava/lang/Object;", "invokeMethod", cl, : java.io.IOException: 登录失败