|
I use the Linux system is: RedHat
[Root @ infa ~] # wget http://download.redis.io/releases/redis-2.8.12.tar.gz
Tar xzf redis-2.8.12.tar.gz
[Root @ infa ~] # tar xzf redis-2.8.12.tar.gz
[Root @ infa ~] # cd redis-2.8.12
[Root @ infa redis-2.8.12] # ls
00-RELEASENOTES BUGS CONTRIBUTING COPYING deps INSTALL Makefile MANIFESTO README redis.conf runtest runtest-sentinel sentinel.conf src tests utils
[Root @ infa redis-2.8.12] # make
But this will be given the wrong translation, it seems because of the reasons for the system;
The solution is to add the compiler parameter settings, as follows:
[Root @ infa redis-2.8.12] # make CFLAGS = "- march = i686"
Compile successfully;
Start and run redis:
[Root @ infa redis-2.8.12] # src / redis-server
Open another terminal to run, redis client
[Root @ infa redis-2.8.12] # src / redis-cli
127.0.0.1:6379> set name chenzhou
OK
127.0.0.1:6379> get name
"Chenzhou"
127.0.0.1:6379>
Appendix 2: Redis Linux service as a boot
Here is one of the easiest ways to do this, preferably by writing a bootstrap script.
If you want to boot redis, we need to set the redis daemon background (if you do not set to start the background, the linux graphical interface will be stuck in a blank page), and redis only a startup parameter, is redis configuration file path. Redis default configuration file redis.conf redis installation directory. We can copy the file to the / etc directory
Shell code
1 [root @ localhost redis-2.6.14] # cp redis.conf / etc /
Redis default configuration file daemonize parameter value is no, on behalf of non-background start, so we need to modify the value of the parameter is yes.
After modifying daemonize parameters, redis will be able to start through the daemon, then the next step is to add redis linux boot service configuration, the specific steps are as follows:
Use the VI editor to open the Linux boot service configuration file, /etc/rc.local, and add the following line of code:
Shell code
2 / usr / local / redis-2.6.14 / src / redis-server /etc/redis.conf
Save after editing, and then restart the system on OK.
Stop the Redis service:
Shell code
3src / redis-cli shutdown |
|
|
|