소개
게시글
질문&답변
goopang-target-group 에서 unhealthy
네 맞습니다.하나의 인스턴스에서 유저 데이터 스크립트가 초기에 함번 실행되고, 중단하고 다시 시작할땐 스크립트기 실행되지 않습니다.현재 구조로 답변 드리면 계속 접속해서 실행시켜줘야하는게 맞습니다.하지만 이후 강의에서 배우게 되는 시작템플릿과 오토스케일링 그룹을 도입하게 되면 이런 부분은 간단하게 해결되니 이후 강의도 수강해주시면 도움 되실거에요!넵 이해했습니다! 덕분에 찝찝했던 부분 없이 속 시원하게 해결되었습니다! 감사합니다!!
- 1
- 11
- 231
질문&답변
goopang-target-group 에서 unhealthy
안녕하세요 강사님. 답변해주신 내용 확인했습니다!그렇다면, 초기에 private-ec2-instance 를 처음 실행할 때가 아닌, Stop Instance 로 중단했다가, Start Instance 로 인스턴스를 재시작하는 경우에는 User Data 의 스크립트가 실행되지 않는다는 말씀이시죠? 그렇다면 인스턴스 실행을 중단(Stop Instance)을 했다가 재실행(Start Instance)할 때 마다 User Data 의 스크립트를 실행하는 방법은 없을까요?매번 private-ec2-instance 에 접속해서 직접 스크립트를 실행해서 테스트를 진행해야 할까요?
- 1
- 11
- 231
질문&답변
goopang-target-group 에서 unhealthy
안녕하세요 강사님. 빠른 답변 항상 감사드립니다.말씀해주신 스크립트 내용을 private-ec2-instacne 의 User Data 내용으로 변경 후에는 역시나 Health checks failed 하였으나,private-ec2-instance 에 EC2 Instance Connect Endpoint 를 이용하여 직접 접속한 후에 aws-operation-prac 으로 폴더 이동 후에 아래 명령어를 직접 실행했을 때는 health check 성공한 것으로 확인됩니다. ./gradlew build sudo java -jar build/libs/aws-msa-monolithic-prac-0.1.jar 뭔가 ec2 인스턴스에서 sudo java -jar 로 애플리케이션 실행 후에 뭔가 문제가 있는 걸까요? private-ec2-instance 에 직접 접속 후에 ls-al 명령어로 파일 확인 시에 aws-operation-prac 프로젝트도 정상적으로 git clone 되어 있는 것 확인했습니다.
- 1
- 11
- 231
질문&답변
goopang-target-group 에서 unhealthy
우선 target group의 health check settings에 interval 시간이나 Unhealthy threshold 수를 늘려보면 좋을것같습니다.interval - 30초 이상Unhealthy threshold - 4회 이상이렇게 넉넉하게 설정해서 테스트하고, 테스트 한번 부탁드릴게요!넵 답변 감사합니다 강사님. 말씀해주신 것 처럼 Unhealthy threshold - 5회, interval - 30초 | Unhealthy threshold - 7회, interval - 60초 로 설정해보았는데, 2번 다 여전히 health checks failed 로 확인됩니다.. 추가적으로 확인해볼 부분이 있을까요..? (사진) (사진)
- 1
- 11
- 231
질문&답변
goopang-target-group 에서 unhealthy
안녕하세요 강사님. 빠른 답변 항상 감사드립니다. 지금으로 의심되는 부분은 보안그룹 설정 정도 될것같습니다.alb에서 ec2 인스턴스로 가는 트래픽에 대한 보안그룹 설정 한번 확인 부탁드릴게요!정상적으로 설정되어있다면, 인스턴스가 생성되고, 애플리케이션이 실행된 상태에서 인스턴스에 접속하여 curl로 health_check 요청이 정상적으로 되는지 그리고 target group에 설정된 health check 설정도 확인해보면 좋을것같습니다! 말씀해주신 부분들 전부 확인해보았는데, 문제가 없어 보여서 다시 질문 드립니다..우선, goopang-alb-sg 의 inbound-rules 에서 http 요청 받을 수 있도록 설정 되어 있고, goopang-private-ec2-sg 의 inbound-rules 에는 alb 와 bastion-host sg 들 요청 받을 수 있도록 설정되어 있는 것 확인했습니다. target-group 의 Health check settings 도 아래 이미지와 같이 /health_check 경로 설정 등 강의 설명과 같이 설정되어 있는 것 확인했습니다.bastion-host 인스턴스를 이용하여 private-ec2-instance 접속 후에 curl -XGET 'localhost/health_check' 로 요청 정상 작동 확인 시에는 아래의 코드 블럭 내용과 같이 server 에 접속 실패하였다고 나옵니다.private-ec2-instance에 EC2 Instance Connect Endpoint 를 이용하여 직접 접속 후 같은 요청을 보내보아도 아래 코드 블럭과 같은 에러(Failed to connect to localhost port 80 after 0 ms: Couldn't connect to server)가 반환됩니다.. private-routing-table 에도 nat-instance 설정되어 있는 것 확인했습니다. User Data 스크립트 log 확인(cat /var/log/cloud-init-output.log)은 이전 답글에 보낸 것과 같이 AwsMsaMonolithicPracApplicationKt 서버가 제대로 떴다가 다시 shutdown 되는 것으로 보입니다.. 혹시 제가 추가적으로 확인해볼만한 것이 있을까요..?(위에 글로 설명한 부분들 확인하기 쉽게 아래의 로그들과 이미지들을 첨부했습니다.)[ec2-user@ip-10-0-1-10 ~]$ curl -XGET 'localhost/health_check' curl: (7) Failed to connect to localhost port 80 after 0 ms: Couldn't connect to server 2024-10-24T16:36:51.158Z INFO 25901 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 80 (http) with context path '' 2024-10-24T16:36:51.182Z INFO 25901 --- [ main] .p.m.a.AwsMsaMonolithicPracApplicationKt : Started AwsMsaMonolithicPracApplicationKt in 7.333 seconds (process running for 8.101) Hibernate: select count(*) from users u1_0 Hibernate: select count(*) from products p1_0 Hibernate: select count(*) from cart_items c1_0 Hibernate: insert into users (email,name,password,id) values (?,?,?,default) Hibernate: insert into users (email,name,password,id) values (?,?,?,default) Hibernate: insert into products (description,name,price,id) values (?,?,?,default) Hibernate: insert into products (description,name,price,id) values (?,?,?,default) Hibernate: insert into cart_items (product_id,quantity,user_id,id) values (?,?,?,default) Hibernate: insert into cart_items (product_id,quantity,user_id,id) values (?,?,?,default) Hibernate: insert into cart_items (product_id,quantity,user_id,id) values (?,?,?,default) Hibernate: insert into cart_items (product_id,quantity,user_id,id) values (?,?,?,default) 2024-10-24T16:48:45.238Z INFO 25901 --- [p-nio-80-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet' 2024-10-24T16:48:45.239Z INFO 25901 --- [p-nio-80-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet' 2024-10-24T16:48:45.241Z INFO 25901 --- [p-nio-80-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 2 ms 2024-10-24T22:07:52.987Z INFO 25901 --- [p-nio-80-exec-9] o.apache.coyote.http11.Http11Processor : Error parsing HTTP request header Note: further occurrences of HTTP request parsing errors will be logged at DEBUG level. java.lang.IllegalArgumentException: Invalid character found in the request target [/index.php?s=/index/\think\app/invokefunction&function=call_user_func_array&vars[0]=md5&vars[1][]=Hello ]. The valid characters are defined in RFC 7230 and RFC 3986 at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:482) ~[tomcat-embed-core-10.1.8.jar!/:na] at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:263) ~[tomcat-embed-core-10.1.8.jar!/:na] at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) ~[tomcat-embed-core-10.1.8.jar!/:na] at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:894) ~[tomcat-embed-core-10.1.8.jar!/:na] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1741) ~[tomcat-embed-core-10.1.8.jar!/:na] at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) ~[tomcat-embed-core-10.1.8.jar!/:na] at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) ~[tomcat-embed-core-10.1.8.jar!/:na] at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[tomcat-embed-core-10.1.8.jar!/:na] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-10.1.8.jar!/:na] at java.base/java.lang.Thread.run(Thread.java:840) ~[na:na] 2024-10-26T09:40:33.557Z INFO 25901 --- [p-nio-80-exec-7] o.apache.coyote.http11.Http11Processor : Error parsing HTTP request header Note: further occurrences of HTTP request parsing errors will be logged at DEBUG level. java.lang.IllegalArgumentException: Invalid character found in the request target [/index.php?s=/index/\think\app/invokefunction&function=call_user_func_array&vars[0]=md5&vars[1][]=Hello ]. The valid characters are defined in RFC 7230 and RFC 3986 at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:482) ~[tomcat-embed-core-10.1.8.jar!/:na] at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:263) ~[tomcat-embed-core-10.1.8.jar!/:na] at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) ~[tomcat-embed-core-10.1.8.jar!/:na] at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:894) ~[tomcat-embed-core-10.1.8.jar!/:na] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1741) ~[tomcat-embed-core-10.1.8.jar!/:na] at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) ~[tomcat-embed-core-10.1.8.jar!/:na] at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) ~[tomcat-embed-core-10.1.8.jar!/:na] at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[tomcat-embed-core-10.1.8.jar!/:na] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-10.1.8.jar!/:na] at java.base/java.lang.Thread.run(Thread.java:840) ~[na:na] 2024-10-27T07:24:26.673Z WARN 25901 --- [p-nio-80-exec-6] o.s.w.s.r.ResourceHttpRequestHandler : "Path contains "../" after call to StringUtils#cleanPath: [media../.git/config]" 2024-10-27T07:24:26.674Z WARN 25901 --- [-nio-80-exec-10] o.s.w.s.r.ResourceHttpRequestHandler : "Path contains "../" after call to StringUtils#cleanPath: [docs../.git/config]" 2024-10-27T07:24:26.679Z WARN 25901 --- [p-nio-80-exec-3] o.s.w.s.r.ResourceHttpRequestHandler : "Path contains "../" after call to StringUtils#cleanPath: [static../.git/config]" 2024-10-27T11:41:00.134Z INFO 25901 --- [ionShutdownHook] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default' 2024-10-27T11:41:00.140Z INFO 25901 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated... 2024-10-27T11:41:00.167Z INFO 25901 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed. (사진) (사진) (사진) (사진)
- 1
- 11
- 231
질문&답변
goopang-target-group 에서 unhealthy
안녕하세요 강사님. 원인은 여러가지일 수 있는데, 헬스체크 기간동안 애플리케이션이 제대로 동작되지 않아 alb에서 비정상 상태로 파악하고 인스턴스를 종료시켰을 수 있습니다. 좀 더 정확한 원인 파악을 위해 target group에서 Unhealthy 가 된 원인을 확인할 수 있습니다. 해당 원인을 확인해서 알려주시며 도움드리기 수월할것같습니다!답변해주신 내용을 확인해봤는데, goopang-target-group 에서는 Health checks failed 로만 나오는데, 혹시 target-group 에서 error log 나 다른 내용을 확인하는 다른 방법이 있을까요? private-ec2-instnace 의 EC2 Instance Connect Endpoint 를 통한 cloud-init-output.log 로는 아래 내용 말고는 에러의 원인으로 보일만한 것이 없는 것 같아서요.2024-10-27T07:24:26.673Z WARN 25901 --- [p-nio-80-exec-6] o.s.w.s.r.ResourceHttpRequestHandler : "Path contains "../" after call to StringUtils#cleanPath: [media../.git/config]" 2024-10-27T07:24:26.674Z WARN 25901 --- [-nio-80-exec-10] o.s.w.s.r.ResourceHttpRequestHandler : "Path contains "../" after call to StringUtils#cleanPath: [docs../.git/config]" 2024-10-27T07:24:26.679Z WARN 25901 --- [p-nio-80-exec-3] o.s.w.s.r.ResourceHttpRequestHandler : "Path contains "../" after call to StringUtils#cleanPath: [static../.git/config]" 2024-10-27T11:41:00.134Z INFO 25901 --- [ionShutdownHook] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default' 2024-10-27T11:41:00.140Z INFO 25901 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated... 2024-10-27T11:41:00.167Z INFO 25901 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.(사진)
- 1
- 11
- 231
질문&답변
goopang-target-group 에서 unhealthy
안녕하세요 강사님.private-ec2-instance 를 며칠동안 stop 시켜놨다가 다시 run 시켰더니 또 target-group 에서 Unhealthy 라고 떴습니다.그래서 이번엔 privaet-ec2-instance 에 EC2 Instance Connect Endpoint 를 이용하여 직접 접속한 후, cat /var/log/cloud-init-output.log 명령어를 통해 log 를 확인하였더니,서버가 잘 떴다가 아래의 에러가 발생합니다. (request target 에 문제가 있는 것 같습니다.)어느 부분에 문제가 있는건지 잘 모르겠어서 다시 한번 질문드립니다.. bernate: select count(*) from users u1_0 Hibernate: select count(*) from products p1_0 Hibernate: select count(*) from cart_items c1_0 Hibernate: insert into users (email,name,password,id) values (?,?,?,default) Hibernate: insert into users (email,name,password,id) values (?,?,?,default) Hibernate: insert into products (description,name,price,id) values (?,?,?,default) Hibernate: insert into products (description,name,price,id) values (?,?,?,default) Hibernate: insert into cart_items (product_id,quantity,user_id,id) values (?,?,?,default) Hibernate: insert into cart_items (product_id,quantity,user_id,id) values (?,?,?,default) Hibernate: insert into cart_items (product_id,quantity,user_id,id) values (?,?,?,default) Hibernate: insert into cart_items (product_id,quantity,user_id,id) values (?,?,?,default) 2024-10-24T16:48:45.238Z INFO 25901 --- [p-nio-80-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet' 2024-10-24T16:48:45.239Z INFO 25901 --- [p-nio-80-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet' 2024-10-24T16:48:45.241Z INFO 25901 --- [p-nio-80-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 2 ms 2024-10-24T22:07:52.987Z INFO 25901 --- [p-nio-80-exec-9] o.apache.coyote.http11.Http11Processor : Error parsing HTTP request header Note: further occurrences of HTTP request parsing errors will be logged at DEBUG level. java.lang.IllegalArgumentException: Invalid character found in the request target [/index.php?s=/index/\think\app/invokefunction&function=call_user_func_array&vars[0]=md5&vars[1][]=Hello ]. The valid characters are defined in RFC 7230 and RFC 3986 at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:482) ~[tomcat-embed-core-10.1.8.jar!/:na] at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:263) ~[tomcat-embed-core-10.1.8.jar!/:na] at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) ~[tomcat-embed-core-10.1.8.jar!/:na] at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:894) ~[tomcat-embed-core-10.1.8.jar!/:na] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1741) ~[tomcat-embed-core-10.1.8.jar!/:na] at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) ~[tomcat-embed-core-10.1.8.jar!/:na] at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) ~[tomcat-embed-core-10.1.8.jar!/:na] at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[tomcat-embed-core-10.1.8.jar!/:na] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-10.1.8.jar!/:na] at java.base/java.lang.Thread.run(Thread.java:840) ~[na:na] 2024-10-26T09:40:33.557Z INFO 25901 --- [p-nio-80-exec-7] o.apache.coyote.http11.Http11Processor : Error parsing HTTP request header Note: further occurrences of HTTP request parsing errors will be logged at DEBUG level. java.lang.IllegalArgumentException: Invalid character found in the request target [/index.php?s=/index/\think\app/invokefunction&function=call_user_func_array&vars[0]=md5&vars[1][]=Hello ]. The valid characters are defined in RFC 7230 and RFC 3986 at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:482) ~[tomcat-embed-core-10.1.8.jar!/:na] at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:263) ~[tomcat-embed-core-10.1.8.jar!/:na] at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) ~[tomcat-embed-core-10.1.8.jar!/:na] at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:894) ~[tomcat-embed-core-10.1.8.jar!/:na] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1741) ~[tomcat-embed-core-10.1.8.jar!/:na] at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) ~[tomcat-embed-core-10.1.8.jar!/:na] at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) ~[tomcat-embed-core-10.1.8.jar!/:na] at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[tomcat-embed-core-10.1.8.jar!/:na] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-10.1.8.jar!/:na] at java.base/java.lang.Thread.run(Thread.java:840) ~[na:na] 2024-10-27T07:24:26.673Z WARN 25901 --- [p-nio-80-exec-6] o.s.w.s.r.ResourceHttpRequestHandler : "Path contains "../" after call to StringUtils#cleanPath: [media../.git/config]" 2024-10-27T07:24:26.674Z WARN 25901 --- [-nio-80-exec-10] o.s.w.s.r.ResourceHttpRequestHandler : "Path contains "../" after call to StringUtils#cleanPath: [docs../.git/config]" 2024-10-27T07:24:26.679Z WARN 25901 --- [p-nio-80-exec-3] o.s.w.s.r.ResourceHttpRequestHandler : "Path contains "../" after call to StringUtils#cleanPath: [static../.git/config]" 2024-10-27T11:41:00.134Z INFO 25901 --- [ionShutdownHook] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default' 2024-10-27T11:41:00.140Z INFO 25901 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated... 2024-10-27T11:41:00.167Z INFO 25901 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed. Cloud-init v. 22.2.2 running 'init' at Wed, 30 Oct 2024 16:00:46 +0000. Up 4.53 seconds. ci-info: ++++++++++++++++++++++++++++++++++++++Net device info++++++++++++++++++++++++++++++++++++++
- 1
- 11
- 231
질문&답변
goopang-target-group 에서 unhealthy
안녕하세요 강사님. 말씀해주신 2가지 방법 다 적용해보았습니다.1번. Private ec2 에 접속해서 스크립트 명령어를 직접 입력 -> EC2 Instance Connect Endpoint 를 이용해서 인스턴스에 접속했고, 명령어가 모두 정상적으로 실행되었습니다. 심지어 sudo java -jar build/libs/aws-msa-monolithic-prac-0.1.jar private ec2 에 접속한 상태에서 해당 명령어로 서버를 실행했을 때 alb 의 target group 이 healthy 상태로 표시됩니다.2번. Nat instance 대신 Nat gateway를 사용해보기 -> 이건 여전히 문제가 발생했었습니다.이 2가지 결과를 보았을 때, Private ec2 instance 를 run 할 때, User Data 의 스크립트에 문제가 있는 것으로 보고 혹시나 하는 마음에 모든 스크립트 내용을 개행 시켜줬습니다. 그렇게 해서 문제 해결했습니다!!백엔드 개발자지만 직접 이렇게 만져본 경험은 많지 않아서 많이 헤맸는데 강사님의 빠른 답변으로 속 시원하게 문제 해결했습니다. 감사합니다!
- 1
- 11
- 231
질문&답변
goopang-target-group 에서 unhealthy
안녕하세요 강사님. 매번 빠른 답변 정말 감사합니다.넵 그래서 확인해봤는데, goopang-nat-instance 가 goopang-private-routing-table 에 route 로 설정이 제대로 되어있고, ping-test-instance 로 외부로 트래픽이 잘 나가는지 테스트도 해보았는데, ping 테스트도 정상적으로 작동합니다..그래도 여전히 문제가 발생하네요..(참고로 route table 의 Target 에 있는 eni-xxxx 는 Instance 설정 후 goopang-nat-instance 로 선택 후 저장하니까 네트워크 인터페이스로 자동 설정되었습니다.)(사진) (사진) 혹시나 vpc, subnet, route tables 설정 때 부터 잘못되었나 싶어서 앞의 강의들도 재시청했는데, 설정은 강사님이 하신데로 제대로 되어있었습니다..그래도 혹시 추가로 체크해야할 부분이 있을까요?
- 1
- 11
- 231
질문&답변
goopang-target-group 에서 unhealthy
안녕하세요 강사님. 늦은 밤에 빠른 답변 정말 감사합니다.그런데 private-ec2-instance, NAT-Instance 를 둘 다 t4g.small 에서 t4g.medium 으로 instance type 을 변경했는데도 여전히 unhealthy 로 확인됩니다..현재 bastion-host-instance 에 접속해서 private-ec2-instance 로 pem키를 이용한 ssh 접속은 정상적으로 진행되나 섹션 5 Private EC2 Instance 접속(실습) 에서와 같이 curl -XGET 으로 health_check 요청은curl: (7) Failed to connect to localhost port 80 after 0 ms: Couldn't connect to server 와 같이 실패합니다.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 () 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. 혹시 몰라서 User Data 내용도 함께 올리겠습니다. #!/bin/bash #패키지 업데이트 sudo yum update -y #Java, Git 설치 sudo yum install -y java-17-amazon-corretto-headless sudo yum install -y git #Git 레포지토리 클론 및 브랜치로 이동 git clone -b 2_monolithic_cloud https://github.com/burger-2023/aws-operation-prac.git #폴더 이동 cd aws-operation-prac #Gradle을 이용한 Spring Boot 프로젝트 빌드 후 빌드된 Spring Boot 애플리케이션 실행 ./gradlew build sudo java -jar build/libs/aws-msa-monolithic-prac-0.1.jar
- 1
- 11
- 231