redis五类型及原理|redis主从及问题|Uninstall Redis CentOs 7

本文介绍Redis的五种数据类型及其应用场景,并详细讲解Redis主从复制的配置过程,包括版本一致性要求、日志查看、防火墙设置、哨兵机制及选举算法等。

1、redis五类型及原理
string 最简单的kv
hash 存储一条记录或对象
list 当做队列或栈使用
set 集合并集交集
zset 分数搜索用
原理文章:
Redis的五种对象类型及其底层实现 - 优快云博客
http://blog.youkuaiyun.com/caishenfans/article/details/44784131
2、redis主从及问题
学会看日志,日志查看:tailf /var/log/redis/redis.log
首先主从必须版本一样
版本不同先写在再安装 yum install redis
保证防火墙关闭 service iptables status /stop
保证主的redis.conf里面的bind是0.0.0.0,否则Unable to connect to MASTER redis
需不需要密码
相关文章
Redis主从复制-Replication - QIANQIANCHEN - 博客园
https://www.cnblogs.com/qianqianchen/p/6024918.html
redis单例、主从模式、sentinel以及集群的配置方式及优缺点对比 - 爱宝贝丶
https://my.oschina.net/zhangxufeng/blog/905611

4 哨兵

测试重点:

需要

ps-ef|grep 6379后

kill掉master

配置哨兵监控Redis运行情况 - 优快云博客
http://blog.youkuaiyun.com/yingxiake/article/details/51671335

Redis Sentinel机制与用法(一) - beanlam - SegmentFault 思否
https://segmentfault.com/a/1190000002680804


Redis Sentinel机制与用法(一) - beanlam - SegmentFault 思否
https://segmentfault.com/a/1190000002680804

 哨兵部署方案

使用三个盒子
配置master 可以使用下面的Redis主从复制特性减轻,它可在master检查到它不再能传输它的写入操作到指定数量的slave的时候停止接收写入操作。

min-slaves-to-write 1
min-slaves-max-lag 10

Redis Sentinel实现的机制与原理详解【Sentinel部署示例】
https://www.cnblogs.com/knowledgesea/p/6567718.html

哨兵选举算法

Raft协议实战之Redis Sentinel的选举Leader源码解析
http://www.blogjava.net/jinfeng_wang/archive/2016/12/14/432108.html

Redis哨兵机制 - 优快云博客
http://blog.youkuaiyun.com/lee_nacl/article/details/62044097

3、彻底卸载redis

First, i suggest you to use your distros package instead of compiling software, this way you can upgrade and get security updates for free.

Back to your question, assuming you left the defaults during ./install_server.sh, first stop redis:

/etc/init.d/redis_6379 stop

Delete redis's install:

rm -fr etc/redis/ /var/log/redis_* /etc/init.d/redis_6379 /usr/local/bin/redis*

Delete redis's data too:

rm -fr /var/lib/redis/6379

Done.

转载于:https://www.cnblogs.com/stevenlii/p/8569241.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值