V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
taijia
V2EX  ›  程序员

腾讯云解决 1M 小水管,秒变私人网盘

  •  
  •   taijia · 2018 年 3 月 7 日 · 4306 次点击
    这是一个创建于 2867 天前的主题,其中的信息可能已经有所发展或是发生改变。

    首先恭喜各位买到 360 元 3 年+的同学们,腾讯云这次优惠很给力,几乎白送,大家用来搭博客,玩爬虫,玩 docker,还有已针会友的 2333,不亦乐乎。但问题 1M 的水管实在太小,几乎没法用。

    下面我来告诉大家一个曲线救国的方法。此方法可让腾讯云变成私人网盘。

    先看看效果:
    挂载
    挂载
    下载速度
    速度

    步骤 1
    访问腾讯云对象存储 COS,申请下获得如下信息
    bucket: xxx-123456789 (格式为 bucketname-appid)
    SecretId: SecretIdaaa
    SecretKey: SecretKeybbb
    region: ap-shanghai
    appid: 123456789

    步骤 2
    系统:centos7.4,其他系统也差不多,需自行调整,不赘述

    # 安装 cosfs
    wget https://github.com/tencentyun/cosfs/releases/download/v1.0.2/cosfs-1.0.2-centos6.5.x86_64.rpm
    sudo yum localinstall cosfs-1.0.2-centos7.0.x86_64.rpm
    # /etc/passwd-cosfs 中写入<your bucketname>:<your SecretId>:<your SecretKey>
    # 可能报错,可 vim 打开文件写入
    sudo echo xxx:SecretIdaaa:SecretKeybbb > /etc/passwd-cosfs
    # 创建挂载路径
    mkdir /tmp/cosfs
    # 挂载,地区若不是上海请自行调整
    sudo /usr/local/bin/cosfs 123456789:xxx /tmp/cosfs -ourl=http://cos.ap-shanghai.myqcloud.com -odbglevel=info -oallow_other 
    

    enjoy !!!

    参考: https://github.com/tencentyun/cosfs
    注意: 对象存在目前限制 50G, 月流量 10G,悠着点

    第 1 条附言  ·  2018 年 3 月 8 日

    挂载
    挂载

    速度
    速度

    第 2 条附言  ·  2018 年 3 月 10 日
    line 2 centos7.0.x86_64.rpm -> centos6.5.x86_64.rpm
    第 3 条附言  ·  2018 年 3 月 10 日

    纠正:

    wget https://github.com/tencentyun/cosfs/releases/download/v1.0.2/cosfs-1.0.2-centos6.5.x86_64.rpm
    # 修改为
    wget https://github.com/tencentyun/cosfs/releases/download/v1.0.2/cosfs-1.0.2-centos7.0.x86_64.rpm
    
    10 条回复    2018-03-10 20:36:03 +08:00
    tonyallen
        1
    tonyallen  
       2018 年 3 月 7 日
    试了下效果还不错,20mb/s+,另外你的图裂了
    steveway
        2
    steveway  
       2018 年 3 月 7 日
    这容量好像干不了什么啊
    Tink
        3
    Tink  
    PRO
       2018 年 3 月 8 日 via iPhone
    并没有啥用啊
    einverne
        4
    einverne  
       2018 年 3 月 8 日 via iPhone
    流量太少
    taijia
        5
    taijia  
    OP
       2018 年 3 月 8 日
    @steveway @Tink 当个玩具,临时用用够了, 放放博客或者小网站的静态资源绰绰有余
    taijia
        6
    taijia  
    OP
       2018 年 3 月 8 日
    @einverne 省着点用吧
    aiso
        7
    aiso  
       2018 年 3 月 8 日
    对象存储只可以用六个月,还是跟这次撸的服务器同样长的时间?
    taijia
        8
    taijia  
    OP
       2018 年 3 月 8 日
    @aiso 长期有效,6 个月是 cdn 每个月 50G 的流量包
    obcs
        9
    obcs  
       2018 年 3 月 10 日
    1.line 2 centos7.0.x86_64.rpm -> centos6.5.x86_64.rpm
    2.line 5 挂载时 http://cos.ap-shanghai.myqcloud.com -> http://cn-east.myqcloud.com cn-east 对应华东上海地域
    建议最好还是参考 https://github.com/tencentyun/cosfs
    taijia
        10
    taijia  
    OP
       2018 年 3 月 10 日
    @obcs 多谢指正
    关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   4031 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 05:27 · PVG 13:27 · LAX 21:27 · JFK 00:27
    ♥ Do have faith in what you're doing.