You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by sr...@apache.org on 2014/12/04 21:19:29 UTC
[2/2] ambari git commit: AMBARI-8417. Move master components related
to Hive, Oozie (Szilard Nemethy via srimanth)
AMBARI-8417. Move master components related to Hive, Oozie (Szilard Nemethy via srimanth)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/53013484
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/53013484
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/53013484
Branch: refs/heads/trunk
Commit: 53013484a3293a32cfa1eadbd7d771d19bd645a2
Parents: 472206f
Author: Srimanth Gunturi <sg...@hortonworks.com>
Authored: Thu Dec 4 12:18:58 2014 -0800
Committer: Srimanth Gunturi <sg...@hortonworks.com>
Committed: Thu Dec 4 12:18:58 2014 -0800
----------------------------------------------------------------------
.../apache/ambari/server/utils/StageUtils.java | 1 +
.../stacks/HDP/2.0.6/services/HIVE/metainfo.xml | 14 +-
.../services/HIVE/package/files/addMysqlUser.sh | 16 +-
.../HIVE/package/files/removeMysqlUser.sh | 32 ++
.../HIVE/package/scripts/mysql_server.py | 36 +-
.../HIVE/package/scripts/mysql_users.py | 65 ++++
.../services/HIVE/package/scripts/params.py | 2 +
.../stacks/2.0.6/HIVE/test_mysql_server.py | 50 ++-
.../2.0.6/configs/default.hbasedecom.json | 2 +-
.../python/stacks/2.0.6/configs/default.json | 2 +-
.../2.0.6/configs/default.non_gmetad_host.json | 2 +-
.../stacks/2.0.6/configs/default_client.json | 2 +-
.../stacks/2.0.6/configs/flume_target.json | 2 +-
.../python/stacks/2.0.6/configs/secured.json | 2 +-
.../stacks/2.0.6/configs/secured_client.json | 2 +-
.../2.0.6/configs/secured_no_jce_name.json | 2 +-
ambari-web/app/controllers.js | 1 +
.../highAvailability/progress_controller.js | 1 -
.../controllers/main/service/info/configs.js | 1 +
.../main/service/reassign/step1_controller.js | 85 ++++-
.../main/service/reassign/step4_controller.js | 355 ++++++++++++++++++-
.../main/service/reassign/step7_controller.js | 90 +++++
.../main/service/reassign_controller.js | 33 +-
ambari-web/app/data/HDP2/site_properties.js | 2 +-
ambari-web/app/messages.js | 43 +++
ambari-web/app/models/service/flume.js | 4 +-
.../app/models/stack_service_component.js | 5 +-
ambari-web/app/routes/reassign_master_routes.js | 72 +++-
.../main/admin/highAvailability/progress.hbs | 5 +-
.../templates/main/service/reassign/step1.hbs | 5 +
.../templates/main/service/reassign/step7.hbs | 18 +
ambari-web/app/utils/ajax/ajax.js | 68 ++++
ambari-web/app/views.js | 1 +
.../admin/highAvailability/progress_view.js | 66 +++-
.../views/main/service/reassign/step1_view.js | 12 +
.../views/main/service/reassign/step5_view.js | 2 +-
.../views/main/service/reassign/step7_view.js | 43 +++
.../app/views/main/service/reassign_view.js | 32 ++
ambari-web/app/views/wizard/controls_view.js | 41 +--
.../service/reassign/step4_controller_test.js | 90 ++++-
.../main/service/reassign_controller_test.js | 2 +-
.../test/models/stack_service_component_test.js | 4 +-
42 files changed, 1186 insertions(+), 127 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/53013484/ambari-server/src/main/java/org/apache/ambari/server/utils/StageUtils.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/utils/StageUtils.java b/ambari-server/src/main/java/org/apache/ambari/server/utils/StageUtils.java
index 5cd67f5..e6e51a1 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/utils/StageUtils.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/utils/StageUtils.java
@@ -116,6 +116,7 @@ public class StageUtils {
componentToClusterInfoKeyMap.put("HBASE_MASTER", "hbase_master_hosts");
componentToClusterInfoKeyMap.put("HBASE_REGIONSERVER", "hbase_rs_hosts");
componentToClusterInfoKeyMap.put("HIVE_SERVER", "hive_server_host");
+ componentToClusterInfoKeyMap.put("HIVE_METASTORE", "hive_metastore_host");
componentToClusterInfoKeyMap.put("OOZIE_SERVER", "oozie_server");
componentToClusterInfoKeyMap.put("WEBHCAT_SERVER", "webhcat_server_host");
componentToClusterInfoKeyMap.put("MYSQL_SERVER", "hive_mysql_host");
http://git-wip-us.apache.org/repos/asf/ambari/blob/53013484/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/metainfo.xml
index 1b30a95..26edb84 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/metainfo.xml
@@ -155,6 +155,16 @@
<script>scripts/mysql_server.py</script>
<scriptType>PYTHON</scriptType>
</commandScript>
+ <customCommands>
+ <customCommand>
+ <name>CLEAN</name>
+ <commandScript>
+ <script>scripts/mysql_server.py</script>
+ <scriptType>PYTHON</scriptType>
+ <timeout>600</timeout>
+ </commandScript>
+ </customCommand>
+ </customCommands>
</component>
<component>
@@ -186,7 +196,7 @@
<type>env</type>
<fileName>hive-exec-log4j.properties</fileName>
<dictionaryName>hive-exec-log4j</dictionaryName>
- </configFile>
+ </configFile>
</configFiles>
<configuration-dependencies>
<config-type>hive-site</config-type>
@@ -265,7 +275,7 @@
<scriptType>PYTHON</scriptType>
<timeout>300</timeout>
</commandScript>
-
+
<requiredServices>
<service>ZOOKEEPER</service>
<service>YARN</service>
http://git-wip-us.apache.org/repos/asf/ambari/blob/53013484/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/files/addMysqlUser.sh
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/files/addMysqlUser.sh b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/files/addMysqlUser.sh
index bd00c1f..d3ae6e4 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/files/addMysqlUser.sh
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/files/addMysqlUser.sh
@@ -23,19 +23,11 @@
mysqldservice=$1
mysqldbuser=$2
mysqldbpasswd=$3
-mysqldbhost=$4
-myhostname=$(hostname -f)
+userhost=$4
service $mysqldservice start
-echo "Adding user $mysqldbuser@$mysqldbhost and $mysqldbuser@localhost"
-mysql -u root -e "CREATE USER '$mysqldbuser'@'$mysqldbhost' IDENTIFIED BY '$mysqldbpasswd';"
-mysql -u root -e "CREATE USER '$mysqldbuser'@'localhost' IDENTIFIED BY '$mysqldbpasswd';"
-mysql -u root -e "GRANT ALL PRIVILEGES ON *.* TO '$mysqldbuser'@'$mysqldbhost';"
-mysql -u root -e "GRANT ALL PRIVILEGES ON *.* TO '$mysqldbuser'@'localhost';"
-if [ '$(mysql -u root -e "select user from mysql.user where user='$mysqldbuser' and host='$myhostname'" | grep "$mysqldbuser")' != '0' ]; then
- echo "Adding user $mysqldbuser@$myhostname";
- mysql -u root -e "CREATE USER '$mysqldbuser'@'$myhostname' IDENTIFIED BY '$mysqldbpasswd';";
- mysql -u root -e "GRANT ALL PRIVILEGES ON *.* TO '$mysqldbuser'@'$myhostname';";
-fi
+echo "Adding user $mysqldbuser@$userhost and $mysqldbuser@localhost"
+mysql -u root -e "CREATE USER '$mysqldbuser'@'$userhost' IDENTIFIED BY '$mysqldbpasswd';"
+mysql -u root -e "GRANT ALL PRIVILEGES ON *.* TO '$mysqldbuser'@'$userhost';"
mysql -u root -e "flush privileges;"
service $mysqldservice stop
http://git-wip-us.apache.org/repos/asf/ambari/blob/53013484/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/files/removeMysqlUser.sh
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/files/removeMysqlUser.sh b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/files/removeMysqlUser.sh
new file mode 100644
index 0000000..924bde3
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/files/removeMysqlUser.sh
@@ -0,0 +1,32 @@
+#!/usr/bin/env bash
+#
+#
+# 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.
+#
+#
+
+mysqldservice=$1
+mysqldbuser=$2
+userhost=$3
+myhostname=$(hostname -f)
+
+service $mysqldservice start
+echo "Removing user $mysqldbuser@$userhost"
+mysql -u root -e "DROP USER '$mysqldbuser'@'$userhost';"
+mysql -u root -e "flush privileges;"
+service $mysqldservice stop
http://git-wip-us.apache.org/repos/asf/ambari/blob/53013484/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/mysql_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/mysql_server.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/mysql_server.py
index 6df6059..885cf06 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/mysql_server.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/mysql_server.py
@@ -23,48 +23,38 @@ from resource_management import *
from mysql_service import mysql_service
-class MysqlServer(Script):
+class MysqlServer(Script):
def install(self, env):
import params
-
self.install_packages(env, exclude_packages=params.hive_exclude_packages)
self.configure(env)
- def configure(self, env):
- import params
+ def clean(self, env):
+ import params, mysql_users
env.set_params(params)
+ mysql_users.mysql_deluser(params)
- mysql_service(daemon_name=params.daemon_name, action='start')
-
- File(params.mysql_adduser_path,
- mode=0755,
- content=StaticFile('addMysqlUser.sh')
- )
-
- cmd = format("bash -x {mysql_adduser_path} {daemon_name} {hive_metastore_user_name} {hive_metastore_user_passwd!p} {mysql_host[0]}")
-
- Execute(cmd,
- tries=3,
- try_sleep=5,
- path='/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'
- )
+ def configure(self, env):
+ import params, mysql_users
+ env.set_params(params)
+ mysql_users.mysql_adduser(params)
def start(self, env):
import params
env.set_params(params)
-
- mysql_service(daemon_name=params.daemon_name, action = 'start')
+ mysql_service(daemon_name=params.daemon_name, action='start')
def stop(self, env):
import params
env.set_params(params)
-
- mysql_service(daemon_name=params.daemon_name, action = 'stop')
+ mysql_service(daemon_name=params.daemon_name, action='stop')
def status(self, env):
import status_params
- mysql_service(daemon_name=status_params.daemon_name, action = 'status')
+
+ mysql_service(daemon_name=status_params.daemon_name, action='status')
+
if __name__ == "__main__":
MysqlServer().execute()
http://git-wip-us.apache.org/repos/asf/ambari/blob/53013484/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/mysql_users.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/mysql_users.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/mysql_users.py
new file mode 100644
index 0000000..9961c18
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/mysql_users.py
@@ -0,0 +1,65 @@
+#!/usr/bin/env python
+"""
+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.
+
+"""
+
+from resource_management import *
+
+# Used to add hive access to the needed components
+def mysql_adduser(params):
+ File(params.mysql_adduser_path,
+ mode=0755,
+ content=StaticFile('addMysqlUser.sh')
+ )
+ hive_server_host = format("{hive_server_host}")
+ hive_metastore_host = format("{hive_metastore_host}")
+
+ add_metastore_cmd = "bash -x {mysql_adduser_path} {daemon_name} {hive_metastore_user_name} {hive_metastore_user_passwd!p} {hive_metastore_host}"
+ add_hiveserver_cmd = "bash -x {mysql_adduser_path} {daemon_name} {hive_metastore_user_name} {hive_metastore_user_passwd!p} {hive_server_host}"
+ if (hive_server_host == hive_metastore_host):
+ cmd = format(add_hiveserver_cmd)
+ else:
+ cmd = format(add_hiveserver_cmd + ";" + add_metastore_cmd)
+ Execute(cmd,
+ tries=3,
+ try_sleep=5,
+ path='/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'
+ )
+
+# Removes hive access from components
+def mysql_deluser(params):
+ File(params.mysql_deluser_path,
+ mode=0755,
+ content=StaticFile('removeMysqlUser.sh')
+ )
+ hive_server_host = format("{hive_server_host}")
+ hive_metastore_host = format("{hive_metastore_host}")
+
+ del_hiveserver_cmd = "bash -x {mysql_deluser_path} {daemon_name} {hive_metastore_user_name} {hive_server_host}"
+ del_metastore_cmd = "bash -x {mysql_deluser_path} {daemon_name} {hive_metastore_user_name} {hive_metastore_host}"
+ if (hive_server_host == hive_metastore_host):
+ cmd = format(del_hiveserver_cmd)
+ else:
+ cmd = format(
+ del_hiveserver_cmd + ";" + del_metastore_cmd)
+ Execute(cmd,
+ tries=3,
+ try_sleep=5,
+ path='/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'
+ )
+
http://git-wip-us.apache.org/repos/asf/ambari/blob/53013484/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/params.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/params.py
index 6e44a0f..f9b23fd 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/params.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/params.py
@@ -100,6 +100,7 @@ check_db_connection_jar_name = "DBConnectionVerification.jar"
check_db_connection_jar = format("/usr/lib/ambari-agent/{check_db_connection_jar_name}")
#common
+hive_metastore_host = config['clusterHostInfo']['hive_metastore_host'][0]
hive_metastore_port = get_port_from_url(config['configurations']['hive-site']['hive.metastore.uris']) #"9083"
hive_var_lib = '/var/lib/hive'
ambari_server_hostname = config['clusterHostInfo']['ambari_server_host'][0]
@@ -167,6 +168,7 @@ mysql_group = 'mysql'
mysql_host = config['clusterHostInfo']['hive_mysql_host']
mysql_adduser_path = format("{tmp_dir}/addMysqlUser.sh")
+mysql_deluser_path = format("{tmp_dir}/removeMysqlUser.sh")
######## Metastore Schema
if hdp_stack_version != "" and compare_versions(hdp_stack_version, "2.1.0.0") < 0:
http://git-wip-us.apache.org/repos/asf/ambari/blob/53013484/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_mysql_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_mysql_server.py b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_mysql_server.py
index 9b30cdb..1d35e97 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_mysql_server.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_mysql_server.py
@@ -96,13 +96,25 @@ class TestMySqlServer(RMFTestCase):
)
self.assertNoMoreResources()
- def assert_configure_default(self):
- self.assertResourceCalled('Execute', "sed -i 's|^bind-address[ \t]*=.*|bind-address = 0.0.0.0|' /etc/my.cnf",
+ def test_clean_default(self):
+ self.executeScript("2.0.6/services/HIVE/package/scripts/mysql_server.py",
+ classname = "MysqlServer",
+ command = "clean",
+ config_file="default.json"
)
- self.assertResourceCalled('Execute', 'service mysql start',
- logoutput = True,
- not_if = 'service mysql status | grep running'
+ self.assert_clean_default()
+ self.assertNoMoreResources()
+
+ def test_clean_secured(self):
+ self.executeScript("2.0.6/services/HIVE/package/scripts/mysql_server.py",
+ classname = "MysqlServer",
+ command = "clean",
+ config_file="secured.json"
)
+ self.assert_clean_secured()
+ self.assertNoMoreResources()
+
+ def assert_configure_default(self):
self.assertResourceCalled('File', '/tmp/addMysqlUser.sh',
content = StaticFile('addMysqlUser.sh'),
mode = 0755,
@@ -114,12 +126,6 @@ class TestMySqlServer(RMFTestCase):
)
def assert_configure_secured(self):
- self.assertResourceCalled('Execute', "sed -i 's|^bind-address[ \t]*=.*|bind-address = 0.0.0.0|' /etc/my.cnf",
- )
- self.assertResourceCalled('Execute', 'service mysql start',
- logoutput = True,
- not_if = 'service mysql status | grep running'
- )
self.assertResourceCalled('File', '/tmp/addMysqlUser.sh',
content = StaticFile('addMysqlUser.sh'),
mode = 0755,
@@ -129,3 +135,25 @@ class TestMySqlServer(RMFTestCase):
tries = 3,
try_sleep = 5,
)
+
+ def assert_clean_default(self):
+ self.assertResourceCalled('File', '/tmp/removeMysqlUser.sh',
+ content = StaticFile('removeMysqlUser.sh'),
+ mode = 0755,
+ )
+ self.assertResourceCalled('Execute', 'bash -x /tmp/removeMysqlUser.sh mysql hive c6402.ambari.apache.org',
+ path = ['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'],
+ tries = 3,
+ try_sleep = 5,
+ )
+
+ def assert_clean_secured(self):
+ self.assertResourceCalled('File', '/tmp/removeMysqlUser.sh',
+ content = StaticFile('removeMysqlUser.sh'),
+ mode = 0755,
+ )
+ self.assertResourceCalled('Execute', 'bash -x /tmp/removeMysqlUser.sh mysql hive c6402.ambari.apache.org',
+ path = ['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'],
+ tries = 3,
+ try_sleep = 5,
+ )
http://git-wip-us.apache.org/repos/asf/ambari/blob/53013484/ambari-server/src/test/python/stacks/2.0.6/configs/default.hbasedecom.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/configs/default.hbasedecom.json b/ambari-server/src/test/python/stacks/2.0.6/configs/default.hbasedecom.json
index f6e9570..4ad5bcd 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/configs/default.hbasedecom.json
+++ b/ambari-server/src/test/python/stacks/2.0.6/configs/default.hbasedecom.json
@@ -652,7 +652,7 @@
"logviewer_server_hosts": [
"c6402.ambari.apache.org"
],
- "hive_metastore_hosts": [
+ "hive_metastore_host": [
"c6402.ambari.apache.org"
],
"hbase_rs_hosts": [
http://git-wip-us.apache.org/repos/asf/ambari/blob/53013484/ambari-server/src/test/python/stacks/2.0.6/configs/default.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/configs/default.json b/ambari-server/src/test/python/stacks/2.0.6/configs/default.json
index 4ddc718..6d5ffa7 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/configs/default.json
+++ b/ambari-server/src/test/python/stacks/2.0.6/configs/default.json
@@ -747,7 +747,7 @@
"logviewer_server_hosts": [
"c6402.ambari.apache.org"
],
- "hive_metastore_hosts": [
+ "hive_metastore_host": [
"c6402.ambari.apache.org"
],
"hbase_rs_hosts": [
http://git-wip-us.apache.org/repos/asf/ambari/blob/53013484/ambari-server/src/test/python/stacks/2.0.6/configs/default.non_gmetad_host.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/configs/default.non_gmetad_host.json b/ambari-server/src/test/python/stacks/2.0.6/configs/default.non_gmetad_host.json
index b31d4b9..bf1d79b 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/configs/default.non_gmetad_host.json
+++ b/ambari-server/src/test/python/stacks/2.0.6/configs/default.non_gmetad_host.json
@@ -699,7 +699,7 @@
"logviewer_server_hosts": [
"c6402.ambari.apache.org"
],
- "hive_metastore_hosts": [
+ "hive_metastore_host": [
"c6402.ambari.apache.org"
],
"hbase_rs_hosts": [
http://git-wip-us.apache.org/repos/asf/ambari/blob/53013484/ambari-server/src/test/python/stacks/2.0.6/configs/default_client.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/configs/default_client.json b/ambari-server/src/test/python/stacks/2.0.6/configs/default_client.json
index c8333ac..f544b88 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/configs/default_client.json
+++ b/ambari-server/src/test/python/stacks/2.0.6/configs/default_client.json
@@ -730,7 +730,7 @@
"logviewer_server_hosts": [
"c6402.ambari.apache.org"
],
- "hive_metastore_hosts": [
+ "hive_metastore_host": [
"c6402.ambari.apache.org"
],
"hbase_rs_hosts": [
http://git-wip-us.apache.org/repos/asf/ambari/blob/53013484/ambari-server/src/test/python/stacks/2.0.6/configs/flume_target.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/configs/flume_target.json b/ambari-server/src/test/python/stacks/2.0.6/configs/flume_target.json
index 0b7a3bb..09d6286 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/configs/flume_target.json
+++ b/ambari-server/src/test/python/stacks/2.0.6/configs/flume_target.json
@@ -657,7 +657,7 @@
"logviewer_server_hosts": [
"c6402.ambari.apache.org"
],
- "hive_metastore_hosts": [
+ "hive_metastore_host": [
"c6402.ambari.apache.org"
],
"hbase_rs_hosts": [
http://git-wip-us.apache.org/repos/asf/ambari/blob/53013484/ambari-server/src/test/python/stacks/2.0.6/configs/secured.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/configs/secured.json b/ambari-server/src/test/python/stacks/2.0.6/configs/secured.json
index c60227b..455a138 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/configs/secured.json
+++ b/ambari-server/src/test/python/stacks/2.0.6/configs/secured.json
@@ -765,7 +765,7 @@
"logviewer_server_hosts": [
"c6402.ambari.apache.org"
],
- "hive_metastore_hosts": [
+ "hive_metastore_host": [
"c6402.ambari.apache.org"
],
"hbase_rs_hosts": [
http://git-wip-us.apache.org/repos/asf/ambari/blob/53013484/ambari-server/src/test/python/stacks/2.0.6/configs/secured_client.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/configs/secured_client.json b/ambari-server/src/test/python/stacks/2.0.6/configs/secured_client.json
index a2c4fef..69c7b4d 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/configs/secured_client.json
+++ b/ambari-server/src/test/python/stacks/2.0.6/configs/secured_client.json
@@ -750,7 +750,7 @@
"logviewer_server_hosts": [
"c6402.ambari.apache.org"
],
- "hive_metastore_hosts": [
+ "hive_metastore_host": [
"c6402.ambari.apache.org"
],
"hbase_rs_hosts": [
http://git-wip-us.apache.org/repos/asf/ambari/blob/53013484/ambari-server/src/test/python/stacks/2.0.6/configs/secured_no_jce_name.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/configs/secured_no_jce_name.json b/ambari-server/src/test/python/stacks/2.0.6/configs/secured_no_jce_name.json
index f1eefdb..e155c11 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/configs/secured_no_jce_name.json
+++ b/ambari-server/src/test/python/stacks/2.0.6/configs/secured_no_jce_name.json
@@ -766,7 +766,7 @@
"logviewer_server_hosts": [
"c6402.ambari.apache.org"
],
- "hive_metastore_hosts": [
+ "hive_metastore_host": [
"c6402.ambari.apache.org"
],
"hbase_rs_hosts": [
http://git-wip-us.apache.org/repos/asf/ambari/blob/53013484/ambari-web/app/controllers.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers.js b/ambari-web/app/controllers.js
index 476b777..faa96d6 100644
--- a/ambari-web/app/controllers.js
+++ b/ambari-web/app/controllers.js
@@ -156,3 +156,4 @@ require('controllers/wizard/stack_upgrade/step3_controller');
require('controllers/global/cluster_controller');
require('controllers/global/update_controller');
require('controllers/global/configuration_controller');
+require('controllers/main/service/reassign/step7_controller');
http://git-wip-us.apache.org/repos/asf/ambari/blob/53013484/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 50e8979..bd3bbd1 100644
--- a/ambari-web/app/controllers/main/admin/highAvailability/progress_controller.js
+++ b/ambari-web/app/controllers/main/admin/highAvailability/progress_controller.js
@@ -100,4 +100,3 @@ App.HighAvailabilityProgressPageController = App.HighAvailabilityWizardControlle
});
}
});
-
http://git-wip-us.apache.org/repos/asf/ambari/blob/53013484/ambari-web/app/controllers/main/service/info/configs.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/info/configs.js b/ambari-web/app/controllers/main/service/info/configs.js
index 88fe2c7..4de6379 100644
--- a/ambari-web/app/controllers/main/service/info/configs.js
+++ b/ambari-web/app/controllers/main/service/info/configs.js
@@ -1034,6 +1034,7 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ServerValidatorM
*/
createConfigProperty: function (_serviceConfigProperty, defaultGroupSelected, serviceConfigsData) {
if (!_serviceConfigProperty) return null;
+
var overrides = _serviceConfigProperty.overrides;
// we will populate the override properties below
Em.set(_serviceConfigProperty, 'overrides', null);
http://git-wip-us.apache.org/repos/asf/ambari/blob/53013484/ambari-web/app/controllers/main/service/reassign/step1_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/reassign/step1_controller.js b/ambari-web/app/controllers/main/service/reassign/step1_controller.js
index 0a0bcbd..2f35650 100644
--- a/ambari-web/app/controllers/main/service/reassign/step1_controller.js
+++ b/ambari-web/app/controllers/main/service/reassign/step1_controller.js
@@ -18,5 +18,88 @@
var App = require('app');
-App.ReassignMasterWizardStep1Controller = Em.Controller.extend();
+App.ReassignMasterWizardStep1Controller = Em.Controller.extend({
+ name: 'reassignMasterWizardStep1Controller',
+ databaseType: null,
+
+ dbProperty: function() {
+ var componentName = this.get('content.reassign.component_name');
+
+ var property = null;
+ switch(componentName) {
+ case 'HIVE_SERVER':
+ case 'HIVE_METASTORE':
+ property = 'javax.jdo.option.ConnectionDriverName';
+ break;
+ case 'OOZIE_SERVER':
+ property = 'oozie.service.JPAService.jdbc.driver';
+ break;
+ }
+
+ return property;
+ },
+
+ loadConfigsTags: function () {
+ if(!this.get('databaseType')) {
+ App.ajax.send({
+ name: 'config.tags',
+ sender: this,
+ success: 'onLoadConfigsTags',
+ error: ''
+ });
+ }
+ },
+
+ /**
+ * construct URL parameters for config call
+ * @param componentName
+ * @param data
+ * @return {Array}
+ */
+ getConfigUrlParams: function (componentName, data) {
+ var urlParams = [];
+ switch (componentName) {
+ case 'OOZIE_SERVER':
+ urlParams.push('(type=oozie-site&tag=' + data.Clusters.desired_configs['oozie-site'].tag + ')');
+ break;
+ case 'HIVE_SERVER':
+ case 'HIVE_METASTORE':
+ urlParams.push('(type=hive-site&tag=' + data.Clusters.desired_configs['hive-site'].tag + ')');
+ break;
+ }
+ return urlParams;
+ },
+
+ onLoadConfigsTags: function (data) {
+ var urlParams = this.getConfigUrlParams(this.get('content.reassign.component_name'), data);
+
+ App.ajax.send({
+ name: 'reassign.load_configs',
+ sender: this,
+ data: {
+ urlParams: urlParams.join('|')
+ },
+ success: 'onLoadConfigs',
+ error: ''
+ });
+ },
+
+ onLoadConfigs: function (data) {
+ var databaseProperty = data.items[0].properties[this.dbProperty()];
+ var databaseType = databaseProperty.match(/MySQL|PostgreS|Oracle|Derby|MSSQL/gi)[0];
+
+ if (databaseType !== 'derby') {
+ App.router.reassignMasterController.set('content.hasManualSteps', false);
+ }
+
+ this.saveDatabaseType(databaseType)
+ },
+
+ saveDatabaseType: function(type) {
+ if(type) {
+ this.set('databaseType', type);
+ App.router.get(this.get('content.controllerName')).saveDatabaseType(type);
+ }
+ }
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/53013484/ambari-web/app/controllers/main/service/reassign/step4_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/reassign/step4_controller.js b/ambari-web/app/controllers/main/service/reassign/step4_controller.js
index 6141711..3a1c487 100644
--- a/ambari-web/app/controllers/main/service/reassign/step4_controller.js
+++ b/ambari-web/app/controllers/main/service/reassign/step4_controller.js
@@ -22,7 +22,9 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro
isReassign: true,
- commands: ['stopServices', 'createHostComponents', 'putHostComponentsInMaintenanceMode', 'reconfigure', 'installHostComponents', 'startZooKeeperServers', 'startNameNode', 'deleteHostComponents', 'startServices'],
+ commands: ['stopServices', 'cleanMySqlServer', 'createHostComponents', 'putHostComponentsInMaintenanceMode', 'reconfigure', 'installHostComponents', 'startZooKeeperServers', 'startNameNode', 'deleteHostComponents', 'configureMySqlServer', 'startMySqlServer', 'startServices'],
+ // custom commands for Components with DB Configuration and Check
+ commandsForDB: ['createHostComponents', 'installHostComponents', 'configureMySqlServer', 'startMySqlServer', 'testDBConnection', 'stopServices', 'cleanMySqlServer', 'putHostComponentsInMaintenanceMode', 'reconfigure', 'deleteHostComponents', 'configureMySqlServer', 'startServices'],
clusterDeployState: 'REASSIGN_MASTER_INSTALLING',
@@ -30,6 +32,8 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro
hostComponents: [],
+ hiveSiteConfig: null,
+
/**
* Map with lists of unrelated services.
* Used to define list of services to stop/start.
@@ -39,7 +43,10 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro
'RESOURCEMANAGER': ['HDFS', 'ZOOKEEPER', 'HBASE', 'FLUME', 'SQOOP', 'STORM'],
'APP_TIMELINE_SERVER': ['HDFS', 'ZOOKEEPER', 'HBASE', 'FLUME', 'SQOOP', 'STORM'],
'OOZIE_SERVER': ['HDFS', 'ZOOKEEPER', 'HBASE', 'FLUME', 'SQOOP', 'STORM', 'HIVE'],
- 'WEBHCAT_SERVER': ['HDFS', 'ZOOKEEPER', 'HBASE', 'FLUME', 'SQOOP', 'STORM']
+ 'WEBHCAT_SERVER': ['HDFS', 'ZOOKEEPER', 'HBASE', 'FLUME', 'SQOOP', 'STORM'],
+ 'HIVE_SERVER': ['HDFS', 'ZOOKEEPER', 'HBASE', 'FLUME', 'SQOOP', 'STORM'],
+ 'HIVE_METASTORE': ['HDFS', 'ZOOKEEPER', 'HBASE', 'FLUME', 'SQOOP', 'STORM'],
+ 'MYSQL_SERVER': ['HDFS', 'ZOOKEEPER', 'HBASE', 'FLUME', 'SQOOP', 'STORM'],
},
/**
@@ -117,7 +124,21 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro
componentName: 'OOZIE_SERVER',
configs: {
'oozie-site': {
- 'oozie.base.url': '<replace-value>:11000/oozie'
+ 'oozie.base.url': '<replace-value>:11000/oozie'
+ }
+ }
+ },
+ {
+ componentName: 'HIVE_METASTORE',
+ configs: {
+ 'hive-site': {}
+ }
+ },
+ {
+ componentName: 'MYSQL_SERVER',
+ configs: {
+ 'hive-site': {
+ 'javax.jdo.option.ConnectionURL': 'jdbc:mysql://<replace-value>/hive?createDatabaseIfNotExist=true'
}
}
}
@@ -240,19 +261,56 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro
* remove unneeded tasks
*/
removeUnneededTasks: function () {
+ if(this.isComponentWithDB()) {
+ var db_type = this.get('content.databaseType');
+
+ if (db_type !== 'mysql') {
+ this.removeTasks(['configureMySqlServer', 'startMySqlServer', 'cleanMySqlServer', 'configureMySqlServer']);
+ }
+
+ if (db_type === 'derby') {
+ this.removeTasks(['testDBConnection']);
+ }
+ }
+
+ if ( this.get('content.reassign.component_name') !== 'MYSQL_SERVER' && !this.isComponentWithDB()) {
+ this.removeTasks(['configureMySqlServer', 'startMySqlServer', 'cleanMySqlServer', 'configureMySqlServer']);
+ }
+
if (this.get('content.hasManualSteps')) {
if (this.get('content.reassign.component_name') === 'NAMENODE' && App.get('isHaEnabled')) {
// Only for reassign NameNode with HA enabled
- this.get('tasks').splice(7, 2);
+ this.removeTasks(['deleteHostComponents', 'startServices']);
} else {
- this.get('tasks').splice(5, 4);
+ this.removeTasks(['startZooKeeperServers', 'startNameNode', 'deleteHostComponents', 'startServices']);
}
} else {
- this.get('tasks').splice(5, 2);
+ this.removeTasks(['startZooKeeperServers', 'startNameNode']);
}
},
/**
+ * remove tasks by command name
+ */
+ removeTasks: function(commands) {
+ var tasks = this.get('tasks'),
+ index = null
+ cmd = null;
+
+ commands.forEach(function(command) {
+ cmd = tasks.filterProperty('command', command);
+
+ if (cmd.length === 0) {
+ return false;
+ } else {
+ index = tasks.indexOf( cmd[0] );
+ }
+
+ tasks.splice( index, 1 );
+ });
+ },
+
+ /**
* initialize tasks
*/
initializeTasks: function () {
@@ -260,9 +318,13 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro
var currentStep = App.router.get('reassignMasterController.currentStep');
var hostComponentsNames = this.getHostComponentsNames();
+ if (this.isComponentWithDB()) {
+ commands = this.get('commandsForDB');
+ }
+
for (var i = 0; i < commands.length; i++) {
var TaskLabel = i === 3 ? this.get('serviceName') : hostComponentsNames; //For Reconfigure task, show serviceName
- var title = Em.I18n.t('services.reassign.step4.task' + i + '.title').format(TaskLabel);
+ var title = Em.I18n.t('services.reassign.step4.tasks.' + commands[i] + '.title').format(TaskLabel);
this.get('tasks').pushObject(Ember.Object.create({
title: title,
status: 'PENDING',
@@ -421,6 +483,14 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro
break;
case 'WEBHCAT_SERVER':
urlParams.push('(type=webhcat-site&tag=' + data.Clusters.desired_configs['webhcat-site'].tag + ')');
+ case 'HIVE_SERVER':
+ urlParams.push('(type=hive-site&tag=' + data.Clusters.desired_configs['hive-site'].tag + ')');
+ break;
+ case 'HIVE_METASTORE':
+ urlParams.push('(type=hive-site&tag=' + data.Clusters.desired_configs['hive-site'].tag + ')');
+ break;
+ case 'MYSQL_SERVER':
+ urlParams.push('(type=hive-site&tag=' + data.Clusters.desired_configs['hive-site'].tag + ')');
break;
}
return urlParams;
@@ -711,5 +781,276 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro
App.router.send('complete');
}
}
+ },
+
+ /**
+ * make server call to clean MYSQL
+ */
+ cleanMySqlServer: function () {
+ App.ajax.send({
+ name: 'service.mysql.clean',
+ sender: this,
+ data: {
+ host: App.HostComponent.find().filterProperty('componentName', 'MYSQL_SERVER').get('firstObject.hostName')
+ },
+ success: 'startPolling',
+ error: 'onTaskError'
+ });
+ },
+
+ /**
+ * make server call to configure MYSQL
+ */
+ configureMySqlServer : function () {
+ App.ajax.send({
+ name: 'service.mysql.configure',
+ sender: this,
+ data: {
+ host: App.HostComponent.find().filterProperty('componentName', 'MYSQL_SERVER').get('firstObject.hostName')
+ },
+ success: 'startPolling',
+ error: 'onTaskError'
+ });
+ },
+
+ startMySqlServer: function() {
+ App.ajax.send({
+ name: 'common.host.host_component.update',
+ sender: this,
+ data: {
+ context: "Start MySQL Server",
+ hostName: App.HostComponent.find().filterProperty('componentName', 'MYSQL_SERVER').get('firstObject.hostName'),
+ serviceName: "HIVE",
+ componentName: "MYSQL_SERVER",
+ HostRoles: {
+ state: "STARTED"
+ }
+ },
+ success: 'startPolling',
+ error: 'onTaskError'
+ });
+ },
+
+ testDBConnection: function() {
+ this.loadServiceConfigsTags();
+ //this.onTaskCompleted();
+ },
+
+ isComponentWithDB: function() {
+ return ['HIVE_SERVER', 'HIVE_METASTORE', 'OOZIE_SERVER'].contains(this.get('content.reassign.component_name'));
+ },
+
+ loadServiceConfigsTags: function() {
+ App.ajax.send({
+ name: 'config.tags',
+ sender: this,
+ success: 'onLoadServiceConfigsTags',
+ error: 'onTaskError'
+ });
+ },
+
+ onLoadServiceConfigsTags: function(data) {
+ var urlParams = this.getConfigUrlParams(this.get('content.reassign.component_name'), data);
+
+ App.ajax.send({
+ name: 'reassign.load_configs',
+ sender: this,
+ data: {
+ urlParams: urlParams.join('|')
+ },
+ success: 'onLoadServiceConfigs',
+ error: 'onTaskError'
+ });
+ },
+
+ dbProperty: function() {
+ var componentName = this.get('content.reassign.component_name');
+
+ var property = null;
+ switch(componentName) {
+ case 'HIVE_SERVER':
+ case 'HIVE_METASTORE':
+ property = 'javax.jdo.option.ConnectionDriverName';
+ break;
+ case 'OOZIE_SERVER':
+ property = 'oozie.service.JPAService.jdbc.url';
+ break;
+ }
+
+ return property;
+ }.property(),
+
+ /** @property {Object} propertiesPattern - check pattern according to type of connection properties **/
+ propertiesPattern: function() {
+ return {
+ user_name: /(username|dblogin)$/ig,
+ user_passwd: /(dbpassword|password)$/ig,
+ db_connection_url: /jdbc\.url|connectionurl/ig,
+ driver_class: /ConnectionDriverName|jdbc\.driver/ig,
+ schema_name: /db\.schema\.name/ig
+ }
+ }.property(),
+
+ /** @property {Object} connectionProperties - service specific config values mapped for custom action request **/
+ connectionProperties: function() {
+ var propObj = {};
+ for (var key in this.get('propertiesPattern')) {
+ propObj[key] = this.getConnectionProperty(this.get('propertiesPattern')[key]);
+ }
+ return propObj;
+ }.property('propertiesPattern'),
+
+ getConnectionProperty: function(regexp) {
+ var propertyName = this.get('requiredProperties').filter(function(item) {
+ return regexp.test(item);
+ })[0];
+ return this.get('content.serviceProperties')[propertyName];
+ },
+ /**
+ * Properties that stores in local storage used for handling
+ * last success connection.
+ *
+ * @property {Object} preparedDBProperties
+ **/
+ preparedDBProperties: function() {
+ var propObj = {};
+ for (var key in this.get('propertiesPattern')) {
+ var propValue = this.getConnectionProperty(this.get('propertiesPattern')[key]);
+ propObj[key] = propValue;
+ }
+ return propObj;
+ }.property(),
+
+ /** @property {object} requiredProperties - properties that necessary for database connection **/
+ requiredProperties: function() {
+ var propertiesMap = {
+ HDFS: ['sink.db.schema.name','sink.dblogin','sink.dbpassword','sink.jdbc.driver','sink.jdbc.url'],
+ OOZIE: ['oozie.db.schema.name','oozie.service.JPAService.jdbc.username','oozie.service.JPAService.jdbc.password','oozie.service.JPAService.jdbc.driver','oozie.service.JPAService.jdbc.url'],
+ HIVE: ['ambari.hive.db.schema.name','javax.jdo.option.ConnectionUserName','javax.jdo.option.ConnectionPassword','javax.jdo.option.ConnectionDriverName','javax.jdo.option.ConnectionURL']
+ };
+ return propertiesMap[this.get('content.reassign.service_id')];
+ }.property(),
+
+ dbType: function() {
+ var databaseTypes = /MySQL|PostgreS|Oracle|Derby|MSSQL/gi;
+ var databaseProp = this.get('content.serviceProperties')[this.get('dbProperty')];
+
+ return databaseProp.match(databaseTypes)[0];
+ }.property('dbProperty'),
+
+ onLoadServiceConfigs: function(data) {
+ var properties = data.items.get('firstObject.properties');
+ this.saveServiceProperties(properties);
+
+ var params = this.get('preparedDBProperties');
+ params['db_name'] = this.get('dbType');
+
+ var ambariProperties = App.router.get('clusterController.ambariProperties');
+
+ params['jdk_location'] = ambariProperties['jdk_location'];
+ params['jdk_name'] = ambariProperties['jdk.name'];
+ params['java_home'] = ambariProperties['java.home'];
+
+ params['threshold'] = 60;
+ params['ambari_server_host'] = location.hostname;
+ params['check_execute_list'] = "db_connection_check";
+
+ App.ajax.send({
+ name: 'custom_action.create',
+ sender: this,
+ data: {
+ requestInfo: {
+ "context": "Check host",
+ "action": "check_host",
+ "parameters": params
+ },
+ filteredHosts: [App.HostComponent.find().filterProperty('componentName', 'MYSQL_SERVER').get('firstObject.hostName')]
+ },
+ success: 'onCreateActionSuccess',
+ error: 'onTaskError'
+ });
+ },
+
+ onCreateActionSuccess: function(data) {
+ this.set('checkDBRequestId', data.Requests.id);
+ App.ajax.send({
+ name: 'custom_action.request',
+ sender: this,
+ data: {
+ requestId: this.get('checkDBRequestId')
+ },
+ success: 'setCheckDBTaskId'
+ });
+ },
+
+ setCheckDBTaskId: function(data) {
+ this.set('checkDBTaskId', data.items[0].Tasks.id);
+ this.startDBCheckPolling();
+ },
+
+ startDBCheckPolling: function() {
+ this.getTaskInfo();
+ },
+
+ getTaskInfo: function() {
+ this.setTaskStatus(this.get('currentTaskId'), 'IN_PROGRESS');
+ this.get('tasks').findProperty('id', this.get('currentTaskId')).set('progress', 100);
+
+ this.set('logs', []);
+ App.ajax.send({
+ name: 'custom_action.request',
+ sender: this,
+ data: {
+ requestId: this.get('checkDBRequestId'),
+ taskId: this.get('checkDBTaskId')
+ },
+ success: 'getTaskInfoSuccess'
+ });
+ },
+
+ getTaskInfoSuccess: function(data) {
+ var task = data.Tasks;
+ if (task.status === 'COMPLETED') {
+ var structuredOut = task.structured_out.db_connection_check;
+ if (structuredOut.exit_code != 0) {
+ this.showConnectionErrorPopup(structuredOut.message);
+ this.onTaskError();
+ } else {
+ this.onTaskCompleted();
+ }
+ }
+
+ if (task.status === 'FAILED') {
+ this.onTaskError();
+ }
+
+ if (/PENDING|QUEUED|IN_PROGRESS/.test(task.status)) {
+ Em.run.later(this, function() {
+ this.startDBCheckPolling();
+ }, 3000);
+ }
+ },
+
+ showConnectionErrorPopup: function(error) {
+ var popup = App.showAlertPopup('Database Connection Error');
+ popup.set('body', error);
+ },
+
+ testDBRetryTooltip: function() {
+ var db_host = App.HostComponent.find().filterProperty('componentName', 'MYSQL_SERVER').get('firstObject.hostName');
+ var db_type = this.get('dbType');
+ var db_props = this.get('preparedDBProperties');
+
+ return Em.I18n.t('services.reassign.step4.tasks.testDBConnection.tooltip').format(
+ db_host, db_type, db_props['schema_name'], db_props['user_name'],
+ db_props['user_passwd'], db_props['driver_class'], db_props['db_connection_url']
+ );
+ }.property('dbProperties'),
+
+ saveServiceProperties: function(properties) {
+ if(properties) {
+ this.set('content.serviceProperties', properties);
+ App.router.get(this.get('content.controllerName')).saveServiceProperties(properties);
+ }
}
});
http://git-wip-us.apache.org/repos/asf/ambari/blob/53013484/ambari-web/app/controllers/main/service/reassign/step7_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/reassign/step7_controller.js b/ambari-web/app/controllers/main/service/reassign/step7_controller.js
new file mode 100644
index 0000000..5fcb1f1
--- /dev/null
+++ b/ambari-web/app/controllers/main/service/reassign/step7_controller.js
@@ -0,0 +1,90 @@
+/**
+ * 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.ReassignMasterWizardStep7Controller = App.ReassignMasterWizardStep4Controller.extend({
+ name: 'reassignMasterWizardStep7Controller',
+ isReassign: true,
+ commands: ['putHostComponentsInMaintenanceMode', 'deleteHostComponents', 'cleanMySqlServer', 'configureMySqlServer', 'startServices'],
+ clusterDeployState: 'REASSIGN_MASTER_INSTALLING',
+ multiTaskCounter: 0,
+
+ initializeTasks: function () {
+
+ var commands = this.get('commands');
+ var hostComponentsNames = this.getHostComponentsNames();
+
+ for (var i = 0; i < commands.length; i++) {
+ var TaskLabel = i === 3 ? this.get('serviceName') : hostComponentsNames; //For Reconfigure task, show serviceName
+ var title = Em.I18n.t('services.reassign.step4.tasks.' + commands[i] + '.title').format(TaskLabel);
+ this.get('tasks').pushObject(Ember.Object.create({
+ title: title,
+ status: 'PENDING',
+ id: i,
+ command: commands[i],
+ showRetry: false,
+ showRollback: false,
+ name: title,
+ displayName: title,
+ progress: 0,
+ isRunning: false,
+ hosts: []
+ }));
+ }
+
+ this.removeUnneededTasks();
+ },
+
+ putHostComponentsInMaintenanceMode: function () {
+ this.set('multiTaskCounter', 0);
+ var hostComponents = this.get('hostComponents');
+ var hostName = this.get('content.reassignHosts.target');
+ for (var i = 0; i < hostComponents.length; i++) {
+ App.ajax.send({
+ name: 'common.host.host_component.passive',
+ sender: this,
+ data: {
+ hostName: hostName,
+ passive_state: "ON",
+ componentName: hostComponents[i]
+ },
+ success: 'onComponentsTasksSuccess',
+ error: 'onTaskError'
+ });
+ }
+ },
+
+ deleteHostComponents: function () {
+ this.set('multiTaskCounter', 0);
+ var hostComponents = this.get('hostComponents');
+ var hostName = this.get('content.reassignHosts.target');
+ for (var i = 0; i < hostComponents.length; i++) {
+ App.ajax.send({
+ name: 'common.delete.host_component',
+ sender: this,
+ data: {
+ hostName: hostName,
+ componentName: hostComponents[i]
+ },
+ success: 'onComponentsTasksSuccess',
+ error: 'onDeleteHostComponentsError'
+ });
+ }
+ }
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/53013484/ambari-web/app/controllers/main/service/reassign_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/reassign_controller.js b/ambari-web/app/controllers/main/service/reassign_controller.js
index bbaf04b..7c4f9ab 100644
--- a/ambari-web/app/controllers/main/service/reassign_controller.js
+++ b/ambari-web/app/controllers/main/service/reassign_controller.js
@@ -23,7 +23,7 @@ App.ReassignMasterController = App.WizardController.extend({
name: 'reassignMasterController',
- totalSteps: 6,
+ totalSteps: 7,
/**
* Used for hiding back button in wizard
@@ -55,8 +55,10 @@ App.ReassignMasterController = App.WizardController.extend({
hdfsUser: "hdfs",
group: "hadoop",
reassign: null,
- componentsWithManualCommands: ['NAMENODE', 'SECONDARY_NAMENODE'],
+ componentsWithManualCommands: ['NAMENODE', 'SECONDARY_NAMENODE', 'OOZIE_SERVER', 'MYSQL_SERVER'],
hasManualSteps: false,
+ hasCheckDBStep: false,
+ componentsWithCheckDBStep: ['HIVE_METASTORE', 'HIVE_SERVER', 'OOZIE_SERVER'],
securityEnabled: false
}),
@@ -82,6 +84,10 @@ App.ReassignMasterController = App.WizardController.extend({
this.set('content.hasManualSteps', this.get('content.componentsWithManualCommands').contains(this.get('content.reassign.component_name')) || this.get('content.securityEnabled'));
}.observes('content.reassign.component_name', 'content.securityEnabled'),
+ addCheckDBStep: function () {
+ this.set('content.hasCheckDBStep', this.get('content.componentsWithCheckDBStep').contains(this.get('content.reassign.component_name')));
+ }.observes('content.reassign.component_name'),
+
getSecurityStatus: function () {
if (App.get('testMode')) {
this.set('securityEnabled', !App.get('testEnableSecurity'));
@@ -263,17 +269,39 @@ App.ReassignMasterController = App.WizardController.extend({
this.set('content.secureConfigs', secureConfigs);
},
+ saveServiceProperties: function (properties) {
+ this.setDBProperty('serviceProperties', properties);
+ this.set('content.serviceProperties', properties);
+ },
+
+ loadServiceProperties: function () {
+ var serviceProperties = this.getDBProperty('serviceProperties');
+ this.set('content.serviceProperties', serviceProperties);
+ },
+
+ saveDatabaseType: function (type) {
+ this.setDBProperty('databaseType', type);
+ this.set('content.databaseType', type);
+ },
+
+ loadDatabaseType: function () {
+ var databaseType = this.getDBProperty('databaseType');
+ this.set('content.databaseType', databaseType);
+ },
+
/**
* Load data for all steps until <code>current step</code>
*/
loadAllPriorSteps: function () {
var step = this.get('currentStep');
switch (step) {
+ case '7':
case '6':
case '5':
this.loadSecureConfigs();
this.loadComponentDir();
case '4':
+ this.loadServiceProperties();
this.loadTasksStatuses();
this.loadTasksRequestIds();
this.loadRequestIds();
@@ -285,6 +313,7 @@ App.ReassignMasterController = App.WizardController.extend({
this.loadConfirmedHosts();
case '1':
this.loadComponentToReassign();
+ this.loadDatabaseType();
this.load('cluster');
}
},
http://git-wip-us.apache.org/repos/asf/ambari/blob/53013484/ambari-web/app/data/HDP2/site_properties.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/data/HDP2/site_properties.js b/ambari-web/app/data/HDP2/site_properties.js
index ecde26c..7971b6a 100644
--- a/ambari-web/app/data/HDP2/site_properties.js
+++ b/ambari-web/app/data/HDP2/site_properties.js
@@ -3318,7 +3318,7 @@ module.exports =
"defaultValue": "",
"description": "The host that has been assigned to run Hive Metastore",
"displayType": "masterHost",
- "isOverridable": false,
+ "isOverridable": true,
"isRequiredByAgent": false,
"isVisible": true,
"serviceName": "HIVE",
http://git-wip-us.apache.org/repos/asf/ambari/blob/53013484/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 7752fde..e2c2744 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1653,6 +1653,32 @@ Em.I18n.translations = {
'services.reassign.step3.sourceHost':'Source Host:',
'services.reassign.step3.component':'Component name:',
'services.reassign.step4.header':'Configure Component',
+
+ 'services.reassign.step4.tasks.stopServices.title':'Stop Required Services',
+ 'services.reassign.step4.tasks.createHostComponents.title':'Create {0}',
+ 'services.reassign.step4.tasks.putHostComponentsInMaintenanceMode.title':'Disable {0}',
+ 'services.reassign.step4.tasks.reconfigure.title':'Reconfigure {0}',
+ 'services.reassign.step4.tasks.save.configuration.note':'This configuration is created by Move {0} wizard',
+ 'services.reassign.step4.tasks.installHostComponents.title':'Install {0}',
+ 'services.reassign.step4.tasks.startZooKeeperServers.title':'Start ZooKeeper Servers',
+ 'services.reassign.step4.tasks.startNameNode.title':'Start NameNode',
+ 'services.reassign.step4.tasks.deleteHostComponents.title':'Delete disabled {0}',
+ 'services.reassign.step4.tasks.startServices.title':'Start Required Services',
+ 'services.reassign.step4.tasks.cleanMySqlServer.title':'Clean MYSQL Server',
+ 'services.reassign.step4.tasks.testHiveMysqlConnection.title':'Test MYSQL Connection',
+ 'services.reassign.step4.tasks.configureMySqlServer.title':'Configure MYSQL Server',
+ 'services.reassign.step4.tasks.startMySqlServer.title':'Start MYSQL Server',
+ 'services.reassign.step4.tasks.testDBConnection.title':'Test DB Connection',
+ 'services.reassign.step4.tasks.testDBConnection.tooltip':'Database Host: {0}\n' +
+ 'Database Type: {1}\n' +
+ 'Database Name: {2}\n' +
+ 'Username: {3}\n' +
+ 'Password: {4}\n' +
+ 'JDBC Driver Class: {5}\n' +
+ 'Database URL: {6}',
+ 'services.reassign.rollback.confirm':'Are you sure?',
+
+
'services.reassign.step4.task0.title':'Stop Required Services',
'services.reassign.step4.task1.title':'Create {0}',
'services.reassign.step4.task2.title':'Disable {0}',
@@ -1705,6 +1731,19 @@ Em.I18n.translations = {
'<div class="code-snippet">chown -R {3}:{5} {6}</div></li>' +
'</ol>' +
'</div>',
+ 'services.reassign.step5.body.oozie_server':
+ '<div class="alert alert-info">' +
+ 'Copy the contents of <b>/hadoop/oozie/data/oozie-db</b> on the source host <b>{1}</b> to <b>/hadoop/oozie/data/oozie-db</b> on the target host <b>{2}</b>.' +
+ '</div>',
+ 'services.reassign.step5.body.mysql_server':
+ '<div class="alert alert-info">' +
+ '<ol>' +
+ '<li>On <b>{1}</b> using a terminal you can export your Metastore DB (MYSQL) using:' +
+ '<div class="code-snippet">mysqldump db_name > backup-file.sql</div></li>' +
+ '<li>Copy the file to the target host <b>{2}</b> hosting the MySQL DB and import' +
+ '<div class="code-snippet">mysql db_name < backup-file.sql</div></li>' +
+ '</ol>' +
+ '</div>',
'services.reassign.step5.body.securityNotice': '<div class="alert alert-info"> <div class="alert alert-warn"> <strong>Note: </strong> Secure cluster' +
' requires generating necessary principals for reassigned component and creating keytab files with the principal on ' +
'the target host. The keytab file should be accessible to the service user.</div> {0} </div>',
@@ -1717,6 +1756,10 @@ Em.I18n.translations = {
'services.reassign.step6.status.success': 'Successfully moved <b>{0}</b> from <b>{1}</b> host to <b>{2}</b> host.',
'services.reassign.step6.status.failed': 'Failed to move <b>{0}</b> from <b>{1}</b> host to <b>{2}</b> host.',
'services.reassign.step6.status.info': 'Reassigning {0}. \nPlease wait for all tasks to be completed.',
+ 'services.reassign.step7.header': 'Rollback',
+ 'services.reassign.step7.info': 'Rollback in progress',
+ 'services.reassign.step7.failed': 'Rollback failed',
+ 'services.reassign.step7.success': 'Rollback successfully completed',
/** services page constants **/
http://git-wip-us.apache.org/repos/asf/ambari/blob/53013484/ambari-web/app/models/service/flume.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/service/flume.js b/ambari-web/app/models/service/flume.js
index 4a76969..dd4167f 100644
--- a/ambari-web/app/models/service/flume.js
+++ b/ambari-web/app/models/service/flume.js
@@ -5,9 +5,9 @@
* 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
http://git-wip-us.apache.org/repos/asf/ambari/blob/53013484/ambari-web/app/models/stack_service_component.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/stack_service_component.js b/ambari-web/app/models/stack_service_component.js
index 5d62683..48e9cb9 100644
--- a/ambari-web/app/models/stack_service_component.js
+++ b/ambari-web/app/models/stack_service_component.js
@@ -77,7 +77,7 @@ App.StackServiceComponent = DS.Model.extend({
/** @property {Boolean} isReassignable - component supports reassign action **/
isReassignable: function() {
- return ['NAMENODE', 'SECONDARY_NAMENODE', 'JOBTRACKER', 'RESOURCEMANAGER', 'APP_TIMELINE_SERVER', 'OOZIE_SERVER', 'WEBHCAT_SERVER'].contains(this.get('componentName'));
+ return ['NAMENODE', 'SECONDARY_NAMENODE', 'JOBTRACKER', 'RESOURCEMANAGER', 'APP_TIMELINE_SERVER', 'OOZIE_SERVER', 'WEBHCAT_SERVER', 'HIVE_SERVER', 'HIVE_METASTORE', 'MYSQL_SERVER'].contains(this.get('componentName'));
}.property('componentName'),
/** @property {Boolean} isRollinRestartAllowed - component supports rolling restart action **/
@@ -147,7 +147,7 @@ App.StackServiceComponent = DS.Model.extend({
return this.get('isMaster') && this.get('isMultipleAllowed') && this.get('maxToInstall') > 2;
}.property('componentName'),
-
+
/** @property {Boolean} isClientBehavior - Some non client components can be assigned as clients.
*
* Used for ignoring such components as Ganglia Monitor on Installer "Review" step.
@@ -206,4 +206,3 @@ App.StackServiceComponent.coHost = {
'HIVE_METASTORE': 'HIVE_SERVER',
'WEBHCAT_SERVER': 'HIVE_SERVER'
};
-
http://git-wip-us.apache.org/repos/asf/ambari/blob/53013484/ambari-web/app/routes/reassign_master_routes.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/routes/reassign_master_routes.js b/ambari-web/app/routes/reassign_master_routes.js
index 43563ea..738a018 100644
--- a/ambari-web/app/routes/reassign_master_routes.js
+++ b/ambari-web/app/routes/reassign_master_routes.js
@@ -65,10 +65,16 @@ module.exports = App.WizardRoute.extend({
if (parseInt(currStep) > 3) {
var self = this;
- App.showConfirmationPopup(function () {
- router.get('reassignMasterWizardStep' + currStep + 'Controller').removeObserver('tasks.@each.status', this, 'onTaskStatusChange');
- context.leaveWizard(router, self);
- }, Em.I18n.t('services.reassign.closePopup').format(reassignMasterController.get('content.reassign.display_name')));
+ if(reassignMasterController.get('content.hasCheckDBStep') && currStep !== "7") {
+ App.showConfirmationPopup(function () {
+ App.router.transitionTo('step7');
+ }, Em.I18n.t('services.reassign.rollback.confirm'));
+ } else {
+ App.showConfirmationPopup(function () {
+ router.get('reassignMasterWizardStep' + currStep + 'Controller').removeObserver('tasks.@each.status', this, 'onTaskStatusChange');
+ context.leaveWizard(router, self);
+ }, Em.I18n.t('services.reassign.closePopup').format(reassignMasterController.get('content.reassign.display_name')));
+ }
} else {
context.leaveWizard(router, this);
}
@@ -103,10 +109,12 @@ module.exports = App.WizardRoute.extend({
connectOutlets: function (router) {
console.log('in reassignMaster.step1:connectOutlets');
var controller = router.get('reassignMasterController');
+ var step1Controller = router.get('reassignMasterWizardStep1Controller');
controller.setCurrentStep('1');
controller.dataLoading().done(function () {
controller.loadAllPriorSteps();
controller.connectOutlet('reassignMasterWizardStep1', controller.get('content'));
+ step1Controller.loadConfigsTags();
})
},
next: function (router) {
@@ -202,12 +210,14 @@ module.exports = App.WizardRoute.extend({
},
next: function (router) {
router.get('reassignMasterController').setCurrentStep('5');
+
App.clusterStatus.setClusterStatus({
clusterName: router.get('reassignMasterController.content.cluster.name'),
clusterState: 'REASSIGN_MASTER_INSTALLING',
wizardControllerName: 'reassignMasterController',
localdb: App.db.data
});
+
router.transitionTo('step5');
},
@@ -299,6 +309,60 @@ module.exports = App.WizardRoute.extend({
}
}),
+ step7: Em.Route.extend({
+ route: '/step7',
+ connectOutlets: function (router) {
+ console.log('in reassignMaster.step7:connectOutlets');
+ var controller = router.get('reassignMasterController');
+ controller.setCurrentStep('7');
+ controller.setLowerStepsDisable(7);
+ controller.dataLoading().done(function () {
+ controller.loadAllPriorSteps();
+ controller.connectOutlet('reassignMasterWizardStep7', controller.get('content'));
+ });
+ },
+
+ next: function (router) {
+ var controller = router.get('reassignMasterController');
+ var reassignMasterWizardStep7 = router.get('reassignMasterWizardStep7Controller');
+ if (!reassignMasterWizardStep7.get('isSubmitDisabled')) {
+ controller.finish();
+ controller.get('popup').hide();
+ App.clusterStatus.setClusterStatus({
+ clusterName: router.get('reassignMasterController.content.cluster.name'),
+ clusterState: 'DEFAULT',
+ localdb: App.db.data
+ }, {alwaysCallback: function () {
+ controller.get('popup').hide();
+ router.transitionTo('main.index');
+ location.reload();
+ }});
+ }
+ },
+
+ complete: function (router) {
+ var controller = router.get('reassignMasterController');
+ var reassignMasterWizardStep7 = router.get('reassignMasterWizardStep7Controller');
+ if (!reassignMasterWizardStep7.get('isSubmitDisabled')) {
+ controller.finish();
+ controller.get('popup').hide();
+ App.clusterStatus.setClusterStatus({
+ clusterName: router.get('reassignMasterController.content.cluster.name'),
+ clusterState: 'DEFAULT',
+ localdb: App.db.data
+ }, {alwaysCallback: function () {
+ controller.get('popup').hide();
+ router.transitionTo('main.index');
+ location.reload();
+ }});
+ }
+ },
+
+ unroutePath: function () {
+ return false;
+ }
+ }),
+
backToServices: function (router) {
App.router.get('updateController').set('isWorking', true);
router.transitionTo('services');
http://git-wip-us.apache.org/repos/asf/ambari/blob/53013484/ambari-web/app/templates/main/admin/highAvailability/progress.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/admin/highAvailability/progress.hbs b/ambari-web/app/templates/main/admin/highAvailability/progress.hbs
index f543554..5f95387 100644
--- a/ambari-web/app/templates/main/admin/highAvailability/progress.hbs
+++ b/ambari-web/app/templates/main/admin/highAvailability/progress.hbs
@@ -32,11 +32,12 @@
<div class="bar" {{bindAttr style="view.barWidth"}}></div>
</div>
</div>
- <div class="span1">{{task.progress}}%</div>
+ <div {{bindAttr class=":span1 view.hidePercent:noDisplay"}}>{{task.progress}}%</div>
</div>
<div>
{{#if task.showRetry}}
- <a {{action retryTask target="controller"}} class="btn btn-primary retry">
+ <a {{action retryTask target="controller"}} class="btn btn-primary retry"
+ rel="tooltip" data-trigger="click" {{bindAttr title="view.showDBTooltip:testDBRetryTooltip"}}>
<i class="icon-repeat icon-white"></i>
{{t common.retry}}
</a>
http://git-wip-us.apache.org/repos/asf/ambari/blob/53013484/ambari-web/app/templates/main/service/reassign/step1.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/service/reassign/step1.hbs b/ambari-web/app/templates/main/service/reassign/step1.hbs
index 9862cbe..63a344d 100644
--- a/ambari-web/app/templates/main/service/reassign/step1.hbs
+++ b/ambari-web/app/templates/main/service/reassign/step1.hbs
@@ -22,6 +22,11 @@
{{{message}}}
{{/each}}
</div>
+{{#if view.jdbcSetupMessage}}
+ <div class="alert alert-warning">
+ {{{view.jdbcSetupMessage}}}
+ </div>
+{{/if}}
<div class="btn-area">
<a class="btn btn-success pull-right" {{bindAttr disabled="isSubmitDisabled"}} {{action next}}>{{t common.next}} →</a>
</div>
http://git-wip-us.apache.org/repos/asf/ambari/blob/53013484/ambari-web/app/templates/main/service/reassign/step7.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/service/reassign/step7.hbs b/ambari-web/app/templates/main/service/reassign/step7.hbs
new file mode 100644
index 0000000..defea53
--- /dev/null
+++ b/ambari-web/app/templates/main/service/reassign/step7.hbs
@@ -0,0 +1,18 @@
+{{!
+* 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.
+}}
+{{template "templates/main/admin/highAvailability/progress"}}
http://git-wip-us.apache.org/repos/asf/ambari/blob/53013484/ambari-web/app/utils/ajax/ajax.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/ajax/ajax.js b/ambari-web/app/utils/ajax/ajax.js
index a853d3b..3d9206e 100644
--- a/ambari-web/app/utils/ajax/ajax.js
+++ b/ambari-web/app/utils/ajax/ajax.js
@@ -2141,6 +2141,74 @@ var urls = {
data: JSON.stringify(data.data)
}
}
+ },
+
+ 'service.mysql.clean': {
+ 'real': '/clusters/{clusterName}/requests',
+ 'mock': '',
+ 'format': function (data) {
+ return {
+ type: 'POST',
+ data: JSON.stringify({
+ "RequestInfo": {
+ "command" : "CLEAN", "context" : "Clean MYSQL Server"
+ },
+ "Requests/resource_filters": [{
+ "service_name" : "HIVE",
+ "component_name" : "MYSQL_SERVER",
+ "hosts": data.host
+ }]
+ })
+ }
+ }
+ },
+
+ 'service.mysql.configure': {
+ 'real': '/clusters/{clusterName}/requests',
+ 'mock': '',
+ 'format': function (data) {
+ return {
+ type: 'POST',
+ data: JSON.stringify({
+ "RequestInfo": {
+ "command" : "CONFIGURE", "context" : "Configure MYSQL Server"
+ },
+ "Requests/resource_filters": [{
+ "service_name" : "HIVE",
+ "component_name" : "MYSQL_SERVER",
+ "hosts": data.host
+ }]
+ })
+ }
+ }
+ },
+
+ 'service.mysql.testHiveConnection': {
+ 'real': '/requests',
+ 'mock': '',
+ 'format': function (data) {
+ return {
+ type: 'POST',
+ data: JSON.stringify({
+ "RequestInfo": {
+ "context": "Check host",
+ "action": "check_host",
+ "parameters":{
+ "db_name": data.db_name,
+ "user_name": data.db_user,
+ "user_passwd": data.db_pass,
+ "db_connection_url": data.db_connection_url,
+ "jdk_location": data.jdk_location,
+ "threshold":"60",
+ "ambari_server_host": "c6403.ambari.apache.org",
+ "check_execute_list":"db_connection_check",
+ "java_home": data.java_home,
+ "jdk_name": data.jdk_name
+ }
+ },
+ "Requests/resource_filters": [{"hosts": data.hosts}]})
+ }
+ }
}
};
/**
http://git-wip-us.apache.org/repos/asf/ambari/blob/53013484/ambari-web/app/views.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views.js b/ambari-web/app/views.js
index 3b45d59..e5770d7 100644
--- a/ambari-web/app/views.js
+++ b/ambari-web/app/views.js
@@ -294,6 +294,7 @@ require('views/wizard/step4_view');
require('views/wizard/step5_view');
require('views/wizard/step6_view');
require('views/wizard/step7_view');
+require('views/main/service/reassign/step7_view');
require('views/wizard/step8_view');
require('views/wizard/step9_view');
require('views/wizard/step9/hostLogPopupBody_view');
http://git-wip-us.apache.org/repos/asf/ambari/blob/53013484/ambari-web/app/views/main/admin/highAvailability/progress_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/admin/highAvailability/progress_view.js b/ambari-web/app/views/main/admin/highAvailability/progress_view.js
index 45cb00f..dba80dc 100644
--- a/ambari-web/app/views/main/admin/highAvailability/progress_view.js
+++ b/ambari-web/app/views/main/admin/highAvailability/progress_view.js
@@ -43,5 +43,69 @@ App.HighAvailabilityProgressPageView = Em.View.extend(App.wizardProgressPageView
}
}.property(),
- notice: Em.I18n.t('admin.highAvailability.wizard.progressPage.notice.inProgress')
+ notice: Em.I18n.t('admin.highAvailability.wizard.progressPage.notice.inProgress'),
+
+ noticeClass: 'alert alert-info',
+
+ onStatusChange: function () {
+ var status = this.get('controller.status');
+ if (status === 'COMPLETED') {
+ this.set('notice', this.get('noticeCompleted'));
+ this.set('noticeClass', 'alert alert-success');
+ } else if (status === 'FAILED') {
+ this.set('notice', this.get('noticeFailed'));
+ this.set('noticeClass', 'alert alert-error');
+ } else {
+ this.set('notice', this.get('noticeInProgress'));
+ this.set('noticeClass', 'alert alert-info');
+ }
+ }.observes('controller.status'),
+
+ taskView: Em.View.extend({
+ icon: '',
+ iconColor: '',
+ linkClass: '',
+
+ didInsertElement: function () {
+ this.onStatus();
+ $('body').tooltip({
+ selector: '[rel=tooltip]'
+ });
+ },
+
+ barWidth: function () {
+ return 'width: ' + this.get('content.progress') + '%;';
+ }.property('content.progress'),
+
+ onStatus: function () {
+ var linkClass = !!this.get('content.requestIds.length') ? 'active-link' : 'active-text';
+ this.set('linkClass', linkClass);
+ if (this.get('content.status') === 'IN_PROGRESS') {
+ this.set('icon', 'icon-cog');
+ this.set('iconColor', 'text-info');
+ } else if (this.get('content.status') === 'FAILED') {
+ this.set('icon', 'icon-exclamation-sign');
+ this.set('iconColor', 'text-error');
+ } else if (this.get('content.status') === 'COMPLETED') {
+ this.set('icon', 'icon-ok');
+ this.set('iconColor', 'text-success');
+ } else {
+ this.set('icon', 'icon-cog');
+ this.set('iconColor', '');
+ this.set('linkClass', 'not-active-link');
+ }
+ }.observes('content.status', 'content.hosts.length'),
+
+ showProgressBar: function () {
+ return this.get('content.status') === "IN_PROGRESS";
+ }.property('content.status'),
+
+ hidePercent: function() {
+ return this.get('content.command') === 'testDBConnection';
+ }.property('content.command'),
+
+ showDBTooltip: function() {
+ return this.get('content.command') !== 'testDBConnection';
+ }.property('content.command')
+ })
});
http://git-wip-us.apache.org/repos/asf/ambari/blob/53013484/ambari-web/app/views/main/service/reassign/step1_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/reassign/step1_view.js b/ambari-web/app/views/main/service/reassign/step1_view.js
index ddabf14..1e6b13e 100644
--- a/ambari-web/app/views/main/service/reassign/step1_view.js
+++ b/ambari-web/app/views/main/service/reassign/step1_view.js
@@ -32,6 +32,18 @@ App.ReassignMasterWizardStep1View = Em.View.extend({
return messages;
}.property('controller.content.reassign.display_name','controller.content.hasManualSteps'),
+ jdbcSetupMessage: function() {
+ if(['HIVE_SERVER', 'HIVE_METASTORE', 'OOZIE_SERVER'].contains(this.get('controller.content.reassign.component_name'))) {
+ if(this.get('controller.content.reassign.component_name') === 'OOZIE_SERVER' && this.get('controller.databaseType') === 'derby') {
+ return false;
+ }
+
+ return Em.I18n.t('services.service.config.database.msg.jdbcSetup').format(this.get('controller.databaseType'), this.get('controller.databaseType'));
+ }
+
+ return false;
+ }.property('controller.content.reassign.display_name, controller.databaseType'),
+
templateName: require('templates/main/service/reassign/step1')
});
http://git-wip-us.apache.org/repos/asf/ambari/blob/53013484/ambari-web/app/views/main/service/reassign/step5_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/reassign/step5_view.js b/ambari-web/app/views/main/service/reassign/step5_view.js
index 5b7e53f..6947d4b 100644
--- a/ambari-web/app/views/main/service/reassign/step5_view.js
+++ b/ambari-web/app/views/main/service/reassign/step5_view.js
@@ -27,7 +27,7 @@ App.ReassignMasterWizardStep5View = Em.View.extend({
if (!this.get('controller.content.componentsWithManualCommands').contains(this.get('controller.content.reassign.component_name'))) {
return '';
}
- var componentDir = this.get('controller.content.componentDir');
+ var componentDir = this.get('controller.content.componentDir') || '';
var componentDirCmd = componentDir.replace(/,/g, ' ');
var sourceHost = this.get('controller.content.reassignHosts.source');
var targetHost = this.get('controller.content.reassignHosts.target');
http://git-wip-us.apache.org/repos/asf/ambari/blob/53013484/ambari-web/app/views/main/service/reassign/step7_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/reassign/step7_view.js b/ambari-web/app/views/main/service/reassign/step7_view.js
new file mode 100644
index 0000000..2e5f470
--- /dev/null
+++ b/ambari-web/app/views/main/service/reassign/step7_view.js
@@ -0,0 +1,43 @@
+/**
+ * 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.ReassignMasterWizardStep7View = App.HighAvailabilityProgressPageView.extend({
+
+ headerTitle: Em.I18n.t('services.reassign.step7.header'),
+
+ noticeInProgress: function () {
+ return Em.I18n.t('services.reassign.step7.info');
+ }.property(),
+
+ noticeFailed: function () {
+ return Em.I18n.t('services.reassign.step7.failed');
+ }.property(),
+
+ noticeCompleted: function () {
+ return Em.I18n.t('services.reassign.step7.success');
+ }.property(),
+
+ submitButtonText: function () {
+ return Em.I18n.t('common.complete') + ' →';
+ }.property(),
+
+ templateName: require('templates/main/service/reassign/step7')
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/53013484/ambari-web/app/views/main/service/reassign_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/reassign_view.js b/ambari-web/app/views/main/service/reassign_view.js
index 47f1860..fd2776d 100644
--- a/ambari-web/app/views/main/service/reassign_view.js
+++ b/ambari-web/app/views/main/service/reassign_view.js
@@ -23,6 +23,38 @@ App.ReassignMasterView = Em.View.extend(App.WizardMenuMixin, {
templateName: require('templates/main/service/reassign'),
+ isStep1Disabled: function () {
+ return this.isStepDisabled(1);
+ }.property('controller.isStepDisabled.@each.value').cacheable(),
+
+ isStep2Disabled: function () {
+ return this.isStepDisabled(2);
+ }.property('controller.isStepDisabled.@each.value').cacheable(),
+
+ isStep3Disabled: function () {
+ return this.isStepDisabled(3);
+ }.property('controller.isStepDisabled.@each.value').cacheable(),
+
+ isStep4Disabled: function () {
+ return this.isStepDisabled(4);
+ }.property('controller.isStepDisabled.@each.value').cacheable(),
+
+ isStep5Disabled: function () {
+ return this.isStepDisabled(5);
+ }.property('controller.isStepDisabled.@each.value').cacheable(),
+
+ isStep6Disabled: function () {
+ return this.isStepDisabled(6);
+ }.property('controller.isStepDisabled.@each.value').cacheable(),
+
+ isStep7Disabled: function () {
+ return this.isStepDisabled(7);
+ }.property('controller.isStepDisabled.@each.value').cacheable(),
+
+ isStepDisabled: function (index) {
+ return this.get('controller.isStepDisabled').findProperty('step', index).get('value');
+ },
+
isLoaded: false,
willInsertElement: function() {
http://git-wip-us.apache.org/repos/asf/ambari/blob/53013484/ambari-web/app/views/wizard/controls_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/wizard/controls_view.js b/ambari-web/app/views/wizard/controls_view.js
index a4cbf3f..ac0e015 100644
--- a/ambari-web/app/views/wizard/controls_view.js
+++ b/ambari-web/app/views/wizard/controls_view.js
@@ -60,25 +60,10 @@ App.ServiceConfigPopoverSupport = Ember.Mixin.create({
});
/**
- * if config value contains &|<|>|"|'
- * input field converts it to &|<|>|"|'
- * this mixin helps to aviod such convertation and show values as is.
- */
-App.SkipXmlEscapingSupport = Ember.Mixin.create({
- didInsertElement: function() {
- this._super();
- if (this.get('serviceConfig.value').match(/(&|<|>|"|')/g)) {
- this.set('value', this.get('serviceConfig.value').replace('&','&'));
- this.set('value', this.get('value').replace('&','&'));
- }
- }
-});
-
-/**
* Default input control
* @type {*}
*/
-App.ServiceConfigTextField = Ember.TextField.extend(App.ServiceConfigPopoverSupport, App.SkipXmlEscapingSupport, {
+App.ServiceConfigTextField = Ember.TextField.extend(App.ServiceConfigPopoverSupport, {
valueBinding: 'serviceConfig.value',
classNameBindings: 'textFieldClassName',
@@ -171,7 +156,7 @@ App.ServiceConfigPasswordField = Ember.TextField.extend({
* Textarea control
* @type {*}
*/
-App.ServiceConfigTextArea = Ember.TextArea.extend(App.ServiceConfigPopoverSupport, App.SkipXmlEscapingSupport, {
+App.ServiceConfigTextArea = Ember.TextArea.extend(App.ServiceConfigPopoverSupport, {
valueBinding: 'serviceConfig.value',
rows: 4,
@@ -182,7 +167,7 @@ App.ServiceConfigTextArea = Ember.TextArea.extend(App.ServiceConfigPopoverSuppor
* Textarea control for content type
* @type {*}
*/
-App.ServiceConfigTextAreaContent = Ember.TextArea.extend(App.ServiceConfigPopoverSupport, App.SkipXmlEscapingSupport, {
+App.ServiceConfigTextAreaContent = Ember.TextArea.extend(App.ServiceConfigPopoverSupport, {
valueBinding: 'serviceConfig.value',
rows: 20,
@@ -246,7 +231,6 @@ App.ServiceConfigRadioButtons = Ember.View.extend({
connectionUrl.set('value', "jdbc:mysql://" + this.get('hostName') + "/" + this.get('databaseName') + "?createDatabaseIfNotExist=true");
dbClass.set('value', "com.mysql.jdbc.Driver");
break;
- case 'New PostgreSQL Database':
case Em.I18n.t('services.service.config.hive.oozie.postgresql'):
connectionUrl.set('value', "jdbc:postgresql://" + this.get('hostName') + ":5432/" + this.get('databaseName'));
dbClass.set('value', "org.postgresql.Driver");
@@ -358,7 +342,6 @@ App.ServiceConfigRadioButtons = Ember.View.extend({
if (this.get('serviceConfig.serviceName') === 'HIVE') {
switch (value) {
case 'New MySQL Database':
- case 'New PostgreSQL Database':
hostname = this.get('categoryConfigsAll').findProperty('name', 'hive_ambari_host');
break;
case 'Existing MySQL Database':
@@ -454,7 +437,7 @@ App.ServiceConfigRadioButtons = Ember.View.extend({
*
* @method handleDBConnectionProperty
**/
- handleDBConnectionProperty: function () {
+ handleDBConnectionProperty: function() {
if (!['addServiceController', 'installerController'].contains(App.clusterStatus.wizardControllerName)) return;
var handledProperties = ['oozie_database', 'hive_database', 'sink_database'];
var currentValue = this.get('serviceConfig.value');
@@ -464,16 +447,16 @@ App.ServiceConfigRadioButtons = Ember.View.extend({
var currentDBType = currentValue.match(databasesTypes)[0];
var existingDatabase = /existing/gi.test(currentValue);
// db connection check button show up if existed db selected
-
- var propertyAppendTo1 = this.get('categoryConfigsAll').findProperty('displayName', 'Database URL');
- if (currentDB && existingDatabase) {
- if (handledProperties.contains(this.get('serviceConfig.name'))) {
- if (propertyAppendTo1) propertyAppendTo1.set('additionalView', App.CheckDBConnectionView.extend({databaseName: currentDB}));
+ if (App.supports.databaseConnection) {
+ var propertyAppendTo1 = this.get('categoryConfigsAll').findProperty('displayName', 'Database URL');
+ if (currentDB && existingDatabase) {
+ if (handledProperties.contains(this.get('serviceConfig.name'))) {
+ if (propertyAppendTo1) propertyAppendTo1.set('additionalView', App.CheckDBConnectionView.extend({databaseName: currentDB}));
+ }
+ } else {
+ propertyAppendTo1.set('additionalView', null);
}
- } else {
- propertyAppendTo1.set('additionalView', null);
}
-
// warning msg under database type radio buttons, to warn the user to setup jdbc driver if existed db selected
var propertyHive = this.get('categoryConfigsAll').findProperty('displayName', 'Hive Database');
var propertyOozie = this.get('categoryConfigsAll').findProperty('displayName', 'Oozie Database');