Download Source: wget http://redis.googlecode.com/files/redis-2.8.19.tar.gz
1, Decompression installation:
wget http://download.redis.io/releases/redis-2.8.19.tar.gz tar xzf redis-2.8.19.tar.gz cd redis-2.8.19 make make instal L 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
2. Modify the Redis configuration file:
CD/ETC vi redis.conf Modify DAEMONIZE Yes---purpose to make the process 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)
3. Start Redis:
Cd/usr/local/bin./redis-server/etc/redis.conf
4. Check whether the start is successful
Ps-ef | grep Redis
5. Test:
cd/usr/local/bin/
Enter the REDIS_CLI test as follows:
[[email protected] bin]# ./redis-cli127.0.0.1:6379> set names xiaozhangok127.0.0.1:6379> get Names "Xiaozhang" 127.0.0.1:6379>
Turn off Redis Services
REDIS-CLI shutdown
Linux install Redis extensions under PHP:
Reference Link: http://www.cnblogs.com/zgaspnet/p/3939198.html
1. Installing Redis
Download: https://github.com/nicolasff/phpredis/archive/2.2.4.tar.gz
Upload phpredis-2.2.4.tar.gz to/usr/local/src directory
CD/USR/LOCAL/SRC #进入软件包存放目录
Tar zxvf phpredis-2.2.4.tar.gz #解压
CD phpredis-2.2.4 #进入安装目录
/usr/local/webserver/php/bin/phpize #用phpize生成configure配置文件
./configure--with-php-config=/usr/local/webserver/php/bin/php-config #配置
Make #编译
Make install #安装
After the installation is complete, the following installation path appears
/usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20090626/
2. Configure PHP Support
Vi/usr/local/webserver/php/etc/php.ini #编辑配置文件, add the following on the last line
Add to
extension= "Redis.so"
: wq! #保存退出
3 Restart Service
Reference Link: http://www.th7.cn/Program/php/201406/218337.shtml
1. Stop Nginx
/usr/local/webserver/nginx/sbin/nginx-s stop
2. Stop and restart PHP-FPM
Cd/usr/local/webserver/sbinpkill PHP-FPM/USR/LOCAL/WEBSERVER/SBIN/PHP-FPM
3. Start Nginx
/usr/local/webserver/nginx/sbin/nginx-c/usr/local/webserver/nginx/conf/nginx.conf
Install Redis and Linux under the Linux installation Redis extension