Fast installation
Update: 2017-06-07 13:26:11
Ossfs allows you to mount the OSS bucket to a local file system in Linux. You can use the local file system to operate objects on OSS and share data easily.
The main function
Ossfs is built on s3FS and has all the functionality of S3FS. The main features include:
- Support for most of the POSIX file system features, including file reads and writes, directories, link operations, permissions, Uids/gids, and extended attributes
- Upload large files through the OSS multipart function.
- MD5 authentication ensures data integrity.
limitations
The functionality and performance provided by OSSFS has some limitations compared to native file systems. Specifically include:
- Random or appending writing to a file causes the entire file to be overwritten.
- Metadata operations, such as List Directory, perform poorly because they require remote access to the OSS server.
- The rename operation of a file/folder is not atomic.
- When multiple clients mount the same OSS bucket, users need to coordinate the behaviors of each client. For example, avoid multiple clients writing the same file and so on.
- Hard Link is not supported.
- Not suitable for high concurrent read/write scenarios, which can increase the load of the system.
Installation and use
Download the installation package
Linux distributions | download |
---|---|
Ubuntu 16.04 (x64) | Ossfs_1. 80.2 _ubuntu16. 04 _amd64. Deb |
Ubuntu 14.04 (x64) | Ossfs_1. 80.2 _ubuntu14. 04 _amd64. Deb |
CentOS 7.0 (x64) | Ossfs_1. 80.2 _centos7. 0 _x86_64. RPM |
CentOS 6.5 (x64) | Ossfs_1. 80.2 _centos6. 5 _x86_64. RPM |
Installation method
- For Ubuntu, the installation command is:
sudo apt-get update
sudo apt-get install gdebi-core
sudo gdebi your_ossfs_package
Copy the code
- For CentOS6.5 and above, the installation commands are:
sudo yum localinstall your_ossfs_package
Copy the code
- For CentOS5, the installation command is:
sudo yum localinstall your_ossfs_package --nogpgcheck
Copy the code
Method of use
Set bucket name and AccessKeyId/Secret and store them in the /etc/passwd-ossfs file. The permission of the file must be set correctly. You are advised to set this file to 640.
echo my-bucket:my-access-key-id:my-access-key-secret > /etc/passwd-ossfs
chmod 640 /etc/passwd-ossfs
Copy the code
Mount the OSS bucket to the specified directory.
ossfs my-bucket my-mount-point -ourl=my-oss-endpoint
Copy the code
The sample
Mount the bucket to the directory/TMP /ossfs. AccessKeyId faint AccessKeySecret 123. Oss the endpoint is http://oss-cn-hangzhou.aliyuncs.com
echo my-bucket:faint:123 > /etc/passwd-ossfs
chmod 640 /etc/passwd-ossfs
mkdir /tmp/ossfs
ossfs my-bucket /tmp/ossfs -ourl=http://oss-cn-hangzhou.aliyuncs.com
Copy the code
Uninstall the bucket:
fusermount -u /tmp/ossfs
Copy the code
For more details, please refer to: github.com/aliyun/ossf…
Version of the log
Please refer to: github.com/aliyun/ossf…