Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-24032

[RSGroup] Assign created tables to respective rsgroup automatically instead of manual operations

    XMLWordPrintableJSON

Details

    • Reviewed
    • Hide
      Admin can determine which tables go to which rsgroup by script (setting hbase.rsgroup.table.mapping.script with local filystem path) on Master side which aims to lighten the burden of admin operations. Note, since HBase 3+, rsgroup can be specified in TableDescriptor as well, if clients specify this, master will skip the determination from script.

      Here is a simple example of script:
      {code}
      # Input consists of two string, 1st is the namespace of the table, 2nd is the table name of the table
      #!/bin/bash
      namespace=$1
      tablename=$2
      if [[ $namespace == test ]]; then
        echo test
      elif [[ $tablename == *foo* ]]; then
        echo other
      else
        echo default
      fi
      {code}
      Show
      Admin can determine which tables go to which rsgroup by script (setting hbase.rsgroup.table.mapping.script with local filystem path) on Master side which aims to lighten the burden of admin operations. Note, since HBase 3+, rsgroup can be specified in TableDescriptor as well, if clients specify this, master will skip the determination from script. Here is a simple example of script: {code} # Input consists of two string, 1st is the namespace of the table, 2nd is the table name of the table #!/bin/bash namespace=$1 tablename=$2 if [[ $namespace == test ]]; then   echo test elif [[ $tablename == *foo* ]]; then   echo other else   echo default fi {code}

    Description

      In prod practise, it's time consuming and tiring to assign tables to their rsgroups for HBase admin by shell, especially in 1.x rsgroup client is IA.private, we could not even write some programs to do that.

      And I'm here proposing a solution to do the automated rsgroup assignment by allowing running a shell in postCreateTable to determine which table should go to which rsgroup (way in branch-1 not master). The benefit is obvious, admin can determine or change at any time the mapping rule in script without restarting or re-config anything. It's flexible, convenience and time saving.

      Attachments

        Activity

          People

            reidchan Reid Chan
            reidchan Reid Chan
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: