GCP
GCP30 :: CloudSQL 데이터베이스에서 select 조회하는 Application 배포는Cloud RUN
GCP30 :: CloudSQL 데이터베이스에서 select 조회하는 Application 배포는Cloud RUN
2020.09.01ㅡ. 개요 CloudSQL에 데이터를 node.js서버에서 간단하게 불러오는 rest api application을 만들고 이를 Cloud Run을 이용해 배포하는 과정 ㅡ. 시작 프로젝트를 생성합니다. ㅡ. Cloud SQL 생성 cloud SQL 생성시 공개 IP 주소로 접근하였습니다. Terminal 환경에서 접속으로 Local에서 CloudSQL이 접근가능한지 확인하였습니다. ㅡ. Mysql Workbench 실행 워크벤치에서 Connection을 생성하고 데이터베이스, 테이블 생성 후 데이터를 insert 하였습니다. ㅡ. node.js 와 mysql 연동 2020/08/25 - [Node.js] - node.js restful api 서버 만들기 (with bigQuery) node.js re..
GCP29 :: Cloud-Run 으로 빌드 및 배포
GCP29 :: Cloud-Run 으로 빌드 및 배포
2020.09.01*ref : https://cloud.google.com/run/docs/quickstarts/build-and-deploy?hl=ko 그 다음 부터는 dockerfile이 포함되어 있는 디렉토리에 Cloud Build로 컨테이너 이미지를 빌드합니다. terminal창을 키고 gcloud init 을 통해서 google 계정과 프로젝트를 선택합니다. gcloud builds submit --tag gcr.io/PROJECT-ID/helloworld gcr.io : 이미지를 미국의 데이터 센터에서 호스팅하지만 나중에 위치가 변경될 수 있습니다. 호스팅하는곳을 의미합니다. 기본적으로는 미국 이렇게 성공하면 이미지 이름(gcr.io/PROJECT-ID/helloworld) 포함된 성공 메시지가 표시된다. 이미..
GCP28 :: Google Cloud Certification 시작
GCP28 :: Google Cloud Certification 시작
2020.08.31https://www.coursera.org/learn/preparing-cloud-professional-cloud-architect-exam/lecture/qMLHZ/introduction Introduction - Welcome to Preparing for the Professional Cloud Architect Exam | Coursera www.coursera.org 코세라에서 7일 강의 무료 인걸 등록했다. 시간이 지나면 결제가 되는건 단점이지만... 이 내용을 정리해본다. ㅡ. 어소시에이트 vs 프로페셔널 프로페셔널에 Business requirements가 포함된다. (Design, Plan, Ensure fesibility, Optimize) ㅡ. 시험 정보 시험 시간 : 2시간 시험..
GCP27 :: Compute Engine, 이론
GCP27 :: Compute Engine, 이론
2020.08.31ㅡ. Compute Engine VM 들을 생성해서 Google Clouud Service를 제공합니다. laas 이며, Server Autoscaling 수행합니다. ㅡ. 구성 vCPUs (cores), Memory (RAM) -> 선택가능 Persistent disks:HDD, SSD and Local SSD Networking ->(networking interfaces 환경설정) Linux or Windows -> (Linux 나 Windows 머신과 결합하여 동작시킬 수도있습니다.) 을 지원합니다. ㅡ. 특징 1. Machine rightsizing 최적의 사이즈, stackdriver 통계 2. 글로벌 로드 밸런싱 멀티플 리전 고가용성 3. 선점형 Up to 80% discount No SLA..
GCP26 :: DNS 등록하기, Google Cloud Platform
GCP26 :: DNS 등록하기, Google Cloud Platform
2020.08.24개요 해당 포스팅에서는 AWS 에서 구매한 도메인을 서버와 연결하여 도메인으로 애플리케이션에 접속하는 과정을 보여 줍니다. 서버는 Google Cloud Platform의 VM 인스턴스에 Web Application을 배포한 상태입니다. 보통의 경우 http://외부IP:Port 로 접근할 수 있지만, 이 경우 보안에 취약할 수 있기 때문에 DNS를 등록하여 사용하도록 하겠습니다. AWS 사전에 미리 구입해둔 도메인에 정보를 확인합니다. https://cloud.google.com/dns/docs/quickstart?hl=ko 확인하고시작했습니다. Google DNS Google Cloud Platform에서 DNS 영역을 생성할 수 있습니다. 구입한 도메인을 사전에 배포한 Web Application으..
GCP22 :: Web배포시 고려할 점
GCP22 :: Web배포시 고려할 점
2020.08.21본 포스팅은 메모 형식으로 작성된 게시글 입니다. 보시는데 다소 불편하실 수 있습니다. ㅠ private, public subnet-> vm -> 이것저것 -> lb -> lb firewall (외부IP 대역 허용, 443(https), 80(http) filter 추가) -> public 베스천vm -> private subnet 에 nat 로통신해서 외부 library 접속 가능 참고로 베스천vm은 ssh로 내부 ip에 접속하는 용도이다. ㅡ. VPC 생성 ㅡ. 방화벽 규칙 SSH 접속을 하기 위해서 TCP::20 그외에 Load-Balancing TCP::80(http), 443(https) 설정합니다. I. SSH ll. LB ㅡ. vm생성 #! /bin/bash apt-get update apt..
GCP21 :: Nginx 통해 배포된 Compute Engine 에 부하분산기 달기(2)
GCP21 :: Nginx 통해 배포된 Compute Engine 에 부하분산기 달기(2)
2020.08.21ㅡ. 스냅샷 만들기 스냅샷을 가지고 디스크를 생성합니다. ㅡ. 디스크 만들기 스냅샷으로 이미지를 생성합니다. ㅡ. 이미지 만들기 생성된 이미지를 통해서 인스턴스 템플릿을 만들자. ㅡ. 부팅디스크 만들기 ㅡ. 인스턴스템플릿 만들기 인스턴스 템플릿으로 인스턴스 그룹을 생성합니다. ㅡ. 인스턴스 그룹 만들기 다중 영역을 위해서 하나더 만든다. http 를 통해 아이피로 들어가게 되면 로드 밸런싱을 수행한 채로 웹사이트가 동작하는것을 확인할 수 있다.
GCP20 :: Google Cloud Compute Engine 이용해서 Vue.js 배포하기(Nginx)
GCP20 :: Google Cloud Compute Engine 이용해서 Vue.js 배포하기(Nginx)
2020.08.21우선 vue project에서 npm run build 수행하자! 서버를 하나 만들어줬다. GCP에서 Compute Engine 을 다음 스펙으로 만들었다. ssh 로 접속해서 rsa keygen 생성한것을 등록해준다. 2020/08/21 - [Cloud] - bigQuery에서 pub/sub 으로 불러오고, compute engine 에 올려서 event stream 수행하기-1 sudo apt-get install nginx nginx를 설치하자 filezilla를 다운받았습니다. 다운받는경로 : https://filezilla.kr.uptodown.com/mac/download filezilla 이용할때는 Putty도 함께 사용해야 합니다. mac에 putty 까는게 없네... 어찌저찌 옮겼다. (..
GCP19 :: CPU와 메모리 관계(2)
GCP19 :: CPU와 메모리 관계(2)
2020.08.21ㅡ. 메모리 계층 구조 메모리 계층 구조를 보면 : 레지스터>캐시>메모리>하드디스크 순으로 되어있다. 만약 CPU가 한번에 50개 데이터를 처리할 수 있고 메모리가 25개의 데이터를 처리할 수 있다고 가정하면 process : 메모리에서 25개를 처리하고 CPU에서 25개를 처리합니다. CPU가 전부 처리할 수 있지만 전달된 데이터만 처리하기 때문에 CPU가 높은것이 성능에 크게 좌우하지 않는다. CPU와 메모리가 서로 나눠서 처리한다. 결과적으로 연산이 많다면, CPU 사양이 높은것을 고르고 API 로 말아서 데이터를 보내주는 작업이라면, 메모리 사양이 높은것을 고르자.
GCP18 :: LB(Load-Balancer)
GCP18 :: LB(Load-Balancer)
2020.08.21workflow는 다음과 같다. VM인스턴스 -> 스냅샷 -> 디스크 -> 이미지 -> 인스턴스템플릿 -> 인스턴스 그룹 -> 로드 밸런서 #! /bin/bash apt-get update apt-get install -y apache2 cat [ 부하 분산 ] 탭이 있다. 인터넷 트래픽 부하분산을 선택했다. 백엔드 서비스를 생성하고 새백엔드 옵션을 이렇게 주었다. 백엔드를 하나 더 추가하자. 유럽 인스턴스 그룹을!! 그 다음에 해야할것은 상태 확인 부분에서 상태 확인 생성이다. 이제 생성을 누르면 백엔드 구성이 완료된다. 그 다음에 호스트및 경로규칙을 누른다. [ 호스트 및 경로규칙 ] 은 규칙에 따라 라우팅 방식을 지정할 수 있지만! 지정하지 않을 수 도 있다. 그 다음에 프론트엔드 구성을 누른다. ..
bigQuery에서 pub/sub 으로 불러오고, compute engine 에 올려서 event stream 수행하기
bigQuery에서 pub/sub 으로 불러오고, compute engine 에 올려서 event stream 수행하기
2020.08.21bigQuery table 에서 event stream 을 수행하면서 publisher 의 topic에 message를 전송하고 이를 apache-beam 상에서 코드로 동작시켜 ETL을 수행하는것까지 진행!! event stream은 local에서 compute engine 동작시켜서 stream이 끝날 때까지 수행하는것을 역할로 잡았습니다. 미리 public-data-set 의 stackoverflow dataset을 bigQuery table로 Import 했습니다. 제가 이 테스팅을 진행하는건 tags 와 view_count를 가지고 중복되는 tags 이름에 총 몇번의 view_count를 가지고 있는지 확인하려고 합니다. (물론 | 기준으로 split 해야합니다.) pub/sub에서 stream..
데이터 스튜디오 이용해 bigQuery 시각화
데이터 스튜디오 이용해 bigQuery 시각화
2020.08.20dataStudio 가 bigQuery에 접근할 때 bigQuery connector 를 사용하게 됩니다. 이후에 약관동에에 대해서 전부 동의해줍니다. 보고서에 데이터를 추가하고, 검색어에 bigQuery를 입력합니다. 권한에 대해 승인하고 [Project선택] - [Public Dataset 선택] - [tableset 선택] 이후 보고서에 데이터를 추가합니다. natality에 대한 테이블 정보를 확인해보겠습니다. 레포트가 생성되면 데이터소스를 클릭해서 구글 docs에 나와있는 1단계는 모두 끝났습니다. ㅡ. 막대 그래프 생성하기 차트에서 막대그래프를 선택합니다. 이후에 측정기준에 source_year 을 찾고, 측정항목에 birth_count 를 생성 후 COUNT(is_male)을 입력하면 이와 ..