{"id":1013,"date":"2021-10-11T21:48:54","date_gmt":"2021-10-12T04:48:54","guid":{"rendered":"https:\/\/www.xh86.me\/?p=1013"},"modified":"2021-10-11T21:48:54","modified_gmt":"2021-10-12T04:48:54","slug":"%e5%bf%ab%e9%80%9f%e6%9e%84%e5%bb%baceph%e9%9b%86%e7%be%a4","status":"publish","type":"post","link":"https:\/\/www.xh86.me\/?p=1013","title":{"rendered":"\u5feb\u901f\u6784\u5efaCeph\u96c6\u7fa4"},"content":{"rendered":"<p>\u867d\u7136\u5b89\u88c5\u73af\u5883\u5e76\u4e0d\u662f\u5c5e\u4e8e\u7814\u53d1\u4eba\u5458\u7684\u672c\u8d28\u5de5\u4f5c\uff0c\u751a\u81f3\u6709\u4e9b\u7814\u53d1\u4eba\u5458\u62b5\u89e6\u4e00\u4e9b\u73af\u5883\u7684\u642d\u5efa\u5de5\u4f5c\u3002\u5728\u4e00\u4e9b\u5927\u578b\u4f01\u4e1a\u4e2d\uff0c\u7531\u4e8e\u5206\u5de5\u660e\u786e\uff0c\u9020\u6210\u4e86\u4e00\u4e9b\u7814\u53d1\u4eba\u5458\u5728\u8fd9\u4e00\u65b9\u9762\u80fd\u529b\u7684\u4e25\u91cd\u7f3a\u5931\u3002\u5176\u5b9e\u73af\u5883\u5b89\u88c5\u5bf9\u4e8e\u5f00\u53d1\u4eba\u5458\u4ece\u6574\u4f53\u4e0a\u638c\u63e1\u8f6f\u4ef6\u67b6\u6784\u5e08\u975e\u5e38\u6709\u76ca\u7684\uff0c\u540c\u65f6\u968f\u7740\u4e91\u8ba1\u7b97\u3001\u4e91\u539f\u751f\u7684\u53d1\u5c55\uff0c\u5bf9\u4e8eDevOps\u7684\u8f6f\u4ef6\u5f00\u53d1\u6a21\u5f0f\u4e5f\u8d8a\u6765\u8d8a\u88ab\u4f01\u4e1a\u63a5\u53d7\uff0c\u53ef\u4ee5\u9884\u89c1\u7684\u662f\uff0c\u672a\u6765DevOps\u5c06\u662f\u6240\u6709\u7814\u53d1\u4eba\u5458\u5fc5\u5907\u7684\u6280\u80fd\u4e4b\u4e00\u3002<\/p>\n<p>\u672c\u6587\u4e3b\u8981\u76ee\u6807\u662f\u5e2e\u52a9\u7814\u53d1\u4eba\u5458\u7528\u6700\u5c0f\u6210\u672c\u642d\u5efa\u4e00\u5957Ceph\u73af\u5883\uff0c\u4e3a\u4e86\u964d\u4f4e\u642d\u5efa\u6210\u672c\uff0c\u4f7f\u7528\u4e86Ceph Deploy\u53ca\u56fd\u5185\u6e90\u52a0\u901f\u5b89\u88c5\u901f\u5ea6\u3002\u6211\u4eec\u9009\u62e9\u76ee\u524dCeph Octopus\u6700\u65b0\u7684\u7a33\u5b9a\u7248\u672c\u8fdb\u884c\u5b89\u88c5\u3002<\/p>\n<h1 id=\"\u90e8\u7f72\u67b6\u6784\">\u90e8\u7f72\u67b6\u6784<\/h1>\n<p>\u6211\u4eec\u51c6\u5907\u56db\u53f0\u670d\u52a1\u5668\uff0c\u5176\u4e2d\u4e00\u53f0\u4f5c\u4e3a\u90e8\u7f72\u53d1\u8d77\u8282\u70b9\u548c\u540e\u7eedClient\u8282\u70b9\u4f7f\u7528\u3002\u53e6\u5916\u4e09\u53f0\u4f5c\u4e3aCeph\u8282\u70b9\u4f7f\u7528\uff0c\u5176\u4e2d\u7b2c\u4e00\u53f0\u8282\u70b9node01\u4e0a\uff0c\u9664\u4e86monitor\u548cosd\u5916\uff0c\u8fd8\u5c06\u8fd0\u884cManager, MDS\u548cRGW\u670d\u52a1\uff0c\u7528\u4e8e\u63d0\u4f9b\u6587\u4ef6\u53ca\u5bf9\u8c61\u5b58\u50a8\u670d\u52a1\u3002\u6bcf\u4e00\u53f0Ceph\u8282\u70b9\u90fd\u53e6\u5916\u6302\u8f7d\u4e86\u4e00\u5757\u5355\u72ec\u7684\u78c1\u76d8\uff0c\u7531\u4e8e\u6211\u4f7f\u7528\u7684\u662f\u865a\u62df\u673a\u73af\u5883\uff0c\u6240\u4ee5\u6302\u8f7d\u8282\u70b9\u4e3a\/dev\/vdb\uff0c\u5982\u679c\u4f7f\u7528\u662f\u5176\u4ed6\u73af\u5883\u9700\u8981\u6ce8\u610f\u6302\u8f7d\u70b9\u540d\u79f0\u3002<\/p>\n<p><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='http:\/\/sunqi.site\/images\/pasted-58-1.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"http:\/\/sunqi.site\/images\/pasted-58-1.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"upload successful\" \/><\/div><\/p>\n<h1 id=\"\u90e8\u7f72\u65f6\u5e8f\u56fe\">\u90e8\u7f72\u65f6\u5e8f\u56fe<\/h1>\n<p>\u4f7f\u7528Ceph Deploy\u5c06\u5927\u5e45\u5ea6\u7b80\u5316\u5b89\u88c5\u8fc7\u7a0b\uff0c\u5927\u4f53\u4e0a\u5206\u4e3a\u4ee5\u4e0b\u5b89\u88c5\u6b65\u9aa4\uff1a<\/p>\n<ul>\n<li>\u8282\u70b9\u521d\u59cb\u5316\u914d\u7f6e<\/li>\n<li>Ceph Deploy\u8282\u70b9\u5b89\u88c5<\/li>\n<li>Ceph\u96c6\u7fa4\u521d\u59cb\u5316<\/li>\n<li>ODS\u8282\u70b9\u5b89\u88c5\u3001\u5b89\u88c5Mgr\u670d\u52a1\u53ca\u6dfb\u52a0ODS\u78c1\u76d8\uff0c\u5b8c\u6210Ceph\u57fa\u672c\u5b89\u88c5<\/li>\n<li>CephFS\u5b89\u88c5\uff0c\u90e8\u7f72Metadata\u670d\u52a1<\/li>\n<li>Ceph RGW\u5b89\u88c5\uff0c\u90e8\u7f72RGW\u670d\u52a1<\/li>\n<\/ul>\n<p><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='http:\/\/sunqi.site\/images\/pasted-59-1.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"http:\/\/sunqi.site\/images\/pasted-59-1.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"upload successful\" \/><\/div><\/p>\n<h1 id=\"\uff08\u5168\u90e8\u8282\u70b9\uff09\u73af\u5883\u51c6\u5907\">\uff08\u5168\u90e8\u8282\u70b9\uff09\u73af\u5883\u51c6\u5907<\/h1>\n<p>\u8fd9\u662f\u6211\u975e\u5e38\u5e38\u7528\u7684\u9488\u5bf9CentOS 7\u7684\u8bbe\u7f6e\uff0c\u4e3a\u4e86\u6d4b\u8bd5\u65b9\u4fbf\uff0c\u5173\u95ed\u4e86\u9632\u706b\u5899\u3001SELINUX\uff0c\u540c\u65f6\u66f4\u65b0\u4e86\u7cfb\u7edf\u548cEPEL\u6e90\u4e3a\u963f\u91cc\u6e90\uff0c\u6700\u540e\u8fdb\u884c\u7cfb\u7edf\u66f4\u65b0\uff0c\u4fdd\u8bc1\u7cfb\u7edf\u8f6f\u4ef6\u5305\u66f4\u65b0\u5230\u6700\u65b0\u7248\u672c\u540e\uff0c\u518d\u8fdb\u884c\u73af\u5883\u5b89\u88c5\u3002<\/p>\n<figure class=\"highlight plain\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter\">\n<pre><span class=\"line\">1<\/span>\r\n<span class=\"line\">2<\/span>\r\n<span class=\"line\">3<\/span>\r\n<span class=\"line\">4<\/span>\r\n<span class=\"line\">5<\/span>\r\n<span class=\"line\">6<\/span>\r\n<span class=\"line\">7<\/span>\r\n<span class=\"line\">8<\/span>\r\n<span class=\"line\">9<\/span>\r\n<span class=\"line\">10<\/span>\r\n<span class=\"line\">11<\/span>\r\n<span class=\"line\">12<\/span>\r\n<span class=\"line\">13<\/span>\r\n<span class=\"line\">14<\/span>\r\n<span class=\"line\">15<\/span>\r\n<span class=\"line\">16<\/span>\r\n<span class=\"line\">17<\/span>\r\n<span class=\"line\">18<\/span><\/pre>\n<\/td>\n<td class=\"code\">\n<pre><span class=\"line\"># Set SELinux in permissive mode (effectively disabling it)<\/span>\r\n<span class=\"line\">setenforce 0<\/span>\r\n<span class=\"line\">#sed -i 's\/^SELINUX=enforcing$\/SELINUX=permissive\/' \/etc\/selinux\/config<\/span>\r\n<span class=\"line\">sed -i 's\/^SELINUX=enforcing$\/SELINUX=disabled\/' \/etc\/selinux\/config<\/span>\r\n \r\n<span class=\"line\">systemctl stop NetworkManager<\/span>\r\n<span class=\"line\">systemctl disable NetworkManager<\/span>\r\n \r\n<span class=\"line\">systemctl status firewalld<\/span>\r\n<span class=\"line\">systemctl stop firewalld<\/span>\r\n<span class=\"line\">systemctl disable firewalld<\/span>\r\n<span class=\"line\">systemctl status firewalld<\/span>\r\n<span class=\"line\">firewall-cmd --state<\/span>\r\n \r\n<span class=\"line\">curl -o \/etc\/yum.repos.d\/CentOS-Base.repo <a class=\"vglnk\" href=\"http:\/\/mirrors.aliyun.com\/repo\/Centos-7.repo\" rel=\"nofollow\">http:\/\/mirrors.aliyun.com\/repo\/Centos-7.repo<\/a><\/span>\r\n<span class=\"line\">curl -o \/etc\/yum.repos.d\/epel.repo <a class=\"vglnk\" href=\"http:\/\/mirrors.aliyun.com\/repo\/epel-7.repo\" rel=\"nofollow\">http:\/\/mirrors.aliyun.com\/repo\/epel-7.repo<\/a><\/span>\r\n<span class=\"line\">yum clean all &amp;&amp; yum makecache<\/span>\r\n<span class=\"line\">yum update -y<\/span><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p>\u5982\u679c\u6309\u7167\u6b63\u5e38\u6d41\u7a0b\u5b89\u88c5\u540e\uff0c\u6267\u884cceph -s\uff0c\u4f1a\u51fa\u73b0restful\u6a21\u5757\u65e0\u6cd5\u627e\u5230\uff0c\u7f3a\u5c11pecan\u7684\u5b89\u88c5\u5305\uff0c\u6240\u4ee5\u5728\u521d\u59cb\u5316\u9636\u6bb5\u76f4\u63a5\u5c06\u7f3a\u5c11\u7684\u5305\u8fdb\u884c\u5b89\u88c5\u3002<\/p>\n<figure class=\"highlight plain\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter\">\n<pre><span class=\"line\">1<\/span>\r\n<span class=\"line\">2<\/span><\/pre>\n<\/td>\n<td class=\"code\">\n<pre><span class=\"line\">yum install -y python3-pip<\/span>\r\n<span class=\"line\">pip3 install pecan werkzeug<\/span><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h1 id=\"Ceph-Deploy\u8282\u70b9\u5b89\u88c5\">Ceph-Deploy\u8282\u70b9\u5b89\u88c5<\/h1>\n<h2 id=\"\uff08Ceph-Deploy\u8282\u70b9\uff09\u5b89\u88c5Ceph-Deploy\">\uff08Ceph Deploy\u8282\u70b9\uff09\u5b89\u88c5Ceph-Deploy<\/h2>\n<figure class=\"highlight plain\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter\">\n<pre><span class=\"line\">1<\/span>\r\n<span class=\"line\">2<\/span>\r\n<span class=\"line\">3<\/span>\r\n<span class=\"line\">4<\/span>\r\n<span class=\"line\">5<\/span>\r\n<span class=\"line\">6<\/span>\r\n<span class=\"line\">7<\/span>\r\n<span class=\"line\">8<\/span>\r\n<span class=\"line\">9<\/span><\/pre>\n<\/td>\n<td class=\"code\">\n<pre><span class=\"line\">cat &lt;&lt; EOF &gt; \/etc\/yum.repos.d\/ceph.repo<\/span>\r\n<span class=\"line\">[ceph-noarch]<\/span>\r\n<span class=\"line\">name=Ceph noarch packages<\/span>\r\n<span class=\"line\">baseurl=<a class=\"vglnk\" href=\"https:\/\/mirrors.aliyun.com\/ceph\/rpm-octopus\/el7\/noarch\/\" rel=\"nofollow\">https:\/\/mirrors.aliyun.com\/ceph\/rpm-octopus\/el7\/noarch\/<\/a><\/span>\r\n<span class=\"line\">enabled=1<\/span>\r\n<span class=\"line\">gpgcheck=1<\/span>\r\n<span class=\"line\">type=rpm-md<\/span>\r\n<span class=\"line\">gpgkey=<a class=\"vglnk\" href=\"https:\/\/mirrors.aliyun.com\/ceph\/keys\/release.asc\" rel=\"nofollow\">https:\/\/mirrors.aliyun.com\/ceph\/keys\/release.asc<\/a><\/span>\r\n<span class=\"line\">EOF<\/span><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<figure class=\"highlight plain\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter\">\n<pre><span class=\"line\">1<\/span>\r\n<span class=\"line\">2<\/span><\/pre>\n<\/td>\n<td class=\"code\">\n<pre><span class=\"line\">yum makecache<\/span>\r\n<span class=\"line\">yum install -y ceph-deploy<\/span><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h2 id=\"\uff08\u5168\u90e8\u8282\u70b9\uff09\u8bbe\u7f6e\u65f6\u95f4\u540c\u6b65\u670d\u52a1\">\uff08\u5168\u90e8\u8282\u70b9\uff09\u8bbe\u7f6e\u65f6\u95f4\u540c\u6b65\u670d\u52a1<\/h2>\n<p>\u65f6\u95f4\u540c\u6b65\u670d\u52a1\u662f\u5206\u5e03\u5f0f\u7cfb\u7edf\u7684\u751f\u547d\u7ebf\uff0c\u6240\u4ee5\u5b89\u88c5\u65f6\u5019\u5148\u8981\u5b89\u88c5NTP\u6216\u8005Chrony\u3002\u5728RHEL 7\u4e2d\uff0c\u9ed8\u8ba4\u7684\u65f6\u95f4\u540c\u6b65\u88ab\u66ff\u6362\u4e3aChrony\uff0c\u5f88\u591a\u65b0\u7684\u5b89\u88c5\u6587\u6863\u4e2d\u4e5f\u5f00\u59cb\u4f7f\u7528Chrony\u4f5c\u4e3a\u65f6\u95f4\u540c\u6b65\u670d\u52a1\uff0c\u4f46\u662fNTP\u4e5f\u88ab\u540c\u65f6\u4fdd\u7559\u3002\u6211\u7684\u73af\u5883\u4e2dChrony\u5df2\u7ecf\u88ab\u5b89\u88c5\u5e76\u542f\u52a8\uff0c\u5982\u679c\u6ca1\u6709\u8bf7\u81ea\u884c\u5b89\u88c5\u3002<\/p>\n<h2 id=\"\uff08Ceph-Deploy\u8282\u70b9\uff09\u65e0\u5bc6\u7801\u767b\u5f55\">\uff08Ceph Deploy\u8282\u70b9\uff09\u65e0\u5bc6\u7801\u767b\u5f55<\/h2>\n<p>\u8fd9\u91cc\u4e3a\u4e86\u7b80\u4fbf\uff0c\u4f7f\u7528\u4e86root\u7528\u6237\u8fdb\u884c\u5b89\u88c5\u3002\u914d\u7f6e\u5b8c\u6210\u540e\uff0c\u9700\u8981\u8ba9Ceph Deploy\u80fd\u591f\u65e0\u5bc6\u7801\u7684\u65b9\u5f0f\u8bbf\u95ee\u5168\u90e8Ceph\u8282\u70b9\u3002<\/p>\n<figure class=\"highlight plain\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter\">\n<pre><span class=\"line\">1<\/span><\/pre>\n<\/td>\n<td class=\"code\">\n<pre><span class=\"line\">ssh-keygen<\/span><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<figure class=\"highlight plain\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter\">\n<pre><span class=\"line\">1<\/span>\r\n<span class=\"line\">2<\/span>\r\n<span class=\"line\">3<\/span><\/pre>\n<\/td>\n<td class=\"code\">\n<pre><span class=\"line\">ssh-copy-id root@node1<\/span>\r\n<span class=\"line\">ssh-copy-id root@node2<\/span>\r\n<span class=\"line\">ssh-copy-id root@node3<\/span><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h1 id=\"Ceph\u96c6\u7fa4\u5b89\u88c5\">Ceph\u96c6\u7fa4\u5b89\u88c5<\/h1>\n<h2 id=\"\uff08Ceph-Deploy\u8282\u70b9\uff09Ceph\u5757\u5b58\u50a8\u670d\u52a1\u5b89\u88c5\">\uff08Ceph Deploy\u8282\u70b9\uff09Ceph\u5757\u5b58\u50a8\u670d\u52a1\u5b89\u88c5<\/h2>\n<figure class=\"highlight plain\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter\">\n<pre><span class=\"line\">1<\/span>\r\n<span class=\"line\">2<\/span>\r\n<span class=\"line\">3<\/span>\r\n<span class=\"line\">4<\/span>\r\n<span class=\"line\">5<\/span>\r\n<span class=\"line\">6<\/span>\r\n<span class=\"line\">7<\/span>\r\n<span class=\"line\">8<\/span>\r\n<span class=\"line\">9<\/span>\r\n<span class=\"line\">10<\/span>\r\n<span class=\"line\">11<\/span>\r\n<span class=\"line\">12<\/span>\r\n<span class=\"line\">13<\/span>\r\n<span class=\"line\">14<\/span>\r\n<span class=\"line\">15<\/span>\r\n<span class=\"line\">16<\/span>\r\n<span class=\"line\">17<\/span>\r\n<span class=\"line\">18<\/span>\r\n<span class=\"line\">19<\/span><\/pre>\n<\/td>\n<td class=\"code\">\n<pre><span class=\"line\">export CEPH_DEPLOY_REPO_URL=<a class=\"vglnk\" href=\"https:\/\/mirrors.aliyun.com\/ceph\/rpm-octopus\/el7\" rel=\"nofollow\">https:\/\/mirrors.aliyun.com\/ceph\/rpm-octopus\/el7<\/a><\/span>\r\n<span class=\"line\">export CEPH_DEPLOY_GPG_URL=<a class=\"vglnk\" href=\"https:\/\/mirrors.aliyun.com\/ceph\/keys\/release.asc\" rel=\"nofollow\">https:\/\/mirrors.aliyun.com\/ceph\/keys\/release.asc<\/a><\/span>\r\n\r\n<span class=\"line\"># \u96c6\u7fa4\u521d\u59cb\u5316\uff0c\u8fd9\u4e00\u6b65\u4f1a\u751f\u6210\u521d\u59cb\u5316\u7684ceph.conf\uff0c\u53ef\u4ee5\u914d\u7f6e\u7f51\u7edc\u7b49\u4fe1\u606f<\/span>\r\n<span class=\"line\">ceph-deploy new node01<\/span>\r\n<span class=\"line\">ceph-deploy install node01 node02 node03<\/span>\r\n\r\n<span class=\"line\"># \u521d\u59cb\u5316monitor\uff0c\u5e76\u6536\u96c6keys<\/span>\r\n<span class=\"line\">ceph-deploy mon create-initial<\/span>\r\n<span class=\"line\">ceph-deploy admin node01 node02 node03<\/span>\r\n\r\n<span class=\"line\">ceph-deploy mgr create node01<\/span>\r\n\r\n<span class=\"line\">ceph-deploy osd create --data \/dev\/vdb node01<\/span>\r\n<span class=\"line\">ceph-deploy osd create --data \/dev\/vdb node02<\/span>\r\n<span class=\"line\">ceph-deploy osd create --data \/dev\/vdb node03<\/span>\r\n\r\n<span class=\"line\"># \u68c0\u67e5\u96c6\u7fa4\u72b6\u6001<\/span>\r\n<span class=\"line\">ceph -s<\/span><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p>\u7531\u4e8e\u9ed8\u8ba4\u91c7\u7528\u4e86Bluestore\u5b89\u88c5\u65b9\u5f0f\uff0c\u5982\u679c\u60f3\u4f7f\u7528SSD\u4f5c\u4e3ablock.db\u548cblock.wal\uff0c\u53ef\u4ee5\u8fd9\u6837\u521b\u5efaOSD<\/p>\n<figure class=\"highlight plain\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter\">\n<pre><span class=\"line\">1<\/span><\/pre>\n<\/td>\n<td class=\"code\">\n<pre><span class=\"line\">ceph-deploy osd create --data \/dev\/vdb --block-db \/dev\/vdc --block-wal \/dev\/vdc node01<\/span><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p>\u5728Ceph Deploy\u8282\u70b9\uff0c\u5c06Ceph\u76f8\u5173\u914d\u7f6e\u6587\u4ef6\u62f7\u8d1d\u81f3\u7cfb\u7edf\u7684\/etc\/ceph\u76ee\u5f55<\/p>\n<figure class=\"highlight plain\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter\">\n<pre><span class=\"line\">1<\/span>\r\n<span class=\"line\">2<\/span>\r\n<span class=\"line\">3<\/span><\/pre>\n<\/td>\n<td class=\"code\">\n<pre><span class=\"line\">mkdir -p \/etc\/ceph<\/span>\r\n<span class=\"line\">cp ceph.conf \/etc\/ceph<\/span>\r\n<span class=\"line\">cp ceph.client.admin.keyring \/etc\/ceph<\/span><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h3 id=\"\uff08Ceph-Deploy\u8282\u70b9\uff09\u589e\u52a0\u591a\u4e2aMonitor\u8282\u70b9\">\uff08Ceph Deploy\u8282\u70b9\uff09\u589e\u52a0\u591a\u4e2aMonitor\u8282\u70b9<\/h3>\n<p>\u6dfb\u52a0\u591a\u4e2aMonitor\u8282\u70b9\uff0c\u53ef\u4ee5\u5b9e\u73b0\u9ad8\u53ef\u9760\uff0c\u4f46\u662f\u4e00\u5b9a\u4e3a\u5947\u6570\u3002\u5148\u66f4\u65b0\u914d\u7f6e\u6587\u4ef6\uff0c\u5728\u521a\u624d\u521d\u59cb\u5316\u96c6\u7fa4\u76ee\u5f55\u4e0b\u7684ceph.conf\u4e2d\u7684mon_host\u6dfb\u52a0\u6240\u6709\u8282\u70b9IP\uff0c\u4e4b\u540e\u8bbe\u5b9apublic network\uff0c\u8fd9\u91cc\u6211\u4eec\u4f7f\u7528\u4e86Ceph\u8282\u70b9\u7684\u7f51\u6bb5\uff1a<\/p>\n<figure class=\"highlight plain\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter\">\n<pre><span class=\"line\">1<\/span>\r\n<span class=\"line\">2<\/span>\r\n<span class=\"line\">3<\/span>\r\n<span class=\"line\">4<\/span>\r\n<span class=\"line\">5<\/span><\/pre>\n<\/td>\n<td class=\"code\">\n<pre><span class=\"line\"># ceph.conf<\/span>\r\n<span class=\"line\"># ...<\/span>\r\n<span class=\"line\">mon_host = 192.168.10.105,192.168.10.176,192.168.10.139<\/span>\r\n<span class=\"line\">public network = 192.168.10.1\/24<\/span>\r\n<span class=\"line\"># ...<\/span><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p>\u5206\u53d1\u914d\u7f6e\u6587\u4ef6<\/p>\n<figure class=\"highlight plain\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter\">\n<pre><span class=\"line\">1<\/span>\r\n<span class=\"line\">2<\/span>\r\n<span class=\"line\">3<\/span>\r\n<span class=\"line\">4<\/span>\r\n<span class=\"line\">5<\/span>\r\n<span class=\"line\">6<\/span>\r\n<span class=\"line\">7<\/span><\/pre>\n<\/td>\n<td class=\"code\">\n<pre><span class=\"line\">ceph-deploy --overwrite-conf admin node01 node02 node03<\/span>\r\n<span class=\"line\">ceph-deploy mon add node02<\/span>\r\n<span class=\"line\">ceph-deploy mon add node03<\/span>\r\n\r\n\r\n<span class=\"line\"># \u68c0\u67e5quorum\u72b6\u6001<\/span>\r\n<span class=\"line\">ceph quorum_status --format json-pretty<\/span><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h2 id=\"\uff08Ceph-Deploy\u8282\u70b9\uff09Ceph\u6587\u4ef6\u7cfb\u7edf\u670d\u52a1\u5b89\u88c5\">\uff08Ceph Deploy\u8282\u70b9\uff09Ceph\u6587\u4ef6\u7cfb\u7edf\u670d\u52a1\u5b89\u88c5<\/h2>\n<figure class=\"highlight plain\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter\">\n<pre><span class=\"line\">1<\/span>\r\n<span class=\"line\">2<\/span>\r\n<span class=\"line\">3<\/span>\r\n<span class=\"line\">4<\/span>\r\n<span class=\"line\">5<\/span>\r\n<span class=\"line\">6<\/span>\r\n<span class=\"line\">7<\/span>\r\n<span class=\"line\">8<\/span><\/pre>\n<\/td>\n<td class=\"code\">\n<pre><span class=\"line\">ceph-deploy mds create node01<\/span>\r\n\r\n\r\n<span class=\"line\"># \u6dfb\u52a0\u591a\u4e2aManager\u670d\u52a1\uff0cManager\u91c7\u7528\u7684\u662f\u4e3b\u4ece\u6a21\u5f0f<\/span>\r\n<span class=\"line\">ceph-deploy mgr create node02 node03<\/span>\r\n\r\n<span class=\"line\"># \u53ef\u4ee5\u770b\u5230Manager\u4e3b\u4ece\u8282\u70b9\u72b6\u6001<\/span>\r\n<span class=\"line\">ceph -s<\/span><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p>\u5982\u679c\u53d1\u73b0Ceph Monitor\u8282\u70b9\u542f\u52a8\u5931\u8d25\uff0c\u9700\u8981\u5230\u76f8\u5e94\u7684\u8282\u70b9\u4e0a\u67e5\u770b\u5931\u8d25\u539f\u56e0\uff0c\u6bd4\u5982\u6211\u7684Monitor\u4f7f\u7528Start\u542f\u52a8\uff0c\u8fd4\u56de\u8fd9\u6837\u7684\u63d0\u793a<\/p>\n<figure class=\"highlight plain\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter\">\n<pre><span class=\"line\">1<\/span>\r\n<span class=\"line\">2<\/span><\/pre>\n<\/td>\n<td class=\"code\">\n<pre><span class=\"line\">Job for ceph-mon@node02.service failed because start of the service was attempted too often. See \"systemctl status ceph-mon@node02.service\" and \"journalctl -xe\" for details.<\/span>\r\n<span class=\"line\">To force a start use \"systemctl reset-failed ceph-mon@node02.service\" followed by \"systemctl start ceph-mon@node02.service\" again.<\/span><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p>\u6309\u7167\u63d0\u793a\u91cd\u65b0\u542f\u52a8\u5373\u53ef<\/p>\n<figure class=\"highlight plain\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter\">\n<pre><span class=\"line\">1<\/span>\r\n<span class=\"line\">2<\/span><\/pre>\n<\/td>\n<td class=\"code\">\n<pre><span class=\"line\">systemctl reset-failed ceph-mon@node02.service<\/span>\r\n<span class=\"line\">systemctl start ceph-mon@node02.service<\/span><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h2 id=\"\uff08Ceph-Deploy\u8282\u70b9\uff09Ceph\u5bf9\u8c61\u5b58\u50a8\u670d\u52a1\u5b89\u88c5\">\uff08Ceph Deploy\u8282\u70b9\uff09Ceph\u5bf9\u8c61\u5b58\u50a8\u670d\u52a1\u5b89\u88c5<\/h2>\n<figure class=\"highlight plain\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter\">\n<pre><span class=\"line\">1<\/span><\/pre>\n<\/td>\n<td class=\"code\">\n<pre><span class=\"line\">ceph-deploy rgw create node01<\/span><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h1 id=\"\u6d4b\u8bd5\">\u6d4b\u8bd5<\/h1>\n<h2 id=\"\u5757\u5b58\u50a8\u6d4b\u8bd5\">\u5757\u5b58\u50a8\u6d4b\u8bd5<\/h2>\n<h3 id=\"\u5efa\u7acb\u5b58\u50a8\u7a7a\u95f4\">\u5efa\u7acb\u5b58\u50a8\u7a7a\u95f4<\/h3>\n<figure class=\"highlight plain\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter\">\n<pre><span class=\"line\">1<\/span>\r\n<span class=\"line\">2<\/span><\/pre>\n<\/td>\n<td class=\"code\">\n<pre>\r\n\r\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h3 id=\"\u6302\u8f7d\u4f7f\u7528\">\u6302\u8f7d\u4f7f\u7528<\/h3>\n<h2 id=\"\u6587\u4ef6\u7cfb\u7edf\u6d4b\u8bd5\">\u6587\u4ef6\u7cfb\u7edf\u6d4b\u8bd5<\/h2>\n<h3 id=\"\u5efa\u7acb\u5b58\u50a8\u7a7a\u95f4-1\">\u5efa\u7acb\u5b58\u50a8\u7a7a\u95f4<\/h3>\n<figure class=\"highlight plain\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter\">\n<pre><span class=\"line\">1<\/span>\r\n<span class=\"line\">2<\/span>\r\n<span class=\"line\">3<\/span>\r\n<span class=\"line\">4<\/span>\r\n<span class=\"line\">5<\/span>\r\n<span class=\"line\">6<\/span><\/pre>\n<\/td>\n<td class=\"code\">\n<pre><span class=\"line\">ceph osd pool create cephfs_data 16<\/span>\r\n<span class=\"line\">ceph osd pool create cephfs_metadata 16<\/span>\r\n\r\n<span class=\"line\"># ceph fs new &lt;fs_name&gt; &lt;metadata&gt; &lt;data&gt;<\/span>\r\n<span class=\"line\">ceph fs new cephfs cephfs_metadata cephfs_data<\/span>\r\n<span class=\"line\">ceph fs ls<\/span><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h3 id=\"\u5185\u6838\u65b9\u5f0f\u6302\u8f7d\">\u5185\u6838\u65b9\u5f0f\u6302\u8f7d<\/h3>\n<figure class=\"highlight plain\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter\">\n<pre><span class=\"line\">1<\/span>\r\n<span class=\"line\">2<\/span><\/pre>\n<\/td>\n<td class=\"code\">\n<pre><span class=\"line\">mkdir -p \/mnt\/mycephfs<\/span>\r\n<span class=\"line\">mount -t ceph 192.168.10.11:6789:\/ \/mnt\/mycephfs -o name=admin,secretfile=\/etc\/ceph\/admin.secret<\/span><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h3 id=\"Fuse\u65b9\u5f0f\u6302\u8f7d\">Fuse\u65b9\u5f0f\u6302\u8f7d<\/h3>\n<p>\u786e\u4fdd\/etc\/ceph\u4e0b\u9762\u5df2\u7ecf\u62f7\u8d1d\u4e86ceph.conf\u548ckeyring\u6587\u4ef6<\/p>\n<figure class=\"highlight plain\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter\">\n<pre><span class=\"line\">1<\/span>\r\n<span class=\"line\">2<\/span><\/pre>\n<\/td>\n<td class=\"code\">\n<pre><span class=\"line\">mkdir -p \/mnt\/mycephfs<\/span>\r\n<span class=\"line\">ceph-fuse -m 192.168.10.11:6789 \/mnt\/mycephfs<\/span><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n","protected":false},"excerpt":{"rendered":"<p>\u867d\u7136\u5b89\u88c5\u73af\u5883\u5e76\u4e0d\u662f\u5c5e\u4e8e\u7814\u53d1\u4eba\u5458\u7684\u672c\u8d28\u5de5\u4f5c\uff0c\u751a\u81f3\u6709\u4e9b\u7814\u53d1\u4eba\u5458\u62b5\u89e6\u4e00\u4e9b\u73af\u5883\u7684\u642d\u5efa\u5de5\u4f5c\u3002\u5728\u4e00\u4e9b\u5927\u578b\u4f01\u4e1a\u4e2d\uff0c\u7531\u4e8e\u5206\u5de5\u660e [&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],"tags":[],"class_list":["post-1013","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/posts\/1013","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=1013"}],"version-history":[{"count":1,"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/posts\/1013\/revisions"}],"predecessor-version":[{"id":1014,"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/posts\/1013\/revisions\/1014"}],"wp:attachment":[{"href":"https:\/\/www.xh86.me\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1013"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xh86.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1013"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xh86.me\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1013"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}