hbase主从同步

 如下是hbasereplication验证,测试版本hbase-0.98.6-cdh5.3.3.总体来说可以满足主从间的相互复制.详细描述见下:

 

情况一:

 

hbase里有表scores 分别同步到从hbase1 hbase2的表scores(同步主hbase 102里的表scores到从hbase 集群103104scores)

 

add_peer '4','192.168.56.104:2181:/hbase'

set_peer_tableCFs '4', " scores:grade"

 

add_peer '5','192.168.56.103:2181:/hbase'

set_peer_tableCFs '5', " scores:grade"

 


情况二:

 

hbase里有表slave1slave2 分别同步到从hbase1slave1和从hbase2slave2(同步主hbase 102里的表slave1slave2到从hbase 集群104slave1103slave2)

 

set_peer_tableCFs '4', " scores:grade;slave1:grade"

 

set_peer_tableCFs '5', " scores:grade; slave2:grade "

 

 

情况三

 

hbase1里的表scores,hbase2的表master2分别同步到从hbase里的表scoresmaster2(同步主hbase 102里的表scores、主hbase 104master2到从hbase 集群103scoresmaster2)

 

 

set_peer_tableCFs '5', " scores:grade"

 

hbase1 peers:

 

 

hbase2 peers :

add_peer '6','192.168.56.103:2181:/hbase'

set_peer_tableCFs '5', " master2:grade"

 

 

:打开hbase集群的复制功能、表的复制功能,添加并配置peer.

 

 

附录:

Hbase复制相关命令:

Group name: replication

Commands:

add_peer :adds a replication relationship between two clusters.为两个集群添加复制管理

disable_peer : Disable a replication relationship.禁用复制关系

enable_peer: Enable a previously-disabled replication relationship 启用复制关系

list_peers:list all replication relationships known by this cluster 显示当前集群的复制关系

remove_peer: Disable and remove a replication relationship.禁用并删除复制关系

list_replicated_tables: List all the tables and column families replicated from this cluster 显示一个hbase集群下处于复制状态的表

set_peer_tableCFs:Set the replicable table-cf config for the specified peer  设置peer下的表、列族复制关系

show_peer_tableCFs:Show replicable table-cf config for the specified peer. 显示peer下表、列族复制关系

 

  • 3
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值