需安装java环境
1. 设置免密码登录
ssh-keygen -t rsa
ssh-copy-id root@192.168.10.10
ssh 'root@192.168.10.10'
2. 下载hadoop
wget http://apache.fayea.com/hadoop/common/hadoop-2.7.3/hadoop-2.7.3.tar.gz
3. 解压缩
mkdir -p /usr/local/hadoop/
tar zxvf hadoop-2.7.3.tar.gz -C /usr/local/hadoop/
4. 修改配置文件
root@ubuntu:~# cat /usr/local/hadoop/hadoop-2.7.3/etc/hadoop/core-site.xml
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>fs.default.name</name>
<value>hdfs://localhost:9000</value>
</property>
<property>
<name>hadoop.tmp.dir</name>
<value>/root/tmp</value>
</property>
</configuration>
root@ubuntu:~# cat /usr/local/hadoop/hadoop-2.7.3/etc/hadoop/hdfs-site.xml
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
</configuration>
root@ubuntu:~# cat vim /usr/local/hadoop/hadoop-2.7.3/etc/hadoop/hadoop-env.sh
export JAVA_HOME=/usr/java/jdk1.8.0_112
export HADOOP_HOME=/usr/local/hadoop/hadoop-2.7.3
export PATH=$PATH:/usr/local/hadoop/hadoop-2.7.3/bin
5. 格式化namenode
hadoop namenode -format
6. 启动hdfs
root@ubuntu:~# start-all.sh
7. 查看
root@ubuntu:~# jps