hadoop2.2.0:“名称或服务未知”警告

wvt8vs2t  于 2021-06-03  发布在  Hadoop
关注(0)|答案(5)|浏览(372)

我的目标是在Ubuntu12.4上运行Hadoop2.2.0。我可以做到,但当我运行以下命令时:rushi@ubuntu:/usr/local/hadoop$sbin/start-dfs.sh
我的dfs正在启动namenode、scondarynamenode和datanode,但问题是我收到以下警告

rushi@ubuntu:/usr/local/hadoop$ sbin/start-dfs.sh    
14/01/24 12:05:46 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
    Starting namenodes on [Java HotSpot(TM) 64-Bit Server VM warning: You have loaded library /usr/local/hadoop-2.2.0/lib/native/libhadoop.so.1.0.0 which might have disabled stack guard. The VM will try to fix the stack guard now.
    It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
    localhost]
    sed: -e expression #1, char 6: unknown option to `s'
    Java: ssh: Could not resolve hostname Java: Name or service not known
    library: ssh: Could not resolve hostname library: Name or service not known
    warning:: ssh: Could not resolve hostname warning:: Name or service not known
    which: ssh: Could not resolve hostname which: Name or service not known
    have: ssh: Could not resolve hostname have: Name or service not known
    might: ssh: Could not resolve hostname might: Name or service not known
    You: ssh: Could not resolve hostname You: Name or service not known
    loaded: ssh: Could not resolve hostname loaded: Name or service not known
    Server: ssh: Could not resolve hostname Server: Name or service not known
    HotSpot(TM): ssh: Could not resolve hostname HotSpot(TM): Name or service not known
    have: ssh: Could not resolve hostname have: Name or service not known
    64-Bit: ssh: Could not resolve hostname 64-Bit: Name or service not known
    VM: ssh: Could not resolve hostname VM: Name or service not known
    disabled: ssh: Could not resolve hostname disabled: Name or service not known
    VM: ssh: Could not resolve hostname VM: Name or service not known
    stack: ssh: Could not resolve hostname stack: Name or service not known
    The: ssh: Could not resolve hostname The: Name or service not known
    fix: ssh: Could not resolve hostname fix: Name or service not known
    try: ssh: Could not resolve hostname try: Name or service not known
    guard.: ssh: Could not resolve hostname guard.: Name or service not known
    to: ssh: Could not resolve hostname to: Name or service not known
    now.: ssh: Could not resolve hostname now.: Name or service not known
    will: ssh: Could not resolve hostname will: Name or service not known
    that: ssh: Could not resolve hostname that: Name or service not known
    stack: ssh: Could not resolve hostname stack: Name or service not known
    the: ssh: Could not resolve hostname the: Name or service not known
    you: ssh: Could not resolve hostname you: Name or service not known
    -c: Unknown cipher type 'cd'
    guard: ssh: Could not resolve hostname guard: Name or service not known
    It's: ssh: Could not resolve hostname It's: Name or service not known
    highly: ssh: Could not resolve hostname highly: Name or service not known
    fix: ssh: Could not resolve hostname fix: Name or service not known
    recommended: ssh: Could not resolve hostname recommended: Name or service not known
    or: ssh: Could not resolve hostname or: Name or service not known
    the: ssh: Could not resolve hostname the: Name or service not known
    library: ssh: Could not resolve hostname library: Name or service not known
    link: ssh: Could not resolve hostname link: Name or service not known
    'execstack: ssh: Could not resolve hostname 'execstack: Name or service not known
    with: ssh: Could not resolve hostname with: Name or service not known
    <libfile>',: ssh: Could not resolve hostname <libfile>',: Name or service not known
    it: ssh: Could not resolve hostname it: Name or service not known
    noexecstack'.: ssh: Could not resolve hostname noexecstack'.: Name or service not known
    with: ssh: Could not resolve hostname with: Name or service not known
    '-z: ssh: Could not resolve hostname '-z: Name or service not known
    localhost: starting namenode, logging to /usr/local/hadoop-2.2.0/logs/hadoop-rushi-namenode-ubuntu.out
    localhost: starting datanode, logging to /usr/local/hadoop-2.2.0/logs/hadoop-rushi-datanode-ubuntu.out
    Starting secondary namenodes [Java HotSpot(TM) 64-Bit Server VM warning: You have loaded library /usr/local/hadoop-2.2.0/lib/native/libhadoop.so.1.0.0 which might have disabled stack guard. The VM will try to fix the stack guard now.
    It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
    0.0.0.0

]

有什么问题,怎么解决?请帮帮我

irlmq6kh

irlmq6kh1#

此错误主要是由于.bashrc的配置错误造成的。
在最后的.bashrc文件中添加以下代码。


# HADOOP VARIABLES START

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

# HADOOP VARIABLES END

删除有关主机的错误。安装apache2服务器。它将配置localhost的所有基本配置。

sudo apt-get install apache2.

请在此url上检查:http://localhost
阅读下面的整篇文章,从一开始就进行配置。http://www.bogotobogo.com/hadoop/bigdata_hadoop_install_on_ubuntu_single_node_cluster.php

wb1gzix0

wb1gzix02#

这与本链接中给出的问题相同。只是换个Angular 问
遵循此链接后,仍然有机会得到以下警告

WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable

要解决此警告,请访问以下链接

lzfw57am

lzfw57am3#

我认为这里唯一的问题和这个问题是一样的,所以解决方法也是一样的:
停止jvm将stack guard警告打印到stdout/stderr,因为这会破坏hdfs启动脚本。
通过替换你的 etc/hadoop/hadoop-env.sh 生产线:

export HADOOP_OPTS="$HADOOP_OPTS -Djava.net.preferIPv4Stack=true"

使用:

export HADOOP_OPTS="$HADOOP_OPTS -XX:-PrintWarnings -Djava.net.preferIPv4Stack=true"

(这个解决方案已经在sumit chawla的博客上找到了)

zzwlnbp8

zzwlnbp84#

此脚本已弃用。而是使用start-dfs.sh和start-yarn.sh
试试start-yarn.sh

clj7thdc

clj7thdc5#

原因之一可能是hadoop中的默认本机库是为32位构建的。
将以下行添加到.bashrc或.bash\u配置文件:

export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_INSTALL/lib/native
export HADOOP_OPTS="-Djava.library.path=$HADOOP_INSTALL/lib"

这对我在ubuntu12.04上起了作用。
$hadoop\u install是安装hadoop的位置(通常是/usr/local/hadoop)。
甚至可能有hadoop\u home而不是hadoop\u install。

相关问题