Browse Source

AMBARI-4276. Falcon initial implementation. (Mikhail Bayuk via alexantonenko)

Alex Antonenko 11 years ago
parent
commit
6c6f00122e
29 changed files with 226 additions and 7 deletions
  1. 16 0
      ambari-web/app/assets/data/alerts/HDP2/alerts.json
  2. 4 0
      ambari-web/app/assets/data/clusters/HDP2/cluster.json
  3. 3 0
      ambari-web/app/assets/data/clusters/cluster.json
  4. 10 1
      ambari-web/app/assets/data/hosts/HDP2/hc_host_status.json
  5. 8 0
      ambari-web/app/assets/data/hosts/HDP2/hosts.json
  6. 8 1
      ambari-web/app/assets/data/services/HDP2/services.json
  7. 12 1
      ambari-web/app/assets/data/wizard/stack/hdp/version/2.0.1.json
  8. 12 1
      ambari-web/app/assets/data/wizard/stack/hdp/version/2.0.5.json
  9. 11 0
      ambari-web/app/assets/data/wizard/stack/stacks.json
  10. 1 0
      ambari-web/app/config.js
  11. 7 0
      ambari-web/app/controllers/wizard/step5_controller.js
  12. 19 0
      ambari-web/app/controllers/wizard/step8_controller.js
  13. 29 1
      ambari-web/app/data/HDP2/global_properties.js
  14. 10 0
      ambari-web/app/data/review_configs.js
  15. 8 0
      ambari-web/app/data/service_components.js
  16. 9 0
      ambari-web/app/data/service_configs.js
  17. 10 1
      ambari-web/app/data/services.js
  18. 1 0
      ambari-web/app/mappers/server_data_mapper.js
  19. 2 0
      ambari-web/app/mappers/service_metrics_mapper.js
  20. 1 0
      ambari-web/app/models/host_component.js
  21. 11 0
      ambari-web/app/models/quick_links.js
  22. 2 0
      ambari-web/app/models/service.js
  23. 1 0
      ambari-web/app/templates.js
  24. 3 0
      ambari-web/app/templates/main/service/info/summary.hbs
  25. 19 0
      ambari-web/app/templates/main/service/info/summary/falcon.hbs
  26. 4 0
      ambari-web/app/utils/helper.js
  27. 3 0
      ambari-web/app/views/common/quick_view_link_view.js
  28. 1 1
      ambari-web/app/views/main/menu.js
  29. 1 0
      ambari-web/app/views/main/service/info/summary.js

+ 16 - 0
ambari-web/app/assets/data/alerts/HDP2/alerts.json

@@ -633,6 +633,22 @@
               "last_check" : "1375308415",
               "service_type" : "ZOOKEEPER"
             },
+            {
+              "service_description" : "Falcon Server process down",
+              "host_name" : "dev01.hortonworks.com",
+              "current_attempt" : "1",
+              "current_state" : "0",
+              "plugin_output" : "TCP OK - 0.001 second response time on port 16000",
+              "last_hard_state_change" : "1375291434",
+              "last_hard_state" : "0",
+              "last_time_ok" : "1375308415",
+              "last_time_warning" : "0",
+              "last_time_unknown" : "0",
+              "last_time_critical" : "1375289980",
+              "is_flapping" : "0",
+              "last_check" : "1375308415",
+              "service_type" : "FALCON"
+            },
             {
               "service_description" : "Storm process down",
               "host_name" : "dev01.hortonworks.com",

+ 4 - 0
ambari-web/app/assets/data/clusters/HDP2/cluster.json

@@ -49,6 +49,10 @@
         "user" : "admin",
         "tag" : "version1"
       },
