1. :
$ wget http://download.redis.io/releases/redis-3.0.3.tar.gz
2. Unzip
$ TAR-ZVXF redis-3.0.3.tar.gz
3. Compile
$ CD redis-3.0.3
$ make
$make Install
$CP redis.conf/etc/
Parameter description:
When the make install command finishes executing, the executable is generated in the/usr/local/bin directory, respectively, Redis-server, REDIS-CLI, Redis-benchmark, Redis-check-aof, Redis-check-dump, they function as follows:
Redis-server:redis Server Daemon Startup program
Redis-cli:redis command-line operation tool. You can also use Telnet to manipulate it based on its plain text protocol.
Redis-benchmark:redis Performance Testing tool to test Redis's read and write performance under current system
REDIS-CHECK-AOF: Data Repair
Redis-check-dump: Check the Export tool
4. Modify the system configuration file, execute the command
A) echo Vm.overcommit_memory=1 >>/etc/sysctl.conf
b) Sysctl Vm.overcommit_memory=1
Use numeric meanings:
0, indicates that the kernel will check for sufficient available memory to be used by the process, and if sufficient memory is available, the memory request is allowed; otherwise, the memory request fails and the error is returned to the application process.
1, which means that the kernel allows all physical memory to be allocated regardless of the current memory state.
2, which indicates that the kernel allows allocating more memory than the sum of all physical memory and swap space
5. Modifying a Redis configuration file
A) $ cd/etc
b) VI redis.conf
c) Modify Daemonize Yes---to enable the process to run in the background
Parameter description:
Daemonize: Whether to run daemon mode later
Pidfile:pid File Location
Port: Port number for listening
Timeout: Request time-out
Loglevel:log Information level
Logfile:log File Location
Databases: number of open databases
Save *: How often the snapshot is saved, the first * indicates how long, and the third * indicates how many times the write operation is performed. Snapshots are automatically saved when a certain number of writes are performed within a certain amount of time. You can set multiple conditions.
Rdbcompression: Whether to use compression
Dbfilename: Data Snapshot file name (only file name, excluding directory)
Dir: Save directory for Data snapshot (this is the directory)
AppendOnly: If the appendonlylog is turned on, each write will record a log, which will improve the data anti-risk ability, but affect the efficiency.
Appendfsync:appendonlylog How to sync to disk (three options, each write is forced to call Fsync, Fsync per second, do not call Fsync wait for the system to synchronize itself)
6. Start Redis
A) $ cd/usr/local/bin
b)./redis-server/etc/redis.conf
7. Check whether the start is successful
A) $ ps-ef | grep Redis
CentOS Installation Redis