当前位置: 首页> 文旅> 艺术 > 在北京找工作有哪些招聘网站_安徽建设工程信息网安管人员查询_热狗seo外包_销售课程视频免费

在北京找工作有哪些招聘网站_安徽建设工程信息网安管人员查询_热狗seo外包_销售课程视频免费

时间:2025/7/9 5:57:42来源:https://blog.csdn.net/m0_53675514/article/details/144911529 浏览次数:0次
在北京找工作有哪些招聘网站_安徽建设工程信息网安管人员查询_热狗seo外包_销售课程视频免费

一、环境准备

1.有访问对象存储权限的AKSK

2.服务器、对象存储

二、实施步骤

sudo apt update


sudo apt install s3fs


echo "AK:SK" >/home/ubuntu/.passwd-s3fs ---位置自定义
chmod 600 /home/ubuntu/.passwd-s3fs  ---权限必须要有
mkdir /data
sudo s3fs yyy1 /data -o passwd_file=/home/ubuntu/.passwd-s3fs -o url=http://s3.cn-northwest-1.amazonaws.com.cn -o allow_other -o endpoint=cn-northwest-1

allow_other  --其他用户也能看到  如只想让root看或者挂载用户看就不加

vi /usr/local/bin/mount-s3.sh
准备启动脚本

#!/bin/bash

# 定义变量
BUCKET_NAME="yyy1"
MOUNT_POINT="/data"
PASSWD_FILE="/home/ubuntu/.passwd-s3fs"
REGION="cn-northwest-1"
URL="http://s3.cn-northwest-1.amazonaws.com.cn"

# 检查挂载点是否存在,不存在则创建
if [ ! -d "$MOUNT_POINT" ]; then
    mkdir -p "$MOUNT_POINT"
fi

# 尝试挂载S3存储桶
s3fs "$BUCKET_NAME" "$MOUNT_POINT" -o passwd_file="$PASSWD_FILE" -o url="$URL" -o allow_other -o endpoint="$REGION"
# 检查挂载是否成功
if mount | grep -q "s3fs on $MOUNT_POINT"; then
    echo "S3 bucket $BUCKET_NAME mounted successfully on $MOUNT_POINT"
else
    echo "Failed to mount S3 bucket $BUCKET_NAME on $MOUNT_POINT"
    exit 1
fi

sudo chmod +x /usr/local/bin/mount-s3.sh

加权限

vi /etc/systemd/system/mount-s3.service

[Unit]
Description=Mount S3 bucket on /data
After=network.target
Requires=network.target

[Service]
Type=oneshot
ExecStart=/usr/local/bin/mount-s3.sh
RemainAfterExit=true

[Install]
WantedBy=multi-user.target

sudo systemctl enable mount-s3.service

sudo systemctl start mount-s3.service

三、测试验证

reboot测试一下 重启机器是否会成功挂载

测试验证成功

关闭的话:

sudo systemctl disable mount-s3.service

sudo systemctl stop mount-s3.service

在reboot 一下

关键字:在北京找工作有哪些招聘网站_安徽建设工程信息网安管人员查询_热狗seo外包_销售课程视频免费

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: