目錄
- OSS Clients
- ossfs
OSS Clients
ossbrowser
A graphical management tool.
ossutil
A command-line tool used to manage objects and buckets.
ossfs # FUSE
A tool used to mount a bucket to a local file system.
ossfs is built based on s3fs
ossftp # Python 2.7
An FTP-based tool used to manage objects in OSS.
You can use FTP clients, such as FileZilla, WinSCP, and FlashFXP, to manage objects in OSS.
ossftp is an FTP server that receives FTP requests and performs operations on objects and directories in OSS.
ossimport # Java 7
A tool used to migrate data to OSS.
Allows you to migrate data from a third-party data source to OSS.
ossfs
Support OS
- CentOS 7, 8
- Ubuntu 14, 16, 18, 20, 22
Limits
* does not support hard links
* not suitable for scenarios that require highly concurrent read and write operations
* If a bucket is mounted to multiple clients and data is simultaneously written to the mount points,
ossfs does not guarantee consistency.
* If you do not add the mime.types file,
OSS sets Content-Type of the uploaded object to application/octet-stream by default.
* upload to a bucket may initiate two upload requests
The first request creates a 0-byte object and
the second request uploads actual data to create the object in the bucket.
安裝
apt install mime-suppor
apt install fuse
fusermount -V
ossfs
mkdir /usr/src/ossfs; cd /usr/src/ossfs
apt install gdebi-core
wget https://gosspublic.alicdn.com/ossfs/ossfs_1.91.3_ubuntu22.04_amd64.deb
gdebi ossfs_1.91.3_ubuntu22.04_amd64.deb
Config
Password
touch /etc/passwd-ossfs
chmod 640 /etc/passwd-ossfs
BUCKETNAME:AccessKeyID:Secret
Mount OSS Bucket
Syntax
ossfs <BucketName> <mountfolder> -o url=<Endpoint>
Endpoint
-ourl=oss-cn-hongkong.aliyuncs.com
-ourl=http://oss-cn-hongkong.aliyuncs.com
-ourl=https://oss-cn-hongkong.aliyuncs.com
* The default request protocol is HTTP.
Internal / Internet
Access Over Internet: oss-cn-hongkong.aliyuncs.com
Internal network: oss-cn-hongkong-internal.aliyuncs.com
(Access from ECS over the VPC)
e.g.
mkdir /mnt/oss_mount
# Mount
ossfs mytestbucket /mnt/oss_mount -o url=https://oss-cn-hongkong.aliyuncs.com
# Un-Mount
fusermount -u /tmp/ossfs
Opts(-o)
allow_other
authorizes other users to access the directory
direct_read (Default: off)
By default, ossfs uses disk storage capacity to store temporary data uploaded or downloaded.
You can specify this option to directly read data from OSS rather than from the local disk.
enable_content_md5 (Default: off)
Specifies whether to configure the CONTENT_MD5 header for the object upload.