4343223 发表于 2016-9-30 08:45:19

centos7 ceph-deploy 安装jewel

一、安装依赖

以下操作需要在所有节点上执行
1、安装ceph源


1
yum install epel-release yum-plugin-priorities -y




2、添加ceph源
编辑/etc/yum.repos.d/ceph.repo


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

name=Ceph packages for $basearch
baseurl=http://debian.ustc.edu.cn/ceph/rpm-jewel/el7/$basearch
enabled=1
gpgcheck=1
type=rpm-md
gpgkey=http://debian.ustc.edu.cn/ceph/keys/release.asc
priority=1

name=Ceph noarch packages
baseurl=http://debian.ustc.edu.cn/ceph/rpm-jewel/el7/noarch
enabled=1
gpgcheck=1
type=rpm-md
gpgkey=http://debian.ustc.edu.cn/ceph/keys/release.asc
priority=1

name=Ceph source packages
baseurl=http://debian.ustc.edu.cn/ceph/rpm-hammer/el7/SRPMS
enabled=1
gpgcheck=1
type=rpm-md
gpgkey=http://debian.ustc.edu.cn/ceph/keys/release.asc
priority=1




3、安装ntp


1
2
3
yum install ntp -y
systemctl enable ntpd
systemctl restart ntpd




4、创建部署用户


1
2
3
4
useradd -m ceph
passwd ceph
echo "ceph ALL = (root) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/ceph
chmod 0440 /etc/sudoers.d/ceph




5、修改sudo配置,找到Defaults   requiretty行修改如下


1
Defaults    !requiretty




6、编辑/etc/hosts 添加ceph节点的主机名


1
2
3
192.168.56.103 node0
192.168.56.104 node1
192.168.56.105 node2




二、配置部署节点
1、在部署节点上安装ceph-deploy


1
yum update && yum install ceph-deploy -y




2、配置部署节点的ceph用户,使用无密码方式以ceph用户登录ceph节点


1
2
3
4
5
su - ceph
ssh-keygen
ssh-copy-id ceph@node0
ssh-copy-id ceph@node1
ssh-copy-id ceph@node2




3、编辑 ceph用户下的文件 ~/.ssh/config


1
2
3
4
5
6
7
8
9
Host node0
   Hostname node0
   User ceph
Host node1
   Hostname node1
   User ceph
Host node2
   Hostname node2
   User ceph




4、修改~/.ssh/config 权限


1
chmod 644 ~/.ssh/config




三、部署ceph
以ceph用户登录布署节点
1、创建布署目录


1
2
mkdir my-cluster
cd my-cluster




2、清理旧配置,全新安装可不用执行


1
2
ceph-deploy purgedata node0 node1 node2
ceph-deploy forgetkeys




3、创建cluster


1
ceph-deploy new node0




4、编辑ceph.conf


1
2
3
4
5
6
7
8
9
10
11

fsid = 2e351760-f2f1-455f-940d-89be2f855a76
mon_initial_members = node0
mon_host = 192.168.56.103
auth_cluster_required = cephx
auth_service_required = cephx
auth_client_required = cephx
osd pool default size = 1
osd pool default min size = 1
public network = 192.168.56.0/24
cluster network = 192.168.56.0/24




5、安装ceph
这里直接登录进各ceph节点,手动安装


1
yum install ceph -y




6、添加 initial monitor


1
ceph-deploy mon create-initial




7、添加osd

1
2
ceph-deploy osd prepare node0:sdb
ceph-deploy osd activatenode0:/dev/sdb1




四、安装radosgw

1
2
ssh ceph@node0 sudo yum install ceph-radosgw -y
ceph-deploy rgw create node0






页: [1]
查看完整版本: centos7 ceph-deploy 安装jewel