Automating Linux and Unix System Administration (2009).pdf

(1755 KB) Pobierz
201772539 UNPDF
Automating Linux
and Unix System
Administration
Second Edition
Nate Campi and Kirk Bauer
201772539.001.png 201772539.002.png
Automating Linux and Unix System Administration, Second Edition
Copyright 2009 by Nate Campi, Kirk Bauer
All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means,
electronic or mechanical, including photocopying, recording, or by any information storage or retrieval
system, without the prior written permission of the copyright owner and the publisher.
ISBN-13 (pbk): 978-1-4302-1059-7
ISBN-13 (electronic): 978-1-4302-1060-3
Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1
Trademarked names may appear in this book. Rather than use a trademark symbol with every occurrence
of a trademarked name, we use the names only in an editorial fashion and to the benefit of the trademark
owner, with no intention of infringement of the trademark.
Lead Editor: Frank Pohlmann
Technical Reviewer: Mark Burgess
Editorial Board: Clay Andres, Steve Anglin, Mark Beckner, Ewan Buckingham, Tony Campbell, Gary Cor-
nell, Jonathan Gennick, Michelle Lowman, Matthew Moodie, Jeffrey Pepper, Frank Pohlmann, Ben
Renow-Clarke, Dominic Shakeshaft, Matt Wade, Tom Welsh
Project Manager: Kylie Johnston
Copy Editors: Nina Goldschlager, Heather Lang
Associate Production Director: Kari Brooks-Copony
Production Editor: Ellie Fountain
Compositor: Linda Weidemann, Wolf Creek Press
Proofreader: Nancy Sixsmith
Indexer: Becky Hornyak
Cover Designer: Kurt Krames
Manufacturing Director: Tom Debolski
Distributed to the book trade worldwide by Springer-Verlag New York, Inc., 233 Spring Street, 6th Floor,
New York, NY 10013. Phone 1-800-SPRINGER, fax 201-348-4505, e-mail kn`ano)ju<olnejcan)o^i*_ki ,
or visit dppl6++sss*olnejcankjheja*_ki .
For information on translations, please contact Apress directly at 2855 Telegraph Avenue, Suite 600,
Berkeley, CA 94705. Phone 510-549-5930, fax 510-549-5939, e-mail ejbk<]lnaoo*_ki , or visit
dppl6++sss*]lnaoo*_ki .
Apress and friends of ED books may be purchased in bulk for academic, corporate, or promotional
use. eBook versions and licenses are also available for most titles. For more information, reference our
Special Bulk Sales–eBook Licensing web page at dppl6++sss*]lnaoo*_ki+ejbk+^qhgo]hao .
The information in this book is distributed on an “as is” basis, without warranty. Although every pre-
caution has been taken in the preparation of this work, neither the author(s) nor Apress shall have any
liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly
or indirectly by the information contained in this work.
The source code for this book is available to readers at dppl6++sss*]lnaoo*_ki .
I dedicate this book to my dear grandmother Mary Lou.
Her influence makes everyone around her a better person,
and her presence lights up a room.
She is beautiful inside and out,
and she meets adversity with faith,
quiet dignity, and grace.
—Nate Campi
Contents at a Glance
About the Authors ................................................................. xv
About the Technical Reviewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
Acknowledgments ................................................................xix
Introduction .....................................................................xxi
CHAPTER 1 Introducing the Basics of Automation ............................1
CHAPTER 2 Applying Practical Automation ..................................19
CHAPTER 3 Using SSH to Automate System Administration Securely .........27
CHAPTER 4 Configuring Systems with cfengine .............................49
CHAPTER 5 Bootstrapping a New Infrastructure .............................79
CHAPTER 6 Setting Up Automated Installation ..............................107
CHAPTER 7 Automating a New System Infrastructure .......................161
CHAPTER 8 Deploying Your First Application ...............................213
CHAPTER 9 Generating Reports and Analyzing Logs ........................253
CHAPTER 10 Monitoring ....................................................273
CHAPTER 11 Infrastructure Enhancement ...................................323
CHAPTER 12 Improving System Security ....................................353
APPENDIX A Introducing the Basic Tools ....................................375
APPENDIX B Writing cfengine Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
INDEX .......................................................................401
v
201772539.003.png
Contents
About the Authors ................................................................. xv
About the Technical Reviewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
Acknowledgments ................................................................xix
Introduction .....................................................................xxi
CHAPTER 1 Introducing the Basics of Automation ......................1
Do You Need Automation? .........................................2
Large Companies with Many Diverse Systems ...................4
Medium-Sized Companies Planning for Growth ..................4
Internet Service Providers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Application Service Providers ..................................5
Web Server Farms ...........................................5
Beowulf Clusters ............................................6
Network Appliances ..........................................7
What Will You Gain? ..............................................7
Saving Time ................................................7
Reducing Errors .............................................7
Documenting System Configuration Policies ....................8
Realizing Other Benefits ......................................8
What Do System Administrators Do? ...............................10
Methodology: Get It Right from the Start! ...........................11
Homogenizing Your Systems .................................13
Deciding on Push vs. Pull ....................................13
Dealing with Users and Administrators .............................14
Who Owns the Systems? .........................................17
Defining Policy ..................................................18
vii
201772539.004.png
Zgłoś jeśli naruszono regulamin