Shuting down Linux Cluster using Telnet

Reply

Join Date: May 2004
Posts: 4
Reputation: thomase is an unknown quantity at this point 
Solved Threads: 0
thomase thomase is offline Offline
Newbie Poster

Shuting down Linux Cluster using Telnet

 
0
  #1
May 26th, 2004
I Need Help. I am a Linux Newbe. I have been tasked to build a build a Beiwolf Cluster. However, my immediate problem is. H ow can I shut down each Linux box using a telnet command from remote as an emergency procedure such as AC Failure or power failure in the server room.
Reply With Quote Quick reply to this message  
Join Date: Feb 2002
Posts: 12,043
Reputation: cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light 
Solved Threads: 130
Administrator
Staff Writer
cscgal's Avatar
cscgal cscgal is offline Offline
The Queen of DaniWeb

Re: Shuting down Linux Cluster using Telnet

 
0
  #2
May 26th, 2004
I'm a tad confused. If the power is suddenly pulled, there is no time to initiate a clean shutdown. In that case you would need to purchase a UPS Power Backup.

I use two commands to shutdown. halt and shutdown "now" ... there is also the shutdown -r "now" command to restart. The value in quotes is in how much time you want the shutdown procedure to start. As far as I know, halt can only be used by a super user.
Dani the Computer Science Gal
Follow my Twitter feed! twitter.com/DaniWeb
And if you're interested in Internet marketing there is twitter.com/DaniWebAds
Reply With Quote Quick reply to this message  
Join Date: May 2004
Posts: 4
Reputation: thomase is an unknown quantity at this point 
Solved Threads: 0
thomase thomase is offline Offline
Newbie Poster

Re: Shuting down Linux Cluster using Telnet

 
0
  #3
May 26th, 2004
The entire server room is on UPS. In this area we experience Brownouts. The UPS are good for an hour. The main problem is AC cooling is lost. Security will alert person on "call list". one or two persons will come on site a shut down all 60 servers systems therefore the manual shut down procedure must be quick. We got if covered for Windows boxes. But the Linux Cluster need a guick procedure because non of the cluster boxes have monitors, keyboards or mice attached. So telnet or ftp is the only way to communicate with each cluster host.
Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 1,620
Reputation: kc0arf is a jewel in the rough kc0arf is a jewel in the rough kc0arf is a jewel in the rough 
Solved Threads: 51
Team Colleague
kc0arf kc0arf is offline Offline
Posting Virtuoso

Re: Shuting down Linux Cluster using Telnet

 
0
  #4
May 26th, 2004
Hello,

This was discussed in another topic involving UPS shutdown to other computers. Also, as a newbie, a Beowolf cluster is quite a haul!

What I would do is:
1) determine the order that the boxes have to be shut down in. I have not built a Beowolf cluster, and it might not matter, but boxes might have to go down in a certain order.
2) Collect the IP numbers and root usernames / passwords for each box.
3) Install / Verify that SSH and expect is installed on all of the computers
4) Use expect to create a script file for one central computer to order the rest of them to power down. Expect is an "interactive" shell language that is great for username / passwords and similar interaction.
5) Code it and test it.

Things to watch out for:

1) Telnet will not allow a root login. SSH will, but will also require a pre-login before the script runs to setup and accept the encryption keys.
2) Your script must be protected from prying eyes, and also on the computer, as it will have all the root passwords handy
3) If you have to wait for delays between server shutdowns, remember to encode them into your script.

As you are starting on this, Thomase, rough out your thoughts in pseudo code and post them here. DO NOT put in passwords or sensitive IP addresses... but we can help debug it.

Christian
Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 209
Reputation: i686-linux is on a distinguished road 
Solved Threads: 12
i686-linux's Avatar
i686-linux i686-linux is offline Offline
Posting Whiz in Training

Re: Shuting down Linux Cluster using Telnet

 
0
  #5
May 26th, 2004
here would be a good script:

(the pre-req is that you have ssh installed on everything and can log into every server by using public keys instead of passwords)

 #!/bin/bash
 
 SSH=/usr/bin/ssh
 POWERCMD="/sbin/shutdown -h now"
 HOSTS="server1 server2 server3"
 
 # Shutdown remote machines
 for i in $HOSTS;
 do
 	 $SSH -l root $i $POWERCMD;
 done
 
 # Shutdown ourself
 /sbin/shutdown -h now

I provide no warranties so use at your own risk.
PARANOIA:
A healthy understanding of the way the universe works.
Reply With Quote Quick reply to this message  
Join Date: May 2004
Posts: 4
Reputation: thomase is an unknown quantity at this point 
Solved Threads: 0
thomase thomase is offline Offline
Newbie Poster

Re: Shuting down Linux Cluster using Telnet

 
0
  #6
Jun 3rd, 2004
Many thanks for your input. I see I have a lot to learn in the Linux world. scripting and all that. Windows xp is a peace of cake compared to this. Its like going back to my IBM Main Frame programming days in Assembly Language Coding (ALC). But I'll survive, I got a pile of text books in one hand and the keyboard in the other. I will try out the script you provided
Reply With Quote Quick reply to this message  
Join Date: May 2004
Posts: 4
Reputation: thomase is an unknown quantity at this point 
Solved Threads: 0
thomase thomase is offline Offline
Newbie Poster

Re: Shuting down Linux Cluster using Telnet

 
0
  #7
Jun 3rd, 2004
Thank you for your structured thoughts. I will put these to use. This my first attempt to build a cluster on my own. The first time I was just assisting my manager and was feeding each node a kickstart diskette and changing some parameters on the screen. Since I have to learn Linux now I decided to also learn clusters and show our inhouse clients how to put up cluster applications.
Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 1,620
Reputation: kc0arf is a jewel in the rough kc0arf is a jewel in the rough kc0arf is a jewel in the rough 
Solved Threads: 51
Team Colleague
kc0arf kc0arf is offline Offline
Posting Virtuoso

Re: Shuting down Linux Cluster using Telnet

 
0
  #8
Jun 3rd, 2004
Hello Thomase,

Windows XP / 2003 Server is not a piece of cake. True, you might not be aware of the tools that are in Linux, you will find that there are a lot less hidden registry settings and other nit-noids that go into a Windows system. Linux configuration files are often pure text files that are easily printable and managable. There is not much too them at all. Yes, syntax will be important, but if you had to, you could edit them with a 2400 baud modem.

Enjoy, and let us know how you did it. Keep very good notes of each installation (I used a bit text file on one of the computers as a running log, and it worked well -- just be sure to print it when done).

Christian
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the *nix Software Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC