闃块噷浜憃ss涓婁紶鏂囦欢鍙婃寕杞界‖鐩

ossutil宸ュ叿


./ossutil config -e oss.aliyuncs.com -i your_id -k your_key ./ossutil ls #鍒椾妇Buckets $./ossutil cp -r dir oss://ossutil-test #涓婁紶鏂囦欢澶 #鍩烘湰涓婃渶濂介兘鏄窇鍐呯綉 澶栫綉铏界劧涔熻姳涓嶄簡澶氬皯 浣嗚繕鏄閽

ossfs宸ュ叿

ossfs 鑳借鎮ㄥ湪Linux绯荤粺涓妸OSS bucket 鎸傝浇鍒版湰鍦版枃浠剁郴缁熶腑锛屾偍鑳藉渚挎嵎鍦伴氳繃鏈湴鏂囦欢绯荤粺鎿嶄綔OSS 涓婄殑瀵硅薄锛屽疄鐜版暟鎹殑鍏变韩銆
#浠entos6.5-7涓轰緥瀛
wget http://docs-aliyun.cn-hangzhou.oss.aliyun-inc.com/assets/attach/32196/cn_zh/1507811607579/ossfs_1.80.3_centos6.5_x86_64.rpm

yum  install ossfs_1.80.3_centos6.5_x86_64.rpm

绐佺劧鎶ヤ簡鍐茬獊鐨勯敊璇 

Transaction Check Error:
  file /sbin/mount.fuse from install of ossfs-1.80.3-1.x86_64 conflicts with file from package fuse-2.8.3-5.el6.x86_64
  file /usr/bin/fusermount from install of ossfs-1.80.3-1.x86_64 conflicts with file from package fuse-2.8.3-5.el6.x86_64
  file /usr/bin/ulockmgr_server from install of ossfs-1.80.3-1.x86_64 conflicts with file from package fuse-2.8.3-5.el6.x86_64


#灏卞厛鍗歌浇fuse
yum remove fuse
yum install ossfs_1.80.3_centos6.5_x86_64.rpm #閲嶆柊瀹夎


#璁剧疆bucket name 鍜 AccessKeyId/Secret淇℃伅锛屽皢鍏跺瓨鏀惧湪/etc/passwd-ossfs 鏂囦欢涓紝娉ㄦ剰杩欎釜鏂囦欢鐨勬潈闄愬繀椤绘纭缃紝寤鸿璁句负640銆
echo my-bucket:my-access-key-id:my-access-key-secret > /etc/passwd-ossfs
chmod 640 /etc/passwd-ossfs

#灏哋SS bucket mount鍒版寚瀹氱洰褰曘傛敞鎰忔煡鐪嬭嚜宸辩殑ECS鏄粈涔堢綉缁滅被鍨嬶紝涓嶅悓鐨勭綉缁滅被鍨嬶紝鍐呯綉閾炬帴鏄笉涓鏍风殑銆
ossfs my-bucket my-mount-point -ourl=my-oss-endpoint

寮鏈鸿嚜鍔ㄦ寕杞

vi /etc/fstab

ossfs#your_bucket_name your_mount_point fuse _netdev,url=your_url,allow_other 0 0

#cnetos鐨勮鍔犲涓鍙
chkconfig netfs on

#鍙栨秷鎸傝浇
fusermount -u your_mountpoint

All posts

Other pages

鍙戣〃璇勮

鐢靛瓙閭欢鍦板潃涓嶄細琚叕寮銆 蹇呭~椤瑰凡鐢*鏍囨敞