Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | |
| 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 | 26 | 27 |
| 28 | 29 | 30 |
Tags
- 맥북 엑셀 한글
- terraform
- ovirt
- OSX 엑셀
- 맥북 한글
- 연결이 비공개
- Chrome
- 맥북 백업
- yum
- 인증서
- rhv
- 테라폼
- tfenv
- AWS
- Cannot upload enabled repos report
- v1alpha1
- invalid apiVersion
- 버전관리
- 타임머신
- 빠르게
- EKS
- 테라폼 버전
- ERR_CERT_INVALID
Archives
- Today
- Total
hisosic
ElastiCache (Redis) Socket Connect Timeout Check 본문
#!/bin/env python3
from redis import Redis
from datetime import datetime
import time
redis_host = 'cxx-redis-sxxx.lxxxm.0001.usw2.cache.amazonaws.com'
while True:
res = False
time.sleep(0.5)
now = datetime.today().strftime("%H:%M:%S")
try:
r = Redis(redis_host, socket_connect_timeout=1) # short timeout for the test
res = r.ping()
except Exception as e:
print(f"[{now}] ERROR {res}, {e}")
if res:
print(f'[{now}] connected to redis {redis_host}')
Comments