• ubuntu上部署ceph集群


    配置apt源

    1.  
      # wget -q -O- 'https://download.ceph.com/keys/release.asc' | sudo apt-key add -
    2.  
      # echo deb https://download.ceph.com/debian-jewel/ $(lsb_release -sc) main | sudo tee /etc/apt/sources.list.d/ceph.list

    安装ceph-deploy,一台机器即可

    # apt-get install ceph-deploy
    

    安装ceph软件,三台机器都需要安装

    # apt-get install ceph
    

    创建集群

    1.  
      # mkdir /opt/ceph
    2.  
      # cd /opt/ceph
    3.  
      # ceph-deploy new k8s1 k8s2 k8s3
    4.  
      # echo mon_pg_warn_max_per_osd = 1000 >> ceph.conf
    5.  
      # echo cluster_network=172.16.13.0/24 >> ceph.conf
    6.  
      # echo max open files = 131072 >> ceph.conf
    7.  
      # echo osd_scrub_begin_hour=1 >> ceph.conf
    8.  
      # echo osd_scrub_end_hour=7 >> ceph.conf
    9.  
      # echo "osd max object name len = 256" >> ceph.conf
    10.  
      # echo "osd max object namespace len = 64" >> ceph.conf

    初始化集群

    # ceph-deploy mon create-initial
    

    拷贝秘钥

    # cp ceph.client.admin.keyring /etc/ceph/
    

    添加osd

    由于没有裸盘,所以直接指定目录作为osd,尝试了下新版luminous,ceph-deploy里似乎不支持指定目录作为osd

    1.  
      # mkdir -p /data/ceph/data
    2.  
      # chown ceph:ceph /data/ceph/data/
    3.  
      # ceph-deploy osd prepare k8s2:/data/ceph/data
    4.  
      # ceph-deploy osd activate k8s2:/data/ceph/data

    三个节点每个节点一个osd

    1.  
      # ceph -s
    2.  
      cluster 6d8963e9-9585-4679-8dac-17b60f2d0c30
    3.  
      health HEALTH_OK
    4.  
      monmap e1: 3 mons at {tj006=172.16.41.25:6789/0,tj007=172.16.41.26:6789/0,tj008=172.16.41.27:6789/0}
    5.  
      election epoch 12, quorum 0,1,2 tj006,tj007,tj008
    6.  
      osdmap e14: 3 osds: 3 up, 3 in
    7.  
      flags sortbitwise,require_jewel_osds
    8.  
      pgmap v29: 64 pgs, 1 pools, 0 bytes data, 0 objects
    9.  
      7811 GB used, 39739 GB / 50064 GB avail
    10.  
      64 active+clean

    添加mds

    1.  
      # ceph-deploy mds create k8s1
    2.  
      # ceph osd pool create k8s_data 32
    3.  
      # ceph osd pool create k8s_metadata 32
    4.  
      # ceph fs new ceph_k8s k8s_metadata k8s_data
    5.  
      # mkdir /data/ceph/cephfs
    6.  
      # mount -t ceph 172.16.13.160:6789:/ /data/ceph/cephfs -o name=admin,secretfile=/etc/ceph/admin.secret
     

    转载于:https://my.oschina.net/xiaozhublog/blog/2986134

     
  • 相关阅读:
    HDU5087——Revenge of LIS II(BestCoder Round #16)
    HDU5086——Revenge of Segment Tree(BestCoder Round #16)
    POJ3009——Curling 2.0(DFS)
    POJ2891——Strange Way to Express Integers(模线性方程组)
    算法总结之求解模线性方程组
    Linux运维学习笔记-网络技术知识体系总结
    Linux运维学习笔记-定时任务知识总结
    Linux运维学习笔记-文件权限知识总结
    Linux运维学习笔记-常用快捷键及vi、vim总结
    Linux运维学习笔记-角色知识总结
  • 原文地址:https://www.cnblogs.com/javalinux/p/14604916.html
Copyright © 2020-2023  润新知