Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
所以我尝试了memcache。在我的 Ubuntu 上做了“apt-get install python-memcache”,然后:
>>> import memcache >>> s = memcache.Client(["127.0.0.1:11211"]) >>> s.set("mykey", "myvalue") 0 >>> myvar = s.get("mykey") >>> print(myvar) None
怎么了?
您没有运行 memcached 服务。以下是服务启动时的外观:
>>> s = memcache.Client(["127.0.0.1:11211"]) >>> s.set("mykey", "myvalue") True >>> myvar = s.get("mykey") >>> print(myvar) myvalue
以下是检查它是否正在运行的方法:
$ service memcached status * memcached is running