append_peer_namespaces

Definition

Appends replicable namespaces to the specified replication relationship (peer). Remember the following restrictions:

  • The REPLICATE_ALL flag should have the false value in the replication peer configuration (see set_peer_replicate_all).

  • Setting a namespace means that all tables in this namespace with the REPLICATION_SCOPE flag != 0 are replicated. If the peer configuration already contains some table (added via append_peer_tableCFs or set_peer_tableCFs), then setting its namespace with this command is not allowed.

NOTE
This command does not remove the previously defined namespaces from the peer configuration (unlike set_peer_namespaces).

Usage

append_peer_namespaces '<peer_id>', <namespaces_array[]>
Arguments
Parameter Description

peer_id

A unique identifier of the replication peer. Should not contain hyphens

namespaces_array

An array of strings specified in the format '<namespace_name>', where <namespace_name> — a namespace name

Examples

Successful namespace appending

A peer without namespaces:

hbase(main):019:0> list_peers
 PEER_ID CLUSTER_KEY ENDPOINT_CLASSNAME STATE REPLICATE_ALL NAMESPACES TABLE_CFS BANDWIDTH
 1 serov-adh-1.ru-central1.internal,serov-adh-2.ru-central1.internal,serov-adh-3.ru-central1.internal:2181:/hbase  ENABLED false  default.articles 0
1 row(s)
Took 0.0119 seconds
=> #<Java::JavaUtil::ArrayList:0xe886caf>
hbase(main):022:0> append_peer_namespaces '1', ['ns1']
Took 0.0250 seconds
hbase(main):025:0> list_peers
 PEER_ID CLUSTER_KEY ENDPOINT_CLASSNAME STATE REPLICATE_ALL NAMESPACES TABLE_CFS BANDWIDTH
 1 serov-adh-1.ru-central1.internal,serov-adh-2.ru-central1.internal,serov-adh-3.ru-central1.internal:2181:/hbase  ENABLED false ns1 default.articles 0
1 row(s)
Took 0.0063 seconds
=> #<Java::JavaUtil::ArrayList:0x6a902015>

A peer with namespaces:

hbase(main):031:0> list_peers
 PEER_ID CLUSTER_KEY ENDPOINT_CLASSNAME STATE REPLICATE_ALL NAMESPACES TABLE_CFS BANDWIDTH
 1 serov-adh-1.ru-central1.internal,serov-adh-2.ru-central1.internal,serov-adh-3.ru-central1.internal:2181:/hbase  ENABLED false ns1 default.articles 0
1 row(s)
Took 0.0063 seconds
=> #<Java::JavaUtil::ArrayList:0x6a902015>
hbase(main):032:0> append_peer_namespaces '1', ['ns2']
Took 0.0114 seconds
hbase(main):034:0> list_peers
 PEER_ID CLUSTER_KEY ENDPOINT_CLASSNAME STATE REPLICATE_ALL NAMESPACES TABLE_CFS BANDWIDTH
 1 serov-adh-1.ru-central1.internal,serov-adh-2.ru-central1.internal,serov-adh-3.ru-central1.internal:2181:/hbase  ENABLED false ns1;ns2 default.articles 0
1 row(s)
Took 0.0084 seconds
=> #<Java::JavaUtil::ArrayList:0x2c1ea7be>

Unsuccessful namespace appending

hbase(main):053:0> list_peers
 PEER_ID CLUSTER_KEY ENDPOINT_CLASSNAME STATE REPLICATE_ALL NAMESPACES TABLE_CFS BANDWIDTH
 1 serov-adh-1.ru-central1.internal,serov-adh-2.ru-central1.internal,serov-adh-3.ru-central1.internal:2181:/hbase  DISABLED false ns1 default.articles 0
1 row(s)
Took 0.0113 seconds
=> #<Java::JavaUtil::ArrayList:0x6dde1bf5>
hbase(main):054:0> append_peer_namespaces '1', ['default']

ERROR: java.io.IOException: Table-cfs articles is conflict with namespaces default in peer config
        at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:472)
        at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:130)
        at org.apache.hadoop.hbase.ipc.RpcExecutor$Handler.run(RpcExecutor.java:324)
        at org.apache.hadoop.hbase.ipc.RpcExecutor$Handler.run(RpcExecutor.java:304)
Caused by: org.apache.hadoop.hbase.replication.ReplicationException: Table-cfs articles is conflict with namespaces default in peer config
        at org.apache.hadoop.hbase.master.replication.ReplicationManager.checkNamespacesAndTableCfsConfigConflict(ReplicationManager.java:181)
        at org.apache.hadoop.hbase.master.replication.ReplicationManager.checkPeerConfig(ReplicationManager.java:148)
        at org.apache.hadoop.hbase.master.replication.ReplicationManager.updatePeerConfig(ReplicationManager.java:103)
        at org.apache.hadoop.hbase.master.HMaster.updateReplicationPeerConfig(HMaster.java:3535)
        at org.apache.hadoop.hbase.master.MasterRpcServices.updateReplicationPeerConfig(MasterRpcServices.java:1943)
        at org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos$MasterService$2.callBlockingMethod(MasterProtos.java)
        at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:413)
        ... 3 more

  Append some namespaces to be replicable for the specified peer.

  Set a namespace in the peer config means that all tables in this
  namespace (with replication_scope != 0 ) will be replicated.

  Examples:

    # append ns1,ns2 to be replicable for peer '2'.
    hbase> append_peer_namespaces '2', ["ns1", "ns2"]


Took 8.1496 seconds
Found a mistake? Seleсt text and press Ctrl+Enter to report it