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

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 

Último (20)

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 

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