1. centos默认的安装源在官方centos.org上,而redis在第三方的yum源里,所以无法安装,非官方的yum推荐用fedora的epel仓库

[root@localhost install]# yum install redis
Loaded plugins: fastestmirror
Setting up Install Process
Determining fastest mirrors
 * base: mirrors.skyshe.cn
 * extras: mirrors.163.com
 * updates: mirrors.pubyun.com
base                                                                                                                                                                                                                  | 3.7 kB     00:00     
extras                                                                                                                                                                                                                | 2.9 kB     00:00     
updates                                                                                                                                                                                                               | 3.4 kB     00:00     
No package redis available.
Error: Nothing to do

首先为yum添加epel源:yum install epel-release回车

yum install epel-release
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: mirrors.skyshe.cn
 * extras: mirrors.163.com
 * updates: mirrors.pubyun.com
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch 0:6-8 will be installed
--> Finished Dependency Resolution


Dependencies Resolved


=============================================================================================================================================================================================================================================
 Package                                                       Arch                                                    Version                                                 Repository                                               Size
=============================================================================================================================================================================================================================================
Installing:
 epel-release                                                  noarch                                                  6-8                                                     extras                                                   14 k


Transaction Summary
=============================================================================================================================================================================================================================================
Install       1 Package(s)



2. yum 安装redis

[root@localhost install]# yum install redis
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
epel/metalink                                                                                                                                                                                                         | 3.6 kB     00:00     
 * base: mirrors.skyshe.cn
 * epel: mirrors.opencas.cn
 * extras: mirrors.163.com
 * updates: mirrors.pubyun.com
epel                                                                                                                                                                                                                  | 4.3 kB     00:00     
epel/primary_db                                                                                                                                                                                                       | 5.7 MB     00:24     
Resolving Dependencies
--> Running transaction check
---> Package redis.x86_64 0:2.4.10-1.el6 will be installed
--> Finished Dependency Resolution


Dependencies Resolved


=============================================================================================================================================================================================================================================
 Package                                                Arch                                                    Version                                                          Repository                                             Size
=============================================================================================================================================================================================================================================
Installing:
 redis                                                  x86_64                                                  2.4.10-1.el6                                                     epel                                                  213 k


Transaction Summary
=============================================================================================================================================================================================================================================
Install       1 Package(s)


3. 查看redis文件

[root@localhost ~]# find / -name "redis*"

/usr/sbin/redis-server
/usr/bin/redis-check-aof
/usr/bin/redis-cli
/usr/bin/redis-check-dump
/usr/bin/redis-benchmark


4. 开启redis-server服务

[root@localhost ~]# redis-server /root/redis_conf/redis6379/redis6379.conf 

[root@localhost ~]# redis-server /root/redis_conf/redis6380/redis6380.conf

[root@localhost ~]# redis-server /root/redis_conf/redis6378/redis6378.conf 

查看进程

[root@localhost ~]# ps -ef|grep redis
root      4970     1  0 16:35 ?        00:00:00 redis-server /root/redis_conf/redis6379/redis6379.conf
root      4976     1  0 16:36 ?        00:00:00 redis-server /root/redis_conf/redis6380/redis6380.conf
root      4982     1  0 16:36 ?        00:00:00 redis-server /root/redis_conf/redis6378/redis6378.conf
root      4987  1489  0 16:36 pts/0    00:00:00 grep redis