1、解压
tar -xzvf hadoop-2.8.1.tar.gz
2、配置环境变量、生效
vi /etc/profile
export HADOOP_HOME=/opt/software/hadoop-2.8.1
export PATH=$HADOOP_HOME/bin:$PATH
source /etc/profile
3、配置core-site文件
#cd /opt/software/hadoop-2.8.1/etc/hadoop
vi core_site.xml
4、配置hdfs-site.xml文件
vi hdfs-site.xml
5、修改hadoop-env.sh中java_home
# The java implementation to use.
export JAVA_HOME=/usr/java/jdk1.8.0_45
6、格式化hdfs
格式化之前先将ip和机器名添加至hosts文件
vi /etc/hosts
192.168.137.130 hadoop001
[root@hadoop001 ~]# hdfs namenode -format
18/05/17 19:57:05 INFO util.ExitUtil: Exiting with status 0
18/05/17 19:57:05 INFO namenode.NameNode: SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at hadoop001/192.168.137.130
************************************************************/
7、启动
[root@hadoop001 hadoop-2.8.1]# cd sbin
[root@hadoop001 sbin]# ./start-dfs.sh
8、测试
[root@hadoop001 sbin]# jps
21946 SecondaryNameNode
22059 Jps
21788 DataNode
21662 NameNode
网友评论