主節(jié)點(diǎn)安裝
專注于為中小企業(yè)提供網(wǎng)站設(shè)計(jì)制作、成都做網(wǎng)站服務(wù),電腦端+手機(jī)端+微信端的三站合一,更高效的管理,為中小企業(yè)沈河免費(fèi)做網(wǎng)站提供優(yōu)質(zhì)的服務(wù)。我們立足成都,凝聚了一批互聯(lián)網(wǎng)行業(yè)人才,有力地推動(dòng)了1000+企業(yè)的穩(wěn)健成長(zhǎng),幫助中小企業(yè)通過(guò)網(wǎng)站建設(shè)實(shí)現(xiàn)規(guī)模擴(kuò)充和轉(zhuǎn)變。yum -y install krb5-server krb5-libs krb5-auth-dialog krb5-workstation
cat /etc/krb5.conf
Configuration snippets may be placed in this directory as well
includedir /etc/krb5.conf.d/
[logging]
default = FILE:/var/log/krb5libs.log
kdc = FILE:/var/log/krb5kdc.log
admin_server = FILE:/var/log/kadmind.log
[libdefaults]
default_realm = HADOOP.COM
dns_lookup_realm = false
dns_lookup_kdc = false
ticket_lifetime = 24h
renew_lifetime = 7d
forwardable = true
rdns = false
# default_realm = EXAMPLE.COM
# default_ccache_name = KEYRING:persistent:%{uid}
[realms]
HADOOP.COM = {
kdc = bigdata-cdh01.kfk.com
admin_server = bigdata-cdh01.kfk.com
}
[domain_realm]
.bigdata-cdh01.kfk.com = HADOOP.COM
bigdata-cdh01.kfk.com = HADOOP.COM
cat /var/kerberos/krb5kdc/kadm5.acl
*/admin@HADOOP.COM *
cat /var/kerberos/krb5kdc/kdc.conf
[kdcdefaults]
kdc_ports = 88
kdc_tcp_ports = 88
[realms]
HADOOP.COM = {
#master_key_type = aes256-cts
max_renewable_life= 7d 0h 0m 0s
acl_file = /var/kerberos/krb5kdc/kadm5.acl
dict_file = /usr/share/dict/words
admin_keytab = /var/kerberos/krb5kdc/kadm5.keytab
supported_enctypes = aes256-cts:normal aes128-cts:normal des3-hmac-sha1:normal arcfour-hmac:normal camellia256-cts:normal camellia128-cts:normal des-hmac-sha1:normal des-cbc-md5:normal des-cbc-crc:normal
}
創(chuàng)建kerberos數(shù)據(jù)庫(kù)
kdb5_util create -r HADOOP.COM -s
創(chuàng)建kerberos管理賬號(hào)
將kerberos服務(wù)添加為開機(jī)啟動(dòng)
systemctl enable krb5kdc
systemctl enable kadmin
systemctl start krb5kdc
systemctl start kadmin
測(cè)試管理員賬號(hào)
為節(jié)點(diǎn)安裝客戶端
yum -y install krb5-libs krb5-auth-dialog krb5-workstation
在主節(jié)點(diǎn)上安裝額外的包
yum -y install openldap-clients
將krb5.conf文件拷貝到所有kerberos客戶端(批量拷貝)
#!/bin/bash
for i in `cat node.list`
do
scp -r $2 $i:$3
done
sh scp.sh node.list /etc/krb5.conf /etc/
啟動(dòng)kerberos
為kafka開啟kerberos
krb5的一些命令
列出賬號(hào) kadmin.local -q "listprincs"
刪除賬號(hào) kadmin.local -q 'delete_principal hdfs/bigdata-cdh01.kfk.com@HADOOP.COM'
創(chuàng)建賬號(hào)指定密碼 kadmin.local -q "addprinc hdfs/bigdata-cdh01.kfk.com@bd00@HADOOP.COM"
隨機(jī)生成密碼 kadmin.local -q "addprinc -randkey hdfs/bigdata-cdh01.kfk.com@HADOOP.COM"
導(dǎo)出票據(jù) kadmin.local -q "xst -k hdfs.keytab hdfs/bigdata-cdh01.kfk.com@HADOOP.COM"
登錄 kinit -k -t hdfs.keytab hdfs/bigdata-cdh01.kfk.com@HADOOP.COM
查看過(guò)期時(shí)間 kadmin.local -q 'getprinc krbtgt/HADOOP.COM@HADOOP.COM'
修改時(shí)間 kadmin.local -q 'modprinc -maxrenewlife "7d" krbtgt/HADOOP.COM@HADOOP.COM'
查看keytab內(nèi)容 klist -e -k -t zookeeper.keytab
不修改密碼導(dǎo)出 kadmin.local -q 'xst -k hdfs.keytab -norandkey hdfs/bigdata-cdh01.kfk.com@HADOOP.COM'
退出登錄 kdestroy
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無(wú)理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。