Using Python to connect to Redis, you need to install Python and redis-py, and in CentOS as an example, introduce Redis-py's client environment setup.
No. 0 Step: Prepare for work
Cloud purchased 1 ECS (I chose CentOS 6.3), a distributed cache instance (DCS for Redis), I chose a standalone instance.
Note that ECS and cache instances are configured with the same VPC and security groups to ensure network interoperability.
1th Step: Install Python and redis-py
If your system does not have Python, you can install it using Yum mode.
Yum Install Python
Download and unzip Redis-py
Wget Https://github.com/andymccurdy/redis-py/archive/master.zip;
Go to the Unzip directory and install Redis-py
Python setup.py install;
After installation so verify, do not error instructions successfully installed REDIS-PY:
2nd step: Connect to Redis (cache instance)
Example of a command-line pattern (you can also write a command to a Python script and then execute it):
Using Python Client (redis-py) connection redis--Cloud DCs for Redis experience