Ottomata has submitted this change and it was merged.
Change subject: Use lockfiles instead of ps to conditionally start hdfs balancer
......................................................................
Use lockfiles instead of ps to conditionally start hdfs balancer
Change-Id: I1176fc451492e442d097465b1a035428aad3ee2a
---
M manifests/role/analytics/hadoop.pp
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Ottomata: Looks good to me, approved
jenkins-bot: Verified
diff --git a/manifests/role/analytics/hadoop.pp
b/manifests/role/analytics/hadoop.pp
index 2e4ea0b..cc1dd53 100644
--- a/manifests/role/analytics/hadoop.pp
+++ b/manifests/role/analytics/hadoop.pp
@@ -619,7 +619,7 @@
Class['role::analytics::hadoop::client'] ->
Class['role::analytics::hadoop::balancer']
cron {'hdfs-balancer':
- command => 'ps a | grep -v grepĀ | grep -q "hdfs balancer" || hdfs
dfsadmin -setBalancerBandwidth $((40*1048576)) && /usr/bin/hdfs balancer >>
/var/log/hadoop-hdfs/balancer.log 2>&1',
+ command => '(lockfile-check /tmp/hdfs-balancer && echo "$(date
\'+%y/%m/%d %H:%M:%S\') WARN Not starting hdfs balancer, it is already running
(or the lockfile exists).") || (lockfile-create /tmp/hdfs-balancer && hdfs
dfsadmin -setBalancerBandwidth $((40*1048576)) && /usr/bin/hdfs balancer >>
/var/log/hadoop-hdfs/balancer.log 2>&1; lockfile-remove /tmp/hdfs-balancer)',
user => 'hdfs',
# Start run at 0:00 every Saturday UTC.
minute => 0,
--
To view, visit https://gerrit.wikimedia.org/r/207831
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I1176fc451492e442d097465b1a035428aad3ee2a
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ottomata <[email protected]>
Gerrit-Reviewer: Ottomata <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits