• [zz]Unrecognized option: jvm


    转载自:http://blog.csdn.net/viproc/article/details/7570866

    情景描述:
            按照hadoop手册,搭建Single Node.
            启动hadoop时   #./start-all.sh
            报错:
            ###################
    ####################################
             localhost: Unrecognized option: -jvm
             localhost: Could not create the Java virtual machine.
           
    ######################################################    

    环境:
          服务器:RHEL4.7_x86_64 内存:512M
          hadoop版本:hadoop-0.20.203.0rc1.tar.gz
          java版本:jdk-6u25-linux-x64.bin
            
    解决:
       可以修改的地方有两个
          第一个(次要的):/usr/local/hadoop/conf/hadoop-env.sh
           修改参数: export HADOOP_HEAPSIZE=256   #默认值为1000M,为Java虚拟机占用的内存的大小

      第二个(主要的)
           查看
    /usr/local/hadoop/bin/hadoop源码:
           ################################################
    ####################
           if [[ $EUID -eq 0 ]]; then
               HADOOP_OPTS="$HADOOP_OPTS -jvm server $HADOOP_DATANODE_OPTS"
           else
               HADOOP_OPTS="$HADOOP_OPTS -server $HADOOP_DATANODE_OPTS"
           fi
          
    ####################################################################
           如果以root身份启动,则hadoop启动java虚拟机时,会带上-jvm参数。
           不同的java版本,启动参数可能会不一致,由此导致以上问题。
          
           其他解释
           (详细见链接地址:
           http://mail-archives.apache.org/mod_mbox/hadoop-hdfs-user/201105.mbox
           /%3CBANLkTinm3q4EAo=GkeMjG67ZnXXRLRV+yw@mail.gmail.com%3E):
           ####################################################################     

                > I think, that code is there for jsvc. If you run hadoop in secure mode, it             
                > executes this path. There is nothing wrong in -jvm option since it meant for             
                > jsvc.             
                >             
                > In case of secure mode, jsvc process runs as root and invokes the datanode             
                > process as hdfs user (or any other configured user).            
                > But it seems there is a bug in the code, if you run as root in non-secured             
                > mode this issue can trigger.             
                >
           ####################################################################       
    

           因此,
           新建一个hadoop用户,
           重新初始化操作:#./
    hadoop namenode -format

           再次启动hadoop: #./start-all.sh
           正常。
          
    补充: 修改JAVA_HEAP_MAX的大小:
            # vi bin/hadoop
              JAVA_HEAP_MAX=-Xmx1000m
       
           输出结果:
    ############################
    ##################################################################################
    [hadoop@localhost bin]$ ./start-all.sh
    starting namenode, logging to /usr/local/hadoop/bin/../logs/hadoop-hadoop-namenode-localhost.out
    localhost: starting datanode, logging to /usr/local/hadoop/bin/../logs/hadoop-hadoop-datanode-localhost.out
    localhost: starting secondarynamenode, logging to /usr/local/hadoop/bin/../logs/hadoop-hadoop-secondarynamenode-localhost.out
    starting jobtracker, logging to /usr/local/hadoop/bin/../logs/hadoop-hadoop-jobtracker-localhost.out
    localhost: starting tasktracker, logging to /usr/local/hadoop/bin/../logs/hadoop-hadoop-tasktracker-localhost.out
    ####################################################################################

  • 相关阅读:
    Java发生的重大事件
    Java的特点
    JVM的整体结构
    JVM生态圈
    简历不造假,根本就找不到工作?如果你这样想就OUT了
    C语言必背18个经典程序,你记住了吗
    黑客入侵的常用手段,你真的要做好防护了
    从零开始自学Linux,一篇文章带你快速找准学习方向
    还在担心学Linux懵圈吗?掌握这份Linux思维导图,你就能成为高手
    为何计算机专业大一期间先选择学习C语言,而不是其他语言呢?
  • 原文地址:https://www.cnblogs.com/zhangzhang/p/2854671.html
Copyright © 2020-2023  润新知