安装wget
yum install -y wget
下载 wget http://mirror.bit.edu.cn/apache/hadoop/common/hadoop-1.2.1/hadoop-1.2.1.tar.gz
解压
tar -zxvf hadoop-1.2.1.tar.gz
配置文件
hadoop-1.2.1/conf 目录下
hadoop.env.sh
export JAVA_HOME=/usr/java/jdk1.8.0_45
core-site.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!-- Put site-specific property overrides in this file. -->
<configuration>
<!—- hadoop工作目录 -—>
<property>
<name>hadoop.tmp.dir</name>
<value>/hadoop</value>
<name>hadoop.tmp.dir</name>
<value>/hadoop</value>
</property>
<!—- 源数据目录 -—>
<property>
<name>dfs.name.dir</name>
<value>/hadoop/name</value>
</property>
<name>dfs.name.dir</name>
<value>/hadoop/name</value>
</property>
<!—- 访问路径 -—>
</configuration>
hdfs-sit.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!-- Put site-specific property overrides in this file. -->
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!-- Put site-specific property overrides in this file. -->
<configuration>
<!——文件系统数据保存路径-->
<property>
<name>dfs.name.dir</name>
<value>/hadoop/data</value>
</property>
<value>/hadoop/data</value>
</property>
</configuration>
mapred-site.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!-- Put site-specific property overrides in this file. -->
<configuration>
<property>
<name>mapred.job.tracker</name>
<value>cas:9001</value>
</property>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!-- Put site-specific property overrides in this file. -->
<configuration>
<property>
<name>mapred.job.tracker</name>
<value>cas:9001</value>
</property>
</configuration>
格式化操作 hadoop namenode -format
jps
查看文件
hadoop fs -ls /