OSSFS Tool mounts OSS to Aliyun Linux system catalog Example

Source: Internet
Author: User
Tags centos file permissions aliyun

Taking CentOS as an example

Download the installation package:

wget http://dl.cdn.ouu.me/VPS/ossfs/ossfs_1.79.8_centos6.5_x86_64.rpm

To run the installation package:

Yum-y Localinstall ossfs_1.79.8_centos6.5_x86_64.rpm

Write the OSS bucket name you need to mount, access key ID and access key secret, and so on, in the following format

echo Bucketname:AccesskeyID:Accesskeysecret >/etc/passwd-ossfs

Modify the file permissions

chmod 640/ETC/PASSWD-OSSFS

Mount to system directory,/oss directory as example

Mkdir/data/oss
Start mount, please modify the parameters yourself

OSSFS bucketname/data/oss-ourl=oss node Address-o Allow_other

Parameter description OSS node address in the OSS background query, into Hangzhou is http://oss-cn-hangzhou.aliyuncs.com

-O Allow_other

To allow this directory to be used for non-root accounts

Ossfs Post address: Aliyun Forum

OSSFS official Faq:gihub

PS: How to boot automatically mount Ossfs

Automatic mount by Fstab Way

Add the following command to the/etc/fstab

Ossfs#your_bucket_name your_mount_point Fuse _netdev,url=your_url,allow_other 0 0
The your_xxx information in the above command needs to be populated with information such as your bucket name.

Save the/etc/fstab file. Executes the mount-a command, and if there is no error, the setting is normal.

You also need to execute the following command:

Chkconfig Netfs on

PS: Using ECS Mount OSSFS, how to avoid the cost of scanning files due to background programs?

The program scans the OSSFS mounted directories and converts them to OSS requests, which, if requested in a large number of times, would be incurred (1 cents/10,000). If it is updatedb, you can make it skip by modifying/etc/updatedb.conf. The following measures are:

After prunefs = Add Fuse.ossfs

Add a mounted directory after prunepaths =

PS: The use of Ossfs uploaded to the OSS file Content-type is all "application/octet-stream" what is going on?

Ossfs to determine the content-type of the file by querying the contents of the/etc/mime.types, check that the file exists, and if it does not exist, you need to add:

For CentOS can be added through yum install Mailcap

You can also manually add, each format line, each line format is: Application/javascript JS

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.