微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

如何解决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 举报,一经查实,本站将立刻删除。