成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

聊聊 HDFS Balancer負載均衡器

大數據 數據分析
平衡指的是 每個DataNode的利用率 與 集群的利用率 之間相差不超過給定的閾值百分比。此處的平衡 指的是各個DataNode之間的平衡,同一個DataNode之間的各個磁盤是不會平衡的。

1、背景

當我們的hadoop集群運行了一段時間之后,各個DataNode上的數據分布并不一定是均勻分布的。比如說: 我們向現有集群中添加了一個新的DataNode。

DataNode數據不均衡

2、什么是平衡

此處是我自己的一個簡單的理解

所謂的平衡指的是 每個DataNode的利用率 與 集群的利用率 之間相差不超過給定的閾值百分比。此處的平衡 指的是各個DataNode之間的平衡,同一個DataNode之間的各個磁盤是不會平衡的。

2.1 每個DataNode的利用率計算

每個DataNode的利用率計算

DataNode的利用率= dfs已用的空間 / 分配給dfs的空間。

注意: 分配給dfs的空間 不是磁盤的總空間。

2.2 集群的利用率

集群的利用率

集群的利用率= 各datanode dfs已使用的空間 / 各datanode總空間

2.3 平衡

假設平衡的閾值是 5%,集群的利用率是 37.5,那么每個節點的利用率在32.5%到42.5%之間都認為是均衡的。也就是說,極端情況下,DataNode的利用率最大相差10%。

3、hdfs balancer語法

[hadoopdeploy@hadoop01 ~]$ hdfs balancer --help
Usage: hdfs balancer
[-policy <policy>] the balancing policy: datanode or blockpool
[-threshold <threshold>] Percentage of disk capacity
[-exclude [-f <hosts-file> | <comma-separated list of hosts>]] Excludes the specified datanodes.
[-include [-f <hosts-file> | <comma-separated list of hosts>]] Includes only the specified datanodes.
[-source [-f <hosts-file> | <comma-separated list of hosts>]] Pick only the specified datanodes as source nodes.
[-blockpools <comma-separated list of blockpool ids>] The balancer will only run on blockpools included in this list.
[-idleiterations <idleiterations>] Number of consecutive idle iterations (-1 for Infinite) before exit.
[-runDuringUpgrade] Whether to run the balancer during an ongoing HDFS upgrade.This is usually not desired since it will not affect used space on over-utilized machines.
[-asService] Run as a long running service.

Generic options supported are:
-conf <configuration file> specify an application configuration file
-D <property=value> define a value for a given property
-fs <file:///|hdfs://namenode:port> specify default filesystem URL to use, overrides 'fs.defaultFS' property from configurations.
-jt <local|resourcemanager:port> specify a ResourceManager
-files <file1,...> specify a comma-separated list of files to be copied to the map reduce cluster
-libjars <jar1,...> specify a comma-separated list of jar files to be included in the classpath
-archives <archive1,...> specify a comma-separated list of archives to be unarchived on the compute machines

The general command line syntax is:
command [genericOptions] [commandOptions]

參數

描述

threshold

磁盤容量的百分比。默認值為10%,表示上下浮動10%。

policy

平衡策略。
datanode(默認):當每一個DataNode是平衡的時候,集群就是平衡的。
blockpool:當每一個DataNode中的blockpool是平衡的,集群就是平衡的。

exclude

不參與平衡的DataNode節點

include

參與平衡的DataNode節點

source

僅選取指定的數據節點作為源節點

blockpools

Balancer僅在指定的blockpools中運行

idleiterations

退出前的連續空閑迭代次數(-1表示無限)

-runDuringUpgrade

是否在正在進行的HDFS升級過程中運行平衡器。通常不需要這樣做,因為這不會影響過度使用的計算機上的已用空間。

-asService

作為長期運行的服務運行


4、運行一個簡單的balance案例

4.1 設置平衡數據傳輸帶寬

[hadoopdeploy@hadoop01 ~]$ hdfs dfsadmin  -setBalancerBandwidth 10485760
Balancer bandwidth is set to 10485760
[hadoopdeploy@hadoop01 ~]$

當我們的集群負載需要調低這個值,當我們的集群負載較低時,可以適當調高這個值。

4.2 執行banalce

