CentOS7+hadoop2.6.5单节点配置

环境目录

[sam@sam01 ~]$ vi .bash_profile
export JAVA_HOME=$HOME/tools/jdk1.7.0_80
export CLASSPATH=$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export HADOOP_HOME=$HOME/tools/hadoop-2.6.5
export HADOOP_CONF_DIR=$HOME/tools/hadoop-2.6.5/etc/hadoop
PATH=$HADOOP_HOME/sbin:$HADOOP_HOME/bin:$JAVA_HOME/bin:$PATH
export PATH

建立HDFS文件存储目录

[sam@sam01 ~]$ mkdir -p /home/sam/tmp/hadoop

ssh免密钥配置

[sam@sam01 hadoop]$ ssh-keygen -t rsa
[sam@sam01 hadoop]$ cd ~/.ssh
[sam@sam01 .ssh]$ cp id_rsa.pub authorized_keys

hadoop-env.sh配置JAVA_HOME

#######[sam@sam01 hadoop]$ vi $HADOOP_HOME/etc/hadoop/hadoop-env.sh

export JAVA_HOME=/home/sam/tools/jdk1.7.0_80

修改hadoop配置文件

[sam@sam01 hadoop]$ vi $HADOOP_HOME/etc/hadoop/core-site.xml







 
     hadoop.tmp.dir
     file:///home/sam/data/hadoop/tmp
     A base for other temporary directories.
 

 
     fs.defaultFS
     hdfs://sam01:9000
 

[sam@sam01 hadoop]$ vi $HADOOP_HOME/etc/hadoop/hdfs-site.xml







  
    dfs.nameservices
    sam-hadoop-cluster
  
  
    dfs.replication
    1
  
  
    dfs.namenode.name.dir
    file:///home/sam/data/hadoop/hdfs/nn
  
  
    dfs.namenode.checkpoint.dir
    file:///home/sam/data/hadoop/hdfs/snn
  
  
    dfs.namenode.checkpoint.edits.dir
    file:///home/sam/data/hadoop/hdfs/snn
  
  
    dfs.datanode.data.dir
    file:///home/sam/data/hadoop/hdfs/dn
  
  
    dfs.permissions
    false
  

格式化目录

[sam@sam01 hadoop]$ $HADOOP_HOME/bin/hdfs namenode -format

启动hdfs

[sam@sam01 hadoop]$ $HADOOP_HOME/sbin/start-dfs.sh
访问http://192.168.1.106:50070
[sam@sam01 hadoop]$ mv $HADOOP_HOME/etc/hadoop/mapred-site.xml.template $HADOOP_HOME/etc/hadoop/mapred-site.xml
[sam@sam01 hadoop]$ vi $HADOOP_HOME/etc/hadoop/mapred-site.xml

    
        mapreduce.framework.name
        yarn
    

[sam@sam01 hadoop]$ vi $HADOOP_HOME/etc/hadoop/yarn-site.xml

  
    yarn.resourcemanager.hostname
    sam01
  
  
  
    yarn.nodemanager.aux-services
    mapreduce_shuffle
  
  
    yarn.nodemanager.local-dirs
    file:///home/sam/data/hadoop/yarn/nm
  

[sam@sam01 hadoop]$ $HADOOP_HOME/sbin/start-yarn.sh
访问http://192.168.1.106:8088

你可能感兴趣的:(CentOS7+hadoop2.6.5单节点配置)