Install redis and centosredis in centos 6.5
Version: redis-2.8.19.tar.gz
Check whether the following dependencies are installed. If not, install them first. Otherwise, an exception occurs.
Yum installgcc-c ++
Yum install-y tcl.
1. Obtain the Installation File
Redis-2.8.19.tar.gz
Http://redis.io/download
2. decompress the file
Tar-xzvf redis-2.8.19.tar.gz
Music redis-2.8.19/usr/local/redis
3. Enter the Directory
Cd redis
4. Compile
Make
5. Installation
Make install
6. Set the configuration file path
Mkdir-p/etc/redis
Cp redis. conf/etc/redis
7. modify the configuration file
Vi/etc/redis. conf
Modify only: daemonize yes
8. Start
/Usr/local/bin/redis-server/etc/redis. conf
9. View startup
Ps-ef | grep redis
10. Use the client
Redis-cli
> Set namedavid
OK
11. Disable the client
Redis-cli shutdown
12. Exceptions and Solutions
Exception 1:
Make [2]: cc: Command not found
Cause of exception: gcc Is Not Installed
Solution: yum install gcc-c ++
Exception 2:
Zmalloc. h: 51: 31: error: jemalloc/jemalloc. h: No such file or directory
Cause of exception: Some compilation dependencies or issues left behind by the original compilation
Solution: make distclean. Clean up and then make.
Make test is required after make is successful. An exception occurred in make test.
Exception 1:
Couldn 'texecute "tclsh8.5": no such file or directory
Cause of exception: tcl is not installed
If you run make test without installing tcl to compile redis, the following error will be reported. This step can also be omitted, directly executing make install without executing make test has no effect on redis startup or shutdown.
[Root @ localhostredis] # make test
Cd src & make test
Make [1]: Enteringdirectory '/usr/local/webserver/redis/src'
You need tcl 8.5 ornewer in order to run the Redis test
Make [1]: *** [test] Error 1
Make [1]: Leavingdirectory '/usr/local/webserver/redis/src'
Make: *** [test] Error 2