이두잉의 AWS 세상

AWS CloudFront 이슈 발생 시 필요 정보

2018.02.26 16:08 - leedoing leedoing

1. CF Resolver DNS Query

2. curl 등 다운로드 테스트

3. Traceroute 정보


[Case Open 시 AWS에서 필요 정보 요청]

1) What latency do you expect 
2) Please provide the Request ID of a request that appears to experience high latency 
3) Do "dig resolver-identity.cloudfront.net"; or "nslookup resolver-identity.cloudfront.net
4) Please send us the http headers from when you had the problem retrieval (you can do that from the command line using curl or wget, or from the browser using HAR - https://code.google.com/p/harviewer/
 Example: a) curl -v -k http://mydistributionid.cloudfront.net/object.html > /dev/null 
 b) wget --server-response http://mydistributionid.cloudfront.net/object.html 
 c) From a browser https://toolbox.googleapps.com/apps/har_analyzer/ or https://confluence.atlassian.com/kb/generating-har-files-and-analysing-web-requests-720420612.html 
5) Where (physically) is the computer that is running the test or downloading content? 
6) Do "mtr dfafdfadfffdfafd.cloudfront.net" and if you cannot do that, run "traceroute -T dfdfafdfa.cloudfront.net"; or "tracert dfadfafd4zlj.cloudfront.net" I look forward to your response. Please feel free to reach out to me with any additional questions or concerns. Best regards, Olamide O. Amazon Web Services Check out the AWS Support Knowledge Center, a knowledge base of articles and videos that answer customer questions about AWS services: https://aws.amazon.com/premiumsupport/knowledge-center/?icmpid=support_email_category We value your feedback. Please rate my response using the link below. =================================================== To contact us again about this case, please return to the AWS Support Center using the following


아래 쉘을 참고해서 장애 발생 시 정보를 수집하자. 필요한 기능만 추려서 주기적으로 데이터를 저장하는 것도 좋을 듯 하다...

(그럼 mail 버퍼 쌓이는 걸 지워줘야함)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/bin/bash
 
##CF ISSUE CHECK
 
#CURL, MUUT PACKEGE INSTALL
echo "Package Install(curl, mutt)"
mutt=$(cat /etc/issue)
os=`echo $mutt | cut -f1 -d" "`
if [ "$os" = "Amazon" -"$os" = "CentOS" -"$os" = "Red" ]
then
        mutt=$(yum -y install mutt)
        echo "$mutt"
        curl=$(yum -y install curl-devel)
        echo "$curl"
else
        mutt=$(apt-get install mutt)
        echo "$mutt"
        curl=$(apt-get install curl)
        echo "$curl"
fi
echo "Package Installed(curl, mutt)"
echo
 
#HOST NAME
host_name=$(hostname)
dns_resolv=$(cat /etc/resolv.conf)
mutt=$(yum -y install mutt)
curl=$(yum -y install curl-devel)
 
echo -"Input URL(ex. https://media.amazonwebservices.com/urchin.js): "
read url
echo -"Input mail Address(ex. user@hostname.com): "
read mail
 
pwd=$(pwd)
path=$pwd/cf_issue_$host_name.log
echo Save $path
HOST=`echo $url | cut -f3 -d"/"`
 
#Host Infomation
exec 3<> cf_issue_$host_name.log
echo "Host_name: " $host_name >&3
echo "DNS_resolv" >&3
echo "$dns_resolv" >&3
echo >&3
 
##1.DNS RESOLVER
echo "[1. DNS RESOLVER]" >&3
dns_query=$(dig resolver-identity.cloudfront.net +trace)
echo "$dns_query" >&3
echo >&3
 
##2. CURL SPEED
#curl_speed=$(curl -w "%{time_namelookup}/%{time_connect}/%{time_starttransfer}/%{time_total}" -tlsv1.2 -o /dev/null -s "https://images-na.ssl-images-amazon.com/images/G/01/awssignin/static/aws_logo_smile.png")
curl_speed=$(curl -"%{time_namelookup}/%{time_connect}/%{time_starttransfer}/%{time_total}" -tlsv1.2 -/dev/null -"$URL")
        time_namelookup=`echo $curl_speed | cut -f1 -d"/"`
        time_connect=`echo $curl_speed | cut -f2 -d"/"`
        time_starttransfer=`echo $curl_speed | cut -f3 -d"/"`
        time_total=`echo $curl_speed | cut -f4 -d"/"`
        time_connect_r=`echo "$time_connect - $time_namelookup"|bc`
        time_starttransfer_r=`echo "$time_starttransfer - $time_connect"|bc`
echo "[2. CURL SPEED]" >&3
echo $(date) time_namelookup=$time_namelookup time_connect=$time_connect_r time_starttransfer=$time_starttransfer_r time_total=$time_total >&3
echo >&3
 
##3. CURL RESPONSE HEADER
#curl_header=$(curl -v -tlsv1.2 -o /dev/null -s "https://images-na.ssl-images-amazon.com/images/G/01/awssignin/static/aws_logo_smile.png")
curl_header=$(curl --tlsv1.2 -"$URL")
echo "[3. CF REQUEST HEADER]" >&3
echo "$curl_header" >&3
echo >&3
 
##4. NETWORK TRACE
echo "[4. NETWORK TRACEROUTE]" >&3
network_trace=$(traceroute -"$HOST")
echo "$network_trace" >&3
echo >&3
 
#Send mail
mutt -"CloudFront Issue Check_$host_name" $mail < $path
 
cs


해당 정보를 통해 Case Open