takada@ç¦å²¡ãªãã£ã¹ã§ãã
ããµã¼ãã¼ã¬ã¹ããæ®éã«ãµã¼ãã好ã£ãã¼ã£ããã¯ããã¨ãããã¨ã§ãAWSããAmazon Elastic File System(EFS)ã®ãããã¯ã·ã§ã³ãªãªã¼ã¹ã®ã¢ãã¦ã³ã¹ãã§ã¾ããã®ã§ã触ã£ã¦ã¿ã¾ããã
ã¢ãã¦ã³ã¹ã«ããã¨ããã2016/6/29æç¹ã§ãthe US East (Northern Virginia), US West (Oregon), and Europe (Ireland)
ã®3ã¤ã®ãªã¼ã¸ã§ã³ã®ã¿ã§å©ç¨å¯è½ã§ãã
ä»åã¯ãUS West (Oregon)ãªã¼ã¸ã§ã³ã§è©¦ãã¦ã¿ã¾ããã
EFSãä½ã£ã¦ã¿ã
US West (Oregon)ãªã¼ã¸ã§ã³ãé¸æããã¨ãã¡ãã¥ã¼ã«EFSã追å ããã¦ãã¾ãã
ã¡ãã¥ã¼ããé¸æããå¾ããCreate file systemããæ¼ä¸ããã¨ãSTEP1ã¨ãã¦ã以ä¸ã®ãããªç»é¢ã§å¿ è¦é ç®ãè¨å®ãã¾ãã
以ä¸ããã¤ã³ãã§ãã
- AZãã¨ã«1ã¤ã®mount targetï¼NFSã®ã¨ã³ããã¤ã³ãï¼ãä½æãã¾ããä½æãããµããããã¯ä»»æã§ãã
- IP addressã¯èªåå²ãå½ã¦ã«ãããã¨ããæå®ãããã¨ãã§ãã¾ãã
- mount targetãã¨ã«ã»ãã¥ãªãã£ã°ã«ã¼ããä»ä¸ãã¾ãã
次ã®ç»é¢ã«é²ã¿ã¾ãã
ã¿ã°ã®æå®ã¨ãPerformance modeãé¸æãã¾ãã
EFSããã¦ã³ãããEC2ã10å°æªæºã§ããã°ãGeneral Purposeã§ããããã§ãã
次ã®ç»é¢ã«é²ã¿ã¾ãã
å 容ã確èªãããCreate File Systemããæ¼ä¸ãã¾ãã
ä½æä¸ã®ç»é¢ã¨ãªãããã°ããããã¨ããã¡ã¤ã«ã·ã¹ãã ã®ä½æãå®äºãã¾ãã
EFSããã¦ã³ããã¦ã¿ã
ã
ä¸è¨ã®ç»é¢ã®ä¸æã«ãããEC2 mount instructionããæ¼ä¸ããã¨ããã¦ã³ãã®ä»æ¹ãè¨è¼ãããç»é¢ã表示ããã¾ãã
ä»åã¯ãCentOS7ã§è©¦ãã¦ã¿ã¾ãããæé ã¯ä»¥ä¸ã®ã¨ããã§ãã
-
nfs-utils ããã±ã¼ã¸ãã¤ã³ã¹ãã¼ã«ãã¾ãã
sudo yum install -y nfs-utils
-
ãã¦ã³ããã¤ã³ããä½æãã¾ãã
sudo mkdir /efs
-
ãã¦ã³ããã¾ãã
sudo mount -t nfs4 -o nfsvers=4.1 $(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone)."File system ID".efs.us-west-2.amazonaws.com:/ efs
3çªç®ã®ãã¦ã³ãã³ãã³ãã§ã¯ãAZåãã¡ã¿ãã¼ã¿ããåå¾ãã¦ãã¾ããFile system IDã¯ããããä½æããå¾ã«ä»ä¸ããããã®ã«èªã¿æ¿ãã¦ãã ãããã¾ããEFSã¯NFSver4ããã³v4.1ã«å¯¾å¿ãã¦ãã¾ãã®ã§ãNFSã®ãã¼ã¸ã§ã³æå®ã4.1ã«æå®ãã¦ãã¾ããã
ãã¦ã³ãå¾ã®dfã³ãã³ãã®çµæã¯ã以ä¸ã®ããã«ãªãã¾ãã
ã8.0Eãã£ã¦ã奥ãããã¨ã¯ãµãã¤ãã§ãããã®ã¬ããã©ããã¿ãã¨ã¯ãµããããã ããã©ãããããã ãã ããããã¥ã¢ã«ã«ã¯ãAmazon EFS file systems store data and metadata across multiple Availability Zones in a region and can grow to petabyte scaleãã¨ããè¨è¼ãããã¾ãã®ã§ã表示ããã¦ããã8.0Eãã¯ããã¼è¡¨ç¤ºã®å¯è½æ§ãããã¾ãããã¿ã§ããããã§ããããã
æ°¸ç¶çã«ãã¦ã³ããããããã«ã¯ã/etc/fstabã«ä»¥ä¸ã«ããã«æ¸ãã¦ããã¾ãã以ä¸ã®ä¾ã§ã¯ãæ示çã«NFSv4ãæå®ãã¦ãã¾ããããã§ãªãã¼ãå¾ãèªåçã«ãã¦ã³ãããã¾ãã
ã¾ã¨ã
ã
ä»åã¯ããããã¯ããªãªã¼ã¹ãããEFSã触ã£ã¦ã¿ã¾ããã
ããã¾ã§ã¯ãEC2ã§NFSãµã¼ããæ§ç¯ããå¯ç¨æ§ãæãããããã«ã¯ããã£ã¹ã¯ãã©ã¼ãªã³ã°ï¼ã¯ã©ã¹ã¿çã®ä»çµã¿ãå¿
è¦ã§ããããEFSãªãã3stepã§ãã«ããã¼ã¸ãã®å¤§å®¹éã®NFSãå©ç¨ãããã¨ãã§ãã¾ããæ±äº¬ãªã¼ã¸ã§ã³ã§ã®æä¾ãå¾
ã¡é ããã§ããã