Apache Ignite - 简单 Python 示例

Apache Ignite - simple Python example

我在本地 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

有谁知道可能是什么问题?或者,如果您有更简单的示例,可以逐步 运行 Apache Ignite Python,请告诉我。 (我在网上尝试了几个例子,none 到目前为止有效)..

To connect to Ignite using a Python client for Memcached, you need to download Ignite and -

  1. Start Ignite cluster with cache configured. For example:

Shell bin/ignite.sh examples/config/example-cache.xml 2. Connect to Ignite using Memcached client, via binary protocol.

Python import pylibmc

client = pylibmc.Client (["127.0.0.1:11211"], binary=True)

client.set("key", "val")

print "Value for 'key': %s"%client.get("key")

来自:https://apacheignite.readme.io/docs/memcached-support#python

看起来你没有通过正确的配置来点燃:

bin/ignite.sh examples/config/example-cache.xml