Heroku 上的 redis json (redislabs/rejson:latest)

问题描述

我无法弄清楚这一点。希望我能得到一些帮助

我在运行 django 的 Heroku 中有一个爱好层。为此,我想附加一个 Redis 服务。但是,我想使用最近的 rejson (redislabs/rejson:latest) docker 映像(而不是 redistogo 或 heroku-redis),因为它支持 json。这在我的本地环境中非常有效。我能够将 docker 映像推送到容器注册表中并实际启动 redis 服务器

2021-07-23T00:14:48.576294+00:00 app[worker.1]: 3:M 23 Jul 2021 00:14:48.576 # Current maximum open files is 10000. maxclients has been reduced to 9968 to compensate for low ulimit. If you need higher maxclients increase 'ulimit -n'.
2021-07-23T00:14:48.577054+00:00 app[worker.1]: 3:M 23 Jul 2021 00:14:48.577 * Running mode=standalone,port=6379.
2021-07-23T00:14:48.577124+00:00 app[worker.1]: 3:M 23 Jul 2021 00:14:48.577 # Server initialized
2021-07-23T00:14:48.577184+00:00 app[worker.1]: 3:M 23 Jul 2021 00:14:48.577 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
2021-07-23T00:14:48.577671+00:00 app[worker.1]: 3:M 23 Jul 2021 00:14:48.577 # <ReJSON> JSON data type for Redis v1.0.7 [encver 0]
2021-07-23T00:14:48.577789+00:00 app[worker.1]: 3:M 23 Jul 2021 00:14:48.577 * Module 'ReJSON' loaded from /usr/lib/redis/modules/rejson.so
2021-07-23T00:14:48.578232+00:00 app[worker.1]: 3:M 23 Jul 2021 00:14:48.578 * Ready to accept connections

不幸的是,django 无法连接到它

ConnectionError: Error -2 connecting to redis://localhost:6379. Name or service not kNown
  • 没有暴露的 ENV 变量,所以我无法设置任何(我的意思是我可以设置它们,但怀疑它们是否相关)
  • 我尝试安装 redistogo add on 并且能够连接到它(这需要根据添加 redistogo 时暴露的 REdis_URL 环境变量设置连接)

在我的智慧结束...任何帮助表示赞赏...我想这个问题真的很糟糕:

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)