Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
dbmathisI have a group of about 150 linux application
servers that a process runs on nightly and then a SUCCESS gets written
to a logfile of each of the servers when the process completes.
Currently I have to log into each server via ssh and grep each
log to see if the process completed.



YMMV, but I had (and have) to deal with a similar problem
in a "computational chemistry" environment. The number of servers
or nodes is about one half of yours.

What I learned from all that: "keep it dead simple" try to get it installed OOTB -if possible.
My current solution:

1. programs & logging
- One of the (older) boxes poses as server and holds the
   node cluster in a subnet (a private one in my case)
- The server exposes (NFS,SMB possible) its /usr/local/bin (ro-mode) and
   its /srv/cluster (rw-mode) to the subnet,
- The nodes load their applications from the central mounted
   /usr/local/bin and write logs with date and ip
   (in filenames) into seperate files in /srv/cluster

2. job overview
- The server has some perl scripts for job overview,
   if required, the number and respective
   ip's of running nodes are found by "nmapping" the subnet:
... # $addr is the actual subnet, e.g. "192.168.1.0" ... my $output = qx{nmap -sP ${addr}/24}; my @nodes= $output =~ /(?<=\s)c\w+\b/g;
This (nmap -sP) will run very fast (at least here, from
a non-root account) and may provide a
"real time" info on running nodes per html page, eg.:
... print header('text/html'); print h1('Local Network: '. $addr . '/24'); print map "$_ appears to be up<br />", @hosts ...
The found nodes might then be rsh'ed (if its a private
subnet, you won't be killed for using rsh/rexec then)
Pseudo:
... my ($exe, $cmd) = ('/usr/bin/rsh', 'ps -fl r -u username'); my $cnt = 0; for my $node ( sort @nodes ) { my @res = grep !(/$cmd/ || /STIME/), split /[\n\r]+/, qx{$exe $node + $cmd}; my $nproc = scalar @res; # how many processes if( $nproc ) { print map "Do " . "some ". "formatting of " . "ps -fl output here!", @res } ... ++$cnt ...
In the end, you'll have a browser-interface to the
running processes (build a nice html table in the "map"
above) and a central directory full of log files, which
might even be exported (smb) to windows machines for
coworker preferring the explorer ;-)

The only "complication" (additional work per node) would
be "installing and enabling the nfs client".
my €0.02

regards

mwa

In reply to Re: General perl question. Multiple servers. by mwah
in thread General perl question. Multiple servers. by dbmathis

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others pondering the Monastery: (4)
    As of 2021-01-22 04:22 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      Notices?