DevOps

AWS 이슈 해결 - 지역별 네트워크 상황

올라석이! 2022. 7. 13. 16:13

 

AWS 서비스 사용 중 이슈 해결에 관한 경험을 적어봅니다.

aws smail logo

 

aws elastic beanstalk logo

6년전인가 2016년도 즈음에 AWS에서 Beanstalk이란 서비스를 처음 봤을 때 엄청 좋아했던 기억이있습니다.
당시에도 docker가 있었지만 운영으로 사용하기엔 적합하지 않다는 논란이 있었고
컨테이너 오케스트레이션 서비스도 개발되는 시기라서 인프라 자동화관리에 있어 Beanstalk이 사용하기 제일 만만했었습니다.

 

서버를 돌리려면 ec2에 인스턴스 만들고 ELB 만들고 스케일링하려면 AutoScaling 그룹만들고 등등 해야 되는데

Beanstalk은 클릭 몇번으로 ec2에 instance부터 S3에 로그 넣까지 전부 해주니 엄청 편했던 것이죠.

거기에 aws 리눅스, ec2 도커, aws 파이썬, php, java등 여러가지 플랫폼을 지원하니 골라쓰기도 좋았습니다.

route53 에서 DNS만 Beanstalk 환경의 DNS로 연결해주면 되니 Blue/Green 배포도 쉽습니다.
당시 PaaS로 운영하던 서비스가 있던 업체가 문을 닫아 Beastalk으로 이전하였는데 아직도 잘 돌아갑니다.

 

그런데 최근 업데이트 할 일이 있어 배포를 했는데 안되어 살펴봤습니다.
해당 서비스는 nodejs로 만들어진 API 서버 입니다.
일단 해당 인스턴스에 접속하여 /var/log/eb-aciviti.log 파일을 봅니다.

 

 

[ec2-user@ip-172-31-29-197 log]$ cat eb-activity.log
[2022-07-13T06:24:47.346Z] INFO  [2842]  - [Initialization] : Starting activity...
[2022-07-13T06:24:47.346Z] INFO  [2842]  - [Initialization/AddonsBefore] : Starting activity...
[2022-07-13T06:24:47.346Z] INFO  [2842]  - [Initialization/AddonsBefore/InstallCWLAgent] : Starting activity...
[2022-07-13T06:24:47.346Z] INFO  [2842]  - [Initialization/AddonsBefore/InstallCWLAgent/01-install-cwl-agent.sh] : Starting activity...
[2022-07-13T06:24:49.797Z] INFO  [2842]  - [Initialization/AddonsBefore/InstallCWLAgent/01-install-cwl-agent.sh] : Completed activity. Result:
  + grep -iq 'Amazon Linux' /etc/issue
  + yum install -y awslogs
  Loaded plugins: priorities, update-motd, upgrade-helper
  Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
  Resolving Dependencies
  --> Running transaction check
  ---> Package awslogs.noarch 0:1.1.4-1.12.amzn1 will be installed
  --> Processing Dependency: aws-cli-plugin-cloudwatch-logs(python27) for package: awslogs-1.1.4-1.12.amzn1.noarch
  --> Running transaction check
  ---> Package aws-cli-plugin-cloudwatch-logs.noarch 0:1.4.4-1.16.amzn1 will be installed
  --> Finished Dependency Resolution

  Dependencies Resolved

  ================================================================================
   Package                          Arch     Version            Repository   Size
  ================================================================================
  Installing:
   awslogs                          noarch   1.1.4-1.12.amzn1   amzn-main   9.2 k
  Installing for dependencies:
   aws-cli-plugin-cloudwatch-logs   noarch   1.4.4-1.16.amzn1   amzn-main    71 k

  Transaction Summary
  ================================================================================
  Install  1 Package (+1 Dependent package)

  Total download size: 81 k
  Installed size: 246 k
  Downloading packages:
  --------------------------------------------------------------------------------
  Total                                              644 kB/s |  81 kB  00:00
  Running transaction check
  Running transaction test
  Transaction test succeeded
  Running transaction
    Installing : aws-cli-plugin-cloudwatch-logs-1.4.4-1.16.amzn1.noarch       1/2
    Installing : awslogs-1.1.4-1.12.amzn1.noarch                              2/2
    Verifying  : awslogs-1.1.4-1.12.amzn1.noarch                              1/2
    Verifying  : aws-cli-plugin-cloudwatch-logs-1.4.4-1.16.amzn1.noarch       2/2

  Installed:
    awslogs.noarch 0:1.1.4-1.12.amzn1

  Dependency Installed:
    aws-cli-plugin-cloudwatch-logs.noarch 0:1.4.4-1.16.amzn1

  Complete!
  + cat
  ++ sed 's/.$//'
  ++ curl 169.254.169.254/latest/meta-data/placement/availability-zone
    % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                   Dload  Upload   Total   Spent    Left  Speed
