我使用Docker来运行Redis:
docker run --rm -p '6379:6379' -v "$redis_data_dir:/data" --name my_redis_server -d redis redis-server --appendonly 'yes'
过去这个可以正常运行,但现在我遇到了这个错误:
{ ReplyError: ERR DB index is out of range at parseError (/root/interos/repos/ntrs-cli/node_modules/redis-parser/lib/parser.js:179:12) at parseType (/root/interos/repos/ntrs-cli/node_modules/redis-parser/lib/parser.js:302:14)
command: { name: 'select', args: [ '20127' ] } }
看起来它正在尝试连接到数据库20127
,我确信它是以下四个之一:
const client_db0 = new Redis(`redis://${conf["platform-build.public-dns"]}:6379/0`);
const client_db1 = new Redis(`redis://${conf["platform-build.public-dns"]}:6379/1`);
const client_db2 = new Redis(`redis://${conf["platform-build.public-dns"]}:6379/2`);
const client_db3 = new Redis(`redis://${conf["platform-build.public-dns"]}:6379/3`);
有没有一种方法可以启动Redis并告诉它添加更多的数据库?就像这样:
docker run .... redis redis-server --appendonly 'yes' --db-count=16