1. Install redis
1) download redis latest stable version: http://redis.googlecode.com/files/redis-2.4.14.tar.gz
2) unzip and install: Make & make test
3) install tcl8.5:
3.1) download tcl8.5 source package: wget http://downloads.sourceforge.net/tcl/tcl8.5.10-src.tar.gz
3.2) unzip and install: cd unix/&./configure -- prefix =/usr -- enable-threads -- Mandir =/usr/share/man
3.3) Make & sed-I-e "s @ ^ \ (tcl_src_dir = '\). * @ \ 1/usr/include '@ "-e"/tcl_ B/s @ =' \ (-L \)\?. * UNIX @ = '\ 1/usr/lib @ "tclconfig. Sh
3.4) make Test & make install-private-headers & ln-v-SF tclsh8.5/usr/bin/tclsh & chmod-V 755/usr/lib/libtcl8.5.so
4) install: make install
5) modify the configuration file VI/etc/redis. conf.
Daemonize yes # Whether the background process (yes/no) pidfile/usr/local/redis/var/redis. pid # PID file path port 6379 # redis server listening port bind 127.0.0.1 # Set the interface bound to redis. If not set, move to all timeout 300 # client connection timeout loglevel debug # Log Level (debug/verbose/notice/warning) logfile/usr/local/redis/var/redis. log # log file path (stdout/file path) Databases 16 # number of databases. The default database is db 0 save 90 100000 # How the database is saved to the disk: save <seconds> <changes> rdbcompression yes # Whether to compress dbfilename dump database data. RDB # database data file name DIR/usr/local/redis/var/# database data directory appendonly no # Whether to enable the appendfsync always function for each operation record # (no wait until the system synchronizes always every record is synchronized once every second) glueoutputbuf yes # define objects notesobjectspoolsize 1024
6) Start redis server:/usr/local/bin/redis-server/etc/redis. conf
Ii. Install redis-py (redis-py does not support Python 2.4)
After modifying the source code of some redis-py, the installation was successful. The test result is as follows:
[root@test redis-2.4.13]# pythonPython 2.4.3 (#1, Feb 22 2012, 16:05:45) [GCC 4.1.2 20080704 (Red Hat 4.1.2-52)] on linux2Type "help", "copyright", "credits" or "license" for more information.>>> import redis>>> r = redis.StrictRedis(host='127.0.0.1', port=6379)>>> r.set('foo', 'hello') True>>> r.rpush('mylist', 'one')1L>>> print r.get('foo') hello>>> print r.rpop('mylist')one>>>