Repository: ambari Updated Branches: refs/heads/trunk 41247c174 -> 8ee7ddbb9
Revert "AMBARI-16703. Takeover config merge should handle AMS hbase configs (aonishuk)" This reverts commit 291577035c076435376c224c8d987ad6bd8b702e. Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/8ee7ddbb Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/8ee7ddbb Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/8ee7ddbb Branch: refs/heads/trunk Commit: 8ee7ddbb9806269cf2ee9793b9ca7a340d9c042a Parents: 41247c1 Author: Andrew Onishuk <[email protected]> Authored: Thu May 19 14:59:18 2016 +0300 Committer: Andrew Onishuk <[email protected]> Committed: Thu May 19 14:59:18 2016 +0300 ---------------------------------------------------------------------- .../resources/scripts/takeover_config_merge.py | 33 ++++++++++++-------- .../scripts/takeover_files_mapping.json | 23 -------------- nohup.out | 4 --- 3 files changed, 20 insertions(+), 40 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/8ee7ddbb/ambari-server/src/main/resources/scripts/takeover_config_merge.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/scripts/takeover_config_merge.py b/ambari-server/src/main/resources/scripts/takeover_config_merge.py index 075f99f..f940f27 100644 --- a/ambari-server/src/main/resources/scripts/takeover_config_merge.py +++ b/ambari-server/src/main/resources/scripts/takeover_config_merge.py @@ -33,7 +33,7 @@ import ConfigParser logger = logging.getLogger('AmbariTakeoverConfigMerge') -CONFIG_MAPPING_HELP_TEXT = """ +LOG4J_HELP_TEXT = """ JSON file should content map with {regex_path : <service>-log4j} Example: {".+/hadoop/.+/log4j.properties" : "hdfs-log4j", @@ -158,6 +158,13 @@ class ConfigMerge: SUPPORTED_EXTENSIONS = ['.xml', '.yaml', '.properties', '.sh'] SUPPORTED_FILENAME_ENDINGS = {".sh" : "-env"} UNKNOWN_FILES_MAPPING_FILE = None + SERVICE_TO_AMBARI_CONFIG_NAME = { + "storm.yaml": "storm-site", + "runtime.properties" : "falcon-runtime", + "startup.properties" : "falcon-startup", + "flume-conf.properties" : "flume-conf", + "pig.properties" : "pig-properties" + } CONFIGS_WITH_CONTENT = ['pig-properties', '-log4j'] @@ -181,8 +188,11 @@ class ConfigMerge: logger.warn("File {0} is not configurable by Ambari. Skipping...".format(file_path)) continue config_name = None + if file in ConfigMerge.SERVICE_TO_AMBARI_CONFIG_NAME: + config_name = ConfigMerge.SERVICE_TO_AMBARI_CONFIG_NAME[file] - if ConfigMerge.UNKNOWN_FILES_MAPPING_FILE: + #hack for log4j.properties files + elif ConfigMerge.UNKNOWN_FILES_MAPPING_FILE: for path_regex, name in ConfigMerge.CONTENT_UNKNOWN_FILES_MAPPING_FILE.iteritems(): match = re.match(path_regex, os.path.relpath(file_path, ConfigMerge.INPUT_DIR)) if match: @@ -354,8 +364,8 @@ def main(): metavar="FILE", help="Output directory. [default: /tmp]") parser.add_option("-i", "--inputdir", dest="inputDir", help="Input directory.") - parser.add_option("-u", '--unknown-files-mapping-file',dest="unknown_files_mapping_file", - metavar="FILE", help=CONFIG_MAPPING_HELP_TEXT, default="takeover_files_mapping.json") + parser.add_option("-u", '--unknown-files-mapping-file',dest="unknown_files_mapping_file", default=None, + metavar="FILE", help=LOG4J_HELP_TEXT) (options, args) = parser.parse_args() @@ -368,6 +378,12 @@ def main(): ConfigMerge.INPUT_DIR = options.inputDir ConfigMerge.OUTPUT_DIR = options.outputDir + #hack for logf4.properties files + if options.unknown_files_mapping_file: + ConfigMerge.UNKNOWN_FILES_MAPPING_FILE = options.unknown_files_mapping_file + with open(options.unknown_files_mapping_file) as f: + ConfigMerge.CONTENT_UNKNOWN_FILES_MAPPING_FILE = json.load(f) + if not os.path.exists(ConfigMerge.OUTPUT_DIR): os.makedirs(ConfigMerge.OUTPUT_DIR) @@ -382,15 +398,6 @@ def main(): stdout_handler.setFormatter(formatter) logger.addHandler(stdout_handler) - #unknown file mapping - if options.unknown_files_mapping_file and os.path.exists(options.unknown_files_mapping_file): - ConfigMerge.UNKNOWN_FILES_MAPPING_FILE = options.unknown_files_mapping_file - with open(options.unknown_files_mapping_file) as f: - ConfigMerge.CONTENT_UNKNOWN_FILES_MAPPING_FILE = json.load(f) - else: - logger.warning("Config mapping file was not found at {0}. " - "Please provide it at the given path or provide a different path to it using -u option.".format(options.unknown_files_mapping_file)) - filePaths = ConfigMerge.get_all_supported_files_grouped_by_name() logger.info("Writing logs into '{0}' file".format(logegr_file_name)) logger.debug("Following configuration files found:\n{0}".format(filePaths.items())) http://git-wip-us.apache.org/repos/asf/ambari/blob/8ee7ddbb/ambari-server/src/main/resources/scripts/takeover_files_mapping.json ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/scripts/takeover_files_mapping.json b/ambari-server/src/main/resources/scripts/takeover_files_mapping.json deleted file mode 100644 index 69b4085..0000000 --- a/ambari-server/src/main/resources/scripts/takeover_files_mapping.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - ".+/ams-hbase/.+/hbase-site.xml" : "ams-hbase-site", - ".+/ams-hbase/.+/log4j.properties" : "ams-hbase-log4j", - ".+/ambari-metrics-collector/.+/log4j.properties" : "ams-log4j", - ".+/etc/accumulo/.+/log4j.properties" : "accumulo-log4j", - ".+/etc/atlas/.+/log4j.properties" : "atlas-log4j", - ".+/etc/flume/.+/log4j.properties" : "flume-log4j", - ".+/flume-conf.properties" : "flume-conf", - ".+/etc/zookeeper/.+/log4j.properties" : "zookeeper-log4j", - ".+/etc/hbase/.+/log4j.properties" : "hbase-log4j", - ".+/etc/ams-hbase/.+/log4j.properties" : "ams-hbase-log4j", - ".+/etc/pig/.+/log4j.properties" : "pig-log4j", - ".+/pig.properties" : "pig-properties", - ".+/etc/hadoop/.+/log4j.properties" : "hdfs-log4j", - ".+/etc/hive/.+/log4j.properties" : "hive-log4j", - ".+/etc/kafka/.+/log4j.properties" : "kafka-log4j", - ".+/etc/oozie/.+/log4j.properties" : "oozie-log4j", - ".+/etc/slider/.+/log4j.properties" : "slider-log4j", - ".+/etc/ambari-metrics-collector/.+/log4j.properties" : "ams-log4j", - ".+/storm.yaml" : "storm-site", - ".+/runtime.properties" : "falcon-runtime", - ".+/startup.properties" : "falcon-startup" -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/8ee7ddbb/nohup.out ---------------------------------------------------------------------- diff --git a/nohup.out b/nohup.out deleted file mode 100644 index 363da0e..0000000 --- a/nohup.out +++ /dev/null @@ -1,4 +0,0 @@ -[17613:17649:0518/184644:ERROR:nss_util.cc(839)] After loading Root Certs, loaded==false: NSS error code: -8018 -Created new window in existing browser session. -[17755:17792:0518/184909:ERROR:nss_util.cc(839)] After loading Root Certs, loaded==false: NSS error code: -8018 -Created new window in existing browser session.
