BN.com Gift Guide

Deploying Rails: Automate, Deploy, Scale, Maintain, and Sleep at Night

Overview

Today's modern Rails applications have lots of moving parts. Make sure your next production deployment goes smoothly with this hands-on book, which guides you through the entire production process. You'll set up scripts to install and configure all the software your servers need, including your application code. Once you're in production, you'll learn how to set up systems to monitor your application's health, gather metrics so you can stop problems before they start, and fix ...

See more details below
Paperback
$24.89
BN.com price
(Save 17%)$30.00 List Price

Pick Up In Store

Reserve and pick up in 60 minutes at your local store

Other sellers (Paperback)
  • All (5) from $3.98   
  • New (1) from $31.81   
  • Used (4) from $3.98   
Sending request ...

Overview

Today's modern Rails applications have lots of moving parts. Make sure your next production deployment goes smoothly with this hands-on book, which guides you through the entire production process. You'll set up scripts to install and configure all the software your servers need, including your application code. Once you're in production, you'll learn how to set up systems to monitor your application's health, gather metrics so you can stop problems before they start, and fix things when they go wrong.

Deploying Rails takes you on a expertly guided tour of the current best practices in Rails deployment and management. You'll find in-depth explanations on effectively running a Rails app by leveraging popular open source tools such as Puppet, Capistrano, and Vagrant. Then you'll go beyond deployment and learn how to use Ganglia and Nagios to monitor your application's health and gather metrics so you can head off problems before they happen.

You'll start out by building your own virtual environment by writing scripts to provision a production server with Vagrant and Puppet. Then you'll leverage the popular Rails deployment tool Capistrano to deploy an application into this infrastructure. Once the app is live, you'll monitor your application's health with Nagios, and configure Ganglia to collect system metrics. Finally, you'll see how to keep your data backed up, recover data when things go wrong, tame your log files, and use Puppet to automate everything along the way.

Whether you're a Rails developer who wants a better understanding of the needs of a production Rails system, if you're a system administrator who wants to manage a Rails application, or if you're bridging the gap between development and operations, this book will be your roadmap to successful production deployment and maintenance, whether your application has ten users or ten million users.

What You Need:

The exercises and examples are most suited to a computer running some Unix variant, such as Mac OS X or Linux. But a Windows machine running Linux in a VirtualBox virtual machine is also sufficient.

We'll show you how to set up a local virtual machine for your deployments; you won't need a dedicated server to hone your deployment skills. We expect you to have a basic familiarity with the Ruby programming language, the Ruby on Rails framework, and the Unix command line.

Read More Show Less

Product Details

  • ISBN-13: 9781934356951
  • Publisher: Pragmatic Programmers, LLC, The
  • Publication date: 8/7/2012
  • Edition number: 1
  • Pages: 240
  • Sales rank: 1,398,683
  • Product dimensions: 7.50 (w) x 9.00 (h) x 0.70 (d)

Meet the Author

Tom Copeland is also a Rails developer at LivingSocial. He has programmed in Ruby since 2004, consulted at InfoEther on Ruby on Rails applications since 2007, and received a "Ruby Hero" award in 2008. Before focusing on Ruby, he wrote two books on Java programming ("PMD Applied" and "Generating Parsers with JavaCC") and was named Oracle's "Open Source Developer of the Year" in 2003.

Anthony Burns is a professional Ruby and Rails developer at LivingSocial. Prior to LivingSocial, he worked at InfoEther, a Rails consultancy, where he handled deployment and infrastructure for various clients.

Read More Show Less

Table of Contents

Preface ix

Acknowledgments xv

1 Introduction 1

1.1 Where Do We Host Our Rails Application? 1

1.2 Building Effective Teams with DevOps 5

1.3 Earning with MassiveApp 7

2 Getting Started with Vagrant 9

2.1 Installing VirtualBox and Vagrant 10

2.2 Configuring Networks and Multiple Virtual Machines 18

2.3 Running Multiple VMs 21

2.4 Where to Go Next 24

2.5 Conclusion 25

2.6 For Future Reference 25

3 Rails on Puppet 27

3.1 Understanding Puppet 27

3.2 Setting Up Puppet 28

3.3 Installing Apache with Puppet 33

3.4 Configuring MySQL with Puppet 44

3.5 Creating the MassiveApp Rails Directory Tree 47

3.6 Writing a Passenger Module 50

3.7 Managing Multiple Hosts with Puppet 54

3.8 Updating the Base Box 55

3.9 Where to Go Next 56

3.10 Conclusion 58

3.11 For Future Reference 59

4 Basic Capistrano 61

4.1 Setting Up Capistrano 62

4.2 Making It Work 65

4.3 Setting Up the Deploy 68

4.4 Pushing a Release 69

4.5 Exploring Roles, Tasks, and Hooks 76

4.6 Conclusion 80

5 Advanced Capistrano 81

5.1 Deploying Faster by Creating Symlinks in Bulk 81

5.2 Uploading and Downloading Files 83

5.3 Restricting Tasks with Roles 85

5.4 Deploying to Multiple Environments with Multistage 87

5.5 Capturing and Streaming Remote Command Output 88

5.6 Running Commands with the Capistrano Shell 90

5.7 Conclusion 93

6 Monitoring with Nagios 95

6.1 A MassiveApp to Monitor 96

6.2 Writing a Nagios Puppet Module 98

6.3 Monitoring Concepts in Nagios 105

6.4 Monitoring Local Resources 106

6.5 Monitoring Services 110

6.6 Monitoring Applications 121

6.7 Where to Go Next 125

6.8 Conclusion 126

6.9 For Future Reference 127

7 Collecting Metrics with Ganglia 129

7.1 Setting Up a Metrics VM 130

7.2 Writing a Ganglia Puppet Module 131

7.3 Using Ganglia Plugins 140

7.4 Gathering Metrics with a Custom Gmetric Plugin 143

7.5 Producing Metrics with Ruby 146

7.6 Where to Go Next 148

7.7 Conclusion 149

7.8 For Future Reference 150

8 Maintaining the Application 153

8.1 Managing Logs 153

8.2 Archiving Application Data 158

8.3 Organizing Backups and Configuring MySQL Failover 160

8.4 Making Downtime Better 169

9 Running Rubies with RVM 173

9.1 Installing RVM 174

9.2 Serving Applications with Passenger Standalone 177

9.3 Using Systemwide RVM 180

9.4 Watching Passenger Standalone with Monit 182

9.5 Contrasting Gemsets and Bundler 184

9.6 Conclusion 184

10 Special Topics 185

10.1 Managing Crontab with Whenever 185

10.2 Backing Up Everything 188

10.3 Using Ruby Enterprise Edition 193

10.4 Securing sshd 196

10.5 Conclusion 197

A1 A Capistrano Case Study 199

A1.1 Requires and Variables 199

A1.2 Hooks and Tasks 201

A2 Running on Unicorn and nginx 205

A2.1 Installing and Configuring nginx 206

A2.2 Running MassiveApp on Unicorn 208

A2.3 Deploying to nginx and Unicorn 209

A2.4 Where to Go Next 210

Bibliography 213

Index 215

Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star

(0)

4 Star

(0)

3 Star

(0)

2 Star

(0)

1 Star

(0)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously

    If you find inappropriate content, please report it to Barnes & Noble
    Why is this product inappropriate?
    Comments (optional)