【问题标题】:Redis on Windows - config fileWindows 上的 Redis - 配置文件
【发布时间】:2015-02-10 22:59:03
【问题描述】:

我刚刚从here 在 Windows 上安装了 redis 服务器,并以默认模式运行服务器,没有指定配置文件。

如何将配置文件(使用 Windows)链接到服务器以及如何指定保存 dtb 的文件夹?

文件夹如下所示:

  • 文件夹:C:\Program Files\Redis\conf - 有一些模板配置文件
  • 文件夹:C:\Program Files\Redis\data - 空
  • 文件夹:C:\Program Files\Redis\logs - 空
  • 文件:C:\Program Files\Redis\redis-server.exe
  • 文件:C:\Program Files\Redis\redis-cli。

【问题讨论】:

    标签: redis


    【解决方案1】:

    您需要做的就是运行 redis-server.exe,后跟配置文件的文件名。

    例如:

    D:\Coding\RedisIO>redis-server.exe redis.windows.conf
    

    对于 db 文件,您需要在配置文件中添加/更改行:

    # The filename where to dump the DB
    dbfilename dump.rdb
    

    在配置文件的下面是条目

    # The working directory.
    #
    # The DB will be written inside this directory, with the filename specified
    # above using the 'dbfilename' configuration directive.
    # 
    # The Append Only File and the QFork memory mapped file will also be created 
    # inside this directory.
    # 
    # Note that you must specify a directory here, not a file name.
    # The working directory.
    #
    # The DB will be written inside this directory, with the filename specified
    # above using the 'dbfilename' configuration directive.
    # 
    # The Append Only File and the QFork memory mapped file will also be created 
    # inside this directory.
    # 
    # Note that you must specify a directory here, not a file name.
    dir ./
    

    【讨论】:

    • 当我运行 D:\Coding\Redis>redis-server.exe redis.windows.conf 时,控制台进入睡眠状态。什么都没有发生,好像在等待某个指令。
    • 多年前我曾使用 redis,但目前我认为您的服务器正在运行并等待连接。您是否尝试连接到本地 redis 数据库?
    【解决方案2】:

    您可能从 (https://github.com/microsoftarchive/redis/releases) 安装了 Redis 3.2.100。 但这给了我错误。

    要解决此问题,请从 (https://github.com/tporadowski/redis/releases) 下载 Redis 5.0.9。运行这个服务器,你会很好。

    【讨论】:

      【解决方案3】:

      如果您使用 MSI 软件包安装 Redis,则 Redis 已作为 Windows 服务安装。如果您想更改其设置,可以更新安装文件夹中的 redis.windows-service.conf 文件,然后重新启动 Redis 服务(运行 -> services.msc -> Redis -> 重新启动)。

      有关更详细的说明,请按照安装文件夹中提供的文档进行操作,名称为 Windows Service Documentation.docx

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-01-17
        • 1970-01-01
        • 1970-01-01
        • 2020-11-28
        • 1970-01-01
        相关资源
        最近更新 更多