🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
**一、部署ceph-deploy** ceph-deploy主机: 1、安装 `yum update && yum -y install ceph-deploy -y` 在执行ceph-deploy的过程中会生成一些配置文件,建议创建一个目录 ~~~ mkdir my-cluster cd my-cluster ~~~ 2、创建集群,部署新的monitor节点 `ceph-deploy new WLWJFX23 WLWJFX24 WLWJFX25` 3、配置ceph.conf ~~~ cat /etc/ceph/ceph.conf [global] fsid = e062ce71-bfb3-4895-8373-6203de2fa793 mon_initial_members = WLWJFX23, WLWJFX24, WLWJFX25 mon_host = 10.255.213.133,10.255.213.134,10.255.213.135 auth_cluster_required = cephx auth_service_required = cephx auth_client_required = cephx ########以上是ceph安装时自带######## public network = 10.255.213.128/25 [osd] osd max object name len = 256 osd max object namespace len = 64 rbd default features = 1 osd pool default size = 3 [mon] mon_pg_warn_max_per_osd = 1000 ~~~ 4、安装ceph到各节点 `ceph-deploy install WLWJFX{66..69} 经检查本次安装只安装ceph的各个组件,请登录各节点自行执行 `yum -y install ceph` ###可能是版本的原因 5、获取秘钥key,会在my-cluster的目录下面生成几个key值 ~~~ ceph-deploy mon create-initial 或者 ceph-deploy --overwrite-conf mon create cephadmin ceph31 ~~~ 6、初始化磁盘 `ceph-deploy disk zap node1:sdb` **该命令要慎用,如果磁盘已做分区挂载可省略该步骤** 7、准备OSD 上传配置: ` ceph-deploy --overwrite-conf config push WLWJFX{64..72} WLWHDX{36..50}` 将生成的key上传至各主机 ` ceph-deploy gatherkeys WLWJFX{64..72} WLWHDX{36..50} ` 准备osd: `ceph-deploy osd prepare WLWJFX{67..69}:/ceph{01..05}` 8、激活OSD `ceph-deploy osd activate WLWJFX{67..69}:/ceph{01..05}` 9、分发key `ceph-deploy admin WLWJFX{66..69} ` 10、给admin key赋值 `sudo chmod +r /etc/ceph/ceph.calient.admin.keyring` 11、查看集群健康状态 ~~~ `[root@WLWJFX68 ~]#ceph -s` cluster fa18d52b-f8de-40d4-8e84-54980976ff48 health HEALTH_OK monmap e1: 1 mons at {WLWJFX67=10.255.213.177:6789/0} election epoch 1, quorum 0 WLWJFX67 mdsmap e9: 1/1/1 up {0=WLWJFX67=up:active} osdmap e14: 2 osds: 2 up, 2 in pgmap v4571: 320 pgs, 3 pools, 80170 MB data, 20063 objects 167 GB used, 1746 GB / 2015 GB avail 320 active+clean ~~~ **至此ceph集群安装完毕** 部署ceph-Jewwl版 划分新区: fdisk /dev/sda w partprobe mkfs.ext4 /dev/sda3 mkdir -p /data01 mount /dev/sda3 /data01 添加用户: groupadd -g 1500 cetest useradd -u 1999 -g 1500 cetest echo cetest:'password' | chpasswd 给用户权限: echo "cetest ALL = (root) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/cetest sudo chmod 0440 /etc/sudoers.d/cetest 设置cetest用户互信: 用cetest用户登录执行: ssh-keygen 一直回车 ssh-copy-id cetest@xhw342 ssh-copy-id cetest@xhw343 ssh-copy-id cetest@xhw344 ssh-copy-id cetest@xhw345 在xhw341 上安装ceph-deploy yum -y install ceph-deploy ceph-deploy install xhw343{1..5}