Design
NameNode: s201
DataNode: s202, s203, s204
Config of Hadoop
core-site.xml1234<property><name>fs.defaultFS</name><value>hdfs://s201/</value></property>hdfs-site.xml1234<property><name>dfs.replication</name><value>3</value></property>There are 3 datanodes.
mapred-site.xml
Don not need to modify.yarn-site.xml12345678<property><name>yarn.resourcemanager.hostname</name><value>s201</value></property><property><name>yarn.nodemanager.aux-services</name><value>mapreduce_shuffle</value></property>resourcemanager is s201.
- Clear
Remove all of${HADOOP_HOME}/logsand/tmp.Clone VMs and Test
- Clone
Clone –> Create a full done - Config hostname and network
- hostname
Edit/etc/sysconfig/network
ChangeHOSTNAME=s20x - Network
- IP
Edit/etc/sysconfig/network-scripts/ifcfg-ehtx
RemoveHWADDRandUUID
ChangeIPADDR=xxx.xxx.xxx.20x - Card info
Remove/etc/udev/rules.d/70-persistent-net.rules - Restart network
- IP
- hostname
- Ssh without password
Configs201login others without password. Start hadoop
12$> hadoop namenode -format$> start-all.shWebUI:
http://192.168.137.201:50070
Click Datanodes –> 3 datanodes
Config by script
- Install
rsyncpackage Edit
xcall.shto run command on all nodes1234567891011121314param=$@ip=201if [ $# -lt 1 ]; thenecho parameters less than 1exit 1fifor (( ; ip<=204; ip=$ip+1 )); doecho =============host: ${ip}============ssh s$ip "${param}"doneEdit
xrsync.shcopy file to other nodes12345678910111213141516171819if [ $# -lt 1 ]; thenecho no paramexit 1fipath=$1dir=$(dirname $path)filename=$(basename $path)cd $dirfullpath=$(pwd -P .)user=$(whoami)for (( ip=202; ip<=204; ip=$ip+1 )); doecho ============node: s$ip=============rsync -lr ${path} ${user}@s${ip}:${fullpath}done