You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ja...@apache.org on 2014/11/21 23:04:51 UTC
[3/3] ambari git commit: AMBARI-8408. Implement the initial layout
for the kerberos wizard. (jaimin)
AMBARI-8408. Implement the initial layout for the kerberos wizard. (jaimin)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/dd87511e
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/dd87511e
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/dd87511e
Branch: refs/heads/trunk
Commit: dd87511efa0d6b741b1b6acab3b399b8722a994b
Parents: 1c655c7
Author: Jaimin Jetly <ja...@hortonworks.com>
Authored: Fri Nov 21 14:04:24 2014 -0800
Committer: Jaimin Jetly <ja...@hortonworks.com>
Committed: Fri Nov 21 14:04:24 2014 -0800
----------------------------------------------------------------------
.../stacks/HDP-2.1/recommendations_configs.json | 318 ++++++++--------
.../data/stacks/HDP-2.1/service_components.json | 89 +++++
.../wizard/stack/hdp/version2.0.1/KERBEROS.json | 372 +++++++++++++++++++
ambari-web/app/config.js | 3 +-
ambari-web/app/controllers.js | 9 +
.../controllers/global/cluster_controller.js | 2 +-
.../global/configuration_controller.js | 50 ++-
.../nameNode/wizard_controller.js | 3 +-
.../highAvailability/progress_controller.js | 320 +---------------
.../app/controllers/main/admin/kerberos.js | 95 +++++
.../main/admin/kerberos/progress_controller.js | 25 ++
.../main/admin/kerberos/step1_controller.js | 82 ++++
.../main/admin/kerberos/step2_controller.js | 164 ++++++++
.../main/admin/kerberos/step3_controller.js | 59 +++
.../main/admin/kerberos/step4_controller.js | 22 ++
.../main/admin/kerberos/step5_controller.js | 21 ++
.../main/admin/kerberos/step6_controller.js | 25 ++
.../main/admin/kerberos/wizard_controller.js | 220 +++++++++++
.../app/controllers/wizard/step7_controller.js | 31 +-
.../app/controllers/wizard/step8_controller.js | 74 +---
ambari-web/app/data/HDP2/site_properties.js | 199 +++++++++-
ambari-web/app/messages.js | 36 +-
ambari-web/app/mixins.js | 4 +
.../wizard/wizardDeployProgressController.js | 94 +++++
.../mixins/wizard/wizardDeployProgressView.js | 96 +++++
.../wizard/wizardProgressPageController.js | 364 ++++++++++++++++++
.../app/mixins/wizard/wizardProgressPageView.js | 121 ++++++
ambari-web/app/models/stack_service.js | 7 +-
ambari-web/app/router.js | 3 +
ambari-web/app/routes/add_kerberos_routes.js | 255 +++++++++++++
ambari-web/app/routes/main.js | 14 +-
.../main/admin/highAvailability/progress.hbs | 5 +-
.../app/templates/main/admin/kerberos.hbs | 36 ++
.../app/templates/main/admin/kerberos/step1.hbs | 47 +++
.../app/templates/main/admin/kerberos/step2.hbs | 35 ++
.../app/templates/main/admin/kerberos/step3.hbs | 18 +
.../app/templates/main/admin/kerberos/step4.hbs | 21 ++
.../app/templates/main/admin/kerberos/step5.hbs | 18 +
.../app/templates/main/admin/kerberos/step6.hbs | 18 +
.../templates/main/admin/kerberos/wizard.hbs | 47 +++
ambari-web/app/utils/ajax/ajax.js | 33 +-
ambari-web/app/utils/config.js | 14 +-
ambari-web/app/utils/db.js | 12 +
ambari-web/app/utils/ember_reopen.js | 19 +-
ambari-web/app/views.js | 11 +
ambari-web/app/views/main/admin.js | 18 +-
.../admin/highAvailability/progress_view.js | 63 +---
ambari-web/app/views/main/admin/kerberos.js | 28 ++
.../views/main/admin/kerberos/progress_view.js | 39 ++
.../app/views/main/admin/kerberos/step1_view.js | 44 +++
.../app/views/main/admin/kerberos/step2_view.js | 31 ++
.../app/views/main/admin/kerberos/step3_view.js | 32 ++
.../app/views/main/admin/kerberos/step4_view.js | 25 ++
.../app/views/main/admin/kerberos/step5_view.js | 25 ++
.../app/views/main/admin/kerberos/step6_view.js | 30 ++
.../views/main/admin/kerberos/wizard_view.js | 81 ++++
ambari-web/app/views/main/menu.js | 18 +-
ambari-web/app/views/wizard/step8_view.js | 71 +---
ambari-web/package.json | 1 +
59 files changed, 3288 insertions(+), 729 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/dd87511e/ambari-web/app/assets/data/stacks/HDP-2.1/recommendations_configs.json
----------------------------------------------------------------------
diff --git a/ambari-web/app/assets/data/stacks/HDP-2.1/recommendations_configs.json b/ambari-web/app/assets/data/stacks/HDP-2.1/recommendations_configs.json
index 6dacfeb..da38fcb 100644
--- a/ambari-web/app/assets/data/stacks/HDP-2.1/recommendations_configs.json
+++ b/ambari-web/app/assets/data/stacks/HDP-2.1/recommendations_configs.json
@@ -1,175 +1,153 @@
{
- "hosts": ["ab2test-5.c.pramod-thangali.internal", "ab2test-6.c.pramod-thangali.internal", "ab2test-7.c.pramod-thangali.internal"],
- "services": ["HDFS", "MAPREDUCE2", "YARN", "TEZ", "NAGIOS", "GANGLIA", "HIVE", "SQOOP", "OOZIE", "ZOOKEEPER", "FALCON", "STORM", "FLUME", "PIG"],
- "recommendations": {
- "blueprint": {
- "host_groups": [
- {
- "name": "host-group-3",
- "components": [
- {
- "name": "NAMENODE"
- },
- {
- "name": "STORM_UI_SERVER"
- },
- {
- "name": "GANGLIA_SERVER"
- },
- {
- "name": "ZOOKEEPER_SERVER"
- },
- {
- "name": "STORM_REST_API"
- },
- {
- "name": "NIMBUS"
- },
- {
- "name": "DRPC_SERVER"
- },
- {
- "name": "MYSQL_SERVER"
- },
- {
- "name": "NAGIOS_SERVER"
- }
- ]
+ "resources" : [
+ {
+ "href" : "http://c6403.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/recommendations/5",
+ "hosts" : [
+ "c6403.ambari.apache.org"
+ ],
+ "services": ["HDFS", "MAPREDUCE2", "YARN", "TEZ", "NAGIOS", "GANGLIA", "HIVE", "SQOOP", "OOZIE", "ZOOKEEPER", "FALCON", "STORM", "FLUME", "PIG"],
+ "Recommendation" : {
+ "id" : 5
},
- {
- "name": "host-group-1",
- "components": [
- {
- "name": "YARN_CLIENT"
- },
- {
- "name": "NODEMANAGER"
- },
- {
- "name": "HDFS_CLIENT"
- },
- {
- "name": "HIVE_CLIENT"
- },
- {
- "name": "SQOOP"
- },
- {
- "name": "GANGLIA_MONITOR"
- },
- {
- "name": "DATANODE"
- },
- {
- "name": "FLUME_HANDLER"
- },
- {
- "name": "MAPREDUCE2_CLIENT"
- },
- {
- "name": "SUPERVISOR"
- },
- {
- "name": "OOZIE_CLIENT"
- },
- {
- "name": "ZOOKEEPER_CLIENT"
- },
- {
- "name": "PIG"
- },
- {
- "name": "ZOOKEEPER_SERVER"
- },
- {
- "name": "JOURNALNODE"
- },
- {
- "name": "ZKFC"
- },
- {
- "name": "TEZ_CLIENT"
- },
- {
- "name": "FALCON_CLIENT"
- },
- {
- "name": "HCAT"
- }
- ]
+ "Versions" : {
+ "stack_name" : "HDP",
+ "stack_version" : "2.2"
},
- {
- "name": "host-group-2",
- "components": [
- {
- "name": "FALCON_SERVER"
- },
- {
- "name": "OOZIE_SERVER"
- },
- {
- "name": "HIVE_SERVER"
- },
- {
- "name": "APP_TIMELINE_SERVER"
- },
- {
- "name": "HISTORYSERVER"
- },
- {
- "name": "HIVE_METASTORE"
- },
- {
- "name": "ZOOKEEPER_SERVER"
- },
- {
- "name": "RESOURCEMANAGER"
- },
- {
- "name": "WEBHCAT_SERVER"
- },
- {
- "name": "SECONDARY_NAMENODE"
- }
- ]
+ "recommendations" : {
+ "blueprint" : {
+ "host_groups" : [
+ {
+ "name" : "host-group-1",
+ "components" : [
+ {
+ "name" : "NODEMANAGER"
+ },
+ {
+ "name" : "HIVE_CLIENT"
+ },
+ {
+ "name" : "HDFS_CLIENT"
+ },
+ {
+ "name" : "APP_TIMELINE_SERVER"
+ },
+ {
+ "name" : "SLIDER"
+ },
+ {
+ "name" : "RESOURCEMANAGER"
+ },
+ {
+ "name" : "WEBHCAT_SERVER"
+ },
+ {
+ "name" : "DATANODE"
+ },
+ {
+ "name" : "FLUME_HANDLER"
+ },
+ {
+ "name" : "SUPERVISOR"
+ },
+ {
+ "name" : "NAMENODE"
+ },
+ {
+ "name" : "HBASE_CLIENT"
+ },
+ {
+ "name" : "OOZIE_CLIENT"
+ },
+ {
+ "name" : "HBASE_REGIONSERVER"
+ },
+ {
+ "name" : "KAFKA_BROKER"
+ },
+ {
+ "name" : "HISTORYSERVER"
+ },
+ {
+ "name" : "PIG"
+ },
+ {
+ "name" : "KNOX_GATEWAY"
+ },
+ {
+ "name" : "HCAT"
+ },
+ {
+ "name" : "YARN_CLIENT"
+ },
+ {
+ "name" : "SQOOP"
+ },
+ {
+ "name" : "GANGLIA_SERVER"
+ },
+ {
+ "name" : "HIVE_METASTORE"
+ },
+ {
+ "name" : "DRPC_SERVER"
+ },
+ {
+ "name" : "NIMBUS"
+ },
+ {
+ "name" : "GANGLIA_MONITOR"
+ },
+ {
+ "name" : "MYSQL_SERVER"
+ },
+ {
+ "name" : "MAPREDUCE2_CLIENT"
+ },
+ {
+ "name" : "OOZIE_SERVER"
+ },
+ {
+ "name" : "HIVE_SERVER"
+ },
+ {
+ "name" : "HBASE_MASTER"
+ },
+ {
+ "name" : "STORM_UI_SERVER"
+ },
+ {
+ "name" : "ZOOKEEPER_CLIENT"
+ },
+ {
+ "name" : "ZOOKEEPER_SERVER"
+ },
+ {
+ "name" : "TEZ_CLIENT"
+ },
+ {
+ "name" : "SECONDARY_NAMENODE"
+ },
+ {
+ "name" : "NAGIOS_SERVER"
+ }
+ ]
+ }
+ ],
+ "configurations" : { }
+ },
+ "blueprint_cluster_binding" : {
+ "host_groups" : [
+ {
+ "name" : "host-group-1",
+ "hosts" : [
+ {
+ "name" : "c6403.ambari.apache.org"
+ }
+ ]
+ }
+ ]
+ }
}
- ],
- "configurations": {
- "core-site": {},
- "global": {
- "properties": {}
- },
- "hbase-site": {},
- "hdfs-site": {},
- "yarn-site": {}
}
- },
- "blueprint_cluster_binding": {
- "host_groups": [
- {
- "name": "host-group-3",
- "hosts": [
- {
- "fqdn": "ab2test-5.c.pramod-thangali.internal"
- }
- ]
- },
- {
- "name": "host-group-1",
- "hosts": [
- {
- "fqdn": "ab2test-7.c.pramod-thangali.internal"
- }
- ]
- },
- {
- "name": "host-group-2",
- "hosts": [
- {
- "fqdn": "ab2test-6.c.pramod-thangali.internal"
- }
- ]
- }
- ]
- }
-}}
+ ]
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/dd87511e/ambari-web/app/assets/data/stacks/HDP-2.1/service_components.json
----------------------------------------------------------------------
diff --git a/ambari-web/app/assets/data/stacks/HDP-2.1/service_components.json b/ambari-web/app/assets/data/stacks/HDP-2.1/service_components.json
index 7c56a30..64a4e1d 100644
--- a/ambari-web/app/assets/data/stacks/HDP-2.1/service_components.json
+++ b/ambari-web/app/assets/data/stacks/HDP-2.1/service_components.json
@@ -1451,6 +1451,95 @@
"dependencies" : [ ]
}
]
+ },
+ {
+ "href" : "http://c6403.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.1/services/KERBEROS",
+ "StackServices" : {
+ "comments" : "A computer network authentication protocol which works on\n the basis of 'tickets' to allow nodes communicating over a\n non-secure network to prove their identity to one another in a\n secure manner.\n ",
+ "custom_commands" : [ ],
+ "display_name" : "Kerberos",
+ "required_services" : [ ],
+ "service_check_supported" : true,
+ "service_name" : "KERBEROS",
+ "service_version" : "1.10.3-10",
+ "stack_name" : "HDP",
+ "stack_version" : "2.1",
+ "user_name" : null,
+ "config_types" : {
+ "kadm5-acl" : {
+ "supports" : {
+ "adding_forbidden" : "false",
+ "do_not_extend" : "false",
+ "final" : "false"
+ }
+ },
+ "kdc-conf" : {
+ "supports" : {
+ "adding_forbidden" : "false",
+ "do_not_extend" : "false",
+ "final" : "false"
+ }
+ },
+ "krb5-conf" : {
+ "supports" : {
+ "adding_forbidden" : "false",
+ "do_not_extend" : "false",
+ "final" : "false"
+ }
+ }
+ }
+ },
+ "serviceComponents" : [
+ {
+ "href" : "http://c6403.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.1/services/KERBEROS/components/KDC_SERVER",
+ "StackServiceComponents" : {
+ "cardinality" : "0-1",
+ "component_category" : "MASTER",
+ "component_name" : "KDC_SERVER",
+ "custom_commands" : [ ],
+ "display_name" : "Kerberos KDC",
+ "is_client" : false,
+ "is_master" : true,
+ "service_name" : "KERBEROS",
+ "stack_name" : "HDP",
+ "stack_version" : "2.1"
+ },
+ "dependencies" : [
+ {
+ "href" : "http://c6403.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.1/services/KERBEROS/components/KDC_SERVER/dependencies/KERBEROS_CLIENT",
+ "Dependencies" : {
+ "component_name" : "KERBEROS_CLIENT",
+ "dependent_component_name" : "KDC_SERVER",
+ "dependent_service_name" : "KERBEROS",
+ "scope" : "cluster",
+ "stack_name" : "HDP",
+ "stack_version" : "2.1"
+ }
+ }
+ ]
+ },
+ {
+ "href" : "http://c6403.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.1/services/KERBEROS/components/KERBEROS_CLIENT",
+ "StackServiceComponents" : {
+ "cardinality" : "ALL",
+ "component_category" : "CLIENT",
+ "component_name" : "KERBEROS_CLIENT",
+ "custom_commands" : [
+ "SET_KEYTAB"
+ ],
+ "display_name" : "Kerberos Client",
+ "is_client" : true,
+ "is_master" : false,
+ "service_name" : "KERBEROS",
+ "stack_name" : "HDP",
+ "stack_version" : "2.1"
+ },
+ "auto_deploy" : {
+ "enabled" : true
+ },
+ "dependencies" : [ ]
+ }
+ ]
}
]
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/dd87511e/ambari-web/app/assets/data/wizard/stack/hdp/version2.0.1/KERBEROS.json
----------------------------------------------------------------------
diff --git a/ambari-web/app/assets/data/wizard/stack/hdp/version2.0.1/KERBEROS.json b/ambari-web/app/assets/data/wizard/stack/hdp/version2.0.1/KERBEROS.json
new file mode 100644
index 0000000..05a7a2b
--- /dev/null
+++ b/ambari-web/app/assets/data/wizard/stack/hdp/version2.0.1/KERBEROS.json
@@ -0,0 +1,372 @@
+
+{
+ "href" : "http://c6403.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/stackServices/KERBEROS/configurations?fields=*",
+ "items" : [
+ {
+ "href" : "http://c6403.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/services/KERBEROS/configurations/admin_server_host",
+ "StackConfigurations" : {
+ "final" : "false",
+ "property_description" : "\n The IP address or FQDN of the administrative Kerberos server, optionally a port number may be\n provided\n ",
+ "property_name" : "admin_server_host",
+ "property_type" : [ ],
+ "property_value" : "",
+ "service_name" : "KERBEROS",
+ "stack_name" : "HDP",
+ "stack_version" : "2.2",
+ "type" : "krb5-conf.xml"
+ }
+ },
+ {
+ "href" : "http://c6403.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/services/KERBEROS/configurations/conf_dir",
+ "StackConfigurations" : {
+ "final" : "false",
+ "property_description" : "The kadm.acl configuration directory",
+ "property_name" : "conf_dir",
+ "property_type" : [ ],
+ "property_value" : "/var/kerberos/krb5kdc",
+ "service_name" : "KERBEROS",
+ "stack_name" : "HDP",
+ "stack_version" : "2.2",
+ "type" : "kadm5-acl.xml"
+ }
+ },
+ {
+ "href" : "http://c6403.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/services/KERBEROS/configurations/conf_dir",
+ "StackConfigurations" : {
+ "final" : "false",
+ "property_description" : "The kdc.conf configuration directory",
+ "property_name" : "conf_dir",
+ "property_type" : [ ],
+ "property_value" : "/var/kerberos/krb5kdc",
+ "service_name" : "KERBEROS",
+ "stack_name" : "HDP",
+ "stack_version" : "2.2",
+ "type" : "kdc-conf.xml"
+ }
+ },
+ {
+ "href" : "http://c6403.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/services/KERBEROS/configurations/conf_dir",
+ "StackConfigurations" : {
+ "final" : "false",
+ "property_description" : "The krb5.conf configuration directory",
+ "property_name" : "conf_dir",
+ "property_type" : [ ],
+ "property_value" : "/etc",
+ "service_name" : "KERBEROS",
+ "stack_name" : "HDP",
+ "stack_version" : "2.2",
+ "type" : "krb5-conf.xml"
+ }
+ },
+ {
+ "href" : "http://c6403.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/services/KERBEROS/configurations/content",
+ "StackConfigurations" : {
+ "final" : "false",
+ "property_description" : "The jinja template for the kadm5.acl file",
+ "property_name" : "content",
+ "property_type" : [ ],
+ "property_value" : "\n */admin@{{realm}}\t*\n\n {# Append additional realm declarations should be placed below #}\n ",
+ "service_name" : "KERBEROS",
+ "stack_name" : "HDP",
+ "stack_version" : "2.2",
+ "type" : "kadm5-acl.xml"
+ }
+ },
+ {
+ "href" : "http://c6403.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/services/KERBEROS/configurations/content",
+ "StackConfigurations" : {
+ "final" : "false",
+ "property_description" : "The jinja template for the kdc.conf file",
+ "property_name" : "content",
+ "property_type" : [ ],
+ "property_value" : "\n [kdcdefaults]\n kdc_ports = {{kdcdefaults_kdc_ports}}\n kdc_tcp_ports = {{kdcdefaults_kdc_tcp_ports}}\n\n [realms]\n {{realm}} = {\n acl_file = {{kadm5_acl_path}}\n dict_file = /usr/share/dict/words\n admin_keytab = {{kadm5_acl_dir}}/kadm5.keytab\n supported_enctypes = {{libdefaults_default_tgs_enctypes}}\n }\n\n {# Append additional realm declarations should be placed below #}\n ",
+ "service_name" : "KERBEROS",
+ "stack_name" : "HDP",
+ "stack_version" : "2.2",
+ "type" : "kdc-conf.xml"
+ }
+ },
+ {
+ "href" : "http://c6403.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/services/KERBEROS/configurations/content",
+ "StackConfigurations" : {
+ "final" : "false",
+ "property_description" : "The jinja template for the krb5.conf file",
+ "property_name" : "content",
+ "property_type" : [ ],
+ "property_value" : "\n[libdefaults]\n renew_lifetime = {{libdefaults_renew_lifetime}}\n forwardable = {{libdefaults_forwardable}}\n default_realm = {{realm|upper()}}\n ticket_lifetime = {{libdefaults_ticket_lifetime}}\n dns_lookup_realm = {{libdefaults_dns_lookup_realm}}\n dns_lookup_kdc = {{libdefaults_dns_lookup_kdc}}\n\n{% if domains %}\n[domain_realm]\n{% for domain in domains %}\n {{domain}} = {{realm|upper()}}\n{% endfor %}\n{% endif %}\n\n[logging]\n default = {{logging_default}}\n{#\n# The following options are unused unless a managed KDC is installed\n admin_server = {{logging_admin_server}}\n kdc = {{logging_admin_kdc}}\n#}\n\n[realms]\n {{realm}} = {\n admin_server = {{admin_server_host|default(kdc_host, True)}}\n kdc = {{kdc_host}}\n }\n\n{# Append additional realm declarations should be placed below #}\n ",
+ "service_name" : "KERBEROS",
+ "stack_name" : "HDP",
+ "stack_version" : "2.2",
+ "type" : "krb5-conf.xml"
+ }
+ },
+ {
+ "href" : "http://c6403.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/services/KERBEROS/configurations/domains",
+ "StackConfigurations" : {
+ "final" : "false",
+ "property_description" : "\n A comma-delimited list of domain names that the realm serves (optional)\n ",
+ "property_name" : "domains",
+ "property_type" : [ ],
+ "property_value" : "",
+ "service_name" : "KERBEROS",
+ "stack_name" : "HDP",
+ "stack_version" : "2.2",
+ "type" : "krb5-conf.xml"
+ }
+ },
+ {
+ "href" : "http://c6403.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/services/KERBEROS/configurations/kdc_host",
+ "StackConfigurations" : {
+ "final" : "false",
+ "property_description" : "\n The IP address or FQDN of the KDC or Active Directory server, optionally a port number may be\n provided\n ",
+ "property_name" : "kdc_host",
+ "property_type" : [ ],
+ "property_value" : "",
+ "service_name" : "KERBEROS",
+ "stack_name" : "HDP",
+ "stack_version" : "2.2",
+ "type" : "krb5-conf.xml"
+ }
+ },
+ {
+ "href" : "http://c6403.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/services/KERBEROS/configurations/kdc_type",
+ "StackConfigurations" : {
+ "final" : "false",
+ "property_description" : "\n The type of KDC being used. Either mit-kdc or active-directory\n ",
+ "property_name" : "kdc_type",
+ "property_type" : [ ],
+ "property_value" : "mit-kdc",
+ "service_name" : "KERBEROS",
+ "stack_name" : "HDP",
+ "stack_version" : "2.2",
+ "type" : "krb5-conf.xml"
+ }
+ },
+ {
+ "href" : "http://c6403.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/services/KERBEROS/configurations/kdcdefaults_kdc_ports",
+ "StackConfigurations" : {
+ "final" : "false",
+ "property_description" : null,
+ "property_name" : "kdcdefaults_kdc_ports",
+ "property_type" : [ ],
+ "property_value" : "88",
+ "service_name" : "KERBEROS",
+ "stack_name" : "HDP",
+ "stack_version" : "2.2",
+ "type" : "kdc-conf.xml"
+ }
+ },
+ {
+ "href" : "http://c6403.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/services/KERBEROS/configurations/kdcdefaults_kdc_tcp_ports",
+ "StackConfigurations" : {
+ "final" : "false",
+ "property_description" : null,
+ "property_name" : "kdcdefaults_kdc_tcp_ports",
+ "property_type" : [ ],
+ "property_value" : "88",
+ "service_name" : "KERBEROS",
+ "stack_name" : "HDP",
+ "stack_version" : "2.2",
+ "type" : "kdc-conf.xml"
+ }
+ },
+ {
+ "href" : "http://c6403.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/services/KERBEROS/configurations/libdefaults_default_tgs_enctypes",
+ "StackConfigurations" : {
+ "final" : "false",
+ "property_description" : "\n a space-delimited list of session key encryption types supported by the KDC or Active\n Directory\n ",
+ "property_name" : "libdefaults_default_tgs_enctypes",
+ "property_type" : [ ],
+ "property_value" : "\n aes256-cts-hmac-sha1-96 aes128-cts-hmac-sha1-96 des3-cbc-sha1 arcfour-hmac-md5\n camellia256-cts-cmac camellia128-cts-cmac des-cbc-crc des-cbc-md5 des-cbc-md4\n ",
+ "service_name" : "KERBEROS",
+ "stack_name" : "HDP",
+ "stack_version" : "2.2",
+ "type" : "krb5-conf.xml"
+ }
+ },
+ {
+ "href" : "http://c6403.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/services/KERBEROS/configurations/libdefaults_default_tkt_enctypes",
+ "StackConfigurations" : {
+ "final" : "false",
+ "property_description" : "\n a space-delimited list of session key encryption types supported by the KDC or Active\n Directory\n ",
+ "property_name" : "libdefaults_default_tkt_enctypes",
+ "property_type" : [ ],
+ "property_value" : "\n aes256-cts-hmac-sha1-96 aes128-cts-hmac-sha1-96 des3-cbc-sha1 arcfour-hmac-md5\n camellia256-cts-cmac camellia128-cts-cmac des-cbc-crc des-cbc-md5 des-cbc-md4\n ",
+ "service_name" : "KERBEROS",
+ "stack_name" : "HDP",
+ "stack_version" : "2.2",
+ "type" : "krb5-conf.xml"
+ }
+ },
+ {
+ "href" : "http://c6403.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/services/KERBEROS/configurations/libdefaults_dns_lookup_kdc",
+ "StackConfigurations" : {
+ "final" : "false",
+ "property_description" : null,
+ "property_name" : "libdefaults_dns_lookup_kdc",
+ "property_type" : [ ],
+ "property_value" : "false",
+ "service_name" : "KERBEROS",
+ "stack_name" : "HDP",
+ "stack_version" : "2.2",
+ "type" : "krb5-conf.xml"
+ }
+ },
+ {
+ "href" : "http://c6403.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/services/KERBEROS/configurations/libdefaults_dns_lookup_realm",
+ "StackConfigurations" : {
+ "final" : "false",
+ "property_description" : null,
+ "property_name" : "libdefaults_dns_lookup_realm",
+ "property_type" : [ ],
+ "property_value" : "false",
+ "service_name" : "KERBEROS",
+ "stack_name" : "HDP",
+ "stack_version" : "2.2",
+ "type" : "krb5-conf.xml"
+ }
+ },
+ {
+ "href" : "http://c6403.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/services/KERBEROS/configurations/libdefaults_forwardable",
+ "StackConfigurations" : {
+ "final" : "false",
+ "property_description" : null,
+ "property_name" : "libdefaults_forwardable",
+ "property_type" : [ ],
+ "property_value" : "true",
+ "service_name" : "KERBEROS",
+ "stack_name" : "HDP",
+ "stack_version" : "2.2",
+ "type" : "krb5-conf.xml"
+ }
+ },
+ {
+ "href" : "http://c6403.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/services/KERBEROS/configurations/libdefaults_renew_lifetime",
+ "StackConfigurations" : {
+ "final" : "false",
+ "property_description" : null,
+ "property_name" : "libdefaults_renew_lifetime",
+ "property_type" : [ ],
+ "property_value" : "7d",
+ "service_name" : "KERBEROS",
+ "stack_name" : "HDP",
+ "stack_version" : "2.2",
+ "type" : "krb5-conf.xml"
+ }
+ },
+ {
+ "href" : "http://c6403.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/services/KERBEROS/configurations/libdefaults_ticket_lifetime",
+ "StackConfigurations" : {
+ "final" : "false",
+ "property_description" : null,
+ "property_name" : "libdefaults_ticket_lifetime",
+ "property_type" : [ ],
+ "property_value" : "24h",
+ "service_name" : "KERBEROS",
+ "stack_name" : "HDP",
+ "stack_version" : "2.2",
+ "type" : "krb5-conf.xml"
+ }
+ },
+ {
+ "href" : "http://c6403.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/services/KERBEROS/configurations/logging_admin_server",
+ "StackConfigurations" : {
+ "final" : "false",
+ "property_description" : null,
+ "property_name" : "logging_admin_server",
+ "property_type" : [ ],
+ "property_value" : "FILE:/var/log/kadmind.log",
+ "service_name" : "KERBEROS",
+ "stack_name" : "HDP",
+ "stack_version" : "2.2",
+ "type" : "krb5-conf.xml"
+ }
+ },
+ {
+ "href" : "http://c6403.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/services/KERBEROS/configurations/logging_default",
+ "StackConfigurations" : {
+ "final" : "false",
+ "property_description" : null,
+ "property_name" : "logging_default",
+ "property_type" : [ ],
+ "property_value" : "FILE:/var/log/krb5libs.log",
+ "service_name" : "KERBEROS",
+ "stack_name" : "HDP",
+ "stack_version" : "2.2",
+ "type" : "krb5-conf.xml"
+ }
+ },
+ {
+ "href" : "http://c6403.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/services/KERBEROS/configurations/logging_kdc",
+ "StackConfigurations" : {
+ "final" : "false",
+ "property_description" : null,
+ "property_name" : "logging_kdc",
+ "property_type" : [ ],
+ "property_value" : "FILE:/var/log/krb5kdc.log",
+ "service_name" : "KERBEROS",
+ "stack_name" : "HDP",
+ "stack_version" : "2.2",
+ "type" : "krb5-conf.xml"
+ }
+ },
+ {
+ "href" : "http://c6403.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/services/KERBEROS/configurations/realm",
+ "StackConfigurations" : {
+ "final" : "false",
+ "property_description" : "\n The realm to use when creating service principals\n ",
+ "property_name" : "realm",
+ "property_type" : [ ],
+ "property_value" : "",
+ "service_name" : "KERBEROS",
+ "stack_name" : "HDP",
+ "stack_version" : "2.2",
+ "type" : "krb5-conf.xml"
+ }
+ },
+ {
+ "href" : "http://c6403.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/services/KERBEROS/configurations/test_keytab",
+ "StackConfigurations" : {
+ "final" : "false",
+ "property_description" : "\n The base64-encoded keytab for the test principal (either this value or the password\n value is required to be set, neither is expected to be retained)\n ",
+ "property_name" : "test_keytab",
+ "property_type" : [ ],
+ "property_value" : "\n\n ",
+ "service_name" : "KERBEROS",
+ "stack_name" : "HDP",
+ "stack_version" : "2.2",
+ "type" : "krb5-conf.xml"
+ }
+ },
+ {
+ "href" : "http://c6403.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/services/KERBEROS/configurations/test_password",
+ "StackConfigurations" : {
+ "final" : "false",
+ "property_description" : "\n The password for the administrative principal (either this value or the keytab value is\n required to be set, neither is expected to be retained)\n ",
+ "property_name" : "test_password",
+ "property_type" : [
+ "PASSWORD"
+ ],
+ "property_value" : "",
+ "service_name" : "KERBEROS",
+ "stack_name" : "HDP",
+ "stack_version" : "2.2",
+ "type" : "krb5-conf.xml"
+ }
+ },
+ {
+ "href" : "http://c6403.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/services/KERBEROS/configurations/test_principal",
+ "StackConfigurations" : {
+ "final" : "false",
+ "property_description" : "\n The principal that may be used to test the Kerberos configuration (this will not be retained)\n ",
+ "property_name" : "test_principal",
+ "property_type" : [ ],
+ "property_value" : "",
+ "service_name" : "KERBEROS",
+ "stack_name" : "HDP",
+ "stack_version" : "2.2",
+ "type" : "krb5-conf.xml"
+ }
+ }
+ ]
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/dd87511e/ambari-web/app/config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/config.js b/ambari-web/app/config.js
index 13901a1..69e033b 100644
--- a/ambari-web/app/config.js
+++ b/ambari-web/app/config.js
@@ -60,7 +60,8 @@ App.supports = {
stackUpgrade: false,
autoRollbackHA: false,
alerts: true,
- alwaysEnableManagedMySQLForHive: false
+ alwaysEnableManagedMySQLForHive: false,
+ automatedKerberos: false
};
if (App.enableExperimental) {
http://git-wip-us.apache.org/repos/asf/ambari/blob/dd87511e/ambari-web/app/controllers.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers.js b/ambari-web/app/controllers.js
index c4385ce..58e9c4e 100644
--- a/ambari-web/app/controllers.js
+++ b/ambari-web/app/controllers.js
@@ -58,6 +58,15 @@ require('controllers/main/admin/stack_versions/stack_version_details_controller'
require('controllers/main/admin/serviceAccounts_controller');
require('controllers/main/admin/advanced');
require('utils/polling');
+require('controllers/main/admin/kerberos');
+require('controllers/main/admin/kerberos/wizard_controller');
+require('controllers/main/admin/kerberos/progress_controller');
+require('controllers/main/admin/kerberos/step1_controller');
+require('controllers/main/admin/kerberos/step2_controller');
+require('controllers/main/admin/kerberos/step3_controller');
+require('controllers/main/admin/kerberos/step4_controller');
+require('controllers/main/admin/kerberos/step5_controller');
+require('controllers/main/admin/kerberos/step6_controller');
require('controllers/main/admin/security');
require('controllers/main/admin/security/security_progress_controller');
require('controllers/main/admin/security/disable');
http://git-wip-us.apache.org/repos/asf/ambari/blob/dd87511e/ambari-web/app/controllers/global/cluster_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/global/cluster_controller.js b/ambari-web/app/controllers/global/cluster_controller.js
index 17c995b..6107e68 100644
--- a/ambari-web/app/controllers/global/cluster_controller.js
+++ b/ambari-web/app/controllers/global/cluster_controller.js
@@ -321,7 +321,7 @@ App.ClusterController = Em.Controller.extend({
service.StackServices.is_installed = false;
}, self);
App.stackServiceMapper.mapStackServices(data);
- App.config.setPreDefinedServiceConfigs();
+ App.config.setPreDefinedServiceConfigs(true);
var updater = App.router.get('updateController');
self.updateLoadStatus('stackComponents');
updater.updateServices(function () {
http://git-wip-us.apache.org/repos/asf/ambari/blob/dd87511e/ambari-web/app/controllers/global/configuration_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/global/configuration_controller.js b/ambari-web/app/controllers/global/configuration_controller.js
index bacebae..b1d3ff7 100644
--- a/ambari-web/app/controllers/global/configuration_controller.js
+++ b/ambari-web/app/controllers/global/configuration_controller.js
@@ -24,7 +24,9 @@ App.ConfigurationController = Em.Controller.extend({
/**
* get configs by tags
* return Deferred object with configs as argument
- * @param tags
+ * @param tags {Object}
+ * ** siteName
+ * ** tagName (optional)
* @return {object}
*/
getConfigsByTags: function (tags) {
@@ -74,10 +76,34 @@ App.ConfigurationController = Em.Controller.extend({
* @return {Array}
*/
loadFromServer: function (tags) {
- var dfd = $.Deferred();
- var loadedConfigs = [];
var self = this;
+ var dfd = $.Deferred();
+ if (!tags.everyProperty('tagName')) {
+ var configTags;
+ var jqXhr = this.loadConfigTags();
+ jqXhr.done(function (data) {
+ configTags = data.Clusters.desired_configs;
+ tags.forEach(function (_tag) {
+ if (_tag.siteName && !_tag.tagName) {
+ _tag.tagName = configTags[_tag.siteName].tag;
+ }
+ }, self);
+ self.loadConfigsByTags(tags,dfd);
+ });
+ } else {
+ self.loadConfigsByTags(tags,dfd);
+ }
+ return dfd.promise();
+ },
+ /**
+ * loadConfigsByTags: Loads properties for a config tag
+ * @params tags
+ * @params dfd jqXhr promise
+ */
+ loadConfigsByTags: function (tags,dfd) {
+ var self = this;
+ var loadedConfigs = [];
App.config.loadConfigsByTags(tags).done(function (data) {
if (data.items) {
data.items.forEach(function (item) {
@@ -86,10 +112,20 @@ App.ConfigurationController = Em.Controller.extend({
});
}
}).complete(function () {
- self.saveToDB(loadedConfigs);
- dfd.resolve(loadedConfigs);
- });
- return dfd.promise();
+ self.saveToDB(loadedConfigs);
+ dfd.resolve(loadedConfigs);
+ });
+ },
+
+ /**
+ * loadConfigTags: Loads all config tags applied to the cluster
+ * @return: jqXhr promise
+ */
+ loadConfigTags: function () {
+ return App.ajax.send({
+ name: 'config.tags',
+ sender: this
+ });
},
/**
http://git-wip-us.apache.org/repos/asf/ambari/blob/dd87511e/ambari-web/app/controllers/main/admin/highAvailability/nameNode/wizard_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/wizard_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/wizard_controller.js
index dd14232..9fe751a 100644
--- a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/wizard_controller.js
+++ b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/wizard_controller.js
@@ -41,7 +41,8 @@ App.HighAvailabilityWizardController = App.WizardController.extend({
serviceName: 'MISC',
hdfsUser:"hdfs",
nameServiceId: '',
- failedTask : null
+ failedTask : null,
+ requestIds: null
}),
setCurrentStep: function (currentStep, completed) {
http://git-wip-us.apache.org/repos/asf/ambari/blob/dd87511e/ambari-web/app/controllers/main/admin/highAvailability/progress_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/highAvailability/progress_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/progress_controller.js
index 04bdf08..50e8979 100644
--- a/ambari-web/app/controllers/main/admin/highAvailability/progress_controller.js
+++ b/ambari-web/app/controllers/main/admin/highAvailability/progress_controller.js
@@ -19,93 +19,12 @@
var App = require('app');
var installedComponents = [];
-App.HighAvailabilityProgressPageController = App.HighAvailabilityWizardController.extend({
+App.HighAvailabilityProgressPageController = App.HighAvailabilityWizardController.extend(App.wizardProgressPageControllerMixin, {
name: 'highAvailabilityProgressPageController',
-
- status: 'IN_PROGRESS',
clusterDeployState: 'HIGH_AVAILABILITY_DEPLOY',
- tasks: [],
- commands: [],
- currentRequestIds: [], //todo: replace with using requestIds from tasks
- logs: [],
- currentTaskId: null,
- POLL_INTERVAL: 4000,
- isSubmitDisabled: true,
- isRollback: false,
tasksMessagesPrefix: 'admin.highAvailability.wizard.step',
-
- loadStep: function () {
- this.clearStep();
- this.initializeTasks();
- this.loadTasks();
- this.addObserver('tasks.@each.status', this, 'onTaskStatusChange');
- this.onTaskStatusChange();
- },
-
- clearStep: function () {
- this.set('isSubmitDisabled', true);
- this.set('tasks', []);
- this.set('currentRequestIds', []);
- },
-
- initializeTasks: function () {
- var commands = this.get('commands');
- var currentStep = App.router.get(this.get('content.controllerName') + '.currentStep');
- var tasksMessagesPrefix = this.get('tasksMessagesPrefix');
- for (var i = 0; i < commands.length; i++) {
- this.get('tasks').pushObject(Ember.Object.create({
- title: Em.I18n.t(tasksMessagesPrefix + currentStep + '.task' + i + '.title'),
- status: 'PENDING',
- id: i,
- command: commands[i],
- showRetry: false,
- showRollback: false,
- name: Em.I18n.t(tasksMessagesPrefix + currentStep + '.task' + i + '.title'),
- displayName: Em.I18n.t(tasksMessagesPrefix + currentStep + '.task' + i + '.title'),
- progress: 0,
- isRunning: false,
- requestIds: []
- }));
- }
- },
-
- loadTasks: function () {
- var self = this;
- var loadedStatuses = this.get('content.tasksStatuses');
- var loadedRequestIds = this.get('content.tasksRequestIds');
- if (loadedStatuses && loadedStatuses.length === this.get('tasks').length) {
- this.get('tasks').forEach(function (task, i) {
- self.setTaskStatus(task.get('id'), loadedStatuses[i]);
- self.setRequestIds(task.get('id'), loadedRequestIds[i]);
- });
- if (loadedStatuses.contains('IN_PROGRESS')) {
- var curTaskId = this.get('tasks')[loadedStatuses.indexOf('IN_PROGRESS')].get('id');
- this.set('currentRequestIds', this.get('content.requestIds'));
- this.set('currentTaskId', curTaskId);
- this.doPolling();
- } else if (loadedStatuses.contains('QUEUED')) {
- var curTaskId = this.get('tasks')[loadedStatuses.indexOf('QUEUED')].get('id');
- this.set('currentTaskId', curTaskId);
- this.runTask(curTaskId);
- }
- }
- },
-
- setTaskStatus: function (taskId, status) {
- this.get('tasks').findProperty('id', taskId).set('status', status);
- },
-
- setRequestIds: function (taskId, requestIds) {
- this.get('tasks').findProperty('id', taskId).set('requestIds', requestIds);
- },
-
- retryTask: function () {
- var task = this.get('tasks').findProperty('status', 'FAILED');
- task.set('showRetry', false);
- task.set('showRollback', false);
- task.set('status', 'PENDING');
- },
+ isRollback: false,
manualRollback: function () {
App.ModalPopup.show({
@@ -152,241 +71,6 @@ App.HighAvailabilityProgressPageController = App.HighAvailabilityWizardControlle
});
},
- onTaskStatusChange: function () {
- var statuses = this.get('tasks').mapProperty('status');
- var tasksRequestIds = this.get('tasks').mapProperty('requestIds');
- var requestIds = this.get('currentRequestIds');
- // save task info
- App.router.get(this.get('content.controllerName')).saveTasksStatuses(statuses);
- App.router.get(this.get('content.controllerName')).saveTasksRequestIds(tasksRequestIds);
- App.router.get(this.get('content.controllerName')).saveRequestIds(requestIds);
- // call saving of cluster status asynchronous
- // synchronous executing cause problems in Firefox
- App.clusterStatus.setClusterStatus({
- clusterName: this.get('content.cluster.name'),
- clusterState: this.get('clusterDeployState'),
- wizardControllerName: this.get('content.controllerName'),
- localdb: App.db.data
- }, {successCallback: this.statusChangeCallback, sender: this});
- },
- /**
- * Method that called after saving persist data to server.
- * Switch task according its status.
- */
- statusChangeCallback: function () {
- if (!this.get('tasks').someProperty('status', 'IN_PROGRESS') && !this.get('tasks').someProperty('status', 'QUEUED') && !this.get('tasks').someProperty('status', 'FAILED')) {
- var nextTask = this.get('tasks').findProperty('status', 'PENDING');
- if (nextTask) {
- this.set('status', 'IN_PROGRESS');
- this.setTaskStatus(nextTask.get('id'), 'QUEUED');
- this.set('currentTaskId', nextTask.get('id'));
- this.runTask(nextTask.get('id'));
- } else {
- this.set('status', 'COMPLETED');
- this.set('isSubmitDisabled', false);
- }
- } else if (this.get('tasks').someProperty('status', 'FAILED')) {
- this.set('status', 'FAILED');
- this.get('tasks').findProperty('status', 'FAILED').set('showRetry', true);
- if (App.supports.autoRollbackHA) {
- this.get('tasks').findProperty('status', 'FAILED').set('showRollback', true);
- }
- }
- this.get('tasks').filterProperty('status', 'COMPLETED').setEach('showRetry', false);
- this.get('tasks').filterProperty('status', 'COMPLETED').setEach('showRollback', false);
- },
-
- /**
- * Run command of appropriate task
- */
- runTask: function (taskId) {
- this[this.get('tasks').findProperty('id', taskId).get('command')]();
- },
-
- onTaskError: function () {
- this.setTaskStatus(this.get('currentTaskId'), 'FAILED');
- },
-
- onTaskCompleted: function () {
- this.setTaskStatus(this.get('currentTaskId'), 'COMPLETED');
- },
-
- /**
- * check whether component installed on specified hosts
- * @param componentName
- * @param hostNames
- * @return {$.ajax}
- */
- checkInstalledComponents: function (componentName, hostNames) {
- return App.ajax.send({
- name: 'host_component.installed.on_hosts',
- sender: this,
- data: {
- componentName: componentName,
- hostNames: hostNames.join(',')
- },
- success: 'checkInstalledComponentsSuccessCallback'
- });
- },
-
- checkInstalledComponentsSuccessCallback: function (data, opt, params) {
- installedComponents = data.items;
- },
-
- createComponent: function (componentName, hostName, serviceName) {
- var hostNames = (Array.isArray(hostName)) ? hostName : [hostName];
- var self = this;
-
- this.checkInstalledComponents(componentName, hostNames).complete(function () {
- var result = [];
-
- hostNames.forEach(function (hostName) {
- result.push({
- componentName: componentName,
- hostName: hostName,
- hasComponent: installedComponents.someProperty('HostRoles.host_name', hostName)
- });
- });
-
- result.forEach(function (host, index, array) {
- if (!host.hasComponent) {
- App.ajax.send({
- name: 'admin.high_availability.create_component',
- sender: this,
- data: {
- hostName: host.hostName,
- componentName: host.componentName,
- serviceName: serviceName,
- taskNum: array.length
- },
- success: 'onCreateComponent',
- error: 'onCreateComponentError'
- });
- } else {
- // Simulates format returned from ajax.send
- this.onCreateComponent(null, null, {hostName: host.hostName, componentName: host.componentName, taskNum: array.length});
- }
- }, self)
- });
- },
-
- onCreateComponent: function () {
- var hostName = arguments[2].hostName;
- var componentName = arguments[2].componentName;
- var taskNum = arguments[2].taskNum;
- var serviceName = arguments[2].serviceName;
- this.updateComponent(componentName, hostName, serviceName, "Install", taskNum);
- },
-
- onCreateComponentError: function (error) {
- if (error.responseText.indexOf('org.apache.ambari.server.controller.spi.ResourceAlreadyExistsException') !== -1) {
- this.onCreateComponent();
- } else {
- this.onTaskError();
- }
- },
-
- updateComponent: function (componentName, hostName, serviceName, context, taskNum) {
- if (!(hostName instanceof Array)) {
- hostName = [hostName];
- }
- var state = context.toLowerCase() == "start" ? "STARTED" : "INSTALLED";
- for (var i = 0; i < hostName.length; i++) {
- App.ajax.send({
- name: 'common.host.host_component.update',
- sender: this,
- data: {
- context: context + " " + App.format.role(componentName),
- hostName: hostName[i],
- serviceName: serviceName,
- componentName: componentName,
- taskNum: taskNum || hostName.length,
- HostRoles: {
- state: state
- }
- },
- success: 'startPolling',
- error: 'onTaskError'
- });
- }
- },
-
- startPolling: function (data) {
- if (data) {
- this.get('currentRequestIds').push(data.Requests.id);
- var tasksCount = arguments[2].taskNum || 1;
- if (tasksCount === this.get('currentRequestIds').length) {
- this.setRequestIds(this.get('currentTaskId'), this.get('currentRequestIds'));
- this.doPolling();
- }
- } else {
- this.onTaskCompleted();
- }
- },
-
- doPolling: function () {
- this.setTaskStatus(this.get('currentTaskId'), 'IN_PROGRESS');
- var requestIds = this.get('currentRequestIds');
- this.set('logs', []);
- for (var i = 0; i < requestIds.length; i++) {
- App.ajax.send({
- name: 'admin.high_availability.polling',
- sender: this,
- data: {
- requestId: requestIds[i]
- },
- success: 'parseLogs',
- error: 'onTaskError'
- });
- }
- },
-
- parseLogs: function (logs) {
- this.get('logs').pushObject(logs.tasks);
- if (this.get('currentRequestIds').length === this.get('logs').length) {
- var tasks = [];
- this.get('logs').forEach(function (logs) {
- tasks.pushObjects(logs);
- }, this);
- var self = this;
- var currentTaskId = this.get('currentTaskId');
- if (!tasks.someProperty('Tasks.status', 'PENDING') && !tasks.someProperty('Tasks.status', 'QUEUED') && !tasks.someProperty('Tasks.status', 'IN_PROGRESS')) {
- this.set('currentRequestIds', []);
- if (tasks.someProperty('Tasks.status', 'FAILED') || tasks.someProperty('Tasks.status', 'TIMEDOUT') || tasks.someProperty('Tasks.status', 'ABORTED')) {
- this.setTaskStatus(currentTaskId, 'FAILED');
- } else {
- this.setTaskStatus(currentTaskId, 'COMPLETED');
- }
- } else {
- var actionsPerHost = tasks.length;
- var completedActions = tasks.filterProperty('Tasks.status', 'COMPLETED').length
- + tasks.filterProperty('Tasks.status', 'FAILED').length
- + tasks.filterProperty('Tasks.status', 'ABORTED').length
- + tasks.filterProperty('Tasks.status', 'TIMEDOUT').length;
- var queuedActions = tasks.filterProperty('Tasks.status', 'QUEUED').length;
- var inProgressActions = tasks.filterProperty('Tasks.status', 'IN_PROGRESS').length;
- var progress = Math.ceil(((queuedActions * 0.09) + (inProgressActions * 0.35) + completedActions ) / actionsPerHost * 100);
- this.get('tasks').findProperty('id', currentTaskId).set('progress', progress);
- window.setTimeout(function () {
- self.doPolling()
- }, self.POLL_INTERVAL);
- }
- }
- },
-
- showHostProgressPopup: function (event) {
- var popupTitle = event.contexts[0].title;
- var requestIds = event.contexts[0].requestIds;
- var hostProgressPopupController = App.router.get('highAvailabilityProgressPopupController');
- hostProgressPopupController.initPopup(popupTitle, requestIds, this, true);
- },
-
- done: function () {
- if (!this.get('isSubmitDisabled')) {
- this.removeObserver('tasks.@each.status', this, 'onTaskStatusChange');
- App.router.send('next');
- }
- },
/**
*
* @param siteNames Array
http://git-wip-us.apache.org/repos/asf/ambari/blob/dd87511e/ambari-web/app/controllers/main/admin/kerberos.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/kerberos.js b/ambari-web/app/controllers/main/admin/kerberos.js
new file mode 100644
index 0000000..701e6db
--- /dev/null
+++ b/ambari-web/app/controllers/main/admin/kerberos.js
@@ -0,0 +1,95 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+var App = require('app');
+App.MainAdminKerberosController = Em.Controller.extend({
+ name: 'mainAdminKerberosController',
+ securityEnabled: false,
+ dataIsLoaded: false,
+ isRecommendedLoaded: true,
+ getAddSecurityWizardStatus: function () {
+ return App.db.getSecurityWizardStatus();
+ },
+ setAddSecurityWizardStatus: function (status) {
+ App.db.setSecurityWizardStatus(status);
+ },
+
+ setDisableSecurityStatus: function (status) {
+ App.db.setDisableSecurityStatus(status);
+ },
+ getDisableSecurityStatus: function (status) {
+ return App.db.getDisableSecurityStatus();
+ },
+
+ notifySecurityOff: false,
+ notifySecurityAdd: false,
+
+ notifySecurityOffPopup: function () {
+ var self = this;
+ App.ModalPopup.show({
+ header: Em.I18n.t('popup.confirmation.commonHeader'),
+ primary: Em.I18n.t('ok'),
+ onPrimary: function () {
+ App.db.setSecurityDeployCommands(undefined);
+ self.setDisableSecurityStatus("RUNNING");
+ App.router.transitionTo('disableSecurity');
+ this.hide();
+ },
+ bodyClass: Ember.View.extend({
+ isMapReduceInstalled: App.Service.find().mapProperty('serviceName').contains('MAPREDUCE'),
+ templateName: require('templates/main/admin/security/notify_security_off_popup')
+ })
+ })
+ },
+
+ getUpdatedSecurityStatus: function () {
+ this.setSecurityStatus();
+ return this.get('securityEnabled');
+ },
+
+ startKerberosWizard: function () {
+ this.setAddSecurityWizardStatus('RUNNING');
+ App.router.transitionTo('adminAddKerberos');
+ },
+
+ /**
+ * Loads the security status from server (security_enabled property in cluster-env configuration)
+ */
+ loadSecurityStatusFromServer: function () {
+ if (App.get('testMode')) {
+ this.set('securityEnabled', !App.get('testEnableSecurity'));
+ this.set('dataIsLoaded', true);
+ } else {
+ //get Security Status From Server
+ var self = this;
+ var tags = [{siteName: 'cluster-env'}];
+ App.router.get('configurationController').getConfigsByTags(tags).done(function (data) {
+ var configs = data[0].properties;
+ if (configs) {
+ self.set('securityEnabled', configs['security_enabled'] === 'true');
+ }
+ self.set('dataIsLoaded', true);
+ });
+ }
+ }
+});
+
+
+
+
http://git-wip-us.apache.org/repos/asf/ambari/blob/dd87511e/ambari-web/app/controllers/main/admin/kerberos/progress_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/kerberos/progress_controller.js b/ambari-web/app/controllers/main/admin/kerberos/progress_controller.js
new file mode 100644
index 0000000..365821b
--- /dev/null
+++ b/ambari-web/app/controllers/main/admin/kerberos/progress_controller.js
@@ -0,0 +1,25 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+App.KerberosProgressPageController = App.KerberosWizardController.extend(App.wizardProgressPageControllerMixin, {
+
+ name: 'kerberosProgressPageController',
+ clusterDeployState: 'KERBEROS__DEPLOY',
+ tasksMessagesPrefix: 'admin.kerberos.wizard.step',
+ isRollback: false
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/dd87511e/ambari-web/app/controllers/main/admin/kerberos/step1_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/kerberos/step1_controller.js b/ambari-web/app/controllers/main/admin/kerberos/step1_controller.js
new file mode 100644
index 0000000..e3c4a89
--- /dev/null
+++ b/ambari-web/app/controllers/main/admin/kerberos/step1_controller.js
@@ -0,0 +1,82 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var App = require('app');
+
+App.KerberosWizardStep1Controller = Em.Controller.extend({
+ name: "kerberosWizardStep1Controller",
+
+ selectedItem: Em.I18n.t('admin.kerberos.wizard.step1.option.kdc'),
+
+ isSubmitDisabled: function() {
+ return this.get('selectedOption.preConditions').someProperty('checked',false);
+ }.property('selectedOption', 'selectedOption.preConditions.@each.checked'),
+
+ options: [
+ Em.Object.create({
+ displayName: Em.I18n.t('admin.kerberos.wizard.step1.option.kdc'),
+ value: Em.I18n.t('admin.kerberos.wizard.step1.option.kdc'),
+ preConditions: [
+ Em.Object.create({
+ displayText: Em.I18n.t('admin.kerberos.wizard.step1.option.kdc.condition.1'),
+ checked: false
+ }),
+ Em.Object.create({
+ displayText: Em.I18n.t('admin.kerberos.wizard.step1.option.kdc.condition.2'),
+ checked: false
+ })
+ ]
+ }),
+ Em.Object.create({
+ displayName: Em.I18n.t('admin.kerberos.wizard.step1.option.ad'),
+ value: Em.I18n.t('admin.kerberos.wizard.step1.option.ad'),
+ preConditions: [
+ Em.Object.create({
+ displayText: Em.I18n.t('admin.kerberos.wizard.step1.option.ad.condition.1'),
+ checked: false
+ }),
+ Em.Object.create({
+ displayText: Em.I18n.t('admin.kerberos.wizard.step1.option.ad.condition.2'),
+ checked: false
+ })
+ ]
+ })
+ ],
+
+ /**
+ * precondition for the selected KDC option
+ */
+ selectedOption: function () {
+ var options = this.get('options');
+ var selectedItem = this.get('selectedItem');
+ return options.findProperty('value', selectedItem);
+ }.property('selectedItem'),
+
+
+
+ loadStep: function () {
+ this.set('selectedItem', Em.I18n.t('admin.kerberos.wizard.step1.option.kdc'));
+ },
+
+ next: function () {
+ if (!this.get('isSubmitDisabled')) {
+ App.router.send('next');
+ }
+ }
+});
+
http://git-wip-us.apache.org/repos/asf/ambari/blob/dd87511e/ambari-web/app/controllers/main/admin/kerberos/step2_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/kerberos/step2_controller.js b/ambari-web/app/controllers/main/admin/kerberos/step2_controller.js
new file mode 100644
index 0000000..f674f4a
--- /dev/null
+++ b/ambari-web/app/controllers/main/admin/kerberos/step2_controller.js
@@ -0,0 +1,164 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var App = require('app');
+require('controllers/wizard/step7_controller');
+
+App.KerberosWizardStep2Controller = App.WizardStep7Controller.extend({
+ name: "kerberosWizardStep2Controller",
+ isKerberosWizard: true,
+
+ selectedServiceNames: ['KERBEROS'],
+
+ allSelectedServiceNames: ['KERBEROS'],
+
+ installedServiceNames: [],
+
+ servicesInstalled: false,
+
+ addMiscTabToPage: false,
+
+ hostNames: function() {
+ return this.get('content.hosts');
+ }.property('content.hosts'),
+
+ serviceConfigTags: [],
+
+
+ clearStep: function () {
+ this._super();
+ this.get('serviceConfigTags').clear();
+ this.set('servicesInstalled', false);
+ },
+
+
+ /**
+ * On load function
+ * @method loadStep
+ */
+ loadStep: function () {
+ console.log("TRACE: Loading step7: Configure Services");
+ this.clearStep();
+ var kerberosStackService = App.StackService.find().findProperty('serviceName', 'KERBEROS');
+ if (!kerberosStackService) return;
+ //STEP 1: Load advanced configs
+ var advancedConfigs = this.get('content.advancedServiceConfig');
+ //STEP 2: Load on-site configs by service from local DB
+ var storedConfigs = this.get('content.serviceConfigProperties');
+ //STEP 3: Merge pre-defined configs with loaded on-site configs
+ var configs = App.config.mergePreDefinedWithStored(
+ storedConfigs,
+ advancedConfigs,
+ this.get('selectedServiceNames'));
+ App.config.setPreDefinedServiceConfigs(this.get('addMiscTabToPage'));
+ //STEP 4: Add advanced configs
+ App.config.addAdvancedConfigs(configs, advancedConfigs);
+ this.applyServicesConfigs(configs, storedConfigs);
+ },
+
+ submit: function () {
+ this.set('isSubmitDisabled', true);
+ var self = this;
+ this.deleteKerberosService().always(function (data) {
+ self.createKerberosResources();
+ });
+ },
+
+ createKerberosResources: function () {
+ var self = this;
+ this.createKerberosService().done(function() {
+ self.createConfigurations().done(function() {
+ App.router.send('next');
+ });
+ });
+ },
+
+ /**
+ * Delete Kerberos service if it exists
+ */
+ deleteKerberosService: function () {
+ var serviceName = this.selectedServiceNames[0];
+ return App.ajax.send({
+ name: 'common.delete.service',
+ sender: this,
+ data: {
+ serviceName: serviceName
+ }
+ });
+ },
+
+ createKerberosService: function () {
+ return App.ajax.send({
+ name: 'wizard.step8.create_selected_services',
+ sender: this,
+ data: {
+ data: '{"ServiceInfo": { "service_name": "KERBEROS"}}',
+ cluster: App.get('clusterName') || App.clusterStatus.get('clusterName')
+ }
+ });
+ },
+
+ createConfigurations: function () {
+ var service = App.StackService.find().findProperty('serviceName', 'KERBEROS');
+ var serviceConfigTags = [];
+ var tag = 'version' + (new Date).getTime();
+ Object.keys(service.get('configTypes')).forEach(function (type) {
+ if (!serviceConfigTags.someProperty('type', type)) {
+ var obj = this.createKerberosSiteObj(type, tag);
+ obj.service_config_version_note = Em.I18n.t('admin.kerberos.wizard.configuration.note');
+ serviceConfigTags.pushObject(obj);
+ }
+ }, this);
+ var allConfigData = [];
+ var serviceConfigData = [];
+ Object.keys(service.get('configTypesRendered')).forEach(function (type) {
+ var serviceConfigTag = serviceConfigTags.findProperty('type', type);
+ if (serviceConfigTag) {
+ serviceConfigData.pushObject(serviceConfigTag);
+ }
+ }, this);
+ if (serviceConfigData.length) {
+ allConfigData.pushObject(JSON.stringify({
+ Clusters: {
+ desired_config: serviceConfigData
+ }
+ }));
+ }
+ return App.ajax.send({
+ name: 'common.across.services.configurations',
+ sender: this,
+ data: {
+ data: '[' + allConfigData.toString() + ']'
+ }
+ });
+ },
+
+ createKerberosSiteObj: function (site, tag) {
+ var properties = {};
+ var content = this.get('stepConfigs')[0].get('configs');
+ var configs = content.filterProperty('filename', site + '.xml');
+ configs.forEach(function (_configProperty) {
+ // do not pass any globals whose name ends with _host or _hosts
+ if (_configProperty.isRequiredByAgent !== false) {
+ properties[_configProperty.name] = _configProperty.value;
+ }
+ }, this);
+ return {"type": site, "tag": tag, "properties": properties};
+ }
+});
+
http://git-wip-us.apache.org/repos/asf/ambari/blob/dd87511e/ambari-web/app/controllers/main/admin/kerberos/step3_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/kerberos/step3_controller.js b/ambari-web/app/controllers/main/admin/kerberos/step3_controller.js
new file mode 100644
index 0000000..3a4fdbd
--- /dev/null
+++ b/ambari-web/app/controllers/main/admin/kerberos/step3_controller.js
@@ -0,0 +1,59 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+App.KerberosWizardStep3Controller = App.KerberosProgressPageController.extend({
+ name: 'kerberosWizardStep3Controller',
+ clusterDeployState: 'KERBEROS_DEPLOY',
+ serviceName: 'KERBEROS',
+ componentName: 'KERBEROS_CLIENT',
+
+ commands: ['installKerberos', 'testKerberos'],
+
+ installKerberos: function() {
+ App.ajax.send({
+ name: 'common.create_component',
+ sender: this,
+ data: {
+ serviceName: this.serviceName,
+ componentName: this.componentName
+ },
+ success: 'onKerberosCreate',
+ error: 'onKerberosCreate'
+ });
+ },
+
+ onKerberosCreate: function() {
+ var hostNames = this.get('content.hosts');
+ this.createComponent(this.componentName, hostNames, this.serviceName);
+ },
+
+ testKerberos: function() {
+ App.ajax.send({
+ 'name': 'service.item.smoke',
+ 'sender': this,
+ 'success': 'startPolling',
+ 'error': 'onTaskError',
+ 'data': {
+ 'serviceName': this.serviceName,
+ 'displayName': App.format.role(this.serviceName),
+ 'actionName': this.serviceName + '_SERVICE_CHECK'
+ }
+ });
+ }
+});
+
http://git-wip-us.apache.org/repos/asf/ambari/blob/dd87511e/ambari-web/app/controllers/main/admin/kerberos/step4_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/kerberos/step4_controller.js b/ambari-web/app/controllers/main/admin/kerberos/step4_controller.js
new file mode 100644
index 0000000..216d934
--- /dev/null
+++ b/ambari-web/app/controllers/main/admin/kerberos/step4_controller.js
@@ -0,0 +1,22 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+App.KerberosWizardStep4Controller = Em.Controller.extend({
+ name: 'kerberosWizardStep4Controller'
+});
+
http://git-wip-us.apache.org/repos/asf/ambari/blob/dd87511e/ambari-web/app/controllers/main/admin/kerberos/step5_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/kerberos/step5_controller.js b/ambari-web/app/controllers/main/admin/kerberos/step5_controller.js
new file mode 100644
index 0000000..b15c8cf
--- /dev/null
+++ b/ambari-web/app/controllers/main/admin/kerberos/step5_controller.js
@@ -0,0 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+App.KerberosWizardStep5Controller = Em.Controller.extend({
+ name: 'kerberosWizardStep5Controller'
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/dd87511e/ambari-web/app/controllers/main/admin/kerberos/step6_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/kerberos/step6_controller.js b/ambari-web/app/controllers/main/admin/kerberos/step6_controller.js
new file mode 100644
index 0000000..800e0c8
--- /dev/null
+++ b/ambari-web/app/controllers/main/admin/kerberos/step6_controller.js
@@ -0,0 +1,25 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+App.KerberosWizardStep6Controller = App.KerberosProgressPageController.extend({
+ name: 'kerberosWizardStep6Controller',
+ clusterDeployState: 'KERBEROS_DEPLOY',
+ commands: ['stopServices','startServices']
+});
+
+
http://git-wip-us.apache.org/repos/asf/ambari/blob/dd87511e/ambari-web/app/controllers/main/admin/kerberos/wizard_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/kerberos/wizard_controller.js b/ambari-web/app/controllers/main/admin/kerberos/wizard_controller.js
new file mode 100644
index 0000000..fd8e119
--- /dev/null
+++ b/ambari-web/app/controllers/main/admin/kerberos/wizard_controller.js
@@ -0,0 +1,220 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+var App = require('app');
+
+App.KerberosWizardController = App.WizardController.extend({
+
+ name: 'kerberosWizardController',
+
+ totalSteps: 6,
+
+ isKerberosWizard: true,
+
+ /**
+ * Used for hiding back button in wizard
+ */
+ hideBackButton: true,
+
+ content: Em.Object.create({
+ controllerName: 'kerberosWizardController',
+ serviceName: 'KERBEROS',
+ hosts: '',
+ kerberosOption: null,
+ cluster: null,
+ services: null,
+ advancedServiceConfig: null,
+ serviceConfigProperties: [],
+ failedTask: null
+ }),
+
+ setCurrentStep: function (currentStep, completed) {
+ this._super(currentStep, completed);
+ if (App.testMode) {
+ return;
+ }
+ App.clusterStatus.setClusterStatus({
+ clusterName: this.get('content.cluster.name'),
+ clusterState: 'KERBEROS_DEPLOY',
+ wizardControllerName: 'kerberosWizardController',
+ localdb: App.db.data
+ });
+ },
+
+ /**
+ * return new object extended from clusterStatusTemplate
+ * @return Object
+ */
+ getCluster: function () {
+ return jQuery.extend({}, this.get('clusterStatusTemplate'), {name: App.router.getClusterName()});
+ },
+
+ /**
+ * save status of the cluster.
+ * @param clusterStatus object with status,requestId fields.
+ */
+ saveClusterStatus: function (clusterStatus) {
+ var oldStatus = this.toObject(this.get('content.cluster'));
+ clusterStatus = jQuery.extend(oldStatus, clusterStatus);
+ if (clusterStatus.requestId) {
+ clusterStatus.requestId.forEach(function (requestId) {
+ if (clusterStatus.oldRequestsId.indexOf(requestId) === -1) {
+ clusterStatus.oldRequestsId.push(requestId)
+ }
+ }, this);
+ }
+ this.set('content.cluster', clusterStatus);
+ this.save('cluster');
+ },
+
+
+ saveTasksStatuses: function (statuses) {
+ this.setDBProperty('tasksStatuses',statuses);
+ this.set('content.tasksStatuses', statuses);
+ },
+
+ saveConfigTag: function (tag) {
+ App.db.setKerberosWizardConfigTag(tag);
+ this.set('content.' + [tag.name], tag.value);
+ },
+
+ saveKerberosOption: function (stepController) {
+ this.setDBProperty('kerberosOption', stepController.get('selectedItem'));
+ this.set('content.kerberosOption', stepController.get('selectedItem'));
+ },
+
+ loadConfigTag: function (tag) {
+ var tagVal = App.db.getKerberosWizardConfigTag(tag);
+ this.set('content.' + tag, tagVal);
+ },
+
+
+ loadTasksStatuses: function () {
+ var statuses = this.getDBProperty('tasksStatuses');
+ this.set('content.tasksStatuses', statuses);
+ },
+
+ /**
+ * Load serviceConfigProperties to model
+ */
+ loadServiceConfigProperties: function () {
+ var serviceConfigProperties = this.getDBProperty('serviceConfigProperties');
+ this.set('content.serviceConfigProperties', serviceConfigProperties);
+ },
+
+ /**
+ * load advanced configs from server
+ */
+ loadAdvancedConfigs: function (dependentController) {
+ var self = this;
+ var loadAdvancedConfigResult = [];
+ dependentController.set('isAdvancedConfigLoaded', false);
+ var serviceName = this.get('content.serviceName');
+ App.config.loadAdvancedConfig(serviceName, function (properties) {
+ loadAdvancedConfigResult.pushObjects(properties);
+ self.set('content.advancedServiceConfig', loadAdvancedConfigResult);
+ self.setDBProperty('advancedServiceConfig', loadAdvancedConfigResult);
+ dependentController.set('isAdvancedConfigLoaded', true);
+ });
+ },
+
+
+ saveRequestIds: function (requestIds) {
+ this.setDBProperty('requestIds',requestIds);
+ this.set('content.requestIds', requestIds);
+ },
+
+ loadKerberosOption: function () {
+ this.set('content.kerberosOption', this.getDBProperty('kerberosOption'));
+ },
+
+ loadRequestIds: function () {
+ var requestIds = this.getDBProperty('requestIds');
+ this.set('content.requestIds', requestIds);
+ },
+
+ saveTasksRequestIds: function (requestIds) {
+ this.setDBProperty('tasksRequestIds',requestIds);
+ this.set('content.tasksRequestIds', requestIds);
+ },
+
+ loadTasksRequestIds: function () {
+ var requestIds = this.getDBProperty('tasksRequestIds');
+ this.set('content.tasksRequestIds', requestIds);
+ },
+
+ loadMap: {
+ '1': [
+ {
+ type: 'sync',
+ callback: function () {
+ this.loadKerberosOption();
+ }
+ }
+ ],
+ '2': [
+ {
+ type: 'sync',
+ callback: function () {
+ var kerberosStep2controller = App.router.get('kerberosWizardStep2Controller');
+ this.loadAdvancedConfigs(kerberosStep2controller);
+ this.loadServiceConfigProperties();
+ this.load('hosts');
+ }
+ }
+ ],
+ '3': [
+ {
+ type: 'sync',
+ callback: function () {
+ this.loadTasksStatuses();
+ this.loadTasksRequestIds();
+ this.loadRequestIds();
+ }
+ }
+ ]
+ },
+
+ /**
+ * Remove all loaded data.
+ * Created as copy for App.router.clearAllSteps
+ */
+ clearAllSteps: function () {
+ this.clearInstallOptions();
+ // clear temporary information stored during the install
+ this.set('content.cluster', this.getCluster());
+ },
+
+ clearTasksData: function () {
+ this.saveTasksStatuses(undefined);
+ this.saveRequestIds(undefined);
+ this.saveTasksRequestIds(undefined);
+ },
+
+ /**
+ * Clear all temporary data
+ */
+ finish: function () {
+ // The in-memory variable for currentstep should be reset to 1st step.
+ this.setCurrentStep('1');
+ // kerberos wizard namespace in the localStorage should be emptied
+ this.resetDbNamespace();
+ App.router.get('updateController').updateAll();
+ }
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/dd87511e/ambari-web/app/controllers/wizard/step7_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step7_controller.js b/ambari-web/app/controllers/wizard/step7_controller.js
index 88a3b5f..0e5b7dc 100644
--- a/ambari-web/app/controllers/wizard/step7_controller.js
+++ b/ambari-web/app/controllers/wizard/step7_controller.js
@@ -41,6 +41,8 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, {
slaveHostToGroup: null,
+ addMiscTabToPage: true,
+
/**
* Is Submit-click processing now
* @type {bool}
@@ -623,7 +625,7 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, {
advancedConfigs,
this.get('selectedServiceNames').concat(this.get('installedServiceNames'))
);
- App.config.setPreDefinedServiceConfigs();
+ App.config.setPreDefinedServiceConfigs(this.get('addMiscTabToPage'));
//STEP 4: Add advanced configs
App.config.addAdvancedConfigs(configs, advancedConfigs);
//STEP 5: Add custom configs
@@ -670,7 +672,9 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, {
* @method checkHostOverrideInstaller
*/
checkHostOverrideInstaller: function () {
- this.loadConfigGroups(this.get('content.configGroups'));
+ if (this.get('wizardController.name') !== 'kerberosWizardController') {
+ this.loadConfigGroups(this.get('content.configGroups'));
+ }
if (this.get('installedServiceNames').length > 0) {
this.loadInstalledServicesConfigGroups(this.get('installedServiceNames'));
}
@@ -887,15 +891,15 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, {
});
serviceNames.forEach(function (serviceName) {
var propertyPrefix = serviceName.toLowerCase();
- if(/HDFS/gi.test(serviceName)) propertyPrefix = 'sink';
+ if (/HDFS/gi.test(serviceName)) propertyPrefix = 'sink';
var dbTypeConfig = configs.findProperty('name', propertyPrefix + '_database');
if (!/existing/gi.test(dbTypeConfig.value)) return;
var dbHostName = propertyPrefix + '_hostname';
var database = dbTypeConfig.value.match(/MySQL|PostgreSQL|Oracle|Derby|MSSQL/gi)[0];
var dbPrefix = database.toLowerCase();
- if(database.toLowerCase() == 'mssql') {
+ if (database.toLowerCase() == 'mssql') {
dbHostName = 'sink.dbservername';
- if(/integrated/gi.test(dbTypeConfig.value)) {
+ if (/integrated/gi.test(dbTypeConfig.value)) {
dbPrefix = 'mssql_server';
} else {
dbPrefix = 'mssql_server_2';
@@ -1127,12 +1131,19 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, {
* @method activateSpecialConfigs
*/
activateSpecialConfigs: function () {
- var miscConfigs = this.get('stepConfigs').findProperty('serviceName', 'MISC').configs;
- if (this.get('wizardController.name') == "addServiceController") {
- miscConfigs.findProperty('name', 'smokeuser').set('value', this.get('content.smokeuser')).set('isEditable', false);
- miscConfigs.findProperty('name', 'user_group').set('value', this.get('content.group')).set('isEditable', false);
+ if (this.get('addMiscTabToPage')) {
+ var miscConfigs = this.get('stepConfigs').findProperty('serviceName', 'MISC').configs;
+ if (this.get('wizardController.name') == "addServiceController") {
+ miscConfigs.findProperty('name', 'smokeuser').set('value', this.get('content.smokeuser')).set('isEditable', false);
+ miscConfigs.findProperty('name', 'user_group').set('value', this.get('content.group')).set('isEditable', false);
+ }
+ App.config.miscConfigVisibleProperty(miscConfigs, this.get('selectedServiceNames'));
+ }
+ var wizardController = this.get('wizardController');
+ if (wizardController.get('name') === "kerberosWizardController") {
+ var kerberosConfigs = this.get('stepConfigs').findProperty('serviceName', 'KERBEROS').configs;
+ kerberosConfigs.findProperty('name', 'kdc_type').set('value', wizardController.get('content.kerberosOption'));
}
- App.config.miscConfigVisibleProperty(miscConfigs, this.get('selectedServiceNames'));
},
/**