YARN:资源调度平台
YARN集群运行
HDFS已经启动
[root@node1 hadoop]# scp yarn-site.xml node2:/opt/hadoop-2.7.3/etc/hadoop/
yarn-site.xml 100% 3496 282.5KB/s 00:00
[root@node1 hadoop]# scp mapred-site.xml node2:/opt/hadoop-2.7.3/etc/hadoop/
mapred-site.xml 100% 1803 133.8KB/s 00:00
[root@node1 hadoop]# scp mapred-site.xml node3:/opt/hadoop-2.7.3/etc/hadoop/
mapred-site.xml 100% 1803 29.8KB/s 00:00
[root@node1 hadoop]# scp yarn-site.xml node3:/opt/hadoop-2.7.3/etc/hadoop/
yarn-site.xml
[root@node1 hadoop]# jps
2033 Jps
1798 DataNode
1694 NameNode
[root@node2 ~]# jps
1585 Jps
1299 DataNode
1544 SecondaryNameNode
[root@node2 ~]# ^C
[root@node2 ~]#
[root@node3 ~]# jps
1515 Jps
1279 DataNode
[root@node3 ~]#
分发文件
[root@node1 hadoop]# start-yarn.sh
starting yarn daemons
starting resourcemanager, logging to /opt/hadoop-2.7.3/logs/yarn-root-resourcemanager-node1.out
node3: starting nodemanager, logging to /opt/hadoop-2.7.3/logs/yarn-root-nodemanager-node3.out
node2: starting nodemanager, logging to /opt/hadoop-2.7.3/logs/yarn-root-nodemanager-node2.out
node1: starting nodemanager, logging to
/opt/hadoop-2.7.3/logs/yarn-root-nodemanager-node1.out
[root@node1 hadoop]#
[root@node1 hadoop]# jps
2129 ResourceManager
2517 Jps
1798 DataNode
2230 NodeManager
1694 NameNode
[root@node1 hadoop]#
[root@node2 ~]# jps
1681 NodeManager
1299 DataNode
1544 SecondaryNameNode
1785 Jps
[root@node2 ~]#
[root@node3 ~]# jps
1698 Jps
1279 DataNode
1599 NodeManager
[root@node3 ~]#
[root@node1 hadoop]# cd mapreduce
[root@node1 mapreduce]# ll
total 4972
-rw-r--r-- 1 root root 537521 Aug 17 2016 hadoop-mapreduce-client-app-2.7.3.jar
-rw-r--r-- 1 root root 773501 Aug 17 2016 hadoop-mapreduce-client-common-2.7.3.jar
-rw-r--r-- 1 root root 1554595 Aug 17 2016 hadoop-mapreduce-client-core-2.7.3.jar
-rw-r--r-- 1 root root 189714 Aug 17 2016 hadoop-mapreduce-client-hs-2.7.3.jar
-rw-r--r-- 1 root root 27598 Aug 17 2016 hadoop-mapreduce-client-hs-plugins-2.7.3.jar
-rw-r--r-- 1 root root 61745 Aug 17 2016 hadoop-mapreduce-client-jobclient-2.7.3.jar
-rw-r--r-- 1 root root 1551594 Aug 17 2016 hadoop-mapreduce-client-jobclient-2.7.3-tests.jar
-rw-r--r-- 1 root root 71310 Aug 17 2016 hadoop-mapreduce-client-shuffle-2.7.3.jar
-rw-r--r-- 1 root root 295812 Aug 17 2016 hadoop-mapreduce-examples-2.7.3.jar
drwxr-xr-x 2 root root 4096 Aug 17 2016 lib
drwxr-xr-x 2 root root 30 Aug 17 2016 lib-examples
drwxr-xr-x 2 root root 4096 Aug 17 2016 sources
[root@node1 mapreduce]#
Hadoop自带样例程序
[root@node1 ~]# cd /opt/hadoop-2.7.3/share/hadoop/mapreduce/
[root@node1 mapreduce]# ll total 4972 -rw-r--r-- 1 root root 537521 Aug 17 2016 hadoop-mapreduce-client-app-2.7.3.jar
-rw-r--r-- 1 root root 773501 Aug 17 2016 hadoop-mapreduce-client-common-2.7.3.jar
-rw-r--r-- 1 root root 1554595 Aug 17 2016 hadoop-mapreduce-client-core-2.7.3.jar
-rw-r--r-- 1 root root 189714 Aug 17 2016 hadoop-mapreduce-client-hs-2.7.3.jar
-rw-r--r-- 1 root root 27598 Aug 17 2016 hadoop-mapreduce-client-hs-plugins-2.7.3.jar
-rw-r--r-- 1 root root 61745 Aug 17 2016 hadoop-mapreduce-client-jobclient-2.7.3.jar
-rw-r--r-- 1 root root 1551594 Aug 17 2016 hadoop-mapreduce-client-jobclient-2.7.3-tests.jar
-rw-r--r-- 1 root root 71310 Aug 17 2016 hadoop-mapreduce-client-shuffle-2.7.3.jar
-rw-r--r-- 1 root root 295812 Aug 17 2016 hadoop-mapreduce-examples-2.7.3.jar
drwxr-xr-x 2 root root 4096 Aug 17 2016 lib
drwxr-xr-x 2 root root 30 Aug 17 2016 lib-examples
drwxr-xr-x 2 root root 4096 Aug 17 2016 sources
求解PI值
我们可以观察页面http://192.168.55.128:8088