You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ec...@apache.org on 2011/10/20 17:17:29 UTC

svn commit: r1186847 - /incubator/accumulo/trunk/bin/check-slaves

Author: ecn
Date: Thu Oct 20 15:17:29 2011
New Revision: 1186847

URL: http://svn.apache.org/viewvc?rev=1186847&view=rev
Log:
ACCUMULO-32: document check-slaves; add warning for missing configuration, fail-fast for non-linux oses

Modified:
    incubator/accumulo/trunk/bin/check-slaves

Modified: incubator/accumulo/trunk/bin/check-slaves
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/bin/check-slaves?rev=1186847&r1=1186846&r2=1186847&view=diff
==============================================================================
--- incubator/accumulo/trunk/bin/check-slaves (original)
+++ incubator/accumulo/trunk/bin/check-slaves Thu Oct 20 15:17:29 2011
@@ -15,6 +15,16 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+# This script will check the configuration and uniformity of all the nodes in a cluster.
+# Checks
+#   each node is reachable via ssh
+#   login identity is the same
+#   the physical memory is the same
+#   the mounts are the same on each machine
+#   a set of writable locations (typically different disks) are in fact writable
+# 
+# In order to check for writable partitions, you must configure the WRITABLE variable below.
+#
 
 import subprocess
 import time
@@ -23,9 +33,12 @@ import os
 import sys
 import fcntl
 import signal
+if not sys.platform.startswith('linux'):
+   sys.stderr.write('This script only works on linux, sorry.\n')
+   sys.exit(1)
 
 TIMEOUT = 5
-WRITABLE = [('/data%02d/hadoop' % n) for n in range(3)]
+WRITABLE = []
 #WRITABLE = ['/srv/hdfs1', '/srv/hdfs2', '/srv/hdfs3']
 
 def ssh(slave, *args):
@@ -127,6 +140,9 @@ def checkMemory(slaves):
 
 def checkWritable(slaves):
     'Touch all the directories that should be writable by this user return any nodes that fail'
+    if not WRITABLE:
+       print '# WRITABLE value not configured, not checking partitions'
+       return []
     handles = runAll(slaves, 'touch', *WRITABLE)
     bad = set()
     for h in handles:
@@ -163,7 +179,7 @@ def checkMounts(slaves):
 
 def main(argv):
     if len(argv) < 1:
-        sys.stderr.write('Usage: check_slaves.py slaves\n')
+        sys.stderr.write('Usage: check_slaves slaves\n')
         sys.exit(1)
     sys.stdin.close()
     slaves = set()