【发布时间】:2017-10-14 19:22:41
【问题描述】:
每当我在本地机器之外运行我的代码时,我都会被连接错误困扰一周。
无论我做什么,连接错误都是因为 carmine 正在连接到 localhost。这是来自我的 ns store.core 的 repl 会话的完整输出,其中 requires [taoensso.carmine :as redis]:
(def conn
{:pool {}
:spec {:url "redis://redistogo:[password]@chubb.redistogo.com:9836/"}})
#'store.core/conn
store.core=> (redis/wcar conn (redis/hget 1 2))
java.net.ConnectException: Connection refused (Connection refused)
clojure.lang.ExceptionInfo: Carmine connection error
[在另一个终端启用本地 redis]
store.core=> (redis/wcar conn (redis/hget 1 2))
"3"
^ this is now connecting to my local redis, despite `conn` pointing to redistogo.
我做错了什么?这种用法似乎与carmine.clj#L28 建议的完全一样!
【问题讨论】:
标签: clojure redis redistogo carmine