Ceph/概要

Cephのインストール

パッケージのインストール

Cephをインストールする前に,Cephのコンパイルに必要なパッケージをインストールする.
合わせて,Cephのソースコードはgitで提供されているためgit-coreをインストールする.

$ sudo aptitude -y install automake autoconf automake gcc g++ libboost-dev libedit-dev libssl-dev \
 libtool libfcgi libfcgi-dev libfuse-dev linux-kernel-headers libatomic-ops-dev \
 btrfs-tools libexpat1-dev git-core

Cephのダウンロード,インストール

Cephのソースコードをダウンロードし,コンパイル,インストールの作業を行う.

$ git clone git://ceph.newdream.net/git/ceph.git
$ cd ceph
$ ./autogen.sh
$ ./configure --with-fuse --with-radosgw --with-libatomic-ops
$ make
$ sudo make install

設定ファイルの作成

まず、/etc/ceph/ceph.confを作成する.

$ sudo mkdir /etc/ceph
$ touch /etc/ceph/ceph.conf

ceph.conf

[global]
	pid file = /var/run/ceph/$name.pid
	debug ms = 0
[mon]
	mon data = /data/mon$id
[mon0]
	host = ceph1
	mon addr = xx.xx.xx.xx:6789
[mon1]
	host = ceph2
	mon addr = xx.xx.xx.xx:6789
[mon2]
	host = ceph3
	mon addr = xx.xx.xx.xx:6789

[mds]
	debug mds = 0
[mds0]
	host = ceph1
[mds1]
	host = ceph2
[mds2]
	host = ceph3
[osd]
	sudo = true
	osd data = /data/osd$id
	osd journal = /data/osd$id/journal
	osd journal size = 100
	debug osd = 0
	debug filestore = 0
[osd0]
	host = ceph1
	btrfs devs = /dev/sdb 

[osd1]

	host = ceph2
	btrfs devs = /dev/sdb
[osd2]
	host = ceph3
	btrfs devs = /dev/sdb

設定ファイルの反映

$ sudo mkcephfs -c /etc/ceph/ceph.conf --allhosts --mkbtrfs

Cephの起動

$ cd ceph
$ sudo cp src/init-ceph /etc/init.d/ceph
$ sudo chmod a+x /etc/init.d/ceph
$ sudo /etc/init.d/ceph --allhosts start

initスクリプトの書き換え

デフォルトでは、/usr/local/etc/cephを読みに行く場合がある.
今回の例では/etc/cephに設定ファイルを作成したので,initスクリプトが設定ファイルを読みに行く際/etc/cephを読むように書き換える.

/etc/init.d/cephの24行目あたり

    # i hate autoconf:
    if [ "/usr/local/etc" = "/usr/etc" ]; then
        ETCDIR=/etc/ceph
    else
        ETCDIR=/etc/ceph
#       ETCDIR=/usr/local/etc/ceph
    fi
fi

トップ   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS