V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
taijia
V2EX  ›  程序员

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

  •  
  •   taijia · 2018-03-07 21:01:51 +08:00 · 3534 次点击
    这是一个创建于 2240 天前的主题,其中的信息可能已经有所发展或是发生改变。

    首先恭喜各位买到 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-03-08 09:10:35 +08:00

    挂载
    挂载

    速度
    速度

    第 2 条附言  ·  2018-03-10 20:36:35 +08:00
    line 2 centos7.0.x86_64.rpm -> centos6.5.x86_64.rpm
    第 3 条附言  ·  2018-03-10 20:39:26 +08:00

    纠正:

    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-03-07 22:25:27 +08:00
    试了下效果还不错,20mb/s+,另外你的图裂了
    steveway
        2
    steveway  
       2018-03-07 23:10:10 +08:00
    这容量好像干不了什么啊
    Tink
        3
    Tink  
       2018-03-08 01:01:54 +08:00 via iPhone
    并没有啥用啊
    einverne
        4
    einverne  
       2018-03-08 07:37:28 +08:00 via iPhone
    流量太少
    taijia
        5
    taijia  
    OP
       2018-03-08 09:13:16 +08:00
    @steveway @Tink 当个玩具,临时用用够了, 放放博客或者小网站的静态资源绰绰有余
    taijia
        6
    taijia  
    OP
       2018-03-08 09:13:46 +08:00
    @einverne 省着点用吧
    aiso
        7
    aiso  
       2018-03-08 15:35:03 +08:00
    对象存储只可以用六个月,还是跟这次撸的服务器同样长的时间?
    taijia
        8
    taijia  
    OP
       2018-03-08 16:54:23 +08:00
    @aiso 长期有效,6 个月是 cdn 每个月 50G 的流量包
    obcs
        9
    obcs  
       2018-03-10 20:27:57 +08:00
    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-03-10 20:36:03 +08:00
    @obcs 多谢指正
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5660 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 03:31 · PVG 11:31 · LAX 20:31 · JFK 23:31
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.