add README and some prototype hooks

This commit is contained in:
Paul Collins 2012-10-02 22:25:11 +13:00
parent 8ff7acad82
commit 3e55c31017
10 changed files with 70 additions and 1 deletions

18
README Normal file
View File

@ -0,0 +1,18 @@
This charm deploys a Ceph cluster.
It uses the new-style Ceph deployment as reverse-engineered from the
Chef cookbook at https://github.com/ceph/ceph-cookbooks
This charm is currently deliberately inflexible and potentially
destructive. It is designed to deploy on exactly three machines.
Each machine will run mon and osd.
The osds use so-called "OSD hotplugging". ceph-disk-prepare is used
to create the filesystems with a special GPT partition type. udev is
set up to mount such filesystems and start the osd daemons as their
storage becomes visible to the system (or after "udevadm trigger").
The Chef cookbook above performs some extra steps to generate an OSD
bootstrapping key and propagate it to the other nodes in the cluster.
Since all our OSDs run on nodes that also run mon, we don't need this
and did not implement it.

View File

@ -4,6 +4,13 @@ options:
description: |
fsid of our cluster
osd-devices:
default: ["/dev/sdb", "/dev/sdc", "/dev/sdd", "/dev/sde"]
type: string
default: /dev/sdb /dev/sdc /dev/sdd /dev/sde
description: |
the devices to format and set up as osd volumes
monitor-secret:
type: string
description: |
this value will become the "mon." key
to generate a suitable value, use
ceph-authtool /dev/stdout --name=mon. --gen-key

View File

@ -2,3 +2,4 @@ Copyright 2012 Canonical Ltd.
Authors:
Paul Collins <paul.collins@canonocal.com>
James Page <james.page@canonical.com>

19
hooks/install Executable file
View File

@ -0,0 +1,19 @@
#!/bin/bash
set -e
set -u
# set up ceph package source
# XXX make this a charm config option
cat >/etc/apt/sources.list.d/ceph-brolin.list <<EOF
deb http://archive.admin.canonical.com/ubuntu precise-cat-ceph main
EOF
apt-get update
apt-get -y install ceph
# ceph-prepare-disk uses this, is only "suggests" in the package
apt-get -y install gdisk
exit 0

5
hooks/mon-relation Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
set -e
set -u

1
hooks/mon-relation-changed Symbolic link
View File

@ -0,0 +1 @@
mon-relation

1
hooks/mon-relation-departed Symbolic link
View File

@ -0,0 +1 @@
mon-relation

1
hooks/mon-relation-joined Symbolic link
View File

@ -0,0 +1 @@
mon-relation

13
hooks/start Normal file
View File

@ -0,0 +1,13 @@
#!/bin/sh
set -e
set -u
for disk in $(config-get osd-devices); do
ceph-disk-prepare $disk
done
udevadm trigger --subsystem-match=block --action=add
exit 0

View File

@ -2,3 +2,6 @@ name: ceph-brolin
summary: distributed storage
description: |
This charm deploys Ceph.
peers:
mon:
interface: ceph-brolin