100    15  100    15    0     0   7500      0 --:--:-- --:--:-- --:--:--  7500
  + region=ap-northeast-1
  + sed -i -e 's/region = .*/region = ap-northeast-1/g' /etc/awslogs/awscli.conf
  + /opt/elasticbeanstalk/bin/log-conf -n awslogs -l/var/log/awslogs.log
[2022-07-13T06:24:49.797Z] INFO  [2842]  - [Initialization/AddonsBefore/InstallCWLAgent] : Completed activity. Result:
  Successfully execute hooks in directory /opt/elasticbeanstalk/addons/logstreaming/hooks/install.
[2022-07-13T06:24:49.797Z] INFO  [2842]  - [Initialization/AddonsBefore] : Completed activity.
[2022-07-13T06:24:49.797Z] INFO  [2842]  - [Initialization/PreInitStage0] : Starting activity...
[2022-07-13T06:24:49.797Z] INFO  [2842]  - [Initialization/PreInitStage0/DownloadSourceBundle] : Starting activity...
[2022-07-13T06:24:50.172Z] INFO  [2842]  - [Initialization/PreInitStage0/DownloadSourceBundle] : Completed activity. Result:
  [2022-07-13T06:24:49.900Z] INFO  [2902]  : Application version will be saved to /opt/elasticbeanstalk/deploy/appsource.
  [2022-07-13T06:24:49.900Z] INFO  [2902]  : Using manifest cache with deployment ID 3 and serial 4.
  [2022-07-13T06:24:49.900Z] INFO  [2902]  : Attempting to download application source bundle to: '/opt/elasticbeanstalk/deploy/appsource/source_bundle'.
  [2022-07-13T06:24:49.900Z] INFO  [2902]  : Using computed s3 key.
  [2022-07-13T06:24:50.019Z] INFO  [2902]  : Downloading from bucket 'elasticbeanstalk-ap-northeast-1-674591158488' with key 'resources/environments/e-8jszd2kthk/_runtime/_versions/Tcare/code-pipeline-1657687859706-f8adf408c835ebd4f62e17a35ea296f3261de8c6' and version '' to '/opt/elasticbeanstalk/deploy/appsource/source_bundle'.
  [2022-07-13T06:24:50.135Z] INFO  [2902]  : Size: 88712, ETag: "69bdfe9d9f9f3918ae0d3fee24588643", Metadata: {"environmentid"=>"e-8jszd2kthk", "requestid"=>"6b60d42b-4089-401a-b528-185479c8885c"}.
  [2022-07-13T06:24:50.159Z] INFO  [2902]  : Downloaded size: 88712.
  [2022-07-13T06:24:50.159Z] INFO  [2902]  : Successfully downloaded to '/opt/elasticbeanstalk/deploy/appsource/source_bundle'.
