redis sentinel 그룹을 구성했습니다 (자동 장애 조치가있는 마스터 1 개와 슬레이브 2 개). 연결은 모두 좋으며, 센티넬 장애 조치가 작동하지만 응용 프로그램에서 연결할 때 throw됩니다. 정보 명령을 실행할 때 연결 오류가 진열되어 폐쇄 https://discuss.zendesk.com/hc/en-us/articles/205309388-How-to-setup-HAProxy-and-Redis-Sentinel-for-automatic-failover-between-Redis-Master-and-Slave-servers이Redis : Django에서 서버 오류로 연결이 끊어졌습니다.
내가 레디 스-CLI하지만를 사용 haproxy에 연결할 수 있습니다 다음과 같은 오류가 :
Request Method: GET
Request URL: https://node-app/leaderboard/5790778dd4a8db6171625910/
Django Version: 1.9.9
Python Version: 2.7.6
Installed Applications:
['django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django_mongoengine',
'django_mongoengine.mongo_auth',
'django_mongoengine.mongo_admin.sites',
'django_mongoengine.mongo_admin',
'mongonaut',
'rest_framework',
'rest_framework_swagger',
'rest_framework_mongoengine',
'rest_framework.authtoken',
'social.apps.django_app.me',
'rest_social_auth',
'django_s3_storage',
'mongoengine',
'corsheaders',
'seacucumber',
'djcelery',
'src',
'oauth2_provider',
'rest_framework_social_oauth2']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
'corsheaders.middleware.CorsMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'social.apps.django_app.middleware.SocialAuthExceptionMiddleware']
Traceback:
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
149. response = self.process_exception_by_middleware(e, request)
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
147. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/views/decorators/csrf.py" in wrapped_view
58. return view_func(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/views/generic/base.py" in view
68. return self.dispatch(request, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/rest_framework/views.py" in dispatch
466. response = self.handle_exception(exc)
File "/usr/local/lib/python2.7/dist-packages/rest_framework/views.py" in dispatch
463. response = handler(request, *args, **kwargs)
File "./src/apps/users/views/rankview.py" in get
16. ranks, status = RankClass.retrieve_rank(id)
File "./src/apps/users/libraries/ranklib.py" in retrieve_rank
132. ranks[name][TOP] = leaderboard.top(TOPRANKUPTO, with_member_data=True)
File "/usr/local/lib/python2.7/dist-packages/leaderboard/leaderboard.py" in top
890. return self.top_in(self.leaderboard_name, number, **options)
File "/usr/local/lib/python2.7/dist-packages/leaderboard/leaderboard.py" in top_in
903. return self.members_from_rank_range_in(leaderboard_name, 1, number, **options)
File "/usr/local/lib/python2.7/dist-packages/leaderboard/leaderboard.py" in members_from_rank_range_in
861. if ending_rank > self.total_members_in(leaderboard_name):
File "/usr/local/lib/python2.7/dist-packages/leaderboard/leaderboard.py" in total_members_in
323. return self.redis_connection.zcard(leaderboard_name)
File "/usr/local/lib/python2.7/dist-packages/redis/client.py" in zcard
1595. return self.execute_command('ZCARD', name)
File "/usr/local/lib/python2.7/dist-packages/redis/client.py" in execute_command
578. connection.send_command(*args)
File "/usr/local/lib/python2.7/dist-packages/redis/connection.py" in send_command
563. self.send_packed_command(self.pack_command(*args))
File "/usr/local/lib/python2.7/dist-packages/redis/connection.py" in send_packed_command
538. self.connect()
File "/usr/local/lib/python2.7/dist-packages/redis/connection.py" in connect
446. self.on_connect()
File "/usr/local/lib/python2.7/dist-packages/redis/connection.py" in on_connect
514. if nativestr(self.read_response()) != 'OK':
File "/usr/local/lib/python2.7/dist-packages/redis/connection.py" in read_response
577. response = self._parser.read_response()
File "/usr/local/lib/python2.7/dist-packages/redis/connection.py" in read_response
238. response = self._buffer.readline()
File "/usr/local/lib/python2.7/dist-packages/redis/connection.py" in readline
168. self._read_from_socket()
File "/usr/local/lib/python2.7/dist-packages/redis/connection.py" in _read_from_socket
143. (e.args,))
Exception Type: ConnectionError at /leaderboard/5790778dd4a8db6171625910/
Exception Value: Error while reading from socket: ('Connection closed by server.',)
내가 haproxy - 레디 스-감시 설정에 대해 다음 문서를 따라 (그것은 나를 redis-cli 쉘로 떨어 뜨린다), 또한 auth는 redis로 가능하다. 아무런 문제없이 일하고 있습니다. 등
구성은, 내가 방화벽, 보안 그룹 등을 확인하고 노스 캐롤라이나 -zv 모두가 그렇게