gpt4 book ai didi

java - $bin/hadoop namenode --格式错误

转载 作者:行者123 更新时间:2023-12-02 21:37:27 25 4
gpt4 key购买 nike

尝试执行此命令时出现此错误:$bin/hadoop namenode –format

/home/MAHI/hadoop-1.2.1/libexec/../conf/hadoop-env.sh: line 31: unexpected EOF while looking for matching `"'
/home/MAHI/hadoop-1.2.1/libexec/../conf/hadoop-env.sh: line 58: syntax error: unexpected end of file**
# The java implementation to use. Required.
export JAVA_HOME= "C:\Java\"

# Extra Java CLASSPATH elements. Optional.
# export HADOOP_CLASSPATH=

# The maximum amount of heap to use, in MB. Default is 1000.
# export HADOOP_HEAPSIZE=2000

# Extra Java runtime options. Empty by default.
# export HADOOP_OPTS=-server

# Command specific options appended to HADOOP_OPTS when specified
export HADOOP_NAMENODE_OPTS="-Dcom.sun.management.jmxremote $HADOOP_NAMENODE_OPTS"
export HADOOP_SECONDARYNAMENODE_OPTS="-Dcom.sun.management.jmxremote $HADOOP_SECONDARYNAMENODE_OPTS"
export HADOOP_DATANODE_OPTS="-Dcom.sun.management.jmxremote $HADOOP_DATANODE_OPTS"
export HADOOP_BALANCER_OPTS="-Dcom.sun.management.jmxremote $HADOOP_BALANCER_OPTS"
export HADOOP_JOBTRACKER_OPTS="-Dcom.sun.management.jmxremote $HADOOP_JOBTRACKER_OPTS"
export HADOOP_TASKTRACKER_OPTS=
The following applies to multiple commands (fs, dfs, fsck, distcp etc)
export HADOOP_CLIENT_OPTS

Extra ssh options. Empty by default.
export HADOOP_SSH_OPTS="-o ConnectTimeout=1 -o SendEnv=HADOOP_CONF_DIR"

Where log files are stored. $HADOOP_HOME/logs by default.
export HADOOP_LOG_DIR=${HADOOP_HOME}/logs

File naming remote slave hosts. $HADOOP_HOME/conf/slaves by default.
export HADOOP_SLAVES=${HADOOP_HOME}/conf/slaves

host:path where hadoop code should be rsync'd from. Unset by default.
export HADOOP_MASTER=master:/home/$USER/src/hadoop

Seconds to sleep between slave commands. Unset by default. This
can be useful in large clusters, where, e.g., slave rsyncs can
otherwise arrive faster than the master can service them.
export HADOOP_SLAVE_SLEEP=0.1

存储 pid 文件的目录。 /tmp默认情况下。
注意:这应该设置为只能由以下人员写入的目录
将运行 hadoop 守护进程的用户。否则有
符号链接(symbolic link)攻击的可能性。
 export HADOOP_PID_DIR=/var/hadoop/pids

A string representing this instance of hadoop. $USER by default.
export HADOOP_IDENT_STRING=$USER

The scheduling priority for daemon processes. See 'man nice'.
export HADOOP_NICENESS=10

最佳答案

您在 hadoop-env.sh 中错误地设置了 JAVA_HOME。给出 java_home 的绝对路径。您可以使用以下命令找出 java 当前 java 路径:

alternatives --config java

它将提供您已安装的所有 java 版本并选择正确的版本并将此 java 路径设置为 hadoop-env.sh,如下所示:
 export JAVA_HOME=/usr/java/jdk1.*/bin

另一种方法是将 $JAVA_HOME 设置为用户的 .bashrc 。所以不需要设置成hadoop-env.sh。

关于java - $bin/hadoop namenode --格式错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31100699/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com