惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
Docker
IT之家
IT之家
Microsoft Security Blog
Microsoft Security Blog
博客园 - 司徒正美
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
D
DataBreaches.Net
B
Blog RSS Feed
博客园_首页
The GitHub Blog
The GitHub Blog
I
InfoQ
L
LangChain Blog
G
Google Developers Blog
M
MIT News - Artificial intelligence
美团技术团队
腾讯CDC
V
Visual Studio Blog
aimingoo的专栏
aimingoo的专栏
博客园 - 聂微东
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Apple Machine Learning Research
Apple Machine Learning Research
A
About on SuperTechFans
博客园 - 三生石上(FineUI控件)
博客园 - 叶小钗

博客园 - Qiozi

Window server 2022 Datacenter, 布署 asp.net 3.5 后,自定义控件无法运行,错误提示:未知的服务器标记:”****” sql server 2019,安装多个实例 配置镜像, msoledbsql.msi 无法安装 CMD, 按日期备份mysql数据库, 并删除30天前的备份 WPS excel 操作,组件服务里找不到wps组件, 程序报:检索 COM 类工厂中 CLSID 为 {00024500-0000-0000-C000-000000000046} 的组件时失败 tasklist, 查找进程,杀掉进程 redis-cli --cluster create 群集 查出当前数据库,所有数据表索引碎片情况。 mysql 5.7*, 报错:this is incompatible with DISTINCT [EndOfStreamException: 尝试读取超出流末尾的内容。] .net MVC 中,使用 BundleConfig 合并js文件后,网站无法运行,发现代码丢失问题。 Ensure that HttpConfiguration.EnsureInitialized() is called in the application's startup code after Windows service 安装命令 sql server 查询CPU占用时间最大的语句。 Get http://IP:Port/v2/: dial tcp IP:Port: connect: connection refused 如何创建 Dockerfile? Windows 10 系统, 修改Docker容器系统时间区域, Docker 容器里连接远程 Sql Server 数据库。 SQL SERVER 2016数据库:删除用户时提示“数据库主体在该数据库中拥有架构” Docker 容器里,添加 Ping 功能。
windows 2012 R2 系统下, redis 主从配置
Qiozi · 2021-01-20 · via 博客园 - Qiozi

环境

system: Windows 2012 R2

Redis: 5.0.10 64bit

原来只有一个节点进行读写,随着时间推移,时不时出现超时现象,于是改为1主(写)2从(读)方案。项目背景可以使 用 redis 只做缓存使用, 不需要持久化。

1,安装redis 后,再复制出两个文件夹。

端口: 

redis: 6379
redis_slave1: 6380
redis_slave2: 6381

2,分别打开 Redis_Slave1, Redis_Slave2 下的配置文件, redis.windows.conf, 在“Replication" 部位添加配置:

slaveof 127.0.0.1 6379
################################# REPLICATION #################################

# Master-Slave replication. Use slaveof to make a Redis instance a copy of
# another Redis server. A few things to understand ASAP about Redis replication.
#
# 1) Redis replication is asynchronous, but you can configure a master to
#    stop accepting writes if it appears to be not connected with at least
#    a given number of slaves.
# 2) Redis slaves are able to perform a partial resynchronization with the
#    master if the replication link is lost for a relatively small amount of
#    time. You may want to configure the replication backlog size (see the next
#    sections of this file) with a sensible value depending on your needs.
# 3) Replication is automatic and does not need user intervention. After a
#    network partition slaves automatically try to reconnect to masters
#    and resynchronize with them.
#
# slaveof <masterip> <masterport>
slaveof 127.0.0.1 6379

3,注册为windows service

分别到Redis_Slave1, Redis_Slave2 文件夹下执行命令。注意: redis-server.exe 前面有".\" , 如果不加".\" 执行的是系统全局命令,将无法启动多个服务。

# 文件夹 Redis_Slave1
.\redis-server.exe --service-install redis.windows.conf --service-name Redis6380
# 文件夹 Redis_Slave2
.\redis-server.exe --service-install redis.windows.conf --service-name Redis6381

在win服务里查看执行结果:

4,验证安装

通过redis-cli 命令分别登录服务,并测试一个key,