Solved

How to change an entry in config file to 100 linux servers

Posted on 2014-02-05
9
310 Views
Last Modified: 2014-02-17
How can I change the entry in /etc/kdump.conf from 10.10.10.10    to 11.11.11.11
by running a script from a central server and modifying the kdump.conf file in all 100 servers?
0
Comment
Question by:oo_tatang
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 6

Expert Comment

by:Jordan Medlen
ID: 39835513
I would recommend setting up rsync on all servers as well as root login via key file over ssh. Then you can make the change to the "central server" and have a script run that will rsync the file to all other servers and restart the service if necessary.
0
 
LVL 19

Expert Comment

by:simon3270
ID: 39835530
If this (or work like this) is going to be a frequent occurrence, you might want to install puppet on the systems.
0
 
LVL 6

Expert Comment

by:Shiju Jacob
ID: 39836269
try

for i in `cat hostlist`; do scp file* $i:/tmp/; done

hostlist are the ip of the hosts
/tmp you can have your path
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 23

Expert Comment

by:savone
ID: 39836426
I use CSSH for stuff like this.  It will open all 100 ssh sessions and let you work with all of them with one entry.

http://sourceforge.net/projects/clusterssh/
0
 
LVL 13

Expert Comment

by:Sandy
ID: 39838051
i also suggest CSSH.
0
 

Author Comment

by:oo_tatang
ID: 39844675
I have my central server working already. The problem is i dont want to login to each and every server and vi the /etc/kdump.conf file and change the entry in the file from xx.xx.xx.xx ip entry to yy.yy.yy.yy which is time consuming .
0
 
LVL 19

Expert Comment

by:simon3270
ID: 39845185
Is the file the same on all servers? Of so, rcp or scp might be the best solution. You will have to set up ssh keys between the central machine an the 100 servers

if the files are not all the same, Puppet would seem to be better. With it, you can update a single line in a file
0
 

Author Comment

by:oo_tatang
ID: 39848977
How is puppet obtain. I am looking for a script to run in order to ssh to each server and change the entry in the /etc/kdump.conf file of each servers. The file configuration for each serves are not the  same. Please help
0
 
LVL 19

Accepted Solution

by:
simon3270 earned 500 total points
ID: 39849221
Puppet may be in the repositories for your distribution, or you candownload it free on puppetlabs.com.  You install the Puppet server on your central machine, and the Puppet agent on the 100 other servers.  You then set up a single configuration file on the central server to set the kdump line to have 11.11.11.11 in it, and the agents then all pick up the instructions and modify the file.  That line is then controlled by Puppet - if anyone tries to change the line on one of the 100 servers manually later on, puppet will set it back to 11.11.11.11.

That may seem overkill for just changing a single line, but once Puppet is installed, making other changes on all of the servers is much easier.

if you really want to use ssh, and you have set up ssh keys (with no passphrase) from the central node to the 100, with the node names one per line in remote_nodes.lst, then

for remnode in $(cat remote_nodes.lst); do

  ssh $remnode 'sed -i s/10.10.10.10/11.11.11.11/ /etc/kdump.conf'

don

Open in new window

0

Featured Post

Learn by Doing. Anytime. Anywhere.

Do you like to learn by doing?
Our labs and exercises give you the chance to do just that: Learn by performing actions on real environments.

Hands-on, scenario-based labs give you experience on real environments provided by us so you don't have to worry about breaking anything.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Fine Tune your automatic Updates for Ubuntu / Debian
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question