为kafka开启kerberos
主节点安装
在铜陵等地区,都构建了全面的区域性战略布局,加强发展的系统性、市场前瞻性、产品创新能力,以专注、极致的服务理念,为客户提供网站制作、做网站 网站设计制作按需网站策划,公司网站建设,企业网站建设,品牌网站建设,全网营销推广,外贸营销网站建设,铜陵网站建设费用合理。
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
}
创建kerberos数据库
kdb5_util create -r HADOOP.COM -s
创建kerberos管理账号
将kerberos服务添加为开机启动
systemctl enable krb5kdc
systemctl enable kadmin
systemctl start krb5kdc
systemctl start kadmin
测试管理员账号
为节点安装客户端
yum -y install krb5-libs krb5-auth-dialog krb5-workstation
在主节点上安装额外的包
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/
启动kerberos
为kafka开启kerberos
krb5的一些命令
列出账号 kadmin.local -q "listprincs"
删除账号 kadmin.local -q 'delete_principal hdfs/bigdata-cdh01.kfk.com@HADOOP.COM'
创建账号指定密码 kadmin.local -q "addprinc hdfs/bigdata-cdh01.kfk.com@bd00@HADOOP.COM"
随机生成密码 kadmin.local -q "addprinc -randkey hdfs/bigdata-cdh01.kfk.com@HADOOP.COM"
导出票据 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
查看过期时间 kadmin.local -q 'getprinc krbtgt/HADOOP.COM@HADOOP.COM'
修改时间 kadmin.local -q 'modprinc -maxrenewlife "7d" krbtgt/HADOOP.COM@HADOOP.COM'
查看keytab内容 klist -e -k -t zookeeper.keytab
不修改密码导出 kadmin.local -q 'xst -k hdfs.keytab -norandkey hdfs/bigdata-cdh01.kfk.com@HADOOP.COM'
退出登录 kdestroy
新闻名称:为kafka开启kerberos
链接地址:http://cdiso.cn/article/pjdpgc.html