redis.conf 包含:"坏的指令或者参数数量错误"。

4
我已经为Redis创建了这个配置文件[/etc/redis/map.conf]:
include /etc/redis/ideal.conf
port 11235
pidfile /var/run/redis-map.pid
logfile /var/log/redis/map.log
dbfilename map.rdb

正如你所看到的,它包括了 /etc/redis/ideal.conf;该文件实际上存在且我们有读取权限。 此外还有另一个文件,稍微有些不同;请考虑 [/etc/redis/storage.conf]:

include /etc/redis/ideal.conf

pidfile /var/run/redis-storage.pid
port 8000
bind 192.168.0.3
logfile /var/log/redis/storage.log
dbfilename dump_storage.rdb

我的问题是:我可以使用storage.conf启动redis-server(一切正常工作),但是使用map.conf会导致以下错误:

Reading the configuration file, at line 1
>>> 'include /etc/redis/ideal.conf'
Bad directive or wrong number of arguments
failed

Redis的版本是2.2。

我错在哪里了?


2
我会尝试使用od或hexdump来检查包含行中是否隐藏了一些不可打印的字符。 - Didier Spezia
1个回答

8

对不起,大家。

我使用了不同的Redis实例。

storage.conf 实例是通过 /usr/local/bin/redis-server 启动的,但是 map.conf 是通过 /usr/bin/redis-server 启动的;第二个实例出现了问题。

无论如何,还是非常感谢你们。


1
非常感谢!我为此苦恼了很久。在redis.conf中尝试包含此模块时,我一直遇到相同的错误。loadmodule /usr/src/RediSearch/redisearch.so - buycanna.io

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接