Last active
June 30, 2017 08:47
-
-
Save theriverman/16f06f13962aa6767b68d4f93c8f5074 to your computer and use it in GitHub Desktop.
Revisions
-
theriverman renamed this gist
Jun 30, 2017 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
theriverman revised this gist
Jun 29, 2017 . 1 changed file with 11 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,6 +14,17 @@ DATABASES = { "PORT": "3306", }, } ___________________________________________________________ Replace the target database in common.py (try migrating database settings to local.py) sed -Ei 's/psql/psql-slave/g' psql_setting #Master to Slave sed -Ei 's/psql-slave/psql/g' psql_setting #Slave to Master # Exact match: sed -i 's/\<$basename\>/${basename}_yesterday/g' file.txt https://stackoverflow.com/questions/26608906/django-multiple-databases-fallback-to-master-if-slave-is-down -
theriverman created this gist
Jun 29, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ DATABASES = { "follower": { "ENGINE": "django.db.backends.postgresql", "NAME": "follower", "USER": "root", "HOST": "54.34.65.24", "PORT": "3306", }, "default": { "ENGINE": "django.db.backends.postgresql", "NAME": "application", "USER": "root", "HOST": "54.34.65.23", "PORT": "3306", }, } https://stackoverflow.com/questions/26608906/django-multiple-databases-fallback-to-master-if-slave-is-down