ceph系列一、ceph安装

1.安装源

(1)安装wget,删除默认的源,国外的比较慢

yum clean all
rm -rf /etc/yum.repos.d/*.repo

(2)下载阿里云的base源

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

(3)下载阿里云的epel源

wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

(4)修改里面的系统版本为7.3.1611

sed -i '/aliyuncs/d' /etc/yum.repos.d/CentOS-Base.repo
sed -i '/aliyuncs/d' /etc/yum.repos.d/epel.repo
sed -i 's/$releasever/7.3.1611/g' /etc/yum.repos.d/CentOS-Base.repo

(5)添加ceph源

vim /etc/yum.repos.d/ceph.repo

2. 系统配置

(1)关闭 SELINUX

sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
setenforce 0 

(2)关闭iptables

systemctl stop firewalld
systemctl disable firewalld

(3)同步时间

yum -y ntp

(4)修改本地域名

cat /etc/hosts
127.0.0.1   local
host localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6
localhost6.localdomain6
192.168.63.128        master
192.168.63.130 	      slave1
192.168.63.131        slave2

3. 硬盘准备(可以跳过)

(1)格式化磁盘sdb

parted -a optimal --script /dev/sdb -- mktable gpt
parted -a optimal --script /dev/sdb -- mkpart primary xfs 0% 100%
mkfs.xfs -f /dev/sdb

(2)格式化磁盘sdc

parted -a optimal --script /dev/sdc -- mktable gpt
parted -a optimal --script /dev/sdc -- mkpart primary xfs 0% 100%
mkfs.xfs -f /dev/sdc

4. 安装ceph

(1)安装ceph-deploy

yum install ceph-deploy -y
mkdir ~/ceph-cluster
cd ceph-cluster/

(2)创建监控节点

ceph-deploy new master

(3)每个节点安装ceph

ceph-deploy install master slave1 slave2

(4)初始化monitor

ceph-deploy mon create-initial

(5)创建日志盘(可跳过,采用步骤6)

ceph-deploy disk zap slave1:sdb
ceph-deploy osd create slave1:sdb:/dev/sdc1

ceph-deploy disk zap slave2:sdb
ceph-deploy osd create slave2:sdb:/dev/sdc1

(6)创建日志路径

mkdir -p /var/local/osd1
ceph-deploy osd prepare ceph1:/var/local/osd0 ceph2:/var/local/osd1
ceph-deploy osd activate ceph1:/var/local/osd0 ceph2:/var/local/osd1

(7)从节点复制配置

ceph-deploy admin master slave1 slave2

(8)删除节点(安装出错)

ceph-deploy purge ceph0 ceph1 ceph2
ceph-deploy purgedata ceph0 ceph1 ceph2			注:purgedata删除ceph程序,重新安装

ceph-deploy forgetkeys

你可能感兴趣的:(ceph)