Redis Python-redis Installation Detailed steps

Source: Internet
Author: User

Installing Redis

Installing Redis into the/opt/redis-2.8 directory

    • wget http://download.redis.io/releases/redis-2.8.1.tar.gz
    • Tar-zxfx redis-2.8.1.tar.gz
    • CD redis-2.8.1
    • Make && make prefix=/opt/redis-2.8 install
    • CP redis.conf/opt/redis-2.8/

Just use Redis as a queue and don't need storage, so edit/opt/redis-2.8/redis.conf

    • Set Daemonize Yes
    • save ..comment out all 3 strips so that the hard disk storage is turned off

Starting Redis is simple:/opt/redis-2.8/bin/redis-server /opt/redis-2.8/redis.conf

$REIDS_INSTALL_DIR/utils/redis_init_scriptThis script can be put into/ETC/INIT.D as a Redis boot script with a slight modification.

Install Python

CentOS comes with python2.4, too old to upgrade to 2.7

    • wget http://www.python.org/ftp/python/2.7.6/Python-2.7.6.tgz
    • TAR-ZVXF python-2.7.6.tgz
    • CD Python-2.7.6
    • ./configure
    • Make && make install
    • Replace the system default Python:sudo ln -s /usr/local/bin/python2.7 /usr/bin/python
To install a Python module
    • wget--no-check-certificate https://pypi.python.org/packages/source/r/redis/redis-2.8.0.tar.gz
    • TAR-ZVXF redis-2.8.0.tar.gz
    • MV redis-2.8.0 python-redis-2.8.0
    • CD python-redis-2.8.0
    • Python setup.py Install

Successful deployment, write code verification

import redisclient =  redis.StrictRedis(host=‘localhost‘, port=6379)print client.ping()

True

Successful execution

Redis Python-redis Installation Detailed steps

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.