~ubuntu-branches/ubuntu/quantal/ceph/quantal

« back to all changes in this revision

Viewing changes to doc/config-cluster/chef.rst

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2012-07-16 09:56:24 UTC
  • mfrom: (0.3.11)
  • mto: This revision was merged to the branch mainline in revision 17.
  • Revision ID: package-import@ubuntu.com-20120716095624-azr2w4hbhei1rxmx
Tags: upstream-0.48
ImportĀ upstreamĀ versionĀ 0.48

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
=====================
 
2
 Deploying with Chef
 
3
=====================
 
4
 
 
5
We use Chef cookbooks to deploy Ceph. See `Managing Cookbooks with Knife`_ for details
 
6
on using ``knife``.  For Chef installation instructions, see
 
7
`Installing Chef <../../install/chef>`_.
 
8
 
 
9
Add a Cookbook Path
 
10
-------------------
 
11
Add the ``cookbook_path`` to your ``~/.ceph/knife.rb`` configuration file. For example:: 
 
12
 
 
13
        cookbook_path '/home/userId/.chef/ceph-cookbooks'
 
14
 
 
15
Install Ceph Cookbooks
 
16
----------------------
 
17
To get the cookbooks for Ceph, clone them from git.::
 
18
 
 
19
        cd ~/.chef      
 
20
        git clone https://github.com/ceph/ceph-cookbooks.git
 
21
        knife cookbook upload parted btrfs ceph
 
22
 
 
23
Install Apache Cookbooks
 
24
------------------------
 
25
RADOS Gateway uses Apache 2. So you must install the Apache 2 cookbooks. 
 
26
To retrieve the Apache 2 cookbooks, execute the following::  
 
27
 
 
28
        cd ~/.chef/ceph-cookbooks
 
29
        knife cookbook site download apache2
 
30
 
 
31
The `apache2-{version}.tar.gz`` archive will appear in your ``~/.ceph`` directory.
 
32
In the following example, replace ``{version}`` with the version of the Apache 2
 
33
cookbook archive knife retrieved. Then, expand the archive and upload it to the 
 
34
Chef server.:: 
 
35
 
 
36
        tar xvf apache2-{version}.tar.gz
 
37
        knife cookbook upload apache2
 
38
 
 
39
Configure Chef
 
40
--------------
 
41
To configure Chef, you must specify an environment and a series of roles. You 
 
42
may use the Web UI or ``knife`` to perform these tasks.
 
43
 
 
44
The following instructions demonstrate how to perform these tasks with ``knife``.
 
45
 
 
46
 
 
47
Create a role file for the Ceph monitor. :: 
 
48
 
 
49
        cat >ceph-mon.rb <<EOF
 
50
        name "ceph-mon"
 
51
        description "Ceph monitor server"
 
52
        run_list(
 
53
                'recipe[ceph::mon]'
 
54
        )
 
55
        EOF
 
56
 
 
57
Create a role file for the OSDs. ::
 
58
 
 
59
        cat >ceph-osd.rb <<EOF
 
60
        name "ceph-osd"
 
61
        description "Ceph object store"
 
62
        run_list(
 
63
                'recipe[ceph::bootstrap_osd]'
 
64
        )
 
65
        EOF
 
66
 
 
67
Add the roles to Chef using ``knife``. :: 
 
68
 
 
69
        knife role from file ceph-mon.rb ceph-osd.rb
 
70
 
 
71
You may also perform the same tasks with the command line and a ``vim`` editor.
 
72
Set an ``EDITOR`` environment variable. :: 
 
73
 
 
74
        export EDITOR=vi
 
75
 
 
76
Then exectute:: 
 
77
 
 
78
        knife create role {rolename}
 
79
 
 
80
The ``vim`` editor opens with a JSON object, and you may edit the settings and
 
81
save the JSON file.
 
82
 
 
83
Finally configure the nodes. ::
 
84
 
 
85
        knife node edit {nodename}
 
86
 
 
87
 
 
88
 
 
89
 
 
90
.. _Managing Cookbooks with Knife: http://wiki.opscode.com/display/chef/Managing+Cookbooks+With+Knife