+      "falcon-site" : {
+        "user" : "admin",
+        "tag" : "version1"
+      },
       "storm-site" : {
         "user" : "admin",
         "tag" : "version1"

+ 3 - 0
ambari-web/app/assets/data/clusters/cluster.json

@@ -32,6 +32,9 @@
       "hue-site" : {
         "tag" : "version1"
       },
+      "falcon-site" : {
+        "tag" : "version1"
+      },
       "storm-site" : {
         "tag" : "version1"
       },

+ 10 - 1
ambari-web/app/assets/data/hosts/HDP2/hc_host_status.json

@@ -208,13 +208,22 @@
           }
         },
         {
-          "href" : "http://192.168.56.101:8080/api/v1/clusters/perf/hosts/dev01.hortonworks.com/host_components/NIMBUS",
+          "href" : "http://192.168.56.101:8080/api/v1/clusters/perf/hosts/dev01.hortonworks.com/host_components/SUPERVISOR",
           "HostRoles" : {
             "cluster_name" : "perf",
             "component_name" : "SUPERVISOR",
             "host_name" : "dev01.hortonworks.com",
             "state" : "STARTED"
           }
+        },
+        {
+          "href" : "http://192.168.56.101:8080/api/v1/clusters/perf/hosts/dev01.hortonworks.com/host_components/FALCON",
+          "HostRoles" : {
+            "cluster_name" : "perf",
+            "component_name" : "FALCON_SERVER",
+            "host_name" : "dev01.hortonworks.com",
+            "state" : "STARTED"
+          }
         }
       ]
     }

+ 8 - 0
ambari-web/app/assets/data/hosts/HDP2/hosts.json

@@ -291,6 +291,14 @@
             "component_name" : "SUPERVISOR",
             "host_name" : "dev01.hortonworks.com"
           }
+        },
+        {
+          "href" : "http://dev01.hortonworks.com:8080/api/v1/clusters/c1/hosts/dev01.hortonworks.com/host_components/FALCON",
+          "HostRoles" : {
+            "cluster_name" : "c1",
+            "component_name" : "FALCON_SERVER",
+            "host_name" : "dev01.hortonworks.com"
+          }
         }
       ]
     }

+ 8 - 1
ambari-web/app/assets/data/services/HDP2/services.json

@@ -78,6 +78,13 @@
         "service_name" : "ZOOKEEPER"
       }
     },
+    {
+      "href" : "http://192.168.56.101:8080/api/v1/clusters/cl/services/FALCON",
+      "ServiceInfo" : {
+        "cluster_name" : "cl",
+        "service_name" : "FALCON"
+      }
+    },
     {
       "href" : "http://192.168.56.101:8080/api/v1/clusters/cl/services/STORM",
       "ServiceInfo" : {
@@ -86,4 +93,4 @@
       }
     }
   ]
-}
+}

+ 12 - 1
ambari-web/app/assets/data/wizard/stack/hdp/version/2.0.1.json

@@ -144,6 +144,17 @@
         "service_version" : "2.0.3.22-1"
       }
     },
+    {
+      "href" : "http://192.168.56.101:8080/api/v1/stacks2/HDP/versions/2.0.1/stackServices/FALCON",
+      "StackServices" : {
+        "user_name" : "root",
+        "stack_version" : "2.0.1",
+        "service_name" : "FALCON",
+        "stack_name" : "HDP",
+        "comments" : "Falcon server",
+        "service_version" : "2.0.3.22-1"
+      }
+    },
     {
       "href" : "http://192.168.56.101:8080/api/v1/stacks2/HDP/versions/2.0.1/stackServices/STORM",
       "StackServices" : {
@@ -156,4 +167,4 @@
       }
     }
   ]
-}
+}

+ 12 - 1
ambari-web/app/assets/data/wizard/stack/hdp/version/2.0.5.json

@@ -144,6 +144,17 @@
         "service_version" : "2.0.3.22-1"
       }
     },
+    {
+      "href" : "http://192.168.56.101:8080/api/v1/stacks2/HDP/versions/2.0.1/stackServices/FALCON",
+      "StackServices" : {
+        "user_name" : "falcon",
+        "stack_version" : "2.0.1",
+        "service_name" : "FALCON",
+        "stack_name" : "HDP",
+        "comments" : "Falcon server",
+        "service_version" : "0.3"
+      }
+    },
     {
       "href" : "http://192.168.56.101:8080/api/v1/stacks2/HDP/versions/2.0.1/stackServices/STORM",
       "StackServices" : {
@@ -156,4 +167,4 @@
       }
     }
   ]
