Oss挂载到ecs上

来自ling
跳转至: 导航搜索

https://www.jianshu.com/p/0b45d25b232c

https://github.com/aliyun/ossfs?spm=a2c4g.11186623.0.0.2f1168a89HmmRQ#ossfs

ln -s /oss/ling-cloud/mediawiki/images /alidata/dockerdata/mediawiki/images

ecs

#下载rmp包
wget http://gosspublic.alicdn.com/ossfs/ossfs_1.80.6_centos7.0_x86_64.rpm
#安装
yum localinstall ossfs_1.80.6_centos7.0_x86_64.rpm
#配置账号访问信息
echo ling2-cloud:6JPMZ51Vn0bty4CH:Dpco4krKGqaX63OUdruh194tXOQCOm > /etc/passwd-ossfs
chmod 640 /etc/passwd-ossfs
#手动挂载到/data目录
mkdir -p /oss/ling-cloud
ossfs ling2-cloud /oss/ling-cloud -ourl=http://oss-cn-zhangjiakou-internal.aliyuncs.com
#取消挂载
fusermount -u /oss/ling-cloud

#创建开机启动脚本
tee /etc/init.d/ossfs <<-'EOF'

#! /bin/bash
#
# ossfs      Automount Aliyun OSS Bucket in the specified direcotry.
#
# chkconfig: 2345 90 10
# description: Activates/Deactivates ossfs configured to start at boot time.

/usr/local/bin/ossfs  ling2-cloud  /oss/ling-cloud -ourl=http://oss-cn-zhangjiakou-internal.aliyuncs.com -oallow_other
EOF

开机自动挂载目录

chmod a+x /etc/init.d/ossfs
chkconfig ossfs on

如果上述开机自动挂载目录失败的话,再添加命令到crontab

crontab -l 
@reboot /etc/init.d/ossfs

重启vm 测试一下是否自动挂了,重启后df -h 可以查看到/data 256T容量


ossfs ling2-cloud /oss/ling-cloud -ourl=http://oss-cn-zhangjiakou-internal.aliyuncs.com -o dbglevel=debug -f -d > /tmp/fs.log 2>&1
tail -f /tmp/fs.log

other

#下载rmp包
wget http://gosspublic.alicdn.com/ossfs/ossfs_1.80.6_centos7.0_x86_64.rpm
#安装
yum localinstall ossfs_1.80.6_centos7.0_x86_64.rpm
#配置账号访问信息
echo ling2-cloud:6JPMZ51Vn0bty4CH:Dpco4krKGqaX63OUdruh194tXOQCOm > /etc/passwd-ossfs
chmod 640 /etc/passwd-ossfs
#手动挂载到/data目录
mkdir -p /oss/ling-cloud
ossfs ling2-cloud /oss/ling-cloud -ourl=http://oss-cn-zhangjiakou.aliyuncs.com
#取消挂载
fusermount -u /oss/ling-cloud

#创建开机启动脚本
<source>
tee /etc/init.d/ossfs <<-'EOF'
  
#! /bin/bash
#
# ossfs      Automount Aliyun OSS Bucket in the specified direcotry.
#
# chkconfig: 2345 90 10
# description: Activates/Deactivates ossfs configured to start at boot time.

/usr/local/bin/ossfs  ling2-cloud  /oss/ling-cloud -ourl=http://oss-cn-zhangjiakou.aliyuncs.com -oallow_other

EOF

开机自动挂载目录 chmod a+x /etc/init.d/ossfs chkconfig ossfs on

如果上述开机自动挂载目录失败的话,再添加命令到crontab crontab -l @reboot /etc/init.d/ossfs

重启vm 测试一下是否自动挂了,重启后df -h 可以查看到/data 256T容量 </source>

问题解决

cannot open shared object file

wget http://rpmfind.net/linux/centos/8-stream/AppStream/x86_64/os/Packages/compat-openssl10-1.0.2o-3.el8.x86_64.rpm
yum localinstall compat-openssl10-1.0.2o-3.el8.x86_64.rpm

群晖无yum

https://blog.csdn.net/qq_37946291/article/details/108421382

wget http://ipkg.nslu2-linux.org/feeds/optware/syno-i686/cross/unstable/syno-i686-bootstrap_1.2-7_i686.xsh
chmod +x syno-i686-bootstrap_1.2-7_i686.xsh
sh syno-i686-bootstrap_1.2-7_i686.xsh 
ipkg update