环境准备
软件
centos 7.5.1804 最新版
ceph 12.2.10 Luminous 稳定版
服务器
序号 | IP地址 | 主机名 | 组件 | 备注 | |
---|---|---|---|---|---|
1 | 10.10.10.27 | ceph-object-01 | Ceph-deploy MGR Node MON Node OSD Node |
||
2 | 10.10.10.28 | ceph-object-02 | MGR Node MON Node OSD Node |
||
3 | 10.10.10.29 | ceph-object-03 | MGR Node MON Node OSD Node |
主机名
echo "\
10.10.10.27 ceph-object-01
10.10.10.28 ceph-object-02
10.10.10.29 ceph-object-03" >> /etc/hosts
变量
export username="ceph-admin"
export passwd="ceph-admin"
export node1="ceph-object-01"
export node2="ceph-object-02"
export node3="ceph-object-03"
export node1_ip="10.10.10.27"
export node2_ip="10.10.10.28"
export node3_ip="10.10.10.29"
配置RPM
echo "\
[ceph]
name=ceph
baseurl=http://mirrors.aliyun.com/ceph/rpm-luminous/el7/x86_64/
gpgcheck=0
priority=1
[ceph-noarch]
name=cephnoarch
baseurl=http://mirrors.aliyun.com/ceph/rpm-luminous/el7/noarch/
gpgcheck=0
priority=1
[ceph-source]
name=Ceph source packages
baseurl=http://mirrors.aliyun.com/ceph/rpm-luminous/el7/SRPMS/
enabled=0
gpgcheck=1
type=rpm-md
gpgkey=http://mirrors.aliyun.com/ceph/keys/release.asc
priority=1" >> /etc/yum.repos.d/ceph.repo
配置NTP
yum -y install ntpdate
ntpdate cn.ntp.org.cn
创建部署用户和ssh免密码登陆
useradd ${username}
echo "${passwd}"|passwd --stdin ${username}
echo "${username} ALL = (root) NOPASSWD:ALL"|sudo tee /etc/sudoers.d/${username}
chmod 0440 /etc/sudoers.d/${username}
配置防火墙、或者关闭
关闭selinux
sed -i "s#enforcing#disabled#g" /etc/selinux/config
setenforce 0
配置sudo不需要tty
sed -i "s/Default requiretty/#Default requiretty/g" /etc/sudoers
基础集群
安装ceph-deploy
yum -y install ceph-deploy python-pip
部署节点
ceph-deploy new ceph-object-01 ceph-object-02 ceph-object-03
[root@cs6 my-cluster]#
[ceph_deploy.conf][DEBUG ] found configuration file at: /root/.cephdeploy.conf
[ceph_deploy.cli][INFO ] Invoked (2.0.1): /usr/bin/ceph-deploy new ceph-object-01 ceph-object-02 ceph-object-03
[ceph_deploy.cli][INFO ] ceph-deploy options:
[ceph_deploy.cli][INFO ] username : None
[ceph_deploy.cli][INFO ] func : <function new at 0x7f659e867d70>
[ceph_deploy.cli][INFO ] verbose : False
[ceph_deploy.cli][INFO ] overwrite_conf : False
[ceph_deploy.cli][INFO ] quiet : False
[ceph_deploy.cli][INFO ] cd_conf : <ceph_deploy.conf.cephdeploy.Conf instance at 0x7f659dfdf998>
[ceph_deploy.cli][INFO ] cluster : ceph
[ceph_deploy.cli][INFO ] ssh_copykey : True
[ceph_deploy.cli][INFO ] mon : ['ceph-object-01', 'ceph-object-02', 'ceph-object-03']
[ceph_deploy.cli][INFO ] public_network : None
[ceph_deploy.cli][INFO ] ceph_conf : None
[ceph_deploy.cli][INFO ] cluster_network : None
[ceph_deploy.cli][INFO ] default_release : False
[ceph_deploy.cli][INFO ] fsid : None
[ceph_deploy.new][DEBUG ] Creating new cluster named ceph
[ceph_deploy.new][INFO ] making sure passwordless SSH succeeds
[ceph-object-01][DEBUG ] connected to host: cs6
[ceph-object-01][INFO ] Running command: ssh -CT -o BatchMode=yes ceph-object-01
[ceph-object-01][DEBUG ] connected to host: ceph-object-01
[ceph-object-01][DEBUG ] detect platform information from remote host
[ceph-object-01][DEBUG ] detect machine type
[ceph-object-01][DEBUG ] find the location of an executable
[ceph-object-01][INFO ] Running command: /usr/sbin/ip link show
[ceph-object-01][INFO ] Running command: /usr/sbin/ip addr show
[ceph-object-01][DEBUG ] IP addresses found: [u'169.254.0.1', u'192.168.122.1', u'10.10.10.27']
[ceph_deploy.new][DEBUG ] Resolving host ceph-object-01
[ceph_deploy.new][DEBUG ] Monitor ceph-object-01 at 10.10.10.27
[ceph_deploy.new][INFO ] making sure passwordless SSH succeeds
[ceph-object-02][DEBUG ] connected to host: cs6
[ceph-object-02][INFO ] Running command: ssh -CT -o BatchMode=yes ceph-object-02
[ceph-object-02][DEBUG ] connected to host: ceph-object-02
[ceph-object-02][DEBUG ] detect platform information from remote host
[ceph-object-02][DEBUG ] detect machine type
[ceph-object-02][DEBUG ] find the location of an executable
[ceph-object-02][INFO ] Running command: /usr/sbin/ip link show
[ceph-object-02][INFO ] Running command: /usr/sbin/ip addr show
[ceph-object-02][DEBUG ] IP addresses found: [u'10.10.10.28', u'169.254.0.1', u'192.168.122.1']
[ceph_deploy.new][DEBUG ] Resolving host ceph-object-02
[ceph_deploy.new][DEBUG ] Monitor ceph-object-02 at 10.10.10.28
[ceph_deploy.new][INFO ] making sure passwordless SSH succeeds
[ceph-object-03][DEBUG ] connected to host: cs6
[ceph-object-03][INFO ] Running command: ssh -CT -o BatchMode=yes ceph-object-03
[ceph-object-03][DEBUG ] connected to host: ceph-object-03
[ceph-object-03][DEBUG ] detect platform information from remote host
[ceph-object-03][DEBUG ] detect machine type
[ceph-object-03][DEBUG ] find the location of an executable
[ceph-object-03][INFO ] Running command: /usr/sbin/ip link show
[ceph-object-03][INFO ] Running command: /usr/sbin/ip addr show
[ceph-object-03][DEBUG ] IP addresses found: [u'10.10.10.29', u'169.254.0.1', u'192.168.122.1']
[ceph_deploy.new][DEBUG ] Resolving host ceph-object-03
[ceph_deploy.new][DEBUG ] Monitor ceph-object-03 at 10.10.10.29
[ceph_deploy.new][DEBUG ] Monitor initial members are ['ceph-object-01', 'ceph-object-02', 'ceph-object-03']
[ceph_deploy.new][DEBUG ] Monitor addrs are ['10.10.10.27', '10.10.10.28', '10.10.10.29']
[ceph_deploy.new][DEBUG ] Creating a random mon key...
[ceph_deploy.new][DEBUG ] Writing monitor keyring to ceph.mon.keyring...
[ceph_deploy.new][DEBUG ] Writing initial config to ceph.conf...
安装ceph包
yum -y install ceph ceph-radosgw
配置初始化monitors,并收集所有密钥
ceph-deploy mon create-initial
分发配置
ceph-deploy admin ceph-object-01 ceph-object-02 ceph-object-03
部署osd
ceph-deploy disk zap ceph-object-01 /dev/sdb
ceph-deploy osd create ceph-object-01 --data /dev/sdb
ceph-deploy disk zap ceph-object-02 /dev/sdb
ceph-deploy osd create ceph-object-02 --data /dev/sdb
ceph-deploy disk zap ceph-object-03 /dev/sdb
ceph-deploy osd create ceph-object-03 --data /dev/sdb
部署mgr
ceph-deploy mgr create ceph-object-01 ceph-object-02 ceph-object-03
开启dashboard模块 启动UI界面
ceph mgr module enable dashboard
ceph mgr module disable dashboard
日志
/var/log/ceph