查看官网:http://hadoop.apache.org/docs/r2.5.2/hadoop-project-dist/hadoop-common/SingleCluster.html

配置hadoop

1上传hadoop包

2解压hadoop包

tar -zxvf hadoop-*.tar.gz -C /usr/local/

3配置hadoop伪分布式

第一个:hadoop-env.sh

vim hadoop-env.sh

export JAVA_HOME=/usr/java/jdk

第二个:core-site.xml

vim core-site.xml

fs.default.name

hdfs://hadoop01:9000

第三个:hdfs-site.xml

vim hdfs-site.xml

dfs.replication

1

4将hadoop添加到环境变量

vim /etc/profile

export JAVA_HOME=/usr/java/jdk

export HADOOP_HOME=/usr/local/hadoop

export PATH=.:$PATH:$JAVA_HOME/bin:$HADOOP_HOME/bin

source /etc/profile

5格式化HDFS

hadoop namenode -format

6启动hadoop

start-dfs.sh