Added some settings for elasticsearch

This commit is contained in:
Rob Hudson 2013-05-24 16:50:09 -07:00
Родитель 5aaf2469ed
Коммит 90581546a4
4 изменённых файлов: 16 добавлений и 5 удалений

Просмотреть файл

@ -35,7 +35,7 @@ DATABASES = {
'ENGINE': 'django.db.backends.mysql',
'USER': 'root',
'PASSWORD': '',
'OPTIONS': {'init_command': 'SET storage_engine=InnoDB'},
'OPTIONS': {'init_command': 'SET storage_engine=InnoDB'},
'TEST_CHARSET': 'utf8',
'TEST_COLLATION': 'utf8_general_ci',
},
@ -89,3 +89,7 @@ APP_PURCHASE_SECRET = 'This secret must match your webpay SECRET'
# Assuming you did `npm install` (and not `-g`) like you were supposed to,
# this will be the path to the `stylus` executable.
STYLUS_BIN = path('node_modules/stylus/bin/stylus')
# Locally we typically don't run more than 1 elasticsearch node. So we set
# replicas to zero.
ES_DEFAULT_NUM_REPLICAS = 0

Просмотреть файл

@ -1,6 +1,12 @@
Settings Changelog
==================
2013-05-24
----------
* Added ``ES_DEFAULT_NUM_REPLICAS``. Locally if you're running a single
Elasticsearch node you probably want to set this to 0 (zero).
* Added ``ES_DEFAULT_NUM_SHARDS``. Locally 3 shards is sufficient.
2012-04-12
----------
* Removed ``GEOIP_NOOP``, ``GEOIP_HOST``, and ``GEOIP_PORT`` as they are no

Просмотреть файл

@ -36,8 +36,6 @@ logger = logging.getLogger('z.elasticsearch')
# The subset of settings.ES_INDEXES we are concerned with.
DEFAULT_NUM_REPLICAS = 2
DEFAULT_NUM_SHARDS = 5
ALIAS = settings.ES_INDEXES['webapp']
if hasattr(settings, 'ES_URLS'):
@ -215,8 +213,9 @@ class Command(BaseCommand):
else:
s = {}
num_replicas = s.get('number_of_replicas', DEFAULT_NUM_REPLICAS)
num_shards = s.get('number_of_shards', DEFAULT_NUM_SHARDS)
num_replicas = s.get('number_of_replicas',
settings.ES_DEFAULT_NUM_REPLICAS)
num_shards = s.get('number_of_shards', settings.ES_DEFAULT_NUM_SHARDS)
# Start our chain of events to re-index.
tree = TaskTree()

Просмотреть файл

@ -1374,6 +1374,8 @@ ES_INDEXES = {'default': 'addons',
'stats_collections_counts': 'addons_stats',
'users_install': 'addons_stats'}
ES_TIMEOUT = 30
ES_DEFAULT_NUM_REPLICAS = 2
ES_DEFAULT_NUM_SHARDS = 5
# Default AMO user id to use for tasks.
TASK_USER_ID = 4757633