zoukankan      html  css  js  c++  java
  • 基于docker搭建ceph集群

    1.安装docker

    2.修改docker源为国内源

    vim /etc/docker/daemon.json
    
    {
        "registry-mirrors" : [
            "https://registry.docker-cn.com",
            "https://docker.mirrors.ustc.edu.cn",
            "http://hub-mirror.c.163.com",
            "https://cr.console.aliyun.com/"
      ]
    }

    3.拉取镜像

    docker pull ceph/mon
    docker pull  ceph/osd
    docker pull  ceph/radosgw
    

    4.创建ceph网桥

    docker network create --driver bridge --subnet 172.20.0.0/16 ceph-network
    

    5.创建相关目录及修改权限,用于挂载volume

    mkdir -p /www/ceph /var/lib/ceph/osd /www/osd/
    
    chown -R 64045:64045 /var/lib/ceph/osd
    
    chown -R 64045:64045 /www/osd/
    

    6.创建monitor节点

    docker run -itd --name monnode --network ceph-network --ip 172.20.0.10 -e NON_NAME=monnode -e MON_IP=172.20.0.10 -v /www/ceph:/etc/ceph ceph/mon
    

    7.在monitor节点上标识3个osd节点

    docker exec monnode ceph osd create
    
    docker exec monnode ceph osd create
    
    docker exec monnode ceph osd create
    

    8. 创建osd节点

    docker run -itd --name osdnode0 --network ceph-network -e CLUSTER=ceph -e WEIGHT=1.0 -e MON_NAME=monnode -e MON_IP=172.20.0.10 -v /www/ceph:/etc/ceph -v /www/osd0:/var/lib/ceph/osd/ceph-0 ceph/osd
    
    docker run -itd --name osdnode1 --network ceph-network -e CLUSTER=ceph -e WEIGHT=1.0 -e MON_NAME=monnode -e MON_IP=172.20.0.10 -v /www/ceph:/etc/ceph -v /www/osd1:/var/lib/ceph/osd/ceph-1 ceph/osd
    
    docker run -itd --name osdnode2 --network ceph-network -e CLUSTER=ceph -e WEIGHT=1.0 -e MON_NAME=monnode -e MON_IP=172.20.0.10 -v /www/ceph:/etc/ceph -v /www/osd2:/var/lib/ceph/osd/ceph-2 ceph/osd
    

    9. 增加monitor节点,组件成机器

    docker run -itd --name monnode_1 --network ceph-network --ip 172.20.0.11 -e NON_NAME=monnode_1 -e MON_IP=172.20.0.11 -v /www/ceph:/etc/ceph ceph/mon
    
    docker run -itd --name monnode_2 --network ceph-network --ip 172.20.0.12 -e NON_NAME=monnode_2 -e MON_IP=172.20.0.12 -v /www/ceph:/etc/ceph ceph/mon
    

    10. 创建gateway节点

    docker run -itd --name gwnode --network ceph-network --ip 172.20.0.9 -p 9080:80 -e RGW_NAME=gwnode -v /www/ceph:/etc/ceph ceph/radosgw
    

    11. 查看ceph集群状态

    docker exec monnode ceph -s
    

      

  • 相关阅读:
    python学习-3 字典
    python学习-3
    python学习-3
    python学习日记-2
    python学习日记
    FTP文件传输
    unity实现截屏功能
    使用C++来写数据库
    background使用
    一张图说明DIV盒子距离
  • 原文地址:https://www.cnblogs.com/navysummer/p/14429765.html
Copyright © 2011-2022 走看看