EFS 실습자료
1
사용자 데이터 – 선택 사항
#!/bin/bash
yum -y install httpd
systemctl enable httpd
systemctl start httpd
echo '
Hello From Your Web Server!
' > /var/www/html/index.html
2
EC2 서버 2대 – 웹서버 생성
sudo yum -y install amazon-efs-utils
mkdir /var/www/html/efs
EFS=fs-0d05af8c6f0dc3f6b
mount -t efs -o tls $EFS:/ /var/www/html/efs
echo 'Hello EFS1
' > /var/www/html/efs/index.html
curl localhost/efs/
[root@ip-10-0-4-65 ~]# df -h | grep efs
127.0.0.1:/ 8.0E 0 8.0E 0% /var/www/html/efs
3
EC2 서버 2대 – 2번째 서버
ec2-user
sudo su -
sudo yum -y install amazon-efs-utils
mkdir /var/www/html/efs
EFS=fs-0d05af8c6f0dc3f6b
mount -t efs -o tls $EFS:/ /var/www/html/efs
curl localhost/efs/
[root@ip-10-0-4-111 ~]# df -h | grep efs
127.0.0.1:/ 8.0E 0 8.0E 0% /var/www/html/efs
4
서버 1에서 생성
[root@ip-10-0-4-65 ~]# for i in {1..100}; do touch /var/www/html/efs/test.$i; done;
[root@ip-10-0-4-65 ~]#
서버2에서 확인
[root@ip-10-0-4-111 ~]# cd /var/www/html/efs/
[root@ip-10-0-4-111 efs]# ls
index.html test.13 test.19 test.24 test.3 test.35 test.40 test.46 test.51 test.57 test.62 test.68 test.73 test.79 test.84 test.9 test.95
test.1 test.14 test.2 test.25 test.30 test.36 test.41 test.47 test.52 test.58 test.63 test.69 test.74 test.8 test.85 test.90 test.96
test.10 test.15 test.20 test.26 test.31 test.37 test.42 test.48 test.53 test.59 test.64 test.7 test.75 test.80 test.86 test.91 test.97
test.100 test.16 test.21 test.27 test.32 test.38 test.43 test.49 test.54 test.6 test.65 test.70 test.76 test.81 test.87 test.92 test.98
test.11 test.17 test.22 test.28 test.33 test.39 test.44 test.5 test.55 test.60 test.66 test.71 test.77 test.82 test.88 test.93 test.99
test.12 test.18 test.23 test.29 test.34 test.4 test.45 test.50 test.56 test.61 test.67 test.72 test.78 test.83 test.89 test.94
[root@ip-10-0-4-111 efs]#