$ vim .bashrc //编辑文件,添加如下几行
export HADOOP_HOME=/home/hduser/hadoop
export JAVA_HOME=/usr/lib/jvm/java-8-oracle
PATH=$PATH:$HADOOP_HOME/bin:$HADOOP_HOME/sbin
$ source .bashrc //source使其立即生效
分别在master和slave节点上执行以下操作,更改Hadoop-env的JAVA_HOME:
$ vim /home/hduser/hadoop/etc/hadoop/hadoop-env.sh
#export JAVA_HOME=${JAVA_HOME} //更改此行,或者注释掉新加以下一行
export JAVA_HOME=/usr/lib/jvm/java-8-oracle
--------------------------------------分割线 --------------------------------------
下面关于Hadoop的文章您也可能喜欢,不妨看看:
Ubuntu14.04下Hadoop2.4.1单机/伪分布式安装配置教程
CentOS 6.3下Hadoop伪分布式平台搭建
Ubuntu 14.04 LTS下安装Hadoop 1.2.1(伪分布模式)
CentOS7+Hadoop2.5.2+Spark1.5.2环境搭建
--------------------------------------分割线 --------------------------------------
7.Hadoop配置
Hadoop的配置这里主要涉及四个配置文件:etc/hadoop/core-site.xml,etc/hadoop/hdfs-site.xml, etc/hadoop/yarn-site.xml and etc/hadoop/mapred-site.xml.
这里摘录网络上的一段话,在继续下面的操作之前一定要阅读这段,以便更好的理解:
Hadoop Distributed File System: A distributed file system that provides high-throughput access to application data. A HDFS cluster primarily consists of a NameNode that manages the file system metadata and DataNodes that store the actual data. If you compare HDFS to a traditional storage structures ( e.g. FAT, NTFS), then NameNode is analogous to a Directory Node structure, and DataNode is analogous to actual file storage blocks.
Hadoop YARN: A framework for job scheduling and cluster resource management.
Hadoop MapReduce: A YARN-based system for parallel processing of large data sets.