Author: swagle
Date: Thu Apr 4 18:27:22 2013
New Revision: 1464668
URL: http://svn.apache.org/r1464668
Log:
AMBARI-1776. ZooKeeper Servers needs to store correct kerberos principal in
zookeeper_jaas.conf. (swagle)
Modified:
incubator/ambari/trunk/CHANGES.txt
incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-zookeeper/manifests/init.pp
incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-zookeeper/manifests/params.pp
incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp/manifests/params.pp
incubator/ambari/trunk/ambari-agent/src/main/python/ambari_agent/manifestGenerator.py
Modified: incubator/ambari/trunk/CHANGES.txt
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1464668&r1=1464667&r2=1464668&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Thu Apr 4 18:27:22 2013
@@ -12,6 +12,9 @@ Trunk (unreleased changes):
NEW FEATURES
+ AMBARI-1776. ZooKeeper Servers needs to store correct kerberos principal
+ in zookeeper_jaas.conf. (swagle)
+
AMBARI-1424. Upgrade enhancements for Ambari 1.3.0. (smohanty)
AMBARI-1763. Integrate Frontend security work to enable security on
Modified:
incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-zookeeper/manifests/init.pp
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-zookeeper/manifests/init.pp?rev=1464668&r1=1464667&r2=1464668&view=diff
==============================================================================
---
incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-zookeeper/manifests/init.pp
(original)
+++
incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-zookeeper/manifests/init.pp
Thu Apr 4 18:27:22 2013
@@ -89,6 +89,7 @@ class hdp-zookeeper(
if ($security_enabled == true) {
if ($type == 'server') {
hdp-zookeeper::configfile { 'zookeeper_jaas.conf' : }
+ hdp-zookeeper::configfile { 'zookeeper_client_jaas.conf' : }
} else {
hdp-zookeeper::configfile { 'zookeeper_client_jaas.conf' : }
}
Modified:
incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-zookeeper/manifests/params.pp
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-zookeeper/manifests/params.pp?rev=1464668&r1=1464667&r2=1464668&view=diff
==============================================================================
---
incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-zookeeper/manifests/params.pp
(original)
+++
incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-zookeeper/manifests/params.pp
Thu Apr 4 18:27:22 2013
@@ -21,8 +21,8 @@
class hdp-zookeeper::params() inherits hdp::params
{
$conf_dir = $hdp::params::zk_conf_dir
-
$zk_user = $hdp::params::zk_user
+ $hostname = $hdp::params::hostname
$zk_log_dir = hdp_default("zk_log_dir","/var/log/zookeeper")
$zk_data_dir = hdp_default("zk_data_dir","/var/lib/zookeeper/data")
@@ -35,9 +35,15 @@ class hdp-zookeeper::params() inherits h
$syncLimit = hdp_default("syncLimit","5")
$clientPort = hdp_default("clientPort","2181")
- $zk_keytab_path = hdp_default("zk_service_keytab",
"${keytab_path}/zk.service.keytab")
- $zk_principal = hdp_default("zk_kerberos_prinicipal",
"zk/_HOST@${kerberos_domain}")
+ $zk_primary_name = hdp_default("zookeeper_primary_name", "zookeeper")
+
+ if ($use_hostname_in_principal) {
+ $zk_principal = "${zk_primary_name}/${hostname}@${kerberos_domain}"
+ } else {
+ $zk_principal = "${zk_primary_name}@${kerberos_domain}"
+ }
+ $zk_keytab_path = hdp_default("zookeeper_keytab_path",
"${keytab_path}/zk.service.keytab")
$zk_server_jaas_file = hdp_default("zk_server_jaas_conf_file",
"${conf_dir}/zookeeper_jaas.conf")
$zk_client_jaas_file = hdp_default("zk_client_jaas_conf_file",
"${conf_dir}/zookeeper_client_jaas.conf")
}
Modified:
incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp/manifests/params.pp
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp/manifests/params.pp?rev=1464668&r1=1464667&r2=1464668&view=diff
==============================================================================
---
incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp/manifests/params.pp
(original)
+++
incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp/manifests/params.pp
Thu Apr 4 18:27:22 2013
@@ -28,6 +28,10 @@ class hdp::params()
$cluster_service_state = hdp_default("cluster_service_state","running")
$cluster_client_state =
hdp_default("cluster_client_state","installed_and_configured")
+ ## Hostname defaults
+ $hostname = hdp_default("myhostname", $::fqdn)
+ $public_hostname = hdp_default("public_hostname")
+
##### for secure install
$security_enabled = hdp_default("security_enabled",false)
$kerberos_domain = hdp_default("kerberos_domain","EXAMPLE.COM")
@@ -35,6 +39,7 @@ class hdp::params()
## $smoketest_user_secure_uid = 1012
$kinit_path_local = hdp_default("kinit_path_local","/usr/bin/kinit")
$keytab_path = hdp_default("keytab_path", "/etc/security/keytabs")
+ $use_hostname_in_principal = hdp_default("instance_name", false)
###### hostnames
$namenode_host = hdp_default("namenode_host")
Modified:
incubator/ambari/trunk/ambari-agent/src/main/python/ambari_agent/manifestGenerator.py
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-agent/src/main/python/ambari_agent/manifestGenerator.py?rev=1464668&r1=1464667&r2=1464668&view=diff
==============================================================================
---
incubator/ambari/trunk/ambari-agent/src/main/python/ambari_agent/manifestGenerator.py
(original)
+++
incubator/ambari/trunk/ambari-agent/src/main/python/ambari_agent/manifestGenerator.py
Thu Apr 4 18:27:22 2013
@@ -26,11 +26,12 @@ from shell import shellRunner
from datetime import datetime
import AmbariConfig
import pprint
+import hostname
logger = logging.getLogger()
non_global_configuration_types = ["hdfs-site", "core-site",
- "mapred-queue-acls",
+ "mapred-queue-acls",
"hadoop-policy", "mapred-site",
"capacity-scheduler", "hbase-site",
"hbase-policy", "hive-site", "oozie-site",
@@ -84,8 +85,7 @@ def generateManifest(parsedJson, fileNam
#writing params from map
writeParams(manifest, params, modulesdir)
-
-
+
nonGlobalConfigurations = {}
flatConfigurations = {}
@@ -164,12 +164,16 @@ def writeHostAttributes(outputFile, host
#write flat configurations
def writeFlatConfigurations(outputFile, flatConfigs):
flatDict = {}
+ fqdn = hostname.hostname()
+ public_fqdn = hostname.public_hostname()
logger.info("Generating global configurations =>\n" +
pprint.pformat(flatConfigs))
for flatConfigName in flatConfigs.iterkeys():
for flatConfig in flatConfigs[flatConfigName].iterkeys():
flatDict[flatConfig] = flatConfigs[flatConfigName][flatConfig]
for gconfigKey in flatDict.iterkeys():
outputFile.write('$' + gconfigKey + ' = "' + flatDict[gconfigKey] + '"' +
os.linesep)
+ outputFile.write('$myhostname' + " = '" + fqdn + "'" + os.linesep)
+ outputFile.write('$public_hostname' + " = '" + public_fqdn + "'" +
os.linesep)
#write xml configurations
def writeNonGlobalConfigurations(outputFile, xmlConfigs):