接上一篇:http://www.javashuo.com/article/p-bnuvvbxs-hg.htmlnode
Because Cloudera’s customers need to thoroughly understand their workloads in order to fully optimize Hadoop hardware, a classic chicken-and-egg problem ensues. Most teams looking to build a Hadoop cluster don’t yet know the eventual profile of their workload, and often the first jobs that an organization runs with Hadoop are far different than the jobs that Hadoop is ultimately used for as proficiency increases. Furthermore, some workloads might be bound in unforeseen ways. For example, some theoretical IO-bound workloads might actually be CPU-bound because of a user’s choice of compression, or different implementations of an algorithm might change how the MapReduce job is constrained.服務器
因爲Cloudera的客戶爲了優化硬件須要明確的理解工做場景,一個典型的雞生蛋、蛋生雞的問題產生了。大多數構建Hadoop集羣的團隊甚至還不知道最終的工做場景。不少時候,一個組織用Hadoop作的第一個工做跟他們熟悉Hadoop以後的最終用途截然不同。更重要的是,一些工做場景會受到不可預見的限制。好比,一個理論上的受IO限制的工做可能實際受到了CPU限制,因爲用到了壓縮,或者實現了不一樣的邏輯改變了MapReduce限制的工做。網絡
For these reasons, when the team is unfamiliar with the types of jobs it is going to run, as an initial approach it makes sense to invest in a balanced Hadoop cluster.The next step would be to benchmark MapReduce jobs running on the balanced cluster to analyze how they’re bound. To achieve that goal, it’s straightforward to measure live workloads and determine bottlenecks by putting thorough monitoring in place. We recommend installing Cloudera Manager on the Hadoop cluster to provide real-time statistics about CPU, disk, and network load. With Cloudera Manager installed, Hadoop administrators can then run their MapReduce jobs and check the Cloudera Manager dashboard to see how each machine is performing.app
因爲這些緣由,團隊不熟悉運行任務的類型,做爲一個最初的方案,投入一個均衡的Hadoop集羣就變得有意義了。下一步在集羣上跑MapReduce的基準測試任務來分析限制在哪裏。爲了達到這一目的,最直接的方式就是經過測量實際的場景和設置監控來確認瓶頸所在。咱們建議安裝Cloudera Manager在集羣上來提供實時的CPU、磁盤、網絡負載統計。安裝CM後,管理員可運行MapReduce、查看儀表盤來獲取每一個機器的運行狀況。運維
In addition to building out a cluster appropriate for the workload, we encourage customers to work with their hardware vendor to understand the economics of power and cooling. Since Hadoop runs on tens, hundreds, or thousands of nodes, an operations team can save a significant amount of money by investing in power-efficient hardware. Each hardware vendor will be able to provide tools and recommendations for how to monitor power and cooling.ide
另外,爲了打造一個適合工做場景的集羣,咱們鼓勵客戶跟硬件提供商一塊兒工做,以便更好的理解電量和製冷上的經濟投入。對於10個,100個,1000個節點的集羣,運維團隊能夠節省很多的一筆錢,經過購買節能硬件。每一個供應商都會在電力和製冷方面提供工具和建議。工具
The first step in choosing a machine configuration is to understand the type of hardware your operations team already manages. Operations teams often have opinions or hard requirements about new machine purchases, and will prefer to work with hardware with which they’re already familiar. Hadoop is not the only system that benefits from efficiencies of scale. Again, as a general suggestion, if the cluster is new or you can’t accurately predict your ultimate workload, we advise that you use balanced hardware.oop
選擇硬件首先須要弄清楚已有的硬件類型。團隊購買硬件的觀念,每每更傾向於他們熟悉的硬件。Hadoop並不會惟一受益於規模效應的系統。一般建議,若是你不能準確的預計最終用途,咱們建議購買均衡的硬件。測試
There are four types of roles in a basic Hadoop cluster: NameNode (and Standby NameNode), JobTracker, TaskTracker, and DataNode. (A node is a machine performing a particular task.) Most machines in your cluster will perform two of these roles, functioning as both DataNode (for data storage) and TaskTracker (for data processing).優化
典型的Hadoop集羣有4種角色:NameNode(備用NameNode),JobTracker,TaskTracker,DataNode.一個node就是執行特定任務的機器。多數機器扮演2個角色,同時具備DataNode(數據存儲)和TaskTracker(數據計算)的功能。
Here are the recommended specifications for DataNode/TaskTrackers in a balanced Hadoop cluster:
推薦的DataNode/TaskTrackers規格:
12-24個1-4TB的磁盤(JBOD)
2個4/6/8核CPU,主頻至少2-2.5GHz
64-512內存
骨幹千兆網絡或萬兆網絡。數據越密集,須要的網絡吞吐量就越高。
The NameNode role is responsible for coordinating data storage on the cluster, and the JobTracker for coordinating data processing. (The Standby NameNode should not be co-located on the NameNode machine for clusters and will run on hardware identical to that of the NameNode.) Cloudera recommends that customers purchase enterprise-class machines for running the NameNode and JobTracker, with redundant power and enterprise-grade disks in RAID 1 or 10 configurations.
NameNode用來協調數據在集羣上的存儲,JobTracker協調數據計算。(備用的NameNode不該該一併放在NameNode的主機上,應該放在跟NameNode硬件如出一轍的另外一臺主機上。)Cloudera建議客戶購買企業級的硬件來跑NameNode和JobTracker,配置配用電源,企業級的RAID1和RAID10磁盤。
The NameNode will also require RAM directly proportional to the number of data blocks in the cluster. A good rule of thumb is to assume 1GB of NameNode memory for every 1 million blocks stored in the distributed file system. With 100 DataNodes in a cluster, 64GB of RAM on the NameNode provides plenty of room to grow the cluster. We also recommend having HA configured on both the NameNode and JobTracker, features that have been available in the CDH4 line for some time.
NameNode須要的內存與集羣裏數據塊的數量成正比。一個好的經驗法則,每存儲100萬個數據塊,NameNode須要1GB內存。100個DataNode的集羣,64GB內存的NameNode有足夠的空間來擴展集羣。建議採用NameNode和JobTracker的高可用(HA)配置,這個特性包含在CDH4及之後的版本里。
Here are the recommended specifications for NameNode/JobTracker/Standby NameNode nodes. The drive count will fluctuate depending on the amount of redundancy:
推薦的NameNode/JobTracker/備用Namenode規格:
磁盤數量會根據冗餘(備份)的數量而上下浮動。
With a Hadoop cluster in place, the team can start identifying workloads and prepare to benchmark those workloads to identify hardware bottlenecks. After some time benchmarking and monitoring, the team will understand how additional machines should be configured. Heterogeneous Hadoop clusters are common, especially as they grow in size and number of use cases – so starting with a set of machines that are not 「ideal」 for your workload will not be a waste of time. Cloudera Manager offers templates that allow different hardware profiles to be managed in groups, making it simple to manage heterogeneous clusters.
Hadoop集羣到位後,團隊能夠運行等同的工做負載,準備基準測試來肯定硬件瓶頸。通過一段時間的基準測試和監控,你就會明白其餘的機器如何配置了
Below is a list of various hardware configurations for different workloads, including our original 「balanced」 recommendation:
如下是不一樣工做場景的硬件配置,包含以前提到的「中庸」的建議:
輕度任務(1U服務器):2個6核CPU,24-64GB內存,8個磁盤(1TB或2TB)
計算與存儲兼顧(1U服務器):2個6核CPU,48-128GB內存,主板控制器直接鏈接12-16個硬盤(1TB或2TB),在一個2U機櫃上,一般2個主板和24個硬盤組成1對。
重度存儲(2U服務器):2個6核CPU,48-96GB內存,16-24個硬盤(2TB-4TB)。若是多個節點或者機架故障,將引發大量的網絡數據傳輸。
密集計算(2U服務器):2個6核CPU,64-512GB內存,4-8個硬盤(1TB-2TB)。
未完成,請繼續閱讀:http://www.javashuo.com/article/p-nmgvebdn-kk.html