1. Compile and install
1.1, install the compilation tool
First you need to install a variety of required tools:
gcc
gcc-c++
[Root@myhost/]# yum install gcc gcc-c++ 1.2, starting installation
installation, first need to download from the Redis website Redis installation package, such as this example: redis-3.2.5.tar.gz, can also download directly:
[Root@myhost soft]# wget http://download.redis.io/releases/redis-3.2.5.tar.gz
The installation package is a source package that requires local compilation before it can be installed and run.
Extract the installation source pack into a directory:
[Root@myhost server]# tar-zxvf/soft/redis-3.2.5.tar.gz
Compile:
[Root@myhost server]# CD redis-3.2.5
[Root@myhost redis-3.2.5]# make
You can use the root user to perform ' make install ' to copy the executable file to the/usr/local/bin directory. So you can just hit the name and run the program.
[Root@myhost redis-3.2.5]# make install
After compiling, you can find the following file under the "/usr/local/bin" l= Path:
-rwxr-xr-x. 1 root 2431728 November 19:44 Redis-benchmark
-rwxr-xr-x. 1 root 25165 November 19:44 redis-check-aof
-rwxr-xr-x. 1 root 5182199 November 19:44 Redis-check-rdb
-rwxr-xr-x. 1 root 2584443 November 19:44 redis-cli
lrwxrwxrwx. 1 root 12 November 19:44 Redis-sentinel-> redis-server
-rwxr-xr-x. 1 root 5182199 November 19:44 redis-server
Open the default port:
[Root@myhost server]# firewall-cmd--permanent--zone=public--add-port=6379/tcp
[Root@myhost server]# Firewall-cmd--reload
To modify the configuration file "redis.conf":
Bind 0.0.0.0
For the latest version 3. X, an attribute is added, the default is yes, and it needs to be closed:
Protected-mode No
Binding 0.0.0.0 represents allowing all IP addresses to access Redis remotely.
To start the service:
[Root@myhost redis-3.2.5]# nohup redis-server redis.conf &
Test Link:
[Root@myhost redis-3.2.5]# Redis-cli
127.0.0.1:6379>
This redis installation is complete.
Kill Service:
[Root@myhost redis-3.2.5]# redis-cli shutdown