[2022-07-13T06:24:50.172Z] INFO  [2842]  - [Initialization/PreInitStage0/PreInitHook] : Starting activity...
[2022-07-13T06:24:50.173Z] INFO  [2842]  - [Initialization/PreInitStage0/PreInitHook/01_install_xray_daemon.sh] : Starting activity...
[2022-07-13T06:24:50.281Z] INFO  [2842]  - [Initialization/PreInitStage0/PreInitHook/01_install_xray_daemon.sh] : Completed activity. Result:
  Executing: /bin/chown -R xray:xray /var/log/xray

[2022-07-13T06:24:50.281Z] INFO  [2842]  - [Initialization/PreInitStage0/PreInitHook/10nodejsuser.sh] : Starting activity...
[2022-07-13T06:24:50.411Z] INFO  [2842]  - [Initialization/PreInitStage0/PreInitHook/10nodejsuser.sh] : Completed activity. Result:
  ++ /opt/elasticbeanstalk/bin/get-config container -k app_user
  + EB_APP_USER=nodejs
  + id -u nodejs
  id: nodejs: no such user
  + useradd --system --user-group --home-dir /tmp nodejs -s /sbin/nologin
[2022-07-13T06:24:50.411Z] INFO  [2842]  - [Initialization/PreInitStage0/PreInitHook/20packages.sh] : Starting activity...
[2022-07-13T06:24:50.413Z] INFO  [2842]  - [Initialization/PreInitStage0/PreInitHook/20packages.sh] : Completed activity. Result:
  + is_baked nodejs_packages
  + [[ -f /etc/elasticbeanstalk/baking_manifest/nodejs_packages ]]
  + true
  + echo nodejs related packages have already been installed. Skipping installation.
  nodejs related packages have already been installed. Skipping installation.
[2022-07-13T06:24:50.413Z] INFO  [2842]  - [Initialization/PreInitStage0/PreInitHook/30directories.sh] : Starting activity...
[2022-07-13T06:24:50.697Z] INFO  [2842]  - [Initialization/PreInitStage0/PreInitHook/30directories.sh] : Completed activity. Result:
  ++ /opt/elasticbeanstalk/bin/get-config container -k nodejs_log_dir
  + EB_NODE_LOG_DIR=/var/log/nodejs
  ++ /opt/elasticbeanstalk/bin/get-config container -k app_user
  + EB_APP_USER=nodejs
  ++ /opt/elasticbeanstalk/bin/get-config container -k nodejs_install_dir
  + EB_NODE_INSTALL_DIR=/opt/elasticbeanstalk/node-install
  + mkdir -p /var/log/nodejs
  + chown nodejs /var/log/nodejs
  + mkdir -p /opt/elasticbeanstalk/node-install
[2022-07-13T06:24:50.697Z] INFO  [2842]  - [Initialization/PreInitStage0/PreInitHook/40iptables.sh] : Starting activity...
[2022-07-13T06:24:52.390Z] INFO  [2842]  - [Initialization/PreInitStage0/PreInitHook/40iptables.sh] : Completed activity. Result:
  + /opt/elasticbeanstalk/containerfiles/ebnode.py --action iptables-install
[2022-07-13T06:24:52.390Z] INFO  [2842]  - [Initialization/PreInitStage0/PreInitHook/50logs.sh] : Starting activity...
[2022-07-13T06:24:52.614Z] INFO  [2842]  - [Initialization/PreInitStage0/PreInitHook/50logs.sh] : Completed activity. Result:
  + /opt/elasticbeanstalk/bin/log-conf -n nodejs -l/var/log/nodejs/nodejs.log -f /opt/elasticbeanstalk/containerfiles/nodejs.logrotate.conf
  + /opt/elasticbeanstalk/bin/log-conf -n npm -l/var/log/nodejs/npm-debug.log -t taillogs,systemtaillogs,bundlelogs
  + /opt/elasticbeanstalk/bin/log-conf -nnginx '-l/var/log/nginx/*' -f /opt/elasticbeanstalk/containerfiles/nginx.logrotate.conf
  + /opt/elasticbeanstalk/bin/log-conf -nhttpd '-l/var/log/httpd/*' -f /opt/elasticbeanstalk/containerfiles/httpd.logrotate.conf
