一、准备软件环境:
hadoop-2.6.0.tar.gz
CentOS release 6.5
jdk-7u67-linux-x64.tar.gz
网络配置:
master1 192.168.11.24
worker1 192.168.11.25
二、操作步骤:
1. 修改主机名
2. 配置ssh无密码登录节点
3. 安装jdk, hadoop
4. 配置分布式环境
slaves
core-site.xml
hdfs-site.xml
mapred-site.xml 【mapred-site.xml.template】
yarn-site.xml
5. 在master上启动Hadoop
bin/hdfs namenode -format
sbin/start-dfs.sh
sbin/start-yarn.sh
通过jps查看各个节点所启动的进程,首先查看master:master节点启动了NameNode、SecondaryNameNode、ResourceManager进程。
接着查看slave1:启动了DataNode和NodeManager进程。
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAYwAAACwCAIAAACTlM5/AAAYi0lEQVR4nO2dS3bcOJaGuR4OexE94ci2/JLk16kRN5G2y4IetnMRXEOn01kVI9tZtkJyr6K7q2oZPQAJ3gvcCwIRpAIh/d/Jc9JCgAAIkn8ACNyf1cN3l/a/T+t//sd//qUCZdN2q56u3XVbboKbP9+71sN7AEQKAFA0ECkAQNFApAAARQORAgAUDUQKAFA0xYlUY/Dbyi6p2840VWO6tt51UwCoqioqUnX/Y+wN3q512w3VNWZlmpuqNx+rpSldY7tx03NpzCJ63X8VCO2v2840VqlSqduu6GsF9py4SC2nT+JTwGpc5ss86+nT6J/K5BbmPfM+jVlmUClf38asckUKgEXJEik7tOraehhkjXfyuAWOf6kK6TVJ4wcMTz35nreZu87YjP0nwxFubhgMCsiWvK6zD7leL/uIKELkfGlzJ6nbzrSuClKI1n7SHtMwkUrvZ9txbWvEGirp+pLm+F0hQjvUFRWvV7guAMTJHkkN8xz7b/tAjJM0m2G4+bT0ShnR2Ke+n+g5CajbbtWn2P+P3/NNQ1XSlUhb3pjVZL30RO2MM36+rLkJ1G3nnlU+WhTb35gVa/5kf0bS+XcDa752fbu2zh7F8gO0eiPXBQCVDURK+EYWRxhaelVVUZHqq6UiNWiEvdvHgvngSB6i+COOoN5ghOWVpD6vm0336FFi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cX2KL2ZNiJSen7aTTlFjrqQQKQAsgkgF0xD+xAtTE4ugObn5Jciac93/LS6Eq+00XNf4mdHpaO2/sYsU3xtXmWZMdHPEVbhDguT32tl1TFkl6yvfhgsLUuBOI46kwHLkvh0HgDvO/wO1H64RQ0Q/zwAAAABJRU5ErkJggg==" alt="" />
遇到的问题及处理方法:【master节点jps时没有namenode】
重新format一下namenode
6. 关闭Hadoop集群也是在master节点上执行:
sbin/stop-dfs.sh sbin/stop-yarn.sh