centos6.10单机Hadoop

系统:centos 6.10
jdk:jdk-8u281-linux-x64.tar.gz
hadoop: hadoop-2.10.1.tar.gz
http://mirrors.hust.edu.cn/apache/hadoop/common/hadoop-2.10.1/
1、jdk和hadoop安装包复制解压到服务器,配置环境变量
cd /root
vim .bashrc

export JAVA_HOME=/root/hd/jdk1.8.0_281
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH

export HADOOP_HOME=/root/hd/hadoop-2.10.1
export PATH=$HADOOP_HOME/bin:$PATH

image.png

修改完环境变量执行:source .bashrc
使用命令查看是否配置OK:java -versionhadoop version
2、修改Hadoop配置文件
cd /root/hd/hadoop-2.10.1/etc/hadoop
image.png

2.1、vim core-site.xml


  
    fs.defaultFS
    hdfs://192.168.2.11:9000
  
  
    hadoop.tmp.dir
    /root/hd/hadoop-2.10.1/tmp
  
  
    hadoop.native.lib
    false
    Should native hadoop libraries, if present, be used.
  

image.png

2.2、vim hadoop-env.sh
image.png

2.3、vim hdfs-site.xml


  
    dfs.replication
    1
  
  
    dfs.secondary.http.address
    192.168.2.11:50090
  

image.png

2.4、cp mapred-site.xml.template mapred-site.xmlvim mapred-site.xml


  
    mapreduce.framework.name
    yarn
  

image.png

2.5、vim yarn-site.xml


    yarn.resourcemanager.hostname
    192.168.2.11
  
  
    yarn.nodemanager.aux-services
    mapreduce_shuffle
  

image.png

3、启动Hadoop
3.1、格式化hadoop文件
cd /root/hd/hadoop-2.10.1/sbinhadoop namenode -format
image.png

3.2、启动服务
./start-all.sh中途会让输几次密码
3.3、查看服务是否启动
jps
image.png

访问:http://192.168.2.11:50070/
image.png

你可能感兴趣的:(centos6.10单机Hadoop)