After ps is mounted on oss, rsync can be used to synchronize image data, which is very convenient.
Official tutorial: https://bbs.aliyun.com/read/307212.html
Source of this article: http://www.xxorg.com/archives/4450
Wake Awake server VPS tossing a small site using Aliyun's VPS to install Linux CentOS, sadly, the minimum bandwidth, only 1M bandwidth, it is too difficult to send something from ECS, it is said that backing up the website data requires a lot of For a long time, in order to solve this problem, using Alibaba Cloud's OSS can be solved at the first cost, using ossfs to mount the OSS to the VPS local, and only need to store it in the mounted directory when backing up, which is exactly the same as the local operation, safe and convenient. You only need to pay storage fees when you go to the intranet, and no traffic fees are required. ossfs allows you to mount Alibaba Cloud's OSS buckets to the local file system in Linux systems. You can easily operate objects on the OSS through the local file system to share data.
1. Installation method
The installation package of each version of centos Download
CentOS 7.0 (x64)
http://docs-aliyun.cn-hangzhou.oss.aliyun-inc.com/assets/attach/32196/cn_zh/1481699572723/ossfs_1.80.0_centos7 .0_x86_64.rpm
CentOS 6.5 (x64)
http://docs-aliyun.cn-hangzhou.oss.aliyun-inc.com/assets/attach/32196/cn_zh/1481699605023/ossfs_1.80.0_centos6.5_x86_64.rpm
CentOS 5.11 (x64)
http://docs-aliyun.cn-hangzhou.oss.aliyun-inc.com/assets/attach/32196/cn_zh/1481699644192/ossfs_1.80.0_centos5.11_x86_64.rpm
For CentOS6.5 and above, The installation command is:
For CentOS5, the installation command is:
2. How to use Alibaba Cloud OSS
Set the bucket name and AccessKeyId/Secret information, and store them in the /etc/passwd-ossfs file. The permissions of this file must be set correctly. It is recommended to set it to 640.
chmod 640 /etc/passwd-ossfs
To mount the Alibaba Cloud OSS bucket
to the specified directory, you need to pay attention to the following ourl parameters. If the intranet domain name does not charge upload and download traffic fees, if it is an external network IP, upload and download traffic fees will not be charged, but download traffic fees will be charged.
ossfs bucket-yun /yun-ossfs -ourl=http://oss-cn-hangzhou.aliyuncs.com
Now check if there is a /yun-ossfs directory in the ECS file system. What needs to be done is like a local operation. On the surface, it is stored locally, but it is actually stored in Alibaba Cloud's OSS, even if it is a VPS. After reinstalling the system, the data stored in the Alibaba Cloud OSS will not be lost. Because the storage cost is not expensive, I will use it as backup space when I wake up. Finally, the charging standard of Alibaba Cloud OSS is attached. Although it is not the cheapest in the field of object storage on the Internet, it is also considered powerful in China, and the Chinese data is mostly
uninstalled from the bucket:
fusermount -u /yun-ossfs # non-root user
********************************************
RELATED QUESTIONS
***** ****************************************
When ps executes the ossfs mount command, the error message is as follows , process reference: http://blog.csdn.net/kane_canpower/article/details/70242160
Turn on the debug switch of the ossfs command
Check the log and find the following words, which means that the requested time is too different from the current time
try to check local time
Wed Apr 19 16:47:47 CST 2017
Sure enough, the gap is one hour, just update the synchronization time.
19 Apr 15:52:39 ntpdate[71442]: step time server 51.15.41.135 offset -3357.358058 sec
The mount is successful again, and you can directly access /yun-ossfs
Compared with the local file system, the functions and performance provided by ossfs have some limitations. Specifically, it includes:
random or additionally writing the file will cause the entire file to be rewritten.
Metadata operations, such as list directory, have poor performance because when multiple clients that need to remotely access
files/folders on the oss server are not atomic to
mount the same oss bucket, they rely on the user to coordinate the behavior of each client. For example to avoid multiple clients writing the same file and so on.
Hard links are not supported.
Not suitable for high concurrent read/write scenarios, which will increase the system load