Redis相关
CMD运行方式
redis-server.exe redis.windows.conf
以服务方式安装
安装命令:
redis-server.exe --service-install redis.windows.conf --loglevel verbose
卸载命令:
redis-server --service-uninstall
多实例
安装目录下复制【redis.windows-service.conf】文件重命名为【redis.windows-service6380.conf】。打开,修改其中的设置
【port 6379】修改为【port 6380】
【logfile "server_log.txt"】修改为【logfile "server_log6380.txt"】。如果【syslog-enabled】设置为【no】,这项可以不用修改
设置redis新实例为服务
以上就创建了一个port为6380的心redis实例。但是关掉【redis-server redis.windows-service6380.conf】cmd运行窗口,这个redis实例就也关闭了。得把这个新的实例也设置成服务才行。
运行【redis-server --service-install redis.windows-service6380.conf --service-name redis6380 --port 6380】命令
运行【redis-server --service-start --service-name redis6380】,启动该服务。或者打开服务找到【redis6380】服务右键启动
删除服务redis-server --service-uninstall --service-name redis6380
命令模式:
1.卸载【redistest】服务
redis-server --service-uninstall --service-name redistest
2.安装【redistest】服务,指定服务名称:redistest,端口号:6380
redis-server --service-install –service-name redistest –port 6380
3.启动【redistest】服务
redis-server --service-start –service-name redistest
如果服务启动不了:手动在redis-server.exe所在的目录中建立了子目录Logs,再次启动服务,一切正常
cmd
redis-cli.exe -h 127.0.0.1 -p 6379
1.清空当前redis数据库缓存FLUSHDB
flushdb
2.清空整个redis缓存FLUSHALL
flushall
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构