Managing Servers with Chef

13
Using Chef to Manage Your Server Environments

Transcript of Managing Servers with Chef

Page 1: Managing Servers with Chef

Using Chef to Manage Your

Server Environments

Page 2: Managing Servers with Chef

About Blend

Page 3: Managing Servers with Chef

DevOps

Combines disciplines of

software development / QA

with system administration

(Development / Operations)

Page 4: Managing Servers with Chef

Building/Deploying•Manually

• Build scripts

• “I want to tell this computer how it should be set up, and let it do the rest”

Page 5: Managing Servers with Chef

Chef•Client/Server system for managing

configuration

•Declarative Recipes define end state instead of construction process

• Idempotent - re-running script only causes changes to execute

Page 6: Managing Servers with Chef

No scripts - recipes•Cookbooks - modules for adding support for

software

•Recipes - contained by cookbooks, define server configuration, templates, etc

• Attributes - configurable variables consumed by recipes

•Recipes provide defaults, can be overridden by server, role, or environment

• Some generated automatically

•Data Bags - hold arbitrary configuration data

Page 7: Managing Servers with Chef

Parts and pieces•Chef Server - holds cookbooks and

configuration for your organization

•Chef Client - installed on servers via bootstrap process to execute recipes, solo and client flavors

•Ohai - discovery utility that extracts automatic attributes from servers

• Knife - command line tool for managing chef

Page 8: Managing Servers with Chef

Managing/Orchestration•Chef Solo - One server, no management,

cookbooks go on server

•Hosted Chef - Opscode-provided server, fine-grained permission controls

•Chef Server - Self-hosted chef management server

•Chef supports git, but git repo and servers don’t talk

Page 9: Managing Servers with Chef

Development cycle•Create cookbook

•Develop/Test

•Upload recipe to chef server

• Execute on client servers

Page 10: Managing Servers with Chef

Blend Server Layout/Sites

.conf - all apache vhost configs symlink here

[sitename]

conf - apache and other configs

htdocs - web app, usually apache root dir

logs - apache and other logs

deploy - deploy scripts

Page 11: Managing Servers with Chef

Development tools• Berkshelf - code gen and dependency

management

• Vagrant - automated testing environments

Page 12: Managing Servers with Chef

Linkses•Chef - community.opscode.com

• Berkshelf - berkshelf.com

• Vagrant - vagrantup.com

• Epic Tutorial - vialstudios.com/guide-authoring-cookbooks.html

Page 13: Managing Servers with Chef

Questions?Joe Kepley

Blend Interactive

http://blendinteractive.comhttp://github.com/blendinteractive

http://joind.in/8102@joekepley