您好,登录后才能下订单哦!
小编给大家分享一下hbase如何实现全备增量备份脚本,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!
[hadoop@robot-pbs-hadoop-master backup_hbase]$ cat fullbk_endtime.txt
1504606501092
1504755001094
1504839001095
[hadoop@robot-pbs-hadoop-master backup_hbase]$ cat hbase_fullbk.sh
#!/bash/bin
source /home/hadoop/.bashrc
starttime=`date +%s%m%w`
echo $starttime >>/data/backup_hbase/backup_hbase/fullbk_endtime.txt
tablename='didiiml_audio'
backup_date=`date +%Y-%m-%d-%k-%M-%S`
hbase org.apache.hadoop.hbase.mapreduce.Export $tablename /bak/$backup_date'_fullbk' 1
hdfs dfs -get /bak/$backup_date$tablename'_fullbk' /data/backup_hbase/
hdfs dfs -rmr /bak/$backup_date$tablename'_fullbk'
[hadoop@robot-pbs-hadoop-master backup_hbase]$ cat hbase_increbk.sh
#!/bash/bin
source /home/hadoop/.bashrc
start_time=`tail -n 1 /data/backup_hbase/backup_hbase/fullbk_endtime.txt`
end_time=`date +%s%m%w`
echo $end_time >>/data/backup_hbase/backup_hbase/fullbk_endtime.txt
tablename='didiiml_audio'
backup_date=`date +%Y-%m-%d-%k-%M-%S`
hbase org.apache.hadoop.hbase.mapreduce.Export $tablename /bak/$backup_date$tablename'_increbk' 1 $start_time $end_time
hdfs dfs -get /bak/$backup_date$tablename'_increbk' /data/backup_hbase/
hdfs dfs -rmr /bak/$backup_date$tablename'_increbk'
[hadoop@robot-pbs-hadoop-master backup_hbase]$
以上是“hbase如何实现全备增量备份脚本”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注亿速云行业资讯频道!
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。