前提:四台机器都要有java环境、hadoop环境、
node01:
cd $HADOOP/etc/hadoop
#NN角色 vi core-site.xml 不需要改
# 配置HDFS 副本数为2 nn目录 dn目录 secondary_namenode启动节点以及目录 vi hdfs-site.xml <property> <name>dfs.replication</name> <value>2</value> </property> <property> <name>dfs.namenode.name.dir</name> <value>/var/bigdata/hadoop/full/dfs/name</value> </property> <property> <name>dfs.datanode.data.dir</name> <value>/var/bigdata/hadoop/full/dfs/data</value> </property> <property> <name>dfs.namenode.secondary.http-address</name> <value>node02:50090</value> </property> <property> <name>dfs.namenode.checkpoint.dir</name> <value>/var/bigdata/hadoop/full/dfs/secondary</value> </property>
vi slaves node02 node03 node04
分发: cd /opt scp -r ./bigdata/ node02:`pwd` scp -r ./bigdata/ node03:`pwd` scp -r ./bigdata/ node04:`pwd`
格式化启动 hdfs namenode -format start-dfs.sh
node01 :NameNode
node02 :SecondaryNameNode、DataNode
node03 :DataNode
node04 :DataNode