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_script
This 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