본문 바로가기
Cloud/AWS

[2021.07.21~22] 인턴 +142 How to mount(access) AWS S3 from EC2?

by injekim97 2021. 7. 22.
반응형

[2021.07.21~22] 인턴 +142   How to mount(access) AWS S3 from EC2?

 

 

 

해당 게시글은 AWS EC2(가상 머신 리눅스 서버) 에서 AWS S3에 접근하는 방법에 대해 알아보자.

수 많은 에러가 발생하였다. (다 해결 완료, 에러는 초록색으로 표시)

 

 

 

 

 

 

 

ubuntu@ip-172-31-9-174:~$ sudo apt-get install build-essential git libfuse-dev libcurl4-openssl-dev libxml2-dev mime-support automake libtool

위의 명령어 수행 시 에러 발생 1

E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.





ubuntu@ip-172-31-9-174:~$ sudo dpkg --configure -a


위의 명령어 수행 시 에러 발생 2

dpkg: error: failed to write status database record about 'fonts-ubuntu-console' to '/var/lib/dpkg/status': No space left on device

 

 

---------------------------------------------------------------------------------------------------------------------------
해결 방법
ubuntu@ip-172-31-9-174:~$ sudo apt-get clean; sudo apt-get autoclean





ubuntu@ip-172-31-9-174:~$ sudo dpkg --configure -a

dpkg: dependency problems prevent configuration of gcc:
 gcc depends on gcc-9 (>= 9.3.0-3~); however:
  Package gcc-9 is not installed.

