Centos7安装并配置redis

一、 编译安装
1、yum -y install tcl
2、我是cd到/usl/local/scr目录
get http://download.redis.io/releases/redis-3.2.8.tar.gz
3、tar-zvxf redis-3.2.8.tar.gz
4、mv redis-3.2.8 redis
5、make test 
6、make & make install
7、默认的安装目录是在/usr/local/bin
8、redis-server --port 6379 &
二、centos7 yum 安装redis
1、更新元数据缓存:yum clean all && yum makecache 
2、1>、查看是否安装epel rpm -q epel-release 
   2>、卸载epel yum remove epel-release 
2、清空epel目录:rm -rf /var/cache/yum/x86_64/6/epel/
2、rpm -vih http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-9.noarch.rpm


3、rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
4、yum --enablerepo=remi install redis


5、redis-server --port 6379 &
6、ps -ef | grep redis


客户端登陆redis:  1、开启服务 redis-server --port 6379 &     2、启用客户端  redis-cli


【centos6.8】上安装redis




redis【持久化】配置:
http://blog.csdn.net/vtopqx/article/details/46833513
1、rdb 
save 900 1
save 300 10
save 60 10000
2、aof
appendfsync always
appendfsync everysec
appendfsync no


redis【主从】配置:
http://blog.csdn.net/yilukuangpao/article/details/52004257


vi etc/redis.conf
#绑定IP地址  
bind 192.168.88.128  
  
#若当前服务为slave,在此处设置主服务的ip及端口  
slaveof 10.10.10.200 6379  
  
#若当前服务为slave,设置主服务的认证密码  
masterauth 01130229  

127.0.0.1:6379> slaveof 10.10.10.200 6379

显示ok,也就OK了

redis【集群】配置:
http://blog.csdn.net/jhq0113/article/details/44134833
http://blog.csdn.net/zj0116/article/details/44673017

你可能感兴趣的:(linux)