博客
关于我
ceph手动添加osd
阅读量:498 次
发布时间:2019-03-07

本文共 1480 字,大约阅读时间需要 4 分钟。

简单版ceph-disk:

ceph-disk prepare /dev/sdbceph-disk activate --mark-init systemd --mount /dev/sdb

详细

生成uuid

uuidgen4c0a02e2-e577-4778-b775-8b636926bb2d

创建OSD

ceph osd create 4c0a02e2-e577-4778-b775-8b636926bb2d

创建OSD目录

mkdir -p /var/lib/ceph/osd/ceph-0

改权限

chown ceph.ceph /var/lib/ceph/osd/ceph-0

格式化OSD磁盘

mkfs -t xfs /dev/vdb

挂载OSD磁盘

mount /dev/vdb /var/lib/ceph/osd/ceph-0/

初始化OSD

ceph-osd -i 0 --mkfs --mkkey --osd-uuid 4c0a02e2-e577-4778-b775-8b636926bb2d
如果报错: WARNING: max attr value size (1024) is smaller than osd_max_object_name_len (2048). Your backend filesystem appears to not support attrs large enough to handle the configured max rados name size. You may get unexpected ENAMETOOLONG errors on rados operations or buggy behavior

在ceph.conf加:

osd max object name len = 256 osd max object namespace len = 64

注册OSD keyring

ceph auth add osd.0 osd 'allow *' mon 'allow profile osd' -i /var/lib/ceph/osd/ceph-0/keyring

把此节点加入 CRUSH 图

ceph [--cluster {   cluster-name}] osd crush add-bucket {   hostname} host
ceph osd crush add-bucket node1 host

把此 Ceph 节点放入 default 根下

ceph osd crush move node1 root=default

把此 OSD 加入 CRUSH 图之后,它就能接收数据了。你也可以反编译 CRUSH 图、把此 OSD 加入设备列表、对应主机作为桶加入(如果它还不在 CRUSH 图里)、然后此设备作为主机的一个条目、分配权重、重新编译、注入集群

ceph [--cluster {   cluster-name}] osd crush add {   id-or-name} {   weight} [{   bucket-type}={   bucket-name} ...]
ceph osd crush add osd.0 1.0 host=node1

要让守护进程开机自启,必须创建一个空文件

sudo touch /var/lib/ceph/osd/ceph-0/sysvinit

启动osd

ceph-osd --id 0

参考

转载地址:http://wbujz.baihongyu.com/

你可能感兴趣的文章
Mysql-触发器及创建触发器失败原因
查看>>
MySQL-连接
查看>>
mysql5.5和5.6版本间的坑
查看>>
mysql5.5最简安装教程
查看>>
mysql5.6 TIME,DATETIME,TIMESTAMP
查看>>
mysql5.6.21重置数据库的root密码
查看>>
Mysql5.6主从复制-基于binlog
查看>>
MySQL5.6忘记root密码(win平台)
查看>>
MySQL5.6的Linux安装shell脚本之二进制安装(一)
查看>>
MySQL5.6的zip包安装教程
查看>>
mysql5.7 for windows_MySQL 5.7 for Windows 解压缩版配置安装
查看>>
mysql5.7 安装版 表不能输入汉字解决方案
查看>>
MySQL5.7.18主从复制搭建(一主一从)
查看>>
MySQL5.7.19-win64安装启动
查看>>
mysql5.7.19安装图解_mysql5.7.19 winx64解压缩版安装配置教程
查看>>
MySQL5.7.37windows解压版的安装使用
查看>>
mysql5.7免费下载地址
查看>>
mysql5.7命令总结
查看>>
mysql5.7安装
查看>>
mysql5.7性能调优my.ini
查看>>