ããã«ã¡ã¯ãykiraã¨ç³ãã¾ãã
å¯ãæ¥ãå¤ããªã£ã¦ãã¾ããããçæ§ããããéããã§ããããã
ä»å¹´ãæ©ããã®ã§ãã10æããã¨3ã¶æã§1å¹´ãéãå»ããã¨ãã¦ãã¾ãã
ããããã¤ãã³ããå¤ããªããåºè²»ãªã©ãçãå£ç¯ã§ãããã¾ããã
ãããªæ¹ã®ããã«ãä»åã¯ç¡æã§ä½¿ããå人ç¨ãµã¼ããæ§ç¯ãã¦ã¿ããã¨æãã¾ãã
GCP(Google Cloud Platform)ã¨ã¯ï¼
Googleããã£ã¦ããã¯ã©ã¦ããµã¼ãã¹ã§ãã
ããããIaaSãããã§ããã¡ãªã¿ã«ãã¤ã¡ã¼ã¹ãã¨èªãã¿ãããè¨ãã«ããã§ããã
é¡ä¼¼ãµã¼ãã¹ã¨ãã¦ã¯AWS(Amazon Web Services)ãæåã§ãã
ãã ãã©ã¡ãã沢山ã®æ©è½(ãµã¼ãã¹)ãããã®ã§ãGCP=ã¯ã©ã¦ããµã¼ãã§ã¯ç¡ãã¨ãããã¨ã注æãã¦ããã¾ãããã
ä»åã¯ãç¡æã®éã¹ããµã¼ãã欲ããã ããªã®ã§GCPã®ä¸ã§ãCompute Engineã¨ãããµã¼ãã¹ã®ã¿ä½¿ãå½¢ã§ãã
AWSã ã¨Amazon EC2ã§ããã
ãªãã§ç¡æãªã®ï¼
ç±³å½æéã§ã®2017å¹´3æ9æ¥ã«ãGoogleã¯GCPã®å¸¸æç¡æããã°ã©ã ãæä¾ãã¾ããã
ããã¯ãããæ¡ä»¶ã§ããã°ãã¼ã£ã¨ç¡æã§ãµã¼ã使ããã¨ããç¥ããã°ã©ã ã§ãAWSãªã©ã«ã¯ç¡ããã®ã§ãã
ãã®æ¡ä»¶ã¨ã¯ããã
- 1ã¤ã®f1-micro VMã¤ã³ã¹ã¿ã³ã¹ (1ãæãããããã¼ã¸ãã¢å·åé¨ãé¤ãç±³å½ãªã¼ã¸ã§ã³)
- 30GBã®HDDæ°¸ç¶ãã£ã¹ã¯ã¹ãã¬ã¼ã¸ (1ãæããã)
- 5GBã®ã¹ãããã·ã§ããã¹ãã¬ã¼ã¸ (1ãæããã)
- 1GBã®åç±³ããä»ã®ãªã¼ã¸ã§ã³å®ã¦ä¸ããããã¯ã¼ã¯å©ç¨ (1ãæããããä¸å½ããã³ãªã¼ã¹ãã©ãªã¢ãé¤ã)
ã¨ãªãããã®æ¡ä»¶ç¯å²å ã§ããã°ãã¼ã£ã¨ç¡æã§ãã
f1-microã®ã¹ããã¯ã¯1ã¤ã®ä»®æ³CPUã¨0.60GBã¡ã¢ãªã¨ãªãã¾ãã®ã§ãæ¬çªç¨ãªã©ã«ã¯åãã¾ããããéã³ãå¦ç¿ç¨éã§ã¯ååã«ä½¿ããã¨æãã¾ãã
ãã¼ã¹ãæ©è½ãæä¾ããã¦ããã®ã§ãç¬éçãªè² è·ãªã©ã§ã対å¿ã§ããã®ã§ã¯ãªãã§ããããã
ãã¡ãããGoogleã®æ¹éã§ãã®ããã°ã©ã ãçµäºãã¦ãã¾ãå¯è½æ§ã¯ããã¾ãã®ã§ãä»ã®ãã¡ã«ä½¿ã£ã¦ããã¾ãããã
ã¾ãã¯GCPã®ç¡æãã©ã¤ã¢ã«ãå§ãããï¼
ã¾ãã¯ããµã¤ãã«ã¢ã¯ã»ã¹ãã¦ç¡æãã©ã¤ã¢ã«ãå§ãã¾ãããã
Googleã¢ã«ã¦ã³ãã«ãã°ã¤ã³ããå¿ è¦ãããã¾ããã¢ã«ã¦ã³ãæã£ã¦ããªã人ã¯ä½ã£ã¦ãã ããã
GCP(https://cloud.google.com/)
ç¡æãã©ã¤ã¢ã«ã®ãã¿ã³ããããã¨ãªã
ããã¨ãããªæãã®ç»é¢ã«ãªãã¾ãã
1çªä¸ã¯æ¥æ¬(ãã¶ãããã©ã§ãªã£ã¦ãã)ã§2çªç®ã¯ã好ãã«ã3çªç®ã¯å©ç¨è¦ç´ã®åæãªã®ã§ãã£ãã確èªãã¦ã¯ããé¸ã³ã¾ãããã
åæãã¦ç¶è¡ãã¿ã³ãæ¼ãã¨ããããªç»é¢ã«ã
é ç®ã«æ²¿ã£ã¦ãéµä¾¿çªå·ã»ä½æã»æ°åã»é»è©±çªå·ã»æ¯æãã¯ã¬ã¸ããã«ã¼ããå ¥åãã¾ãããã
å ¥åãçµãã£ããç¡æãã©ã¤ã¢ã«ãéå§ãã¿ã³ãã»ã³ã¿ã¼ã«å ¥ãã¦ã¯ãªãã¯ã
ããã§ã¨ããããã¾ããGCPã¸ã®ç»é²ã¯å®äºã§ãï¼
ãã¾ãã®ããã°ãæ¸ãã¦ããæç¹(2017/10/6)ã§ã¯ã300ãã«å(æ¥æ¬åã§3ä¸åã¡ãã£ã¨)ã®ç¡æã¯ã¬ã¸ãããå ¥ã£ã¦ãã¾ããã
ç»é²ãããæ¥ãã12ã¶æ以å ã§ããã°ããã®300ãã«åã¯èªç±ã«ä½¿ãã¾ãã®ã§ã試ãã«ã¹ããã¯ã®é«ããµã¼ããªã©ã§ãéãã§ã¿ã¦ãã ããã
ããã«ãã¦ã300ãã«åã使ãããªãã¦ã太ã£è ¹ã§ããã¼ï¼ããã天ä¸ã®Googleï¼
ããã¸ã§ã¯ããä½æãã¦ã¿ããï¼
ç»é²ãå®äºããã¨èªåã§ã³ã³ã½ã¼ã«ã«é·ç§»ãããã¨æãã¾ãã
ç»åä¸é¨ãã´ã®å³å´ã«php-devã¨ãªã£ã¦ããã¨ãããããã¸ã§ã¯ãã®è¡¨ç¤ºã¨ãªãã¾ãã
å®éã«ã¯æåMy First Projectã¨ãªã£ã¦ãããã¨æãã¾ãã®ã§ã好ããªååã®ããã¸ã§ã¯ããä½æãã¾ãããã
php-devãã¯ãªãã¯ããã¨ããã¸ã§ã¯ãã®ä¸è¦§ç»é¢ã«ãªãã¾ãã
æ¤ç´¢çªã®å³å´ã«ãã+ãã¯ãªãã¯ããã¨ãããã¸ã§ã¯ãä½æç»é¢ã«ãªãã¾ãã
好ããªååãå ¥åãã¦ä½æããã¨ãããã¸ã§ã¯ããæ°è¦ä½æããã¾ã(å°ãæéããããã¾ã)
ã³ã³ã½ã¼ã«ã«æ»ã£ãããä½æããããã¸ã§ã¯ãã«åãæ¿ããã®ãå¿ããªãããã«ãã¦ãã ããã
ãµã¼ããä½æãã¦ã¿ããï¼
ãã£ã¨æ¬é¡ã§ãããµã¼ããä½ãã¾ãããã
ã³ã³ã½ã¼ã«å·¦å´ã®ã¡ãã¥ã¼ããCompute Engineãã¯ãªãã¯ãã¦ãã ããã
ããã¨ããããªæãã®ç»é¢ã«é·ç§»ãã¾ãã
ä¸é¨ã®ã¡ãã¥ã¼ã«ã¤ã³ã¹ã¿ã³ã¹ã®ä½æã¨ããã®ãããã¾ãã®ã§ãããããä½æãã¾ãã
ãµã¼ã=ã¤ã³ã¹ã¿ã³ã¹ã£ã¦æã£ã¦ããã£ã¦ããã¨æãã¾ãã
ã¤ã³ã¹ã¿ã³ã¹ã®ä½æãã¯ãªãã¯ããã¨ãããªç»é¢ã«é·ç§»ãã¾ãã
é ç®ã«æ²¿ã£ã¦ããµã¼ãã®æ å ±ãå ¥åãã¦ããã¾ãã
- åå
- 好ããªååãå ¥åãã¦ãã ããã
- ã¾ã¼ã³
- us-ãã¨ãããã¤ãé¸æãã¦ãã ããã
- ãã·ã³ã¿ã¤ã
- microãé¸æãã¦ãã ããã
- ãã¼ããã£ã¹ã¯
- HDDã®å®¹éã¨OSã決ãã¾ããHDDã¯30GBã¾ã§ãOSã¯å¥½ããªãã¤ãé¸æãã¦ãã ããã
- ID 㨠API ã¸ã®ã¢ã¯ã»ã¹
- å¤æ´ããå¿ è¦ã¯ããã¾ããã
- ãã¡ã¤ã¢ã¦ã©ã¼ã«
- HTTPã»HTTPSã©ã¡ãã®ãã©ãã£ãã¯ã許å¯ãã¦ãã ããã
ãã®ç¶æ ã§ãã¤ã³ã¹ã¿ã³ã¹ã¯ä½æã§ãã¾ãããããã©ã«ãã§ã°ãã¼ãã«IPããµã¼ããåèµ·åãã度ã«å¤ãã£ã¦ãã¾ãã¨ããè¨å®ã«ãªã£ã¦ãã¾ãã®ã§ããããå¤æ´ãã¦ããã¾ãããã
管çããã£ã¹ã¯ããããã¯ã¼ã¯ãSSHèªè¨¼éµãã¯ãªãã¯ããã¨å ¥åæ¬ã表示ããã¾ãã
ã¿ãã¡ãã¥ã¼ãããããã¯ã¼ã¯ãé¸æãã¦ãã ããã
ãããã¯ã¼ã¯ã¤ã³ã¿ã¼ãã§ã¤ã¹ã¨ããé ç®ãã¯ãªãã¯ããã¨ãããªå ¥åæ¬ãåºã¦ãã¾ãã
å¤é¨IPã¨ããé ç®(ã¨ãã§ã¡ã©ã«ã¨ãªã£ã¦ããç®æ)ãã¯ãªãã¯ãã¦Create IP Addressãé¸æãã¦ãã ããã
ããã¨æ°ããéçIPã¢ãã¬ã¹ã®äºç´ã¦ã£ã³ãã¦ã表示ããã¾ãã
好ããªååãä»ãã¦äºç´ãã¾ãããã
éçIPãä½ããã¦ãã¤ã³ã¹ã¿ã³ã¹ã«è¨å®ããã¾ãã
ããã§å ¥åã¯å®äºã§ãã
ã¾ã¼ã³ã»ãã·ã³ã¿ã¤ãã»ãã¼ããã£ã¹ã¯ã®è¨å®ãééããã¨ç¡æã«ãªãã¾ããã®ã§æ³¨æãã¦ãã ããã
ãã ãééã£ã¦ä½æãã¦ãããã«åé¤ã§ãã¾ãããã¾ãä½ããã¨ãç°¡åã«ã§ããã®ã§ãã¨ããããä½ã£ã¦ã¿ãã¨ããæè¦ã§OKã§ãã
ä½æãã¿ã³ãæ¼ãã¨ã¤ã³ã¹ã¿ã³ã¹ãä½æããã¾ã(å°ãæéããããã¾ã)
ããã§ã¨ããããã¾ãï¼ããã§ãµã¼ããã§ãã¾ããï¼
ãµã¼ãã«sshã§ã¢ã¯ã»ã¹ãã¦ã¿ããï¼
sshã§ã¢ã¯ã»ã¹ããããã«ãéµãè¨å®ãã¾ãããã
éµã¯Compute Engineå·¦å´ã¡ãã¥ã¼ã®ã¡ã¿ãã¼ã¿ããè¨å®ã§ãã¾ãã
éµã®ä½ãæ¹ã¯ãå ¬å¼ããã¥ã¡ã³ããåç §ãã¦ãã ããã
メタデータ内の SSH 認証鍵の管理 | Compute Engine ドキュメント | Google Cloud
$ ssh-keygen -t rsa -f ~/.ssh/[KEY_FILE_NAME] -C [USERNAME]
USERNAMEã®ã¨ããã¯Googleã®ã¢ã«ã¦ã³ãåã«ãã¦ãã ããã
ãã¨ãã°ãGmailã¢ãã¬ã¹ãykiraï¼ gmail.comã¨ããªãykiraãã¢ã«ã¦ã³ãåã«ãªãã¾ãã
éµãä½ã£ãããå ¬ééµ(.pub)ã®ä¸èº«ãã¡ã¿ãã¼ã¿ã«è¨å®ãã¾ãããã
ç»é¢ã®ç·¨éãã¿ã³ãã¯ãªãã¯ããã¨å ¥åæ¬ãåºã¦ãã¾ãã®ã§ãããã«ã³ãããã¦ä¿åããã ãã§ãã
ãã¨ã¯ãç§å¯éµã使ã£ã¦ã¿ã¼ããã«ã§sshããããSFTPã¯ã©ã¤ã¢ã³ãã使ã£ããã§ãµã¼ãã«ã¢ã¯ã»ã¹ã§ãã¾ãã
å人ç¨ã®ãµã¼ããç¡æã§ä½¿ããæ代ï¼
ããã§ãã¨ã¯Apacheã¨ãPHPã¨ã好ããªãã®ãã¤ã³ã¹ãã¼ã«ããã°ããããã¨æãã¾ãã
ãããªã«ç°¡åã«ããããç¡æã§ãµã¼ãã使ãããªãã¦ãããæ代ã«ãªãã¾ãããã
ãã®ãã¡ããã®ãµã¼ãã§PHPãåããã¿ãããªè¨äºãæ¸ãã¦ã¿ããã¨æãã¾ãã
ãã ããã®è¨äºã®brewãyumã«å¤ãã£ãã ãã«ãªãã ãããªã¨æãã¾ãâ¦â¦
ã¾ã¼ãããªãããªã§ã
æ°ã«ãªã£ãæ¹ã¯ããã²ä½¿ã£ã¦ã¿ã¦ãã ããï¼
åèè³æ
ãã®ãããã®è¨äºã«ãç®ãéãã¦ããã¨è¯ããã¨æãã¾ãã
GCEのf1-microインスタンスを真にタダで使う方法 - Qiita
https://media.accel-brain.com/google-cloud-platform-ip-address/
åç¥
å¼ç¤¾ããã²ã¼ã ã¢ããªããªãªã¼ã¹ããã¾ããã
ç°¡åæä½ã§æ¥½ãããã¸ã£ã³ãã¢ã¯ã·ã§ã³ã²ã¼ã ãªã£ã¦ãã¾ãã
ãããããã¯ããªã沢山ç»å ´ãã¾ããã
apps.apple.com