REST Gateway:客戶端安全操作配置

2018-04-20 11:16 更新

用于安全操作的客戶端配置-REST Gateway

將以下內(nèi)容添加到每個(gè)REST網(wǎng)關(guān)的hbase-site.xml文件中:

<property>
  <name>hbase.rest.keytab.file</name>
  <value>$KEYTAB</value>
</property>
<property>
  <name>hbase.rest.kerberos.principal</name>
  <value>$USER/_HOST@HADOOP.LOCALDOMAIN</value>
</property>

分別為$ USER和$ KEYTAB替換適當(dāng)?shù)膽{證和密鑰表。

REST網(wǎng)關(guān)將使用提供的憑證對(duì)HBase進(jìn)行身份驗(yàn)證。

為了使用REST API主體與HBase進(jìn)行交互,還需要將hbase.rest.kerberos.principal添加到該acl表中。例如,要賦予REST API主體、rest_server、管理訪問(wèn)權(quán)限,像以下的命令就足夠了:

grant 'rest_server', 'RWCA'

HBase REST網(wǎng)關(guān)支持SPNEGO HTTP身份驗(yàn)證,以便客戶端訪問(wèn)網(wǎng)關(guān)。要為客戶端訪問(wèn)啟用REST網(wǎng)關(guān)Kerberos身份驗(yàn)證,請(qǐng)將以下內(nèi)容添加到每個(gè)REST網(wǎng)關(guān)的hbase-site.xml文件中:

<property>
  <name>hbase.rest.support.proxyuser</name>
  <value>true</value>
</property>
<property>
  <name>hbase.rest.authentication.type</name>
  <value>kerberos</value>
</property>
<property>
  <name>hbase.rest.authentication.kerberos.principal</name>
  <value>HTTP/_HOST@HADOOP.LOCALDOMAIN</value>
</property>
<property>
  <name>hbase.rest.authentication.kerberos.keytab</name>
  <value>$KEYTAB</value>
</property>
<!-- Add these if you need to configure a different DNS interface from the default -->
<property>
  <name>hbase.rest.dns.interface</name>
  <value>default</value>
</property>
<property>
  <name>hbase.rest.dns.nameserver</name>
  <value>default</value>
</property>

用$ KEYTAB替代HTTP的keytab 。

HBase REST網(wǎng)關(guān)支持不同的'hbase.rest.authentication.type':simple、kerberos。您也可以通過(guò)實(shí)現(xiàn)Hadoop AuthenticationHandler來(lái)實(shí)現(xiàn)自定義身份驗(yàn)證,然后將完整的類名稱指定為'hbase.rest.authentication.type'值。

以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)