hadoop版本-fairscheduler-statedump.log(没有这样的文件或目录)

i5desfxk  于 2021-05-27  发布在  Hadoop
关注(0)|答案(3)|浏览(564)

我尝试在linux-mint上安装hadoop-3.2.0。一切都很好。java 11.0.2的安装方式如下:

$ java -version
java version "11.0.2" 2018-10-16 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.2+7-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.2+7-LTS, mixed mode)

当我使用这个命令 hadoop version ,我得到这个错误:

$ hadoop version
log4j:ERROR setFile(null,true) call failed.
java.io.FileNotFoundException: /usr/local/hadoop-3.2.0/logs/fairscheduler-statedump.log (No such file or directory)
    at java.base/java.io.FileOutputStream.open0(Native Method)
    at java.base/java.io.FileOutputStream.open(FileOutputStream.java:298)
    at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:237)
    at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:158)
    at org.apache.log4j.FileAppender.setFile(FileAppender.java:294)
    at org.apache.log4j.RollingFileAppender.setFile(RollingFileAppender.java:207)
    at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:165)
    at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:307)
    at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:172)
    at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:104)
    at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:842)
    at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:768)
    at org.apache.log4j.PropertyConfigurator.parseCatsAndRenderers(PropertyConfigurator.java:672)
    at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:516)
    at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:580)
    at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:526)
    at org.apache.log4j.LogManager.<clinit>(LogManager.java:127)
    at org.slf4j.impl.Log4jLoggerFactory.<init>(Log4jLoggerFactory.java:66)
    at org.slf4j.impl.StaticLoggerBinder.<init>(StaticLoggerBinder.java:72)
    at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:45)
    at org.slf4j.LoggerFactory.bind(LoggerFactory.java:150)
    at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:124)
    at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:412)
    at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:357)
    at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:383)
    at org.apache.hadoop.util.VersionInfo.<clinit>(VersionInfo.java:37)
Hadoop 3.2.0
Source code repository https://github.com/apache/hadoop.git -r e97acb3bd8f3befd27418996fa5d4b50bf2e17bf
Compiled by sunilg on 2019-01-08T06:08Z
Compiled with protoc 2.5.0
From source with checksum d3f0795ed0d9dc378e2c785d3668f39
This command was run using /usr/local/hadoop-3.2.0/share/hadoop/common/hadoop-common-3.2.0.jar

看起来hadoop安装得很好,但是有点不对劲 log4j . 我可以请你帮我解决这个错误吗?
更新:我应该提到的是,我试图安装hadoop-3.2.0意味着hadoop-3.1.2之前的版本,一切看起来都很好。所以我想这是与JavaV11.0.2和hadoop-3.2.0相关的问题。

z2acfund

z2acfund1#

我也面临这个问题,但我认为这是由于不同的java版本。我最初安装了jdk11,但是更改了jdk8,因为hadoop3.x不兼容8之后的任何东西(https://cwiki.apache.org/confluence/display/hadoop/hadoop+java+versions).
然而,在改用jdk8之后,我仍然面临这个问题。提供的解决方案假设我们创建了一个hadoop用户,但我没有在服务器(工作计算机)上创建另一个用户的权限。
我应该将所有权更改为root吗?我确实有一些sudo特权。

ql3eal8s

ql3eal8s2#

我遇到了同样的问题,因为我是通过根用户安装hadoop,然后通过hadoop用户运行hadoop命令。我只是通过更改hadoop目录的所有者和组来解决这个问题。

sudo chown -R hadoop:hadoop hadoop-3.2.0/

$ hadoop version

Hadoop 3.2.0
Source code repository https://github.com/apache/hadoop.git -r e97acb3bd8f3befd27418996fa5d4b50bf2e17bf

Compiled by sunilg on 2019-01-08T06:08Z

Compiled with protoc 2.5.0

From source with checksum d3f0795ed0d9dc378e2c785d3668f39
This command was run using /opt/hadoop-3.2.0/share/hadoop/common/hadoop-common-3.2.0.jar
cyej8jka

cyej8jka3#

我在/usr/local/hadoop中创建日志目录,并授予hadoop帐户权限。

/usr/local/hadoop$ sudo mkdir logs
/usr/local/hadoop$ sudo chown -R hadoop logs

相关问题