本节包含使用备份和还原功能的必要配置。由于此功能大量使用YARN的MapReduce框架来并行化这些I / O繁重的操作,因此配置更改扩展到了hbase-site.xml之外。

82.1. 在YARN中授权“hbase”系统用户

YARN container-executor.cfg 配置文件必须具有以下属性设置:allowed.system.users =hbase。此配置文件的条目中不允许有空格。

跳过此步骤将导致执行备份任务时发生运行时错误。

与备份和恢复功能有关的的有效container-executor.cfg文件的示例如下:

yarn.nodemanager.log-dirs=/var/log/hadoop/mapred
yarn.nodemanager.linux-container-executor.group=yarn
banned.users=hdfs,yarn,mapred,bin
allowed.system.users=hbase
min.user.id=500

82.2. HBase相关更改

将以下属性添加到hbase-site.xml里并重新启动HBase(如果它已在运行)。

“,...”是一个省略号,意味着这是一个以逗号分隔的值列表,而不是应该添加到hbase-site.xml的文本文本。

<property>
  <name>hbase.backup.enable</name>
  <value>true</value>
</property>
<property>
  <name>hbase.master.logcleaner.plugins</name>
  <value>org.apache.hadoop.hbase.backup.master.BackupLogCleaner,...</value>
</property>
<property>
  <name>hbase.procedure.master.classes</name>
  <value>org.apache.hadoop.hbase.backup.master.LogRollMasterProcedureManager,...</value>
</property>
<property>
  <name>hbase.procedure.regionserver.classes</name>
  <value>org.apache.hadoop.hbase.backup.regionserver.LogRollRegionServerProcedureManager,...</value>
</property>
<property>
  <name>hbase.coprocessor.region.classes</name>
  <value>org.apache.hadoop.hbase.backup.BackupObserver,...</value>
</property>
<property>
  <name>hbase.master.hfilecleaner.plugins</name>
  <value>org.apache.hadoop.hbase.backup.BackupHFileCleaner,...</value>
</property>