Using Python Client (redis-py) connection redis--Cloud DCs for Redis experience

Source: Internet
Author: User
Tags python script install redis



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


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.