##// END OF EJS Templates
elasticsearch: support multiple ES nodes
ergo -
r5:36e6039f
parent child Browse files
Show More
@@ -131,7 +131,7 b' def main(global_config, **settings):'
131 config.include('appenlight_client.ext.pyramid_tween')
131 config.include('appenlight_client.ext.pyramid_tween')
132 config.include('ziggurat_foundations.ext.pyramid.sign_in')
132 config.include('ziggurat_foundations.ext.pyramid.sign_in')
133 config.registry.es_conn = pyelasticsearch.ElasticSearch(
133 config.registry.es_conn = pyelasticsearch.ElasticSearch(
134 settings['elasticsearch.nodes'])
134 aslist(settings['elasticsearch.nodes']))
135 config.registry.redis_conn = redis.StrictRedis.from_url(
135 config.registry.redis_conn = redis.StrictRedis.from_url(
136 settings['redis.url'])
136 settings['redis.url'])
137
137
@@ -98,7 +98,7 b' class Log(Base, BaseModel):'
98 return None
98 return None
99
99
100 to_hash = '{}_{}_{}'.format(self.resource_id, self.primary_key,
100 to_hash = '{}_{}_{}'.format(self.resource_id, self.primary_key,
101 self.namespace)
101 self.namespace)
102 return hashlib.sha1(to_hash.encode('utf8')).hexdigest()
102 return hashlib.sha1(to_hash.encode('utf8')).hexdigest()
103
103
104 def es_doc(self):
104 def es_doc(self):
@@ -37,7 +37,7 b' encryption_secret = oEOikr_T98wTh_xLH3w8Se3kmbgAQYSM4poZvPosya0='
37 redis.url = redis://localhost:6379/0
37 redis.url = redis://localhost:6379/0
38 redis.redlock.url = redis://localhost:6379/3
38 redis.redlock.url = redis://localhost:6379/3
39
39
40 #solr
40 #elasticsearch
41 elasticsearch.nodes = http://127.0.0.1:9200
41 elasticsearch.nodes = http://127.0.0.1:9200
42
42
43 #dirs
43 #dirs
@@ -25,7 +25,7 b' encryption_secret = oEOikr_T98wTh_xLH3w8Se3kmbgAQYSM4poZvPosya0='
25 redis.url = redis://localhost:6379/0
25 redis.url = redis://localhost:6379/0
26 redis.redlock.url = redis://localhost:6379/3
26 redis.redlock.url = redis://localhost:6379/3
27
27
28 #solr
28 #elasticsearch
29 elasticsearch.nodes = http://127.0.0.1:9200
29 elasticsearch.nodes = http://127.0.0.1:9200
30
30
31 #dirs
31 #dirs
General Comments 0
You need to be logged in to leave comments. Login now