Redis official: Http://redis.io/download
Redis Installation
cd/usr/local/src/redis-3.2.3sudo makesudo make install CP. /src/redis-benchmark/usr/local/redis/redis-3.2CP. /src/redis-check-aof/usr/local/redis/redis-3.2CP. /src/redis-check-rdb/usr/local/redis/redis-3.2CP. /src/redis-cli/usr/local/redis/redis-3.2CP. /src/redis-sentinel/usr/local/redis/redis-3.2CP. /src/redis-server/usr/local/redis/redis-3.2CP. /src/redis-trib.rb/usr/local/redis/redis-3.2 CP. /redis.conf/usr/local/redis/redis-3.2
When the make command finishes executing, the executable is generated in the current directory, respectively, Redis-server, REDIS-CLI, Redis-benchmark, redis-stat, and they function as follows:
- Redis-server:redis Server Daemon Startup program
- Redis-cli:redis command-line operation tool. Of course, you can also use Telnet to operate on its plain text protocol.
- Redis-benchmark:redis Performance testing tools to test the read and write performance of Redis in your system and in your configuration
- Redis-stat:redis Status Detection Tool to detect Redis current status parameters and delay status
How to start
After the installation is complete, to start, need the configuration file, in the downloaded file plus there is a default configuration file, you can modify
Parameters
After we successfully install Redis, we can run Redis directly by executing Redis-server, which is run by default configuration (not even run in the background). We want Redis to run on our request, then we need to modify the configuration file, the Redis configuration file is our second CP Operation Redis.conf file, and it is now copied to the/usr/local/redis/redis-3.2 directory. Modify it to configure our server. How to modify? The following are the meanings of the main configuration parameters of redis.conf:
- 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)
After the modification, to copy the configuration files to the installation directory/usr/local/redis/redis-3.2 below, to ensure that you can find
Start the server
cd/usr/local/redis/redis-3.2sudo. /redis-server/usr/local/redis/redis-3.2/redis.conf &
To see if it started successfully
Ps-ef | grep Redis
Verify
./redis-cli Ping 2 PONG
Ext.: http://www.cnblogs.com/52php/p/5809829.html
MAC Pro compile and install Redis-3.2.3