Original address: https://www.cnblogs.com/feijl/p/6879929.html
1. Download
Open Official Website: https://redis.io/
Download---Stable---Download3.2.8, download the latest stable version, this is 3.2.8
2. Installation
When the download is complete, open the command line tool and perform the decompression command
Tar zxvf redis-3.2.8.tar.gz
Put the extracted folder to/usr/local
MV redis-3.2.8/usr/local/
Switch to the appropriate directory
cd/usr/local/redis-3.2.8/
Compiling tests
sudo make test
Compiling the installation
sudo make install
Start Redis
Redis-server
3. Configuration
Create a bin,etc,db three directory under the Redis directory
sudo mkdir /usr/local/redis-3.2.8/binsudo mkdir /usr/local/redis-3.2.8/etcsudo mkdir /usr/local/ redis-3.2.8/db
Copy the Mkreleasehdr.sh,redis-benchmark, Redis-check-rdb, REDIS-CLI, redis-server from the/USR/LOCAL/REDIS/SRC directory to the bin directory
cp/usr/local/redis-3.2.8/src/mkreleasehdr.sh. Cp/usr/local/redis-3.2.8/src/redis-benchmark. cp/usr/local/ Redis-3.2.8/src/redis-check-rdb. Cp/usr/local/redis-3.2.8/src/redis-cli. cp/usr/local/redis-3.2.8/src/ Redis-server.
Copy redis.conf to/usr/local/redis/etc
Cp/usr/local/redis-3.2.8/redis.conf/usr/local/redis-3.2.8/etc
Modify Redis.conf
#修改为守护模式daemonize yes# Set Process lock file pidfile/usr/local/redis-3.2.8/redis.pid# Port 6379# client time-out timeout 300# log level loglevel debug# log file location logfile/usr/local/redis-3.2.8/log-redis.log# set the number of databases, the default database is 0, you can use select <dbid> command to specify the database iddatabases 16# #指定在多长时间内 on the connection, how many update operations to synchronize the data to the data file, multiple conditions can mate #save <seconds> <changes># Three conditions are available in the Redis default profile: Save 1save 10save 60 10000# Specifies whether data is compressed when stored to a local database, the default is Yes,redis with LZF compression, if in order to save CPU time, #可以关闭该 # option, But it can cause the database file to become huge rdbcompression yes# Specify the local database filename dbfilename dump.rdb# Specify the local database path dir/usr/local/redis-3.2.8/db/# Specifies whether logging occurs after each update operation, which, by default, writes data to disk asynchronously and, if not turned on, may cause data loss over a period of time when power is lost. Because the Redis itself synchronizes data files in sync with the save conditions above, the data for # will only exist in memory for a period of time appendonly no# Specify update log conditions, there are 3 optional values: #no: Indicates that the data cache of the operating system is synchronized to disk (FAST) # Always: Represents a manual call to Fsync () to write data to disk (slow, secure) after each update operation #everysec: Indicates synchronization once per second (tradeoff, default) Appendfsync everysec
Start the service
./bin/redis-server etc/redis.conf
View Logs
Tail-f Log-redis.log
Open the Redis client
./bin/redis-cli
Execute Redis command
Let's do it.
Mac System Installation Redis