如何操作云主机成功挂载对象存储服务?
- 内容介绍
- 文章标签
- 相关推荐
本文共计2208个文字,预计阅读时间需要9分钟。
@+ 目录+ 前言+ 一、Rclone是什么?+ 二、操作步骤+ 1. 下载和安装+ 2. 配置对象存储数据源+ 3. 挂载到操作系统+ 3.1. 挂载到Windows操作系统+ 3.2. 挂载到Linux操作系统+ 注意事项+ 前言+ 随着云计算的发展,Rclone应运而生。
@
目录- 前言
- 一、RCLONE是什么?
- 二、操作步骤
- 1.下载和安装
- 2.配置对象存储数据源
- 3.挂载到操作系统
- 3.1.挂载到windows操作系统
- 3.2.挂载到linux操作系统
- 注意事项
前言
随着云计算的发展,公有云成为中小型企业建设业务系统的首选,而对象存储则是存储里面必不可少的存储产品,对象存储不仅可以提供海量、高可靠、安全的服务,而且价格相对普通存储来说会便宜很多,并且不受带宽的限制,仅限于本地下载和上传的网速,对象存储应用场景更适用于静态网站托管、多媒体存储、数据备份等等应用场景;对象存储使用相对来说是比较简单的我这里就不重点说了;
为什么会有云主机挂载对象存储的需求呢?这个还要来源于业务系统的要求,正常来说对象存储基本上都提供S3的一个接口提供上传下载,更是各大云厂商都提供S3的工具,华为云的OBS Browser+以及移动云的S3 Browser等等,不过这些工具无法实现自动化的操作,你想自动化操作有两种方式一种是直接程序调用对象存储的S3接口,另一个方法就说直接将对象存储挂载为本地文件夹或映射为磁盘的方式进行操作,接下来我要说的就是如何将对象存储挂载到云主机,这次采用的是RCLONE这个管理工具,下面使用linux系统进行演示,windows其实和linux操作步骤几乎一致,不过参数可能多少有点不一样,后面也把windows的简单教程放到了最后。
一、RCLONE是什么?
Rclone是一款免费的云存储管理工具,能够像使用本地文件一样便捷的使用云存储,被誉为“云存储界的瑞士军刀”。
您可以使用Rclone工具,对对象存储进行数据导入、数据同步、迁移备份或者挂载等操作。
通过使用Rclone,您可以轻松的完成以下工作:
下载链接:download.csdn.net/download/KH_FC/85448323
2.配置对象存储数据源windows打开CMD程序执行窗口,输入rclone config命令执行
linux系统直接输入rclone config命令执行
执行后屏幕将显示如下的配置向导菜单,如果已有配置编辑输入“e”,如无配置新建配置输入“n”即可;我这里新建配置
No remotes found - make a new one
n) New remote
s) Set configuration password
q) Quit config
n/s/q> n
输入自定义的连接配置的别名后回车,此处以”test“为例:
name> EOS
选择存储类型,输入”s3“后回车:
Option Storage.
Type of storage to configure.
Choose a number from below, or type in your own value.
1 / 1Fichier
\ (fichier)
2 / Akamai NetStorage
\ (netstorage)
3 / Alias for an existing remote
\ (alias)
4 / Amazon Drive
\ (amazon cloud drive)
5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, ChinaMobile, Digital Ocean, Dreamhost, IBM COS, Lyve Cloud, Minio, RackCorp, SeaweedFS, and Tencent COS
\ (s3)
6 / Backblaze B2
\ (b2)
7 / Better checksums for other remotes
\ (hasher)
8 / Box
\ (box)
9 / Cache a remote
\ (cache)
10 / Citrix Sharefile
\ (sharefile)
11 / Compress a remote
\ (compress)
12 / Dropbox
\ (dropbox)
13 / Encrypt/Decrypt a remote
\ (crypt)
14 / Enterprise File Fabric
\ (filefabric)
15 / FTP Connection
\ (ftp)
16 / Google Cloud Storage (this is not Google Drive)
\ (google cloud storage)
17 / Google Drive
\ (drive)
18 / Google Photos
\ (google photos)
19 / Hadoop distributed file system
\ (hdfs)
20 / Hubic
\ (hubic)
21 / In memory object storage system.
\ (memory)
22 / Jottacloud
\ (jottacloud)
23 / Koofr, Digi Storage and other Koofr-compatible storage providers
\ (koofr)
24 / Local Disk
\ (local)
25 / Mail.ru Cloud
\ (mailru)
26 / Mega
\ (mega)
27 / Microsoft Azure Blob Storage
\ (azureblob)
28 / Microsoft OneDrive
\ (onedrive)
29 / OpenDrive
\ (opendrive)
30 / OpenStack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
\ (swift)
31 / Pcloud
\ (pcloud)
32 / Put.io
\ (putio)
33 / QingCloud Object Storage
\ (qingstor)
34 / SSH/SFTP Connection
\ (sftp)
35 / Sia Decentralized Cloud
\ (sia)
36 / Storj Decentralized Cloud Storage
\ (storj)
37 / Sugarsync
\ (sugarsync)
38 / Transparently chunk/split large files
\ (chunker)
39 / Union merges the contents of several upstream fs
\ (union)
40 / Uptobox
\ (uptobox)
41 / Webdav
\ (webdav)
42 / Yandex Disk
\ (yandex)
43 / Zoho
\ (zoho)
44 / docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
Note that this ACL is applied when server-side copying objects as S3
doesn't copy the ACL from the source but rather writes a fresh one.
Choose a number from below, or type in your own value.
Press Enter to leave empty.
/ Owner gets FULL_CONTROL.
1 | No one else has access rights (default).
\ (private)
/ Owner gets FULL_CONTROL.
2 | The AllUsers group gets READ access.
\ (public-read)
/ Owner gets FULL_CONTROL.
3 | The AllUsers group gets READ and WRITE access.
| Granting this on a bucket is generally not recommended.
\ (public-read-write)
/ Owner gets FULL_CONTROL.
4 | The AuthenticatedUsers group gets READ access.
\ (authenticated-read)
acl> public-read-write
选择服务端加密方式,不使用该功能时直接回车:
Option server_side_encryption.
The server-side encryption algorithm used when storing this object in S3.
Choose a number from below, or type in your own value.
Press Enter to leave empty.
1 / None
\ ()
2 / AES256
\ (AES256)
server_side_encryption>
选择上传对象的默认存储类型,不选择时默认使用桶的存储类型:
Option storage_class.
The storage class to use when storing new objects in ChinaMobile.
Choose a number from below, or type in your own value.
Press Enter to leave empty.
1 / Default
\ ()
2 / Standard storage class
\ (STANDARD)
3 / Archive storage mode
\ (GLACIER)
4 / Infrequent access storage mode
\ (STANDARD_IA)
storage_class>
选择是否设置进阶配置,这里不设置,直接回车:
Edit advanced config?
y) Yes
n) No (default)
y/n>
确认刚才配置的连接信息,确认无误后输入”y“后回车,保存配置:
--------------------
[EOS]
type = s3
provider = ChinaMobile
access_key_id = AccessID
secret_access_key = AccessSecretKey
endpoint = eos-wuxi-1.cmecloud.cn
location_constraint = wuxi1
acl = private
--------------------
y) Yes this is OK (default)
e) Edit this remote
d) Delete this remote
y/e/d> y
此时回到了配置向导的初始菜单,刚才的配置会显示出来,可继续执行创建新的配置(输入“n”)、编辑已有的配置(输入“e”)、删除配置(输入“d”)等操作,或者完成配置向导退出(输入“q”):
Current remotes:
Name Type
==== ====
EOS s3
e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q>
到这里配置文件配置已经完成了。
3.挂载到操作系统 3.1.挂载到windows操作系统
安装依赖软件:WINFSP
下载地址:ecloud.10086.cn/op-help-center/doc/article/resource/file/ced6e21813cf60f2828cfc1eb0f5993325f4da56564b5afd1fdfa244830573db
下载好后直接双运行即可,安装也是按照默认的选项走就可以的
一步步安装完成即可;
下面就是挂载对象存储了,挂载也比较简单一条命令搞定
rclone mount 配置文件名称:桶名称 挂载路径 --cache-dir 缓存路径 --vfs-cache-mode writes
输入敲回车即可,你会发现对象存储已经挂载到了你想要的挂载目录上面了,这样就可以上传下载文件了
3.2.挂载到linux操作系统安装依赖软件:FUSE
centos安装:
yum -y install fuse
ubuntu安装:
apt -y insyall fuse
等待安装完成即可,下面就是挂载对象存储了
# 创建挂载路径
mkdir -p 挂载目录
rclone mount 配置文件名称:桶名称 挂载路径 --daemon --allow-other --cache-dir 缓存路径 --vfs-cache-mode writes
执行即可
注意事项1. 需要注意缓存可能会和你上传文件的大小一样,默认缓存保存时间为1小时,如果需要设置缓存时间你可以加”--vfs-cache-max-age“参数设置缓存时间
2. 如果需要删除桶中的对象,建议从系统中删除,如果在对象存储控制台删除的话,会出现所挂载的目录中还是有这个文件的问题
CSDN地址:blog.csdn.net/KH_FC/article/details/124915989
本文共计2208个文字,预计阅读时间需要9分钟。
@+ 目录+ 前言+ 一、Rclone是什么?+ 二、操作步骤+ 1. 下载和安装+ 2. 配置对象存储数据源+ 3. 挂载到操作系统+ 3.1. 挂载到Windows操作系统+ 3.2. 挂载到Linux操作系统+ 注意事项+ 前言+ 随着云计算的发展,Rclone应运而生。
@
目录- 前言
- 一、RCLONE是什么?
- 二、操作步骤
- 1.下载和安装
- 2.配置对象存储数据源
- 3.挂载到操作系统
- 3.1.挂载到windows操作系统
- 3.2.挂载到linux操作系统
- 注意事项
前言
随着云计算的发展,公有云成为中小型企业建设业务系统的首选,而对象存储则是存储里面必不可少的存储产品,对象存储不仅可以提供海量、高可靠、安全的服务,而且价格相对普通存储来说会便宜很多,并且不受带宽的限制,仅限于本地下载和上传的网速,对象存储应用场景更适用于静态网站托管、多媒体存储、数据备份等等应用场景;对象存储使用相对来说是比较简单的我这里就不重点说了;
为什么会有云主机挂载对象存储的需求呢?这个还要来源于业务系统的要求,正常来说对象存储基本上都提供S3的一个接口提供上传下载,更是各大云厂商都提供S3的工具,华为云的OBS Browser+以及移动云的S3 Browser等等,不过这些工具无法实现自动化的操作,你想自动化操作有两种方式一种是直接程序调用对象存储的S3接口,另一个方法就说直接将对象存储挂载为本地文件夹或映射为磁盘的方式进行操作,接下来我要说的就是如何将对象存储挂载到云主机,这次采用的是RCLONE这个管理工具,下面使用linux系统进行演示,windows其实和linux操作步骤几乎一致,不过参数可能多少有点不一样,后面也把windows的简单教程放到了最后。
一、RCLONE是什么?
Rclone是一款免费的云存储管理工具,能够像使用本地文件一样便捷的使用云存储,被誉为“云存储界的瑞士军刀”。
您可以使用Rclone工具,对对象存储进行数据导入、数据同步、迁移备份或者挂载等操作。
通过使用Rclone,您可以轻松的完成以下工作:
下载链接:download.csdn.net/download/KH_FC/85448323
2.配置对象存储数据源windows打开CMD程序执行窗口,输入rclone config命令执行
linux系统直接输入rclone config命令执行
执行后屏幕将显示如下的配置向导菜单,如果已有配置编辑输入“e”,如无配置新建配置输入“n”即可;我这里新建配置
No remotes found - make a new one
n) New remote
s) Set configuration password
q) Quit config
n/s/q> n
输入自定义的连接配置的别名后回车,此处以”test“为例:
name> EOS
选择存储类型,输入”s3“后回车:
Option Storage.
Type of storage to configure.
Choose a number from below, or type in your own value.
1 / 1Fichier
\ (fichier)
2 / Akamai NetStorage
\ (netstorage)
3 / Alias for an existing remote
\ (alias)
4 / Amazon Drive
\ (amazon cloud drive)
5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, ChinaMobile, Digital Ocean, Dreamhost, IBM COS, Lyve Cloud, Minio, RackCorp, SeaweedFS, and Tencent COS
\ (s3)
6 / Backblaze B2
\ (b2)
7 / Better checksums for other remotes
\ (hasher)
8 / Box
\ (box)
9 / Cache a remote
\ (cache)
10 / Citrix Sharefile
\ (sharefile)
11 / Compress a remote
\ (compress)
12 / Dropbox
\ (dropbox)
13 / Encrypt/Decrypt a remote
\ (crypt)
14 / Enterprise File Fabric
\ (filefabric)
15 / FTP Connection
\ (ftp)
16 / Google Cloud Storage (this is not Google Drive)
\ (google cloud storage)
17 / Google Drive
\ (drive)
18 / Google Photos
\ (google photos)
19 / Hadoop distributed file system
\ (hdfs)
20 / Hubic
\ (hubic)
21 / In memory object storage system.
\ (memory)
22 / Jottacloud
\ (jottacloud)
23 / Koofr, Digi Storage and other Koofr-compatible storage providers
\ (koofr)
24 / Local Disk
\ (local)
25 / Mail.ru Cloud
\ (mailru)
26 / Mega
\ (mega)
27 / Microsoft Azure Blob Storage
\ (azureblob)
28 / Microsoft OneDrive
\ (onedrive)
29 / OpenDrive
\ (opendrive)
30 / OpenStack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
\ (swift)
31 / Pcloud
\ (pcloud)
32 / Put.io
\ (putio)
33 / QingCloud Object Storage
\ (qingstor)
34 / SSH/SFTP Connection
\ (sftp)
35 / Sia Decentralized Cloud
\ (sia)
36 / Storj Decentralized Cloud Storage
\ (storj)
37 / Sugarsync
\ (sugarsync)
38 / Transparently chunk/split large files
\ (chunker)
39 / Union merges the contents of several upstream fs
\ (union)
40 / Uptobox
\ (uptobox)
41 / Webdav
\ (webdav)
42 / Yandex Disk
\ (yandex)
43 / Zoho
\ (zoho)
44 / docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
Note that this ACL is applied when server-side copying objects as S3
doesn't copy the ACL from the source but rather writes a fresh one.
Choose a number from below, or type in your own value.
Press Enter to leave empty.
/ Owner gets FULL_CONTROL.
1 | No one else has access rights (default).
\ (private)
/ Owner gets FULL_CONTROL.
2 | The AllUsers group gets READ access.
\ (public-read)
/ Owner gets FULL_CONTROL.
3 | The AllUsers group gets READ and WRITE access.
| Granting this on a bucket is generally not recommended.
\ (public-read-write)
/ Owner gets FULL_CONTROL.
4 | The AuthenticatedUsers group gets READ access.
\ (authenticated-read)
acl> public-read-write
选择服务端加密方式,不使用该功能时直接回车:
Option server_side_encryption.
The server-side encryption algorithm used when storing this object in S3.
Choose a number from below, or type in your own value.
Press Enter to leave empty.
1 / None
\ ()
2 / AES256
\ (AES256)
server_side_encryption>
选择上传对象的默认存储类型,不选择时默认使用桶的存储类型:
Option storage_class.
The storage class to use when storing new objects in ChinaMobile.
Choose a number from below, or type in your own value.
Press Enter to leave empty.
1 / Default
\ ()
2 / Standard storage class
\ (STANDARD)
3 / Archive storage mode
\ (GLACIER)
4 / Infrequent access storage mode
\ (STANDARD_IA)
storage_class>
选择是否设置进阶配置,这里不设置,直接回车:
Edit advanced config?
y) Yes
n) No (default)
y/n>
确认刚才配置的连接信息,确认无误后输入”y“后回车,保存配置:
--------------------
[EOS]
type = s3
provider = ChinaMobile
access_key_id = AccessID
secret_access_key = AccessSecretKey
endpoint = eos-wuxi-1.cmecloud.cn
location_constraint = wuxi1
acl = private
--------------------
y) Yes this is OK (default)
e) Edit this remote
d) Delete this remote
y/e/d> y
此时回到了配置向导的初始菜单,刚才的配置会显示出来,可继续执行创建新的配置(输入“n”)、编辑已有的配置(输入“e”)、删除配置(输入“d”)等操作,或者完成配置向导退出(输入“q”):
Current remotes:
Name Type
==== ====
EOS s3
e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q>
到这里配置文件配置已经完成了。
3.挂载到操作系统 3.1.挂载到windows操作系统
安装依赖软件:WINFSP
下载地址:ecloud.10086.cn/op-help-center/doc/article/resource/file/ced6e21813cf60f2828cfc1eb0f5993325f4da56564b5afd1fdfa244830573db
下载好后直接双运行即可,安装也是按照默认的选项走就可以的
一步步安装完成即可;
下面就是挂载对象存储了,挂载也比较简单一条命令搞定
rclone mount 配置文件名称:桶名称 挂载路径 --cache-dir 缓存路径 --vfs-cache-mode writes
输入敲回车即可,你会发现对象存储已经挂载到了你想要的挂载目录上面了,这样就可以上传下载文件了
3.2.挂载到linux操作系统安装依赖软件:FUSE
centos安装:
yum -y install fuse
ubuntu安装:
apt -y insyall fuse
等待安装完成即可,下面就是挂载对象存储了
# 创建挂载路径
mkdir -p 挂载目录
rclone mount 配置文件名称:桶名称 挂载路径 --daemon --allow-other --cache-dir 缓存路径 --vfs-cache-mode writes
执行即可
注意事项1. 需要注意缓存可能会和你上传文件的大小一样,默认缓存保存时间为1小时,如果需要设置缓存时间你可以加”--vfs-cache-max-age“参数设置缓存时间
2. 如果需要删除桶中的对象,建议从系统中删除,如果在对象存储控制台删除的话,会出现所挂载的目录中还是有这个文件的问题
CSDN地址:blog.csdn.net/KH_FC/article/details/124915989

