您好,欢迎访问三七文档
当前位置:首页 > 办公文档 > 其它办公文档 > ceph安装部署手册1.0
Ceph安装部署手册1.需求1.1硬件环境3台PC机,安装操作系统centos7;分别创建一个主分区/dev/sda4IP分别设置为192.168.0.2,192.168.0.3,192.168.0.4IPHOSTNAMEOSFunction192.168.0.2node1Centos7.1Mon\OSD192.168.0.3node2Centos7.1Mon\OSD192.168.0.4node3Centos7.1Mon\OSD注:MON、OSD节点可以不再同一节点上1.2软件环境安装包:centos、ceph、ceph-deploy2.准备2.1关闭防火墙(所有节点)1.systemctlstopfirewalldsystemctldisablefirewalld2.vi/etc/sysconfig/selinux=SELINUX=disabled2.2主机配置(所有节点)[root@node1~]#vi/etc/hosts2.3软件安装1.安装vsftp:[root@node1~]#rpm-ivh/var/ftp/centos/Packages/vsftpd-3.0.2-9.el7.x86_64.rpm2.配置yumcentos、ceph、ceph-deploy3.启动vsftp4.安装(所有节点)分别安装ceph、ceph-deploy注:建议把NTP服务安装到所有Ceph节点上(特别是Ceph监视器节点),以免因时钟漂移导致故障。#yuminstallntp#yuminstallcephceph-deploy3.搭建ceph1.进入/etc/ceph目录,确保下面所有操作都在此目录下:[root@node1~]#cd/etc/ceph/2.Createthecluster.(创建集群)[root@node1ceph]#ceph-deploynewnode13.createthemonitor.(创建一个mon)[root@node1ceph]#ceph-deploymoncreatenode14.gatherthekeys.(取得秘钥)[root@node1ceph]#ceph-deploygatherkeysnode15.Verifythatthemonitorisrunning.(检查)3.1addingmonitors在node1执行:1.Configuration(在/etc/ceph下面配置ceph.conf,保证fsid和上图标注部分一致)[global]fsid=e23ed29d-abb3-4050-bd40-ed2a07e70a7dmoninitialmembers=node1,node2,node3monhost=192.168.0.11,192.168.0.12,192.168.0.13publicnetwork=192.168.0.0/24authclusterrequired=cephxauthservicerequired=cephxauthclientrequired=cephxfilestorexattruseomap=trueosdjournalsize=1024osdpooldefaultsize=2osdpooldefaultminsize=1osdpooldefaultpgnum=333osdpooldefaultpgpnum=333osdcrushchooseleaftype=1[mon.node1]mon_addr=192.168.0.11host=node1[mon.node2]mon_addr=192.168.0.12host=node2[mon.node3]mon_addr=192.168.0.13host=node32.从node1分别拷贝证书和配置文件到node2,node3[root@node1ceph]#scpceph.client.admin.keyringceph.mon.keyringceph.confroot@192.168.0.12:/etc/ceph/[root@node1ceph]#scpceph.client.admin.keyringceph.mon.keyringceph.confroot@192.168.0.13:/etc/ceph/3.AddtwoCephMonitorstothecluster.(添加两个monitor)[root@node1ceph]#ceph-deploy--overwrite-confmoncreatenode2node34.Verify(检查)3.2addingosds(所有节点)1.GenerateaUUIDfortheOSD.(获得UUID)[root@node1~]#uuidgen2.CreatetheOSD.[root@node1~]#cephosdcreatef898402c-e395-4f57-9e33-89c6dd57edf63.CreatethedefaultdirectoryonyournewOSD.[root@node1~]#mkdir/var/lib/ceph/osd/ceph-04.PrepareadeviceforusewithCeph,andmountittothedirectoryyoujustcreate.[root@node1~]#mkfs-txfs-f/dev/sda4[root@node1~]#mount/dev/sda4/var/lib/ceph/osd/ceph-0/5.InitializetheOSDdatadirectory.[root@node1~]#ceph-osd-i0--mkfs--mkkey--osd-uuidf898402c-e395-4f57-9e33-89c6dd57edf66.RegistertheOSDauthenticationkey.[root@node1~]#cephauthaddosd.0osd'allow*'mon'allowrwx'-i/var/lib/ceph/osd/ceph-0/keyring7.AddtheCephNodetotheCRUSHmap.[root@node1~]#cephosdcrushadd-bucketnode1host8.PlacetheCephNodeundertherootdefault.[root@node1~]#cephosdcrushmovenode1root=default9.Addthedeviceasaniteminthehost,assignitaweight,recompileitandsetit.[root@node1~]#cephosdcrushaddosd.01.0host=node1只在一个节点执行:10.Configuration(在/etc/ceph/ceph.conf中添加以下内容,并且同步到node2,node3)#vi/etc/ceph/ceph.conf[osd]osdmkfstype=xfs[osd.0]host=node1devs=/dev/sda4[osd.1]host=node2devs=/dev/sda4[osd.2]host=node3devs=/dev/sda4#scp/etc/ceph/ceph.confroot@192.168.0.12:/etc/ceph/#scp/etc/ceph/ceph.confroot@192.168.0.13:/etc/ceph/11.StartthenewOSD[root@node1~]#/etc/init.d/cephstartosd.012.Verify(检查)Viewtheosdtree:
本文标题:ceph安装部署手册1.0
链接地址:https://www.777doc.com/doc-1544511 .html