-
Notifications
You must be signed in to change notification settings - Fork 4
Config
Masashi AKISUE edited this page Nov 9, 2016
·
1 revision
Here is example for config/shards.yml.
You could write the config with ERB.
default: &default
adapter: mysql2
encoding: utf8
charset: utf8
reconnect: false
username: <%= ENV['MYSQL_USER_NAME'] %>
password: <%= ENV['MYSQL_ROOT_PASSWORD'] %>
host: <%= ENV['MYSQL_HOST'] %>
port: <%= ENV['MYSQL_PORT'] %>
database: sample_<%= Rails.env %>
tako:
<%= Rails.env %>:
shard01:
<<: *default
host: <%= ENV['MYSQL_SHARD1_HOST'] %>
shard01:
<<: *default
host: <%= ENV['MYSQL_SHARD2_HOST'] %>
master:
<<: *default