python 및 머신러닝 교육, 슬로우캠퍼스

install

sudo apt-get install redis-server

sudo apt-get install python-redis

 

binary file

/usr/bin/redis-server

/usr/bin/redis-cli

 

Conf file

/etc/redis/redis.conf

maxmemory 512mb

maxmemory-policy allkeys-lru

save 900 1

save 300 10

save 60 10000

rdbcompression yes

dbfilename dump.rdb

dir /var/lib/redis  # rdb directory

 

script

/etc/init.d/redis-server restart 

 

Connect to server (client program)

redis-cli



Redis command examples

 

> SET users:goku {race: 'sayan', power: 9001}
> HSET users:goku race sayan

> HSET users:goku power 9001

 

Redis command

  • String hash
    • set keyname value
    • get keyname
    • A value can be a string, a number or a json format with '{}'
  • List
    • lpush listname value  # add a new element at the front of list
    • rpush listname value  # add a new element at the end of list
  • Set
    • sadd setname value
  • Sorted Set
    • zadd setname score_value value
  • Hash
    • hset hashname fieldname value

 




[그림 출처] http://bcho.tistory.com/654 조대협 blog


 

 



'Cloud Computing' 카테고리의 다른 글

대용량 처리 서버 솔루션 (G-WAN, NXWEB)  (0) 2013.03.15
C10K Problem (kegel.com 원본 보관용)  (0) 2013.03.15
Resilience & Trace engineering  (0) 2013.03.14
fabric  (0) 2013.03.13
부하테스트 도구 및  (0) 2013.02.26

WRITTEN BY
manager@
Data Analysis, Text/Knowledge Mining, Python, Cloud Computing, Platform

,