Java 如何修复 Hadoop 警告:在 Ubuntu 上发生了非法反射访问操作错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/52155078/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to fix Hadoop WARNING: An illegal reflective access operation has occurred error on Ubuntu
提问by Amalendu Kar
I have installed Java openjdk version "10.0.2"
and Hadoop 2.9.0
successfully. All processes are running well
我已经安装了 Javaopenjdk version "10.0.2"
并且Hadoop 2.9.0
成功了。所有进程都运行良好
hadoopusr@amalendu:~$ jps
19888 NameNode
20388 DataNode
20898 NodeManager
20343 SecondaryNameNode
20539 ResourceManager
21118 Jps
But when ever i am trying to execute any command like hdfs dfs -ls /
getting this warnings
但是当我尝试执行任何命令时,例如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
Please help how to fix this. This is my ~/.bashrc file configuration
请帮助如何解决这个问题。这是我的 ~/.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"
采纳答案by Eugene
There is nothing you can do about these warnings, this is related to jigsaw project and strong(er) encapsulation.
您对这些警告无能为力,这与拼图项目和强(er)封装有关。
Basically there is some class called sun.security.krb5.Config
that is part of some "module" called java.security.jgss
. This module "defines" what it exports (what others can use out of it) and to whom. This also means in plain english that this is not for the public usage - don't touch it; well hadoop
did, it's part of their effort to fix this. You can report this or try to upgrade hadoop, may be this is already fixed.
基本上有一些类sun.security.krb5.Config
称为java.security.jgss
. 该模块“定义”了它导出的内容(其他人可以使用它的内容)以及输出给谁。这也意味着用简单的英语,这不是供公众使用的——不要碰它;做得好hadoop
,这是他们解决这个问题的努力的一部分。您可以报告此问题或尝试升级hadoop,可能已经修复了。
回答by Prince Yadav
this problem is due to latest java upgrades.please configure it with java 8.its working swiftly.
这个问题是由于最新的 java 升级。请使用 java 8 配置它。它的工作很快。
回答by Xiaoyu Yao
This has been fixed in Hadoop 3.3 and 3.2.2 via. https://issues.apache.org/jira/browse/HADOOP-10848
这已通过 Hadoop 3.3 和 3.2.2 修复。 https://issues.apache.org/jira/browse/HADOOP-10848