-}
+}

+ 11 - 0
ambari-web/app/assets/data/wizard/stack/stacks.json

@@ -874,6 +874,17 @@
             "user_name" : "root"
           }
         },
+        {
+          "href" : "http://192.168.56.101:8080/api/v1/stacks2/HDP/versions/2.0.5/stackServices/FALCON",
+          "StackServices" : {
+            "comments" : "Falcon server",
+            "service_name" : "FALCON",
+            "service_version" : "0.3",
+            "stack_name" : "HDP",
+            "stack_version" : "2.0.5",
+            "user_name" : "falcon"
+          }
+        },
         {
           "href" : "http://192.168.56.101:8080/api/v1/stacks2/HDP/versions/2.0.5/stackServices/STORM",
           "StackServices" : {

+ 1 - 0
ambari-web/app/config.js

@@ -60,6 +60,7 @@ App.supports = {
   addMasters: false,
   customizeSmokeTestUser: true,
   hue: false,
+  falcon: true,
   ldapGroupMapping: false,
   localRepositories: true,
   highAvailability: true,

+ 7 - 0
ambari-web/app/controllers/wizard/step5_controller.js

@@ -443,6 +443,13 @@ App.WizardStep5Controller = Em.Controller.extend({
         return this.getNagiosServer(noOfHosts);
       case 'HUE_SERVER':
         return this.getHueServer(noOfHosts);
+      case 'FALCON_SERVER':
+        return this.getHostForComponent(noOfHosts, {
+          "3" : 0,
+          "6" : 0,
+          "31" : 1,
+          "else" : 2
+        }).host_name;
       case 'NIMBUS':
         return this.getNimbusServer(noOfHosts);
       default:

+ 19 - 0
ambari-web/app/controllers/wizard/step8_controller.js

@@ -513,6 +513,9 @@ App.WizardStep8Controller = Em.Controller.extend({
           case 'HUE':
             this.loadHue(serviceObj);
             break;
+          case 'FALCON':
+            this.loadFalcon(serviceObj);
+            break;
           /* case 'TEZ':
            break;
            case 'PIG':
@@ -897,6 +900,22 @@ App.WizardStep8Controller = Em.Controller.extend({
     this.get('services').pushObject(pigObj);
   },
 
+  loadFalcon: function (falconObj) {
+    falconObj.get('service_components').forEach(function(component) {
+      switch (component.get('display_name')) {
+        case 'Server':
+          this.loadFalconValue(component);
+          break;
+      }
+    }, this);
+    this.get('services').pushObject(falconObj);
+  },
+
+  loadFalconValue: function(component) {
+    var falconHost = this.get('content.masterComponentHosts').filterProperty('display_name', 'Falcon Server');
+    component.set('component_value', falconHost[0].hostName);
+  },
+
   loadSTORM: function (stormObj) {
     stormObj.get('service_components').forEach(function(component) {
       switch (component.get('display_name')) {

+ 29 - 1
ambari-web/app/data/HDP2/global_properties.js

@@ -1270,6 +1270,20 @@ module.exports =
       "serviceName": "GANGLIA",
       "category": "Advanced"
     },
+  /**********************************************FALCON***************************************/
+    {
+      "id": "puppet var",
+      "name": "falcon_dir",
+      "displayName": "Run directory for Falcon",
+      "description": "",
+      "defaultValue": "/var/run/falcon",
+      "isReconfigurable": false,
+      "displayType": "directory",
+      "isVisible": true,
+      "isRequiredByAgent": true,
+      "serviceName": "FALCON",
+      "category": "Falcon"
+    },
   /**********************************************STORM***************************************/
     // @todo create real properties
     {
@@ -1552,6 +1566,20 @@ module.exports =
       "category": "Users and Groups",
       "belongsToService":["STORM"]
     },
+    {
+      "id": "puppet var",
+      "name": "falcon_user",
+      "displayName": "Falcon User",
+      "description": "User to run Falcon as",
+      "defaultValue": "falcon",
+      "isReconfigurable": false,
+      "displayType": "user",
+      "isOverridable": false,
+      "isVisible": true,
+      "serviceName":"MISC",
+      "category": "Users and Groups",
+      "belongsToService":["FALCON"]
+    },
     {
       "id": "puppet var",
       "name": "rrdcached_base_dir",
@@ -1565,7 +1593,7 @@ module.exports =
       "serviceName": "GANGLIA",
       "category": "General",
       "belongsToService":["GANGLIA"]
-    },
+    }
 
   ]
 };

+ 10 - 0
ambari-web/app/data/review_configs.js

@@ -213,6 +213,16 @@ module.exports = [
           })
         ]
       }),
