修改均价系统到redis集群模式

This commit is contained in:
2018-06-19 11:20:21 +08:00
parent fa997f3f5b
commit 6190b6cd1f
8 changed files with 31 additions and 33 deletions
+15
View File
@@ -9,6 +9,7 @@ import requests
import json
import pickle
import redis
from rediscluster import StrictRedisCluster
from fangjia import mongoClients as mongoClients
from fangjia import ElasticsearchClient as es
from fangjia.cachedObjectWrapper import CachedObjectWrapper
@@ -526,6 +527,20 @@ def rent_find_disanganf_price(query, fields=None):
raise Exception("yang ben cha xun shi bai1")
def get_default_redis_connection():
redis_nodes = [
{'host': '192.168.0.79', 'port': 6379},
{'host': '192.168.0.79', 'port': 6380},
{'host': '192.168.0.79', 'port': 6381},
{'host': '192.168.0.81', 'port': 6382},
{'host': '192.168.0.81', 'port': 6383},
{'host': '192.168.0.81', 'port': 6384}
]
redis_connection = StrictRedisCluster(startup_nodes=redis_nodes)
return redis_connection