[2022-07-13T06:24:52.614Z] INFO  [2842]  - [Initialization/PreInitStage0/PreInitHook/60nginx.sh] : Starting activity...
[2022-07-13T06:24:52.713Z] INFO  [2842]  - [Initialization/PreInitStage0/PreInitHook/60nginx.sh] : Completed activity. Result:
  ++ /opt/elasticbeanstalk/bin/get-config container -k app_user
  + EB_APP_USER=nodejs
  + grep 'Elastic Beanstalk managed configuration file' /etc/nginx/nginx.conf
  + cp /opt/elasticbeanstalk/containerfiles/nginx.conf /etc/nginx/nginx.conf
  + rm -f /etc/logrotate.d/nginx
[2022-07-13T06:24:52.714Z] INFO  [2842]  - [Initialization/PreInitStage0/PreInitHook/70apache_mod_reqtimeout.sh] : Starting activity...
[2022-07-13T06:24:52.718Z] INFO  [2842]  - [Initialization/PreInitStage0/PreInitHook/70apache_mod_reqtimeout.sh] : Completed activity. Result:
  + MOD_REQTIMEOUT_CONFIG=/etc/httpd/conf.d/mod_reqtimeout.conf
  + '[' '!' -f /etc/httpd/conf.d/mod_reqtimeout.conf ']'
  + cp /opt/elasticbeanstalk/containerfiles/mod_reqtimeout.conf /etc/httpd/conf.d/mod_reqtimeout.conf
[2022-07-13T06:24:52.718Z] INFO  [2842]  - [Initialization/PreInitStage0/PreInitHook/70proxy_logging_dirs.sh] : Starting activity...
[2022-07-13T06:24:52.726Z] INFO  [2842]  - [Initialization/PreInitStage0/PreInitHook/70proxy_logging_dirs.sh] : Completed activity. Result:
  + mkdir -p /var/log/httpd
  + chmod -R 755 /var/log/httpd
  + '[' -d /etc/healthd ']'
  + mkdir -p /var/log/nginx/healthd
  + chown -R nginx:nginx /var/log/nginx/healthd
  + mkdir -p /var/log/httpd/healthd
[2022-07-13T06:24:52.727Z] INFO  [2842]  - [Initialization/PreInitStage0/PreInitHook/80httpd.sh] : Starting activity...
[2022-07-13T06:24:52.729Z] INFO  [2842]  - [Initialization/PreInitStage0/PreInitHook/80httpd.sh] : Completed activity. Result:
  + rm -f /etc/logrotate.d/httpd
[2022-07-13T06:24:52.729Z] INFO  [2842]  - [Initialization/PreInitStage0/PreInitHook] : Completed activity. Result:
  Successfully execute hooks in directory /opt/elasticbeanstalk/hooks/preinit.
[2022-07-13T06:24:52.730Z] INFO  [2842]  - [Initialization/PreInitStage0] : Completed activity. Result:
  Initialization - Command CMD-PreInit stage 0 completed
[2022-07-13T06:24:52.730Z] INFO  [2842]  - [Initialization/AddonsAfter] : Starting activity...
[2022-07-13T06:24:52.730Z] INFO  [2842]  - [Initialization/AddonsAfter] : Completed activity.
[2022-07-13T06:24:52.730Z] INFO  [2842]  - [Initialization] : Completed activity. Result:
  Initialization - Command CMD-PreInit succeeded
