The Infrastructure Cookbook
The Infrastructure Cookbook
Modern Infrastructure by Example
About the Book
There seems to be a sudden flood of software designed to make managing web infrastructure better, CoreOS is rethinking how we approach our servers at the operating system level, Logstash allows us to turn our logs into an asset, and Sensu is evolving monitoring to deal with the profusion of services used to provide a modern web application.
This book will show you how to put all these things together to provide a coherant whole. Each chapter will walk through setting up one element of that infrastructure, show you what it is and how it works, and then point you in the right direction to find out more. By the end of the book you'll know how to run a cluster of CoreOS servers, deploy software to that cluster, and ensure that everything keeps running smoothly (or at least that you'll be alerted to it if it isn't).
Planned Outline
Introduction- What is this book?
- Who is it for?
- Why did I write it?
- Approach taken
- Each chapter works through a particular aspect of hosting a site.
- Can be used as a reference afterwards.
- Best to at least skim through first time.
- Principles
- What will we end up with?
- What is CoreOS?
- Why use it?
- Starting a CoreOS cluster.
- A quick introduction to Docker.
- Starting our first container.
- What are etcd and confd?
- Why use them?
- Starting etcd.
- Using etcd.
- Registering a container.
- Storing other config.
- Using confd
- Pointing a service at other things.
- Updating config files.
- Further reading.
- What is ELK?
- Why use it?
- Setting up RabbitMQ.
- Register with etcd.
- Configure with confd.
- Setting up Elasticsearch.
- Register with etcd.
- Configure with confd.
- Setting up Logstash.
- Relaying log data to Logstash.
- Revisit RabbitMQ to ship logs.
- Revisit CoreOS to ship logs.
- Setting up Kibana.
- Scaling.
- Further reading.
- What is Sensu?
- Why use it?
- Setting up Sensu.
- Deploy a Redis container.
- Configure RabbitMQ and friends with confd.
- Starting the dashboard.
- How we're going to configure Sensu
- Work this one out - need a way to pull service config from confd.
- Standalone checks look like the way forward here
- Map alert levels to actual alerting methods, eg CRIT -> SMS, WARN -> Hipchat
- Using Sensu
- Monitor CoreOS servers
- Monitor RabbitMQ
- Monitor ELK services
- Deregistering containers?
- Logging config.
- Further reading.
- What is Statsd?
- Why use it?
- Why Librato, rather than Graphite?
- Why indeed? Maybe revisit this.
- Setting up Statsd
- Config from confd
- Register with etcd
- Sending metrics to Statsd
- Sensu
- May need to write a plugin for this.
- Other applications
This is probably much to far back, but not sure we've built up enough knowledge until we get here.
- What is a base container?
- Why are we building one?
- What is it for?
- Building the container
- Service registration
- Logstash forwarder
- Adding new Logstash config
- Sensu client
- Adding new Sensu checks
- Running the actual services you want
- What is the service? (I'm Here - small person tracking web service)
- Doesn't require a database, just Redis, which we've already configured once.
- PUT your location (eg "Home") to an endpoint
- GET the endpoint to find out where you are
- GET / to find out where everyone is
- Building the container
- Using the service
- Metrics
- Rack::StatsD
- Track checkin counts
- Logging
- Backups - don't keep all your eggs in one basket.
Need to think this one through a bit:
- Nginx/VulcanD? Which one?
- Platform layer load balancers like ELB?
- Running multiple instances of a container.
- What is Postgres?
- Why use it?
- Container
- Go into detail on Docker volumes.
- Using the service.
- Monitoring config.
- Logging config.
- Backups.
- Redundancy.
- Further reading.
- Something Django based? Maybe Node? We'll see.
- Puts everything learnt previously together to deploy a full database backed web service.
- Load balance it as well.
Causes Supported
Code Club
https://www.codeclub.org.ukA nationwide network of volunteer-led after school coding clubs for children aged 9-11.
The Leanpub 60 Day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.
You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!
So, there's no reason not to click the Add to Cart button, is there?
See full terms...
Earn $8 on a $10 Purchase, and $16 on a $20 Purchase
We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
In fact, authors have earnedover $14 millionwriting, publishing and selling on Leanpub.
Learn more about writing on Leanpub
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them