Last update at :2024-07-08,Edit by888u
Generally, for our website storage, we directly purchase the system disk that comes with the Alibaba Cloud ECS server or purchase a mounting disk at the same time and mount it to the ECS server. For object storage OSS, most netizens may use it to store static files on the website. Similar to how we use the WPOSS plug-in to separate website images and improve the opening speed of the website. In fact, another way to use OSS object storage is to mount it to an ECS server mount disk. Some people may have too much data when migrating their website. After all, some of our netizens have 1M bandwidth, and it will take a long time to back up directly to the local area. .
We can use OSS object storage to mount it to the ECS server, then migrate the data to OSS, and then migrate the server or reset the system, install it, and then back up and restore it. Lao Zuo (LAOZUO.ORG) will take a look at how OSS object storage is mounted to the ECS server. What needs to be reminded here is that if we need to test something that we are not sure about, we should first operate in the test environment. We must pay attention to the security of server data in the production environment.
First, install necessary software support
apt-get update -y
apt-get install libcurl4-openssl-dev libssl-dev pkg-config libxml2 libxml2-dev libfuse-dev git gcc g++ make -y
Second, install OSSFS and mount it
git clone https://github.com/aliyun/ossfs.gitcd ossfs./autogen.sh./configuremakemake install
Then match the storage space and API key information:
echo my-bucket:my-access-key-id:my-access-key-secret > /etc/passwd-ossfschmod 640 /etc/passwd-ossfs
Then set the mount point:
ossfs my-bucket my-mount-point -ourl=my-oss-endpoint
Set up case demonstration:
echo my-bucket:faint:123 > /etc/passwd-ossfschmod 640 /etc/passwd-ossfsmkdir /tmp/ossfsossfs my-bucket /tmp/ossfs -ourl=http://oss-cn-hangzhou.aliyuncs .com
Cancel mounting:
umount /tmp/ossfs # root userfusermount -u /tmp/ossfs # non-root user
To summarize, in fact, if you encounter a problem, then read the actual document and solve it. Sometimes there is a setting to report an error. Reference address: https://github.com/aliyun/ossfs
Recommended site search: network server, Taiwan proxy server, cn domain name registration, vps US server, domain name registration query, online store virtual host, vps server rental, Beijing domain name registration, server abroad, foreign virtual space,
发表评论