簡體   English   中英

pgsync 無法連接到 RDS 上的 Amazon PostgreSQL 數據庫

[英]pgsync cannot connect to Amazon PostgreSQL database on RDS

我正在嘗試使用pgsync gem 將數據從我的本地開發數據庫同步到在 Amazon RDS 上運行的測試數據庫。

我的.pgsync.yml頁面很簡單:

from: postgres://localhost:5432/imports_development?sslmode=require
to: [See attempts below]
exclude:
  - [A few tables]

我嘗試了很多方法,但都沒有用。 以下是我收到的所有方法和錯誤消息:

to: postgres://awsuser:mypassword@imports-test.abcdefg.us-east-1.rds.amazonaws.com/postgres?sslca=config/rds-combined-ca-bundle.pem
  => invalid URI query parameter: "sslca"

to: postgres://awsuser:mypassword@imports-test.abcdefg.us-east-1.rds.amazonaws.com
  => connection to server at "52.4.150.10", port 5432 failed: FATAL:  database "awsuser" does not exist

to: $(heroku config:get DATABASE_URL)
  => invalid URI parameter: "sslca"

to: imports-test.abcdefg.us-east-1.rds.amazonaws.com
  => connection to server on socket "/tmp/.s.PGSQL.5432" failed: FATAL:  database "imports-test.abcdefg.us-east-1.rds.amazonaws.com" does not exist

這些是 database.yml 用於 RDS 數據庫的憑據:

rds_db_name: postgres
rds_username: awsuser
rds_password: mypassword
rds_hostname: imports-test.abcdefg.us-east-1.rds.amazonaws.com
rds_port: 5432

我可以使用 Rails 控制台連接到這兩個數據庫,所以這應該只是讓上述語句正確的問題。 這里缺少什么?

您是否嘗試過postgres://awsuser:mypassword@imports-test.abcdefg.us-east-1.rds.amazonaws.com/postgres 嘗試 2 似乎有效,但根據錯誤不包括數據庫名稱。

URI 大致采用以下格式:

postgres://{USER}:{PASS}@{HOSTNAME}/{DBNAME}

?sslca=123和其他選項之后? (查詢字符串)作為選項。 並非所有客戶端都支持此處的所有選項。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM