SlideShare uma empresa Scribd logo
1 de 18
Load Balancer Outline in
HBase ( CDH 3 update 0 )



               Hisayoshi TAMAKI
                       2011/6/16
         Twitter :   @hisayosh
Load Balancer Outline in
 HBase

           1. Bulk assignment

Load       2. Inline region placement
Balancer
           3. Cluster-wide load balancing
Load Balancer Outline in
    HBase
   dedicated thread for the load balancing

    › Step 1 : Thread sleep during period at which the
      region balancer runs in the HMaster

    › Step 2 : Generate a global load balancing plan

    › Step 3 : Assignment Manager class executes the
      plan
Step 1

package org.apache.hadoop.hbase.master.HMaster

private static Thread getAndStartBalancerChore(final HMaster master) {
   String name = master.getServerName() + "-BalancerChore";
   int period = master.getConfiguration().getInt("hbase.balancer.period", 300000);
   // Start up the load balancer chore
   Chore chore = new Chore(name, period, master) {
     @Override
     protected void chore() {
       master.balance();                                 hbase-site.xml
     }                                                     hbase.balancer.period
   };
   return Threads.setDaemonThreadRunning(chore);
 }                                                           Period at which the region
                                                            balancer runs in the Master.
Load Balancer Outline in
    HBase
   dedicated thread for the load balancing

    › Step 1 : Thread sleep during period at which the
      region balancer runs in the HMaster

    › Step 2 : Generate a global load balancing plan

    › Step 3 : Assignment Manager class executes the
      plan
Step 2

@Override
public boolean balance() {
 if (!this.balanceSwitch) return false;
 synchronized (this.balancer) {



     List<RegionPlan> plans = this.balancer.balanceCluster(assignments);
     if (plans != null && !plans.isEmpty()) {
       for (RegionPlan plan: plans) {
         LOG.info("balance " + plan);
         this.assignmentManager.balance(plan);
       }



    return true;
}
Step 2
org.apache.hadoop.hbase.master.LoadBalancer

public List<RegionPlan> balanceCluster(
   Map<HServerInfo,List<HRegionInfo>> clusterState) {




}
this chart does not
Step 2 : Planning flow                                                          cover all steps.
                                                           needed to fill all
                                 Region Server : 5         to min and none             NO
             Balancer            Region Num : 16            left to drain all
              Start              MIN = 3                         to MAX
                                 MAX = 4
                                                                                         return
      Get Server number                                               YES                Region
                                                              we need                     Plan
                                        NO                    more to fill             NO
         numServers !
            =0?                                                MIN ?
                     YES                                              YES
MIN = region / region server
                                                          grab one from each
MAX = region mod region server == 0 ?       return null    most loaded until
min : min + 1                                                   enough

                                                             Walk down least
              server                    NO                 loaded, filling each
             outside                                           to the MIN
             range ?

                     YES                                      we still have            NO
        Walk down most                     return null       regions to dish
        loaded, pruning                                           out?                    return
        each to the MAX                                                                   Region
                                                                      YES                  Plan
        Walk down least
                                                                                          return
      loaded, assigning to                                assign underloaded to
                                                                                          Region
      each to fill up to MIN                                      MAX
                                                                                           Plan
this chart does not
Step 2 : Planning flow                                                                     cover all steps.
                                                                      needed to fill all
                                 Region Server : 5                    to min and none             NO
             Balancer            Region Num : 16                       left to drain all
              Start              MIN = 3                                    to MAX
                                 MAX = 4     1 2         3   4   5
                                                                                                    return
      Get Server number                      5   5       5   1   0
                                                                                 YES                Region
                                                                         we need                     Plan
                                        NO                               more to fill             NO
         numServers !
            =0?                                                           MIN ?
                     YES                                                         YES
MIN = region / region server
                                                                     grab one from each
MAX = region mod region server == 0 ?       return null               most loaded until
min : min + 1                                                              enough

                                                                        Walk down least
              server                    NO                            loaded, filling each
             outside                                                      to the MIN
             range ?

                     YES                                                 we still have            NO
        Walk down most                     return null                  regions to dish
        loaded, pruning                                                      out?                    return
        each to the MAX                                                                              Region
                                                                                 YES                  Plan
        Walk down least
                                                                                                     return
      loaded, assigning to                                           assign underloaded to
                                                                                                     Region
      each to fill up to MIN                                                 MAX
                                                                                                      Plan
this chart does not
Step 2 : Planning flow                                                                     cover all steps.
                                                                      needed to fill all
                                 Region Server : 5                    to min and none             NO
             Balancer            Region Num : 16                       left to drain all
              Start              MIN = 3                                    to MAX
                                 MAX = 4     1 2         3   4   5
                                                                                                    return
      Get Server number                      4   4       4   1   0
                                                                                 YES                Region
                                                                         we need                     Plan
                                        NO                               more to fill             NO
         numServers !
            =0?                                                           MIN ?
                     YES                                                         YES
MIN = region / region server
                                                                     grab one from each
MAX = region mod region server == 0 ?       return null               most loaded until
min : min + 1                                                              enough

                                                                        Walk down least
              server                    NO                            loaded, filling each
             outside                                                      to the MIN
             range ?

                     YES                                                 we still have            NO
        Walk down most                     return null                  regions to dish
        loaded, pruning                                                      out?                    return
        each to the MAX                                                                              Region
                                                                                 YES                  Plan
        Walk down least
                                                                                                     return
      loaded, assigning to                                           assign underloaded to
                                                                                                     Region
      each to fill up to MIN                                                 MAX
                                                                                                      Plan
this chart does not
Step 2 : Planning flow                                                                     cover all steps.
                                                                      needed to fill all
                                 Region Server : 5                    to min and none             NO
             Balancer            Region Num : 16                       left to drain all
              Start              MIN = 3                                    to MAX
                                 MAX = 4     1 2         3   4   5
                                                                                                    return
      Get Server number                      4   4       4   3   1               YES                Region
                                                                         we need                     Plan
                                        NO                               more to fill             NO
         numServers !
            =0?                                                           MIN ?
                     YES                                                         YES
MIN = region / region server
                                                                     grab one from each
MAX = region mod region server == 0 ?       return null               most loaded until
min : min + 1                                                              enough

                                                                        Walk down least
              server                    NO                            loaded, filling each
             outside                                                      to the MIN
             range ?

                     YES                                                 we still have            NO
        Walk down most                     return null                  regions to dish
        loaded, pruning                                                      out?                    return
        each to the MAX                                                                              Region
                                                                                 YES                  Plan
        Walk down least
                                                                                                     return
      loaded, assigning to                                           assign underloaded to
                                                                                                     Region
      each to fill up to MIN                                                 MAX
                                                                                                      Plan
this chart does not
Step 2 : Planning flow                                                                     cover all steps.
                                                                      needed to fill all
                                 Region Server : 5                    to min and none             NO
             Balancer            Region Num : 16                       left to drain all
              Start              MIN = 3                                    to MAX
                                 MAX = 4     1 2         3   4   5
                                                                                                    return
      Get Server number                      3   3       3   3   1
                                                                                 YES                Region
                                                                         we need                     Plan
                                        NO                               more to fill             NO
         numServers !
            =0?                                                           MIN ?
                     YES                                                         YES
MIN = region / region server
                                                                     grab one from each
MAX = region mod region server == 0 ?       return null               most loaded until
min : min + 1                                                              enough

                                                                        Walk down least
              server                    NO                            loaded, filling each
             outside                                                      to the MIN
             range ?

                     YES                                                 we still have            NO
        Walk down most                     return null                  regions to dish
        loaded, pruning                                                      out?                    return
        each to the MAX                                                                              Region
                                                                                 YES                  Plan
        Walk down least
                                                                                                     return
      loaded, assigning to                                           assign underloaded to
                                                                                                     Region
      each to fill up to MIN                                                 MAX
                                                                                                      Plan
this chart does not
Step 2 : Planning flow                                                                     cover all steps.
                                                                      needed to fill all
                                 Region Server : 5                    to min and none             NO
             Balancer            Region Num : 16                       left to drain all
              Start              MIN = 3                                    to MAX
                                 MAX = 4     1 2         3   4   5
                                                                                                    return
      Get Server number                      3   3       3   3   3
                                                                                 YES                Region
                                                                         we need                     Plan
                                        NO                               more to fill             NO
         numServers !
            =0?                                                           MIN ?
                     YES                                                         YES
MIN = region / region server
                                                                     grab one from each
MAX = region mod region server == 0 ?       return null               most loaded until
min : min + 1                                                              enough

                                                                        Walk down least
              server                    NO                            loaded, filling each
             outside                                                      to the MIN
             range ?

                     YES                                                 we still have            NO
        Walk down most                     return null                  regions to dish
        loaded, pruning                                                      out?                    return
        each to the MAX                                                                              Region
                                                                                 YES                  Plan
        Walk down least
                                                                                                     return
      loaded, assigning to                                           assign underloaded to
                                                                                                     Region
      each to fill up to MIN                                                 MAX
                                                                                                      Plan
this chart does not
Step 2 : Planning flow                                                                     cover all steps.
                                                                      needed to fill all
                                 Region Server : 5                    to min and none             NO
             Balancer            Region Num : 16                       left to drain all
              Start              MIN = 3                                    to MAX
                                 MAX = 4     1 2         3   4   5
                                                                                                    return
      Get Server number                      4   3       3   3   3
                                                                                 YES                Region
                                                                         we need                     Plan
                                        NO                               more to fill             NO
         numServers !
            =0?                                                           MIN ?
                     YES                                                         YES
MIN = region / region server
                                                                     grab one from each
MAX = region mod region server == 0 ?       return null               most loaded until
min : min + 1                                                              enough

                                                                        Walk down least
              server                    NO                            loaded, filling each
             outside                                                      to the MIN
             range ?

                     YES                                                 we still have            NO
        Walk down most                     return null                  regions to dish
        loaded, pruning                                                      out?                    return
        each to the MAX                                                                              Region
                                                                                 YES                  Plan
        Walk down least
                                                                                                     return
      loaded, assigning to                                           assign underloaded to
                                                                                                     Region
      each to fill up to MIN                                                 MAX
                                                                                                      Plan
Load Balancer Outline in
    HBase
   dedicated thread for the load balancing

    › Step 1 : Thread sleep during period at which the
      region balancer runs in the HMaster

    › Step 2 : Generate a global load balancing plan

    › Step 3 : Assignment Manager class executes the
      plan
Step 3

@Override
public boolean balance() {
 if (!this.balanceSwitch) return false;
 synchronized (this.balancer) {



     List<RegionPlan> plans = this.balancer.balanceCluster(assignments);
     if (plans != null && !plans.isEmpty()) {
       for (RegionPlan plan: plans) {
         LOG.info("balance " + plan);
         this.assignmentManager.balance(plan);
       }
                   package org.apache.hadoop.hbase.master.AssignmentManager

    return true;
}
Questions?
   Ted Yu’s Blog ( by Zhihong Yu )
    http://zhihongyu.blogspot.com/2011/04/load-balancer-in-hbase-090.html

Mais conteúdo relacionado

Último

Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 

Último (20)

Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 

Destaque

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Destaque (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Load balancer Outline in HBase (cdh3u0)

  • 1. Load Balancer Outline in HBase ( CDH 3 update 0 ) Hisayoshi TAMAKI 2011/6/16 Twitter : @hisayosh
  • 2. Load Balancer Outline in HBase 1. Bulk assignment Load 2. Inline region placement Balancer 3. Cluster-wide load balancing
  • 3. Load Balancer Outline in HBase  dedicated thread for the load balancing › Step 1 : Thread sleep during period at which the region balancer runs in the HMaster › Step 2 : Generate a global load balancing plan › Step 3 : Assignment Manager class executes the plan
  • 4. Step 1 package org.apache.hadoop.hbase.master.HMaster private static Thread getAndStartBalancerChore(final HMaster master) { String name = master.getServerName() + "-BalancerChore"; int period = master.getConfiguration().getInt("hbase.balancer.period", 300000); // Start up the load balancer chore Chore chore = new Chore(name, period, master) { @Override protected void chore() { master.balance(); hbase-site.xml } hbase.balancer.period }; return Threads.setDaemonThreadRunning(chore); } Period at which the region balancer runs in the Master.
  • 5. Load Balancer Outline in HBase  dedicated thread for the load balancing › Step 1 : Thread sleep during period at which the region balancer runs in the HMaster › Step 2 : Generate a global load balancing plan › Step 3 : Assignment Manager class executes the plan
  • 6. Step 2 @Override public boolean balance() { if (!this.balanceSwitch) return false; synchronized (this.balancer) { List<RegionPlan> plans = this.balancer.balanceCluster(assignments); if (plans != null && !plans.isEmpty()) { for (RegionPlan plan: plans) { LOG.info("balance " + plan); this.assignmentManager.balance(plan); } return true; }
  • 7. Step 2 org.apache.hadoop.hbase.master.LoadBalancer public List<RegionPlan> balanceCluster( Map<HServerInfo,List<HRegionInfo>> clusterState) { }
  • 8. this chart does not Step 2 : Planning flow cover all steps. needed to fill all Region Server : 5 to min and none NO Balancer Region Num : 16 left to drain all Start MIN = 3 to MAX MAX = 4 return Get Server number YES Region we need Plan NO more to fill NO numServers ! =0? MIN ? YES YES MIN = region / region server grab one from each MAX = region mod region server == 0 ? return null most loaded until min : min + 1 enough Walk down least server NO loaded, filling each outside to the MIN range ? YES we still have NO Walk down most return null regions to dish loaded, pruning out? return each to the MAX Region YES Plan Walk down least return loaded, assigning to assign underloaded to Region each to fill up to MIN MAX Plan
  • 9. this chart does not Step 2 : Planning flow cover all steps. needed to fill all Region Server : 5 to min and none NO Balancer Region Num : 16 left to drain all Start MIN = 3 to MAX MAX = 4 1 2 3 4 5 return Get Server number 5 5 5 1 0 YES Region we need Plan NO more to fill NO numServers ! =0? MIN ? YES YES MIN = region / region server grab one from each MAX = region mod region server == 0 ? return null most loaded until min : min + 1 enough Walk down least server NO loaded, filling each outside to the MIN range ? YES we still have NO Walk down most return null regions to dish loaded, pruning out? return each to the MAX Region YES Plan Walk down least return loaded, assigning to assign underloaded to Region each to fill up to MIN MAX Plan
  • 10. this chart does not Step 2 : Planning flow cover all steps. needed to fill all Region Server : 5 to min and none NO Balancer Region Num : 16 left to drain all Start MIN = 3 to MAX MAX = 4 1 2 3 4 5 return Get Server number 4 4 4 1 0 YES Region we need Plan NO more to fill NO numServers ! =0? MIN ? YES YES MIN = region / region server grab one from each MAX = region mod region server == 0 ? return null most loaded until min : min + 1 enough Walk down least server NO loaded, filling each outside to the MIN range ? YES we still have NO Walk down most return null regions to dish loaded, pruning out? return each to the MAX Region YES Plan Walk down least return loaded, assigning to assign underloaded to Region each to fill up to MIN MAX Plan
  • 11. this chart does not Step 2 : Planning flow cover all steps. needed to fill all Region Server : 5 to min and none NO Balancer Region Num : 16 left to drain all Start MIN = 3 to MAX MAX = 4 1 2 3 4 5 return Get Server number 4 4 4 3 1 YES Region we need Plan NO more to fill NO numServers ! =0? MIN ? YES YES MIN = region / region server grab one from each MAX = region mod region server == 0 ? return null most loaded until min : min + 1 enough Walk down least server NO loaded, filling each outside to the MIN range ? YES we still have NO Walk down most return null regions to dish loaded, pruning out? return each to the MAX Region YES Plan Walk down least return loaded, assigning to assign underloaded to Region each to fill up to MIN MAX Plan
  • 12. this chart does not Step 2 : Planning flow cover all steps. needed to fill all Region Server : 5 to min and none NO Balancer Region Num : 16 left to drain all Start MIN = 3 to MAX MAX = 4 1 2 3 4 5 return Get Server number 3 3 3 3 1 YES Region we need Plan NO more to fill NO numServers ! =0? MIN ? YES YES MIN = region / region server grab one from each MAX = region mod region server == 0 ? return null most loaded until min : min + 1 enough Walk down least server NO loaded, filling each outside to the MIN range ? YES we still have NO Walk down most return null regions to dish loaded, pruning out? return each to the MAX Region YES Plan Walk down least return loaded, assigning to assign underloaded to Region each to fill up to MIN MAX Plan
  • 13. this chart does not Step 2 : Planning flow cover all steps. needed to fill all Region Server : 5 to min and none NO Balancer Region Num : 16 left to drain all Start MIN = 3 to MAX MAX = 4 1 2 3 4 5 return Get Server number 3 3 3 3 3 YES Region we need Plan NO more to fill NO numServers ! =0? MIN ? YES YES MIN = region / region server grab one from each MAX = region mod region server == 0 ? return null most loaded until min : min + 1 enough Walk down least server NO loaded, filling each outside to the MIN range ? YES we still have NO Walk down most return null regions to dish loaded, pruning out? return each to the MAX Region YES Plan Walk down least return loaded, assigning to assign underloaded to Region each to fill up to MIN MAX Plan
  • 14. this chart does not Step 2 : Planning flow cover all steps. needed to fill all Region Server : 5 to min and none NO Balancer Region Num : 16 left to drain all Start MIN = 3 to MAX MAX = 4 1 2 3 4 5 return Get Server number 4 3 3 3 3 YES Region we need Plan NO more to fill NO numServers ! =0? MIN ? YES YES MIN = region / region server grab one from each MAX = region mod region server == 0 ? return null most loaded until min : min + 1 enough Walk down least server NO loaded, filling each outside to the MIN range ? YES we still have NO Walk down most return null regions to dish loaded, pruning out? return each to the MAX Region YES Plan Walk down least return loaded, assigning to assign underloaded to Region each to fill up to MIN MAX Plan
  • 15. Load Balancer Outline in HBase  dedicated thread for the load balancing › Step 1 : Thread sleep during period at which the region balancer runs in the HMaster › Step 2 : Generate a global load balancing plan › Step 3 : Assignment Manager class executes the plan
  • 16. Step 3 @Override public boolean balance() { if (!this.balanceSwitch) return false; synchronized (this.balancer) { List<RegionPlan> plans = this.balancer.balanceCluster(assignments); if (plans != null && !plans.isEmpty()) { for (RegionPlan plan: plans) { LOG.info("balance " + plan); this.assignmentManager.balance(plan); } package org.apache.hadoop.hbase.master.AssignmentManager return true; }
  • 18. Ted Yu’s Blog ( by Zhihong Yu ) http://zhihongyu.blogspot.com/2011/04/load-balancer-in-hbase-090.html

Notas do Editor

  1. \n
  2. \n
  3. \n
  4. 5min\n
  5. \n
  6. &amp;#x7D50;&amp;#x8AD6;&amp;#x3068;&amp;#x3057;&amp;#x3066;&amp;#x306F;&amp;#x3001;&amp;#x5168;&amp;#x3066;&amp;#x304C;&amp;#x5E73;&amp;#x5747;&amp;#x5316;&amp;#x3055;&amp;#x308C;&amp;#x308B;\n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. 1/10 comitter\n