顯示具有 redis 標籤的文章。 顯示所有文章
顯示具有 redis 標籤的文章。 顯示所有文章

2016年3月24日 星期四

redis type 型態對照

reids type

set :
create -> SADD
get -> SMEMBERS


string :
create -> MSET, SET
get -> MGET, GET

zset :
create -> ZSET
get -> ZRANGE

hash :
create -> HMSET
get -> HGET



2015年11月9日 星期一

redis環境設定

ubuntu
====================================

/etc/redis/redis.conf


指定redis來至該IP請求,不設定將接受所有請求
> bind 127.0.0.1

參考網址:

  1. http://blog.csdn.net/ithomer/article/details/9232891(設定檔文件說明)
  2. http://blog.maxkit.com.tw/2015/02/redis.html


---------------------------------------------------------------


2015年8月2日 星期日

redis-安裝

Ubuntu
====================================
//查版號
$ redis-server --version

$ apt-get update
$ apt-get upgrade
$ apt-get install -y redis-server

$ cp /etc/redis/redis.conf /etc/redis/redis.conf.default

$ redis-cli

參考網址:

  1. https://www.linode.com/docs/databases/redis/redis-on-ubuntu-12-04-precise-pangolin



====================================
====================================
Mac
====================================
//查版號
$ redis-server --version

//安裝
$ brew install redis

//解除安裝
$ brew uninstall redis


----------------------------------------------------------
安裝教學:

This is my setup of redis with OS X 10.9.2 Mavericks and requires brew.
$ brew install redis

Start redis when computer starts:
$ ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents

Start redis:
$ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.redis.plist

Without using launchctl:
$ redis-server /usr/local/etc/redis.conf

Check is redis is correctly running:
$ redis-cli ping
This should reply with PONG if successful.

Configuration 
The configuration file is located in /usr/local/etc/redis.conf.

Uninstall redis:
$ brew uninstall redis; rm ~/Library/LaunchAgents/homebrew.mxcl.redis.plist
$ rm ~/Library/LaunchAgents/homebrew.mxcl.redis.plist

參考網址:

  1. http://www.richardsumilang.com/blog/2014/04/04/how-to-install-redis-on-os-x/
  2. https://medium.com/@petehouston/install-and-config-redis-on-mac-os-x-via-homebrew-eb8df9a4f298

================================

2014年11月12日 星期三

redis指令


//需在安裝Redis伺服器上,下此指令,可進入Redis下
$ redis-cli
-h //Host
-p //port

//取得所有Redis下KEY
$ keys *

//清除全部key
$ flushall

//設定資料時間
$ expire [key] [second number]

//查看目前key剩餘時間
$ ttl [key]

//可檢視key形態
$ type [key]

//檢查是否存在
$ exists [key]

//刪除指定key
$ del [key]

//退出
$ quit

//伺服器參數
$ config get


引用參考網址:

  1. Redis官網(英文)
  2. Redis官網(中文)
  3. Redis安裝-1(中文)
  4. Redis安裝-2(簡體)
  5. 函式說明(中文)
  6. 常用指令(中文)
GUI網址:
  1. Redis GUI-1(for MAC)
  2. Redis GUI-2

http://www.mediatek.com.tw/?a=url&k=2f3e79db&u=aHR0cDovL3d3dy5saW51eGlkYy5jb20vTGludXgvMjAxMi0wNy82NDcyMS5odG0=&t=5a!5UmVkaXPkuIDkupvluLjnlKjnmoTlkb3ku6Tov5vooYzmtYvor5Vf5pWw5o2u5bqT5oqA5pyvX0xpbnV45YWs56S!LUxpbnV457O757ufLi4u&s=bGludXggcmVkaXMg5ZG95Luk
http://www.mediatek.com.tw/?a=url&k=17b7292d&u=aHR0cDovL3d3dy5saW51eGlkYy5jb20vTGludXgvMjAxMi0wMy81NzU3My5odG0=&t=UmVkaXPluLjnlKjlkb3ku6Rf5pWw5o2u5bqT5oqA5pyvX0xpbnV45YWs56S!LUxpbnV457O757uf6Zeo5oi3572R56uZ&s=bGludXggcmVkaXMg5ZG95Luk

中文解釋
http://web.hanzheng.info/lamp/redis/redis-%E5%9F%BA%E7%A1%80
http://m.t086.com/article/4901