ceph-luminous版本搭建过程
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ceph-luminous版本搭建过程相关的知识,希望对你有一定的参考价值。
一、环境准备
1、本次搭建环境为centos7.2版本
2、本次搭建机器为
ceph-node1 192.168.13.72
ceph-node2 192.168.13.84
二、ceph搭建前环境准备
1、准备ceph-deploy的镜像源
vim /etc/yum.repos.d/ceph.repo
[ceph-noarch]
name=Ceph noarch packages
baseurl=https://download.ceph.com/rpm-luminous/el7/noarch
enabled=1
gpgcheck=1
type=rpm-md
gpgkey=https://download.ceph.com/keys/release.asc
yum update
yum -y install ceph-deploy
2、修改hosts文件、安装ceph-deploy
[[email protected] my-cluster]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.13.72 ceph-node1
192.168.13.84 ceph-node2
3、同步时间
1)修改时区 cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
2)vim /etc/chrony.conf
systemctl restart chronyd
systemctl enable chronyd
3)修改其他node节点的/etc/chrony.conf
##删除其他server,修改一行
server 192.168.13.72 iburst
4)systemctl restart chronyd
5)yum install ntp ntpdate
6)ntpdate 192.168.13.72
4、创建ceph用户并赋予sudo权限
[[email protected] ~]# useradd -d /home/ceph -m ceph
[[email protected] ~]# passwd ceph
Changing password for user ceph.
New password:
BAD PASSWORD: The password is a palindrome
Retype new password:
passwd: all authentication tokens updated successfully.
[[email protected] ~]# echo "ceph ALL=(root) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/ceph
ceph ALL=(root) NOPASSWD:ALL
[[email protected] ~]# chmod 0440 /etc/sudoers.d/ceph
5、设置免密登录
[[email protected] ~]# ssh-keygen
[[email protected] ~]# ssh-copy-id [email protected]
[[email protected] ~]# vim /root/.ssh/config
Host node1
Hostname ceph-node1
User ceph
Host node2
Hostname ceph-node2
User ceph
6、关闭selinux,添加防火墙规则6789、6800、7300
[[email protected] systemd]# setenforce 0
[[email protected] systemd]# iptables -I INPUT 1 -p tcp --dport 6789 -J ACCEPT
[[email protected] systemd]# iptables -I INPUT 1 -p tcp --dport 6800 -j ACCEPT
[[email protected] systemd]# iptables -I INPUT 1 -p tcp --dport 7300 -j ACCEPT
[[email protected] systemd]# iptables -I OUTPUT 1 -p tcp --dport 7300 -j ACCEPT
[[email protected] systemd]# iptables -I OUTPUT 1 -p tcp --dport 6800 -j ACCEPT
[[email protected] systemd]# iptables -I OUTPUT 1 -p tcp --dport 6789 -j ACCEPT
7、创建新的集群
[[email protected] my-cluster]# ceph-deploy new ceph-node1 (ceph-node1为本机的hostname)
8、两天node安装ceph
[[email protected] my-cluster]# ceph-deploy install ceph-node1 ceph-node2
9、部署初始监视器并收集密钥
[[email protected] my-cluster]# ceph-deploy mon create-initial
10、将配置文件和管理密钥复制到管理节点和你的Ceph的节点
[[email protected] my-cluster]# ceph-deploy admin ceph-node1 ceph-node2
11、部署管理器守护程序
[[email protected] my-cluster]# ceph-deploy mgr create ceph-node1
12、添加OSD
[[email protected] my-cluster]# ceph-deploy osd create --data /dev/vdc ceph-node1
[[email protected] my-cluster]# ceph-deploy osd create --data /dev/vdc ceph-node2
13、检测集群状态
ceph -s
[[email protected] my-cluster]# ceph -s
cluster:
id: 5c202bf8-aab1-4317-bf76-28a7ed57652a
health: HEALTH_OK
services:
mon: 1 daemons, quorum ceph-node1
mgr: ceph-node1(active)
osd: 2 osds: 2 up, 2 in
data:
pools: 0 pools, 0 pgs
objects: 0 objects, 0 B
usage: 2.0 GiB used, 98 GiB / 100 GiB avail
pgs:
14、添加元数据服务器(如需要使用文件系统需要添加,反之不用添加)
[[email protected] my-cluster]# ceph-deploy mds create ceph-node1
以上是关于ceph-luminous版本搭建过程的主要内容,如果未能解决你的问题,请参考以下文章
超级账本区块链Fabric2.4.4版本搭建过程(完整过程)