[2022-07-13T06:24:52.938Z] INFO  [3072]  - [Application deployment code-pipeline-1657687859706-f8adf408c835ebd4f62e17a35ea296f3261de8c6@3] : Starting activity...
[2022-07-13T06:24:52.939Z] INFO  [3072]  - [Application deployment code-pipeline-1657687859706-f8adf408c835ebd4f62e17a35ea296f3261de8c6@3/AddonsBefore] : Starting activity...
[2022-07-13T06:24:52.939Z] INFO  [3072]  - [Application deployment code-pipeline-1657687859706-f8adf408c835ebd4f62e17a35ea296f3261de8c6@3/AddonsBefore/ConfigCWLAgent] : Starting activity...
[2022-07-13T06:24:52.939Z] INFO  [3072]  - [Application deployment code-pipeline-1657687859706-f8adf408c835ebd4f62e17a35ea296f3261de8c6@3/AddonsBefore/ConfigCWLAgent/10-config.sh] : Starting activity...
[2022-07-13T06:24:53.062Z] INFO  [3072]  - [Application deployment code-pipeline-1657687859706-f8adf408c835ebd4f62e17a35ea296f3261de8c6@3/AddonsBefore/ConfigCWLAgent/10-config.sh] : Completed activity. Result:
  Log streaming option setting is not specified, ignore cloudwatch logs setup.

  Disabled log streaming.
[2022-07-13T06:24:53.062Z] INFO  [3072]  - [Application deployment code-pipeline-1657687859706-f8adf408c835ebd4f62e17a35ea296f3261de8c6@3/AddonsBefore/ConfigCWLAgent] : Completed activity. Result:
  Successfully execute hooks in directory /opt/elasticbeanstalk/addons/logstreaming/hooks/config.
[2022-07-13T06:24:53.062Z] INFO  [3072]  - [Application deployment code-pipeline-1657687859706-f8adf408c835ebd4f62e17a35ea296f3261de8c6@3/AddonsBefore] : Completed activity.
[2022-07-13T06:24:53.062Z] INFO  [3072]  - [Application deployment code-pipeline-1657687859706-f8adf408c835ebd4f62e17a35ea296f3261de8c6@3/StartupStage0] : Starting activity...
[2022-07-13T06:24:53.062Z] INFO  [3072]  - [Application deployment code-pipeline-1657687859706-f8adf408c835ebd4f62e17a35ea296f3261de8c6@3/StartupStage0/HealthdLogRotation] : Starting activity...
[2022-07-13T06:24:53.067Z] INFO  [3072]  - [Application deployment code-pipeline-1657687859706-f8adf408c835ebd4f62e17a35ea296f3261de8c6@3/StartupStage0/HealthdLogRotation] : Completed activity. Result:
  ["/etc/cron.hourly/cron.logrotate.elasticbeanstalk.healthd.conf"]
