묻고 답해요
140만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결AWS로 구축하는 MSA와 컨테이너 오케스트레이션
Auto Scaling Group 인스턴스 개수 관련하여 질문드립니다.
안녕하세요, AWS에 대한 기본 개념을 강사님의 강의를 통해 정말 많이 배우고 있는 학생입니다.Auto Scaling Group의 원하는 용량을 1로 설정하였을 때 인스턴스가 1개만 생성되기를 기대하였으나,2개가 생성되고 최종적으로 1개가 종료되는 현상을 확인할 수 있었는데요. 2개 인스턴스 가용영역이 다른 것으로 보아 이와 관련이 있지 않을까라고만 추측하고 있어 이렇게 질문드리게 되었습니다. 강사님 강의에서는 1로 설정하더라도 위와 같은 현상이 보이지 않았는데 혹시 제가 설정을 잘못한 것인지 궁금합니다.
-
미해결AWS로 구축하는 MSA와 컨테이너 오케스트레이션
goopang-target-group 에서 unhealthy
안녕하세요 강사님.private-ec2-instance 의 Inbound Rules 에 goopang-alb 의 http 요청을 허용해주었는데, 여전히 goopang-target-group 에서 unhealthy 로 표시됩니다. Health status details 에는 Health checks failed 로만 나옵니다..이전 강의에서 NAT Gateway, Elastic IP 를 비용 문제로 삭제를 했었는데, 이후에 강의 들의 실습을 정상 진행하려면 2개를 삭제하면 안되었나요? 이번 강의도 2개를 삭제해서 문제가 발생한 경우일까요? NAT Instance 는 삭제하지 않았습니다.
-
미해결AWS로 구축하는 MSA와 컨테이너 오케스트레이션
외부에서 private subnet 으로 HTTP 요청이 안되는 문제점
개선할 부분에 Private Subnet 으로 이동한 EC2 는 외부에서 HTTP 요청을 할 수 없게 되었다. 가 문제점으로 언급해주셨는데, 외부에서 DDoS 및 트래픽 변조 공격이 들어올 수 있기 때문에 ec2 를 Private Subnet 으로 이동해서 외부에서의 공격(HTTP 요청 포함)을 막은 것이 아니었나요? 그리고 HTTP 요청은 Public Subnet 을 통해 들어가서 Private Subnet 으로 통신해주는 흐름 아닌가요? 어떤 것이 문제점이 되는 건지 헷갈리네요..
-
미해결AWS로 구축하는 MSA와 컨테이너 오케스트레이션
curl -XGET 'localhost/health_check' 명령어에 실패합니다.
다른 질문 글을 보고, NAT Gateway 생성 및 Route Table 도 재설정해주었지만, 여전히curl -XGET 'localhost/health_check' 명령어에 실패합니다.cat /var/log/cloud-init-output.log 실행시에 아래와 같은 log 가 찍힙니다.git 과 JDK, git clone 모두 진행이 제대로 되지 않는 것으로 보이는데 원인을 잘 모르겠습니다. User Data 에 스크립트는 제대로 작성되어 있는 것을 확인했습니다.Cloud-init v. 22.2.2 running 'modules:config' at Tue, 22 Oct 2024 14:53:05 +0000. Up 7.18 seconds. Cloud-init v. 22.2.2 running 'modules:final' at Tue, 22 Oct 2024 14:53:06 +0000. Up 7.95 seconds. Amazon Linux 2023 repository 0.0 B/s | 0 B 06:00 Errors during downloading metadata for repository 'amazonlinux': - Curl error (28): Timeout was reached for https://al2023-repos-ap-northeast-2-de612dc2.s3.dualstack.ap-northeast-2.amazonaws.com/core/mirrors/2023.6.20241010/aarch64/mirror.list [Connection timeout after 30001 ms] - Curl error (28): Timeout was reached for https://al2023-repos-ap-northeast-2-de612dc2.s3.dualstack.ap-northeast-2.amazonaws.com/core/mirrors/2023.6.20241010/aarch64/mirror.list [Connection timeout after 30002 ms] Error: Failed to download metadata for repo 'amazonlinux': Cannot prepare internal mirrorlist: Curl error (28): Timeout was reached for https://al2023-repos-ap-northeast-2-de612dc2.s3.dualstack.ap-northeast-2.amazonaws.com/core/mirrors/2023.6.20241010/aarch64/mirror.list [Connection timeout after 30001 ms] Amazon Linux 2023 Kernel Livepatch repository 0.0 B/s | 0 B 06:00 Errors during downloading metadata for repository 'kernel-livepatch': - Curl error (28): Timeout was reached for https://al2023-repos-ap-northeast-2-de612dc2.s3.dualstack.ap-northeast-2.amazonaws.com/kernel-livepatch/mirrors/al2023/aarch64/mirror.list [Failed to connect to al2023-repos-ap-northeast-2-de612dc2.s3.dualstack.ap-northeast-2.amazonaws.com port 443 after 30001 ms: Timeout was reached] - Curl error (28): Timeout was reached for https://al2023-repos-ap-northeast-2-de612dc2.s3.dualstack.ap-northeast-2.amazonaws.com/kernel-livepatch/mirrors/al2023/aarch64/mirror.list [Failed to connect to al2023-repos-ap-northeast-2-de612dc2.s3.dualstack.ap-northeast-2.amazonaws.com port 443 after 30000 ms: Timeout was reached] - Curl error (28): Timeout was reached for https://al2023-repos-ap-northeast-2-de612dc2.s3.dualstack.ap-northeast-2.amazonaws.com/kernel-livepatch/mirrors/al2023/aarch64/mirror.list [Failed to connect to al2023-repos-ap-northeast-2-de612dc2.s3.dualstack.ap-northeast-2.amazonaws.com port 443 after 30002 ms: Timeout was reached] - Curl error (28): Timeout was reached for https://al2023-repos-ap-northeast-2-de612dc2.s3.dualstack.ap-northeast-2.amazonaws.com/kernel-livepatch/mirrors/al2023/aarch64/mirror.list [Connection timeout after 30002 ms] - Curl error (28): Timeout was reached for https://al2023-repos-ap-northeast-2-de612dc2.s3.dualstack.ap-northeast-2.amazonaws.com/kernel-livepatch/mirrors/al2023/aarch64/mirror.list [Connection timeout after 30000 ms] - Curl error (28): Timeout was reached for https://al2023-repos-ap-northeast-2-de612dc2.s3.dualstack.ap-northeast-2.amazonaws.com/kernel-livepatch/mirrors/al2023/aarch64/mirror.list [Connection timeout after 30001 ms] Error: Failed to download metadata for repo 'kernel-livepatch': Cannot prepare internal mirrorlist: Curl error (28): Timeout was reached for https://al2023-repos-ap-northeast-2-de612dc2.s3.dualstack.ap-northeast-2.amazonaws.com/kernel-livepatch/mirrors/al2023/aarch64/mirror.list [Connection timeout after 30000 ms] Ignoring repositories: amazonlinux, kernel-livepatch Error encountered while trying to retrieve release update information: Unable to retrieve release info data. Curl error (28): Timeout was reached for https://al2023-repos-ap-northeast-2-de612dc2.s3.dualstack.ap-northeast-2.amazonaws.com/core/releasemd.xml [Connection timeout after 30001 ms] Dependencies resolved. Nothing to do. Complete! Amazon Linux 2023 repository 0.0 B/s | 0 B 06:00 Errors during downloading metadata for repository 'amazonlinux': - Curl error (28): Timeout was reached for https://al2023-repos-ap-northeast-2-de612dc2.s3.dualstack.ap-northeast-2.amazonaws.com/core/mirrors/2023.6.20241010/aarch64/mirror.list [Connection timeout after 30000 ms] - Curl error (28): Timeout was reached for https://al2023-repos-ap-northeast-2-de612dc2.s3.dualstack.ap-northeast-2.amazonaws.com/core/mirrors/2023.6.20241010/aarch64/mirror.list [Connection timeout after 30001 ms] Error: Failed to download metadata for repo 'amazonlinux': Cannot prepare internal mirrorlist: Curl error (28): Timeout was reached for https://al2023-repos-ap-northeast-2-de612dc2.s3.dualstack.ap-northeast-2.amazonaws.com/core/mirrors/2023.6.20241010/aarch64/mirror.list [Connection timeout after 30000 ms] Amazon Linux 2023 Kernel Livepatch repository 0.0 B/s | 0 B 06:00 Errors during downloading metadata for repository 'kernel-livepatch': - Curl error (28): Timeout was reached for https://al2023-repos-ap-northeast-2-de612dc2.s3.dualstack.ap-northeast-2.amazonaws.com/kernel-livepatch/mirrors/al2023/aarch64/mirror.list [Connection timeout after 30000 ms] - Curl error (28): Timeout was reached for https://al2023-repos-ap-northeast-2-de612dc2.s3.dualstack.ap-northeast-2.amazonaws.com/kernel-livepatch/mirrors/al2023/aarch64/mirror.list [Connection timeout after 30001 ms] Error: Failed to download metadata for repo 'kernel-livepatch': Cannot prepare internal mirrorlist: Curl error (28): Timeout was reached for https://al2023-repos-ap-northeast-2-de612dc2.s3.dualstack.ap-northeast-2.amazonaws.com/kernel-livepatch/mirrors/al2023/aarch64/mirror.list [Connection timeout after 30001 ms] Ignoring repositories: amazonlinux, kernel-livepatch No match for argument: java-17-amazon-corretto-devel Error: Unable to find a match: java-17-amazon-corretto-devel Amazon Linux 2023 repository 0.0 B/s | 0 B 06:00 Errors during downloading metadata for repository 'amazonlinux': - Curl error (28): Timeout was reached for https://al2023-repos-ap-northeast-2-de612dc2.s3.dualstack.ap-northeast-2.amazonaws.com/core/mirrors/2023.6.20241010/aarch64/mirror.list [Connection timeout after 30002 ms] - Curl error (28): Timeout was reached for https://al2023-repos-ap-northeast-2-de612dc2.s3.dualstack.ap-northeast-2.amazonaws.com/core/mirrors/2023.6.20241010/aarch64/mirror.list [Connection timeout after 30001 ms] Error: Failed to download metadata for repo 'amazonlinux': Cannot prepare internal mirrorlist: Curl error (28): Timeout was reached for https://al2023-repos-ap-northeast-2-de612dc2.s3.dualstack.ap-northeast-2.amazonaws.com/core/mirrors/2023.6.20241010/aarch64/mirror.list [Connection timeout after 30001 ms] Amazon Linux 2023 Kernel Livepatch repository 0.0 B/s | 0 B 06:00 Errors during downloading metadata for repository 'kernel-livepatch': - Curl error (28): Timeout was reached for https://al2023-repos-ap-northeast-2-de612dc2.s3.dualstack.ap-northeast-2.amazonaws.com/kernel-livepatch/mirrors/al2023/aarch64/mirror.list [Connection timeout after 30001 ms] - Curl error (28): Timeout was reached for https://al2023-repos-ap-northeast-2-de612dc2.s3.dualstack.ap-northeast-2.amazonaws.com/kernel-livepatch/mirrors/al2023/aarch64/mirror.list [Failed to connect to al2023-repos-ap-northeast-2-de612dc2.s3.dualstack.ap-northeast-2.amazonaws.com port 443 after 30001 ms: Timeout was reached] - Curl error (28): Timeout was reached for https://al2023-repos-ap-northeast-2-de612dc2.s3.dualstack.ap-northeast-2.amazonaws.com/kernel-livepatch/mirrors/al2023/aarch64/mirror.list [Connection timeout after 30002 ms] Error: Failed to download metadata for repo 'kernel-livepatch': Cannot prepare internal mirrorlist: Curl error (28): Timeout was reached for https://al2023-repos-ap-northeast-2-de612dc2.s3.dualstack.ap-northeast-2.amazonaws.com/kernel-livepatch/mirrors/al2023/aarch64/mirror.list [Connection timeout after 30001 ms] Ignoring repositories: amazonlinux, kernel-livepatch No match for argument: git Error: Unable to find a match: git /var/lib/cloud/instance/scripts/part-001: line 11: git: command not found /var/lib/cloud/instance/scripts/part-001: line 14: cd: aws-operation-prac: No such file or directory /var/lib/cloud/instance/scripts/part-001: line 17: ./gradlew: No such file or directory sudo: java: command not found 2024-10-22 15:31:09,338 - cc_scripts_user.py[WARNING]: Failed to run module scripts-user (scripts in /var/lib/cloud/instance/scripts) 2024-10-22 15:31:09,340 - util.py[WARNING]: Running module scripts-user (<module 'cloudinit.config.cc_scripts_user' from '/usr/lib/python3.9/site-packages/cloudinit/config/cc_scripts_user.py'>) failed Cloud-init v. 22.2.2 finished at Tue, 22 Oct 2024 15:31:09 +0000. Datasource DataSourceEc2. Up 2290.97 seconds Cloud-init v. 22.2.2 running 'init' at Tue, 22 Oct 2024 16:16:20 +0000. Up 5.11 seconds.질문 글에 10000 자 이상으로 작성이 되지 않아 log 중 핵심되는 내용으로 추정되는 부분만 복붙했습니다.
-
미해결AWS로 구축하는 MSA와 컨테이너 오케스트레이션
aws ecs의 service 생성 오류
강의 너무 잘 듣고 있습니다! aws 사용만 할줄 알았지 이렇게 심도있게 공부하는건 처음인거 같습니다! 저는 강사님이 하신 코드와 비슷하게 쇼핑몰 웹사이트 백엔드 개발을 해보려고 user, product 서버를 만들고 aws ecr과 aws ecs를 이용해서 배포하려고 했습니다. 그래서 vpc부터 alb까지 따라했고, aws ecs 태스크, 클러스트까지 만들었지만 ecs 서비스를 만들려고 할때 user-service 배포 중 오류가 발생했습니다.Resource handler returned message: "Error occurred during operation 'ECS Deployment Circuit Breaker was triggered'." (RequestToken: a2db5dfb-7a55-ce69-fb99-854b5e0efc28, HandlerErrorCode: GeneralServiceException)health-check는 200으로 잘 돌아오는데 계속 서비스 생성에 실패하는 오류가 발생합니다. 서버 2개가 있는데 서버별로 각각 task를 만들고, 그에 해당하는 서비스도 각각 생성해야 하는게 맞는지 여쭤보고 싶었습니다.
-
미해결AWS로 구축하는 MSA와 컨테이너 오케스트레이션
ecs task error
task가 생성이 안되요 ㅠㅠ 보안그룹이랑 andpoint 확인해봐도 못찾겠어서 nat gateway 설정해봐도 똑같이 안되네요 ㅜㅠ
-
미해결AWS로 구축하는 MSA와 컨테이너 오케스트레이션
lambda 인증
토큰을 설정해 접속하는거에서 헤더를 넣어서 요청을 보내면 500에러가 뜹니다 node.js20버전으로 설정했는데 그게문제일까요? 그래서 요렇게 바꿔서 해봤는데도 안되요ㅜㅜexports.handler = async (event) => { // 요청의 authorization 헤더를 받아옴 const rawToken = event.headers?.authorization; // 미리 정의된 토큰 값 const token = "userToken123"; // 토큰 유효성 검사 if (rawToken === token) { // 인증 성공: 올바른 HTTP 응답 형식으로 반환 return { statusCode: 200, body: JSON.stringify({ isAuthorized: true }) }; } else { // 인증 실패: 401 Unauthorized 응답 return { statusCode: 401, body: JSON.stringify({ message: "Unauthorized" }) }; } }; 권한부여자 빼면 접속 잘됩니다
-
미해결AWS로 구축하는 MSA와 컨테이너 오케스트레이션
lamda node.js 16 버전
현재는 node.js 18버전이 가장 구버전인 버전이라 현재 테스트는 불가능한건가요? 따라해봤는데 안돼서요
-
미해결AWS로 구축하는 MSA와 컨테이너 오케스트레이션
user-data의 git clone이 동작하지 않는것 같습니다.
user-data 스크립트를 복사하여 진행하였습니다. 깃 클론이 동작하지 않는것 같으며, 몇개의 인스턴스를 새로 만들어 보았으나 똑같은 상황이고, 직접 복사해서 터미널에 붙여 넣으니 정상적으로 클론 & 빌드 됩니다. 헤결해보려했으나 잘 안되서 질문드립니다.. 어디서 실수를 한것일까요?---------------------------------------------------------cat /var/log/cloud-init-output.logCloud-init v. 22.2.2 running 'init' at Wed, 25 Sep 2024 05:33:28 +0000. Up 5.06 seconds.ci-info: ++++++++++++++++++++++++++++++++++++++Net device info+++++++++++++++++++++++++++++++++++++++ci-info: +--------+------+-----------------------------+---------------+--------+-------------------+ci-info: | Device | Up | Address | Mask | Scope | Hw-Address |ci-info: +--------+------+-----------------------------+---------------+--------+-------------------+ci-info: | ens5 | True | 10.0.2.183 | 255.255.255.0 | global | 0a:46:c1:75:88:63 |ci-info: | ens5 | True | fe80::846:c1ff:fe75:8863/64 | . | link | 0a:46:c1:75:88:63 |ci-info: | lo | True | 127.0.0.1 | 255.0.0.0 | host | . |ci-info: | lo | True | ::1/128 | . | host | . |ci-info: +--------+------+-----------------------------+---------------+--------+-------------------+ci-info: ++++++++++++++++++++++++++++Route IPv4 info+++++++++++++++++++++++++++++ci-info: +-------+-------------+----------+-----------------+-----------+-------+ci-info: | Route | Destination | Gateway | Genmask | Interface | Flags |ci-info: +-------+-------------+----------+-----------------+-----------+-------+ci-info: | 0 | 0.0.0.0 | 10.0.2.1 | 0.0.0.0 | ens5 | UG |ci-info: | 1 | 10.0.0.2 | 10.0.2.1 | 255.255.255.255 | ens5 | UGH |ci-info: | 2 | 10.0.2.0 | 0.0.0.0 | 255.255.255.0 | ens5 | U |ci-info: | 3 | 10.0.2.1 | 0.0.0.0 | 255.255.255.255 | ens5 | UH |ci-info: +-------+-------------+----------+-----------------+-----------+-------+ci-info: +++++++++++++++++++Route IPv6 info+++++++++++++++++++ci-info: +-------+-------------+---------+-----------+-------+ci-info: | Route | Destination | Gateway | Interface | Flags |ci-info: +-------+-------------+---------+-----------+-------+ci-info: | 0 | fe80::/64 | :: | ens5 | U |ci-info: | 2 | local | :: | ens5 | U |ci-info: | 3 | multicast | :: | ens5 | U |ci-info: +-------+-------------+---------+-----------+-------+Generating public/private ed25519 key pair.Your identification has been saved in /etc/ssh/ssh_host_ed25519_keyYour public key has been saved in /etc/ssh/ssh_host_ed25519_key.pubThe key fingerprint is:SHA256:fpsHSruoIojFa8d8/mYqtdccZq0Cr3EmxaAgllKrGAI root@ip-10-0-2-183.eu-north-1.compute.internalThe key's randomart image is:+--[ED25519 256]--+|E . ||.... ||=oo . ||=+ . . o ||o. . S . || o oo. = . ||o. + .o=+B.+ ||+ + = o*O.+o. || o o.==Booo. |+----[SHA256]-----+Generating public/private ecdsa key pair.Your identification has been saved in /etc/ssh/ssh_host_ecdsa_keyYour public key has been saved in /etc/ssh/ssh_host_ecdsa_key.pubThe key fingerprint is:SHA256:/A37KFDhyVfBSIbDAullypcuJM8J98k4VrUgMrAgNBI root@ip-10-0-2-183.eu-north-1.compute.internalThe key's randomart image is:+---[ECDSA 256]---+|E= .o . ooo.. ||+.+ o = *.. o ||. = = B = . || o +. . || B O oS.. || O * . + || . o . o . || . o || .. . |+----[SHA256]-----+Cloud-init v. 22.2.2 running 'modules:config' at Wed, 25 Sep 2024 05:33:30 +0000. Up 7.27 seconds.Cloud-init v. 22.2.2 running 'modules:final' at Wed, 25 Sep 2024 05:33:31 +0000. Up 7.97 seconds.Amazon Linux 2023 repository 49 MB/s | 27 MB 00:00 Amazon Linux 2023 Kernel Livepatch repository 42 kB/s | 8.3 kB 00:00 Last metadata expiration check: 0:00:01 ago on Wed Sep 25 05:33:43 2024.Dependencies resolved.Nothing to do.Complete!Last metadata expiration check: 0:00:02 ago on Wed Sep 25 05:33:43 2024.Dependencies resolved.======================================================================================== Package Arch Version Repository Size========================================================================================Installing: java-17-amazon-corretto-headless aarch64 1:17.0.12+7-1.amzn2023.1 amazonlinux 91 MInstalling dependencies: alsa-lib aarch64 1.2.7.2-1.amzn2023.0.2 amazonlinux 492 k cairo aarch64 1.17.6-2.amzn2023.0.1 amazonlinux 669 k dejavu-sans-fonts noarch 2.37-16.amzn2023.0.2 amazonlinux 1.3 M dejavu-sans-mono-fonts noarch 2.37-16.amzn2023.0.2 amazonlinux 467 k dejavu-serif-fonts noarch 2.37-16.amzn2023.0.2 amazonlinux 1.0 M fontconfig aarch64 2.13.94-2.amzn2023.0.2 amazonlinux 278 k fonts-filesystem noarch 1:2.0.5-12.amzn2023.0.2 amazonlinux 9.5 k freetype aarch64 2.13.2-5.amzn2023.0.1 amazonlinux 413 k google-noto-fonts-common noarch 20201206-2.amzn2023.0.2 amazonlinux 15 k google-noto-sans-vf-fonts noarch 20201206-2.amzn2023.0.2 amazonlinux 492 k graphite2 aarch64 1.3.14-7.amzn2023.0.2 amazonlinux 93 k harfbuzz aarch64 7.0.0-2.amzn2023.0.1 amazonlinux 843 k javapackages-filesystem noarch 6.0.0-7.amzn2023.0.6 amazonlinux 12 k langpacks-core-font-en noarch 3.0-21.amzn2023.0.4 amazonlinux 10 k libX11 aarch64 1.7.2-3.amzn2023.0.4 amazonlinux 648 k libX11-common noarch 1.7.2-3.amzn2023.0.4 amazonlinux 152 k libXau aarch64 1.0.9-6.amzn2023.0.2 amazonlinux 32 k libXext aarch64 1.3.4-6.amzn2023.0.2 amazonlinux 40 k libXrender aarch64 0.9.10-14.amzn2023.0.2 amazonlinux 27 k libbrotli aarch64 1.0.9-4.amzn2023.0.2 amazonlinux 316 k libjpeg-turbo aarch64 2.1.4-2.amzn2023.0.5 amazonlinux 191 k libpng aarch64 2:1.6.37-10.amzn2023.0.6 amazonlinux 121 k libxcb aarch64 1.13.1-7.amzn2023.0.2 amazonlinux 231 k pixman aarch64 0.40.0-3.amzn2023.0.3 amazonlinux 194 k xml-common noarch 0.6.3-56.amzn2023.0.2 amazonlinux 32 kTransaction Summary========================================================================================Install 26 PackagesTotal download size: 99 MInstalled size: 273 MDownloading Packages:(1/26): dejavu-sans-fonts-2.37-16.amzn2023.0.2. 16 MB/s | 1.3 MB 00:00 (2/26): cairo-1.17.6-2.amzn2023.0.1.aarch64.rpm 6.4 MB/s | 669 kB 00:00 (3/26): alsa-lib-1.2.7.2-1.amzn2023.0.2.aarch64 4.5 MB/s | 492 kB 00:00 (4/26): dejavu-sans-mono-fonts-2.37-16.amzn2023 15 MB/s | 467 kB 00:00 (5/26): dejavu-serif-fonts-2.37-16.amzn2023.0.2 32 MB/s | 1.0 MB 00:00 (6/26): fonts-filesystem-2.0.5-12.amzn2023.0.2. 402 kB/s | 9.5 kB 00:00 (7/26): fontconfig-2.13.94-2.amzn2023.0.2.aarch 6.3 MB/s | 278 kB 00:00 (8/26): google-noto-fonts-common-20201206-2.amz 876 kB/s | 15 kB 00:00 (9/26): google-noto-sans-vf-fonts-20201206-2.am 19 MB/s | 492 kB 00:00 (10/26): freetype-2.13.2-5.amzn2023.0.1.aarch64 8.6 MB/s | 413 kB 00:00 (11/26): graphite2-1.3.14-7.amzn2023.0.2.aarch6 2.5 MB/s | 93 kB 00:00 (12/26): javapackages-filesystem-6.0.0-7.amzn20 602 kB/s | 12 kB 00:00 (13/26): langpacks-core-font-en-3.0-21.amzn2023 636 kB/s | 10 kB 00:00 (14/26): harfbuzz-7.0.0-2.amzn2023.0.1.aarch64. 14 MB/s | 843 kB 00:00 (15/26): libX11-common-1.7.2-3.amzn2023.0.4.noa 5.8 MB/s | 152 kB 00:00 (16/26): libX11-1.7.2-3.amzn2023.0.4.aarch64.rp 12 MB/s | 648 kB 00:00 (17/26): libXau-1.0.9-6.amzn2023.0.2.aarch64.rp 1.1 MB/s | 32 kB 00:00 (18/26): libXrender-0.9.10-14.amzn2023.0.2.aarc 1.5 MB/s | 27 kB 00:00 (19/26): libXext-1.3.4-6.amzn2023.0.2.aarch64.r 1.2 MB/s | 40 kB 00:00 (20/26): libbrotli-1.0.9-4.amzn2023.0.2.aarch64 6.1 MB/s | 316 kB 00:00 (21/26): libjpeg-turbo-2.1.4-2.amzn2023.0.5.aar 3.7 MB/s | 191 kB 00:00 (22/26): libpng-1.6.37-10.amzn2023.0.6.aarch64. 2.6 MB/s | 121 kB 00:00 (23/26): libxcb-1.13.1-7.amzn2023.0.2.aarch64.r 5.2 MB/s | 231 kB 00:00 (24/26): xml-common-0.6.3-56.amzn2023.0.2.noarc 1.7 MB/s | 32 kB 00:00 (25/26): pixman-0.40.0-3.amzn2023.0.3.aarch64.r 4.1 MB/s | 194 kB 00:00 (26/26): java-17-amazon-corretto-headless-17.0. 79 MB/s | 91 MB 00:01 --------------------------------------------------------------------------------Total 69 MB/s | 99 MB 00:01 [ec2-user@ip-10-0-2-183 ~]$ vi /var/log/cloud-init-output.log[ec2-user@ip-10-0-2-183 ~]$ ping github.comPING github.com (140.82.121.3) 56(84) bytes of data.64 bytes from lb-140-82-121-3-fra.github.com (140.82.121.3): icmp_seq=1 ttl=49 time=21.3 ms64 bytes from lb-140-82-121-3-fra.github.com (140.82.121.3): icmp_seq=2 ttl=49 time=21.4 ms64 bytes from lb-140-82-121-3-fra.github.com (140.82.121.3): icmp_seq=3 ttl=49 time=21.4 ms^C--- github.com ping statistics ---3 packets transmitted, 3 received, 0% packet loss, time 2004msrtt min/avg/max/mdev = 21.284/21.366/21.423/0.059 ms[ec2-user@ip-10-0-2-183 ~]$ ls -ltotal 0[ec2-user@ip-10-0-2-183 ~]$
-
미해결AWS로 구축하는 MSA와 컨테이너 오케스트레이션
장바구니 서비스 연결 실패
위는 현재 설정상태이고, 컨테이너도 잘 실행되는 상태에서아래처럼 조회가 장바구니 서비스만 실패하는 상황입니다(장바구니 서비스 배포 시 사용한 명령어docker run --rm -d -p 8000:8000 --network goopang-network -e "msa.product-service.url=product-service-container:8001" -e "msa.user-service.url=user-service-container:8002" --name cart-service-container -t 009160049723.dkr.ecr.ap-northeast-2.amazonaws.com/goopang-cart-service) 메시지는 거부되었다는 메시지이긴 한데.. 8000번은 정상적으로 설정한 것 같거든요, 컨테이너도 잘 실행되고있구요(API 요청했을 때 컨테이너에 로그가 실시간으로 찍히는지도 봤는데 별다른 로그가 찍히지는 않는것 같아보입니다) 혹시 살펴볼 것이 있을까요?
-
미해결AWS로 구축하는 MSA와 컨테이너 오케스트레이션
디비 연결 안돼요 ㅠ
연결이 왜 안될까요 ㅜ #!/bin/bash# ecr 로그인aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 963475970914.dkr.ecr.us-east-1.amazonaws.com# 컨테이너 실행docker run -p 80:8002 --name user-service-container \-e "spring.datasource.url=jdbc:postgresql://geonmin-rds-db.cn6c8q4o89q7.us-east-1.rds.amazonaws.com:5432/user_database" \-e "spring.datasource.username=postgres" \-e "spring.datasource.password=postgress" \-e "spring.datasource.driverClassName=org.postgresql.Driver" \-t 963475970914.dkr.ecr.us-east-1.amazonaws.com/user-service
-
미해결AWS로 구축하는 MSA와 컨테이너 오케스트레이션
user service 실행오류
postgres 컨테이너를 올리고 user service 실행을 하는데 오류가 떠요 ㅜㅠ 왠 구팡 네트워크 이미지를 찾는건지 도와주세요!!
-
미해결AWS로 구축하는 MSA와 컨테이너 오케스트레이션
컨테이너 환경에서 MSA 테스트 (실습) 강의에서..
실습 따라해보려는데 기본적으로 앱 빌드에 필요한 파일들은 어떻게 로컬환경에 받아야 하나요? 수업 자체는 잘 이해가 되는데 실습이 안돼서.. 강의에서 놓친게 있나 싶어서 질문드립니다
-
해결됨AWS로 구축하는 MSA와 컨테이너 오케스트레이션
EC2 하나만 운용시 로드밸런서를 설정해야하는지
만약 스프링 부트 서버용 EC2 한 개만 운용한다면 굳이 로드밸런서를 설정하지 않아도 괜찮을까요? 그리고 만약 스프링부트 서버용 EC2를 2, 3개 더 만든다면 프리티어단계에선 탄력적 IP에 대한 요금만 부과되는 것인지, EC2 인스턴스 갯수만큼 요금이 나오는 것인지 궁금합니다.
-
미해결AWS로 구축하는 MSA와 컨테이너 오케스트레이션
스크립트 오류
#!/bin/bash git clone -b 5_1_monolithic_s3 https://github.com/burger-2023/aws-operation-prac.git cd /aws-operation-prac ./gradlew build sudo java -jar build/libs/aws-msa-monolithic-prac-0.1.jar \ --spring.datasource.url=jdbc:postgresql://비밀:5432/geonmin_database \ --spring.datasource.username=postgres \ --spring.datasource.password=postgress \ --cloud.aws.s3.bucket=geonmin-bucket-test \ --cloud.aws.region.static=us-east-1빌드까지는 잘되는거 같은데 마지막줄이 오류납니다 ㅜㅠ 원인을 모르겠어요 그리고 강사님이 밑에 써준 스크립트 예시에 버킷 들어가기전에 \ 하나가 빠진거 같아요
-
미해결AWS로 구축하는 MSA와 컨테이너 오케스트레이션
rds 사용자 구성 명령어가 실행이 안되요
영상처럼 시작 템플릿 바꾸고 오토스케일링 그룹 설정 새로운버전으로 바꾸고 로드밸런서 dns 주소로 health체크를 해봤는데 502에러가 뜨고 안되서 여러가지 다 확인해봤는데ec2 만들어지고 git clone 자체가 안되었더라고요 사용자 데이터 명령어 자체가 실행이 안됩니다 직접 들어가서 명령어를 치면 먹습니다 네트워크 문제도아니고 패키지 다운로드 안한것도 아닌데 사용자 데이터 명령어가 git clone 시작도 안되면 어떻게 해결해야될까요? git clone은 되었지만 괜한 root 계정 밑에서만 조회해서 못봤던거... 강사님 해결해주셔서 감사합니다!
-
미해결AWS로 구축하는 MSA와 컨테이너 오케스트레이션
rds read replica 접속 에러
시작 템플릿 - 유저 데이터에 write와 read 설정하고 오토스케일링 돌렸는데 에러가 납니다. 시작 템플릿에서 테스트로 인스턴스 생성해서 확인해보니 write는 문제 없는데 read에서 에러가 나옵니다. (여러번 설정해봄)ssh 접속해서 아래부분 실행 시 에러... 무슨 문제 일까요?java -jar build/libs/aws-msa-monolithic-prac-0.1.jar \ --spring.datasource.write.jdbc-url=jdbc:postgresql://goopang-rds-db.*****.ap-northeast-2.rds.amazonaws.com:5432:goopang_database \ --spring.datasource.write.username=postgres \ --spring.datasource.write.password=**** \ --spring.datasource.read.jdbc-url=jdbc:postgresql://goopang-rds-db-read-replica.****.ap-northeast-2.rds.amazonaws.com:5432:goopang_database \ --spring.datasource.read.username=postgres \ --spring.datasource.read.password=****2024-08-31T02:10:00.841Z ERROR 2333 --- [ main] j.LocalContainerEntityManagerFactoryBean : Failed to initialize JPA EntityManagerFactory: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment] due to: Unable to determine Dialect without JDBC metadata (please set 'javax.persistence.jdbc.url', 'hibernate.connection.url', or 'hibernate.dialect') 2024-08-31T02:10:00.907Z ERROR 2333 --- [ main] o.s.boot.SpringApplication : Application run failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment] due to: Unable to determine Dialect without JDBC metadata (please set 'javax.persistence.jdbc.url', 'hibernate.connection.url', or 'hibernate.dialect') at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1770) ~[spring-beans-6.0.9.jar!/:6.0.9] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:598) ~[spring-beans-6.0.9.jar!/:6.0.9] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:520) ~[spring-beans-6.0.9.jar!/:6.0.9] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[spring-beans-6.0.9.jar!/:6.0.9] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.0.9.jar!/:6.0.9] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[spring-beans-6.0.9.jar!/:6.0.9] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[spring-beans-6.0.9.jar!/:6.0.9] at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1156) ~[spring-context-6.0.9.jar!/:6.0.9] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:931) ~[spring-context-6.0.9.jar!/:6.0.9] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:608) ~[spring-context-6.0.9.jar!/:6.0.9] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.1.0.jar!/:3.1.0] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:733) ~[spring-boot-3.1.0.jar!/:3.1.0] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:435) ~[spring-boot-3.1.0.jar!/:3.1.0] at org.springframework.boot.SpringApplication.run(SpringApplication.java:311) ~[spring-boot-3.1.0.jar!/:3.1.0] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1305) ~[spring-boot-3.1.0.jar!/:3.1.0] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1294) ~[spring-boot-3.1.0.jar!/:3.1.0] at com.prac.monolithic.awsmsamonolithicprac.AwsMsaMonolithicPracApplicationKt.main(AwsMsaMonolithicPracApplication.kt:13) ~[classes!/:0.1] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] at java.base/java.lang.reflect.Method.invoke(Method.java:569) ~[na:na] at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) ~[aws-msa-monolithic-prac-0.1.jar:0.1] at org.springframework.boot.loader.Launcher.launch(Launcher.java:95) ~[aws-msa-monolithic-prac-0.1.jar:0.1] at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) ~[aws-msa-monolithic-prac-0.1.jar:0.1] at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:65) ~[aws-msa-monolithic-prac-0.1.jar:0.1] Caused by: org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment] due to: Unable to determine Dialect without JDBC metadata (please set 'javax.persistence.jdbc.url', 'hibernate.connection.url', or 'hibernate.dialect') at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:277) ~[hibernate-core-6.2.2.Final.jar!/:6.2.2.Final] at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:239) ~[hibernate-core-6.2.2.Final.jar!/:6.2.2.Final] at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:216) ~[hibernate-core-6.2.2.Final.jar!/:6.2.2.Final] at org.hibernate.boot.model.relational.Database.<init>(Database.java:45) ~[hibernate-core-6.2.2.Final.jar!/:6.2.2.Final] at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.getDatabase(InFlightMetadataCollectorImpl.java:229) ~[hibernate-core-6.2.2.Final.jar!/:6.2.2.Final] at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.<init>(InFlightMetadataCollectorImpl.java:197) ~[hibernate-core-6.2.2.Final.jar!/:6.2.2.Final] at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:166) ~[hibernate-core-6.2.2.Final.jar!/:6.2.2.Final] at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata(EntityManagerFactoryBuilderImpl.java:1380) ~[hibernate-core-6.2.2.Final.jar!/:6.2.2.Final] at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1451) ~[hibernate-core-6.2.2.Final.jar!/:6.2.2.Final] at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:66) ~[spring-orm-6.0.9.jar!/:6.0.9] at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:376) ~[spring-orm-6.0.9.jar!/:6.0.9] at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:409) ~[spring-orm-6.0.9.jar!/:6.0.9] at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:396) ~[spring-orm-6.0.9.jar!/:6.0.9] at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:352) ~[spring-orm-6.0.9.jar!/:6.0.9] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1816) ~[spring-beans-6.0.9.jar!/:6.0.9] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1766) ~[spring-beans-6.0.9.jar!/:6.0.9] ... 24 common frames omitted Caused by: org.hibernate.HibernateException: Unable to determine Dialect without JDBC metadata (please set 'javax.persistence.jdbc.url', 'hibernate.connection.url', or 'hibernate.dialect') at org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl.determineDialect(DialectFactoryImpl.java:188) ~[hibernate-core-6.2.2.Final.jar!/:6.2.2.Final] at org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl.buildDialect(DialectFactoryImpl.java:87) ~[hibernate-core-6.2.2.Final.jar!/:6.2.2.Final] at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:274) ~[hibernate-core-6.2.2.Final.jar!/:6.2.2.Final] at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:34) ~[hibernate-core-6.2.2.Final.jar!/:6.2.2.Final] at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:119) ~[hibernate-core-6.2.2.Final.jar!/:6.2.2.Final] at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:264) ~[hibernate-core-6.2.2.Final.jar!/:6.2.2.Final] ... 39 common frames omitted 2024-08-31 02:10:01,061 - cc_scripts_user.py[WARNING]: Failed to run module scripts-user (scripts in /var/lib/cloud/instance/scripts) 2024-08-31 02:10:01,064 - util.py[WARNING]: Running module scripts-user (<module 'cloudinit.config.cc_scripts_user' from '/usr/lib/python3.9/site-packages/cloudinit/config/cc_scripts_user.py'>) failed Cloud-init v. 22.2.2 finished at Sat, 31 Aug 2024 02:10:01 +0000. Datasource DataSourceEc2. Up 122.75 seconds [root@ip-10-0-1-8 aws-operation-prac]#
-
미해결AWS로 구축하는 MSA와 컨테이너 오케스트레이션
인스턴스 타겟그룹 등록 언헬시
인스턴스 만들때 라우팅 테이블 어떻게 설정 되어 있나요 nat랑 연결되어있나요?
-
미해결AWS로 구축하는 MSA와 컨테이너 오케스트레이션
ECS Fargate 배포후 504 time-out
안녕하세요, 회사에서 GCP에서 AWS로 인프라를 이관 중에 있습니다. 강의를 들으면서 개발 서버를 이관했고 ECS에 서비스를 작동 중입니다. 하지만, Deploy는 Failed 하고 504 timeout-error가 발생하면서 ALB의 IP들도 모두 unhealthy 상태입니다. 이상한 점은 ECS에서 서비스 로그를 확인하면 스케줄러로 등록해뒀던 작업들이 실행되는 로그를 확인할 수 있습니다. 이로 미루어 볼때 서버는 실행이 되고 있는 상태이나 외부에서 접근이 안되는 것 같아 security-group 과 vpc 설정, 포트도 확인을 해봤었는데요. 그래도 해결을 못하고 있어서 이렇게 질문 남겨 둡니다. ㅠㅠALB Resource map2. ECS service 상태서비스 이벤트 로그 service has started 1 tasks: task ******* Amazon ECS replaced 1 tasks due to an unhealthy status.service registered 1 targets in target-group *****service port 3000 is unhealthy in target-group *** due to (reason Health checks failed).service deployment *** deployment failed: tasks failed to start.
-
미해결AWS로 구축하는 MSA와 컨테이너 오케스트레이션
NAT gateway 비용 절감을 위한 NAT instance (실습) 수업노트 오타
네트워크 인터페이스 이름을 확인 명령어natstat -i오타 제보합니다!netstat -i