Skip to content

Instantly share code, notes, and snippets.

@choyno
Last active May 7, 2019 07:49
Show Gist options
  • Save choyno/e6d703ed48b96d81a07ba19da00e1ef0 to your computer and use it in GitHub Desktop.
Save choyno/e6d703ed48b96d81a07ba19da00e1ef0 to your computer and use it in GitHub Desktop.
MOUNTING S3 to your Application Uploads Folder using GOOFYS
$ sudo su -
# sudo yum install golang fuse -y
# export GOPATH=/usr/local/go
# go env GOPATH
/usr/local/go
# go get github.com/kahing/goofys
# go install github.com/kahing/goofys
# vi /etc/profile
export PATH=$PATH:/usr/local/go/bin
#source /etc/profile
CREATE BUCKET
# aws s3 mb s3://yunjin-keji
Make_bucket: yunjin-keji
# aws s3 ls s3://yunjin-keji
MOUNT S3
goofys -o nonempty stm-chat-staging /home/ec2-user/huber-stm-chat/current/public/uploads/
goofys -o nonempty <bucket> <folder to mount>
MOUNT AFTER SERVER REBOOT
sudo vim /etc/fstab
/usr/local/go/bin/goofys#stm-chat-staging /home/ec2-user/huber-stm-chat/current/public/uploads/ fuse _netdev,allow_other,nonempty,--file-mode=0666,--uid=1000,--gid=1000 0 0
CHECK FSTAB SETUP
sudo mount -a
CHECK LOG FOR ERRORS
sudo vim /var/log/messages
CHECK USER ID
id -u ec2-user
CHECK GROUP USER ID
id -g ec2-user
UNMOUNT FOLDER
sudo umount -l <FOLDER NAME>
SEARCH RUNNING MOUNT GOOFYS
ps auxf |grep goofys | grep -v grep
SOURCE
https://51daiwei.net/mount-s3-using-goofys-on-amazon-linux
VAR LOG
https://qiita.com/adachi_you/items/459cbc56e83089bdc7f9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment