首页 > 代码库 > CEPH
CEPH
Ceph 搭建文档
硬件环境准备
3台CentOS7。数据盘根据需要来定
软件环境准备
关闭 SELINUX
# sed -i ‘s/SELINUX=enforcing/SELINUX=disabled/g‘ /etc/selinux/config # setenforce 0
关闭iptables
# systemctl stop firewalld
# systemctl disable firewalld
安装 EPEL 软件源:
# rpm –Uvh https://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-8.noarch.rpm
同步时间
# yum -y ntp
# ntpdate asia.pool.ntp.org
分别修改hostname
# hostname node1
# echo node1 > /etc/hostname
分别修改/etc/hosts
# cat /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.50.1 node1 192.168.50.2 node2 192.168.50.3 node3
分别配置ssh免密码登录
# ssh-keygen -t rsa -P ‘‘ # ssh-copy-id node1 # ssh-copy-id node2 # ssh-copy-id node3
Ceph部署
每台安装配置源
# yum clean all # rm -rf /etc/yum.repos.d/*.repo # wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo # wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo # sed -i ‘/aliyuncs/d‘ /etc/yum.repos.d/CentOS-Base.repo # sed -i ‘/aliyuncs/d‘ /etc/yum.repos.d/epel.repo
增加ceph源
# vim /etc/yum.repos.d/ceph.repo [ceph] name=ceph baseurl=http://mirrors.aliyun.com/ceph/rpm-jewel/el7/x86_64/ gpgcheck=0 [ceph-noarch] name=cephnoarch baseurl=http://mirrors.aliyun.com/ceph/rpm-jewel/el7/noarch/ gpgcheck=0
node1安装deploy
# yum install ceph-deploy –y
创建目录
# mkdir ~/ceph-cluster
# cd ceph-cluster/
创建
# ceph-deploy new node1 node2 node3
安装ceph
# ceph-deploy install node1 node2 node3
初始化mon
# ceph-deploy mon create-initial
创建osd
ceph-deploy --overwrite-conf osd create mode1:/dev/sdb node2:/dev/sdb node3:/dev/sdb
创建admin
# ceph-deploy --overwrite-conf admin node1 node2 node3
查看
# ceph health
HEALTH_OK
!如果出错,一切都可以重新来过
# ceph-deploy purge node1 node2 node3 # ceph-deploy purgedata node1 node2 node3 # ceph-deploy forgetkeys
CEPH
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。