jijijig / Albeobsa-Backend

알(뜰마)법사
https://albeobsa-front.vercel.app
MIT License
0 stars 1 forks source link

AWS 배포 #3

Closed chaiminwoo0223 closed 3 months ago

chaiminwoo0223 commented 6 months ago
chaiminwoo0223 commented 6 months ago

서버 배포를 미리 먼저 하는 것이 좋을 것 같습니다.

chaiminwoo0223 commented 6 months ago
스크린샷 2024-03-17 오후 9 20 50
chaiminwoo0223 commented 6 months ago

현재 Docker Hub 사이트에서 에러가 발생해서 바로 배포를 할 수 없는 상황입니다. 해결이 되는대로 배포 진행하겠습니다.

chaiminwoo0223 commented 6 months ago

현재 사용하고 있는 AWS 스토리지 용량이 8GIB 기본 용량입니다. 추후에 용량이 부족하면 새로운 인스턴스를 생성하겠습니다. Free Tier는 30GIB까지 허용이 된다고 하네요.^^

chaiminwoo0223 commented 6 months ago

AWS에 docker를 깔고 실행을 시켰는데, 그 후 키를 이용한 접속 자체가 되지 않고 있습니다. 아무래도 용량이 너무 적어서 이러한 문제가 발생한 것 같습니다. 기존에 만들었던 AWS 인스턴스를 삭제하고, 용량이 큰 AWS로 다시 만들겠습니다.

chaiminwoo0223 commented 6 months ago

AWS는 기본 용량(8GIB)이 아니라, 최고 용량(30GIB)으로 사용하는 것이 좋습니다.^^ 현재 AWS 가상환경에는 Docker, docker-compose, java, mysql을 설치한 상태입니다.

chaiminwoo0223 commented 6 months ago

What's Next?

1.도메인 설정 2.Nginx 보안 강화

chaiminwoo0223 commented 5 months ago
스크린샷 2024-03-21 오전 12 20 00
chaiminwoo0223 commented 5 months ago

배포가 되었음에도 불구하고, 시간이 지나면 "UBSAN: array-index-out-of-bounds" 에러가 발생합니다. 만약 이러한 상황이 지속된다면 다음과 같은 상황을 고려해야 할 것 같습니다.

1.GCP 2.AWS 업그레이드

chaiminwoo0223 commented 5 months ago
스크린샷 2024-04-01 오후 10 03 37
chaiminwoo0223 commented 5 months ago

배포 성공

chaiminwoo0223 commented 5 months ago

EC2 인스턴스에서 데이터베이스를 분리하여, 문제를 해결했습니다.

1.AWS EC2 인스턴스를 만들고, 서버에 docker, docker-compose, java를 설치했습니다. 2.RDS(MySQL)을 생성해서, 원격으로 데이터베이스를 연결했습니다.

chaiminwoo0223 commented 5 months ago

https://jijijig.duckdns.org/swagger-ui/index.html

chaiminwoo0223 commented 5 months ago

도메인 이름을 수정해야 할 것 같습니다.(jijijig -> albeobsa)

chaiminwoo0223 commented 4 months ago
spring-boot-app  | 2024-05-01T01:44:05.167Z ERROR 1 --- [nio-8080-exec-7] s.jijijig.controller.CrawlingController  : 쿨엔조이 크롤링 과정에서 오류 발생

spring-boot-app  | 
spring-boot-app  | org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure. 
spring-boot-app  | Host info: host: '-----', ip: '-----'
spring-boot-app  | Build info: version: '4.14.1', revision: '-----'
spring-boot-app  | System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.5.0-1017-aws', java.version: '21'
spring-boot-app  | Driver info: org.openqa.selenium.chrome.ChromeDriver
spring-boot-app  | Command: [null, newSession {capabilities=[Capabilities {browserName: chrome, goog:chromeOptions: {args: [--headless, --disable-gpu, --no-sandbox, --disable-dev-shm-usage, --disable-extensions, --disable-popup-blocking, --start-maximized, --window-size=1920,1080, user-agent=Mozilla/5.0..., --disable-infobars, --disable-browser-side-navi..., --disable-setuid-sandbox], extensions: []}, goog:loggingPrefs: {browser: ALL}}]}]
spring-boot-app  |  at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:620) ~[selenium-remote-driver-4.14.1.jar!/:na]
spring-boot-app  |  at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:236) ~[selenium-remote-driver-4.14.1.jar!/:na]
spring-boot-app  |  at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:163) ~[selenium-remote-driver-4.14.1.jar!/:na]
spring-boot-app  |  at org.openqa.selenium.chromium.ChromiumDriver.<init>(ChromiumDriver.java:108) ~[selenium-chromium-driver-4.14.1.jar!/:na]
spring-boot-app  |  at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:88) ~[selenium-chrome-driver-4.14.1.jar!/:na]
spring-boot-app  |  at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:83) ~[selenium-chrome-driver-4.14.1.jar!/:na]
spring-boot-app  |  at skhu.jijijig.service.CrawlingService.crawlingCoolenjoy(CrawlingService.java:210) ~[!/:0.0.1-SNAPSHOT]
spring-boot-app  |  at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) ~[na:na]
spring-boot-app  |  at java.base/java.lang.reflect.Method.invoke(Method.java:580) ~[na:na]
spring-boot-app  |  at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:351) ~[spring-aop-6.1.4.jar!/:6.1.4]
spring-boot-app  |  at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:196) ~[spring-aop-6.1.4.jar!/:6.1.4]
spring-boot-app  |  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-6.1.4.jar!/:6.1.4]
...
chaiminwoo0223 commented 4 months ago

1.Version 115 이상의 Chromedriver는 별도의 설치 없이 WebDriverManager를 이용하여 크롤링을 진행할 수 있습니다. 2.AWS EC2 환경과 Docker 환경은 분리되어 있으므로, Docker 내부에서 독립적으로 Chrome을 설치하려면 Dockerfile을 사용해야 합니다.

chaiminwoo0223 commented 3 months ago

https://albeobsa.duckdns.org/swagger-ui/index.html

chaiminwoo0223 commented 3 months ago

AWS EC2 서버 다운 문제를 해결했습니다.

1.nginx 인증서 문제 2.swapfile을 이용한 용량 증가