怎么获取到Hadoop集群的个数

如何获取到Hadoop集群的个数

Class ClusterStatus

====================================================================

ClusterStatus provides clients with information such as:

  1. Size of the cluster.
  2. Name of the trackers.
  3. Task capacity of the cluster.
  4. The number of currently running map and reduce tasks.
  5. State of the JobTracker.
  6. Details regarding black listed trackers.
-----------------------------------------------------------------------------------------------------------------------

 ClusterStatus clusterStatus = new JobClient(new JobConf()).getClusterStatus();

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

Nice!

1楼laxcus前天 12:45
这在我们的集群里,只是管理员在终端上发一个命令就可以解决的问题: count [all|data|call|work|build] site