[hadoopdeploy@hadoop01 ~]$ hdfs balancer -policy datanode -threshold 5
2023-03-26 14:10:09,785 INFO balancer.Balancer: Using a threshold of 5.0
2023-03-26 14:10:09,786 INFO balancer.Balancer: namenodes = [hdfs://hadoop01:8020]
2023-03-26 14:10:09,786 INFO balancer.Balancer: parameters = Balancer.BalancerParameters [BalancingPolicy.Node, threshold = 5.0, max idle iteration = 5, #excluded nodes = 0, #included nodes = 0, #source nodes = 0, #blockpools = 0, run during upgrade = false]
2023-03-26 14:10:09,786 INFO balancer.Balancer: included nodes = []
2023-03-26 14:10:09,786 INFO balancer.Balancer: excluded nodes = []
2023-03-26 14:10:09,786 INFO balancer.Balancer: source nodes = []
Time Stamp Iteration# Bytes Already Moved Bytes Left To Move Bytes Being Moved NameNode
2023-03-26 14:10:09,787 INFO balancer.NameNodeConnector: getBlocks calls for hdfs://hadoop01:8020 will be rate-limited to 20 per second
2023-03-26 14:10:10,392 INFO balancer.Balancer: dfs.namenode.get-blocks.max-qps = 20 (default=20)
2023-03-26 14:10:10,392 INFO balancer.Balancer: dfs.balancer.movedWinWidth = 5400000 (default=5400000)
2023-03-26 14:10:10,392 INFO balancer.Balancer: dfs.balancer.moverThreads = 1000 (default=1000)
2023-03-26 14:10:10,392 INFO balancer.Balancer: dfs.balancer.dispatcherThreads = 200 (default=200)
2023-03-26 14:10:10,392 INFO balancer.Balancer: dfs.balancer.getBlocks.size = 2147483648 (default=2147483648)
2023-03-26 14:10:10,392 INFO balancer.Balancer: dfs.balancer.getBlocks.min-block-size = 10485760 (default=10485760)
2023-03-26 14:10:10,392 INFO balancer.Balancer: dfs.datanode.balance.max.concurrent.moves = 100 (default=100)
2023-03-26 14:10:10,392 INFO balancer.Balancer: dfs.datanode.balance.bandwidthPerSec = 104857600 (default=104857600)
2023-03-26 14:10:10,395 INFO balancer.Balancer: dfs.balancer.max-size-to-move = 10737418240 (default=10737418240)
2023-03-26 14:10:10,395 INFO balancer.Balancer: dfs.blocksize = 134217728 (default=134217728)
2023-03-26 14:10:10,401 INFO net.NetworkTopology: Adding a new node: /default-rack/192.168.121.141:9866
2023-03-26 14:10:10,401 INFO net.NetworkTopology: Adding a new node: /default-rack/192.168.121.140:9866
2023-03-26 14:10:10,401 INFO net.NetworkTopology: Adding a new node: /default-rack/192.168.121.142:9866
2023-03-26 14:10:10,402 INFO balancer.Balancer: 0 over-utilized: []
2023-03-26 14:10:10,402 INFO balancer.Balancer: 0 underutilized: []
2023-3-26 14:10:10 0 0 B 0 B 0 B 0 hdfs://hadoop01:8020
The cluster is balanced. Exiting...
2023-3-26 14:10:10 Balancing took 810.0 milliseconds
[hadoopdeploy@hadoop01 ~]$

5、參考文檔

1、https://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-hdfs/HdfsUserGuide.html#Balancer
2、https://help.aliyun.com/document_detail/449686.html?

責任編輯:武曉燕 來源: 今日頭條
相關推薦

2023-04-03 06:57:38

DataNode工具命令行

2010-05-06 10:14:31

負載均衡器

2017-05-19 14:45:01

OVN負載均衡器路由器

2022-07-14 08:53:48

MetalLBkubernetes

2024-02-22 10:11:00

負載均衡器反向代理

2023-02-13 16:39:45

Kubernetes容器負載均衡器

2010-04-22 10:46:40

Lvs負載均衡故障負載均衡器

2010-05-10 18:22:51

負載均衡器

2024-06-18 08:14:21

2010-04-20 10:46:59

什么是負載均衡器

2010-07-15 11:16:04

負載均衡

2010-05-10 14:13:26

2013-05-23 15:31:36

負載均衡

2010-05-05 19:05:03

負載均衡器會話保持

2010-04-28 17:01:30

Apusic負載均衡器

2020-12-14 10:15:03

負載均衡器Linux服務器

2010-03-24 10:35:02

Nginx負載均衡器

2010-04-22 10:09:28

負載均衡器

2010-04-26 15:04:08

負載均衡器

2010-05-10 14:05:31

負載均衡器
點贊
收藏

51CTO技術棧公眾號

主站蜘蛛池模板: 狠狠操狠狠干 | 国产成人福利视频 | 免费在线观看一区二区 | 日韩精品一区二区三区中文字幕 | 国产成人精品在线播放 | 国产一级片 | 婷婷福利视频导航 | 国产精品久久久久久二区 | 天天干狠狠干 | 久久国产精品一区二区 | 欧美成人h版在线观看 | 久久不卡| 另类专区成人 | 国产精品美女久久久久久免费 | 成人欧美一区二区三区在线播放 | 午夜日韩 | 亚洲精品国产成人 | 日韩视频一区在线观看 | 青青草免费在线视频 | 成人二区 | 999久久久精品 | 91豆花视频| 91免费观看在线 | 欧美精品久久久久久久久久 | 成人精品 | 中文字幕一区二区三区四区五区 | 亚洲美女一区 | 国产精品不卡一区 | 国产精品毛片 | 免费国产一区 | 久久综合一区 | 久久久久久亚洲精品 | 亚洲一区二区黄 | 精品久久久久一区二区国产 | 日韩精品一区二区三区中文在线 | 亚洲国产激情 | 久久激情视频 | 国产1区2区3区 | 天天插天天搞 | 久久高清| 中文天堂在线一区 |