要将对象存储对接到 VPS,您可以按照以下步骤进行操作,通常使用 S3FS-FUSE 工具来挂载对象存储。以下是具体步骤:
步骤 1:安装 S3FS-FUSE
通过 SSH 登录到您的 VPS,并执行以下命令安装 S3FS-FUSE:
对于 Debian/Ubuntu 系统:
bashsudo apt-get update
sudo apt-get install build-essential git libfuse-dev libcurl4-openssl-dev libxml2-dev mime-support automake libtool pkg-config libssl-dev
git clone https://github.com/s3fs-fuse/s3fs-fuse
cd s3fs-fuse/
./autogen.sh
./configure --prefix=/usr --with-openssl
make
sudo make install
对于 CentOS/RHEL 系统:
bashsudo yum install gcc libstdc++-devel gcc-c++ fuse fuse-devel curl-devel libxml2-devel mailcap git automake make openssl-devel
git clone https://github.com/s3fs-fuse/s3fs-fuse
cd s3fs-fuse/
./autogen.sh
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
./configure --prefix=/usr --with-openssl
make
sudo make install
步骤 2:获取对象存储 API 信息
- 登录到您的对象存储提供商的控制面板(如 Wasabi、AWS S3 等)。
- 创建一个存储桶(Bucket),并记录下以下信息:
- 访问密钥(Access Key)
- 秘密密钥(Secret Key)
- API 端点(Endpoint)
步骤 3:创建凭据文件
在 VPS 上创建一个凭据文件以存储您的访问密钥和秘密密钥:
bashecho "your_access_key:your_secret_key" > /etc/passwd-s3fs
chmod 600 /etc/passwd-s3fs
将 your_access_key
和 your_secret_key
替换为您从对象存储提供商获取的实际值。
步骤 4:创建挂载点
创建一个目录作为挂载点,例如 /mnt/mybucket
:
bashmkdir /mnt/mybucket
步骤 5:挂载对象存储
使用 S3FS 挂载对象存储到您刚刚创建的挂载点:
bashs3fs your_bucket_name /mnt/mybucket -o passwd_file=/etc/passwd-s3fs -o url=https://your_api_endpoint -o allow_other -o use_path_request_style
将 your_bucket_name
替换为您的存储桶名称,your_api_endpoint
替换为您的 API 端点。
步骤 6:确保重启后自动挂载
要确保在系统重启后自动挂载,可以将挂载命令添加到 /etc/fstab
文件中。打开该文件并添加以下行:
texts3fs#your_bucket_name /mnt/mybucket fuse _netdev,allow_other,passwd_file=/etc/passwd-s3fs,url=https://your_api_endpoint,use_path_request_style 0 0
步骤 7:验证挂载
运行以下命令检查是否成功挂载:
bashdf -h
您应该能够看到 /mnt/mybucket
显示为已挂载的文件系统。
通过以上步骤,您可以成功将对象存储对接到您的 VPS,并像使用本地文件系统一样访问它。
Citations:
- https://www.vps911.com/vpsjc/1052.html
- https://wzfou.com/rclone-cos-fuse-ossfs/
- https://www.chz.one/2022/08/19/32-scwoss/
- https://www.vps911.com/vpsjc/1053.html
- https://blog.csdn.net/KH_FC/article/details/124915989
- https://wasabi.com
- https://www.cnblogs.com/AmazonwebService/p/17844238.html
- https://www.reddit.com/r/webhosting/comments/lzqpv3/is_wasabi_the_cheapest_object_storage/
- https://blog.csdn.net/awschina/article/details/134509866
- https://www.alibabacloud.com/tc/product/swas?_p_lc=1
- https://www.x-od.com/wasabi/
- https://www.zhihu.com/question/300550572
- https://www.vpsvsvps.com/discuss/a/1676472032247681024.html
- https://www.vpsss.net/7108.html
- https://aws.amazon.com/cn/what-is/vps/
- https://www.ywsj365.com/archives/jiang-jia-gu-wen-mian-fei-20g-dui-xiang-cun-chu-gua-zai-dao-ren-yi-vps
- https://www.hostwinds.cn/tutorials/how-to-mount-object-storage-to-a-vps-ubuntu-18-04
- https://wzfou.com/linode-object-storage/
- https://github.com/readloud/Awesome-Stars/blob/main/README.md
- https://blog.einverne.info/post/2023/02/rclone-mount-remote-storage-vps.html
- https://www.tencentcloud.com/zh/document/product/628/47386
- http://www.bilibili.com/read/cv33361756/
- https://www.vpsce.com/vps_wiki/QYqsjb.html
- https://wzfou.com/free-object-storage/
- https://zhujitips.com/1260
- https://support.huaweicloud.com/topic/135549-1-V/
- https://iweec.com/700.html
- https://uit.stanford.edu/storage/wasabi-cloud-storage
- https://zh.sharktech.net/s3/
- https://wasabi.com/solutions/cloud-computing
- https://wasabi.com/cloud-object-storage