codestates / ETON-server

0 stars 0 forks source link

[Task] AWS deploy - DB #26

Open ddubbu opened 3 years ago

ddubbu commented 3 years ago

Task Card

Assignee: @ddubbu

Job Description

advanced

aesopfrom0 commented 3 years ago

https://www.notion.so/aesopballer/ETON-RDS-EC2-6ad80dc7cb424793829cc277187064c3

ddubbu commented 3 years ago

2월 7일

aesopfrom0 commented 3 years ago
스크린샷 2021-02-07 21 56 58

git clone 이후에 이러한 에러가 떴습니다. node 버전이 문제라고 하는데 찾아보겠습니다

aesopfrom0 commented 3 years ago

https://docs.aws.amazon.com/ko_kr/sdk-for-javascript/v2/developer-guide/setting-up-node-on-ec2-instance.html

nodejs 버전을 업그레이드 했습니다.

aesopfrom0 commented 3 years ago

node index.js 를 실행했더니 에러 발생

node:internal/fs/utils:636 throw new ERR_INVALID_ARG_TYPE(propName, ['string', 'Buffer', 'URL'], path); ^

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received undefined at Object.openSync (node:fs:484:10) at Object.readFileSync (node:fs:393:35) at Object. (/home/ubuntu/ETON-server/index.js:6:23) at Module._compile (node:internal/modules/cjs/loader:1108:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10) at Module.load (node:internal/modules/cjs/loader:973:32) at Function.Module._load (node:internal/modules/cjs/loader:813:14) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12) at node:internal/main/run_main_module:17:47 { code: 'ERR_INVALID_ARG_TYPE' }

aesopfrom0 commented 3 years ago

index.js 에서 https 관련 부분을 모두 지우고 해서 에러는 해결했습니다.

geteton.ga로 접속했을 때 502 Bad Gateway가 뜹니다. test 폴더와 다른 점을 체크 중입니다.

aesopfrom0 commented 3 years ago

원인은 로드밸런서

스크린샷 2021-02-07 23 13 07

포트 4000 추가해주면 된다.

aesopfrom0 commented 3 years ago

RDS에서 sequelizer 쓰려고 할 때, DB 부분은 기존 db 있으면 드랍하고 새로 만든다. 그러면 createdAt, updatedAt 칼럼까지 반영되어 있다.