Is Blog se local se server per data create kar sakte hai.
1. On each EC2 instance, edit the PostgreSQL configuration file
1.1 sudo nano /etc/postgresql/<version>/main/postgresql.conf
# or for Amazon Linux
sudo nano /var/lib/pgsql/<version>/data/postgresql.conf
--
Update this line:
listen_addresses = '*' OR
listen_addresses = '0.0.0.0'
---------------------------------------------------------------
2. Edit pg_hba.conf
to Allow Remote Connections
On each instance, edit the pg_hba.conf
file:
----------------------------------------------------
4. Restart PostgreSQL
After making changes:
ec2-ip: Server Ip address
username: Server pg username
6. Update Database.yml file
default: &default adapter: postgresql encoding: unicode pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> username: <%= ENV["DATABASE_USERNAME"] %> password: <%= ENV["DATABASE_PASSWORD"] %> database: <%= ENV["DATABASE_NAME"] %> host: <%= ENV["DATABASE_HOST"] %> development: <<: *default staging: <<: *default test: <<: *default production: <<: *default
Application.yml file
development:
DATABASE_NAME: "database_name" # This is server database name
DATABASE_HOST: "IP"
DATABASE_USERNAME: "Server pg username"
DATABASE_PASSWORD: "Server pg password"