[iyunv@localhost 4setup]# wget http://redis.googlecode.com/files/redis-2.2.12.tar.gz --19:06:56-- http://redis.googlecode.com/files/redis-2.2.12.tar.gz 正在解析主机 redis.googlecode.com... 74.125.71.82
Connecting to redis.googlecode.com|74.125.71.82|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:455240 (445K) [application/x-gzip]
Saving to: `redis-2.2.12.tar.gz' 100%[==========================================>] 455,24034.8K/s in 13s
19:07:16 (34.8 KB/s) - `redis-2.2.12.tar.gz' saved [455240/455240] [iyunv@localhost 4setup]# 步骤二: 编译源程序
[iyunv@localhost 4setup]# ll
总计 29168
-rw-r--r--1 root root 4552402011-07-22 redis-2.2.12.tar.gz
[iyunv@localhost 4setup]# tar xzf redis-2.2.12.tar.gz
[iyunv@localhost 4setup]# cd redis-2.2.12
[iyunv@localhost redis-2.2.12]# make
cd src && make all
make[1]: Entering directory `/root/4setup/redis-2.2.12/src' 步骤三: 启动Redis服务
src/redis-server
[iyunv@localhost redis-2.2.12]# src/redis-server
[6246] 05 Aug 19:17:22 # Warning: no config file specified, using the default config. In order to specify a config file use 'redis-server /path/to/redis.conf' [6246] 05 Aug 19:17:22* Server started, Redis version 2.2.12
[6246] 05 Aug 19:17:22 # WARNING overcommit_memory issetto0! Background save may fail under low memory condition. Tofix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect. [6246] 05 Aug 19:17:22* The server isnow ready to accept connections on port 6379
[6246] 05 Aug 19:17:22-0 clients connected (0 slaves), 539544 bytes in use Redis 服务端的默认连接端口是 6379。 步骤四: 将Redis作为 Linux 服务随机启动
vi /etc/rc.local, 使用vi编辑器打开随机启动配置文件,并在其中加入下面一行代码。