默認情況下,REST Gateway(REST網關)不支持模擬。它代表客戶端訪問HBase。對於HBase服務器,所有請求都來自REST網關用戶,實際用戶不詳。您可以打開模擬支持。通過模擬,REST網關用戶是代理用戶。HBase服務器知道每個請求的實際/真實用戶,因此它可以應用適當的授權。
要打開REST網關模擬,我們需要配置HBase服務器(主服務器和區域服務器)以允許代理用戶;配置REST網關以啟用模擬。
要允許代理用戶,請將以下內容添加到每個HBase服務器的hbase-site.xml文件中:
<code><
property
><
name
>hadoop.security.authorizationname
><
value
>truevalue
>property
><
property
><
name
>hadoop.proxyuser.$USER.groupsname
><
value
>$GROUPSvalue
>property
><
property
><
name
>hadoop.proxyuser.$USER.hostsname
><
value
>$GROUPSvalue
>property
>/<code>
將REST網關代理用戶替換為$ USER,並將允許的組列表替換為$ GROUPS。
要啟用REST網關模擬,請將以下內容添加到每個REST網關的hbase-site.xml文件中:
<code><
property
><
name
>hbase.rest.authentication.typename
><
value
>kerberosvalue
>property
><
property
><
name
>hbase.rest.authentication.kerberos.principalname
><
value
>HTTP/[email protected]value
>property
><
property
><
name
>hbase.rest.authentication.kerberos.keytabname
><
value
>$KEYTABvalue
>property
>/<code>
用$ KEYTAB替代HTTP的keytab 。