hbase的snaptshot和replication
參考鏈接:
hbase目錄在hdfs上的含義:
http://www.rzrgm.cn/zhangwuji/p/9160301.html
replication:
http://www.rzrgm.cn/ios123/p/6410986.html
http://www.rzrgm.cn/zhangwuji/p/9195806.html
snapshot:
https://blog.csdn.net/Luomingkui1109/article/details/85128337
http://www.rzrgm.cn/ballwql/p/hbase_data_transfer.html
一、replication的配置方式
1.添加參數(shù)
<property>
<name>hbase.replication</name>
<value>true</value>
</property>
2.前置hbase2執(zhí)行 集群replication哪些表,哪些列族
alter 'DBN_STO',{NAME=>'if',REPLICATION_SCOPE => '1'}
3.前置hbase2執(zhí)行與hbase1做關(guān)聯(lián)
add_peer '1', '10.15.36.2:2181:/hyperbase1'
4.驗(yàn)證
前置hbase2 put一條數(shù)據(jù)去后置hbase1驗(yàn)證是否同步成功
put 'DBN_STO', 'testRow', 'if:a', '1'
后置hbase1 delete一條數(shù)據(jù)去前置hbase2驗(yàn)證是否同步成功
二、hbase snaptshot
1.創(chuàng)建快照 hbase2
snapshot 'DBN_STO','DBN_STO'
2.同步數(shù)據(jù) hbase2 ==》hbase1
hbase org.apache.hadoop.hbase.snapshot.ExportSnapshot -snapshot DBN_4PX_sn -copy-from hdfs://10.15.36.6:8020/hyperbase2 -copy-to hdfs://10.15.36.3:8020/hyperbase1 -overwrite -mappers 8 -bandwidth 1024
3.在hbase1上,從快照恢復(fù)數(shù)據(jù)
clone_snapshot 'DBN_STO','DBN_STO'

浙公網(wǎng)安備 33010602011771號(hào)