Browse Source

AMBARI-4826. Falcon: expose custom startup.properties and runtime.properties. (jaimin)

Jaimin Jetly 11 năm trước cách đây
mục cha
commit
a9bd173545

+ 2 - 2
ambari-server/src/main/resources/stacks/HDP/2.1.1/services/FALCON/package/scripts/falcon.py

@@ -57,13 +57,13 @@ def falcon(type, action = None):
                      mode=0644
       )
     if action == 'start':
-      Execute(format('env JAVA_HOME={java_home} FALCON_LOG_DIR=/var/log/falcon '
+      Execute(format('env JAVA_HOME={java_home} FALCON_LOG_DIR={falcon_log_dir} '
                      'FALCON_PID_DIR=/var/run/falcon FALCON_DATA_DIR={falcon_data_dir} '
                      '{falcon_home}/bin/falcon-start -port {falcon_port}'),
               user=params.falcon_user
       )
     if action == 'stop':
-      Execute(format('env JAVA_HOME={java_home} FALCON_LOG_DIR=/var/log/falcon '
+      Execute(format('env JAVA_HOME={java_home} FALCON_LOG_DIR={falcon_log_dir} '
                      'FALCON_PID_DIR=/var/run/falcon FALCON_DATA_DIR={falcon_data_dir} '
                      '{falcon_home}/bin/falcon-stop'),
               user=params.falcon_user

+ 16 - 6
ambari-web/app/controllers/wizard/step8_controller.js

@@ -1094,7 +1094,8 @@ App.WizardStep8Controller = Em.Controller.extend({
       this.get('serviceConfigTags').pushObject(this.createLog4jObj('PIG'));
     }
     if (selectedServices.someProperty('serviceName', 'FALCON')) {
-      this.get('serviceConfigTags').pushObject(this.createFalconSiteObj('FALCON'));
+      this.get('serviceConfigTags').pushObject(this.createFalconStartupSiteObj('FALCON'));
+      this.get('serviceConfigTags').pushObject(this.createFalconRuntimeSiteObj('FALCON'));
     }
     if (selectedServices.someProperty('serviceName', 'STORM')) {
       this.get('serviceConfigTags').pushObject(this.createStormSiteObj());
@@ -1430,13 +1431,22 @@ App.WizardStep8Controller = Em.Controller.extend({
   },
 
 
-  createFalconSiteObj: function (s) {
-    var configs = this.get('configs').filterProperty('filename', 'oozie-site.xml');
-    var falconProperties = {};
+  createFalconStartupSiteObj: function (s) {
+    var configs = this.get('configs').filterProperty('filename', 'falcon-startup.properties.xml');
+    var falconStartupProperties = {};
+    configs.forEach(function (_configProperty) {
+      falconStartupProperties[_configProperty.name] = App.config.escapeXMLCharacters(_configProperty.value);
+    }, this);
+    return {type: 'falcon-startup.properties', tag: 'version1', properties: falconStartupProperties};
+  },
+
+  createFalconRuntimeSiteObj: function (s) {
+    var configs = this.get('configs').filterProperty('filename', 'falcon-runtime.properties.xml');
+    var falconRuntimeProperties = {};
     configs.forEach(function (_configProperty) {
-      falconProperties[_configProperty.name] = App.config.escapeXMLCharacters(_configProperty.value);
+      falconRuntimeProperties[_configProperty.name] = App.config.escapeXMLCharacters(_configProperty.value);
     }, this);
-    return {type: 'oozie-site', tag: 'version' + (new Date()).getTime(), properties: falconProperties};
+    return {type: 'falcon-runtime.properties', tag: 'version1', properties: falconRuntimeProperties};
   },
 
   ajaxQueueFinished: function () {

+ 26 - 0
ambari-web/app/data/HDP2/global_properties.js

@@ -1376,6 +1376,32 @@ module.exports =
       "serviceName": "FALCON",
       "category": "Falcon"
     },
+    {
+      "id": "puppet var",
+      "name": "falcon_log_dir",
+      "displayName": "Falcon Log Dir",
+      "description": "Directory for Falcon logs",
+      "defaultValue": "/var/log/falcon",
+      "displayType": "directory",
+      "isOverridable": false,
+      "isVisible": true,
+      "isRequiredByAgent": true,
+      "serviceName": "FALCON",
+      "category": "Advanced"
+    },
+    {
+      "id": "puppet var",
+      "name": "falcon_pid_dir",
+      "displayName": "Falcon PID Dir",
+      "description": "Directory in which the pid files for Falcon processes will be created",
+      "defaultValue": "/var/run/falcon",
+      "displayType": "directory",
+      "isOverridable": false,
+      "isVisible": true,
+      "isRequiredByAgent": true,
+      "serviceName": "FALCON",
+      "category": "Advanced"
+    },
   /**********************************************STORM***************************************/
     {
       "id": "puppet var",

+ 3 - 1
ambari-web/app/data/service_configs.js

@@ -226,7 +226,9 @@ module.exports = [
     configCategories: [
       App.ServiceConfigCategory.create({ name: 'Falcon', displayName : 'Falcon Server'}),
       App.ServiceConfigCategory.create({ name: 'Falcon - Oozie integration', displayName : 'Falcon - Oozie integration'}),
-      App.ServiceConfigCategory.create({ name: 'Advanced', displayName : 'Advanced'})
+      App.ServiceConfigCategory.create({ name: 'Advanced', displayName : 'Advanced'}),
+      App.ServiceConfigCategory.create({ name: 'AdvancedFalconStartupSite', displayName : 'Custom startup.properties', siteFileName: 'falcon-startup.properties.xml', canAddProperty: true}),
+      App.ServiceConfigCategory.create({ name: 'AdvancedFalconRuntimeSite', displayName : 'Custom runtime.properties', siteFileName: 'falcon-runtime.properties.xml', canAddProperty: true})
     ],
     sites: ['global', 'oozie-site'],
     configs: []