druid Kerberos化配置
上一篇: druid基础安装部署.
上一篇: Kerberos安装配置.
一,修改 /etc/krb5.conf 文件
去掉这一行,会导致奇怪的问题。
renew_lifetime = 7d
二,生成principle ,keytab文件
在Kerberos server所在服务器登陆kdc创建principle,生成keytab文件
kadmin.local
创建sponge 使用的principle
add_principal HTTP/hdp001.edu.org@EDU.ORG
add_principal HTTP/hdp002.edu.org@EDU.ORG
add_principal HTTP/hdp003.edu.org@EDU.ORG
ktadd -k /etc/security/keytabs/sponge.hdp001.keytab -norandkey HTTP/hdp001.edu.org@EDU.ORG
ktadd -k /etc/security/keytabs/sponge.hdp002.keytab -norandkey HTTP/hdp002.edu.org@EDU.ORG
ktadd -k /etc/security/keytabs/sponge.hdp003.keytab -norandkey HTTP/hdp003.edu.org@EDU.ORG
创建druid组件内部通讯使用的principe
add_principal druid
ktadd -k /etc/security/keytabs/druid.keytab -norandkey druid@EDU.ORG
将sponge keytab文件拷贝到对应的服务器目录下,将druid.keytab文件拷贝到所有服务器对应目录下。
三,配置kerberos 认证
druid.extensions.loadList=["druid-hdfs-storage", "druid-kafka-indexing-service","mysql-metadata-storage","druid-datasketches","druid-kerberos"]
# Authenticator 认证器 使用kerberos认证用户
druid.auth.authenticatorChain=["kerberos"]
druid.auth.authenticator.kerberos.type=kerberos
druid.auth.authenticator.kerberos.serverPrincipal=HTTP/_HOST@EDU.ORG
druid.auth.authenticator.kerberos.serverKeytab=/etc/security/keytabs/spnego.hdp001.keytab
druid.auth.authenticator.kerberos.authorizerName=allowAll
druid.auth.authenticator.kerberos.cookieSignatureSecret=cookie-signature-secret
# escalator 内部组件间通讯,认证方式需要和authenticator 保持一致
druid.escalator.type=kerberos
druid.escalator.internalClientPrincipal=druid@EDU.ORG
druid.escalator.internalClientKeytab=/etc/security/keytabs/druid.keytab
druid.escalator.authorizerName=allowAll
# authorizer 授权器
druid.auth.authorizers=["allowAll"]
druid.auth.authorizer.allowAll.type=allowAll
Kerberos认证基础上目前没有可用的授权器可用,使用allowAll 所有用户有所有访问权限。(druid 支持ranger,但是ranger貌似不支持druid)
四,启动druid,通过curl 命令,浏览器访问druid。
如果启动报认证错误,可以打开Kerberos debug 查看详细信息。