惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

C
CXSECURITY Database RSS Feed - CXSecurity.com
Stack Overflow Blog
Stack Overflow Blog
月光博客
月光博客
T
Threat Research - Cisco Blogs
小众软件
小众软件
有赞技术团队
有赞技术团队
酷 壳 – CoolShell
酷 壳 – CoolShell
Apple Machine Learning Research
Apple Machine Learning Research
C
Cyber Attacks, Cyber Crime and Cyber Security
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
T
Tailwind CSS Blog
Cisco Talos Blog
Cisco Talos Blog
V
V2EX
博客园 - 【当耐特】
C
Cybersecurity and Infrastructure Security Agency CISA
Hugging Face - Blog
Hugging Face - Blog
The Cloudflare Blog
The Last Watchdog
The Last Watchdog
Simon Willison's Weblog
Simon Willison's Weblog
T
Threatpost
S
Secure Thoughts
O
OpenAI News
P
Proofpoint News Feed
S
SegmentFault 最新的问题
Forbes - Security
Forbes - Security
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Application and Cybersecurity Blog
Application and Cybersecurity Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Last Week in AI
Last Week in AI
宝玉的分享
宝玉的分享
Scott Helme
Scott Helme
T
Tenable Blog
A
Arctic Wolf
L
LINUX DO - 热门话题
爱范儿
爱范儿
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
www.infosecurity-magazine.com
www.infosecurity-magazine.com
V
Visual Studio Blog
Hacker News: Ask HN
Hacker News: Ask HN
Hacker News - Newest:
Hacker News - Newest: "LLM"
腾讯CDC
博客园 - Franky
WordPress大学
WordPress大学
Know Your Adversary
Know Your Adversary
博客园_首页
雷峰网
雷峰网
IT之家
IT之家
PCI Perspectives
PCI Perspectives
L
LINUX DO - 最新话题
H
Heimdal Security Blog

思有云 - IOIOX - CentOS

CentOS 7 从Python2.7.5升级到Python2.7.16版本教程 - 思有云 支持本地,腾讯,阿里,七牛,又拍云对象存储的Lsky Pro图床安装教程 - 思有云 - IOIOX LNMP环境中使用Docker安装配置GitLab教程 - 思有云 - IOIOX OLAINDEX另一个OneDrive目录索引应用部署教程 - 思有云 - IOIOX CentOS使用OneIndex部署OneDrive免费网盘教程 - 思有云 - IOIOX 一键安装脚本为CentOS 7 添加Swap交换分区 - 思有云 服务器安装ServerStatus监控探针教程 - 思有云 - IOIOX 群晖Virtual Machine Manager套件安装CentOS虚拟机 - 思有云
CentOS 7 挂载腾讯云COS对象存储教程 - 思有云
博主: Stille · 2019-11-27 · via 思有云 - IOIOX - CentOS
  • 发布时间:
  • 11421 次浏览
  • 3 条评论
  • 1570字数
  • 分类: 运维部署
  1. 首页
  2. 正文  

前言

本文将详解使用腾讯云cosfs工具将COS对象存储的存储桶挂载到CentOS 7服务器的教程.其他平台及常见问题请参考官方说明:

腾讯云COSFS 工具
COSFS 工具类常见问题

本文为 Stille 原创文章.经实践,测试,整理发布.如需转载请联系作者获得授权,并注明转载地址.


安装COSFS工具

获取源码

git clone https://github.com/tencentyun/cosfs /usr/cosfs

安装依赖软件

sudo yum install automake gcc-c++ git libcurl-devel libxml2-devel fuse-devel make openssl-devel fuse

编译和安装 COSFS

cd /usr/cosfs
./autogen.sh
./configure
make
sudo make install
cosfs --version  #查看 cosfs 版本号

获取挂载信息

登录腾讯云-控制台-对象存储-存储桶获取相关信息

  • BucketName-APPID : test-1250000000 即存储桶名称
  • SecretId : XXXXXX
  • SecretKey : XXXXXX
  • 区域地址 : https://cos.ap-guangzhou.myqcloud.com 存储桶所在的区域域名.

配置密钥文件

官方样本

echo <BucketName-APPID>:<SecretId>:<SecretKey> > /etc/passwd-cosfs
chmod 640 /etc/passwd-cosfs

示例

echo test-1250000000:AKIDHTVVaVR6e3:PdkhT9e2rZCfy6 > /etc/passwd-cosfs
chmod 640 /etc/passwd-cosfs

挂载COS

官方样本

cosfs <BucketName-APPID> <MountPoint> -ourl=<CosDomainName> -odbglevel=info

相关参数

-o nonempty # 挂载到本地的目录不为空时.
-oallow_other # 允许其他用户访问,允许Web直连下载.

示例
创建你想挂载的路径

mkdir -p /mnt/cosfs

挂载

cosfs test-1250000000 /mnt/cosfs -ourl=https://cos.ap-guangzhou.myqcloud.com -odbglevel=info -onoxattr -oallow_other

如需挂载子目录

cosfs test-1250000000:/my-dir /mnt/cosfs -ourl=https://cos.ap-guangzhou.myqcloud.com -odbglevel=info -onoxattr -oallow_other

卸载COS

umount -l /mnt/cosfs

结语

正好搭建一个环境用到挂载对象存储,就顺手记录下配置流程.


晚高峰稳定 4K 的 IPLC 机场 解锁各流媒体 支持 ChatGPT. 晚高峰稳定 4K 的 IPLC 机场 解锁各流媒体 支持 ChatGPT. RedteaGO - 最划算的大陆漫游 eSim 流量卡,原生境外 IP,注册就送 3 刀。
RedteaGO - 最划算的大陆漫游 eSim 流量卡,原生境外 IP,注册就送 3 刀。

赞赏作者

如果喜欢我的文章,觉得对你有帮助,请随意赞赏!

CentOS 7 挂载腾讯云COS对象存储教程

 •