次ã®è¡¨ã使ç¨ãã¦ãCloudWatch ã«ã¡ããªã¯ã¹ãçºè¡ãã AWS ãµã¼ãã¹ã確èªã§ãã¾ããã¡ããªã¯ã¹ã¨ãã£ã¡ã³ã·ã§ã³ã«ã¤ãã¦ã¯ãæå®ãããããã¥ã¡ã³ããåç §ãã¦ãã ããã
You have been redirected here because the page you are trying to access has been archived. AWS re:Post is a cloud knowledge service launched at re:Invent 2021. We've migrated selected questions and answers from Forums to AWS re:Post. The thread you are trying to access has outdated guidance, hence we have archived it. If you would like up-to-date guidance, then share your question via AWS re:Post.
CloudWatchã¯AWSãæä¾ããã¡ããªã¯ã¹ä¿åã»ç£è¦ãµã¼ãã¹ã§ããEC2ã®CPU使ç¨çãNetwork I/Oãªã©ã®åºæ¬çãªã¡ããªã¯ã¹ããä½ã追å ã§ä½æ¥ãããã¨ãªãç¡æã§ç£è¦ãããã¨ãã§ãã¾ãã ä¸æ¹ã§ãããã©ã«ãã§ã¯ç£è¦ãããªãé ç®ãã«ã¹ã¿ã ã¡ããªã¯ã¹ã¨ããæ¹æ³ãå©ç¨ããã°ãä»»æã®å¤ãCloudWatchã«ç»é²ãããã¨ãå¯è½ã§ããã«ã¹ã¿ã ã¡ããªã¯ã¹ç»é²ã®ããã«ã¯CloudWatchã®APIçµç±ã§å¤ã®ç»é²ãããå¿ è¦ãæããããAWS SDKãAWS CLIãå©ç¨ããããã¨ãå¤ãã§ãã ã«ã¹ã¿ã ã¡ããªã¯ã¹ã«ç°¡åã«å¤ã追å ã§ããããã«ãç»é²ããã¨ãã®bashã¹ã¯ãªãããéå½¢ã¨ãã¦ä½ã£ã¦ã¿ã¾ããã ã¹ã¯ãªãã ä¾ã¨ãã¦ããã£ã¹ã¯ä½¿ç¨çãCloudWatchã«ã¹ã¿ã ã¡ããªã¯ã¹ã¨ãã¦éä¿¡ããã¹ã¯ãªãããä½æãã¾ããã #!/bin/bash log() { echo $1 | logger }
西澤ã§ããCloudWatchãå©ç¨ãã¦ããã¨ãAWS Management Consoleããã®ã°ã©ãã ãã§ã¯ç©è¶³ããªããªããã¨ãããã¾ããããé常ã«ä¾¿å©ã§è¦ãããã®ã§ããã詳細ãã¼ã¿ãæ°åã§ç´°ãã追ã£ããããµããªã§ã¬ãã¼ããä½ã£ãããããããªãã¾ãã ç»é¢ä¸ããã¨ã¯ã¹ãã¼ãæ©è½ã¯ç¡ãã®ã§ããããï¼ã¿ãããªãåãåãããããããã ãã®ã§ããããã®ãããªæ©è½ã¯å®è£ ããã¦ããªãããã§ãããã ãCloudWatchãä»ã®ãµã¼ãã¹ã¨åæ§API(ä»åã¯AWS CLIã使ãã¾ã)ããæ å ±ãåå¾ã§ããã¨ããç¹æ§ãå©ç¨ããã¨ãçµ±è¨ã¬ãã¼ãã®ãããªåºåãç°¡åã«çæãããã¨ãã§ãã¾ããã±ã£ã¨ã¤ã¡ã¼ã¸ãã¦ãã¾ããããª5åããã®ãã¼ã¿ãåºåãã¦ãExcelã§ã¾ã¨ãã¦ã´ãã§ã´ãã§ããå¿ è¦ã¯ããã¾ããã AWS CLIã§çµ±è¨ã¬ãã¼ããä½æãã ã¨ãããã¨ã§ããã¾ãã¾ä»ååãåãããåã£ãã±ã¼ã¹çãå«ãã¦ãå©ç¨ä¾ãç´¹
CloudWatch ã¯ãã¡ããªãã¯ã¹ã®ä¿åæéã 14 æ¥ãã 15 ãæã¸ã¨ç¡åã§å»¶é·ãããã¨ãçºè¡¨ãã¾ãããCloudWatch ã«ã¯æ¢ã« 3 ãæ以ä¸ã®æ¢åã¡ããªãã¯ã¹ããã¹ã¦ä¿åããã¦ãã¾ããã客æ§ã¯ãããæ´»ç¨ãã¦ãå£ç¯çãªå¾åãæéã®ååãä»ããåæã§ããã ãã§ãªããå°æ¥çã«ã¯åå¹´ã¨ã®æ¯è¼ãäºæ³ãè¡ããããã«ãªãã¾ãã CloudWatch Metrics ã§é¸æã§ããä¿åæéã¹ã±ã¸ã¥ã¼ã«ã¯ã次㮠3 種é¡ã«ãªãã¾ããã 1 åãã¨ã®ãã¼ã¿ãã¤ã³ãã 15 æ¥éä¿å 5 åãã¨ã®ãã¼ã¿ãã¤ã³ãã 63 æ¥éä¿å 1 æéãã¨ã®ãã¼ã¿ãã¤ã³ãã 455 æ¥éä¿å ã¾ããCloudWatch 㯠Metrics ã«æ°ã¦ã¼ã¶ã¼ã¤ã³ã¿ã¼ãã§ã¤ã¹ãæ¡ç¨ãããã¨ãçºè¡¨ãã¾ããããã®ã¤ã³ã¿ã¼ãã§ã¤ã¹ã«ã¯ãæ¹è¯çã°ã©ã表示ã³ã³ããã¼ã«ãç¸å¯¾/絶対ã¿ã¤ã ã©ã¤ã³ã«å¯¾å¿ããæ¹è¯çã«ã¬ã³ãã¼ã¦ã£ã¸ã§ã
Amazon CloudWatch ã¢ã©ã¼ã ã®è«æ±ããã³æéã«é¢ããæ å ±ã«ã¤ãã¦ã¯ããAmazon CloudWatch ã¦ã¼ã¶ã¼ã¬ã¤ããã®ãCloudWatch ã®è«æ±ã¨ã³ã¹ãããåç §ãã¦ãã ããã ãµã¼ãã¹ã«ãªã³ã¯ããããã¼ã« AWSServiceRoleForCloudWatchEvents ã使ç¨ããã¨ãAWS ãã客æ§ã«ä»£ãã£ã¦ã¢ã©ã¼ã ã¢ã¯ã·ã§ã³ãå®è¡ã§ãã¾ããAWS Management ConsoleãAWS CLIãã¾ã㯠IAM API ã§åãã¦ã¢ã©ã¼ã ãä½æããå ´åãCloudWatch ã¯ãµã¼ãã¹ã«ãªã³ã¯ããããã¼ã«ãä½æãã¾ãã èªåçã«ã¤ã³ã¹ã¿ã³ã¹ãåæ¢ã¾ãã¯çµäºããã·ããªãªã¯ããã¤ãããã¾ããä¾ãã°ãããã給ä¸è¨ç®å¦çã¸ã§ãã¾ãã¯ç§å¦è¨ç®ã¿ã¹ã¯ãå°ç¨ã«è¡ãã¤ã³ã¹ã¿ã³ã¹ã使ç¨ãã¦ããå ´åãæãããã¾ãããããã®ã¤ã³ã¹ã¿ã³ã¹ã¯ä¸å®æéåä½ãã¦ä»äºãå®äºãã¾ãããã®ã
ããã«ã¡ã¯ã AWSã«ã¯ãªã½ã¼ã¹ç£è¦ã¨ãã¦CloudWatchãããã¾ãããEC2ã¤ã³ã¹ã¿ã³ã¹ã®å é¨æ å ±ï¼ã¡ã¢ãªããã£ã¹ã¯ã®æ å ±ï¼ã¯åå¾åºæ¥ã¾ããã ããã¯AWSãåã¦ã¼ã¶ã¼ã®ã¤ã³ã¹ã¿ã³ã¹å é¨ã®æ å ±ãåå¾åºæ¥ãªãããã«è¨è¨ããã¦ããããã§ããããã®é¨åããµãã¼ããããã¼ã«ãæä¾ããã¦ãã¾ãã ãAWSçºè¡¨ãLinuxç¨CloudWatchç£è¦ã¹ã¯ãªããã«3ã¤ã®æ°æ©è½ã追å ãªã³ã¯ã«ããéããæè¿ã¢ãããã¼ããããã¾ããã IAM Roleã¸ã®å¯¾å¿ã¯ã¤ã³ã¹ã¿ã³ã¹ã«ã¢ã¯ã»ã¹ãã¼IDã¨ã·ã¼ã¯ã¬ãããã¼ãä¿åããå¿ è¦ããªããªãã®ã§ãå¬ããã§ããã ãããªããã§æ©é試ãã¦ã¿ã¾ããã â»ã¡ãªã¿ã«IAM Roleã«ã¤ãã¦ã¯ãã¡ãã®ããã°ãåèã«ãªãã®ããªã¨æãã¾ãï¼ã¹ããï¼ ç°å¢ ä»åã¯Amazon Linuxã§ããã¾ãããã以ä¸ã®ãããªãã£ã¹ããªãã¥ã¼ã·ã§ã³ã§ãOKã¿ããã§ãã Red Hat Ent
CloudWatchã®ã«ã¹ã¿ã ã¡ããªã¯ã¹ã§FreeMemoryMBytesãUsedMemoryPercentãLoadAverageãStealãåå¾ CloudWatchã§åå¾ã§ããã㨠CloudWatchã¯AWSã®æ§ã ãªæ å ±ãç£è¦ãã¦çµ±è¨ãåã£ã¦ããããµã¼ãã¹ã§ããæ¦è¦ã«ã¤ãã¦ã¯ä»¥åãç´¹ä»ãã¾ãããä»åã¯ãæ¨æºã§æä¾ããã¦ããªãçµ±è¨ãã¼ã¿ãç»é²ãã¦åå¾ãã¦ã¿ã¾ããããããã«ã¹ã¿ã ã¡ããªã¯ã¹ã¨ãããã¤ã§ãã ã«ã¹ã¿ã ã¡ããªã¯ã¹ãåå¾ããæ¹æ³ ä»åã®ã«ã¹ã¿ã ã¡ããªã¯ã¹ã§åå¾ããå¤ã¯ä»¥ä¸ã®ï¼ã¤ã§ãã 空ãã¡ã¢ãªã¼å®¹é(FreeMemoryMBytes)ï¼ã¡ã¢ãªã¼ãå°ãªãããã¨ãã£ã¦ã¡ã¢ãªä¸è¶³ã¨ã¯éããªã ã¡ã¢ãªã¼ä½¿ç¨ç(UsedMemoryPercent)ï¼ä½¿ç¨ã¡ã¢ãªã¼ãåè¨ã¡ã¢ãªã¼ã§å²ã£ãå²å ãã¼ãã¢ãã¬ã¼ã¸(LoadAverage)ï¼ã·ã¹ãã ã¸ã®å¹³åè² è· ã¹ãã¼ã«(Steal)ï¼C
EC2ã¤ã³ã¹ã¿ã³ã¹ã§éç¨ãããéã«ãã¤ã³ã¹ã¿ã³ã¹ã®æ»æ´»ãã§ãã¯ããããªãã¤ã³ã¹ã¿ã³ã¹ãæ»ãã§ãéã«ã¯ã¡ã¼ã«ã§ç¥ããããã¨ããè¦æ±ãããã¾ãããããã§æè§AWSã使ç¨ãã¦ããã®ã§ããããCloudWatchã¨SNSã使ç¨ãã¦ãããå®ç¾ãã¦ã¿ããã¨æãã¾ãã æºå ã¾ãã¯ç°å¢ãç¨æãã¾ããEC2ã¤ã³ã¹ã¿ã³ã¹ãä½æãã¾ããä½ææç¹ã§CloudWatchãæå¹ã«ãã¦ããã¾ããyumã§httpdãã¤ã³ã¹ãã¼ã«ãã¦ç¨¼åããã¾ããé©å½ã«index.htmlãã¡ã¤ã«ãä½æãã¦Webããåç §ã§ããããã«ãã¾ããæå¾ã«ELBãä½æãã¦ã¤ã³ã¹ã¿ã³ã¹ãç´ä»ãã¾ããchkconfig httpd onã§èªåèµ·åã«ãã¦ããã¨ãå¾ã»ã©ã¤ã³ã¹ã¿ã³ã¹ã®STOP-STARTãããéã«æ¥½ãã§ãããã§ãã Alarmã®ä½æ 管çã³ã³ã½ã¼ã«ããCloudWatchã®Alarmãä½æãã¾ããä»åã¯ELBã®HealthyHostCou
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}