First, installation
1. Adding a compilation installation Environment GCC:yum install gcc-c++
2, Upload Redis (redis-3.2.9.tar.gz) to any directory, my side upload to the/root directory
3, decompression Redis (after decompression in the current directory more than one redis-3.2.9 directory): TAR-ZXVF redis-3.2.9.tar.gz
4. Compile Redis (compile. C to. O)
- CD redis-3.2.9
- Execution: make
5. Installation: Make Prefix=/usr/local/redis install
If the installation directory does not exist, it is automatically created
6. Copy the configuration file to the installation directory CP redis.conf/usr/local/redis/(this step if omitted, but Redis will go through the default configuration)
Second, the front-end start
1. Enter the installation directory:cd/usr/local/redis/bin/
2. Open Redis Server:./redis-server
3. Open a Linux window and open the client (./redis-cli-h 127.0.0.1-p 6379)
./REDIS-CLI (default connection local 6379 interface)
Third, back-end start
1, modify the configuration file VI redis.conf
Change Daemon daemonize No to daemonize Yes
2, open the service./bin/redis-server./redis.conf
View process Ps-ef at this time | Grep-i Redis, you can see
Note: Here we will find that when we open the server or client, we need to specify the Redis specific directory, in fact, we can configure Redis as an environment variable, you can open the Redis anywhere
1. Modify the configuration environment variable vim ~/.bash_profile
Export Redis_home=/usr/local/redis
Export path= $PATH: $REDIS _home/bin
2. Reload the configuration file:source ~/.bash_profile
Linux installation Redis