+      Ember.Object.create({
+        service_name: 'FALCON',
+        display_name: 'Falcon',
+        service_components: [
+          Ember.Object.create({
+            display_name: 'Server',
+            component_value: ''
+          })
+        ]
+      }),
       Ember.Object.create({
         service_name: 'STORM',
         display_name: 'Storm',

+ 8 - 0
ambari-web/app/data/service_components.js

@@ -330,6 +330,14 @@ module.exports = new Ember.Set([
     isClient: true, 
     description: 'Client component for GLUSTERFS'
   },
+  {
+    service_name: 'FALCON',
+    component_name: 'FALCON_SERVER',
+    display_name: 'Falcon Server',
+    isMaster: true,
+    isClient: false,
+    description: 'Falcon Server for mirroring'
+  },
   // @todo change with real info about service component
   {
     service_name: 'STORM',

+ 9 - 0
ambari-web/app/data/service_configs.js

@@ -216,6 +216,15 @@ module.exports = [
     sites: ['pig-log4j'],
     configs: []
   },
+  {
+    serviceName: 'FALCON',
+    displayName: 'Falcon',
+    configCategories: [
+      App.ServiceConfigCategory.create({ name: 'Falcon', displayName : 'Falcon Server'})
+    ],
+    sites: ['falcon-site'],
+    configs: []
+  },
   // @todo change to actual info
   {
     serviceName: 'STORM',

+ 10 - 1
ambari-web/app/data/services.js

@@ -156,6 +156,15 @@ module.exports = [
     canBeSelected: App.supports.hue,
     isHidden: !App.supports.hue
   },
+  {
+    serviceName: 'FALCON',
+    displayName: 'Falcon',
+    isDisabled: false,
+    isSelected: App.supports.falcon,
+    canBeSelected: App.supports.falcon,
+    isHidden: !App.supports.falcon,
+    description: Em.I18n.t('services.falcon.description')
+  },
   {
     serviceName: 'STORM',
     displayName: 'Storm',
@@ -165,4 +174,4 @@ module.exports = [
     isHidden: !App.testMode,
     description: Em.I18n.t('services.storm.description')
   }
-]
+]

+ 1 - 0
ambari-web/app/mappers/server_data_mapper.js

@@ -213,6 +213,7 @@ App.QuickDataMapper.componentServiceMap = {
   'KERBEROS_CLIENT': 'KERBEROS',
   'HUE_SERVER': 'HUE',
   'GLUSTERFS_CLIENT': 'GLUSTERFS',
+  'FALCON_SERVER': 'FALCON',
   'NIMBUS': 'STORM',
   'SUPERVISOR': 'STORM'
 };

+ 2 - 0
ambari-web/app/mappers/service_metrics_mapper.js

@@ -314,6 +314,8 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
       finalJson.quick_links = [21];
     }else if(item && item.ServiceInfo && item.ServiceInfo.service_name == "HUE"){
       finalJson.quick_links = [22];
+    }else if(item && item.ServiceInfo && item.ServiceInfo.service_name == "FALCON"){
+      finalJson.quick_links = [32];
     }
   },
 

+ 1 - 0
ambari-web/app/models/host_component.js

@@ -77,6 +77,7 @@ App.HostComponent = DS.Model.extend({
       case 'HUE_SERVER':
       case 'HISTORYSERVER':
       case 'FLUME_SERVER':
+      case 'FALCON_SERVER':
       case 'NIMBUS':
       case 'RESOURCEMANAGER':
         return true;

+ 11 - 0
ambari-web/app/models/quick_links.js

@@ -401,5 +401,16 @@ App.QuickLinks.FIXTURES = [
     site: 'storm-site',
     regex: portRegex,
     default_http_port: 9292
+  },
+  {
+    id:32,
+    label:'Falcon Server UI',
+    url:'%@://%@:%@/stacks',
+    service_id: 'FALCON',
+    template:'%@://%@:%@/html5-ui',
+    site: 'falcon-site',
+    regex: portRegex,
+    default_http_port: 16000
+
   }
 ];

+ 2 - 0
ambari-web/app/models/service.js

@@ -180,6 +180,7 @@ App.Service.DisplayNames = {
   'NAGIOS': 'Nagios',
   'HUE': 'Hue',
   'FLUME': 'Flume',
+  'FALCON': 'Falcon',
   'STORM': 'Storm'
 };
 
@@ -201,6 +202,7 @@ App.Service.servicesSortOrder = [
   'PIG',
   'SQOOP',
   'HUE',
+  'FALCON',
   'STORM'
 ];
 

+ 1 - 0
ambari-web/app/templates.js

@@ -26,5 +26,6 @@ require('templates/main/service/info/summary/zookeeper');
 require('templates/main/service/info/summary/mapreduce2');
 require('templates/main/service/info/summary/hive');
 require('templates/main/service/info/summary/hue');
+require('templates/main/service/info/summary/falcon');
 require('templates/main/service/info/summary/storm');
 require('templates/main/admin/highAvailability/progress');

+ 3 - 0
ambari-web/app/templates/main/service/info/summary.hbs

@@ -62,6 +62,9 @@
             {{#if view.serviceStatus.flume}}
               {{view App.MainDashboardServiceFlumeView showOnlyRows=true serviceBinding="view.service"}}
             {{/if}}
+            {{#if view.serviceStatus.falcon}}
+              {{template "templates/main/service/info/summary/falcon"}}
+            {{/if}}
             {{#if view.serviceStatus.storm}}
               {{template "templates/main/service/info/summary/storm"}}
             {{/if}}

+ 19 - 0
ambari-web/app/templates/main/service/info/summary/falcon.hbs

@@ -0,0 +1,19 @@
+{{!
+* 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.
+}}
+{{!<!-- @todo create correct view after api implementing-->}}
+{{view view.sumMasterComponentView}}

+ 4 - 0
ambari-web/app/utils/helper.js

@@ -330,6 +330,10 @@ App.format = {
           return 'Storm Service Check';
       case 'FALCON_SERVICE_CHECK':
           return 'Falcon Service Check';
+      case 'FALCON_SERVER':
+          return 'Falcon Server';
+      case 'FALCON':
+          return 'Falcon';
       case 'NAGIOS_SERVER':
         return 'Nagios Server';
       case 'GANGLIA_SERVER':

+ 3 - 0
ambari-web/app/views/common/quick_view_link_view.js

@@ -128,6 +128,9 @@ App.QuickViewLinks = Em.View.extend({
       case "MAPREDUCE2":
         host = this.findComponentHost('HISTORYSERVER');
         break;
+      case "FALCON":
+        host = this.findComponentHost('FALCON_SERVER');
+        break;
       case "STORM":
         host = this.findComponentHost('NIMBUS');
         break;

+ 1 - 1
ambari-web/app/views/main/menu.js

@@ -33,7 +33,7 @@ App.MainMenuView = Em.CollectionView.extend({
       { label:Em.I18n.t('menu.item.hosts'), routing:'hosts'}
     ];
 
-    if (App.supports.mirroring) {
+    if (App.supports.mirroring && App.Service.find().findProperty('serviceName', 'FALCON')) {
       result.push({ label:Em.I18n.t('menu.item.mirroring'), routing:'mirroring'});
     }
 

+ 1 - 0
ambari-web/app/views/main/service/info/summary.js

@@ -47,6 +47,7 @@ App.MainServiceInfoSummaryView = Em.View.extend({
     nagios:false,
     hue: false,
     flume: false,
+    falcon: false,
     storm: false
   },