泚ïŒã³ã¡ã³ããŒã¿ãŒã¯ãèšäºå šäœã®ã¬ãã¥ãŒãå¿ èŠãšããããã€ãã®ä»®å®ã§é倧ãªãšã©ãŒãææããŸããã
CEPHæŠç¥
CEPHã¯ã©ã¹ã¿ãŒã¯ãä»»æã®ãµã€ãºã®ä»»æã®æ°ã®Kåã®ãã£ã¹ã¯ãçµã¿åããããããã«ããŒã¿ãä¿åããåéšåïŒããã©ã«ãã§ã¯4 MBïŒãæå®ãããæ°ã ãNåè€è£œããŸãã
2ã€ã®åäžã®ãã£ã¹ã¯ãæã€æãåçŽãªã±ãŒã¹ãèããŸããããããããRAID 1ãŸãã¯N = 2ã®ã¯ã©ã¹ã¿ãŒãåéã§ããŸã-çµæã¯åãã§ãã 3ã€ã®ãã£ã¹ã¯ãããããããã®ãµã€ãºãç°ãªãå ŽåãN = 2ã§ã¯ã©ã¹ã¿ãŒãçµã¿ç«ãŠãããšã¯ç°¡åã§ããããŒã¿ã®äžéšã¯ãã£ã¹ã¯1ãš2ã«ãããäžéšã¯ãã£ã¹ã¯1ãš3ã«ãããäžéšã¯2ãš3ã«ãããŸãããRAIDã¯ãããŸããïŒåéã§ããŸãïŒãã®ãããªRAIDããããã¯åé¯ã«ãªããŸãïŒãããã«å€ãã®ãã£ã¹ã¯ãããå ŽåãRAID 5ãäœæããããšãå¯èœã§ããCEPHã«ã¯é¡äŒŒã®-erasure_codeããããéçºè ã®åæã®æŠå¿µãšççŸãããããèæ ®ãããŸããã RAID 5ã¯ãå°æ°ã®ãã£ã¹ã¯ãããããããããã¹ãŠè¯å¥œãªç¶æ ã§ããããšãåæãšããŠããŸããããããã«é害ãçºçããå Žåãæ®ãã®ãã£ã¹ã¯ã¯ããã£ã¹ã¯ã亀æãããŠããŒã¿ããã£ã¹ã¯ã«åŸ©å ããããŸã§ä¿çãããŸãã N> = 3ã®CEPHã¯ãç¹ã«å€ããã£ã¹ã¯ã®äœ¿çšãæšå¥šããŸããããŒã¿ã®1ã€ã®ã³ããŒãæ ŒçŽããããã«è€æ°ã®è¯å¥œãªãã£ã¹ã¯ãä¿æããæ®ãã®2ã€ãŸãã¯3ã€ã®ã³ããŒãå€æ°ã®å€ããã£ã¹ã¯ã«æ ŒçŽããå Žåãæ°ãããã£ã¹ã¯ã皌åããŠããéãåé¡ã¯ãªãããã£ã¹ã¯ã®1ã€ãç Žæããå Žåãåæé害ã®ãããæ å ±ã¯å®å šã§ãã 5幎以äžã®èçšå¹Žæ°ãæã€3ã€ã®ãã£ã¹ã¯ãã§ããã°ç°ãªããµãŒããŒããã®ãã£ã¹ã¯-éåžžã«ãŸããªã€ãã³ãã
ã³ããŒã®é åžã«ã¯åŸ®åŠãªç¹ããããŸããããã©ã«ãã§ã¯ãããŒã¿ãããå€ãã®ïŒãã£ã¹ã¯ãããã100ïŒã®PGé åžã°ã«ãŒãã«åå²ããããããããäžéšã®ãã£ã¹ã¯ã§è€è£œããããšæ³å®ãããŠããŸãã K = 6ãN = 2ãšä»®å®ãããšã確çè«ã«ããã°ãããã2ã€ã®ãã£ã¹ã¯äžã«å°ãªããšã1ã€ã®PGãååšãããããããããã®2ã€ã®ãã£ã¹ã¯ã«é害ãçºçãããšãããŒã¿ã倱ãããããšãä¿èšŒãããŸãããŸãã1ã€ã®ã°ã«ãŒãã倱ããããšãããŒã«å ã®ãã¹ãŠã®ããŒã¿ã«ã¢ã¯ã»ã¹ã§ããªããªããŸãããã£ã¹ã¯ã3ã€ã®ãã¢ã«åå²ããã1ã€ã®ãã¢å ã®ãã£ã¹ã¯ã«ã®ã¿ããŒã¿ãä¿åã§ããå Žåããã®åæ£ã¯ããããã®ãã£ã¹ã¯ã®é害ã«å¯ŸããŠãèæ§ããããŸããã2ã€ã倱æããå ŽåãããŒã¿æ倱ã®ç¢ºçã¯100ïŒ ã§ã¯ãªãã3/15ã®ã¿ã§ãé害ãçºçããå Žåã§ã3æã®ãã£ã¹ã¯-12/20ã®ã¿ããããã£ãŠãããŒã¿ååžã®ãšã³ããããŒã¯ãã©ãŒã«ããã¬ã©ã³ã¹ã«è²¢ç®ããŸããããŸã泚æããŠãã ãããã¡ã€ã«ãµãŒããŒã®å ŽåãRAMã解æŸãããšå¿çé床ãå€§å¹ ã«åäžããŸããåããŒãã®ã¡ã¢ãªãå€ãã»ã©ããŸããã¹ãŠã®ããŒãã®ã¡ã¢ãªãå€ãã»ã©ãé«éã«ãªããŸããããã¯ééããªããåäžã®ãµãŒããŒãšãããã«ã¯éåžžã«å°éã®ã¡ã¢ãªãçµã¿èŸŒãŸããŠããããŒããŠã§ã¢NASã«å¯Ÿããã¯ã©ã¹ã¿ãŒã®å©ç¹ã§ãã
ãããã£ãŠãCEPHã¯å€ãæ©åšããã®æè³ãæå°éã«æããæ¡åŒµæ§ãåããæ°åTBã®ä¿¡é Œæ§ã®é«ãã¹ãã¬ãŒãžã·ã¹ãã ãäœæããã®ã«é©ããæ¹æ³ã§ãïŒãã¡ãããããã«ã¯ã³ã¹ããããããŸãããåçšã¹ãã¬ãŒãžã·ã¹ãã ã«æ¯ã¹ãŠå°ããã§ãïŒã
ã¯ã©ã¹ã¿ãŒã®å®è£
å®éšã§ã¯ãå»æ¢ãããIntel DQ57TM + Intel Core i3 540ã³ã³ãã¥ãŒã¿ãŒ+ 16 GBã®RAMã䜿çšããŸãã4ã€ã®2 TBãã£ã¹ã¯ãäžçš®ã®RAID10ã§ç·šæãããã¹ããæåãããã2çªç®ã®ããŒããšåãæ°ã®ãã£ã¹ã¯ãè¿œå ããŸãã
Linuxãã€ã³ã¹ããŒã«ããŸããé åžã«ã¯ã«ã¹ã¿ãã€ãºãšå®å®æ§ãå¿ èŠã§ããèŠä»¶ã¯DebianãšSuseã§ãã Suseã«ã¯ãããã±ãŒãžãç¡å¹ã«ããããã®ããæè»ãªã€ã³ã¹ããŒã©ãŒããããŸããæ®å¿µãªãããç§ã¯ã·ã¹ãã ã«å®³ãäžããã«ã©ããæšãŠãããšãã§ããããç解ããããšãã§ããŸããã§ããã Debianã¯ãdebootstrap busterãéããŠã€ã³ã¹ããŒã«ããŸãã min-baseãªãã·ã§ã³ã¯ããã©ã€ããŒãäžè¶³ããŠããé皌åã·ã¹ãã ãã€ã³ã¹ããŒã«ããŸãããã«ããŒãžã§ã³ãšæ¯èŒãããµã€ãºã®éãã¯ãæ°ã«ãªãã»ã©å€§ããã¯ãããŸãããäœæ¥ã¯ç©çãã·ã³ã§å®è¡ããããããä»®æ³ãã·ã³ãšåæ§ã«ã¹ãããã·ã§ãããäœæããããšèããŠããŸãã LVMãŸãã¯btrfsïŒãŸãã¯xfsãŸãã¯zfs-éãã¯å€§ãããããŸããïŒã¯ããã®ãããªæ©äŒãæäŸããŸãã LVMã¹ãããã·ã§ããã¯é·æã§ã¯ãããŸããã btrfsãé 眮ããŸãããããŠãããŒãããŒããŒã¯MBRã«ãããŸãã FATããŒãã£ã·ã§ã³ã§50 MBã®ãã£ã¹ã¯ãè©°ãŸãããŠãæå³ããããŸãããããŒãã£ã·ã§ã³ããŒãã«ã®1 MBã®é åã«ãããããã·ã¥ããã·ã¹ãã ã«ãã¹ãŠã®ã¹ããŒã¹ãå²ãåœãŠãããšãã§ããå Žåããã£ã¹ã¯700 MBã§äœ¿çšãããŸããããŒã¹ã®SUSEã€ã³ã¹ããŒã«ã®é-èŠããŠããªãããã§ãããçŽ1.1 GBãŸãã¯1.4 GBã®ããã§ãã
CEPHã®ã€ã³ã¹ããŒã«ãdebianãªããžããªã®ããŒãžã§ã³12ãç¡èŠãã15.2.3ãµã€ãããçŽæ¥ãªã³ã¯ããŸãããCEPHãæåã§ã€ã³ã¹ããŒã«ãããã»ã¯ã·ã§ã³ã®æ瀺ã«åŸããŸããã次ã®ç¹ã«æ³šæããŠãã ããã
- ãªããžããªã«æ¥ç¶ããåã«ãgnupg wget ca-certificatesãã€ã³ã¹ããŒã«ããå¿ èŠããããŸã
- ãªããžããªã«æ¥ç¶ããåŸãã¯ã©ã¹ã¿ãŒãã€ã³ã¹ããŒã«ããåã«ãããã±ãŒãžã®ã€ã³ã¹ããŒã«ã¯çç¥ãããŸããapt -y --no-install-recommends install ceph-common ceph-mon ceph-osd ceph-mds ceph-mgr
- ã€ã³ã¹ããŒã«æã«ceph-osdã¯ïŒãã§ã«ç解ã§ããïŒçç±ã§lvm2ãã€ã³ã¹ããŒã«ããããšããŸããããã¯ç·æ¥ã®å¿
èŠã¯ãããŸãããããã±ãŒãžã®ã€ã³ã¹ããŒã«ã«åé¡ãããå Žåã¯ãceph-osdã®/ var / lib / dpkg / statusã®äŸåé¢ä¿ãåé€ããŠãããã±ãŒãžãç Žæ£ã§ããŸãã
èšäºãæžããŠãããšãã«ããã人éçãªãããã䜿çšãããŸããïŒcat << EOF >> /var/lib/dpkg/status Package: lvm2 Status: install ok installed Priority: important Section: admin Installed-Size: 0 Maintainer: Debian Adduser Developers <adduser@packages.debian.org> Architecture: all Multi-Arch: foreign Version: 113.118 Description: No-install EOF
ã¯ã©ã¹ã¿ãŒã®æŠèŠ
ceph-osd-ãã£ã¹ã¯ãžã®ããŒã¿ã®æ ŒçŽãæ åœããŸããåãã£ã¹ã¯ã«å¯ŸããŠãããã¯ãŒã¯ãµãŒãã¹ãéå§ããããªããžã§ã¯ãã«å¯Ÿããèªã¿åããŸãã¯æžã蟌ã¿ã®èŠæ±ãåãå ¥ããŠå®è¡ããŸãããã®èšäºã§ã¯ãæäžäœã¬ãã«ãšããŠã®ãã«ãŒã¹ãã¢ã¹ãã¬ãŒãžã«ã€ããŠèª¬æããŸãããµãŒãã¹ãã¡ã€ã«ã¯ãã¯ã©ã¹ã¿ãŒIDãã¹ãã¬ãŒãžIDããã®ã¿ã€ããªã©ãããã³å¿ èŠãªãããã¯ãã¡ã€ã«ãèšè¿°ãããµãŒãã¹ãã£ã¬ã¯ããªã«äœæãããŸãããããã®ãã¡ã€ã«ã¯å€æŽãããŸããããã¡ã€ã«ãç©çãã¡ã€ã«ã®å Žåãosdã¯ãã¡ã€ã«ã·ã¹ãã ãäœæããããŒã¿ãä¿åããŸãããã¡ã€ã«ããªã³ã¯ã®å ŽåãããŒã¿ã¯ãªã³ã¯ãæãããã€ã¹ã«ãããŸããã¡ã€ã³ããã€ã¹ã«å ããŠãblock.db-ã¡ã¿ããŒã¿ïŒRocksDBïŒããã³block.wal-ãã°ïŒRocksDBå èªã¿ãã°ïŒãè¿œå ã§æå®ã§ããŸããè¿œå ã®ããã€ã¹ãæå®ãããŠããªãå Žåãã¡ã¿ããŒã¿ãšãã°ã¯ãã©ã€ããªããã€ã¹ã«ä¿åãããŸããRocksDBã®ç©ºã容éã远跡ããããšã¯éåžžã«éèŠã§ããããããªããšãOSDãèµ·åããŸããã
å€ãããŒãžã§ã³ã®æšæºã®OSDäœæã§ã¯ããã£ã¹ã¯ã¯2ã€ã®ã»ã¯ã·ã§ã³ã«åãããŠããŸããæåã®ã»ã¯ã·ã§ã³ã¯100 MB xfsã§ã/ var / lib / ...ã«ããŠã³ãããããµãŒãã¹æ å ±ãå«ãŸãã2çªç®ã¯äž»ã¹ãã¬ãŒãžã«æäŸãããŸããæ°ããããŒãžã§ã³ã¯lvmã䜿çšããŸãã
çè«çã«ã¯ããããã¥ã¢ããŒãã£ã·ã§ã³ãããŠã³ãããããšã¯ã§ããŸãããããã¡ã€ã«ã/ var / lib / ...ã«é 眮ãããããããã¹ãŠã®ããŒãã«è€è£œããŠãGPTãŸãã¯LVMããããŒãäœæããã«ãã£ã¹ã¯å šäœãããŒã¿çšã«å²ãåœãŠãŸãã OSDãæåã§è¿œå ããå ŽåãcephãŠãŒã¶ãŒãããŒã¿ãããã¯ããã€ã¹ãžã®æžã蟌ã¿ã¢ã¯ã»ã¹æš©ãæã£ãŠããããšã確èªããå¿ èŠããããŸãããµãŒãã¹ããŒã¿ãã£ã¬ã¯ããªã/ var / libã«èªåçã«ããŠã³ããããŸããååãªç©çã¡ã¢ãªãããããã«ãosdã¡ã¢ãªã¿ãŒã²ãããã©ã¡ãŒã¿ãæå®ããããšããå§ãããŸãã
ceph-mdsãäœã¬ãã«ã§ã¯ãCEPHã¯ãªããžã§ã¯ãã¹ãã¢ã§ãããããã¯ã¹ãã¬ãŒãžã¯ãå4MBãããã¯ããªããžã§ã¯ããšããŠä¿åããããã«åæžãããŸãããã¡ã€ã«ã¹ãã¬ãŒãžãåãåçã§æ©èœããŸãã 2ã€ã®ããŒã«ãäœæãããŸãã1ã€ã¯ã¡ã¿ããŒã¿çšããã1ã€ã¯ããŒã¿çšã§ãããããã¯ãã¡ã€ã«ã·ã¹ãã ã«çµåãããŸãããã®æç¹ã§ãããçš®ã®ã¬ã³ãŒããäœæãããããããã¡ã€ã«ã·ã¹ãã ãåé€ããŠãäž¡æ¹ã®ããŒã«ãä¿æããŠããå Žåãããã埩å ããããšã¯ã§ããŸããããã¹ããããŠããªãããããã¯ããšã«ãã¡ã€ã«ãæœåºããæé ããããŸãã ceph-mdsãµãŒãã¹ã¯ããã¡ã€ã«ã·ã¹ãã ãžã®ã¢ã¯ã»ã¹ãæ åœããŸãããã¡ã€ã«ã·ã¹ãã ããšã«ããµãŒãã¹ã®åå¥ã®ã€ã³ã¹ã¿ã³ã¹ãå¿ èŠã§ãããªãã·ã§ã³ãã©ã³ã¯ãããããããã䜿çšãããšãè€æ°ã®ãã¡ã€ã«ã·ã¹ãã ã®é¡äŒŒç©ã1ã€ã«äœæã§ããŸããããããã¹ããããŠããŸããã
ceph-mon-ãã®ãµãŒãã¹ã¯ãã¯ã©ã¹ã¿ãŒããããæ ŒçŽããŸããããã«ã¯ããã¹ãŠã®OSDã«é¢ããæ å ±ãOSDã®PGé åžã¢ã«ãŽãªãºã ããããŠæãéèŠãªããšãšããŠããã¹ãŠã®ãªããžã§ã¯ãã«é¢ããæ å ±ãå«ãŸããŸãïŒãã®ã¡ã«ããºã ã®è©³çŽ°ã¯ç§ã«ã¯æ確ã§ã¯ãããŸããã/var/lib/ceph/mon/.../store.dbããã®äžã«ãããŸãïŒ 26MBã®å€§ããªãã¡ã€ã«ãããã105Kãªããžã§ã¯ãã®ã¯ã©ã¹ã¿ãŒã§ã¯ããªããžã§ã¯ãããšã«256ãã€ããå°ãè¶ ããããšãããããŸããã¢ãã¿ãŒã«ã¯ããã¹ãŠã®ãªããžã§ã¯ããšããããé 眮ãããŠããPGã®ãªã¹ããä¿æãããŠãããšæããŸãïŒããã®ãã£ã¬ã¯ããªãæå·ãããšãã¯ã©ã¹ã¿å ã®ãã¹ãŠã®ããŒã¿ã倱ãããŸãããããã£ãŠãCRUSHã¯PGãOSDã«ã©ã®ããã«é 眮ããããªããžã§ã¯ããPGã«ã©ã®ããã«é 眮ãããŠããããããŒã¿ããŒã¹å ã§ç€ºããšçµè«ä»ããããŸããïŒçµè«ã¯äžæ£ç¢ºã§ããããšãããããŸãããçµæãšããŠãæåã«ãããŒã¿ããŒã¹ãåžžã«æžã蟌ãŸããŠãããããã·ã¹ãã ãROã¢ãŒãã®USBãã©ãã·ã¥ãã©ã€ãã«ã€ã³ã¹ããŒã«ã§ããŸããããããã®ïŒ1 GBãè¶ ããããšã¯ã»ãšãã©ãªãïŒããŒã¿çšã«è¿œå ã®ãã£ã¹ã¯ãå¿ èŠã§ãã次ã«ããã®ããŒã¿ããŒã¹ã®ã³ããŒããªã¢ã«ã¿ã€ã ã§ä¿æããå¿ èŠããããŸããã¢ãã¿ãŒãè€æ°ããå Žåã¯ããããã«ãã£ãŠãã©ãŒã«ããã¬ã©ã³ã¹ãæäŸãããŸãããã¢ãã¿ãŒã1ã€ïŒæ倧2ã€ïŒã®å Žåã¯ãããŒã¿ä¿è·ã確ä¿ããå¿ èŠããããŸãã OSDããŒã¿ã«åºã¥ããŠã¢ãã¿ãŒã埩å ããçè«çãªæé ããããŸãããªããžã§ã¯ãã¬ãã«ã§åŸ©å ãããããšãå€æããæç¹ã§ã¯ãçŸæç¹ã§ã®ãã¡ã€ã«ã·ã¹ãã ã¯åŸ©å ã§ããŸããã§ããããããŸã§ã®ãšããããã®ã¡ã«ããºã ã«äŸåããããšã¯ã§ããŸãããçŸåšã®æç¹ã§ã¯ãªããžã§ã¯ãã¬ãã«ã§åŸ©å ãããããšãå€æãããããçŸåšã®ãã¡ã€ã«ã·ã¹ãã ã埩å ã§ããŸããã§ããããããŸã§ã®ãšããããã®ã¡ã«ããºã ã«äŸåããããšã¯ã§ããŸããããªããžã§ã¯ãã¬ãã«ã§åŸ©å ãããæç¹ã§ã¯ããã¡ã€ã«ã·ã¹ãã ã¯çŸæç¹ã§ã¯åŸ©å ãããŠããŸããããããŸã§ã®ãšããããã®ã¡ã«ããºã ã«äŸåããããšã¯ã§ããŸããã
rados-gw-S3ãããã³ã«ãªã©ãä»ããŠãªããžã§ã¯ãã¹ãã¬ãŒãžããšã¯ã¹ããŒãããŸããå€ãã®ããŒã«ãäœæããŸããããã®çç±ã¯æããã§ã¯ãããŸãããããŸãå®éšããªãã£ãã
ceph-mgr-ãã®ãµãŒãã¹ãã€ã³ã¹ããŒã«ãããšãããã€ãã®ã¢ãžã¥ãŒã«ãèµ·åããŸãããããã®1ã€ã¯ç¡å¹ã«ãªã£ãŠããªãèªåã¹ã±ãŒã«ã§ããPG / OSDã®æ£ããéãç¶æããããåªããŠããŸããæ¯çãæåã§ç®¡çãããå Žåã¯ãåããŒã«ã®ã¹ã±ãŒãªã³ã°ãçŠæ¢ã§ããŸããããã®å Žåãã¢ãžã¥ãŒã«ã¯0ã§é€ç®ãããã¯ã©ã¹ã¿ãŒã®ã¹ããŒã¿ã¹ã¯ERRORã«ãªããŸããã¢ãžã¥ãŒã«ã¯pythonã§äœæãããŠãããå¿ èŠãªè¡ãã³ã¡ã³ãåãããšãåæãããŸãã詳现ã¯é¢çœãããŠèŠããããŸããã
åèè³æïŒå®å šãªã¢ãã¿ãŒé害ããã®
CEPH
ãªã«ããªãŒã®ã€ã³ã¹ããŒã«
Ceph Ceph ã¢ãŒããã¯ãã£ãŒã®èª¬æã«ããBlueStoreã«é¢ããèšäº
ãã»ãŒãžã»Aã»ãŠã§ã€ã«
ã¹ã¯ãªãããªã¹ãïŒ
debootstrap
blkdev=sdb1
mkfs.btrfs -f /dev/$blkdev
mount /dev/$blkdev /mnt
cd /mnt
for i in {@,@var,@home}; do btrfs subvolume create $i; done
mkdir snapshot @/{var,home}
for i in {var,home}; do mount -o bind @${i} @/$i; done
debootstrap buster @ http://deb.debian.org/debian; echo $?
for i in {dev,proc,sys}; do mount -o bind /$i @/$i; done
cp /etc/bash.bashrc @/etc/
chroot /mnt/@ /bin/bash
echo rbd1 > /etc/hostname
passwd
uuid=`blkid | grep $blkdev | cut -d "\"" -f 2`
cat << EOF > /etc/fstab
UUID=$uuid / btrfs noatime,nodiratime,subvol=@ 0 1
UUID=$uuid /var btrfs noatime,nodiratime,subvol=@var 0 2
UUID=$uuid /home btrfs noatime,nodiratime,subvol=@home 0 2
EOF
cat << EOF >> /var/lib/dpkg/status
Package: lvm2
Status: install ok installed
Priority: important
Section: admin
Installed-Size: 0
Maintainer: Debian Adduser Developers <adduser@packages.debian.org>
Architecture: all
Multi-Arch: foreign
Version: 113.118
Description: No-install
Package: sudo
Status: install ok installed
Priority: important
Section: admin
Installed-Size: 0
Maintainer: Debian Adduser Developers <adduser@packages.debian.org>
Architecture: all
Multi-Arch: foreign
Version: 113.118
Description: No-install
EOF
exit
grub-install --boot-directory=@/boot/ /dev/$blkdev
init 6
apt -yq install --no-install-recommends linux-image-amd64 bash-completion ed btrfs-progs grub-pc iproute2 ssh smartmontools ntfs-3g net-tools man
exit
grub-install --boot-directory=@/boot/ /dev/$blkdev
init 6
apt -yq install --no-install-recommends gnupg wget ca-certificates
echo 'deb https://download.ceph.com/debian-octopus/ buster main' >> /etc/apt/sources.list
wget -q -O- 'https://download.ceph.com/keys/release.asc' | apt-key add -
apt update
apt -yq install --no-install-recommends ceph-common ceph-mon
echo 192.168.11.11 rbd1 >> /etc/hosts
uuid=`cat /proc/sys/kernel/random/uuid`
cat << EOF > /etc/ceph/ceph.conf
[global]
fsid = $uuid
auth cluster required = cephx
auth service required = cephx
auth client required = cephx
mon allow pool delete = true
mon host = 192.168.11.11
mon initial members = rbd1
mon max pg per osd = 385
osd crush update on start = false
#osd memory target = 2147483648
osd memory target = 1610612736
osd scrub chunk min = 1
osd scrub chunk max = 2
osd scrub sleep = .2
osd pool default pg autoscale mode = off
osd pool default size = 1
osd pool default min size = 1
osd pool default pg num = 1
osd pool default pgp num = 1
[mon]
mgr initial modules = dashboard
EOF
ceph-authtool --create-keyring ceph.mon.keyring --gen-key -n mon. --cap mon 'allow *'
ceph-authtool --create-keyring ceph.client.admin.keyring --gen-key -n client.admin --cap mon 'allow *' --cap osd 'allow *' --cap mds 'allow *' --cap mgr 'allow *'
cp ceph.client.admin.keyring /etc/ceph/
ceph-authtool --create-keyring bootstrap-osd.ceph.keyring --gen-key -n client.bootstrap-osd --cap mon 'profile bootstrap-osd' --cap mgr 'allow r'
cp bootstrap-osd.ceph.keyring /var/lib/ceph/bootstrap-osd/ceph.keyring
ceph-authtool ceph.mon.keyring --import-keyring /etc/ceph/ceph.client.admin.keyring
ceph-authtool ceph.mon.keyring --import-keyring /var/lib/ceph/bootstrap-osd/ceph.keyring
monmaptool --create --add rbd1 192.168.11.11 --fsid $uuid monmap
rm -R /var/lib/ceph/mon/ceph-rbd1/*
ceph-mon --mkfs -i rbd1 --monmap monmap --keyring ceph.mon.keyring
chown ceph:ceph -R /var/lib/ceph
systemctl enable ceph-mon@rbd1
systemctl start ceph-mon@rbd1
ceph mon enable-msgr2
ceph status
# dashboard
apt -yq install --no-install-recommends ceph-mgr ceph-mgr-dashboard python3-distutils python3-yaml
mkdir /var/lib/ceph/mgr/ceph-rbd1
ceph auth get-or-create mgr.rbd1 mon 'allow profile mgr' osd 'allow *' mds 'allow *' > /var/lib/ceph/mgr/ceph-rbd1/keyring
systemctl enable ceph-mgr@rbd1
systemctl start ceph-mgr@rbd1
ceph config set mgr mgr/dashboard/ssl false
ceph config set mgr mgr/dashboard/server_port 7000
ceph dashboard ac-user-create root 1111115 administrator
systemctl stop ceph-mgr@rbd1
systemctl start ceph-mgr@rbd1
OSD ()
apt install ceph-osd
osdnum=`ceph osd create`
mkdir -p /var/lib/ceph/osd/ceph-$osdnum
mkfs -t xfs /dev/sda1
mount -t xfs /dev/sda1 /var/lib/ceph/osd/ceph-$osdnum
cd /var/lib/ceph/osd/ceph-$osdnum
ceph auth get-or-create osd.0 mon 'profile osd' mgr 'profile osd' osd 'allow *' > /var/lib/ceph/osd/ceph-$osdnum/keyring
ln -s /dev/disk/by-partuuid/d8cc3da6-02 block
ceph-osd -i $osdnum --mkfs
#chown ceph:ceph /dev/sd?2
chown ceph:ceph -R /var/lib/ceph
systemctl enable ceph-osd@$osdnum
systemctl start ceph-osd@$osdnum
CEPHã®äž»ãªããŒã±ãã£ã³ã°äžã®å©ç¹ã¯ãããŒã¿ãã±ãŒã·ã§ã³èšç®ã¢ã«ãŽãªãºã ã§ããCRUSHã§ããã¢ãã¿ãŒã¯ãã®ã¢ã«ãŽãªãºã ãã¯ã©ã€ã¢ã³ãã«é åžãããã®åŸãã¯ã©ã€ã¢ã³ãã¯å¿ èŠãªããŒããšå¿ èŠãªOSDãçŽæ¥èŠæ±ããŸãã CRUSHã¯ãéäžåããªãããšãä¿èšŒããŸããããã¯ãå°ãªããšãå°å·ããŠå£ã«æããããšãã§ããå°ããªãã¡ã€ã«ã§ããå®åã§ã¯ãCRUSHã¯å®å šãªãããã§ã¯ãããŸããããã¹ãŠã®OSDãšCRUSHãç¶æããªããã¢ãã¿ãŒãç Žæ£ããŠåäœæããã ãã§ã¯ãã¯ã©ã¹ã¿ãŒã埩å ããã®ã«ååã§ã¯ãããŸããããã®ããšãããåã¢ãã¿ãŒã«ã¯ã¯ã©ã¹ã¿ãŒå šäœã«é¢ããã¡ã¿ããŒã¿ãæ ŒçŽãããŠãããšçµè«ä»ããããŸããããã®ã¡ã¿ããŒã¿ã®ããããªéã¯ãã¯ã©ã¹ã¿ãŒãµã€ãºã«å¶éã課ããŸããããå®å šã確ä¿ããå¿ èŠããããŸããããã«ãããUSBãã©ãã·ã¥ãã©ã€ãã«ã·ã¹ãã ãã€ã³ã¹ããŒã«ããŠãã£ã¹ã¯ã®ç¯çŽãæé€ããããŒãã3ã€æªæºã®ã¯ã©ã¹ã¿ãŒãé€å€ããŸãããªãã·ã§ã³æ©èœã«é¢ããç©æ¥µçãªéçºè ããªã·ãŒãããããªãºã ã«é ããã¬ãã«ã§ã®ããã¥ã¡ã³ãïŒãç§ãã¡ãæã£ãŠãããã®ã«ã€ããŠ-ãã§ã«æè¬ããŠããŸãããéåžžã«éåžžã«å°ãªãã§ãããäœã¬ãã«ã§ãµãŒãã¹ãšå¯Ÿè©±ããå¯èœæ§ãæäŸãããŸãããããã¥ã¡ã³ãã¯è¡šé¢çã«ãã®ãããã¯ã«é¢é£ããããŠããããããã¯ããã§ã¯ãããŸãããç·æ¥æã«ããŒã¿ã埩æ§ããå¯èœæ§ã¯ã»ãšãã©ãããŸããïŒã³ãã¥ããã£ã®èª¬æã®ãããã§ããŸã å¯èœæ§ããããŸãïŒãç·æ¥äºæ ã§ããŒã¿ãå埩ããå¯èœæ§ã¯ã»ãšãã©ãããŸããïŒã³ãã¥ããã£ã®èª¬æã®ãããã§ãå¯èœæ§ã¯ãŸã æ®ã£ãŠããŸãïŒãç·æ¥æã«ããŒã¿ã埩æ§ããå¯èœæ§ã¯ã»ãšãã©ãããŸããïŒã³ãã¥ããã£ã®èª¬æã®ãããã§ããŸã å¯èœæ§ããããŸãïŒã
ãããªãã¢ã¯ã·ã§ã³ã®ãªãã·ã§ã³ïŒCEPHãæŸæ£ããéåžžã®ãã«ããã£ã¹ã¯btrfsïŒãŸãã¯xfsãzfsïŒã䜿çšãããããã®æ¡ä»¶äžã§äœ¿çšã§ããããã«ããCEPHã«é¢ããæ°ããæ å ±ãèŠã€ããŠãè¿œå ã®ãã¬ãŒãã³ã°ãšããŠç¬èªã®ãªããžããªãäœæããŠã¿ãŠãã ããã