Windows上的Redis - 配置文件

Ste*_*gor 8 redis

我刚从这里在Windows上安装了redis服务器,并在没有指定配置文件的默认模式下运行服务器.

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

该文件夹如下所示:

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

小智 12

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

例如:

D:\Coding\RedisIO>redis-server.exe redis.windows.conf
Run Code Online (Sandbox Code Playgroud)

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

# The filename where to dump the DB
dbfilename dump.rdb
Run Code Online (Sandbox Code Playgroud)

以及配置文件中的条目

# 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 ./
Run Code Online (Sandbox Code Playgroud)

  • 当我运行 D:\Coding\Redis>redis-server.exe redis.windows.conf 时,控制台进入睡眠状态。什么也没有发生,就好像它在等待一些指令。 (2认同)