인프라 아키텍처

---
title: 청년인턴 아키텍처 흐름도 요약
---
flowchart TD;
    subgraph Public Zone
        direction LR;
        DEVELOPER(Developer) ====> INTERNET[Internet] ====> |"SSH, SFTP (22)"| BASTION["Bastion (EC2 Server)"]
        USER(User) ---> INTERNET ----> |"HTTP(80), HTTP(443)"| ELB1[Elastic Load Balancer]

        subgraph AWS-RDS
            MASTER[(Read, Write)]
            SLAVE[(Read only)]
        end
    end
    
    subgraph Private Zone
        WEB ---> ELB2[Elastic Load Balancer] ---> WAS

        subgraph WAS
            direction LR;
            WAS-["WAS (EC2 Server)"] --- WAS-AutoScaling
        end

        subgraph WEB
            direction LR;
            WEB-["WEB (EC2 Server)"] --- WEB-AutoScaling
        end
    end
    
    style INTERNET fill:#f9f,stroke:#333,stroke-width:2px
    style WAS- fill:#FF8000,stroke:#F5D0A9,stroke-width:2px
    style WEB- fill:#FF8000,stroke:#F5D0A9,stroke-width:2px
    style BASTION fill:#FF8000,stroke:#F5D0A9,stroke-width:2px
    style ELB1 fill:#FA5882,stroke:#F2F2F2,stroke-width:2px
    style ELB2 fill:#FA5882,stroke:#F2F2F2,stroke-width:2px
---
title: 개발자 접근 아키텍처 흐름도
---
flowchart LR;
    subgraph PrivateZone
        WEB ===> ELB2 ===> WAS
    end
    
    BASTION ===> |keypair .pem| PrivateZone  
    WAS <-. "Abstract Routing DataSource \n LazyConnectionDataSourceProxy" .-> AWS-RDS
    PrivateZone ===> EBS -. fluentd .-> EFS
---
title: 사용자 접근 아키텍처 흐름도
---
flowchart LR;
    subgraph PrivateZone
        WEB ===> ELB2 ===> WAS
    end
    INTERNET ===> ELB1 ===>PrivateZone
    WAS <-. "Abstract Routing DataSource \n LazyConnectionDataSourceProxy" .-> AWS-RDS
    PrivateZone ===> EBS -. fluentd .-> EFS

AWS Resource

오토스케일링과 같은 위험도가 높은 작업은 직접 수행하지 않고, 누리 클라우드 업체의 기술지원을 통하여 진행하였다.
보안을 위하여 VPC 그룹핑 되어 있어 외부에서 직접 인스턴스로 접근이 불가능하다. 배스쳔 서버를 통한 인스턴스 접근을 진행해야한다.
배스쳔 서버의 Public IPv4 주소로 SSH 접근이 가능하다. 이때, ID, PW가 아닌 Keypair를 사용하여 인증하여야 한다.

  • INBOUND 규칙엔 8080 port, 80 port가 열려있어야 한다.
  • VPC는 NAT 설정을 통해 고정된 IP값으로 외부와 통신한다.
  • 즉, VPC 내의 인스턴스는 OUTBOUND 통신 시 동일한 IP를 가지게 된다.
  • WEB, WAS의 로드밸런서를 사용 중이다.

WEB Elastic Load Balancer는 다음과 같은 작업을 수행한다.

  • 80 port => 443 port redirect
  • 443 port => 타겟그룹으로 요청을 전달한다.
  • 타겟그룹엔 두 대의 EC2가 등록되어 있다. (EC2, EC2-Autoscaling)
  • Health checks에선 타겟그룹에 속한 인스턴스의 상태 체크를 설정할 수 있다.
  • ELB는 그룹 내 인스턴스로 http 요청을 보내어 성공 조건을 만족하면 해당 인스턴스가 서비스중이라고 판단한다.

WAS Elastic Load Balancer는 다음과 같은 작업을 수행한다.

  • 8080 port => 타겟그룹으로 요청을 전달한다.
  • 타겟그룹의 자세한 설명은 생략한다.

Elastic Computer Cloud

Instance Role Operating System Applications
Bastion Amazon Linux N/A
WEB Ubuntu 20.04 Nginx
WAS Ubuntu 20.04 PM2

특이사항

  • WAS는 SpringBoot 내장 Tomcat을 사용하고 Process Management Tool PM2를 사용한다.
  • 자세한 설치 과정은 본글에서 생략한다.