in cloudera-on-centos/scripts/cmxDeployOnIbiza.py [0:0]
def setup_kerberos():
"""
Setup Kerberos - work in progress
:return:
"""
# api = ApiResource(server_host=cmx.cm_server, username=cmx.username, password=cmx.password)
# cluster = api.get_cluster(cmx.cluster_name)
print "> Setup Kerberos"
hdfs = cdh.get_service_type('HDFS')
zookeeper = cdh.get_service_type('ZOOKEEPER')
hue = cdh.get_service_type('HUE')
hosts = management.get_hosts()
# HDFS Service-Wide
hdfs.update_config({"hadoop_security_authentication": "kerberos", "hadoop_security_authorization": True})
# hdfs-DATANODE-BASE - Default Group
role_group = hdfs.get_role_config_group("%s-DATANODE-BASE" % hdfs.name)
role_group.update_config({"dfs_datanode_http_port": "1006", "dfs_datanode_port": "1004",
"dfs_datanode_data_dir_perm": "700"})
# Zookeeper Service-Wide
zookeeper.update_config({"enableSecurity": True})
cdh.create_service_role(hue, "KT_RENEWER", [x for x in hosts if x.id == 0][0])