Solved

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

Posted on 2014-02-05
9
308 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
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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
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.

778 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