zoukankan      html  css  js  c++  java
  • 如何启动ResourceManager和NodeManager

    1. 登录到bigtop1上,vagrant ssh bigtop1

    /usr/lib/hadoop/libexec/init-hdfs.sh文件内容替换为:

    #!/bin/bash -ex
    #
    # Licensed to the Apache Software Foundation (ASF) under one or more
    # contributor license agreements.  See the NOTICE file distributed with
    # this work for additional information regarding copyright ownership.
    # The ASF licenses this file to You under the Apache License, Version 2.0
    # (the "License"); you may not use this file except in compliance with
    # the License.  You may obtain a copy of the License at
    #
    #     http://www.apache.org/licenses/LICENSE-2.0
    #
    # Unless required by applicable law or agreed to in writing, software
    # distributed under the License is distributed on an "AS IS" BASIS,
    # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    # See the License for the specific language governing permissions and
    # limitations under the License.
    
    ### Script requires package bigtop-groovy to be installed
    # Use this script to initialize HDFS directory structure for various components
    # to run. This script can be run from any node in the Hadoop cluster but should
    # only be run once by one node only. If you are planning on using oozie, we
    # recommend that you run this script from a node that has hive, pig, sqoop, etc.
    # installed. Unless you are using psuedo distributed cluster, this node is most
    # likely NOT your namenode
    # Steps to be performed before running this script:
    # 1. Stop the namenode and datanode services if running.
    # 2. Format namenode (su -s /bin/bash hdfs hdfs namenode -format).
    # 3. Start the namenode and datanode services on appropriate nodes.
    
    # Autodetect JAVA_HOME if not defined
    if [ -f /usr/lib/bigtop-utils/bigtop-detect-javahome ]; then
      . /usr/lib/bigtop-utils/bigtop-detect-javahome
    fi
    
    HADOOP_LIB_DIR=/usr/lib/hadoop/lib
    HDFS_LIB_DIR=/usr/lib/hadoop-hdfs/lib
    HADOOP_DEPENDENCIES="commons-logging*.jar guava*.jar commons-configuration*.jar commons-collections*.jar slf4j-api*.jar protobuf-java*.jar commons-lang*.jar"
    HDFS_DEPENDENCIES="htrace-core*.jar"
    for i in /usr/lib/hadoop/*.jar; do CLASSPATH=$CLASSPATH:$i; done
    for i in /usr/lib/hadoop-yarn/lib/*.jar; do CLASSPATH=$CLASSPATH:$i; done
    CLASSPATH=/etc/hadoop/conf:$CLASSPATH:/usr/lib/hadoop-hdfs/hadoop-hdfs.jar
    pushd .
    cd $HADOOP_LIB_DIR
    for d in $HADOOP_DEPENDENCIES; do CLASSPATH=$CLASSPATH:$HADOOP_LIB_DIR/$d; done
    for d in $HDFS_DEPENDENCIES;   do CLASSPATH=$CLASSPATH:$HDFS_LIB_DIR/$d; done
    popd
    su -s /bin/bash hdfs -c "/usr/lib/bigtop-groovy/bin/groovy -classpath $CLASSPATH /usr/lib/hadoop/libexec/init-hcfs.groovy /usr/lib/hadoop/libexec/init-hcfs.json"

    在bigtop1上执行命令:

    puppet apply -d --modulepath=/bigtop-home/bigtop-deploy/puppet/modules:/etc/puppet/modules:/usr/share/puppet/modules /bigtop-home/bigtop-deploy/puppet/manifests/site.pp

    执行完后,使用jps命令查看:

    clipboard

  • 相关阅读:
    python 小数和百分数之间的转换
    Pandas datetime常用属性
    Pandas 时间处理 获取数组中某月的数据
    Pandas如何将两个Series对象进行与运算
    【数据结构与算法】数组的增删改查
    【效率为王】超详细 Hexo + Github Pages 博客搭建教程
    大牛们都是怎么玩 Manjora 的
    利用 Halo 从 0 到 1 搭建属于自己的博客
    十分钟入门 Markdown 写作
    当前知识水平下的问题复杂度分类
  • 原文地址:https://www.cnblogs.com/justinzhang/p/5166972.html
Copyright © 2011-2022 走看看