Sharing

2011年10月20日 星期四

Install Ceph 0.37


配合 ubuntu oneiric (11.10) release, Ceph 也 release 0.37, 在安裝上更方便了, 然後 library 也更齊全, 首先參考他新的 document

http://ceph.newdream.net/docs/latest/ops/install/mkcephfs/#installing-the-packages

wget -q -O- https://raw.github.com/NewDreamNetwork/ceph/master/keys/release.asc | sudo apt-key add -

sudo tee /etc/apt/sources.list.d/ceph.list << EOF <="" apt-get="" ceph.newdream.net="" ceph="" deb-src="" deb="" debian="" eof="" http:="" install="" main="" natty="" pre="" sudo="" update="">

The following packages have unmet dependencies:
 ceph : Depends: libcrypto++8 but it is not installable
        Depends: ceph-common but it is not going to be installed
        Recommends: ceph-fuse but it is not going to be installed
        Recommends: libcephfs1 but it is not going to be installed
        Recommends: librados2 but it is not going to be installed
        Recommends: librbd1 but it is not going to be installed
        Recommends: btrfs-tools but it is not going to be installed
接下來設定好 /etc/ceph/ceph.conf, (請按照網站上的設定方法, 因為舊的設定檔無法使用) , 1mon + 1mds + 2osd
[global]
        auth supported = cephx
        keyring = /etc/ceph/$name.keyring
        log file = /var/log/ceph/$name.log
        log_to_syslog = true        ; uncomment this line to log to syslog
        pid file = /var/run/ceph/$name.pid

[mon]
        mon data = /srv/mon.$id

[mon.a]
        host = ubuntu1104-64-5
        mon addr = 172.16.33.5:6789

[mds]

[mds.a]
        host = ubuntu1104-64-5

[osd]
        osd data = /srv/osd.$id
        osd journal = /srv/osd.$id.journal
        osd journal size = 1000 ; journal size, in megabytes

[osd.0]
        host = ubuntu1104-64-5
        btrfs devs = /dev/mapper/ubuntu1104--64--5-lvol0


[osd.1]
        host = ubuntu1104-64-6
        btrfs devs = /dev/mapper/ubuntu1104--64--6-lvol0


把 master 的 public key import 到其它台
root@ubuntu1104-64-5:~$ ssh-copy-id -i /root/.ssh/id_dsa.pub root@172.16.33.6
root@ubuntu1104-64-5:~$ ssh-copy-id -i /root/.ssh/id_dsa.pub root@172.16.33.7
root@ubuntu1104-64-5:~$ mkdir /var/log/ceph # 把 log folder 先建出來
# 把 file system 建立起來

root@ubuntu1104-64-5:/etc/ceph$ mkcephfs -a -c /etc/ceph/ceph.conf --mkbtrfs

# 把 service 啟動起來

root@ubuntu1104-64-5:/etc/ceph$ service ceph -a start
=== mon.a ===
Starting Ceph mon.a on ubuntu1104-64-5...
starting mon.a rank 0 at 172.16.33.5:6789/0 mon_data /srv/mon.a fsid cbb32d58-ceb8-7379-e10e-fc5ad51
865e3
=== mds.a ===
Starting Ceph mds.a on ubuntu1104-64-5...
starting mds.a at 0.0.0.0:6800/1124
=== osd.0 ===
Mounting Btrfs on ubuntu1104-64-5:/srv/osd.0
Scanning for Btrfs filesystems
Starting Ceph osd.0 on ubuntu1104-64-5...
starting osd.0 at 0.0.0.0:6801/1198 osd_data /srv/osd.0 /srv/osd.0.journal
=== osd.1 ===
Mounting Btrfs on ubuntu1104-64-6:/srv/osd.1
Scanning for Btrfs filesystems
Starting Ceph osd.1 on ubuntu1104-64-6...
starting osd.1 at 0.0.0.0:6800/19846 osd_data /srv/osd.1 /srv/osd.1.journal

authtool 的名字改成 ceph-authtool
root@ubuntu1104-64-5:/etc/ceph$ ceph -s
2011-10-20 14:39:54.756735    pg v64: 396 pgs: 396 active+clean; 24 KB data, 4672 KB used, 395 GB / 400 GB avail
2011-10-20 14:39:54.757492   mds e4: 1/1/1 up {0=a=up:active}
2011-10-20 14:39:54.757512   osd e4: 2 osds: 2 up, 2 in
2011-10-20 14:39:54.757541   log 2011-10-20 14:39:55.081612 osd.1 172.16.33.6:6800/19846 102 : [INF] 1.5e scrub ok
2011-10-20 14:39:54.757582   mon e1: 1 mons at {a=172.16.33.5:6789/0}

root@ubuntu1104-64-5:/etc/ceph$ ceph auth list
2011-10-20 14:40:10.586279 mon <- [auth,list]
2011-10-20 14:40:10.586960 mon.0 -> 'installed auth entries:
mon.
        key: AQDfwJ9OkCqOJRAAB5cXyb6EzUrMbCOL1xGVUw==
mds.a
        key: AQDfwJ9OyMIiIBAAh07TCA6SAkNKixVYoyJGvA==
        caps: [mds] allow
        caps: [mon] allow rwx
        caps: [osd] allow *
osd.0
        key: AQDcwJ9OYP7LKhAAhfO7c11l+U5KAGAP+8kVqw==
        caps: [mon] allow rwx
        caps: [osd] allow *
osd.1
        key: AQDnwJ9OOKCqBBAA/oPp6Z1yg+WjuTAutZHT7g==
        caps: [mon] allow rwx
        caps: [osd] allow *
client.admin
        key: AQDfwJ9O8AVZJBAAWe9LfeOYUIP7GauVU1Mi5A==
        caps: [mds] allow
        caps: [mon] allow *
        caps: [osd] allow *
' (0)

2 則留言:

CHI 提到...

能請問你架設ceph的問題嗎

Pjack 提到...

我其實了解的也不多, 能幫忙的儘量幫忙, 其實也可以直接寫信給 Ceph 團隊, 他們回答的速度都滿快的