• hbase记录-备份脚本参考


     1 #!/bin/sh
     2 
     3 ##################################
     4 # CreateDate:2018/7/16 10:40
     5 # ModifyDate:2018/7/16 11:06
     6 #################################
     7 
     8 #############create a snapshot for table##################################################
     9 hbase shell << EOF
    10 snapshot 'contactlist_event_data', 'contactlist_event_dataSnapShot'  
    11 snapshot 'crs_data_report', 'crs_data_reportSnapShot' 
    12 snapshot 'crs_history_report', 'crs_history_reportSnapShot'
    13 snapshot 'event_data', 'event_dataSnapShot'
    14 snapshot 'user_variables', 'user_variablesSnapShot' 
    15 list_snapshots
    16 exit
    17 EOF
    18 
    19 ################copyTable####################################################################
    20 hbase shell << EOF
    21 create 'myinfo', { NAME => 'cf',VERSIONS => 1}
    22 put 'myinfo','r1','cf','shenzhen'
    23 scan 'myinfo',{LIMIT => 1}
    24 create 'myinfoCopy', { NAME => 'cf',VERSIONS => 1}
    25 exit
    26 EOF
    27 sudo -u hadoop hbase org.apache.hadoop.hbase.mapreduce.CopyTable --new.name=myinfoCopy myinfo
    28 ##########################################################################################################
    29 
    30 #Export/Import
    31 sudo -u hdfs hbase org.apache.hadoop.hbase.mapreduce.Export myinfo  /hbasebak/myinfobak
    32 #sudo -u hdfs hadoop dfs -ls /hbasebak/myinfobak
    33 #sudo -u hdfs hadoop fs -cat /hbasebak/myinfobak/part-m-00000
    34 hbase shell << EOF
    35 create 'myinfo2', { NAME => 'cf',VERSIONS => 1}
    36 exit
    37 EOF
    38 sudo -u hadoop hbase org.apache.hadoop.hbase.mapreduce.Import myinfo2 hdfs://nameservice1/hbasebak/myinfobak
    39 hbase shell << EOF
    40 scan 'myinfo2',{LIMIT=>2}
    41 exit
    42 EOF
    43 #############################################################################################################

     

  • 相关阅读:
    046.Kubernetes集群管理-日常运维
    045.Kubernetes集群存储-CSI存储机制
    044.Kubernetes集群存储-StorageClass
    043.Kubernetes集群存储-共享存储
    CKAD考试心得分享
    050.Kubernetes集群管理-Prometheus+Grafana监控方案
    附015.Kubernetes其他技巧
    041.Kubernetes集群网络-K8S网络策略
    042.Kubernetes集群网络-flannel及calico
    040.Kubernetes集群网络-CNI网络模型
  • 原文地址:https://www.cnblogs.com/xinfang520/p/9316674.html
Copyright © 2020-2023  润新知