[2022-07-13T06:24:53.067Z] INFO  [3072]  - [Application deployment code-pipeline-1657687859706-f8adf408c835ebd4f62e17a35ea296f3261de8c6@3/StartupStage0/HealthdHTTPDLogging] : Starting activity...
[2022-07-13T06:24:53.068Z] INFO  [3072]  - [Application deployment code-pipeline-1657687859706-f8adf408c835ebd4f62e17a35ea296f3261de8c6@3/StartupStage0/HealthdHTTPDLogging] : Completed activity.
[2022-07-13T06:24:53.068Z] INFO  [3072]  - [Application deployment code-pipeline-1657687859706-f8adf408c835ebd4f62e17a35ea296f3261de8c6@3/StartupStage0/HealthdNginxLogging] : Starting activity...
[2022-07-13T06:24:53.068Z] INFO  [3072]  - [Application deployment code-pipeline-1657687859706-f8adf408c835ebd4f62e17a35ea296f3261de8c6@3/StartupStage0/HealthdNginxLogging] : Completed activity.
[2022-07-13T06:24:53.068Z] INFO  [3072]  - [Application deployment code-pipeline-1657687859706-f8adf408c835ebd4f62e17a35ea296f3261de8c6@3/StartupStage0/EbExtensionPreBuild] : Starting activity...
[2022-07-13T06:24:53.426Z] INFO  [3072]  - [Application deployment code-pipeline-1657687859706-f8adf408c835ebd4f62e17a35ea296f3261de8c6@3/StartupStage0/EbExtensionPreBuild/Infra-EmbeddedPreBuild] : Starting activity...
[2022-07-13T06:24:53.430Z] INFO  [3072]  - [Application deployment code-pipeline-1657687859706-f8adf408c835ebd4f62e17a35ea296f3261de8c6@3/StartupStage0/EbExtensionPreBuild/Infra-EmbeddedPreBuild/prebuild_0_Tcare] : Starting activity...
[2022-07-13T06:24:53.430Z] INFO  [3072]  - [Application deployment code-pipeline-1657687859706-f8adf408c835ebd4f62e17a35ea296f3261de8c6@3/StartupStage0/EbExtensionPreBuild/Infra-EmbeddedPreBuild/prebuild_0_Tcare] : Completed activity.
[2022-07-13T06:24:53.437Z] INFO  [3072]  - [Application deployment code-pipeline-1657687859706-f8adf408c835ebd4f62e17a35ea296f3261de8c6@3/StartupStage0/EbExtensionPreBuild/Infra-EmbeddedPreBuild/prebuild_1_Tcare] : Starting activity...
[2022-07-13T06:24:53.437Z] INFO  [3072]  - [Application deployment code-pipeline-1657687859706-f8adf408c835ebd4f62e17a35ea296f3261de8c6@3/StartupStage0/EbExtensionPreBuild/Infra-EmbeddedPreBuild/prebuild_1_Tcare] : Completed activity.
[2022-07-13T06:24:53.437Z] INFO  [3072]  - [Application deployment code-pipeline-1657687859706-f8adf408c835ebd4f62e17a35ea296f3261de8c6@3/StartupStage0/EbExtensionPreBuild/Infra-EmbeddedPreBuild] : Completed activity.
[2022-07-13T06:24:53.458Z] INFO  [3072]  - [Application deployment code-pipeline-1657687859706-f8adf408c835ebd4f62e17a35ea296f3261de8c6@3/StartupStage0/EbExtensionPreBuild] : Completed activity.
[2022-07-13T06:24:53.458Z] INFO  [3072]  - [Application deployment code-pipeline-1657687859706-f8adf408c835ebd4f62e17a35ea296f3261de8c6@3/StartupStage0/AppDeployPreHook] : Starting activity...
[2022-07-13T06:24:53.459Z] INFO  [3072]  - [Application deployment code-pipeline-1657687859706-f8adf408c835ebd4f62e17a35ea296f3261de8c6@3/StartupStage0/AppDeployPreHook/01_configure_xray.sh] : Starting activity...
[2022-07-13T06:24:53.568Z] INFO  [3072]  - [Application deployment code-pipeline-1657687859706-f8adf408c835ebd4f62e17a35ea296f3261de8c6@3/StartupStage0/AppDeployPreHook/01_configure_xray.sh] : Completed activity.
[2022-07-13T06:24:53.569Z] INFO  [3072]  - [Application deployment code-pipeline-1657687859706-f8adf408c835ebd4f62e17a35ea296f3261de8c6@3/StartupStage0/AppDeployPreHook/10clean.sh] : Starting activity...
[2022-07-13T06:24:53.665Z] INFO  [3072]  - [Application deployment code-pipeline-1657687859706-f8adf408c835ebd4f62e17a35ea296f3261de8c6@3/StartupStage0/AppDeployPreHook/10clean.sh] : Completed activity. Result:
  ++ /opt/elasticbeanstalk/bin/get-config container -k app_staging_dir
  + EB_APP_STAGING_DIR=/tmp/deployment/application
  + rm -rf /tmp/deployment/application
  + mkdir -p /tmp/deployment/application
