我在本地Mac上启动了Apache Ignite节点,并尝试运行Python脚本以查看它是否可以连接:
import pylibmc
client = pylibmc.Client (["127.0.0.1:11211"], binary=True)
client.set("key", "val")
收到错误:
Traceback (most recent call last):
File "test.py", line 14, in <module>
client.set("key", "val")
pylibmc.UnknownReadFailure: error 7 from memcached_set: (0x7fd26cc3d8d0) UNKNOWN READ FAILURE, host: 127.0.0.1:11211 -> libmemcached/response.cc:828
有谁知道可能是什么问题?或者,如果您使用Python逐步运行Apache Ignite,请告诉我。 (我在网上尝试了几个例子,到目前为止没有一个工作)..
感谢。
答案 0 :(得分:2)
要使用Memcached的Python客户端连接到Ignite,您需要 下载Ignite和 -
- 启动Ignite群集并配置缓存。例如:
醇>Shell bin / ignite.sh examples / config / example-cache.xml 2.使用Memcached客户端通过二进制协议连接到Ignite。
Python import pylibmc
client = pylibmc.Client([&#34; 127.0.0.1:11211&#34;],binary = True)
client.set(&#34; key&#34;,&#34; val&#34;)
打印&#34;&#39;键值&#39;:%s&#34;%client.get(&#34;键&#34;)
来自:https://apacheignite.readme.io/docs/memcached-support#python
看起来你没有通过正确的配置点燃:
bin / ignite.sh examples / config / example-cache.xml