12345678910111213141516171819202122232425262728 |
- #! /usr/bin/env python3
- import json
- import logging
- import sys
- from redis import Redis
- logging.basicConfig(level=logging.INFO)
- def main():
- redis = RedisCluster(
- startup_nodes=[
- {"host": "xxx.yyy.clustercfg.zzz1.cache.amazonaws.com", "port": "6379"}
- ],
- decode_responses=True,
- skip_full_coverage_check=True,
- )
- if redis.ping():
- logging.info("Connected to Redis")
- else:
- logging.error("Could not connect to Redis")
- sys.exit(-1)
- if __name__ == "__main__":
- main()
|