中文字幕av专区_日韩电影在线播放_精品国产精品久久一区免费式_av在线免费观看网站

溫馨提示×

安全模式下配置Hadoop身份驗證

小云
107
2023-10-11 10:04:43
欄目: 大數據

在安全模式下配置Hadoop身份驗證需要完成以下步驟:

  1. 生成Kerberos認證相關的密鑰和憑據:
kdb5_util create -s
ktadd -k /etc/security/keytabs/nn.service.keytab nn/hostname@REALM
ktadd -k /etc/security/keytabs/dn.service.keytab dn/hostname@REALM
ktadd -k /etc/security/keytabs/jhs.service.keytab jhs/hostname@REALM
ktadd -k /etc/security/keytabs/rm.service.keytab rm/hostname@REALM
ktadd -k /etc/security/keytabs/nm.service.keytab nm/hostname@REALM
ktadd -k /etc/security/keytabs/spnego.service.keytab HTTP/hostname@REALM
  1. 配置Kerberos客戶端:
vi /etc/krb5.conf
[libdefaults]
default_realm = REALM
dns_lookup_realm = false
dns_lookup_kdc = false
ticket_lifetime = 86400
renew_lifetime = 604800
forwardable = true
default_tgs_enctypes = aes256-cts-hmac-sha1-96 rc4-hmac des-cbc-crc des-cbc-md5
default_tkt_enctypes = aes256-cts-hmac-sha1-96 rc4-hmac des-cbc-crc des-cbc-md5
permitted_enctypes = aes256-cts-hmac-sha1-96 rc4-hmac des-cbc-crc des-cbc-md5
udp_preference_limit = 1
[realms]
REALM = {
kdc = kdc-hostname:88
admin_server = kdc-hostname:749
}
[domain_realm]
.hostname = REALM
hostname = REALM
  1. 配置Hadoop客戶端:
vi $HADOOP_HOME/etc/hadoop/core-site.xml
<configuration>
<property>
<name>hadoop.security.authentication</name>
<value>kerberos</value>
</property>
<property>
<name>hadoop.security.authorization</name>
<value>true</value>
</property>
<property>
<name>hadoop.security.auth_to_local</name>
<value>RULE:[2:$1@$0](.*@REALM)s/@.*//DEFAULT/</value>
</property>
</configuration>
vi $HADOOP_HOME/etc/hadoop/hdfs-site.xml
<configuration>
<property>
<name>dfs.namenode.kerberos.principal</name>
<value>nn/hostname@REALM</value>
</property>
<property>
<name>dfs.namenode.keytab.file</name>
<value>/etc/security/keytabs/nn.service.keytab</value>
</property>
<property>
<name>dfs.datanode.kerberos.principal</name>
<value>dn/hostname@REALM</value>
</property>
<property>
<name>dfs.datanode.keytab.file</name>
<value>/etc/security/keytabs/dn.service.keytab</value>
</property>
</configuration>
vi $HADOOP_HOME/etc/hadoop/yarn-site.xml
<configuration>
<property>
<name>yarn.resourcemanager.keytab</name>
<value>/etc/security/keytabs/rm.service.keytab</value>
</property>
<property>
<name>yarn.resourcemanager.principal</name>
<value>rm/hostname@REALM</value>
</property>
<property>
<name>yarn.nodemanager.keytab</name>
<value>/etc/security/keytabs/nm.service.keytab</value>
</property>
<property>
<name>yarn.nodemanager.principal</name>
<value>nm/hostname@REALM</value>
</property>
</configuration>
vi $HADOOP_HOME/etc/hadoop/mapred-site.xml
<configuration>
<property>
<name>mapreduce.jobhistory.keytab</name>
<value>/etc/security/keytabs/jhs.service.keytab</value>
</property>
<property>
<name>mapreduce.jobhistory.principal</name>
<value>jhs/hostname@REALM</value>
</property>
</configuration>
  1. 啟動Kerberos并檢查是否成功:
kadmin.local
start

0
姜堰市| 合水县| 上高县| 崇明县| 牙克石市| 松桃| 岳西县| 家居| 尖扎县| 大余县| 明星| 白银市| 江川县| 元阳县| 靖宇县| 长阳| 铅山县| 盖州市| 三台县| 西乌珠穆沁旗| 图木舒克市| 东源县| 松潘县| 绥江县| 托里县| 吴忠市| 东乌| 合山市| 孝感市| 新安县| 南汇区| 体育| 尉犁县| 西林县| 兰西县| 玉山县| 鄂托克前旗| 沁水县| 轮台县| 兴宁市| 乌拉特中旗|