出于安全性考虑,UMem仅能在内网进行访问,以下给出关于redis协议的一些简单的访问示例。 php访问示例 <?php $redis = new Redis(); $redis->connect('10.4.7.17', 6379); $key = "testkey"; $tvalue = "testvalue"; $redis->set($key, $tvalue); $nvalue = $redis->get($key); print_r($nvalue . "\n"); ?> python访问示例 < div class="highlight-python"> #!/usr/bin/env python2 # coding=utf8 import sys, os import redis if __name__ == "__main__": ip = '10.4.7.17' port = 6379 r = redis.StrictRedis(ip, port, 0) key = 'testkey' tvalue = "testvalue" r.set(key, tvalue) nvalue = r.get(key) print nvalue
<
div class="highlight-python">