1, 第一步,下载,解压,编译,安装
$ wget http://download.redis.io/releases/redis-3.0.3.tar.gz$ tar xzf redis-3.0.3.tar.gz$ cd redis-3.0.3$ make
$ cd src && make installed
在当前目录生成配置文件, 并复制到/etc目录
$cp redis.conf /etc/
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
2. Start and check of service
To start and run Redis:
A) $ cd/usr/local/bin
b)./redis-server/etc/redis.conf
Open another window and log in to Redis, first to see if Redis started successfully
c). Check whether the start is successful
$ PS-EF | grep Redis
d). Log in to the Redis client
$/usr/local/bin/redis-cli
>set name Liming
>get Name
3, configuration file parameters Introduction
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)
4, more content reference http://www.redis.cn/download.html
5, Supplement
#加上 ' & ' makes Redis run as a daemon. /redis-server &
#检测后台进程是否存在ps-ef |grep redis6379#使用 ' redis-cli ' client to detect the connection is normal./redis-cli127.0. 0. 1:Set) 127.0. 0. 1:"Hello world" OK127.0. 0. 1:get key' Hello World '
Stop it
Shutdown#因为Redis可以妥善处理SIGTERM信号, so direct kill-9 is also possible. Kill-9 PID
Installation of Redis