set
add
replace
append
prepend
get
gets
delete
incr
decr
安装 medis
git clone https://github.com/vislee/medis.git
make
make install
配置文件
# cat /etc/medis.conf
daemonize yes
pidfile /var/run/medis.pid
port 6379
memcached-port 11211
timeout 300
loglevel notice
logfile /var/log/medis.log
databases 3
save 900 1
save 300 10
save 60 10000
rdbcompression yes
dbfilename dump.rdb
dir /var
maxclients 102400
maxmemory 1024mb
appendonly no
appendfilename appendonly.aof
appendfsync no
activerehashing yes
启动
/usr/local/sbin/medis-server /etc/medis.conf
memcache 测试
# telnet 127.0.0.1 11211
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
set aikaiyuan 123 1000 3
aky
STORED
get aikaiyuan
VALUE aikaiyuan 123 3
aky
END
redis 测试
# redis-cli -h 127.0.0.01 -p 6379
redis 127.0.0.01:6379> PING
PONG
redis 127.0.0.01:6379> get aikaiyuan
"aky"
redis 127.0.0.01:6379> SAVE
OK
redis 127.0.0.01:6379>