You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enable the table replication switch for all its column families. If the table is not found in the destination cluster then it will create one with the same name and column families.
2293
2293
disable_table_replication <TABLE_NAME>::
2294
2294
Disable the table replication switch for all its column families.
To support doing the migrate online, we introduce a shell command called `peer_modification_switch`.
2312
+
[source,ruby]
2313
+
----
2314
+
hbase> peer_modification_switch false, true
2315
+
----
2316
+
Use the above command can disable peer modification operations. The second `true` means you want to
2317
+
wait until all the existing replication peer modification procedures to finish before returning.
2318
+
After disabling the peer modification, it is safe for you to copy replication peer state with the
2319
+
above tool, and then update all the _hbase-site.xml_ files in the cluster to specify the new
2320
+
replication peer storage, and finally trigger an online configuration update to load the new
2321
+
replication peer storage.
2295
2322
2296
2323
=== Serial Replication
2297
2324
@@ -2401,10 +2428,18 @@ This option was introduced in link:https://issues.apache.org/jira/browse/HBASE-1
2401
2428
2402
2429
==== Replication Internals
2403
2430
2431
+
Replication State Storage::
2432
+
In HBASE-15867, we abstract two interfaces for storing replication state,
2433
+
`ReplicationPeerStorage` and `ReplicationQueueStorage`. The former one is for storing the
2434
+
replication peer related states, and the latter one is for storing the replication queue related
2435
+
states.
2436
+
HBASE-15867 is only half done, as although we have abstract these two interfaces, we still only
2437
+
have zookeeper based implementations.
2438
+
2404
2439
Replication State in ZooKeeper::
2405
-
HBase replication maintains its state in ZooKeeper.
2406
2440
By default, the state is contained in the base node _/hbase/replication_.
2407
-
This node contains two child nodes, the `Peers` znode and the `RS` znode.
2441
+
Usually this nodes contains two child nodes, the `peers` znode is for storing replication peer
2442
+
state, and the `rs` znodes is for storing replication queue state.
2408
2443
2409
2444
The `Peers` Znode::
2410
2445
The `peers` znode is stored in _/hbase/replication/peers_ by default.
@@ -2419,6 +2454,15 @@ The `RS` Znode::
2419
2454
The child znode name is the region server's hostname, client port, and start code.
2420
2455
This list includes both live and dead region servers.
2421
2456
2457
+
Other implementations for `ReplicationPeerStorage`::
2458
+
Starting from 2.6.0, we introduce a file system based `ReplicationPeerStorage`, which stores
2459
+
the replication peer state with files on HFile file system, instead of znodes on ZooKeeper.
2460
+
The layout is almost the same with znodes on zookeeper, the main difference is that, the HFile
2461
+
file system may not support atomic rename, so we use two files to store the state and when reading
2462
+
we will read them both and compare the timestamp to find out the newer one. So typically, you will
2463
+
see two peer config files. And for enable/disable state, we just touch a disabled file if the peer
2464
+
is disabled, and remove the file when enabling the peer.
2465
+
2422
2466
==== Choosing Region Servers to Replicate To
2423
2467
2424
2468
When a master cluster region server initiates a replication source to a slave cluster, it first connects to the slave's ZooKeeper ensemble using the provided cluster key . It then scans the _rs/_ directory to discover all the available sinks (region servers that are accepting incoming streams of edits to replicate) and randomly chooses a subset of them using a configured ratio which has a default value of 10%. For example, if a slave cluster has 150 machines, 15 will be chosen as potential recipient for edits that this master cluster region server sends.
@@ -2641,6 +2685,15 @@ The following metrics are exposed at the global region server level and at the p
2641
2685
| The number of region servers a given region server should attempt to
2642
2686
failover simultaneously.
2643
2687
| 1
2688
+
2689
+
| hbase.replication.peer.storage.impl
2690
+
| The replication peer storage implementation
2691
+
| zookeeper
2692
+
2693
+
| hbase.replication.peers.directory
2694
+
| The directory for storing replication peer state, when filesystem replication
0 commit comments