[2022-07-13T06:24:53.665Z] INFO  [3072]  - [Application deployment code-pipeline-1657687859706-f8adf408c835ebd4f62e17a35ea296f3261de8c6@3/StartupStage0/AppDeployPreHook/20unzip.sh] : Starting activity...
[2022-07-13T06:24:53.861Z] INFO  [3072]  - [Application deployment code-pipeline-1657687859706-f8adf408c835ebd4f62e17a35ea296f3261de8c6@3/StartupStage0/AppDeployPreHook/20unzip.sh] : Completed activity. Result:
  ++ /opt/elasticbeanstalk/bin/get-config container -k app_staging_dir
  + EB_APP_STAGING_DIR=/tmp/deployment/application
  ++ /opt/elasticbeanstalk/bin/get-config container -k source_bundle
  + EB_APP_SOURCE_BUNDLE=/opt/elasticbeanstalk/deploy/appsource/source_bundle
  + /usr/bin/unzip -o -d /tmp/deployment/application /opt/elasticbeanstalk/deploy/appsource/source_bundle
  Archive:  /opt/elasticbeanstalk/deploy/appsource/source_bundle
     creating: /tmp/deployment/application/.ebextensions/
    inflating: /tmp/deployment/application/.ebextensions/attachSSL.config
    inflating: /tmp/deployment/application/.ebextensions/commands.config
    inflating: /tmp/deployment/application/.ebextensions/installPackage.config
    inflating: /tmp/deployment/application/.ebextensions/logrotate.config
    inflating: /tmp/deployment/application/.ebextensions/nginx.config
    inflating: /tmp/deployment/application/.gitignore
    inflating: /tmp/deployment/application/README.md
    ...
    여러가지 파일들
    ...
[2022-07-13T06:24:53.861Z] INFO  [3072]  - [Application deployment code-pipeline-1657687859706-f8adf408c835ebd4f62e17a35ea296f3261de8c6@3/StartupStage0/AppDeployPreHook/30config_clean.sh] : Starting activity...
[2022-07-13T06:24:53.956Z] INFO  [3072]  - [Application deployment code-pipeline-1657687859706-f8adf408c835ebd4f62e17a35ea296f3261de8c6@3/StartupStage0/AppDeployPreHook/30config_clean.sh] : Completed activity. Result:
  ++ /opt/elasticbeanstalk/bin/get-config container -k config_staging_dir
  + EB_CONFIG_STAGING_DIR=/tmp/deployment/config
  + rm -rf /tmp/deployment/config
  + mkdir -p /tmp/deployment/config
[2022-07-13T06:24:53.956Z] INFO  [3072]  - [Application deployment code-pipeline-1657687859706-f8adf408c835ebd4f62e17a35ea296f3261de8c6@3/StartupStage0/AppDeployPreHook/40install_node.sh] : Starting activity...
[2022-07-13T06:24:55.597Z] INFO  [3072]  - [Application deployment code-pipeline-1657687859706-f8adf408c835ebd4f62e17a35ea296f3261de8c6@3/StartupStage0/AppDeployPreHook/40install_node.sh] : Completed activity. Result:
  + /opt/elasticbeanstalk/containerfiles/ebnode.py --action node-install
[2022-07-13T06:24:55.597Z] INFO  [3072]  - [Application deployment code-pipeline-1657687859706-f8adf408c835ebd4f62e17a35ea296f3261de8c6@3/StartupStage0/AppDeployPreHook/50npm.sh] : Starting activity...
[ec2-user@ip-172-31-29-197 log]$ tail -f eb-activity.log
[2022-07-13T06:24:53.861Z] INFO  [3072]  - [Application deployment code-pipeline-1657687859706-f8adf408c835ebd4f62e17a35ea296f3261de8c6@3/StartupStage0/AppDeployPreHook/30config_clean.sh] : Starting activity...
[2022-07-13T06:24:53.956Z] INFO  [3072]  - [Application deployment code-pipeline-1657687859706-f8adf408c835ebd4f62e17a35ea296f3261de8c6@3/StartupStage0/AppDeployPreHook/30config_clean.sh] : Completed activity. Result:
  ++ /opt/elasticbeanstalk/bin/get-config container -k config_staging_dir
  + EB_CONFIG_STAGING_DIR=/tmp/deployment/config
  + rm -rf /tmp/deployment/config
  + mkdir -p /tmp/deployment/config
