简体   繁体   English

SSH到AWS RDS Postgres实例

[英]Ssh to AWS RDS Postgres instance

I wanted to install pgbouncer in my postgres rds, but I am not able to access the instance, like the same way we access ec2 instances. 我想在我的postgres rds中安装pgbouncer,但是我无法访问该实例,就像我们访问ec2实例一样。 So is there a way by which I can ssh to the machine (not psql, it's working fine). 因此,有没有一种方法可以使我SSH到计算机(不是psql,它工作正常)。

您不能直接访问rds基础实例,这是设计使然。

This worked for me. 这对我有用。 Make sure you have psql client installed locally. 确保您在本地安装了psql客户端

psql --host=myAwsDbEndpointUrl.ciqykqusf0nv.us-west-1.rds.amazonaws.com --port=5432 --username=myUserName --password --dbname=myDbName

When creating your db instance on aws, make sure to define the following: 在AWS上创建数据库实例时,请确保定义以下内容:

  1. username 用户名
  2. password 密码
  3. database name 数据库名称
  4. port number 端口号

I also had to create a security group for the VPC that the database was located in. After creating it make sure your db instance uses this for its security group. 我还必须为数据库所在的VPC创建一个安全组。创建它之后,请确保您的数据库实例将其用于此安全组。 The security group has the following rules: 安全组具有以下规则:

inbound--> type:PostgreSQL, protocol:TCP port range:5432, source:0.0.0.0/0

outbound--> type:All Traffic, protocol:All, port range:all, destination:0.0.0.0/0

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM