DevOps
  • Introduction
  • Setting
    • Terminal
      • Tmux
    • WSL+Ubuntu
    • [NeoVIM]
      • install & 활용방법
      • error 처리
      • LazyVIM
        • install & 활용방법
    • ssh
    • mysql
    • package관리
  • Fundamental(basic)
    • Network
      • https
  • [GitOps]
    • [SCM]
      • [Github]
        • center-managed
      • bitbucket
      • AWS-codeCommit
  • roadmap
    • devops
    • kubernetes
    • AWS
    • MLOPS
  • Cloud
    • [AWS]
      • aws sso script
      • tagging 자동화
      • 동일cidr에서 VPC 연결
      • 무중단서비스를 위한 고려사항
    • [GCP]
      • [GCP] GCP의 VPC
      • [GCP] GCP의 ALB
      • [GCP] OIDC와 OAUTH를 활용한 github action
      • [GCP] Composer 설명
      • [GCP] gmail-api
      • [GCP] DataLake
      • [GCP] Cloud 관리형 계정&role
      • [[GCP] private환경
        • DNS 설정으로 google api 및 colab-notebook 사용 하기
        • intelligence 설정으로 google api 및 colab-notebook 사용 하기
  • [kubernetes]
    • [cloud 기반]
      • csr
  • InfraAsCode
    • terraform
  • 코드로 그리는 다이어그램
    • CodeAsDiagram
      • example
    • Mermaid
    • PDFtoImage
  • AutoMation
  • [ETC]
    • Magic_Trackpad Window설치
Powered by GitBook
On this page
  1. Setting

ssh

bastion server를 이용 하여 DB 접속 하는 설정

  • 한줄로 실행

ssh -i ~/.ssh/kth.pem -fNL (localhost생략)3306:kth-rds-writer.cds4.ap-northeast-2.rds.amazonaws.com:3306 ec2-user@52.79.xxx.xxx
  • ec2 -> bastion 서버이고

  • rds-writer는 db 서버이다.

  • kth.pem은 베스천서버의 pem key이다

이상태는 터널링이 맺어진 상태이며 mysql -h localhost 실행

그러나 위의 방법은 명령어가 너무 길어서 불편하다.

~/.ssh/config 설정 이후 편하게 사용 하자

Host pdb-proxy
    HostName 52.79.xxx.xxx
    User ec2-user
    IdentityFile ~/.ssh/kth.pem
    LocalForward 3306 kth-rds-writer.cd.ap-northeast-2.rds.amazonaws.com:3306
    ExitOnForwardFailure yes
    ServerAliveInterval 600
  • 실행

ssh -fN pdb-proxy                                                    
Previousinstall & 활용방법Nextmysql

Last updated 1 year ago