收藏文章 楼主

挂载oss

版块:linux   类型:普通   作者:小绿叶技术博客   查看:474   回复:0   获赞:0   时间:2021-07-16 13:24:40
挂载 oss :https://help.aliyun.com/document_detail/134092.html?spm=5176.10695662.1996646101.searchclickresult.48b7351eHLGZEl


#-------- 安装oss环境 ---------#

wget http://gosspublic.alicdn.com/ossfs/ossfs_1.80.6_centos7.0_x86_64.rpm   # 下载安装包

sudo yum install ossfs_1.80.6_centos7.0_x86_64.rpm -y                                    # 安装包


#--------- 账号配置 ----------#

 echo BucketName:yourAccessKeyId:yourAccessKeySecret > /etc/passwd-ossfs ;  chmod 640 /etc/passwd-ossfs

                                                                                                                          # 将Bucket名称以及具有此Bucket访问权限的AccessKey ID和AccessKey Secret信息存放在 /etc/passwd-ossfs文件中。

                                                                                                                          # 注意这个文件的权限必须正确设置,建议设为640





















#------  挂载 oss ------#

OSSFS将OSS bucket 挂载到本地文件系统:https://developer.aliyun.com/article/386980


wget http://docs-aliyun.cn-hangzhou.oss.aliyun-inc.com/assets/attach/32196/cn_zh/1463121229943/ossfs_1.79.8_centos7.0_x86_64.rpm

# 下载包

yum localinstall ossfs_1.79.8_centos7.0_x86_64.rpm

# 安装包

将image这个bucket挂载到/mnt/ossfs目录下,

AccessKeyId是faint

AccessKeySecret是123

oss endpoint是http://oss-cn-hangzhou.aliyuncs.com。


# echo image:faint:123 > /etc/passwd-ossfs

# chmod 640 /etc/passwd-ossfs

# mkdir /mnt/ossfs

# ossfs image /mnt/ossfs -ourl=http://oss-cn-hangzhou.aliyuncs.com -o allow_other

卸载


开机挂载:

vi /etc/rc.d/rc.local 

ossfs image /mnt/ossfs -ourl=http://oss-cn-hangzhou.aliyuncs.com -o allow_other

提供企业建站服务,免费网防系统,提交信息登录 http://yundun.ddoss.cn 邮箱: proposal@ddoss.cn 
回复列表
默认   热门   正序   倒序

回复:挂载oss

头像

用户名:

粉丝数:

签名:

资料 关注 好友 消息