Ottomata has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/312260

Change subject: Copy hive-site.xml into HDFS
......................................................................

Copy hive-site.xml into HDFS

Bug: T133208
Change-Id: I5c9a22c9713deb500acc6a8a81f3ed3a16585208
---
M manifests/site.pp
A modules/role/manifests/analytics_cluster/hive/site_hdfs.pp
2 files changed, 28 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/60/312260/1

diff --git a/manifests/site.pp b/manifests/site.pp
index 02d2333..e131926 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -127,7 +127,13 @@
         analytics_cluster::refinery::camus,
 
         # Add cron job to delete old data in HDFS
-        analytics_cluster::refinery::data::drop)
+        analytics_cluster::refinery::data::drop,
+
+        # We need hive-site.xml in HDFS.  This can be included
+        # on any node with a Hive client, but we really only
+        # want to include it in one place.  analytics1027
+        # is a little special and standalone, so we do it here.
+        analytics_cluster::hive::site_hdfs)
 
     include standard
     include base::firewall
diff --git a/modules/role/manifests/analytics_cluster/hive/site_hdfs.pp 
b/modules/role/manifests/analytics_cluster/hive/site_hdfs.pp
new file mode 100644
index 0000000..44bc502
--- /dev/null
+++ b/modules/role/manifests/analytics_cluster/hive/site_hdfs.pp
@@ -0,0 +1,21 @@
+# == Class role::analytics_cluster::hive::site_hdfs
+# Ensures latest /etc/hive/conf/hive-site.xml is in hdfs
+#
+# TODO: it would be much better if we had a nicer define or puppet function
+# that would allow us to manage files in HDFS like we do in the regular
+# filesystem.  If we figure that out, we can replace this class and also
+# the analytics_cluster::mysql_password class.
+#
+class role::analytics_cluster::hive::site_hdfs {
+    Class['cdh::hive'] -> Class['role::analytics_cluster::hive::site_hdfs']
+
+    $hdfs_path = '/user/hive/hive-site.xml'
+    # Put /etc/hive/conf/hive-site.xml in HDFS whenever puppet
+    # notices that it has changed.
+    exec { 'put-hive-site-in-hdfs':
+        command     => "/usr/bin/hdfs dfs -put -f 
${cdh::hive::config_directory}/hive-site.xml ${hdfs_path} && /usr/bin/hdfs dfs 
-chmod 644 ${hdfs_path} && /usr/bin/hdfs dfs -chown hdfs:hdfs ${hdfs_path}"
+        user        => 'hdfs',
+        refreshonly => true,
+        subscribe   => File["${cdh::hive::config_directory}/hive-site.xml"],
+    }
+}

-- 
To view, visit https://gerrit.wikimedia.org/r/312260
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5c9a22c9713deb500acc6a8a81f3ed3a16585208
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ottomata <o...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to