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