Commit a78cde93 by Morgan Robertson

Replace `DATABASE_OPTIONS` setting.

`DATABASE_OPTIONS` was deprecated in Django 1.2 and removed in 1.4.
`OPTIONS` should now be passed as part of `DATABASES`.
parent 3839b97e
......@@ -20,7 +20,11 @@ ANALYTICS_API_PIP_EXTRA_ARGS: "-i {{ COMMON_PYPI_MIRROR_URL }}"
ANALYTICS_API_NGINX_PORT: "18100"
ANALYTICS_API_DEFAULT_DB_NAME: 'analytics-api'
ANALYTICS_API_DEFAULT_MYSQL_OPTIONS:
connect_timeout: 10
ANALYTICS_API_REPORTS_DB_NAME: 'reports'
ANALYTICS_API_REPORTS_MYSQL_OPTIONS:
connect_timeout: 10
ANALYTICS_API_DATABASES:
# rw user
......@@ -31,6 +35,7 @@ ANALYTICS_API_DATABASES:
PASSWORD: 'password'
HOST: 'localhost'
PORT: '3306'
OPTIONS: "{{ ANALYTICS_API_DEFAULT_MYSQL_OPTIONS }}"
# read-only user
reports:
ENGINE: 'django.db.backends.mysql'
......@@ -39,6 +44,7 @@ ANALYTICS_API_DATABASES:
PASSWORD: 'password'
HOST: 'localhost'
PORT: '3306'
OPTIONS: "{{ ANALYTICS_API_REPORTS_MYSQL_OPTIONS }}"
ANALYTICS_API_VERSION: "master"
# Default dummy user, override this!!
......@@ -110,8 +116,6 @@ ANALYTICS_API_SERVICE_CONFIG:
STATICFILES_DIRS: ['static']
STATIC_ROOT: "{{ COMMON_DATA_DIR }}/{{ analytics_api_service_name }}/staticfiles"
# db config
DATABASE_OPTIONS:
connect_timeout: 10
DATABASES: '{{ ANALYTICS_API_DATABASES }}'
ELASTICSEARCH_LEARNERS_HOST: '{{ ANALYTICS_API_ELASTICSEARCH_LEARNERS_HOST }}'
ELASTICSEARCH_LEARNERS_INDEX: '{{ ANALYTICS_API_ELASTICSEARCH_LEARNERS_INDEX }}'
......
......@@ -17,6 +17,8 @@
# MySQL usernames are limited to 16 characters
{{ role_name|upper }}_MYSQL_USER: '{{ role_name[:13] }}001'
{{ role_name|upper }}_MYSQL_PASSWORD: 'password'
{{ role_name|upper }}_MYSQL_OPTIONS:
connect_timeout: 10
{{ role_name|upper }}_DATABASES:
# rw user
......@@ -29,6 +31,7 @@
PORT: '3306'
ATOMIC_REQUESTS: true
CONN_MAX_AGE: 60
OPTIONS: '{{ '{{' }} {{ role_name|upper}}_MYSQL_OPTIONS }}'
{{ role_name|upper }}_MEMCACHE: [ 'memcache' ]
......@@ -71,8 +74,6 @@
STATIC_ROOT: "{{ '{{' }} COMMON_DATA_DIR }}/{{ '{{' }} {{ role_name }}_service_name }}/staticfiles"
# db config
DATABASE_OPTIONS:
connect_timeout: 10
DATABASES: '{{ '{{' }} {{ role_name|upper }}_DATABASES }}'
CACHES: '{{ '{{' }} {{ role_name|upper }}_CACHES }}'
......
......@@ -24,6 +24,9 @@ CREDENTIALS_MYSQL_HOST: 'localhost'
# MySQL usernames are limited to 16 characters
CREDENTIALS_MYSQL_USER: 'credentials001'
CREDENTIALS_MYSQL_PASSWORD: 'SET-ME-TO-A-UNIQUE-LONG-RANDOM-STRING'
CREDENTIALS_DATABASE_PORT: '3306'
CREDENTIALS_MYSQL_OPTIONS:
connect_timeout: 10
CREDENTIALS_DATABASES:
# rw user
......@@ -33,7 +36,8 @@ CREDENTIALS_DATABASES:
USER: '{{ CREDENTIALS_MYSQL_USER }}'
PASSWORD: '{{ CREDENTIALS_MYSQL_PASSWORD }}'
HOST: '{{ CREDENTIALS_MYSQL_HOST }}'
PORT: '3306'
PORT: '{{ CREDENTIALS_DATABASE_PORT }}'
OPTIONS: '{{ CREDENTIALS_MYSQL_OPTIONS }}'
ATOMIC_REQUESTS: true
CONN_MAX_AGE: 60
......@@ -174,8 +178,6 @@ CREDENTIALS_SERVICE_CONFIG:
EXTRA_APPS: '{{ CREDENTIALS_EXTRA_APPS }}'
# db config
DATABASE_OPTIONS:
connect_timeout: 10
DATABASES: '{{ CREDENTIALS_DATABASES }}'
CACHES: '{{ CREDENTIALS_CACHES }}'
......
......@@ -24,6 +24,9 @@ DISCOVERY_MYSQL: 'localhost'
# MySQL usernames are limited to 16 characters
DISCOVERY_MYSQL_USER: 'discov001'
DISCOVERY_MYSQL_PASSWORD: 'password'
DISCOVERY_MYSQL_PORT: '3306'
DISCOVERY_MYSQL_OPTIONS:
connect_timeout: 10
DISCOVERY_DATABASES:
# rw user
......@@ -33,7 +36,8 @@ DISCOVERY_DATABASES:
USER: '{{ DISCOVERY_MYSQL_USER }}'
PASSWORD: '{{ DISCOVERY_MYSQL_PASSWORD }}'
HOST: '{{ DISCOVERY_MYSQL }}'
PORT: '3306'
PORT: '{{ DISCOVERY_MYSQL_PORT }}'
OPTIONS: '{{ DISCOVERY_MYSQL_OPTIONS }}'
ATOMIC_REQUESTS: false
CONN_MAX_AGE: 60
......@@ -139,8 +143,6 @@ DISCOVERY_SERVICE_CONFIG:
STATIC_ROOT: "{{ COMMON_DATA_DIR }}/{{ discovery_service_name }}/staticfiles"
# db config
DATABASE_OPTIONS:
connect_timeout: 10
DATABASES: '{{ DISCOVERY_DATABASES }}'
CACHES: '{{ DISCOVERY_CACHES }}'
......
......@@ -25,6 +25,8 @@ ECOMMERCE_DATABASE_USER: "ecomm001"
ECOMMERCE_DATABASE_PASSWORD: "password"
ECOMMERCE_DATABASE_HOST: "localhost"
ECOMMERCE_DATABASE_PORT: 3306
ECOMMERCE_MYSQL_OPTIONS:
connect_timeout: 10
ECOMMERCE_DATABASES:
# rw user
......@@ -35,6 +37,7 @@ ECOMMERCE_DATABASES:
PASSWORD: '{{ ECOMMERCE_DATABASE_PASSWORD }}'
HOST: '{{ ECOMMERCE_DATABASE_HOST }}'
PORT: '{{ ECOMMERCE_DATABASE_PORT }}'
OPTIONS: '{{ ECOMMERCE_MYSQL_OPTIONS }}'
ATOMIC_REQUESTS: true
CONN_MAX_AGE: 60
......@@ -174,8 +177,6 @@ ECOMMERCE_SERVICE_CONFIG:
STATIC_ROOT: "{{ COMMON_DATA_DIR }}/{{ ecommerce_service_name }}/staticfiles"
# db config
DATABASE_OPTIONS:
connect_timeout: 10
DATABASES: '{{ ECOMMERCE_DATABASES }}'
PAYMENT_PROCESSOR_CONFIG: '{{ ECOMMERCE_PAYMENT_PROCESSOR_CONFIG }}'
......
......@@ -20,6 +20,9 @@ EDX_NOTES_API_MYSQL_DB_USER: notes001
EDX_NOTES_API_MYSQL_DB_NAME: "{{ EDX_NOTES_API_DATASTORE_NAME }}"
EDX_NOTES_API_MYSQL_DB_PASS: secret
EDX_NOTES_API_MYSQL_HOST: localhost
EDX_NOTES_API_MYSQL_PORT: "3306"
EDX_NOTES_API_MYSQL_OPTIONS:
connect_timeout: 10
EDX_NOTES_API_ELASTICSEARCH_URL: http://127.0.0.1:9200
EDX_NOTES_API_NEWRELIC_APPNAME: "{{ COMMON_ENVIRONMENT }}-{{ COMMON_DEPLOYMENT }}-notes"
# Change these values!!
......@@ -38,7 +41,8 @@ EDX_NOTES_API_DATABASES:
USER: "{{ EDX_NOTES_API_MYSQL_DB_USER }}"
PASSWORD: "{{ EDX_NOTES_API_MYSQL_DB_PASS }}"
HOST: "{{ EDX_NOTES_API_MYSQL_HOST }}"
PORT: 3306
PORT: "{{ EDX_NOTES_API_MYSQL_PORT }}"
OPTIONS: "{{ EDX_NOTES_API_MYSQL_OPTIONS }}"
EDX_NOTES_API_ALLOWED_HOSTS:
- localhost
EDX_NOTES_API_DISABLE_TOKEN_CHECK: False
......@@ -69,8 +73,6 @@ edx_notes_api_service_config:
RESULTS_DEFAULT_SIZE: 25
# Max number of rows to return in result.
RESULTS_MAX_SIZE: 250
DATABASE_OPTIONS:
connect_timeout: 10
DATABASES: "{{ EDX_NOTES_API_DATABASES }}"
HAYSTACK_CONNECTIONS:
default:
......
......@@ -76,16 +76,19 @@ EDXAPP_MYSQL_USER_ADMIN: 'root'
EDXAPP_MYSQL_PASSWORD: 'password'
EDXAPP_MYSQL_PASSWORD_READ_ONLY: 'password'
EDXAPP_MYSQL_PASSWORD_ADMIN: 'password'
EDXAPP_MYSQL_OPTIONS: {}
EDXAPP_MYSQL_REPLICA_DB_NAME: "{{ EDXAPP_MYSQL_DB_NAME }}"
EDXAPP_MYSQL_REPLICA_USER: "{{ EDXAPP_MYSQL_USER }}"
EDXAPP_MYSQL_REPLICA_PASSWORD: "{{ EDXAPP_MYSQL_PASSWORD }}"
EDXAPP_MYSQL_REPLICA_HOST: "{{ EDXAPP_MYSQL_HOST }}"
EDXAPP_MYSQL_REPLICA_PORT: "{{ EDXAPP_MYSQL_PORT }}"
EDXAPP_MYSQL_REPLICA_OPTIONS: "{{ EDXAPP_MYSQL_OPTIONS }}"
EDXAPP_MYSQL_CSMH_DB_NAME: "edxapp_csmh"
EDXAPP_MYSQL_CSMH_USER: "{{ EDXAPP_MYSQL_USER }}"
EDXAPP_MYSQL_CSMH_PASSWORD: "{{ EDXAPP_MYSQL_PASSWORD }}"
EDXAPP_MYSQL_CSMH_HOST: "{{ EDXAPP_MYSQL_HOST }}"
EDXAPP_MYSQL_CSMH_PORT: "{{ EDXAPP_MYSQL_PORT }}"
EDXAPP_MYSQL_CSMH_OPTIONS: "{{ EDXAPP_MYSQL_OPTIONS }}"
# This is Django's default https://docs.djangoproject.com/en/1.8/ref/settings/#conn-max-age
EDXAPP_MYSQL_CONN_MAX_AGE: 0
......@@ -775,6 +778,7 @@ edxapp_databases:
HOST: "{{ EDXAPP_MYSQL_REPLICA_HOST }}"
PORT: "{{ EDXAPP_MYSQL_REPLICA_PORT }}"
CONN_MAX_AGE: "{{ EDXAPP_MYSQL_CONN_MAX_AGE }}"
OPTIONS: "{{ EDXAPP_MYSQL_REPLICA_OPTIONS }}"
default:
ENGINE: 'django.db.backends.mysql'
NAME: "{{ EDXAPP_MYSQL_DB_NAME }}"
......@@ -784,6 +788,7 @@ edxapp_databases:
PORT: "{{ EDXAPP_MYSQL_PORT }}"
ATOMIC_REQUESTS: True
CONN_MAX_AGE: "{{ EDXAPP_MYSQL_CONN_MAX_AGE }}"
OPTIONS: "{{ EDXAPP_MYSQL_OPTIONS }}"
student_module_history:
ENGINE: 'django.db.backends.mysql'
NAME: "{{ EDXAPP_MYSQL_CSMH_DB_NAME }}"
......@@ -792,6 +797,7 @@ edxapp_databases:
HOST: "{{ EDXAPP_MYSQL_CSMH_HOST }}"
PORT: "{{ EDXAPP_MYSQL_CSMH_PORT }}"
CONN_MAX_AGE: "{{ EDXAPP_MYSQL_CONN_MAX_AGE }}"
OPTIONS: "{{ EDXAPP_MYSQL_CSMH_OPTIONS }}"
edxapp_generic_auth_config: &edxapp_generic_auth
EVENT_TRACKING_SEGMENTIO_EMIT_WHITELIST: "{{ EDXAPP_EVENT_TRACKING_SEGMENTIO_EMIT_WHITELIST }}"
......
......@@ -60,11 +60,12 @@ INSIGHTS_OPEN_SOURCE_URL: 'http://set-me-please'
INSIGHTS_LEARNER_API_LIST_DOWNLOAD_FIELDS: !!null
INSIGHTS_DATABASE_NAME: 'dashboard'
INSIGHTS_DATABASE_USER: rosencrantz
INSIGHTS_DATABASE_PASSWORD: secret
INSIGHTS_DATABASE_HOST: 127.0.0.1
INSIGHTS_DATABASE_PORT: 3306
INSIGHTS_MYSQL_OPTIONS:
connect_timeout: 10
INSIGHTS_DATABASES:
# rw user
......@@ -75,6 +76,7 @@ INSIGHTS_DATABASES:
PASSWORD: '{{ INSIGHTS_DATABASE_PASSWORD }}'
HOST: "{{ INSIGHTS_DATABASE_HOST }}"
PORT: '{{ INSIGHTS_DATABASE_PORT }}'
OPTIONS: "{{ INSIGHTS_MYSQL_OPTIONS }}"
INSIGHTS_LMS_COURSE_SHORTCUT_BASE_URL: "URL_FOR_LMS_COURSE_LIST_PAGE"
......@@ -127,8 +129,6 @@ INSIGHTS_CONFIG:
RESEARCH_URL: '{{ INSIGHTS_RESEARCH_URL }}'
OPEN_SOURCE_URL: '{{ INSIGHTS_OPEN_SOURCE_URL }}'
# db config
DATABASE_OPTIONS:
connect_timeout: 10
DATABASES: "{{ INSIGHTS_DATABASES }}"
LMS_COURSE_SHORTCUT_BASE_URL: "{{ INSIGHTS_LMS_COURSE_SHORTCUT_BASE_URL }}"
COURSE_API_URL: "{{ INSIGHTS_COURSE_API_URL }}"
......
......@@ -56,6 +56,7 @@ XQUEUE_MYSQL_USER: 'xqueue001'
XQUEUE_MYSQL_PASSWORD: 'password'
XQUEUE_MYSQL_HOST: 'localhost'
XQUEUE_MYSQL_PORT: '3306'
XQUEUE_MYSQL_OPTIONS: {}
XQUEUE_NEWRELIC_APPNAME: "{{ COMMON_ENVIRONMENT }}-{{ COMMON_DEPLOYMENT }}-xqueue"
# Set the number of workers explicitely for xqueue
XQUEUE_WORKERS: !!null
......@@ -117,6 +118,7 @@ xqueue_auth_config:
HOST: "{{ XQUEUE_MYSQL_HOST }}"
PORT: "{{ XQUEUE_MYSQL_PORT }}"
ATOMIC_REQUESTS: True
OPTIONS: "{{ XQUEUE_MYSQL_OPTIONS }}"
RABBITMQ_USER: "{{ XQUEUE_RABBITMQ_USER }}"
RABBITMQ_PASS: "{{ XQUEUE_RABBITMQ_PASS }}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment