如何修复 Hadoop 警告:Ubuntu 上出现非法反射访问操作错误

How to fix Hadoop WARNING: An illegal reflective access operation has occurred error on Ubuntu

我已成功安装 Java openjdk version "10.0.2"Hadoop 2.9.0。所有进程都运行很好

hadoopusr@amalendu:~$ jps
19888 NameNode
20388 DataNode
20898 NodeManager
20343 SecondaryNameNode
20539 ResourceManager
21118 Jps

但是每当我尝试执行任何命令时 hdfs dfs -ls / 收到此警告

hadoopusr@amalendu:~$ hdfs dfs -ls /
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.apache.hadoop.security.authentication.util.KerberosUtil (file:/usr/local/hadoop/share/hadoop/common/lib/hadoop-auth-2.9.0.jar) to method sun.security.krb5.Config.getInstance()
WARNING: Please consider reporting this to the maintainers of org.apache.hadoop.security.authentication.util.KerberosUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
18/09/04 00:29:24 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable

请帮忙解决这个问题。 这是我的 ~/.bashrc 文件配置

export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
export HADOOP_HOME=/usr/local/hadoop
export PATH=$PATH:$HADOOP_HOME/bin
export PATH=$PATH:$HADOOP_HOME/sbin
export HADOOP_MAPRED_HOME=$HADOOP_HOME
export HADOOP_COMMON_HOME=$HADOOP_HOME
export HADOOP_HDFS_HOME=$HADOOP_HOME
export YARN_HOME=$HADOOP_HOME
export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native
export HADOOP_OPTS="-Djava.library.path=$HADOOP_HOME/lib"

对于这些警告您无能为力,这与拼图项目和强(呃)封装有关。

基本上有一些 class 叫做 sun.security.krb5.Config,它是一些 "module" 叫做 java.security.jgss 的一部分。这个模块 "defines" 它输出什么(其他人可以从中使用什么)以及输出给谁。这也意味着用简单的英语来说,这不是 public 用法 - 不要触摸它; hadoop 做到了,这是他们解决此问题的一部分。您可以报告此问题或尝试升级 hadoop,这可能已经修复。

这个问题是由于最新的 java upgrades.please 配置 java 8.its 工作迅速。

这已在 Hadoop 3.3 和 3.2.2 中修复。 https://issues.apache.org/jira/browse/HADOOP-10848