ceph初始化

系统初始化如之前文章

安装ceph

yum -y install ntp ntpdate ntp-doc
yum -y install ceph ceph-radosgw

初始化

fid=3e5593f4-2e1b-4af4-962c-52a626911003
# 为此集群创建密钥环、并生成监视器密钥
ceph-authtool --create-keyring /tmp/ceph.mon.keyring --gen-key -n mon. --cap mon 'allow *'
# 生成管理员密钥环,生成 client.admin 用户并加入密钥环。
ceph-authtool --create-keyring /etc/ceph/ceph.client.admin.keyring --gen-key -n client.admin --set-uid=0 --cap mon 'allow *' --cap osd 'allow *' --cap mds 'allow'
# 把 client.admin 密钥加入 ceph.mon.keyring 。
ceph-authtool /tmp/ceph.mon.keyring --import-keyring /etc/ceph/ceph.client.admin.keyring
# 用规划好的主机名、对应 IP 地址、和 FSID 生成一个监视器图,并保存为 /tmp/monmap 。
monmaptool --create --add node1 10.0.2.10 --fsid $fid /tmp/monmap
# 在监视器主机上分别创建数据目录。
mkdir /var/lib/ceph/mon/ceph-node1
# 用监视器图和密钥环组装守护进程所需的初始数据
ceph-mon --mkfs -i node1 --monmap /tmp/monmap --keyring /tmp/ceph.mon.keyring

# 建一个空文件 done ,表示监视器已创建、可以启动了
touch /var/lib/ceph/mon/ceph-node1/done

# 启动&测试
ceph-mon -i node1
ceph osd lspools

测试输出 ceph -s

    cluster 3e5593f4-2e1b-4af4-962c-52a626911003
     health HEALTH_ERR
            64 pgs stuck inactive
            64 pgs stuck unclean
            no osds
     monmap e1: 1 mons at {node1=10.0.2.10:6789/0}
            election epoch 2, quorum 0 node1
     osdmap e1: 0 osds: 0 up, 0 in
      pgmap v2: 64 pgs, 1 pools, 0 bytes data, 0 objects
            0 kB used, 0 kB / 0 kB avail
                  64 creating
cat <<eol > /etc/ceph/ceph.conf
[global]
fsid = 3e5593f4-2e1b-4af4-962c-52a626911003
mon initial members = node1
mon host = 10.0.2.10
public network = 10.0.2.0/24
cluster network = 10.0.2.10/24
auth cluster required = cephx
auth service required = cephx
auth client required = cephx
eol
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • ceph简介 Ceph是一个分布式存储系统,诞生于2004年,是最早致力于开发下一代高性能分布式文件系统的项目。随...
    爱吃土豆的程序猿阅读 6,078评论 0 21
  • 系统环境: centos73.10.0-514.26.2.el7.x86_64 机器数量:五台 硬盘:四块一块为系...
    think_lonely阅读 4,757评论 0 5
  • Ceph官方版本目前支持的纠删码很有限,实验室这块希望能够整合我们自主开发的纠删码BRS(Binary Reed–...
    LeeHappen阅读 3,846评论 0 5
  • 集群管理 每次用命令启动、重启、停止Ceph守护进程(或整个集群)时,必须指定至少一个选项和一个命令,还可能要指定...
    Arteezy_Xie阅读 19,471评论 0 19
  • 难道我没有 在空港快线驶在花都的路上想起你 懒在沙发上的衬衣 挣扎在阳台上的花 在一旁怅然若失的我 在房间置身度外的你
    _你好我是小黄黄阅读 205评论 0 0