[2022-07-13T06:24:53.956Z] INFO  [3072]  - [Application deployment code-pipeline-1657687859706-f8adf408c835ebd4f62e17a35ea296f3261de8c6@3/StartupStage0/AppDeployPreHook/40install_node.sh] : Starting activity...
[2022-07-13T06:24:55.597Z] INFO  [3072]  - [Application deployment code-pipeline-1657687859706-f8adf408c835ebd4f62e17a35ea296f3261de8c6@3/StartupStage0/AppDeployPreHook/40install_node.sh] : Completed activity. Result:
  + /opt/elasticbeanstalk/containerfiles/ebnode.py --action node-install
[2022-07-13T06:24:55.597Z] INFO  [3072]  - [Application deployment code-pipeline-1657687859706-f8adf408c835ebd4f62e17a35ea296f3261de8c6@3/StartupStage0/AppDeployPreHook/50npm.sh] : Starting activity...

 

 

로그가 길쥬? 저도 다 모릅니다. Beanstalk 개발자 아니고서는 알 필요가 없지요.
서비스를 사용하는 저희는 오~ 에러없이 잘 실행 되는구만~ 이렇게 생각하면 됩니다ㅎㅎ

 

근데 맨 마지막줄에 [Application deployment code-pipeline-1629264738186-04703ae05415cd95cd08391f310acdc63321d0d8@4/StartupStage0/AppDeployPreHook/50npm.sh] : Starting activity...에서 안넘어 가네요!!

50npm.sh 파일을 열어보니 npm install 을 실행하여 Dependency들을 설치하는 군요!!

모듈들을 설치하는 로그가 있어야 하는데 안나오는거 보니 일단 소스 문제는 아닌것 같습니다.

앗 deprecated

사용중이던 플랫폼 버전이 Deprecated 되었군요ㅠㅠ
잡은 물고기는 먹이를 주지 않는 법!!
이렇게 또 기술적 부채가 시간을 잡아 먹습니다..

하지만 저는 아래 공식을 지향합니다.

꾸준한 관리 비용 (귀찮음) > 기술적 부채 해결 시간 (한방에몰아서) = 평소엔 놀자

 

 

그런데 아직은 의심일 뿐 플랫폼 버전 때문에 모듈 설치가 안되는 것인지는 모릅니다.

로그가 안올라오는 동안 다른 서버도 한번 배포 해봅니다.

변경 사항은 없지만 배포가 잘 되나 동일한 소스를 배포해 보는 것이죠. 음..잘되는군요..

현재 배포가 안되는 서버는 일본에 있고 배포가 잘 되는 서버는 한국에 있습니다.

지역마다 네트워크 상황이 달라 일본에 있는 서버는 지연이 생겨 timeout에 걸리는 느낌적인 느낌입니다.

beanstalk에서 배포시 timeout 시간을 늘려봅니다.

 

 

[2022-07-14T05:53:40.772Z] INFO  [2535]  - [Application deployment code-pipeline-1657772924697-205ef7e8688efc2b6072d644b4944fc09ee035cf@7/StartupStage0/AppDeployPreHook/50npm.sh] : Starting activity...
[2022-07-14T06:35:25.527Z] INFO  [2535]  - [Application deployment code-pipeline-1657772924697-205ef7e8688efc2b6072d644b4944fc09ee035cf@7/StartupStage0/AppDeployPreHook/50npm.sh] : Completed activity. Result:
  + /opt/elasticbeanstalk/containerfiles/ebnode.py --action npm-install

배포에 성공합니다. 

모듈 설치하는데 38분이나 걸리네요!!  일본 나빠요

 

# 이슈 해결 프로세스

1. 이슈 발견

배포가 안됨

2. 이슈 확인

log 확인

3. 가설 설정

플랫폼 버전의 Deprecated

지역 네트워크 지연

4. 이슈 증명 및 해결

다른 지역 배포 테스트

 

 

이슈발견시 여러가지 가능성을 열어두고 접근해 간다면 해결하지 못할 문제는 없다는게 IT의 장점입니다.