943,602 Members | Top Members by Rank

Ad:
May 26th, 2004
0

Shuting down Linux Cluster using Telnet

Expand Post »
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.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
thomase is offline Offline
4 posts
since May 2004
May 26th, 2004
0

Re: Shuting down Linux Cluster using Telnet

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.
Administrator
Staff Writer
Reputation Points: 1422
Solved Threads: 162
The Queen of DaniWeb
cscgal is offline Offline
13,645 posts
since Feb 2002
May 26th, 2004
0

Re: Shuting down Linux Cluster using Telnet

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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
thomase is offline Offline
4 posts
since May 2004
May 26th, 2004
0

Re: Shuting down Linux Cluster using Telnet

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
Team Colleague
Reputation Points: 121
Solved Threads: 57
Posting Virtuoso
kc0arf is offline Offline
1,629 posts
since Mar 2004
May 26th, 2004
0

Re: Shuting down Linux Cluster using Telnet

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.
Reputation Points: 87
Solved Threads: 12
Posting Whiz in Training
i686-linux is offline Offline
208 posts
since Mar 2004
Jun 3rd, 2004
0

Re: Shuting down Linux Cluster using Telnet

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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
thomase is offline Offline
4 posts
since May 2004
Jun 3rd, 2004
0

Re: Shuting down Linux Cluster using Telnet

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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
thomase is offline Offline
4 posts
since May 2004
Jun 3rd, 2004
0

Re: Shuting down Linux Cluster using Telnet

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
Team Colleague
Reputation Points: 121
Solved Threads: 57
Posting Virtuoso
kc0arf is offline Offline
1,629 posts
since Mar 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Linux Applications and Software Forum Timeline: Horde address book issue
Next Thread in Linux Applications and Software Forum Timeline: New HD Installation fail on Linux MDK





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC