• Hadoop2.6.0单机伪分布式安装


    ubuntu@Ubuntu:~$ sudo gedit /etc/hostname

    2hnu

    hadoop

    ubuntu@Ubuntu:~$ sudo groupadd hadoop    //hadoop

    ubuntu@Ubuntu:~$ sudo useradd -s /bin/bash -d /home/hnu -m hnu -g hadoop   //hnuhadoop

    ubuntu@Ubuntu:~$ sudo passwd hnu   //hnu

    ubuntu@Ubuntu:~$ su hnu  //hnu

    3SSHSSH

    Ubuntu14.04环境下:

    ubuntu@Ubuntu:~$ sudo apt-get update

    ubuntu@Ubuntu:~$ sudo apt-get install openssh-client=1:6.6p1-2ubuntu1

    ubuntu@Ubuntu:~$ sudo apt-get install openssh-server

    hnu@Ubuntu:~$  ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa

    .ssh

    hnu@Ubuntu:~$ cd .ssh

    hnu@Ubuntu:~/.ssh$ ls

    id_dsa.pubid_dsaauthorized_keys

    hnu@Ubuntu:~/.ssh$ cat id_dsa.pub >> authorized_keys

    hnu@Ubuntu:~/.ssh$ ls

    hnu@Ubuntu:~$ ssh localhost

     Ubuntu16.04环境下: 

    ubuntu@Ubuntu:~$ sudo apt-get install openssh-server

    如果系统为Ubuntu16.0.4,则该步骤如下图所示

    4Java

    JDK

    ubuntu@Ubuntu:/opt$ sudo tar -zxvf jdk-8u91-linux-x64.tar.gz -C /opt

    ubuntu@Ubuntu:~$ sudo gedit /etc/profile

    #JAVA

    export JAVA_HOME=/opt/jdk1.8.0_91

    export PATH=$PATH:$JAVA_HOME/bin

    export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib

    #HADOOP

    export HADOOP_PREFIX=/home/hnu/hadoop-2.6.0

    export PATH=$PATH:$HADOOP_PREFIX/bin:$HADOOP_PREFIX/sbin

    export HADOOP_COMMON_LIB_NATIVE_DIR=${HADOOP_PREFIX}/lib/native

    export HADOOP_OPTS="-Djava.library.path=$HADOOP_PREFIX/lib:$HADOOP_PREFIX/lib/native"

    5Hadoop

    Hadoop

    ubuntu@Ubuntu:~$ sudo tar -zxvf hadoop-2.6.0.tar.gz -C /home/hnu

    core-site.xml:

    ubuntu@Ubuntu:/home/hnu/hadoop-2.6.0/etc/hadoop$ sudo gedit core-site.xml

    <configuration>

    <property>

    <name>hadoop.tmp.dir</name>

    <value>file:/home/hnu/hadoop-2.6.0/tmp</value>

    <description>Abase for other temporary directories.</description>

    </property>

    <property>

    <name>fs.defaultFS</name>

    <value>hdfs://localhost:9000</value>

    </property>

    </configuration>

    hdfs-site.xml:

    ubuntu@Ubuntu:/home/hnu/hadoop-2.6.0/etc/hadoop$ sudo gedit hdfs-site.xml

    <configuration>

    <property>

    <name>dfs.replication</name>

    <value>1</value>

    </property>

    <property>

    <name>dfs.namenode.name.dir</name>

    <value>file:/home/hnu/hadoop-2.6.0/tmp/dfs/name</value>

    </property>

    <property>

    <name>dfs.datanode.data.dir</name>

    <value>file:/home/hnu/hadoop-2.6.0/tmp/dfs/data</value>

    </property>

    </configuration>

    mapred-site.xml:

    ubuntu@Ubuntu:/home/hnu/hadoop-2.6.0/etc/hadoop$ sudo gedit mapred-site.xml

    <configuration>
    <property>
    <name>mapred.job.tracker</name>
    <value>locahost:9001</value>
    </property>
    </configuration>

    hadoop-env.sh:

    ubuntu@Ubuntu:/home/hnu/hadoop-2.6.0/etc/hadoop$ sudo gedit hadoop-env.sh

    export JAVA_HOME=/opt/jdk1.8.0_91

    yarn-env.sh:

    ubuntu@Ubuntu:/home/hnu/hadoop-2.6.0/etc/hadoop$ sudo gedit yarn-env.sh

    export JAVA_HOME=/opt/jdk1.8.0_91

    6

    root@Ubuntu:/home/hnu# chown -R hnu:hadoop hadoop-2.6.0

    7hdfs

    hnu@Ubuntu:~$ source /etc/profile

    hnu@Ubuntu:~$ hdfs namenode -format

    8/hadoop

    start-all.sh/stop-all.sh

    start-dfs.sh/start-yarn.sh

    stop-dfs.sh/stop-dfs.sh

    hnu@Ubuntu:~$ start-dfs.sh

    hnu@Ubuntu:~$ start-yarn.sh

    hdfs/RM

    localhost:50070/localhost:8088

     
  • 相关阅读:
    CentOS(九)--与Linux文件和目录管理相关的一些重要命令①
    CentOS(八)--crontab命令的使用方法
    CentOS(七)--Linux文件类型及目录配置
    CentOS(六)--Linux系统的网络环境配置
    ActionBar实现顶部返回键,顶部按钮
    安卓---高德地图API应用
    安卓---achartengine图表----简单调用----使用view显示在自己的布局文件中----actionBar的简单设置
    安卓访问webAPI,并取回数据
    webAPI---发布(IIS)--发布遇到问题(500.19,500.21,404.8,404.3)
    安卓----短信验证(借用第三方平台)
  • 原文地址:https://www.cnblogs.com/zhangguangxu98/p/8431721.html
Copyright © 2020-2023  润新知