1.下载redis 2.6.14版本
http://download.redis.io/releases/
2.练习环境
[root@room9pc01 ~]# scp -r /root/桌面/redis/redis-2.6.14/ 192.168.4.2:/root/
3.安装环境的准:
[root@node2 ~]# ls
anaconda-ks.cfg redis-2.6.14
4.解除依赖环境(因为redis 是c语言编写)
[root@node2 ~]# yum -y install gcc gcc-c++
5.进入目录,编译安装
[root@node2 ~]# cd redis-2.6.14/
[root@node2 redis-2.6.14]# make && make install
[root@node2 redis-2.6.14]# ls
00-RELEASENOTES COPYING Makefile redis.conf src
BUGS deps MANIFESTO runtest tests
CONTRIBUTING INSTALL README sentinel.conf utils
[root@node2 redis-2.6.14]# cd utils/
[root@node2 utils]# ls
build-static-symbols.tcl redis-copy.rb speed-regression.tcl
generate-command-help.rb redis_init_script whatisdoing.sh
install_server.sh redis_init_script.tpl
mkrelease.sh redis-sha1.rb
6.需要设定配置文件的路径:
[root@node2 utils]# mkdir -p /etc/redis/
[root@node2 redis-2.6.14]# cp redis.conf /etc/redis/
7.修改配置文件,修改指定项
[root@node2 redis-2.6.14]# vim /etc/redis/redis.conf
17 daemonize yes
17行:把no修改为yes
:wq
8.启动服务:
[root@node2 redis-2.6.14]# /usr/local/bin/redis-server /etc/redis/redis.conf
查看端口和进程:
[root@node2 redis-2.6.14]# ps -ef | grep redis
root 3375 1 0 11:00 ? 00:00:00 /usr/local/bin/redis-server /etc/redis/redis.conf
root 3379 1283 0 11:01 pts/0 00:00:00 grep --color=auto redis
[root@node2 redis-2.6.14]# ss -nutlp | grep :6379
tcp LISTEN 0 128 *:6379 : users:((“redis-server”,pid=3375,fd=4))
10.本机使用redis服务:
[root@node2 redis-2.6.14]# redis-cli
redis 127.0.0.1:6379> set name david
OK
redis 127.0.0.1:6379> get name
“david”
redis 127.0.0.1:6379> exit
11.安装说明:
这次的安装没有修改指定的端口,和修改指定的使用ip 没有使用指定的启动脚步进行关闭和开启服务