dpkg: error processing package gcc (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of g++:
 g++ depends on gcc (= 4:9.3.0-1ubuntu2); however:
  Package gcc is not configured yet.
 g++ depends on g++-9 (>= 9.3.0-3~); however:
  Package g++-9 is not installed.
 g++ depends on gcc-9 (>= 9.3.0-3~); however:
  Package gcc-9 is not installed.

dpkg: error processing package g++ (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of cpp:
 cpp depends on cpp-9 (>= 9.3.0-3~); however:
  Package cpp-9 is not installed.

dpkg: error processing package cpp (--configure):
 dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
Errors were encountered while processing:
 gcc
 g++
 cpp










ubuntu@ip-172-31-9-174:~$ sudo apt-get install build-essential git libfuse-dev libcurl4-openssl-dev libxml2-dev mime-support automake libtool

Reading package lists... Done
Building dependency tree
Reading state information... Done
automake is already the newest version (1:1.16.1-4ubuntu6).
mime-support is already the newest version (3.64ubuntu1).
git is already the newest version (1:2.25.1-1ubuntu3.1).
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 build-essential : Depends: libc6-dev but it is not going to be installed or
                            libc-dev
                   Depends: make
                   Depends: dpkg-dev (>= 1.17.11) but it is not going to be installed
 cpp : Depends: cpp-9 (>= 9.3.0-3~) but it is not going to be installed
 g++ : Depends: g++-9 (>= 9.3.0-3~) but it is not going to be installed
       Depends: gcc-9 (>= 9.3.0-3~) but it is not going to be installed
 gcc : Depends: gcc-9 (>= 9.3.0-3~) but it is not going to be installed
       Recommends: libc6-dev but it is not going to be installed or
                   libc-dev
 libfuse-dev : Depends: libselinux-dev
 libtool : Depends: libc6-dev but it is not going to be installed or
                    libc-dev
           Recommends: libltdl-dev but it is not going to be installed
 libxml2-dev : Depends: libicu-dev but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

 

 

 

 


해결방법

sudo apt-get -o Dpkg::Options::="--force-overwrite" install --fix-broken

 

 


ubuntu@ip-172-31-9-174:~$ sudo apt-get -o Dpkg::Options::="--force-overwrite" install --fix-broken

Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  g++ g++-9 gcc gcc-9 libasan5 libatomic1 libc-dev-bin libc6-dev libcc1-0 libcrypt-dev libgcc-9-dev libgomp1 libitm1 liblsan0
  libquadmath0 libstdc++-9-dev libtsan0 libubsan1 linux-libc-dev
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  cpp-9 g++-9 gcc-9 libc6-dev libgcc-9-dev liblsan0 libstdc++-9-dev libtsan0 libubsan1 linux-libc-dev
Suggested packages:
  gcc-9-locales g++-9-multilib gcc-9-doc gcc-9-multilib glibc-doc manpages-dev libstdc++-9-doc
The following NEW packages will be installed:
  cpp-9 g++-9 gcc-9 libc6-dev libgcc-9-dev liblsan0 libstdc++-9-dev libtsan0 libubsan1 linux-libc-dev
0 upgraded, 10 newly installed, 0 to remove and 17 not upgraded.
3 not fully installed or removed.
Need to get 35.5 MB of archives.
After this operation, 159 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ap-northeast-2.ec2.archive.ubuntu.com/ubuntu focal-updates/main amd64 cpp-9 amd64 9.3.0-17ubuntu1~20.04 [7494 kB]
Get:2 http://ap-northeast-2.ec2.archive.ubuntu.com/ubuntu focal-updates/main amd64 liblsan0 amd64 10.3.0-1ubuntu1~20.04 [835 kB]
Get:3 http://ap-northeast-2.ec2.archive.ubuntu.com/ubuntu focal-updates/main amd64 libtsan0 amd64 10.3.0-1ubuntu1~20.04 [2009 kB]
Get:4 http://ap-northeast-2.ec2.archive.ubuntu.com/ubuntu focal-updates/main amd64 libubsan1 amd64 10.3.0-1ubuntu1~20.04 [784 kB]
Get:5 http://ap-northeast-2.ec2.archive.ubuntu.com/ubuntu focal-updates/main amd64 libgcc-9-dev amd64 9.3.0-17ubuntu1~20.04 [2360 kB]
Get:6 http://ap-northeast-2.ec2.archive.ubuntu.com/ubuntu focal-updates/main amd64 gcc-9 amd64 9.3.0-17ubuntu1~20.04 [8241 kB]
Get:7 http://ap-northeast-2.ec2.archive.ubuntu.com/ubuntu focal-updates/main amd64 linux-libc-dev amd64 5.4.0-80.90 [1129 kB]
Get:8 http://ap-northeast-2.ec2.archive.ubuntu.com/ubuntu focal-updates/main amd64 libc6-dev amd64 2.31-0ubuntu9.2 [2520 kB]
Get:9 http://ap-northeast-2.ec2.archive.ubuntu.com/ubuntu focal-updates/main amd64 libstdc++-9-dev amd64 9.3.0-17ubuntu1~20.04 [1714 kB]
Get:10 http://ap-northeast-2.ec2.archive.ubuntu.com/ubuntu focal-updates/main amd64 g++-9 amd64 9.3.0-17ubuntu1~20.04 [8405 kB]
Fetched 35.5 MB in 0s (77.8 MB/s)
(Reading database ... 206444 files and directories currently installed.)
Preparing to unpack .../0-cpp-9_9.3.0-17ubuntu1~20.04_amd64.deb ...
Unpacking cpp-9 (9.3.0-17ubuntu1~20.04) ...
Preparing to unpack .../1-liblsan0_10.3.0-1ubuntu1~20.04_amd64.deb ...
Unpacking liblsan0:amd64 (10.3.0-1ubuntu1~20.04) ...
Preparing to unpack .../2-libtsan0_10.3.0-1ubuntu1~20.04_amd64.deb ...
Unpacking libtsan0:amd64 (10.3.0-1ubuntu1~20.04) ...
Preparing to unpack .../3-libubsan1_10.3.0-1ubuntu1~20.04_amd64.deb ...
Unpacking libubsan1:amd64 (10.3.0-1ubuntu1~20.04) ...
Preparing to unpack .../4-libgcc-9-dev_9.3.0-17ubuntu1~20.04_amd64.deb ...
Unpacking libgcc-9-dev:amd64 (9.3.0-17ubuntu1~20.04) ...
Preparing to unpack .../5-gcc-9_9.3.0-17ubuntu1~20.04_amd64.deb ...
Unpacking gcc-9 (9.3.0-17ubuntu1~20.04) ...
Preparing to unpack .../6-linux-libc-dev_5.4.0-80.90_amd64.deb ...
Unpacking linux-libc-dev:amd64 (5.4.0-80.90) ...
Preparing to unpack .../7-libc6-dev_2.31-0ubuntu9.2_amd64.deb ...
Unpacking libc6-dev:amd64 (2.31-0ubuntu9.2) ...
Preparing to unpack .../8-libstdc++-9-dev_9.3.0-17ubuntu1~20.04_amd64.deb ...
Unpacking libstdc++-9-dev:amd64 (9.3.0-17ubuntu1~20.04) ...
Preparing to unpack .../9-g++-9_9.3.0-17ubuntu1~20.04_amd64.deb ...
Unpacking g++-9 (9.3.0-17ubuntu1~20.04) ...
Setting up linux-libc-dev:amd64 (5.4.0-80.90) ...
Setting up libubsan1:amd64 (10.3.0-1ubuntu1~20.04) ...
Setting up cpp-9 (9.3.0-17ubuntu1~20.04) ...
Setting up libc6-dev:amd64 (2.31-0ubuntu9.2) ...
Setting up liblsan0:amd64 (10.3.0-1ubuntu1~20.04) ...
Setting up libtsan0:amd64 (10.3.0-1ubuntu1~20.04) ...
Setting up libgcc-9-dev:amd64 (9.3.0-17ubuntu1~20.04) ...
Setting up cpp (4:9.3.0-1ubuntu2) ...
Setting up gcc-9 (9.3.0-17ubuntu1~20.04) ...
Setting up libstdc++-9-dev:amd64 (9.3.0-17ubuntu1~20.04) ...
Setting up gcc (4:9.3.0-1ubuntu2) ...
Setting up g++-9 (9.3.0-17ubuntu1~20.04) ...
Setting up g++ (4:9.3.0-1ubuntu2) ...
update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...





---------------------------------위의 과정을 다 한뒤 제대로 설치됨---------------------------------


★★★★★ S3FS 설치 ★★★★★
# 컴파일 관련 패키지 설치

sudo apt-get install build-essential git libfuse-dev libcurl4-openssl-dev libxml2-dev mime-support automake libtool
sudo apt-get install pkg-config libssl-dev

 

 



ubuntu@ip-172-31-9-174:~$ sudo apt-get install build-essential git libfuse-dev libcurl4-openssl-dev libxml2-dev mime-support automake libtool

Reading package lists... Done
Building dependency tree
Reading state information... Done
automake is already the newest version (1:1.16.1-4ubuntu6).
mime-support is already the newest version (3.64ubuntu1).
git is already the newest version (1:2.25.1-1ubuntu3.1).
The following additional packages will be installed:
  dpkg-dev fakeroot icu-devtools libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libdpkg-perl libfakeroot
  libfile-fcntllock-perl libicu-dev libltdl-dev libpcre2-16-0 libpcre2-32-0 libpcre2-dev libpcre2-posix2 libselinux1-dev
  libsepol1-dev make
Suggested packages:
  debian-keyring libcurl4-doc libidn11-dev libkrb5-dev libldap2-dev librtmp-dev libssh2-1-dev libssl-dev pkg-config zlib1g-dev bzr
  icu-doc libtool-doc gfortran | fortran95-compiler gcj-jdk make-doc
The following NEW packages will be installed:
  build-essential dpkg-dev fakeroot icu-devtools libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl
  libcurl4-openssl-dev libdpkg-perl libfakeroot libfile-fcntllock-perl libfuse-dev libicu-dev libltdl-dev libpcre2-16-0
  libpcre2-32-0 libpcre2-dev libpcre2-posix2 libselinux1-dev libsepol1-dev libtool libxml2-dev make
0 upgraded, 23 newly installed, 0 to remove and 17 not upgraded.
Need to get 13.9 MB of archives.
After this operation, 64.9 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ap-northeast-2.ec2.archive.ubuntu.com/ubuntu focal/main amd64 make amd64 4.2.1-1.2 [162 kB]
Get:2 http://ap-northeast-2.ec2.archive.ubuntu.com/ubuntu focal/main amd64 libdpkg-perl all 1.19.7ubuntu3 [230 kB]
Get:3 http://ap-northeast-2.ec2.archive.ubuntu.com/ubuntu focal/main amd64 dpkg-dev all 1.19.7ubuntu3 [679 kB]
Get:4 http://ap-northeast-2.ec2.archive.ubuntu.com/ubuntu focal-updates/main amd64 build-essential amd64 12.8ubuntu1.1 [4664 B]
Get:5 http://ap-northeast-2.ec2.archive.ubuntu.com/ubuntu focal/main amd64 libfakeroot amd64 1.24-1 [25.7 kB]
Get:6 http://ap-northeast-2.ec2.archive.ubuntu.com/ubuntu focal/main amd64 fakeroot amd64 1.24-1 [62.6 kB]
Get:7 http://ap-northeast-2.ec2.archive.ubuntu.com/ubuntu focal/main amd64 icu-devtools amd64 66.1-2ubuntu2 [188 kB]
Get:8 http://ap-northeast-2.ec2.archive.ubuntu.com/ubuntu focal/main amd64 libalgorithm-diff-perl all 1.19.03-2 [46.6 kB]
Get:9 http://ap-northeast-2.ec2.archive.ubuntu.com/ubuntu focal/main amd64 libalgorithm-diff-xs-perl amd64 0.04-6 [11.3 kB]
Get:10 http://ap-northeast-2.ec2.archive.ubuntu.com/ubuntu focal/main amd64 libalgorithm-merge-perl all 0.08-3 [12.0 kB]
Get:11 http://ap-northeast-2.ec2.archive.ubuntu.com/ubuntu focal-updates/main amd64 libcurl4-openssl-dev amd64 7.68.0-1ubuntu2.5 [321 kB]
Get:12 http://ap-northeast-2.ec2.archive.ubuntu.com/ubuntu focal/main amd64 libfile-fcntllock-perl amd64 0.22-3build4 [33.1 kB]
Get:13 http://ap-northeast-2.ec2.archive.ubuntu.com/ubuntu focal/main amd64 libsepol1-dev amd64 3.0-1 [325 kB]
Get:14 http://ap-northeast-2.ec2.archive.ubuntu.com/ubuntu focal/main amd64 libpcre2-16-0 amd64 10.34-7 [181 kB]
Get:15 http://ap-northeast-2.ec2.archive.ubuntu.com/ubuntu focal/main amd64 libpcre2-32-0 amd64 10.34-7 [169 kB]
Get:16 http://ap-northeast-2.ec2.archive.ubuntu.com/ubuntu focal/main amd64 libpcre2-posix2 amd64 10.34-7 [5992 B]
Get:17 http://ap-northeast-2.ec2.archive.ubuntu.com/ubuntu focal/main amd64 libpcre2-dev amd64 10.34-7 [670 kB]
Get:18 http://ap-northeast-2.ec2.archive.ubuntu.com/ubuntu focal/main amd64 libselinux1-dev amd64 3.0-1build2 [151 kB]
Get:19 http://ap-northeast-2.ec2.archive.ubuntu.com/ubuntu focal/main amd64 libfuse-dev amd64 2.9.9-3 [105 kB]
Get:20 http://ap-northeast-2.ec2.archive.ubuntu.com/ubuntu focal/main amd64 libicu-dev amd64 66.1-2ubuntu2 [9450 kB]
Get:21 http://ap-northeast-2.ec2.archive.ubuntu.com/ubuntu focal/main amd64 libltdl-dev amd64 2.4.6-14 [162 kB]
Get:22 http://ap-northeast-2.ec2.archive.ubuntu.com/ubuntu focal/main amd64 libtool all 2.4.6-14 [161 kB]
Get:23 http://ap-northeast-2.ec2.archive.ubuntu.com/ubuntu focal-updates/main amd64 libxml2-dev amd64 2.9.10+dfsg-5ubuntu0.20.04.1 [735 kB]
Fetched 13.9 MB in 2s (8136 kB/s)
(Reading database ... 209056 files and directories currently installed.)
Preparing to unpack .../00-make_4.2.1-1.2_amd64.deb ...
Unpacking make (4.2.1-1.2) ...
Selecting previously unselected package libdpkg-perl.
Preparing to unpack .../01-libdpkg-perl_1.19.7ubuntu3_all.deb ...
Unpacking libdpkg-perl (1.19.7ubuntu3) ...
Selecting previously unselected package dpkg-dev.
Preparing to unpack .../02-dpkg-dev_1.19.7ubuntu3_all.deb ...
Unpacking dpkg-dev (1.19.7ubuntu3) ...
Selecting previously unselected package build-essential.
Preparing to unpack .../03-build-essential_12.8ubuntu1.1_amd64.deb ...
Unpacking build-essential (12.8ubuntu1.1) ...
Selecting previously unselected package libfakeroot:amd64.
Preparing to unpack .../04-libfakeroot_1.24-1_amd64.deb ...
Unpacking libfakeroot:amd64 (1.24-1) ...
Selecting previously unselected package fakeroot.
Preparing to unpack .../05-fakeroot_1.24-1_amd64.deb ...
Unpacking fakeroot (1.24-1) ...
Selecting previously unselected package icu-devtools.
Preparing to unpack .../06-icu-devtools_66.1-2ubuntu2_amd64.deb ...
Unpacking icu-devtools (66.1-2ubuntu2) ...
Selecting previously unselected package libalgorithm-diff-perl.
Preparing to unpack .../07-libalgorithm-diff-perl_1.19.03-2_all.deb ...
Unpacking libalgorithm-diff-perl (1.19.03-2) ...
Selecting previously unselected package libalgorithm-diff-xs-perl.
Preparing to unpack .../08-libalgorithm-diff-xs-perl_0.04-6_amd64.deb ...
Unpacking libalgorithm-diff-xs-perl (0.04-6) ...
Selecting previously unselected package libalgorithm-merge-perl.
Preparing to unpack .../09-libalgorithm-merge-perl_0.08-3_all.deb ...
Unpacking libalgorithm-merge-perl (0.08-3) ...
Selecting previously unselected package libcurl4-openssl-dev:amd64.
Preparing to unpack .../10-libcurl4-openssl-dev_7.68.0-1ubuntu2.5_amd64.deb ...
Unpacking libcurl4-openssl-dev:amd64 (7.68.0-1ubuntu2.5) ...
Selecting previously unselected package libfile-fcntllock-perl.
Preparing to unpack .../11-libfile-fcntllock-perl_0.22-3build4_amd64.deb ...
Unpacking libfile-fcntllock-perl (0.22-3build4) ...
Selecting previously unselected package libsepol1-dev:amd64.
Preparing to unpack .../12-libsepol1-dev_3.0-1_amd64.deb ...
Unpacking libsepol1-dev:amd64 (3.0-1) ...
Selecting previously unselected package libpcre2-16-0:amd64.
Preparing to unpack .../13-libpcre2-16-0_10.34-7_amd64.deb ...
Unpacking libpcre2-16-0:amd64 (10.34-7) ...
Selecting previously unselected package libpcre2-32-0:amd64.
Preparing to unpack .../14-libpcre2-32-0_10.34-7_amd64.deb ...
Unpacking libpcre2-32-0:amd64 (10.34-7) ...
Selecting previously unselected package libpcre2-posix2:amd64.
Preparing to unpack .../15-libpcre2-posix2_10.34-7_amd64.deb ...
Unpacking libpcre2-posix2:amd64 (10.34-7) ...
Selecting previously unselected package libpcre2-dev:amd64.
Preparing to unpack .../16-libpcre2-dev_10.34-7_amd64.deb ...
Unpacking libpcre2-dev:amd64 (10.34-7) ...
Selecting previously unselected package libselinux1-dev:amd64.
Preparing to unpack .../17-libselinux1-dev_3.0-1build2_amd64.deb ...
Unpacking libselinux1-dev:amd64 (3.0-1build2) ...
Selecting previously unselected package libfuse-dev.
Preparing to unpack .../18-libfuse-dev_2.9.9-3_amd64.deb ...
Unpacking libfuse-dev (2.9.9-3) ...
Selecting previously unselected package libicu-dev:amd64.
Preparing to unpack .../19-libicu-dev_66.1-2ubuntu2_amd64.deb ...
Unpacking libicu-dev:amd64 (66.1-2ubuntu2) ...
Selecting previously unselected package libltdl-dev:amd64.
Preparing to unpack .../20-libltdl-dev_2.4.6-14_amd64.deb ...
Unpacking libltdl-dev:amd64 (2.4.6-14) ...
Selecting previously unselected package libtool.
Preparing to unpack .../21-libtool_2.4.6-14_all.deb ...
Unpacking libtool (2.4.6-14) ...
Selecting previously unselected package libxml2-dev:amd64.
Preparing to unpack .../22-libxml2-dev_2.9.10+dfsg-5ubuntu0.20.04.1_amd64.deb ...
Unpacking libxml2-dev:amd64 (2.9.10+dfsg-5ubuntu0.20.04.1) ...
Setting up libtool (2.4.6-14) ...
Setting up libfile-fcntllock-perl (0.22-3build4) ...
Setting up libalgorithm-diff-perl (1.19.03-2) ...
Setting up libsepol1-dev:amd64 (3.0-1) ...
Setting up libpcre2-16-0:amd64 (10.34-7) ...
Setting up libfakeroot:amd64 (1.24-1) ...
Setting up fakeroot (1.24-1) ...
update-alternatives: using /usr/bin/fakeroot-sysv to provide /usr/bin/fakeroot (fakeroot) in auto mode
Setting up libltdl-dev:amd64 (2.4.6-14) ...
Setting up libpcre2-32-0:amd64 (10.34-7) ...
Setting up make (4.2.1-1.2) ...
Setting up libcurl4-openssl-dev:amd64 (7.68.0-1ubuntu2.5) ...
Setting up icu-devtools (66.1-2ubuntu2) ...
Setting up libpcre2-posix2:amd64 (10.34-7) ...
Setting up libdpkg-perl (1.19.7ubuntu3) ...
Setting up libalgorithm-diff-xs-perl (0.04-6) ...
Setting up libicu-dev:amd64 (66.1-2ubuntu2) ...
Setting up libalgorithm-merge-perl (0.08-3) ...
Setting up libpcre2-dev:amd64 (10.34-7) ...
Setting up libselinux1-dev:amd64 (3.0-1build2) ...
Setting up libfuse-dev (2.9.9-3) ...
Setting up dpkg-dev (1.19.7ubuntu3) ...
Setting up libxml2-dev:amd64 (2.9.10+dfsg-5ubuntu0.20.04.1) ...
Setting up build-essential (12.8ubuntu1.1) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...






ubuntu@ip-172-31-9-174:~$ sudo apt-get install pkg-config libssl-dev

Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
  libssl-doc
The following NEW packages will be installed:
  libssl-dev pkg-config
0 upgraded, 2 newly installed, 0 to remove and 17 not upgraded.
Need to get 1628 kB of archives.
After this operation, 8200 kB of additional disk space will be used.
Get:1 http://ap-northeast-2.ec2.archive.ubuntu.com/ubuntu focal-updates/main amd64 libssl-dev amd64 1.1.1f-1ubuntu2.4 [1583 kB]
Get:2 http://ap-northeast-2.ec2.archive.ubuntu.com/ubuntu focal/main amd64 pkg-config amd64 0.29.1-0ubuntu4 [45.5 kB]
Fetched 1628 kB in 0s (42.1 MB/s)
Selecting previously unselected package libssl-dev:amd64.
(Reading database ... 210400 files and directories currently installed.)
Preparing to unpack .../libssl-dev_1.1.1f-1ubuntu2.4_amd64.deb ...
Unpacking libssl-dev:amd64 (1.1.1f-1ubuntu2.4) ...
Selecting previously unselected package pkg-config.
Preparing to unpack .../pkg-config_0.29.1-0ubuntu4_amd64.deb ...
Unpacking pkg-config (0.29.1-0ubuntu4) ...
Setting up libssl-dev:amd64 (1.1.1f-1ubuntu2.4) ...
Setting up pkg-config (0.29.1-0ubuntu4) ...
Processing triggers for man-db (2.9.1-1) ...
ubuntu@ip-172-31-9-174:~$







# 깃으로 S3FS 다운로드
git clone https://github.com/s3fs-fuse/s3fs-fuse


ubuntu@ip-172-31-9-174:~$ git clone https://github.com/s3fs-fuse/s3fs-fuse

Cloning into 's3fs-fuse'...
remote: Enumerating objects: 7685, done.
remote: Counting objects: 100% (472/472), done.
remote: Compressing objects: 100% (214/214), done.
remote: Total 7685 (delta 334), reused 352 (delta 255), pack-reused 7213
Receiving objects: 100% (7685/7685), 4.87 MiB | 9.38 MiB/s, done.
Resolving deltas: 100% (5404/5404), done.
ubuntu@ip-172-31-9-174:~$ ls
data  elk  mysql-apt-config_0.8.17-1_all.deb  mysql-connector-java_8.0.25-1ubuntu20.04_all.deb  s3fs-fuse
ubuntu@ip-172-31-9-174:~$







# S3FS 설치

cd s3fs-fuse/
./autogen.sh
./configure --prefix=/usr --with-openssl
make
sudo make install






ubuntu@ip-172-31-9-174:~/s3fs-fuse$ pwd
/home/ubuntu/s3fs-fuse

-> 이미 cd s3fs-fuse/ 명령어를 실행한 상태

 


ubuntu@ip-172-31-9-174:~/s3fs-fuse$ ./autogen.sh

--- Make commit hash file -------
--- Finished commit hash file ---
--- Start autotools -------------
configure.ac:30: installing './compile'
configure.ac:26: installing './config.guess'
configure.ac:26: installing './config.sub'
configure.ac:27: installing './install-sh'
configure.ac:27: installing './missing'
src/Makefile.am: installing './depcomp'
parallel-tests: installing './test-driver'
--- Finished autotools ----------

 

 

 


ubuntu@ip-172-31-9-174:~/s3fs-fuse$ ./configure --prefix=/usr --with-openssl

checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking whether make supports the include directive... yes (GNU style)
checking dependency style of g++... gcc3
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking sys/xattr.h usability... yes
checking sys/xattr.h presence... yes
checking for sys/xattr.h... yes
checking attr/xattr.h usability... no
checking attr/xattr.h presence... no
checking for attr/xattr.h... no
checking sys/extattr.h usability... no
checking sys/extattr.h presence... no
checking for sys/extattr.h... no
checking for fallocate... yes
checking s3fs build with nettle(GnuTLS)... no
checking s3fs build with OpenSSL... yes
checking s3fs build with GnuTLS... no
checking s3fs build with NSS... no
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for common_lib_checking... yes
checking compile s3fs with... OpenSSL
checking for DEPS... yes
checking for malloc_trim... yes
checking for library containing clock_gettime... none required
checking for clock_gettime... yes
checking pthread mutex recursive... PTHREAD_MUTEX_RECURSIVE
checking checking CURLOPT_TCP_KEEPALIVE... yes
checking checking CURLOPT_SSL_ENABLE_ALPN... yes
checking checking CURLOPT_KEEP_SENDING_ON_ERROR... yes
checking for git... yes
checking github short commit hash... 012e6dd
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating test/Makefile
config.status: creating doc/Makefile
config.status: creating config.h
config.status: executing depfiles commands






ubuntu@ip-172-31-9-174:~/s3fs-fuse$ make

make  all-recursive
make[1]: Entering directory '/home/ubuntu/s3fs-fuse'
Making all in src
make[2]: Entering directory '/home/ubuntu/s3fs-fuse/src'
g++ -DHAVE_CONFIG_H -I. -I..  -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -I/usr/include/x86_64-linux-gnu -I/usr/include/libxml2    -g -O2 -Wall -fno-exceptions -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -MT s3fs.o -MD -MP -MF .deps/s3fs.Tpo -c -o s3fs.o s3fs.cpp
mv -f .deps/s3fs.Tpo .deps/s3fs.Po
g++ -DHAVE_CONFIG_H -I. -I..  -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -I/usr/include/x86_64-linux-gnu -I/usr/include/libxml2    -g -O2 -Wall -fno-exceptions -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -MT s3fs_global.o -MD -MP -MF .deps/s3fs_global.Tpo -c -o s3fs_global.o s3fs_global.cpp
mv -f .deps/s3fs_global.Tpo .deps/s3fs_global.Po
g++ -DHAVE_CONFIG_H -I. -I..  -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -I/usr/include/x86_64-linux-gnu -I/usr/include/libxml2    -g -O2 -Wall -fno-exceptions -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -MT s3fs_help.o -MD -MP -MF .deps/s3fs_help.Tpo -c -o s3fs_help.o s3fs_help.cpp
mv -f .deps/s3fs_help.Tpo .deps/s3fs_help.Po
g++ -DHAVE_CONFIG_H -I. -I..  -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -I/usr/include/x86_64-linux-gnu -I/usr/include/libxml2    -g -O2 -Wall -fno-exceptions -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -MT s3fs_logger.o -MD -MP -MF .deps/s3fs_logger.Tpo -c -o s3fs_logger.o s3fs_logger.cpp
mv -f .deps/s3fs_logger.Tpo .deps/s3fs_logger.Po
g++ -DHAVE_CONFIG_H -I. -I..  -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -I/usr/include/x86_64-linux-gnu -I/usr/include/libxml2    -g -O2 -Wall -fno-exceptions -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -MT s3fs_xml.o -MD -MP -MF .deps/s3fs_xml.Tpo -c -o s3fs_xml.o s3fs_xml.cpp
mv -f .deps/s3fs_xml.Tpo .deps/s3fs_xml.Po
g++ -DHAVE_CONFIG_H -I. -I..  -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -I/usr/include/x86_64-linux-gnu -I/usr/include/libxml2    -g -O2 -Wall -fno-exceptions -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -MT metaheader.o -MD -MP -MF .deps/metaheader.Tpo -c -o metaheader.o metaheader.cpp
mv -f .deps/metaheader.Tpo .deps/metaheader.Po
g++ -DHAVE_CONFIG_H -I. -I..  -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -I/usr/include/x86_64-linux-gnu -I/usr/include/libxml2    -g -O2 -Wall -fno-exceptions -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -MT mpu_util.o -MD -MP -MF .deps/mpu_util.Tpo -c -o mpu_util.o mpu_util.cpp
mv -f .deps/mpu_util.Tpo .deps/mpu_util.Po
g++ -DHAVE_CONFIG_H -I. -I..  -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -I/usr/include/x86_64-linux-gnu -I/usr/include/libxml2    -g -O2 -Wall -fno-exceptions -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -MT mvnode.o -MD -MP -MF .deps/mvnode.Tpo -c -o mvnode.o mvnode.cpp
mv -f .deps/mvnode.Tpo .deps/mvnode.Po
g++ -DHAVE_CONFIG_H -I. -I..  -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -I/usr/include/x86_64-linux-gnu -I/usr/include/libxml2    -g -O2 -Wall -fno-exceptions -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -MT curl.o -MD -MP -MF .deps/curl.Tpo -c -o curl.o curl.cpp
mv -f .deps/curl.Tpo .deps/curl.Po
g++ -DHAVE_CONFIG_H -I. -I..  -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -I/usr/include/x86_64-linux-gnu -I/usr/include/libxml2    -g -O2 -Wall -fno-exceptions -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -MT curl_handlerpool.o -MD -MP -MF .deps/curl_handlerpool.Tpo -c -o curl_handlerpool.o curl_handlerpool.cpp
mv -f .deps/curl_handlerpool.Tpo .deps/curl_handlerpool.Po
g++ -DHAVE_CONFIG_H -I. -I..  -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -I/usr/include/x86_64-linux-gnu -I/usr/include/libxml2    -g -O2 -Wall -fno-exceptions -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -MT curl_multi.o -MD -MP -MF .deps/curl_multi.Tpo -c -o curl_multi.o curl_multi.cpp
mv -f .deps/curl_multi.Tpo .deps/curl_multi.Po
g++ -DHAVE_CONFIG_H -I. -I..  -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -I/usr/include/x86_64-linux-gnu -I/usr/include/libxml2    -g -O2 -Wall -fno-exceptions -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -MT curl_util.o -MD -MP -MF .deps/curl_util.Tpo -c -o curl_util.o curl_util.cpp
mv -f .deps/curl_util.Tpo .deps/curl_util.Po
g++ -DHAVE_CONFIG_H -I. -I..  -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -I/usr/include/x86_64-linux-gnu -I/usr/include/libxml2    -g -O2 -Wall -fno-exceptions -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -MT bodydata.o -MD -MP -MF .deps/bodydata.Tpo -c -o bodydata.o bodydata.cpp
mv -f .deps/bodydata.Tpo .deps/bodydata.Po
g++ -DHAVE_CONFIG_H -I. -I..  -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -I/usr/include/x86_64-linux-gnu -I/usr/include/libxml2    -g -O2 -Wall -fno-exceptions -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -MT s3objlist.o -MD -MP -MF .deps/s3objlist.Tpo -c -o s3objlist.o s3objlist.cpp
mv -f .deps/s3objlist.Tpo .deps/s3objlist.Po
g++ -DHAVE_CONFIG_H -I. -I..  -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -I/usr/include/x86_64-linux-gnu -I/usr/include/libxml2    -g -O2 -Wall -fno-exceptions -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -MT cache.o -MD -MP -MF .deps/cache.Tpo -c -o cache.o cache.cpp
mv -f .deps/cache.Tpo .deps/cache.Po
g++ -DHAVE_CONFIG_H -I. -I..  -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -I/usr/include/x86_64-linux-gnu -I/usr/include/libxml2    -g -O2 -Wall -fno-exceptions -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -MT string_util.o -MD -MP -MF .deps/string_util.Tpo -c -o string_util.o string_util.cpp
mv -f .deps/string_util.Tpo .deps/string_util.Po
g++ -DHAVE_CONFIG_H -I. -I..  -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -I/usr/include/x86_64-linux-gnu -I/usr/include/libxml2    -g -O2 -Wall -fno-exceptions -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -MT s3fs_util.o -MD -MP -MF .deps/s3fs_util.Tpo -c -o s3fs_util.o s3fs_util.cpp
mv -f .deps/s3fs_util.Tpo .deps/s3fs_util.Po
g++ -DHAVE_CONFIG_H -I. -I..  -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -I/usr/include/x86_64-linux-gnu -I/usr/include/libxml2    -g -O2 -Wall -fno-exceptions -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -MT fdcache.o -MD -MP -MF .deps/fdcache.Tpo -c -o fdcache.o fdcache.cpp
mv -f .deps/fdcache.Tpo .deps/fdcache.Po
g++ -DHAVE_CONFIG_H -I. -I..  -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -I/usr/include/x86_64-linux-gnu -I/usr/include/libxml2    -g -O2 -Wall -fno-exceptions -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -MT fdcache_entity.o -MD -MP -MF .deps/fdcache_entity.Tpo -c -o fdcache_entity.o fdcache_entity.cpp
mv -f .deps/fdcache_entity.Tpo .deps/fdcache_entity.Po
g++ -DHAVE_CONFIG_H -I. -I..  -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -I/usr/include/x86_64-linux-gnu -I/usr/include/libxml2    -g -O2 -Wall -fno-exceptions -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -MT fdcache_page.o -MD -MP -MF .deps/fdcache_page.Tpo -c -o fdcache_page.o fdcache_page.cpp
mv -f .deps/fdcache_page.Tpo .deps/fdcache_page.Po
g++ -DHAVE_CONFIG_H -I. -I..  -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -I/usr/include/x86_64-linux-gnu -I/usr/include/libxml2    -g -O2 -Wall -fno-exceptions -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -MT fdcache_stat.o -MD -MP -MF .deps/fdcache_stat.Tpo -c -o fdcache_stat.o fdcache_stat.cpp
mv -f .deps/fdcache_stat.Tpo .deps/fdcache_stat.Po
g++ -DHAVE_CONFIG_H -I. -I..  -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -I/usr/include/x86_64-linux-gnu -I/usr/include/libxml2    -g -O2 -Wall -fno-exceptions -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -MT fdcache_auto.o -MD -MP -MF .deps/fdcache_auto.Tpo -c -o fdcache_auto.o fdcache_auto.cpp
mv -f .deps/fdcache_auto.Tpo .deps/fdcache_auto.Po
g++ -DHAVE_CONFIG_H -I. -I..  -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -I/usr/include/x86_64-linux-gnu -I/usr/include/libxml2    -g -O2 -Wall -fno-exceptions -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -MT fdcache_fdinfo.o -MD -MP -MF .deps/fdcache_fdinfo.Tpo -c -o fdcache_fdinfo.o fdcache_fdinfo.cpp
mv -f .deps/fdcache_fdinfo.Tpo .deps/fdcache_fdinfo.Po
g++ -DHAVE_CONFIG_H -I. -I..  -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -I/usr/include/x86_64-linux-gnu -I/usr/include/libxml2    -g -O2 -Wall -fno-exceptions -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -MT fdcache_pseudofd.o -MD -MP -MF .deps/fdcache_pseudofd.Tpo -c -o fdcache_pseudofd.o fdcache_pseudofd.cpp
mv -f .deps/fdcache_pseudofd.Tpo .deps/fdcache_pseudofd.Po
g++ -DHAVE_CONFIG_H -I. -I..  -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -I/usr/include/x86_64-linux-gnu -I/usr/include/libxml2    -g -O2 -Wall -fno-exceptions -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -MT fdcache_untreated.o -MD -MP -MF .deps/fdcache_untreated.Tpo -c -o fdcache_untreated.o fdcache_untreated.cpp
mv -f .deps/fdcache_untreated.Tpo .deps/fdcache_untreated.Po
g++ -DHAVE_CONFIG_H -I. -I..  -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -I/usr/include/x86_64-linux-gnu -I/usr/include/libxml2    -g -O2 -Wall -fno-exceptions -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -MT addhead.o -MD -MP -MF .deps/addhead.Tpo -c -o addhead.o addhead.cpp
mv -f .deps/addhead.Tpo .deps/addhead.Po
g++ -DHAVE_CONFIG_H -I. -I..  -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -I/usr/include/x86_64-linux-gnu -I/usr/include/libxml2    -g -O2 -Wall -fno-exceptions -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -MT sighandlers.o -MD -MP -MF .deps/sighandlers.Tpo -c -o sighandlers.o sighandlers.cpp
mv -f .deps/sighandlers.Tpo .deps/sighandlers.Po
g++ -DHAVE_CONFIG_H -I. -I..  -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -I/usr/include/x86_64-linux-gnu -I/usr/include/libxml2    -g -O2 -Wall -fno-exceptions -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -MT autolock.o -MD -MP -MF .deps/autolock.Tpo -c -o autolock.o autolock.cpp
mv -f .deps/autolock.Tpo .deps/autolock.Po
g++ -DHAVE_CONFIG_H -I. -I..  -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -I/usr/include/x86_64-linux-gnu -I/usr/include/libxml2    -g -O2 -Wall -fno-exceptions -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -MT common_auth.o -MD -MP -MF .deps/common_auth.Tpo -c -o common_auth.o common_auth.cpp
mv -f .deps/common_auth.Tpo .deps/common_auth.Po
g++ -DHAVE_CONFIG_H -I. -I..  -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -I/usr/include/x86_64-linux-gnu -I/usr/include/libxml2    -g -O2 -Wall -fno-exceptions -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -MT openssl_auth.o -MD -MP -MF .deps/openssl_auth.Tpo -c -o openssl_auth.o openssl_auth.cpp
mv -f .deps/openssl_auth.Tpo .deps/openssl_auth.Po
g++  -g -O2 -Wall -fno-exceptions -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2   -o s3fs s3fs.o s3fs_global.o s3fs_help.o s3fs_logger.o s3fs_xml.o metaheader.o mpu_util.o mvnode.o curl.o curl_handlerpool.o curl_multi.o curl_util.o bodydata.o s3objlist.o cache.o string_util.o s3fs_util.o fdcache.o fdcache_entity.o fdcache_page.o fdcache_stat.o fdcache_auto.o fdcache_fdinfo.o fdcache_pseudofd.o fdcache_untreated.o addhead.o sighandlers.o autolock.o common_auth.o openssl_auth.o   -lfuse -pthread -lcurl -lxml2 -lcrypto
g++ -DHAVE_CONFIG_H -I. -I..  -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -I/usr/include/x86_64-linux-gnu -I/usr/include/libxml2    -g -O2 -Wall -fno-exceptions -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -MT test_curl_util.o -MD -MP -MF .deps/test_curl_util.Tpo -c -o test_curl_util.o test_curl_util.cpp
mv -f .deps/test_curl_util.Tpo .deps/test_curl_util.Po
g++  -g -O2 -Wall -fno-exceptions -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2   -o test_curl_util common_auth.o curl_util.o string_util.o test_curl_util.o s3fs_global.o s3fs_logger.o openssl_auth.o   -lfuse -pthread -lcurl -lxml2 -lcrypto
g++ -DHAVE_CONFIG_H -I. -I..  -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -I/usr/include/x86_64-linux-gnu -I/usr/include/libxml2    -g -O2 -Wall -fno-exceptions -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -MT test_string_util.o -MD -MP -MF .deps/test_string_util.Tpo -c -o test_string_util.o test_string_util.cpp
mv -f .deps/test_string_util.Tpo .deps/test_string_util.Po
g++  -g -O2 -Wall -fno-exceptions -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2   -o test_string_util string_util.o test_string_util.o s3fs_logger.o
make[2]: Leaving directory '/home/ubuntu/s3fs-fuse/src'
Making all in test
make[2]: Entering directory '/home/ubuntu/s3fs-fuse/test'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/ubuntu/s3fs-fuse/test'
Making all in doc
make[2]: Entering directory '/home/ubuntu/s3fs-fuse/doc'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/ubuntu/s3fs-fuse/doc'
make[2]: Entering directory '/home/ubuntu/s3fs-fuse'
make[2]: Leaving directory '/home/ubuntu/s3fs-fuse'
make[1]: Leaving directory '/home/ubuntu/s3fs-fuse'








ubuntu@ip-172-31-9-174:~/s3fs-fuse$ sudo make install

Making install in src
make[1]: Entering directory '/home/ubuntu/s3fs-fuse/src'
make[2]: Entering directory '/home/ubuntu/s3fs-fuse/src'
 /usr/bin/mkdir -p '/usr/bin'
  /usr/bin/install -c s3fs '/usr/bin'
make[2]: Nothing to be done for 'install-data-am'.
make[2]: Leaving directory '/home/ubuntu/s3fs-fuse/src'
make[1]: Leaving directory '/home/ubuntu/s3fs-fuse/src'
Making install in test
make[1]: Entering directory '/home/ubuntu/s3fs-fuse/test'
make[2]: Entering directory '/home/ubuntu/s3fs-fuse/test'
make[2]: Nothing to be done for 'install-exec-am'.
make[2]: Nothing to be done for 'install-data-am'.
make[2]: Leaving directory '/home/ubuntu/s3fs-fuse/test'
make[1]: Leaving directory '/home/ubuntu/s3fs-fuse/test'
Making install in doc
make[1]: Entering directory '/home/ubuntu/s3fs-fuse/doc'
make[2]: Entering directory '/home/ubuntu/s3fs-fuse/doc'
make[2]: Nothing to be done for 'install-exec-am'.
 /usr/bin/mkdir -p '/usr/share/man/man1'
 /usr/bin/install -c -m 644 man/s3fs.1 '/usr/share/man/man1'
make[2]: Leaving directory '/home/ubuntu/s3fs-fuse/doc'
make[1]: Leaving directory '/home/ubuntu/s3fs-fuse/doc'
make[1]: Entering directory '/home/ubuntu/s3fs-fuse'
make[2]: Entering directory '/home/ubuntu/s3fs-fuse'
make[2]: Nothing to be done for 'install-exec-am'.
make[2]: Nothing to be done for 'install-data-am'.
make[2]: Leaving directory '/home/ubuntu/s3fs-fuse'
make[1]: Leaving directory '/home/ubuntu/s3fs-fuse'
ubuntu@ip-172-31-9-174:~/s3fs-fuse$











– S3FS 설정

# passwd-s3fs 파일 생성
sudo vi /etc/passwd-s3fs
* ACCESS KEY:SECRET ACCESS KEY 형식으로 입력을 해야 한다.

ubuntu@ip-172-31-9-174:~/s3fs-fuse$ cat /etc/passwd-s3fs
AKIAV4FRRCI65BXBR647:2VRJeUgC88H0zAZlFMwvy8paUE2BKMhIXIMu1qhQ






# 기존 644권한에서 640으로 권한 변경
sudo chmod 640 /etc/passwd-s3fs




# S3FS 환경설정 파일 열기

sudo vi /etc/fuse.conf


* 아래꺼 복붙해서 붙여 넣기
# /etc/fuse.conf - Configuration file for Filesystem in Userspace (FUSE)
# Set the maximum number of FUSE mounts allowed to non-root users.
# The default is 1000.
#mount_max = 1000
# Allow non-root users to specify the allow_other or allow_root mount options.

user_allow_other

 

 


– S3FS mount
# /usr/bin/s3fs [S3 버킷명] [마운트할 경로]
sudo mkdir /mnt/mymountpoint   --> 여기서 경로를 설정한 거 그대로 입력
sudo /usr/bin/s3fs mybucketname /mount_dir -o allow_other -o use_cache=/tmp

* allow_other는 모든 유저의 접근을 허용
* use_cache는 캐싱을 할 경로 지정



 
나의 리눅스 기준에서 실행 한 S3FS 마운트 명령어
sudo mkdir /mnt/mount_dir 
sudo /usr/bin/s3fs elk-data-storage /mnt/mount_dir -o allow_other -o use_cache=/tmp

ubuntu@ip-172-31-9-174:~/s3fs-fuse$ sudo /usr/bin/s3fs elk-data-storage /mount_dir -o allow_other -o use_cache=/tmp



 
-------------------------------------------------------------------------------------------------------------------
* 재부팅 후 자동으로 마운트하는 방법

sudo vi /etc/fstab  
 s3fs#mybucketname /mnt/mymountpoint fuse allow_other,use_cache=/tmp 0 0

 

나의 경우엔 :  s3fs#elk-data-storage /mnt/mount_dir fuse allow_other,use_cache=/tmp 0 0

여기서 한칸을 꼭 뛰어준다. (안할시, 빨간색 밑줄 에러 뜸)



 


sudo vi /etc/rc.local 명령어를 입력 

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
 
mount -a
exit 0

 

 

 

 

 

* /tmp에 저장된 캐싱 파일들을 cron을 이용하여 삭제

sudo vi /etc/crontab 명령어 입력

# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.
 
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
 
# m h dom mon dow user  command
17 *    * * *   root    cd / && run-parts --report /etc/cron.hourly
25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6    * * 7   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6    1 * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
#
@daily find /tmp -atime +7 -mtime +30 -exec rm {} \;

 

--------------------------------------------------------------------------------------------------------------------------

<출력 화면>

 

 

 

-> 마운트가 잘 되었다.

반응형

댓글