You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by jg...@apache.org on 2018/06/01 17:42:51 UTC
[ambari] 03/15: AMBARI-23972. Update code for : (1).
'mpack-recommendations' directory creation and (2). putting
'mpack_advisor_wrapper.py' in '/var/lib/ambari-server/resources/scripts/'
folder.
This is an automated email from the ASF dual-hosted git repository.
jgolieb pushed a commit to branch branch-feature-AMBARI-14714-mpack-advisor
in repository https://gitbox.apache.org/repos/asf/ambari.git
commit ddcf2dda276f51613ad7baa858a795759453576a
Author: Swapan Shridhar <ss...@hortonworks.com>
AuthorDate: Tue May 29 13:32:57 2018 -0700
AMBARI-23972. Update code for : (1). 'mpack-recommendations' directory creation and (2). putting 'mpack_advisor_wrapper.py' in '/var/lib/ambari-server/resources/scripts/' folder.
---
ambari-server/conf/unix/ambari.properties | 1 +
ambari-server/src/main/assemblies/server.xml | 13 +++++++++++++
.../src/main/python/ambari_server/BackupRestore.py | 3 ++-
.../src/main/python/ambari_server/serverConfiguration.py | 5 +++++
4 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/ambari-server/conf/unix/ambari.properties b/ambari-server/conf/unix/ambari.properties
index 7c57c51..890cffe 100644
--- a/ambari-server/conf/unix/ambari.properties
+++ b/ambari-server/conf/unix/ambari.properties
@@ -50,6 +50,7 @@ server.version.file=$ROOT/var/lib/ambari-server/resources/version
webapp.dir=$ROOT/usr/lib/ambari-server/web
pid.dir=$ROOT/var/run/ambari-server
recommendations.dir=$ROOT/var/run/ambari-server/stack-recommendations
+mpackrecommendations.dir=$ROOT/var/run/ambari-server/mpack-recommendations
bootstrap.dir=$ROOT/var/run/ambari-server/bootstrap
bootstrap.script=$ROOT/usr/lib/ambari-server/lib/ambari_server/bootstrap.py
bootstrap.setup_agent.script=$ROOT/usr/lib/ambari-server/lib/ambari_server/setupAgent.py
diff --git a/ambari-server/src/main/assemblies/server.xml b/ambari-server/src/main/assemblies/server.xml
index d5b9a4f..3a6a054 100644
--- a/ambari-server/src/main/assemblies/server.xml
+++ b/ambari-server/src/main/assemblies/server.xml
@@ -94,6 +94,14 @@
<fileSet>
<directoryMode>755</directoryMode>
<directory>${empty.dir}</directory>
+ <outputDirectory>/var/run/ambari-server/mpack-recommendations</outputDirectory>
+ <excludes>
+ <exclude>*/**</exclude>
+ </excludes>
+ </fileSet>
+ <fileSet>
+ <directoryMode>755</directoryMode>
+ <directory>${empty.dir}</directory>
<outputDirectory>/var/log/ambari-server</outputDirectory>
<excludes>
<exclude>*/**</exclude>
@@ -431,6 +439,11 @@
</file>
<file>
<fileMode>755</fileMode>
+ <source>src/main/resources/scripts/mpack_advisor_wrapper.py</source>
+ <outputDirectory>/var/lib/ambari-server/resources/scripts</outputDirectory>
+ </file>
+ <file>
+ <fileMode>755</fileMode>
<source>src/main/resources/stacks/service_advisor.py</source>
<outputDirectory>/var/lib/ambari-server/resources/stacks</outputDirectory>
</file>
diff --git a/ambari-server/src/main/python/ambari_server/BackupRestore.py b/ambari-server/src/main/python/ambari_server/BackupRestore.py
index d418b7d..9ea6304 100644
--- a/ambari-server/src/main/python/ambari_server/BackupRestore.py
+++ b/ambari-server/src/main/python/ambari_server/BackupRestore.py
@@ -32,7 +32,8 @@ SUPPORTED_PROCESSES = [BACKUP_PROCESS, RESTORE_PROCESS]
AMBARI_FILESYSTEM_STATE = [AmbariPath.get("/etc/ambari-server/conf"),
AmbariPath.get("/var/lib/ambari-server/resources"),
AmbariPath.get("/var/run/ambari-server/bootstrap/"),
- AmbariPath.get("/var/run/ambari-server/stack-recommendations")]
+ AmbariPath.get("/var/run/ambari-server/stack-recommendations"),
+ AmbariPath.get("/var/run/ambari-server/mpack-recommendations")]
# What to use when no path/archive is specified
DEFAULT_ARCHIVE = AmbariPath.get("/var/lib/ambari-server/Ambari_State_Backup.zip")
diff --git a/ambari-server/src/main/python/ambari_server/serverConfiguration.py b/ambari-server/src/main/python/ambari_server/serverConfiguration.py
index 376f30f..29b84be 100644
--- a/ambari-server/src/main/python/ambari_server/serverConfiguration.py
+++ b/ambari-server/src/main/python/ambari_server/serverConfiguration.py
@@ -62,6 +62,7 @@ OS_TYPE_PROPERTY = "server.os_type"
BOOTSTRAP_DIR_PROPERTY = "bootstrap.dir"
RECOMMENDATIONS_DIR_PROPERTY = 'recommendations.dir'
+MPACK_RECOMMENDATIONS_DIR_PROPERTY = 'mpackrecommendations.dir'
AMBARI_CONF_VAR = "AMBARI_CONF_DIR"
AMBARI_PROPERTIES_FILE = "ambari.properties"
@@ -387,10 +388,12 @@ class ServerConfigDefaults(object):
self.PID_DIR = AmbariPath.get(os.sep + os.path.join("var", "run", "ambari-server"))
self.BOOTSTRAP_DIR = AmbariPath.get(os.sep + os.path.join("var", "run", "ambari-server", "bootstrap"))
self.RECOMMENDATIONS_DIR = AmbariPath.get(os.sep + os.path.join("var", "run", "ambari-server", "stack-recommendations"))
+ self.MPACK_RECOMMENDATIONS_DIR = AmbariPath.get(os.sep + os.path.join("var", "run", "ambari-server", "mpack-recommendations"))
else:
self.PID_DIR = properties.get_property(PID_DIR_PROPERTY)
self.BOOTSTRAP_DIR = properties.get_property(BOOTSTRAP_DIR_PROPERTY)
self.RECOMMENDATIONS_DIR = properties.get_property(RECOMMENDATIONS_DIR_PROPERTY)
+ self.MPACK_RECOMMENDATIONS_DIR = properties.get_property(MPACK_RECOMMENDATIONS_DIR_PROPERTY)
# this directories should be pre-created by user and be writable.
self.check_if_directories_writable([self.OUT_DIR, self.PID_DIR])
@@ -557,6 +560,8 @@ class ServerConfigDefaultsLinux(ServerConfigDefaults):
(AmbariPath.get("/etc/ambari-server/conf/ldap-password.dat"), "640", "{0}", False),
(self.RECOMMENDATIONS_DIR, "744", "{0}", True),
(self.RECOMMENDATIONS_DIR, "755", "{0}", False),
+ (self.MPACK_RECOMMENDATIONS_DIR, "744", "{0}", True),
+ (self.MPACK_RECOMMENDATIONS_DIR, "755", "{0}", False),
(AmbariPath.get("/var/lib/ambari-server/resources/data/"), "644", "{0}", False),
(AmbariPath.get("/var/lib/ambari-server/resources/data/"), "755", "{0}", False),
(AmbariPath.get("/var/lib/ambari-server/data/tmp/*"), "644", "{0}", True),
--
To stop receiving notification emails like this one, please contact
jgolieb@apache.org.