docs
uredis
Getting Started
Access Instance

Access Instance

For security reasons, UMem Redis instances can only be accessed via the internal network. The following briefly describes how to access UMem storage using the Redis protocol.

telnet access

[test@u205 ~]$ telnet 127.0.0.1 6379
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
set key value
+OK
get key
$5
value
del key
:1

php access

<?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 access

#!/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
  • Company
  • ContactUs
  • Blog
Copyright © 2024 SurferCloud All Rights Reserved