Redis-server -致命的配置文件错误-文件路径空间问题。

时间:2022-12-03 20:50:50

I am trying to start the redis-server that was installed in windows PC as deamonize service.

我正在尝试启动安装在windows PC上的redis-server作为deamservice。

I configured the redis.conf file to accept the pidfile and logfile path as follows:

我配置了复述。conf文件接受pidfile和logfile路径如下:

pidfile D:\HMS Build\redis\bin\redis.pid
....
logfile D:\HMS Build\logs\redis.log

While i was trying to start the server, i am getting the following error message.

当我尝试启动服务器时,我得到了以下错误消息。

*** FATAL CONFIG FILE ERROR ***
Reading the configuration file, at line 52
>>> 'logfile D:\HMS Build\logs\redis.log'
Can't open the log file: Invalid argument

I would like to know how to provide the filepath that has spaces in it.

我想知道如何提供有空格的filepath。

I tried with single quote, double quote, but the result is the same: Error

我尝试了单引号,双引号,但结果是一样的:错误。

4 个解决方案

#1


1  

You need to surround the file name with quotes, as you have a space in your folder name. It is something that always gets me. Try this:

您需要使用引号包围文件名称,因为您在文件夹名中有一个空格。这是总能得到我的东西。试试这个:

logfile "D:\HMS Build\logs\redis.log"

#2


1  

I had the same problem: add double quotes and replace \ by / (yes, on Windows)

我遇到了同样的问题:添加双引号并将\(是的,在Windows上)替换

logfile "D:/HMS Build/logs/redis.log"

#3


0  

logfile default is set to "", and you will need to include quotes

logfile默认设置为“”,您将需要包含引号。

logfile "D:/HMS Build/logs/redis.log"

then, you need to start Redis by running,

然后,你需要启动Redis,

sudo /etc/init.d/redis_6379 start

if you are following the installation steps from http://redis.io/topics/quickstart

如果您正在执行从http://redis.io/topics/quickstart的安装步骤。

#4


0  

change the backslash to slash.

将反斜杠改为斜杠。

in my case :

在我的例子中:

logfile "D:/Database/redis/server.log"

数据库日志文件“D:/ /复述/ server.log”

The relative path can not be used on other drive.

相对路径不能在其他驱动器上使用。

#1


1  

You need to surround the file name with quotes, as you have a space in your folder name. It is something that always gets me. Try this:

您需要使用引号包围文件名称,因为您在文件夹名中有一个空格。这是总能得到我的东西。试试这个:

logfile "D:\HMS Build\logs\redis.log"

#2


1  

I had the same problem: add double quotes and replace \ by / (yes, on Windows)

我遇到了同样的问题:添加双引号并将\(是的,在Windows上)替换

logfile "D:/HMS Build/logs/redis.log"

#3


0  

logfile default is set to "", and you will need to include quotes

logfile默认设置为“”,您将需要包含引号。

logfile "D:/HMS Build/logs/redis.log"

then, you need to start Redis by running,

然后,你需要启动Redis,

sudo /etc/init.d/redis_6379 start

if you are following the installation steps from http://redis.io/topics/quickstart

如果您正在执行从http://redis.io/topics/quickstart的安装步骤。

#4


0  

change the backslash to slash.

将反斜杠改为斜杠。

in my case :

在我的例子中:

logfile "D:/Database/redis/server.log"

数据库日志文件“D:/ /复述/ server.log”

The relative path can not be used on other drive.

相对路径不能在其他驱动器上使用。