1
EC2 (탄성 빈 줄)에서 RDS PostgreSQL 9.3 데이터베이스에 연결할 수 없습니다. 환경은 Elastic Beanstalk v3 CLI (PostgreSQL 9.3.5, Puma (Ruby 2.1), Rails 4.1.6)를 사용하여 작성되었습니다. postgresql93-(STABLE)이 성공적으로 .ebextensions/postgres.config을 통해 냠에 의해 설치 :AWS ElasticBeanstalk EC2와 RDS postgresql 연결
packages:
yum:
postgresql93-devel: []
SECRET_KEY_BASE는 콘솔을 통해 환경 테이블에 추가되었습니다.
레이크 DB에 다음과 같은 오류를 가져 오기 : EB의 배포 중에 마이그레이션 :
rake aborted!
PG::ConnectionBad: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
RDS_HOSTNAME을 RDS_DATABSE, RDS_USER_NAME, RDS_PASSWORD : 모든 EC2 상자에 ssh'ing에 의해 레일 콘솔에서 확인.
설정/database.yml을 :
default: &default
adapter: postgresql
encoding: unicode
# For details on connection pooling, see rails configuration guide
# http://guides.rubyonrails.org/configuring.html#database-pooling
pool: 5
production:
<<: *default
database: <%= ENV['RDS_DB_NAME'] %>
username: <%= ENV['RDS_USERNAME'] %>
password: <%= ENV['RDS_PASSWORD'] %>
hostname: <%= ENV['RDS_HOSTNAME'] %>
port: <%= ENV['RDS_PORT'] %>
어떤 생각?