hbase如何实现全备增量备份脚本
小编给大家分享一下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如何实现全备增量备份脚本"这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注行业资讯频道!