随笔分类 - Redis
摘要:1.使用redis连接池 package com.yjw.config; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean
阅读全文
摘要:1.修改配置文件 创建6个配置文件分别为 redis_6379.conf 6380 6381 6389 6390 6391 include /usr/local/redis/conf/redis.confpidfile "/var/run/redis_6379.pid"port 6379dbfile
阅读全文
摘要:1.配置 新建sentinel.conf sentinel monitor mymaster 127.0.0.1 6379 2.启动哨兵 启动哨兵 redis-sentinel sentinel.conf 当主机重启从服务器会充当主服务器,重启之后的主服务器成为了从服务器。 3.单机哨兵模式暂时可用
阅读全文
摘要:*主服务器重启后还是主,从服务器重启之后就不会是从服务器需要重新使用slaveof加入从服务器。从服务器还可以当做另一台服务器的主服务器。复制redis.conf到 /usr/local/redis/conf文件夹下创建redis_6379.conf和redis_6380.conf 配置文件内容如下
阅读全文
摘要:1.安装wget https://download.redis.io/releases/redis-6.2.6.tar.gz mv redis-6.2.6.tar.gz /usr/local tar -zxvf redis-6.2.6.tar.gz mv redis-6.2.6 redis make
阅读全文
摘要:1.修改配置文件增加集群配置 2.启动所有redis节点 3.启动集群redis-cli --cluster create --cluster-replicas 1 116.62.198.68:6379 116.62.198.68:6380 116.62.198.68:6381 116.62.198
阅读全文