Commit a72becb1 by Joseph Mulloy

Add mongo read preference OPS-2440

parent 206358db
- Role: edxapp
- Added `EDXAPP_MONGO_READ_PREFERENCE`,
`EDXAPP_MONGO_MODULESTORE_READ_PREFERENCE` and
`EDXAPP_MONGO_CONTENTSTORE_READ_PREFERENCE` to control MongoDB read
preference. If unset `EDXAPP_MONGO_MODULESTORE_READ_PREFERENCE` and
`EDXAPP_MONGO_CONTENTSTORE_READ_PREFERENCE` take the value of
`EDXAPP_MONGO_READ_PREFERENCE`, which is SECONDARY_PREFERED by
default.
- Role: server_utils
- Install "vim", not "vim-tiny".
......
......@@ -71,6 +71,9 @@ EDXAPP_MONGO_PORT: 27017
EDXAPP_MONGO_USER: 'edxapp'
EDXAPP_MONGO_DB_NAME: 'edxapp'
EDXAPP_MONGO_USE_SSL: False
EDXAPP_MONGO_READ_PREFERENCE: 'SECONDARY_PREFERRED'
EDXAPP_MONGO_MODULESTORE_READ_PREFERENCE: "{{ EDXAPP_MONGO_READ_PREFERENCE }}"
EDXAPP_MONGO_CONTENTSTORE_READ_PREFERENCE: "{{ EDXAPP_MONGO_READ_PREFERENCE }}"
EDXAPP_MYSQL_DB_NAME: 'edxapp'
EDXAPP_MYSQL_USER: 'edxapp001'
......@@ -851,6 +854,7 @@ edxapp_generic_doc_store_config: &edxapp_generic_default_docstore
user: "{{ EDXAPP_MONGO_USER }}"
collection: 'modulestore'
ssl: "{{ EDXAPP_MONGO_USE_SSL }}"
read_preference: "{{ EDXAPP_MONGO_MODULESTORE_READ_PREFERENCE }}"
# https://api.mongodb.com/python/2.9.1/api/pymongo/mongo_client.html#module-pymongo.mongo_client
socketTimeoutMS: 3000 # default is never timeout while the connection is open, this means it needs to explicitly close raising pymongo.errors.NetworkTimeout
connectTimeoutMS: 2000 # default is 20000, I believe raises pymongo.errors.ConnectionFailure
......@@ -937,6 +941,7 @@ edxapp_generic_auth_config: &edxapp_generic_auth
port: "{{ EDXAPP_MONGO_PORT }}"
user: "{{ EDXAPP_MONGO_USER }}"
ssl: "{{ EDXAPP_MONGO_USE_SSL }}"
read_preference: "{{ EDXAPP_MONGO_CONTENTSTORE_READ_PREFERENCE }}"
ADDITIONAL_OPTIONS: "{{ EDXAPP_CONTENTSTORE_ADDITIONAL_OPTS }}"
DOC_STORE_CONFIG: *edxapp_generic_default_docstore
DATABASES: "{{ edxapp_databases }}"
......
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