{"id":11927,"date":"2023-09-19T13:27:48","date_gmt":"2023-09-19T20:27:48","guid":{"rendered":"https:\/\/www.xh86.me\/?p=11927"},"modified":"2023-09-19T13:27:48","modified_gmt":"2023-09-19T20:27:48","slug":"cephadm%e6%90%ad%e5%bb%baceph%e9%9b%86%e7%be%a4","status":"publish","type":"post","link":"https:\/\/www.xh86.me\/?p=11927","title":{"rendered":"cephadm\u642d\u5efaCeph\u96c6\u7fa4"},"content":{"rendered":"<p>ceph\u7684quincy\u662fceph\u7684\u7b2c17\u4e2a\u7248\u672c\uff0c\u521d\u59cb\u53d1\u884c\u65f6\u95f4\u662f2022-04-19\uff0c\u672c\u6587\u5c06\u901a\u8fc7cephadm\u5de5\u5177\u6765\u642d\u5efaquincy\u7684\u96c6\u7fa4\u3002<\/p>\n<p>\u89c4\u5212<\/p>\n<p>\u4e09\u53f0Rocky Linux 8.7\u670d\u52a1\u5668\uff0c4\u6838CPU\uff0c4G\u5185\u5b58\uff0c\u6839\u78c1\u76d850GB\uff0c\u6570\u636e\u76d8\u4e00\u4e2a100GB\uff08\u78c1\u76d8\u65e0\u9700\u521d\u59cb\u5316\u64cd\u4f5c\uff0cfdisk -l\u4e2d\u53ef\u89c1\u5373\u53ef\uff09<\/p>\n<table>\n<tbody>\n<tr>\n<td>1<\/p>\n<p>2<\/p>\n<p>3<\/td>\n<td>10.10.10.161 ceph1<\/p>\n<p>10.10.10.162 ceph2<\/p>\n<p>10.10.10.163 ceph3<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u5173\u95ed\u9632\u706b\u5899\u5173\u95edselinux\uff0c\u5982\u4e0d\u5173\u95ed\uff0c\u5219\u9700\u8981\u81ea\u884c\u653e\u884c\u7aef\u53e3<\/p>\n<table>\n<tbody>\n<tr>\n<td>1<\/p>\n<p>2<\/p>\n<p>3<\/p>\n<p>4<\/td>\n<td>systemctl stop firewalld<\/p>\n<p>systemctl disable firewalld<\/p>\n<p>setenforce 0<\/p>\n<p>sed -i &#8216;s\/^SELINUX=.*\/SELINUX=disabled\/&#8217; \/etc\/selinux\/config<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>\u4ee5\u4e0b1~4\u6b65\u5206\u522b\u5728\u4e09\u53f0\u8282\u70b9\u4e2d\u6267\u884c<\/strong><\/p>\n<p><strong>1\u3001\u540c\u6b65\u65f6\u95f4<\/strong><\/p>\n<p>\u5982\u679c\u4f60\u60f3\u4f7f\u7528\u4f20\u7edf\u7684ntpdate\u540c\u6b65\u65f6\u95f4\uff0c\u53ef\u53c2\u8003<a href=\"https:\/\/www.wlnmp.com\/post-664.html\" target=\"_blank\" rel=\"noopener\">https:\/\/www.wlnmp.com\/post-664.html<\/a><\/p>\n<p>\u5efa\u8bae\u4f7f\u7528\u65b0\u7684\u65f6\u95f4\u540c\u6b65\u65b9\u5f0fchrony\uff0c\u6b64\u5904\u4e0d\u505a\u8fc7\u591a\u8bf4\u660e\uff0c\u65f6\u95f4\u540c\u6b65\u90fd\u4e0d\u4f1a\uff0c\u540e\u9762\u7684\u6559\u7a0b\u4f60\u4e5f\u641e\u4e0d\u5b9a\uff01<\/p>\n<p><strong>2\u3001\u5206\u522b\u5bf9\u5e94\u4fee\u6539\u4e09\u53f0\u673a\u5668hostname<\/strong><\/p>\n<table>\n<tbody>\n<tr>\n<td>1<\/p>\n<p>2<\/p>\n<p>3<\/td>\n<td>hostnamectl set-hostname ceph1<\/p>\n<p>hostnamectl set-hostname ceph2<\/p>\n<p>hostnamectl set-hostname ceph3<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>3\u3001\u5728\u4e09\u53f0\u673a\u5668\u5206\u522b\u6dfb\u52a0\u914d\u7f6ehosts<\/strong><\/p>\n<table>\n<tbody>\n<tr>\n<td>1<\/p>\n<p>2<\/p>\n<p>3<\/td>\n<td>10.10.10.161 ceph1<\/p>\n<p>10.10.10.162 ceph2<\/p>\n<p>10.10.10.163 ceph3<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>4\u3001\u5728\u4e09\u53f0\u673a\u5668\u5206\u522b\u5b89\u88c5\u914d\u7f6epodman<\/strong><\/p>\n<table>\n<tbody>\n<tr>\n<td>1<\/td>\n<td>dnf install yum-utils python3 podman<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>\u4ee5\u4e0b\u5185\u5bb9\u4ec5\u5728ceph1\u4e2d\u6267\u884c<\/strong><\/p>\n<p><strong>5\u3001\u5b89\u88c5cephadm<\/strong><\/p>\n<table>\n<tbody>\n<tr>\n<td>1<\/td>\n<td>curl &#8211;silent &#8211;remote-name &#8211;location https:\/\/github.com\/ceph\/ceph\/raw\/quincy\/src\/cephadm\/cephadm<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u6216<\/p>\n<table>\n<tbody>\n<tr>\n<td>1<\/td>\n<td>curl -o cephadm &#8211;silent &#8211;remote-name &#8211;location http:\/\/down.whsir.com\/downloads\/cephadm17<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>6\u3001\u7ed9\u4e88cephadm\u6267\u884c\u6743\u9650<\/strong><\/p>\n<table>\n<tbody>\n<tr>\n<td>1<\/td>\n<td>chmod +x cephadm<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>7\u3001\u5b89\u88c5cephadm\u5230\u5f53\u524d\u8282\u70b9<\/strong><\/p>\n<table>\n<tbody>\n<tr>\n<td>1<\/p>\n<p>2<\/td>\n<td>dnf install &#8211;assumeyes centos-release-ceph-quincy<\/p>\n<p>dnf install &#8211;assumeyes cephadm<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>8\u3001\u5f15\u5bfcceph\u96c6\u7fa4<\/strong><\/p>\n<table>\n<tbody>\n<tr>\n<td>1<\/td>\n<td>cephadm bootstrap &#8211;mon-ip 10.10.10.161<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>9\u3001\u5b89\u88c5Ceph CLI<\/strong><\/p>\n<p>\u65b9\u6cd5\u4e00\uff1a\u901a\u8fc7\u4ea4\u4e92\u6a21\u5f0f\u6267\u884cceph\u7b49\u76f8\u5173\u547d\u4ee4<\/p>\n<table>\n<tbody>\n<tr>\n<td>1<\/p>\n<p>2<\/p>\n<p>3<\/p>\n<p>4<\/p>\n<p>5<\/td>\n<td>[root@ceph1 ~]# cephadm shell<\/p>\n<p>Inferring fsid 6174cfc0-e3da-11ed-b6bb-52540079c777<\/p>\n<p>Inferring config \/var\/lib\/ceph\/6174cfc0-e3da-11ed-b6bb-52540079c777\/mon.ceph1\/config<\/p>\n<p>quay.io\/ceph\/ceph@sha256:616a304ce397b8a5001d78436f7899d3507bd1d3b8fbc971e4d89c1555a6ed1f<\/p>\n<p>[ceph: root@ceph1 \/]# exit<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u65b9\u6cd5\u4e8c\uff1a\u975e\u4ea4\u4e92\u6a21\u5f0f\uff0c\u6bcf\u6b21\u6267\u884cceph\u547d\u4ee4\u90fd\u901a\u8fc7cephadm shell &#8211;\u524d\u7f00\u6765\u6267\u884c\uff0c\u5982<\/p>\n<table>\n<tbody>\n<tr>\n<td>1<\/td>\n<td>cephadm shell &#8212; ceph -v<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u65b9\u6cd5\u4e09\uff08\u63a8\u8350\uff09\uff1a\u5b89\u88c5\u5de5\u5177\u5305\u7ec4\uff0c\u76f4\u63a5\u53ef\u5728\u5bbf\u4e3b\u673a\u6267\u884cceph\u7b49\u76f8\u5173\u547d\u4ee4<\/p>\n<table>\n<tbody>\n<tr>\n<td>1<\/td>\n<td>dnf install ceph-common<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u76f4\u63a5\u6267\u884cceph\u7b49\u76f8\u5173\u547d\u4ee4\u3002<\/p>\n<p><strong>10\u3001\u67e5\u770bceph\u96c6\u7fa4\u5bb9\u5668\u6240\u6709\u7ec4\u4ef6\u8fd0\u884c\u72b6\u6001<\/strong><\/p>\n<table>\n<tbody>\n<tr>\n<td>1<\/td>\n<td>ceph orch ps<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u786e\u4fddSTATUS\u72b6\u6001\u5168\u90e8\u662frunning<\/p>\n<p><strong>11\u3001\u62f7\u8d1d\u5bc6\u94a5\u5230\u53e6\u5916\u4e24\u53f0\u4e3b\u673a\u4e0a<\/strong><\/p>\n<table>\n<tbody>\n<tr>\n<td>1<\/td>\n<td>ssh-copy-id -f -i \/etc\/ceph\/ceph.pub root@ceph2<\/td>\n<\/tr>\n<tr>\n<td>1<\/td>\n<td>ssh-copy-id -f -i \/etc\/ceph\/ceph.pub root@ceph3<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>12\u3001\u5c06\u53e6\u5916\u4e24\u4e2a\u4e3b\u673a\u6dfb\u52a0\u81f3\u96c6\u7fa4\u4e2d<\/strong><\/p>\n<table>\n<tbody>\n<tr>\n<td>1<\/td>\n<td>ceph orch host add ceph2 10.10.10.162<\/td>\n<\/tr>\n<tr>\n<td>1<\/td>\n<td>ceph orch host add ceph3 10.10.10.163<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>13\u3001\u67e5\u770b\u4e3b\u673a<\/strong><\/p>\n<table>\n<tbody>\n<tr>\n<td>1<\/td>\n<td>ceph orch host ls<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>HOST ADDR LABELS STATUS<br \/>\nceph1 10.10.10.161 _admin<br \/>\nceph2 10.10.10.162<br \/>\nceph3 10.10.10.163<br \/>\n3 hosts in cluster<\/p>\n<table>\n<tbody>\n<tr>\n<td>1<\/td>\n<td>ceph orch ps<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u56e0\u4e3a\u662f\u5728\u7ebf\u5b89\u88c5\uff0c\u7531\u4e8e\u7f51\u7edc\u539f\u56e0\u53ef\u80fd\u4f1a\u5728\u8fd9\u4e00\u90e8\u7b49\u597d\u4e45\uff0c\u786e\u4fddSTATUS\u72b6\u6001\u5168\u90e8\u662frunning\uff0c\u518d\u8fdb\u884c\u4e0b\u4e00\u6b65\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"389\" class=\"wp-image-11928\" src=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2023\/09\/a-screenshot-of-a-computer-screen-description-aut.png\" alt=\"A screenshot of a computer screen\n\nDescription automatically generated\" srcset=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2023\/09\/a-screenshot-of-a-computer-screen-description-aut.png 1024w, https:\/\/www.xh86.me\/wp-content\/uploads\/2023\/09\/a-screenshot-of-a-computer-screen-description-aut-300x114.png 300w, https:\/\/www.xh86.me\/wp-content\/uploads\/2023\/09\/a-screenshot-of-a-computer-screen-description-aut-768x292.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<table>\n<tbody>\n<tr>\n<td>1<\/td>\n<td>ceph orch ls<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"867\" height=\"272\" class=\"wp-image-11929\" src=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2023\/09\/a-black-screen-with-white-text-description-automa.png\" alt=\"A black screen with white text\n\nDescription automatically generated\" srcset=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2023\/09\/a-black-screen-with-white-text-description-automa.png 867w, https:\/\/www.xh86.me\/wp-content\/uploads\/2023\/09\/a-black-screen-with-white-text-description-automa-300x94.png 300w, https:\/\/www.xh86.me\/wp-content\/uploads\/2023\/09\/a-black-screen-with-white-text-description-automa-768x241.png 768w\" sizes=\"auto, (max-width: 867px) 100vw, 867px\" \/><\/p>\n<p><strong>14\u3001\u521b\u5efaOSD<\/strong><\/p>\n<p>\u65b9\u6cd5\u4e00\uff08\u63a8\u8350\uff09\uff1a\u81ea\u52a8\u6dfb\u52a0\u6240\u6709\u6ee1\u8db3\u6761\u4ef6\u7684OSD<\/p>\n<table>\n<tbody>\n<tr>\n<td>1<\/td>\n<td>\u65b9\u6cd5\u4e00\uff08\u63a8\u8350\uff09\uff1a\u81ea\u52a8\u6dfb\u52a0\u6240\u6709\u6ee1\u8db3\u6761\u4ef6\u7684OSD<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u65b9\u6cd5\u4e8c\uff1a\u624b\u5de5\u6307\u5b9a\u7684\u65b9\u5f0f\u6dfb\u52a0OSD<\/p>\n<table>\n<tbody>\n<tr>\n<td>1<\/p>\n<p>2<\/p>\n<p>3<\/td>\n<td>ceph orch daemon add osd ceph1:\/dev\/vdb<\/p>\n<p>ceph orch daemon add osd ceph2:\/dev\/vdb<\/p>\n<p>ceph orch daemon add osd ceph3:\/dev\/vdb<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u7a0d\u7b49\u7247\u523b\uff0c\u901a\u8fc7\u547d\u4ee4\u68c0\u67e5\uff0cAvailable\u663e\u793ano\uff0c\u8868\u793aOSD\u521b\u5efa\u5b8c\u6210<\/p>\n<table>\n<tbody>\n<tr>\n<td>1<\/td>\n<td>ceph orch device ls<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u6b64\u65f6\u901a\u8fc7\u4eea\u8868\u76d8\u53ef\u770b\u5230\u96c6\u7fa4\u6b63\u5e38<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"481\" class=\"wp-image-11930\" src=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2023\/09\/a-screenshot-of-a-computer-description-automatica-16.png\" alt=\"A screenshot of a computer\n\nDescription automatically generated\" srcset=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2023\/09\/a-screenshot-of-a-computer-description-automatica-16.png 1024w, https:\/\/www.xh86.me\/wp-content\/uploads\/2023\/09\/a-screenshot-of-a-computer-description-automatica-16-300x141.png 300w, https:\/\/www.xh86.me\/wp-content\/uploads\/2023\/09\/a-screenshot-of-a-computer-description-automatica-16-768x361.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>\u901a\u8fc7\u547d\u4ee4\u770b\u4e0b\u96c6\u7fa4\u72b6\u6001\u6b63\u5e38<\/p>\n<table>\n<tbody>\n<tr>\n<td>1<\/td>\n<td>ceph -s<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"901\" height=\"418\" class=\"wp-image-11931\" src=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2023\/09\/a-computer-screen-shot-of-a-black-screen-descript.png\" alt=\"A computer screen shot of a black screen\n\nDescription automatically generated\" srcset=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2023\/09\/a-computer-screen-shot-of-a-black-screen-descript.png 901w, https:\/\/www.xh86.me\/wp-content\/uploads\/2023\/09\/a-computer-screen-shot-of-a-black-screen-descript-300x139.png 300w, https:\/\/www.xh86.me\/wp-content\/uploads\/2023\/09\/a-computer-screen-shot-of-a-black-screen-descript-768x356.png 768w\" sizes=\"auto, (max-width: 901px) 100vw, 901px\" \/><\/p>\n<p>\u81f3\u6b64ceph version 17.2.6 quincy(stable)\u96c6\u7fa4\u5728\u7ebf\u7248\u90e8\u7f72\u5b8c\u6210<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>ceph\u7684quincy\u662fceph\u7684\u7b2c17\u4e2a\u7248\u672c\uff0c\u521d\u59cb\u53d1\u884c\u65f6\u95f4\u662f2022-04-19\uff0c\u672c\u6587\u5c06\u901a\u8fc7cephadm\u5de5 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,3],"tags":[],"class_list":["post-11927","post","type-post","status-publish","format-standard","hentry","category-linux","category-system"],"_links":{"self":[{"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/posts\/11927","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xh86.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=11927"}],"version-history":[{"count":1,"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/posts\/11927\/revisions"}],"predecessor-version":[{"id":11932,"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/posts\/11927\/revisions\/11932"}],"wp:attachment":[{"href":"https:\/\/www.xh86.me\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11927"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xh86.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11927"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xh86.me\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11927"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}