Browse Source

AMBARI-1149. HIVE_METASTORE needs to be started as a Hive component. (yusaku)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1431648 13f79535-47bb-0310-9956-ffa450edef68
Yusaku Sako 12 years ago
parent
commit
e954fd0dbd

+ 3 - 0
CHANGES.txt

@@ -654,6 +654,9 @@ AMBARI-666 branch (unreleased changes)
 
 
   BUG FIXES
   BUG FIXES
 
 
+  AMBARI-1149. HIVE_METASTORE needs to be started as a Hive component.
+  (yusaku)
+
   AMBARI-1088. HDFS capacity chart numbers are incorrect. (Srimanth Gunturi
   AMBARI-1088. HDFS capacity chart numbers are incorrect. (Srimanth Gunturi
   via yusaku)
   via yusaku)
 
 

+ 38 - 40
ambari-web/app/controllers/wizard/step5_controller.js

@@ -28,14 +28,16 @@ App.WizardStep5Controller = Em.Controller.extend({
   selectedServicesMasters:[],
   selectedServicesMasters:[],
   zId:0,
   zId:0,
 
 
-  hasWebHCatServer: function () {
-    return this.get('selectedServicesMasters').findProperty('component_name', 'WEBHCAT_SERVER');
+  hasHiveServer: function () {
+    return this.get('selectedServicesMasters').findProperty('component_name', 'HIVE_SERVER');
   }.property('selectedServicesMasters'),
   }.property('selectedServicesMasters'),
 
 
-  updateWebHCatHost: function () {
+  updateHiveCoHosts: function () {
     var hiveServer =  this.get('selectedServicesMasters').findProperty('component_name', 'HIVE_SERVER');
     var hiveServer =  this.get('selectedServicesMasters').findProperty('component_name', 'HIVE_SERVER');
+    var hiveMetastore = this.get('selectedServicesMasters').findProperty('component_name', 'HIVE_METASTORE');
     var webHCatServer = this.get('selectedServicesMasters').findProperty('component_name', 'WEBHCAT_SERVER');
     var webHCatServer = this.get('selectedServicesMasters').findProperty('component_name', 'WEBHCAT_SERVER');
-    if (hiveServer && webHCatServer) {
+    if (hiveServer && hiveMetastore && webHCatServer) {
+      this.get('selectedServicesMasters').findProperty('component_name', 'HIVE_METASTORE').set('selectedHost', hiveServer.get('selectedHost'));
       this.get('selectedServicesMasters').findProperty('component_name', 'WEBHCAT_SERVER').set('selectedHost', hiveServer.get('selectedHost'));
       this.get('selectedServicesMasters').findProperty('component_name', 'WEBHCAT_SERVER').set('selectedHost', hiveServer.get('selectedHost'));
     }
     }
   }.observes('selectedServicesMasters.@each.selectedHost'),
   }.observes('selectedServicesMasters.@each.selectedHost'),
@@ -148,7 +150,7 @@ App.WizardStep5Controller = Em.Controller.extend({
               zooKeeperHost.availableHosts = [];
               zooKeeperHost.availableHosts = [];
               zooKeeperHost.serviceId = services[index];
               zooKeeperHost.serviceId = services[index];
               zooKeeperHost.isInstalled = false;
               zooKeeperHost.isInstalled = false;
-              zooKeeperHost.isWebHCatServer = false;
+              zooKeeperHost.isHiveCoHost = false;
               resultComponents.add(zooKeeperHost);
               resultComponents.add(zooKeeperHost);
             });
             });
 
 
@@ -162,7 +164,7 @@ App.WizardStep5Controller = Em.Controller.extend({
           componentObj.isInstalled = savedComponent ? savedComponent.isInstalled : App.Component.find().someProperty('componentName', _componentInfo.component_name);
           componentObj.isInstalled = savedComponent ? savedComponent.isInstalled : App.Component.find().someProperty('componentName', _componentInfo.component_name);
           componentObj.serviceId = services[index];
           componentObj.serviceId = services[index];
           componentObj.availableHosts = [];
           componentObj.availableHosts = [];
-          componentObj.isWebHCatServer = _componentInfo.component_name == 'WEBHCAT_SERVER';
+          componentObj.isHiveCoHost = ['HIVE_METASTORE', 'WEBHCAT_SERVER'].contains(_componentInfo.component_name);
           resultComponents.add(componentObj);
           resultComponents.add(componentObj);
         }
         }
       }, this);
       }, this);
@@ -313,19 +315,12 @@ App.WizardStep5Controller = Em.Controller.extend({
     }
     }
   },
   },
 
 
+  getHiveMetastore:function (noOfHosts) {
+    return this.getHiveServer(noOfHosts);
+  },
+
   getWebHCatServer:function (noOfHosts) {
   getWebHCatServer:function (noOfHosts) {
-    var hosts = this.get('hosts');
-    if (noOfHosts === 1) {
-      return hosts[0];
-    } else if (noOfHosts < 3) {
-      return hosts[1];
-    } else if (noOfHosts <= 5) {
-      return hosts[1];
-    } else if (noOfHosts <= 30) {
-      return hosts[2];
-    } else {
-      return hosts[4];
-    }
+    return this.getHiveServer(noOfHosts);
   },
   },
 
 
   getZooKeeperServer:function (noOfHosts) {
   getZooKeeperServer:function (noOfHosts) {
@@ -377,28 +372,31 @@ App.WizardStep5Controller = Em.Controller.extend({
    */
    */
   selectHost:function (componentName) {
   selectHost:function (componentName) {
     var noOfHosts = this.get('hosts').length;
     var noOfHosts = this.get('hosts').length;
-    if (componentName === 'KERBEROS_SERVER') {
-      return this.getKerberosServer(noOfHosts).host_name;
-    } else if (componentName === 'NAMENODE') {
-      return this.getNameNode(noOfHosts).host_name;
-    } else if (componentName === 'SECONDARY_NAMENODE') {
-      return this.getSNameNode(noOfHosts).host_name;
-    } else if (componentName === 'JOBTRACKER') {
-      return this.getJobTracker(noOfHosts).host_name;
-    } else if (componentName === 'HBASE_MASTER') {
-      return this.getHBaseMaster(noOfHosts).host_name;
-    } else if (componentName === 'OOZIE_SERVER') {
-      return this.getOozieServer(noOfHosts).host_name;
-    } else if (componentName === 'HIVE_SERVER') {
-      return this.getHiveServer(noOfHosts).host_name;
-    } else if (componentName === 'WEBHCAT_SERVER') {
-      return this.getWebHCatServer(noOfHosts).host_name;
-    } else if (componentName === 'ZOOKEEPER_SERVER') {
-      return this.getZooKeeperServer(noOfHosts);
-    } else if (componentName === 'GANGLIA_SERVER') {
-      return this.getGangliaServer(noOfHosts);
-    } else if (componentName === 'NAGIOS_SERVER') {
-      return this.getNagiosServer(noOfHosts);
+    switch (componentName) {
+      case 'KERBEROS_SERVER':
+        return this.getKerberosServer(noOfHosts).host_name;
+      case 'NAMENODE':
+        return this.getNameNode(noOfHosts).host_name;
+      case 'SECONDARY_NAMENODE':
+        return this.getSNameNode(noOfHosts).host_name;
+      case 'JOBTRACKER':
+        return this.getJobTracker(noOfHosts).host_name;
+      case 'HBASE_MASTER':
+        return this.getHBaseMaster(noOfHosts).host_name;
+      case 'OOZIE_SERVER':
+        return this.getOozieServer(noOfHosts).host_name;
+      case 'HIVE_SERVER':
+        return this.getHiveServer(noOfHosts).host_name;
+      case 'HIVE_METASTORE':
+        return this.getHiveMetastore(noOfHosts).host_name;
+      case 'WEBHCAT_SERVER':
+        return this.getWebHCatServer(noOfHosts).host_name;
+      case 'ZOOKEEPER_SERVER':
+        return this.getZooKeeperServer(noOfHosts);
+      case 'GANGLIA_SERVER':
+        return this.getGangliaServer(noOfHosts);
+      case 'NAGIOS_SERVER':
+        return this.getNagiosServer(noOfHosts);
     }
     }
   },
   },
 
 

+ 1 - 1
ambari-web/app/controllers/wizard/step6_controller.js

@@ -198,7 +198,7 @@ App.WizardStep6Controller = Em.Controller.extend({
   renderSlaveHosts: function () {
   renderSlaveHosts: function () {
     var hostsObj = Em.Set.create();
     var hostsObj = Em.Set.create();
     var allHosts = this.getHostNames();
     var allHosts = this.getHostNames();
-    var maxNoofHostComponents = 9;
+    var maxNoofHostComponents = 11;
     var slaveComponents = this.get('content.slaveComponentHosts');
     var slaveComponents = this.get('content.slaveComponentHosts');
 
 
     allHosts.forEach(function (_hostName) {
     allHosts.forEach(function (_hostName) {

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

@@ -833,6 +833,8 @@ App.WizardStep8Controller = Em.Controller.extend({
         return { "ServiceComponentInfo": { "component_name": _component.component_name } };
         return { "ServiceComponentInfo": { "component_name": _component.component_name } };
       });
       });
 
 
+      debugger;
+
       // Service must be specified in terms of a query for creating multiple components at the same time.
       // Service must be specified in terms of a query for creating multiple components at the same time.
       // See AMBARI-1018.
       // See AMBARI-1018.
       var url = App.apiPrefix + '/clusters/' + this.get('clusterName') + '/services?ServiceInfo/service_name=' + _service;
       var url = App.apiPrefix + '/clusters/' + this.get('clusterName') + '/services?ServiceInfo/service_name=' + _service;
@@ -1246,6 +1248,7 @@ App.WizardStep8Controller = Em.Controller.extend({
     configs.forEach(function (_configProperty) {
     configs.forEach(function (_configProperty) {
       hiveProperties[_configProperty.name] = _configProperty.value;
       hiveProperties[_configProperty.name] = _configProperty.value;
     }, this);
     }, this);
+    hiveProperties['hive.metastore.uris'] = 'thrift://' + this.get('globals').findProperty('hivemetastore_host').value + ':9083';
     hiveProperties['javax.jdo.option.ConnectionURL'] =
     hiveProperties['javax.jdo.option.ConnectionURL'] =
       'jdbc:mysql://' + this.get('globals').findProperty('name', 'hive_mysql_host').value +
       'jdbc:mysql://' + this.get('globals').findProperty('name', 'hive_mysql_host').value +
       '/' + this.get('globals').findProperty('name', 'hive_database_name').value + '?createDatabaseIfNotExist=true';
       '/' + this.get('globals').findProperty('name', 'hive_database_name').value + '?createDatabaseIfNotExist=true';

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

@@ -154,6 +154,14 @@ module.exports = new Ember.Set([
     isClient: false,
     isClient: false,
     description: ''
     description: ''
   },
   },
+  {
+    service_name: 'HIVE',
+    component_name: 'HIVE_METASTORE',
+    display_name: 'Hive Metastore',
+    isMaster: true,
+    isClient: false,
+    description: ''
+  },
   {
   {
     service_name: 'HIVE',
     service_name: 'HIVE',
     component_name: 'HIVE_CLIENT',
     component_name: 'HIVE_CLIENT',

+ 14 - 14
ambari-web/app/data/services.js

@@ -52,6 +52,20 @@ module.exports = [
     isSelected: true,
     isSelected: true,
     description: Em.I18n.t('services.hive.description')
     description: Em.I18n.t('services.hive.description')
   },
   },
+  {
+    serviceName: 'HCATALOG',
+    displayName: 'HCatalog',
+    isDisabled: false,
+    isSelected: true,
+    isHidden: true
+  },
+  {
+    serviceName: 'WEBHCAT',
+    displayName: 'WebHCat',
+    isDisabled: false,
+    isSelected: true,
+    isHidden: true
+  },
   {
   {
     serviceName: 'HBASE',
     serviceName: 'HBASE',
     displayName: 'HBase + ZooKeeper',
     displayName: 'HBase + ZooKeeper',
@@ -80,20 +94,6 @@ module.exports = [
     isSelected: true,
     isSelected: true,
     description: Em.I18n.t('services.oozie.description')
     description: Em.I18n.t('services.oozie.description')
   },
   },
-  {
-    serviceName: 'HCATALOG',
-    displayName: 'HCatalog',
-    isDisabled: false,
-    isSelected: true,
-    isHidden: true
-  },
-  {
-    serviceName: 'WEBHCAT',
-    displayName: 'WebHCat',
-    isDisabled: false,
-    isSelected: true,
-    isHidden: true
-  },
   {
   {
     serviceName: 'ZOOKEEPER',
     serviceName: 'ZOOKEEPER',
 	  displayName: 'ZooKeeper',
 	  displayName: 'ZooKeeper',

+ 2 - 2
ambari-web/app/initialize.js

@@ -19,9 +19,9 @@
 
 
 window.App = require('app');
 window.App = require('app');
 
 
-App.testMode = false;
+App.testMode = true;
 App.skipBootstrap = false;
 App.skipBootstrap = false;
-App.alwaysGoToInstaller = false;
+App.alwaysGoToInstaller = true;
 App.apiPrefix = '/api/v1';
 App.apiPrefix = '/api/v1';
 App.defaultStackVersion = 'HDP-1.2.0';
 App.defaultStackVersion = 'HDP-1.2.0';
 App.defaultLocalStackVersion = 'HDPLocal-1.2.0';
 App.defaultLocalStackVersion = 'HDPLocal-1.2.0';

+ 1 - 1
ambari-web/app/messages.js

@@ -118,7 +118,7 @@ Em.I18n.translations = {
   'installer.step5.header':'Assign Masters',
   'installer.step5.header':'Assign Masters',
   'installer.step5.attention':' hosts not running master services',
   'installer.step5.attention':' hosts not running master services',
   'installer.step5.body':'Assign master components to hosts you want to run them on.',
   'installer.step5.body':'Assign master components to hosts you want to run them on.',
-  'installer.step5.body.webhcat':'<i class="icon-asterisks">&#10037</i> Hive Server and WebHCat Server will be co-hosted on the same server.',
+  'installer.step5.body.hive':'<i class="icon-asterisks">&#10037</i> Hive Server, Hive Metastore, and WebHCat Server will be co-hosted on the same server.',
 
 
   'installer.step6.header':'Assign Slaves and Clients',
   'installer.step6.header':'Assign Slaves and Clients',
   'installer.step6.body':'Assign slave and client components to hosts you want to run them on.<br/>Hosts that are assigned master components are shown with <i class=icon-asterisks>&#10037</i>. <br/>&quot;Client&quot; will install ',
   'installer.step6.body':'Assign slave and client components to hosts you want to run them on.<br/>Hosts that are assigned master components are shown with <i class=icon-asterisks>&#10037</i>. <br/>&quot;Client&quot; will install ',

+ 3 - 3
ambari-web/app/templates/wizard/step5.hbs

@@ -19,9 +19,9 @@
 <h2>{{t installer.step5.header}}</h2>
 <h2>{{t installer.step5.header}}</h2>
 <div class="alert alert-info">
 <div class="alert alert-info">
   {{t installer.step5.body}}
   {{t installer.step5.body}}
-  {{#if hasWebHCatServer}}
+  {{#if hasHiveServer}}
     <br>
     <br>
-    {{t installer.step5.body.webhcat}}
+    {{t installer.step5.body.hive}}
   {{/if}}
   {{/if}}
 </div>
 </div>
 <div class="assign-masters">
 <div class="assign-masters">
@@ -31,7 +31,7 @@
       {{#each selectedServicesMasters}}
       {{#each selectedServicesMasters}}
       <div class="control-group">
       <div class="control-group">
         <label class="control-label">{{display_name}}:</label>
         <label class="control-label">{{display_name}}:</label>
-        {{#if isWebHCatServer}}
+        {{#if isHiveCoHost}}
           <label class="host-name">{{selectedHost}}<i class="icon-asterisks">&#10037</i></label>
           <label class="host-name">{{selectedHost}}<i class="icon-asterisks">&#10037</i></label>
         {{else}}
         {{else}}
         <div class="controls">
         <div class="controls">

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

@@ -288,6 +288,8 @@ App.format = {
         return 'MySQL Server';
         return 'MySQL Server';
       case 'HIVE_SERVER':
       case 'HIVE_SERVER':
         return 'Hive Server';
         return 'Hive Server';
+      case 'HIVE_METASTORE':
+        return 'Hive Metastore';
       case 'HIVE_CLIENT':
       case 'HIVE_CLIENT':
         return 'Hive Client';
         return 'Hive Client';
       case 'HIVE_SERVICE_CHECK':
       case 'HIVE_SERVICE_CHECK':