安裝準備
1.0 準備
三臺虛擬機分別改hosts和hostname文件為ceph-node1唆鸡、ceph-node2涝影、ceph-node3,并分別掛載三個磁盤争占。ceph-node1節(jié)點作為ceph-deploy節(jié)點燃逻,三個節(jié)點同時作為osd節(jié)點和monitor節(jié)點序目。
1.1 添加release.key
apt-get update && apt-get -y upgrade
wget -q -O- 'https://download.ceph.com/keys/autobuild.asc' | apt-key add -
1.2 添加Ceph軟件包源,用Ceph穩(wěn)定版
echo deb http://download.ceph.com/debian-jewel/ $(lsb_release -sc) main | tee /etc/apt/sources.list.d/ceph.list
1.3 更新源倉庫并安裝Ceph
apt-get update && apt-get install ceph-deploy
1.4 安裝NTP(以免因時鐘漂移導致故障)
apt-get install ntp
1.5安裝 SSH 服務器
apt-get install openssh-server
注意:以下命令只在ceph-node1節(jié)點中執(zhí)行
1.6允許無密碼 SSH 登錄
1.6.1 生成 SSH 密鑰對伯襟,但不要用 sudo 或 root 用戶猿涨。提示 “Enter passphrase” 時,直接回車姆怪,口令即為空:
ssh-keygen
1.6.2 把公鑰拷貝到各 Ceph 節(jié)點叛赚。
ssh-copy-id ceph-node1 ceph-node2 ceph-node3
1.7 創(chuàng)建集群
ceph-deploy new ceph-node1 ceph-node2 ceph-node3
1.8 安裝ceph
ceph-deploy install ceph-node1 ceph-node2 ceph-node3
1.9 配置初始監(jiān)視器,并收集所有秘鑰
ceph-deploy mon create-initial
1.10 刪除磁盤現(xiàn)有分區(qū)表和磁盤內容
ceph-deploy disk zap ceph-node1:xvdb ceph-node1:xvdc ceph-node1:xvde ceph-node2:xvdb ceph-node2:xvdc ceph-node2:xvde ceph-node3:xvdb ceph-node3:xvdc ceph-node3:xvde
1.11 準備OSD
ceph-deploy osd prepare ceph-node1:xvdb ceph-node1:xvdc ceph-node1:xvde ceph-node2:xvdb ceph-node2:xvdc ceph-node2:xvde ceph-node3:xvdb ceph-node3:xvdc ceph-node3:xvde
1.12 激活OSD
ceph-deploy osd activate ceph-node1:xvdb1 ceph-node1:xvdc1 ceph-node1:xvde1 ceph-node2:xvdb1 ceph-node2:xvdc1 ceph-node2:xvde1 ceph-node3:xvdb1 ceph-node3:xvdc1 ceph-node3:xvde1
1.13 調整rbd存儲池pg_num和pgp_num的值
ceph osd pool set rbd pg_num 256
ceph osd pool set rbd pgp_num 256
1.14 驗證
ceph -s