You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by yu...@apache.org on 2014/11/06 06:40:18 UTC

git commit: AMBARI-8173. Kafka does not provide any default value for kafka.log.dirs and creates confusion / poor UX. (Sriharsha Chintalapani via yusaku)

Repository: ambari
Updated Branches:
  refs/heads/trunk 9219aefc3 -> 6dc6cc782


AMBARI-8173. Kafka does not provide any default value for kafka.log.dirs and creates confusion / poor UX. (Sriharsha Chintalapani via yusaku)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/6dc6cc78
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/6dc6cc78
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/6dc6cc78

Branch: refs/heads/trunk
Commit: 6dc6cc78234538b76190d5dd3bf85530e076fda8
Parents: 9219aef
Author: Yusaku Sako <yu...@hortonworks.com>
Authored: Wed Nov 5 14:08:58 2014 -0800
Committer: Yusaku Sako <yu...@hortonworks.com>
Committed: Wed Nov 5 16:29:55 2014 -0800

----------------------------------------------------------------------
 .../HDP/2.2/services/KAFKA/configuration/kafka-broker.xml     | 2 +-
 .../stacks/HDP/2.2/services/KAFKA/package/scripts/kafka.py    | 6 ++++++
 ambari-web/app/data/HDP2/site_properties.js                   | 1 +
 ambari-web/app/models/service_config.js                       | 7 +++++++
 4 files changed, 15 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/6dc6cc78/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/configuration/kafka-broker.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/configuration/kafka-broker.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/configuration/kafka-broker.xml
index f9df3e0..dc1b6b4 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/configuration/kafka-broker.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/configuration/kafka-broker.xml
@@ -23,7 +23,7 @@
 <configuration>
   <property>
     <name>log.dirs</name>
-    <value></value>
+    <value>/kafka-logs</value>
     <description>
       A comma-separated list of one or more directories in which Kafka data is stored.
       Each new partition that is created will be placed in the directory which currently has the fewest partitions.

http://git-wip-us.apache.org/repos/asf/ambari/blob/6dc6cc78/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/package/scripts/kafka.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/package/scripts/kafka.py b/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/package/scripts/kafka.py
index b6bc061..c0231a8 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/package/scripts/kafka.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/KAFKA/package/scripts/kafka.py
@@ -35,6 +35,12 @@ def kafka():
     kafka_server_config = mutable_config_dict(params.config['configurations']['kafka-broker'])
     kafka_server_config['broker.id'] = brokerid
     kafka_server_config['host.name'] = params.hostname
+    kafka_data_dir = kafka_server_config['log.dirs']
+    Directory(filter(None,kafka_data_dir.split(",")),
+              owner=params.kafka_user,
+              group=params.user_group,
+              recursive=True)
+
     conf_dir = params.conf_dir
     properties_config("server.properties",
                       conf_dir=params.conf_dir,

http://git-wip-us.apache.org/repos/asf/ambari/blob/6dc6cc78/ambari-web/app/data/HDP2/site_properties.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/data/HDP2/site_properties.js b/ambari-web/app/data/HDP2/site_properties.js
index c8a59f4..a81a471 100644
--- a/ambari-web/app/data/HDP2/site_properties.js
+++ b/ambari-web/app/data/HDP2/site_properties.js
@@ -1724,6 +1724,7 @@ module.exports =
       "displayName": "log.dirs",
       "value": "",
       "defaultValue": "",
+      "defaultDirectory": "/kafka-logs",
       "displayType": "directories",
       "serviceName": "KAFKA",
       "filename": "kafka-broker.xml",

http://git-wip-us.apache.org/repos/asf/ambari/blob/6dc6cc78/ambari-web/app/models/service_config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/service_config.js b/ambari-web/app/models/service_config.js
index be5235a..e94de00 100644
--- a/ambari-web/app/models/service_config.js
+++ b/ambari-web/app/models/service_config.js
@@ -533,6 +533,7 @@ App.ServiceConfigProperty = Ember.Object.extend({
       case 'yarn.nodemanager.local-dirs':
       case 'yarn.nodemanager.log-dirs':
       case 'mapred.local.dir':
+      case 'log.dirs':  // for Kafka Broker
         this.unionAllMountPoints(!isOnlyFirstOneNeeded, localDB);
         break;
       case 'fs.checkpoint.dir':
@@ -655,6 +656,12 @@ App.ServiceConfigProperty = Ember.Object.extend({
           setOfHostNames.push(component.hostName);
         }, this);
         break;
+      case 'log.dirs':
+        components = masterComponentHostsInDB.filterProperty('component', 'KAFKA_BROKER');
+        components.forEach(function (component) {
+          setOfHostNames.push(component.hostName);
+        }, this);
+        break;
     }
 
     // In Add Host Wizard, if we did not select this slave component for any host, then we don't process any further.