http://marutalk-build.s3-website.ap-northeast-2.amazonaws.com/main
아직 도메인이 없어서 s3 정적 웹 호스팅한 주소이다.
이제 실제로 사용하면서 직접 QA를 진행하고 개선을 해 나가고,
서버에는 모니터링과 로깅
그리고 CI/CD 무중단 배포까지 작업하고 실시간 채팅앱은 마무리할 예정이다.
내일은 일단 버그 잡고, 모니터링, 로깅
CI/CD, 무중단 배포 작업
trouble shooting
1. 409
회원가입을 이미 서버에 있는 정보로 다시 요청을 하니 가입이 안된다.
개발자 도구로 확인하니 httpstatus 409를 확인.
그리고 서버쪽 코드에도 회원가입 중 중복이메일에는 throw new ConflictException을 해두었기 때문에 409가 자동으로 발생했다.
409는 서버의 현재 상태와 요청이 충돌했다는 의미이고, 아마 이미 서버 데이터베이스에 요청과 중복된 값이 저장되어 있을 확률이 컸다.
실제로 중복되지 않은 값으로 재요청했을 때 정상 동작 했기 때문이다.
TODO: 프론트에서 이미 회원가입된 정보이면 알려주도록 수정해야 한다.
2. CORS
S3의 정적 웹 사이트 호스팅의 오리진 엔드포인트는
http://marutalk-build.s3-website.ap-northeast-2.amazonaws.com 이런 형태인데
nestJS main.ts에서 CORS 허용 도메인을 지정할때 뒤에 / 를 붙여두어서 에러가 발생했었다.
3. DB Connection
- sudo apt-get update
- sudo apt install mysql-server
- mysql이 떠있는 인스턴스 내에서 아래 처럼 해주면 된다.
sudo mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 18
Server version: 8.0.40-0ubuntu0.24.04.1 (Ubuntu)
Copyright (c) 2000, 2024, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show tables;
ERROR 1046 (3D000): No database selected
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
4 rows in set (0.02 sec)
mysql> create user 'sihanni'@'%' identified by 'password';
Query OK, 0 rows affected (0.03 sec)
mysql> grant all privileges on *.* to 'sihanni'@'%';
Query OK, 0 rows affected (0.01 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.01 sec)
mysql>
- 그리고 인바운드 설정도 내 아이피/32 (/32는 단 하나의 아이피만 허용한다는 의미의 CIDR 표기법) 해준다.
'ToyProject' 카테고리의 다른 글
| nestJS 실시간 채팅 앱 - [Fin] 도메인 (1) | 2025.01.01 |
|---|---|
| [TIL, 마루톡] 20241216 (Jest, Repository, Docker Volume, JWT refactoring) (1) | 2024.12.16 |
| nestJS 실시간 채팅 앱 - [7] 서버, (trouble shooting) (3) | 2024.12.05 |
| nestJS 실시간 채팅 앱 - [1] (1) | 2024.11.12 |
| datetime과 timestamp의 차이 (0) | 2024.07.22 |