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

Add a replicate_all flag to avoid misuse the namespaces and table-cfs config of replication peer

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 3.0.0-alpha-1, 2.0.0
    • 2.0.0-beta-1, 2.0.0
    • Replication
    • None
    • Hide
      Add a replicate_all flag to replication peer config. The default value is true, which means all user tables (REPLICATION_SCOPE != 0 ) will be replicated to peer cluster.

      How to config a peer from replicate all to only replicate special namespace/tablecfs?
      Step1. Add a new peer with no namespace/tablecfs config, the replicate_all flag will be true automatically.
      Step2. User want only replicate some namespaces or tables, so set replicate_all flag to false first.
      Step3. Add special namespaces or table-cfs config to the replication peer.

      How to config a peer from replicate special namespace/tablecfs to replicate all?
      Step1. Add a new peer with special namespace/tablecfs config, the replicate_all flag will be false automatically.
      Step2. User want replicate all user tables, so remove the special namespace/tablecfs config first.
      Step3. Set replicate_all flag to true.

      How to config replicate nothing?
      Set replicate_all flag to false and no namespace/tablecfs config, then all tables cannot be replicated to peer cluster.

      Show
      Add a replicate_all flag to replication peer config. The default value is true, which means all user tables (REPLICATION_SCOPE != 0 ) will be replicated to peer cluster. How to config a peer from replicate all to only replicate special namespace/tablecfs? Step1. Add a new peer with no namespace/tablecfs config, the replicate_all flag will be true automatically. Step2. User want only replicate some namespaces or tables, so set replicate_all flag to false first. Step3. Add special namespaces or table-cfs config to the replication peer. How to config a peer from replicate special namespace/tablecfs to replicate all? Step1. Add a new peer with special namespace/tablecfs config, the replicate_all flag will be false automatically. Step2. User want replicate all user tables, so remove the special namespace/tablecfs config first. Step3. Set replicate_all flag to true. How to config replicate nothing? Set replicate_all flag to false and no namespace/tablecfs config, then all tables cannot be replicated to peer cluster.

    Description

      First add a new peer by shell cmd.

      add_peer '1', CLUSTER_KEY => "server1.cie.com:2181:/hbase".
      

      If we don't set namespaces and table cfs in peer config. It means replicate all tables to the peer cluster.

      Then append a table to the peer config.

      append_peer_tableCFs '1', {"table1" => []}
      

      Then this peer will only replicate table1 to the peer cluster. It changes to replicate only one table from replicate all tables in the cluster. It is very easy to misuse in production cluster. So we should avoid appending table to a peer which replicates all table.

      Attachments

        1. HBASE-16868.master.011.patch
          70 kB
          Guanghao Zhang
        2. HBASE-16868.master.010.patch
          69 kB
          Guanghao Zhang
        3. HBASE-16868.master.009.patch
          69 kB
          Guanghao Zhang
        4. HBASE-16868.master.008.patch
          70 kB
          Guanghao Zhang
        5. HBASE-16868.master.007.patch
          64 kB
          Guanghao Zhang
        6. HBASE-16868.master.006.patch
          64 kB
          Guanghao Zhang
        7. HBASE-16868.master.005.patch
          64 kB
          Guanghao Zhang
        8. HBASE-16868.master.004.patch
          64 kB
          Guanghao Zhang
        9. HBASE-16868.master.003.patch
          78 kB
          Guanghao Zhang
        10. HBASE-16868.master.002.patch
          77 kB
          Guanghao Zhang
        11. HBASE-16868.master.001.patch
          73 kB
          Guanghao Zhang

        Issue Links

          Activity

            People

              zghao Guanghao Zhang
              zghao Guanghao Zhang
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: