Deleted articles cannot be recovered. Draft of this article would be also deleted. Are you sure you want to delete this article?
è¨å®ããããã£ã¨ç´°ããä½æ¥ããããå ´å㯠help ã³ãã³ãã使ãã 種é¡ãã¨ã®ãã«ããã¿ããå ´å㯠@ ãã¤ããã¨ãã ä¾ãã°ãªã¹ãé¢é£ã®ã³ãã³ããç¥ããããªã > help @list ã¨ãã£ãæãã 以ä¸ã¯è§£èª¬ keys ç»é²ããã¦ãã key ãããããªãã¨ä½ãã§ããªãã®ã§ãkeyã®ä¸è¦§ãã¿ãæ¹æ³ > keys * å¼æ°ã«ã¯ãã¿ã¼ã³ãå ¥åãã hogeã§ã¯ãã¾ããã®ã«çµããã¿ãããå ´å㯠> key hoge* ã¨ããããshell ã®å ´åã¯ã¢ã¹ã¿ãªã¹ã¯ã¯ã¨ã¹ã±ã¼ãããå¿ è¦ãããã®ã«æ³¨æ $ redis-cli keys \* type redis 㯠key ã«æ ¼ç´ãããå¤ã®ç¨®é¡ã«ãã£ã¦åå¾ã³ãã³ããéããããã å¤ãã¿ãããã«ç¨®é¡ã®ç¢ºèªãå¿ è¦ã hoge ã¨ãããã¼ããã£ãå ´å㯠> type hoge ã¨ããã è¿ãå¤ã¨ãã¦ã¯ string list set zset has
ä¹ ãã¶ãã«node.jsã§ãã æ®éã«åãAPIãç¨æãããã®ã§ãã¹ãã¬ã¼ã¸ãé¸å®ããå¿ è¦ãããã¾ãã åè£ã¨ãã¦ã¯ MySQL Redis MongoDB ã®3ã¤ããã£ãã®ã§ãããMySQLã¯çµæ§ã¤ãã£ããã¨ãããã®ã§ ãã¾ã使ã£ããã¨ã®ãªãRedisã«ãã¾ããã æ©ä¼ãããã°MongoDBãæ±ãããã§ãã Redisã®ã¤ã³ã¹ãã¼ã« ä½æ¥ä¸ã®ãã·ã³ã¯MacOSX10.7.5ã§ãã Redisã®ã¤ã³ã¹ãã¼ã«ã«ã¯homebrewãå©ç¨ãã¾ãã ã¡ãªã¿ã«homebrewã®ãã¼ã¸ã§ã³ã¯0.9.4ã§ããã $ brew install redisããã ãã§ã¤ã³ã¹ãã¼ã«ã§ãã¾ãã ç§ã¯redis-2.6.13ãã¤ã³ã¹ãã¼ã«ããã¾ããã ãã·ã³ã®èµ·åæã«redisãç«ã¡ããããå ´å㯠ã¤ã³ã¹ãã¼ã«æã®ã¡ãã»ã¼ã¸ã«ãããã£ã¦ $ ln -sfv /usr/local/Cellar/redis/2.6.1
Redisã®ã¤ã³ã¹ãã¼ã«ã¨ã¡ãã£ã¨ä½¿ã£ãã¡ã¢ãªã© Posted 2013å¹´1æ23æ¥ by ã¯ããã¡ & filed under ã¤ã³ãã©. æè¿è©±é¡ã®Redisãããã£ã¦ã¿ã¾ããã KVSã¨ãNoSQLã£ã¦å¼ã°ããRedisã§ããä¼¼ããããªã¢ããªã±ã¼ã·ã§ã³ã«Memcachedãããã¾ãã Memcachedã¨ã®å¤§ããªéãã¨ã㦠1)ãªã¹ãåãéååã¨ãããããªãã¼ã¿æ§é ãæ±ãã 2)ãã¼ã¿ã®æ°¸ç¶åãã§ãã 3)ã¬ããªã±ã¼ã·ã§ã³ãã§ãã ãããã®ã§ã¯ãªããã¨æãã¾ãã éãã¯å½ç¶Memcachedãæé«ãªãã§ããããããªãã«é«éã§ããããçµæ§è¤éãªãã¨ãã§ããããã§ãã ã¤ã³ã¹ãã¼ã«ã¯ããããã http://redis.io/download cd /usr/local/src wget http://redis.googlecode.com/files/redis-2.6.9
ã¯ã¤ãã¯ã¹ã¿ã¼ã¶ ãã®ã¯ã¤ãã¯ã¹ã¿ã¼ããèªãã°5åã§Redisã®ä½¿ãå§ãæ¹ããããã¾ããããã«Redisãç¥ãããæ¹ã¯Redisã®ããã¥ã¡ã³ãã®è¦åºãã確èªãã¦ãã ããã
redis-cliã¯Redisã®ã¯ã©ã¤ã¢ã³ããã¼ã«ã§ãããã³ãã³ãã©ã¤ã³ããå®è¡ããã redis-cli -h $hostä¸è¨ã§Redisãµã¼ãã«æ¥ç¶ããã keyã®set/get redis-cli -h $host set $key $value redis-cli -h $host get $key ã¢ãã¿ãã¼ã« redis-cli -h $host infoã¨æã¤ã¨ããµã¼ãã«é¢ããæ å ±ã¨çµ±è¨ãä¸è¦§è¡¨ç¤ºããã redis-cli -h $host monitorã¨æã¤ã¨ãRedisãµã¼ããåãåã£ããã¹ã¦ã®ã³ãã³ãããªã¢ã«ã¿ã¤ã 表示ããã ã¬ããªã±ã¼ã·ã§ã³ slaveof ã³ãã³ãã使ãã redis-cli -h $slave slaveof $master $portã¬ããªã±ã¼ã·ã§ã³ã解é¤ããã«ã¯ãslaveof no one ãå®è¡ããã redis-cli -h $slav
macosx ã§ã¯ Homebrew ã使ãã¨ç°¡åã«ã¢ããªã®ã¤ã³ã¹ãã¼ã«ãå¯è½ã«ãªãã¾ãã Homebrew ãã¤ã³ã¹ãã¼ã«ãããç°å¢ãªãã° brew install ã³ãã³ãã§ã¤ã³ã¹ãã¼ã«èªä½ã¯é常ã«ç°¡åã«åºæ¥ã¾ãã redisãã¤ã³ã¹ãã¼ã« $ brew install redis ==> Downloading http://redis.googlecode.com/files/redis-2.4.14.tar.gz ######################################################################## 100.0% ==> make -C /private/tmp/homebrew-redis-2.4.14-IgBU/redis-2.4.14/src CC=/usr/bin/clang ==> Caveats If this
ããã«ã¡ã¯ãå®æ´¥äºã§ãã å¼ç¤¾ã§ã¯ã²ã½ã¦ãã¨ããã²ã¼ã ãã©ãããã©ã¼ã ãéå¶ãã¦ããã¾ããã²ã½ã¦ãã§ã¯ãµã¼ãã¹ãªãªã¼ã¹å½åãã主ã«ãã£ãã·ã¥çãªå½¹å²ã§Redisãå°å ¥ãã¦ãã¾ãããã¤ãå æ¥ã®äºã§ãã訳ãã£ã¦Redis 2.6ãããµãã¼ããããRedis Sentinelãæ¡ç¨ãã¾ãããä»åã¯ãæ¡ç¨ã«è³ã£ãçµç·¯ããç´¹ä»ãã¾ãã ç°¡åãªã·ã¹ãã æ§æ ããã©ã¼ãã³ã¹ã¯è¯ãããMemcachedã«ã¯ç¡ã便å©ãªæ©è½ãæä¾ããRedisã§ããç´ä¸å¹´ééç¨ãã¦ããã¤ãã®åé¡ãåºã¦ãã¾ããã Redisãµã¼ãã¼ãçªç¶é«è² è·ã«é¥ãããã¨Webãµã¼ãã¼ãé«è² è·ã«é¥ãRedisã®Replicationã¯å¼µã£ã¦ããã©ã¢ããªã±ã¼ã·ã§ã³å´ã§Redis Slaveã¸ãã§ã¤ã«ãªã¼ãã¼ããªãï¼MySQLãç´æ¥åç §ããï¼Redisè½ã¡ãã¨æããMySQLãµã¼ãã¼ãèããããªãï¼è½ã¡ãäºç¡ããã©ï¼ã¨ããäºã§å¯¾çãè¡ã£ã¦ãã¾ãã
ãã®æ稿ã¯èªåã®ããã°è¨äºããRedis Sentinelé¢é£ã®é ç®ã ãæç²ãããã®ã§ãã追è¨äºé ãããã°ããã°ã®æ¹ã«æ¸ãã¦ããã¾ãã ãRedisã®ç£è¦/åæç³»ãã¼ã«ã¾ã¨ãã http://rest-term.com/archives/3045/ Redisæ¬å®¶ããã¸ã§ã¯ãã§éçºããã¦ãããRedisãµã¼ãã®æ»æ´»ç£è¦/éç¥ããã³èªåãã§ã¤ã«ãªã¼ãã¼æ©è½ãæä¾ãã管çãµã¼ã(redis-sentinel)ã§ããv2.4.16ã¾ãã¯2.6.0-rc6以éã®ãã¼ã¸ã§ã³ããå©ç¨å¯è½ã«ãªãã¾ãããå ¬å¼ããã¥ã¡ã³ããåèã«ãã¤ã¤åä½ç¢ºèªããã¾ãã ç°å¢: CentOS 5.9 (x86_64), Redis 2.6.10 æ§æ ããã§ã¯2ã¤ã®ãã¹ãã§Slaveã2ããã»ã¹ãSentinelã3ããã»ã¹ã®æ§æã§è©¦ãã¾ãã Master db0:6379 Slave db0:6380, db1:6379
Redis in Action ä½è :Carlson, Josiah L.Manning PublicationsAmazon Redis åºåé ä¿¡ãã£ã¦ãã¾ã@yutakikuchi_ã§ãã Redisã®å é¨å¦çã1ã¹ã¬ããã§åãã¦ãããããªã®ã§ããã«ãããã»ã¹ããRedisã«æ¸ãè¾¼ã¿å¦çã大éã«æµããæã«ã©ããªãã®ããæ¤è¨¼ãã¦ã¿ã¾ãããè¨èªã¯CããLibraryã¯hiredisã使ãã¾ããredis/hiredis hiredisã使ã£ã¦åä¸ããã»ã¹ã§å®è¡ããå ´åã¨ãApache Moduleã«hiredisãçµã¿è¾¼ãã§ãã«ãããã»ã¹ã®å®è¡ç¶æ ã§æ¤è¨¼ãã¾ããæ¤è¨¼æ©ã¯CentOS6.4ã§ãã hiredis Redisã®installãversion確èªãèµ·å Redisã®Versionã¯2.4.10ã§ãã $ sudo yum install redis -y $ redis-serv
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}