温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

ceph集群的搭建方法

发布时间:2021-09-18 16:10:25 来源:亿速云 阅读:167 作者:chen 栏目:云计算

这篇文章主要讲解了“ceph集群的搭建方法”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“ceph集群的搭建方法”吧!

1.添加epel-release拓展源

yum install --nogpgcheck -y epel-release

rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

2.添加ceph源

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

[Ceph]
name=Ceph packages for $basearch
baseurl=http://mirrors.aliyun.com/ceph/rpm-jewel/el7/$basearch
enabled=1
gpgcheck=1
type=rpm-md
gpgkey=https://mirrors.aliyun.com/ceph/keys/release.asc
priority=1
 
[Ceph-noarch]
name=Ceph noarch packages
baseurl=http://mirrors.aliyun.com/ceph/rpm-jewel/el7/noarch
enabled=1
gpgcheck=1
type=rpm-md
gpgkey=https://mirrors.aliyun.com/ceph/keys/release.asc
priority=1
 
[ceph-source]
name=Ceph source packages
baseurl=http://mirrors.aliyun.com/ceph/rpm-jewel/el7/SRPMS
enabled=1
gpgcheck=1
type=rpm-md
gpgkey=https://mirrors.aliyun.com/ceph/keys/release.asc
priority=1

3.安装ceph准备

更新主机库文件:yum update -y

下载ceph-deploy:yum install ceph-deploy -y

下载安装ntp服务:yum install ntp ntpdate ntp-doc openssh-server yum-plugin-priorities -y

修改/etc/hosts文件,添加IP-主机名映射,例如:192.168.1.111 node1

创建目录放置ceph安装后的文件并进入目录:mkdir my-cluster ; cd my-cluster

使用ceph-deploy创建新的集群:ceph-deploy new node1(最后为主机名)

修改ceph.conf配置文件,添加一下内容

osd pool default size = 3  #创建3个副本
public_network = 192.168.1.0/24  #公用网络
cluster_network = 192.1681.0/24  #集群网络

4.ceph-deploy下载安装ceph程序:ceph-deploy install node1

5.划分三个大小相等的分区,并且全部大于10GB:例fdisk /dev/sdb

ceph-deploy mon create-initial
ceph-deploy admin node1
chmod +r /etc/ceph/ceph.client.admin.keyring
ceph-disk prepare --cluster node1 --cluster-uuid f453a207-a05c-475b-971d-91ff6c1f6f48 --fs-type xfs /dev/sdb1
剩余的两个分区命令一样,只需要修改/dev/sdb*
上面的uuid使用ceph -s可以查看,就是第一行cluster后面的那串字符,配置文件中可以修改
ceph-disk activate /dev/sdb1
ceph osd getcrushmap -o a.map
crushtool -d a.map -o  a
vi a
rule replicated_ruleset {
        ruleset 0
        type replicated
        min_size 1
        max_size 10
        step take default
        step chooseleaf firstn 0 type osd  #默认为host,修改为osd
        step emit
crushtool -c a -o b.map
ceph osd setcrushmap -i b.map
ceph osd tree
ceph -s

感谢各位的阅读,以上就是“ceph集群的搭建方法”的内容了,经过本文的学习后,相信大家对ceph集群的搭建方法这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是亿速云,小编将为大家推送更多相关知识点的文章,欢迎关注!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI