SlideShare a Scribd company logo
1 of 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

More Related Content

Recently uploaded

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
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
 
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
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
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
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
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
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
[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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 

Recently uploaded (20)

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
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...
 
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
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
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
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
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
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
[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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 

Featured

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
 

Featured (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

Editor's Notes

  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