{"id":1613,"date":"2021-12-04T14:35:46","date_gmt":"2021-12-04T06:35:46","guid":{"rendered":"https:\/\/cloudbool.com\/archive\/?p=1613"},"modified":"2021-12-04T14:35:46","modified_gmt":"2021-12-04T06:35:46","slug":"debian11-mount-cos","status":"publish","type":"post","link":"https:\/\/cloudbool.com\/archive\/debian11-mount-cos.html","title":{"rendered":"Debian11\u6302\u8f7d\u817e\u8baf\u4e91COS"},"content":{"rendered":"\n<p>\u4e4b\u524d\u6211\u4e00\u76f4\u662f\u7528\u817e\u8baf\u4e91COS\u914d\u5408\u817e\u8baf\u4e91CDN\u4ee5\u53cauPic\u4f5c\u4e3a\u56fe\u5e8a\u4f7f\u7528\uff0c\u51e0\u4e2a\u5c0f\u7f51\u7ad9\u914d\u5408\u817e\u8baf\u4e91\u6bcf\u4e2a\u6708\u514d\u8d39\u768410G\u6d41\u91cf\uff0c\u4e00\u5e74\u4e0b\u6765\u4e5f\u7528\u4e0d\u4e86\u591a\u5c11\u94b1\uff0c\u4f46\u662f\u6700\u8fd1\u8d81\u6d3b\u52a8\u5165\u4e86\u51e0\u4e2a5M\u7684\u817e\u8baf\u4e91\u8f7b\u91cf\u4e91\u670d\u52a1\u5668\uff0c\u62c5\u5fc3\u88ab\u5237\u6d41\u91cf\uff0c\u4e8e\u662f\u60f3\u7740\u628a\u56fe\u7247\u8f6c\u79fb\u5230\u670d\u52a1\u5668\uff0c\u5e76\u5c06\u6d41\u91cf\u5207\u6362\u5230\u670d\u52a1\u5668\u3002<\/p>\n\n\n\n<!--more-->\n\n\n\n<h1 class=\"wp-block-heading\">\u5199\u5728\u524d\u9762<\/h1>\n\n\n\n<p>\u6211\u76ee\u524d\u4f7f\u7528\u7684\u662fDebian11\u7cfb\u7edf\uff0c\u5b98\u65b9\u76ee\u524d\u6ca1\u6709\u63d0\u4f9bDebian\u7cfb\u7edf\u7684\u5b89\u88c5\u5305\uff0c\u4f46\u662f\u63d0\u4f9b\u4e86Ubuntu 20.04\u7684\uff0c\u7ecf\u8fc7\u6211\u7684\u5b9e\u9645\u6d4b\u8bd5\uff0c\u53d1\u73b0\u53ef\u4ee5\u517c\u5bb9Debian11\u7cfb\u7edf\uff0c\u6211\u76ee\u524d\u5c31\u662f\u4f7f\u7528\u7684Ubuntu20.04\u5bf9\u5e94\u7684\u5305\u7684\u3002<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">\u4e0b\u8f7d\u53ca\u5b89\u88c5<\/h1>\n\n\n\n<p>\u817e\u8baf\u4e91\u5b98\u65b9\u5728\u5176GitHub\u63d0\u4f9b\u4e86\u5b89\u88c5\u5305\uff0crelease\u9875\u9762\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>https:&#47;&#47;github.com\/tencentyun\/cosfs\/releases<\/code><\/pre>\n\n\n\n<p>\u6211\u76ee\u524d\u662f\u6700\u65b0\u7684\u662f1.0.19\u7248\u672c\uff0c\u5b98\u65b9\u63d0\u4f9bCentOS 6.7\/7.0\u53caUbuntu 14.04\/16.04\/18.04\/20.04\u7248\u672c\uff0c\u5b9e\u6d4b\u6ca1\u6709\u95ee\u9898\uff0c\u4e0b\u8f7d\u53ca\u5b89\u88c5\u547d\u4ee4\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apt install fuse -y\nwget https:\/\/github.com\/tencentyun\/cosfs\/releases\/download\/v1.0.19\/cosfs_1.0.19-ubuntu20.04_amd64.deb\ndpkg -i <meta charset=\"utf-8\">cosfs_1.0.19-ubuntu20.04_amd64.deb<\/code><\/pre>\n\n\n\n<h1 class=\"wp-block-heading\">\u914d\u7f6e<\/h1>\n\n\n\n<p>\u914d\u7f6e\u5206\u4e3a\u4e24\u90e8\u5206\uff0c\u521b\u5efa\u914d\u7f6e\u6587\u4ef6\u53ca\u6302\u8f7d\u5230\u672c\u5730\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u914d\u7f6e\u79d8\u94a5\u6587\u4ef6<\/h2>\n\n\n\n<p>\u4f7f\u7528\u4e0b\u9762\u547d\u4ee4\u521b\u5efa\u914d\u7f6e\u6587\u4ef6\u5e76\u5c06\u79d8\u94a5\u4fe1\u606f\u8f93\u5165\u4fdd\u5b58\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>echo &lt;BucketName-APPID>:&lt;SecretId>:&lt;SecretKey> > \/etc\/passwd-cosfs\nchmod 640 \/etc\/passwd-cosfs<\/code><\/pre>\n\n\n\n<p>\u5206\u522b\u5c06\u4e0a\u8ff0\u4e09\u4e2a&lt;>\u5305\u88f9\u7684\u53c2\u6570\u66ff\u6362\u6210\u5b9e\u9645\u7684\u53c2\u6570\uff0c\u5176\u4e2d\uff0c<meta charset=\"utf-8\">BucketName-APPID\u53ef\u4ee5\u5728COS\u9875\u9762\u83b7\u53d6\uff0cSecretId\u548cSecretKey\u53ef\u5728\u8fd9\u4e2a\u9875\u9762\u83b7\u53d6\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>https:&#47;&#47;console.cloud.tencent.com\/cam<\/code><\/pre>\n\n\n\n<p>\u5efa\u8bae\u662f\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u7528\u6237\uff0c\u7136\u540e\u5355\u72ec\u8d4b\u4e88COS\u76f8\u5173\u6743\u9650\u4ee5\u786e\u4fdd\u8d26\u6237\u5b89\u5168\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u6302\u8f7d<\/h2>\n\n\n\n<p>\u521b\u5efa\u4e00\u4e2a\u672c\u5730\u76ee\u5f55\u7528\u4e8e\u6302\u8f7dCOS\u7684Bucket\u5230\u672c\u5730\uff0c\u56e0\u4e3a\u6211\u662f\u6253\u7b97\u5c06COS\u901a\u8fc7\u670d\u52a1\u5668\u7684Nginx\u66b4\u9732\u51fa\u53bb\uff0c\u6240\u4ee5\u6309\u7167\u4e60\u60ef\u653e\u7f6e\u4e8e\/var\/www\/\u4e0b\u9762\uff0c\u76f8\u5173\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mkdir -p \/var\/www\/cos\ncosfs examplebucket-1250000000 \/var\/www\/cos -ourl=http:\/\/cos.ap-guangzhou.myqcloud.com -odbglevel=info -onoxattr -oallow_other<\/code><\/pre>\n\n\n\n<p>\u5c06\u4e0a\u9762\u7684<meta charset=\"utf-8\">examplebucket-1250000000\u53caguangzhou\u66ff\u6362\u6210\u5b9e\u9645\u7684\uff0c\u5c31\u80fd\u5b8c\u6210COS\u7684\u6302\u8f7d\u4e86\u3002<\/p>\n\n\n\n<p>\u7136\u540e\u5c31\u80fd\u50cf\u6d4f\u89c8\u672c\u5730\u6587\u4ef6\u4e00\u6837\u6d4f\u89c8COS\u7684\u6587\u4ef6\u4e86\u3002<\/p>\n\n\n\n<p>\u6bd4\u5982\u8bf4\u6211\u901a\u8fc7Nginx\u5c06\u5176\u66b4\u9732\u51fa\u53bb\u5c31\u53ef\u4ee5\u5230\u516c\u7f51\u8bbf\u95eeCOS\u91cc\u9762\u7684\u6587\u4ef6\u4e86\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u76f8\u5173\u6587\u6863<\/h2>\n\n\n\n<p>\u672c\u6587\u5927\u591a\u53c2\u8003\u5982\u4e0b\u6587\u6863\u64cd\u4f5c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>https:&#47;&#47;cloud.tencent.com\/document\/product\/436\/6883<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u4e4b\u524d\u6211\u4e00\u76f4\u662f\u7528\u817e\u8baf\u4e91COS\u914d\u5408\u817e\u8baf\u4e91CDN\u4ee5\u53cauPic\u4f5c\u4e3a\u56fe\u5e8a\u4f7f\u7528\uff0c\u51e0\u4e2a\u5c0f\u7f51\u7ad9\u914d\u5408\u817e\u8baf\u4e91\u6bcf\u4e2a\u6708\u514d\u8d39\u768410G\u6d41\u91cf &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/cloudbool.com\/archive\/debian11-mount-cos.html\"> <span class=\"screen-reader-text\">Debian11\u6302\u8f7d\u817e\u8baf\u4e91COS<\/span> \u67e5\u770b\u5168\u6587 &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"footnotes":""},"categories":[8],"tags":[],"class_list":["post-1613","post","type-post","status-publish","format-standard","hentry","category-tech"],"_links":{"self":[{"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/posts\/1613","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/comments?post=1613"}],"version-history":[{"count":0,"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/posts\/1613\/revisions"}],"wp:attachment":[{"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/media?parent=1613"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/categories?post=1613"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/tags?post=1613"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}