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:16:48 UTC
svn commit: r1186846 - /incubator/accumulo/branches/1.3/bin/check-slaves
Author: ecn
Date: Thu Oct 20 15:16:47 2011
New Revision: 1186846
URL: http://svn.apache.org/viewvc?rev=1186846&view=rev
Log:
ACCUMULO-32: document check-slaves; add warning for missing configuration, fail-fast for non-linux oses
Modified:
incubator/accumulo/branches/1.3/bin/check-slaves
Modified: incubator/accumulo/branches/1.3/bin/check-slaves
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/bin/check-slaves?rev=1186846&r1=1186845&r2=1186846&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/bin/check-slaves (original)
+++ incubator/accumulo/branches/1.3/bin/check-slaves Thu Oct 20 15:16:47 2011
@@ -15,6 +15,17 @@
# 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
import select
@@ -22,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/hadoop', '/data1/hadoop', '/data2/hadoop']
+WRITABLE = []
#WRITABLE = ['/srv/hdfs1', '/srv/hdfs2', '/srv/hdfs3']
def ssh(slave, *args):
@@ -126,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:
@@ -162,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()