{"id":438,"date":"2014-02-27T11:58:01","date_gmt":"2014-02-27T02:58:01","guid":{"rendered":"http:\/\/lovelinux.mydns.jp\/?p=438"},"modified":"2014-08-25T11:22:29","modified_gmt":"2014-08-25T02:22:29","slug":"redis%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%a6%e3%81%bf%e3%82%8b-%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%83%bb%e5%8b%95%e4%bd%9c%e7%a2%ba%e8%aa%8d-%ef%bc%88ubuntucentos%ef%bc%89","status":"publish","type":"post","link":"https:\/\/lovelinux.mydns.jp\/?p=438","title":{"rendered":"redis\u3092\u4f7f\u3063\u3066\u307f\u308b \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30fb\u52d5\u4f5c\u78ba\u8a8d \uff08Ubuntu\/CentOS\uff09"},"content":{"rendered":"<p>\u3061\u3087\u3063\u3068\u30a4\u30f3\u30e1\u30e2\u30ea\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u4f7f\u3044\u305f\u3044\u7528\u9014\u304c\u51fa\u3066\u304d\u305f\u306e\u3067\u3001\u8abf\u3079\u3066\u307f\u307e\u3057\u305f\u3002<br \/>\n\u4eca\u56de\u306f\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068\u3001\u3061\u3087\u3063\u3068\u3057\u305f\u52d5\u4f5c\u78ba\u8a8d\u307e\u3067\u306e\u65b9\u6cd5\u3092\u8a18\u8f09\u3057\u307e\u3059\u3002<\/p>\n<h4>Ubuntu\u3067\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h4>\n<p>OS\u306e\u8d77\u52d5\u6642\u306e\u8d77\u52d5\u8a2d\u5b9a\u306f\u81ea\u52d5\u3067\u884c\u308f\u308c\u308b\u6a21\u69d8\u3002<\/p>\n<p>[bash]<br \/>\nsudo apt-get install redis-server<\/p>\n<p>[\/bash]<\/p>\n<h4>CentOS\u3067\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h4>\n<p>fedora epel\u3088\u308arpm\u3092\u62dd\u501f\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5f8c\u3001\u81ea\u52d5\u8d77\u52d5\u306e\u8a2d\u5b9a\u3092\u3059\u308b(chkconfig\uff09<br \/>\n[bash]<br \/>\n# wget http:\/\/dl.fedoraproject.org\/pub\/epel\/6\/x86_64\/redis-2.4.10-1.el6.x86_64.rpm<br \/>\n# rpm -ivh redis-2.4.10-1.el6.x86_64.rpm<br \/>\n# chkconfig redis on<br \/>\n[\/bash]<\/p>\n<h4>\u52d5\u4f5c\u78ba\u8a8d<\/h4>\n<p class=\"point1\"><i class=\"fa fa-hand-o-right\"><\/i>keys * \u3067\u683c\u7d0d\u30ad\u30fc\u3092\u3059\u3079\u3066\u5217\u6319<\/p>\n<p class=\"point1\"><i class=\"fa fa-hand-o-right\"><\/i>set key value \u3067 \u30ad\u30fc\u3068\u30d0\u30ea\u30e5\u30fc\u3092\u4fdd\u5b58<\/p>\n<p class=\"point1\"><i class=\"fa fa-hand-o-right\"><\/i>get key \u3067 \u30ad\u30fc\u306b\u95a2\u9023\u3059\u308b\u30d0\u30ea\u30e5\u30fc\u3092\u53d6\u5f97<\/p>\n<p class=\"point1\"><i class=\"fa fa-hand-o-right\"><\/i>del key \u3067 \u30ad\u30fc\u3068\u30d0\u30ea\u30e5\u30fc\u3092\u524a\u9664<\/p>\n<p class=\"point1\"><i class=\"fa fa-hand-o-right\"><\/i>flushdb\u3067\u30ab\u30ec\u30f3\u30c8DB\u306e\u30ad\u30fc\u3092\u5168\u3066\u7834\u68c4<\/p>\n<p>[bash]<br \/>\n$ redis-cli<br \/>\nredis 127.0.0.1:6379> keys *<br \/>\n(empty list or set)<br \/>\nredis 127.0.0.1:6379> set aaa hello<br \/>\nOK<br \/>\nredis 127.0.0.1:6379> set bbb bye<br \/>\nOK<br \/>\nredis 127.0.0.1:6379> keys *<br \/>\n1) &#8220;aaa&#8221;<br \/>\n2) &#8220;bbb&#8221;<br \/>\nredis 127.0.0.1:6379> get aaa<br \/>\n&#8220;hello&#8221;<br \/>\nredis 127.0.0.1:6379> get bbb<br \/>\n&#8220;bye&#8221;<br \/>\nredis 127.0.0.1:6379> get ccc<br \/>\n(nil)<br \/>\nredis 127.0.0.1:6379> set aaa hello222<br \/>\nOK<br \/>\nredis 127.0.0.1:6379> get aaa<br \/>\n&#8220;hello222&#8221;<br \/>\nredis 127.0.0.1:6379> del aaa<br \/>\n(integer) 1<br \/>\nredis 127.0.0.1:6379> keys *<br \/>\n1) &#8220;bbb&#8221;<br \/>\nredis 127.0.0.1:6379> flushdb<br \/>\nOK<br \/>\nredis 127.0.0.1:6379> keys *<br \/>\n(empty list or set)<\/p>\n<p>[\/bash]<\/p>\n<p>\u3068\u308a\u3042\u3048\u305a\u3001\u521d\u6b69\u306a\u3093\u3067\u3053\u3093\u306a\u3068\u3053\u308d\u3067\u3002\u6b21\u56de\u3078\u7d9a\u304f<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3061\u3087\u3063\u3068\u30a4\u30f3\u30e1\u30e2\u30ea\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u4f7f\u3044\u305f\u3044\u7528\u9014\u304c\u51fa\u3066\u304d\u305f\u306e\u3067\u3001\u8abf\u3079\u3066\u307f\u307e\u3057\u305f\u3002 \u4eca\u56de\u306f\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068\u3001\u3061\u3087\u3063\u3068\u3057\u305f\u52d5\u4f5c\u78ba\u8a8d\u307e\u3067\u306e\u65b9\u6cd5\u3092\u8a18\u8f09\u3057\u307e\u3059\u3002 Ubuntu\u3067\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb OS\u306e\u8d77\u52d5\u6642\u306e\u8d77\u52d5\u8a2d\u5b9a\u306f\u81ea\u52d5\u3067\u884c\u308f\u308c\u308b\u6a21\u69d8\u3002 [bash] sudo apt-get install redis-server [\/bash] CentOS\u3067\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb fedora epel\u3088\u308arpm\u3092\u62dd\u501f\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5f8c\u3001\u81ea\u52d5\u8d77\u52d5\u306e\u8a2d\u5b9a\u3092\u3059\u308b(chkconfig\uff09 [bash] # wget http:\/\/dl.fedoraproject.org\/pub\/epel\/6\/x86_64\/redis-2.4.10-1.el6.x86_64.rpm # rpm -ivh redis-2.4.10-1.el6.x86_64.rpm # chkconfig redis on [\/bash] \u52d5\u4f5c\u78ba\u8a8d keys * \u3067\u683c\u7d0d\u30ad\u30fc\u3092\u3059\u3079\u3066\u5217\u6319 set key value \u3067 \u30ad\u30fc\u3068\u30d0\u30ea\u30e5\u30fc\u3092\u4fdd\u5b58 get key \u3067 \u30ad\u30fc\u306b\u95a2\u9023\u3059\u308b\u30d0\u30ea\u30e5\u30fc\u3092\u53d6\u5f97 del key \u3067 \u30ad\u30fc\u3068\u30d0\u30ea\u30e5\u30fc\u3092\u524a\u9664 flushdb\u3067\u30ab\u30ec\u30f3\u30c8DB\u306e\u30ad\u30fc\u3092\u5168\u3066\u7834\u68c4 [bash] $ redis-cli redis 127.0.0.1:6379> keys * (empty list or set) redis 127.0.0.1:6379> set aaa hello OK redis 127.0.0.1:6379> set bbb bye OK redis 127.0.0.1:6379> keys * 1) &#8220;aaa&#8221; 2) &#8220;bbb&#8221; redis 127.0.0.1:6379> get aaa &#8220;hello&#8221; redis 127.0.0.1:6379> get bbb &#8220;bye&#8221; redis 127.0.0.1:6379> get ccc (nil) redis 127.0.0.1:6379> set aaa hello222 OK redis 127.0.0.1:6379> get aaa &#8220;hello222&#8221; redis 127.0.0.1:6379> del aaa (integer) 1 redis 127.0.0.1:6379> keys * 1) &#8220;bbb&#8221; redis 127.0.0.1:6379> flushdb OK redis 127.0.0.1:6379> keys * (empty list or set) [\/bash] \u3068\u308a\u3042\u3048\u305a\u3001\u521d\u6b69\u306a\u3093\u3067\u3053\u3093\u306a\u3068\u3053\u308d\u3067\u3002\u6b21\u56de\u3078\u7d9a\u304f<\/p>\n","protected":false},"author":1,"featured_media":441,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[3,2],"tags":[25,17],"class_list":{"0":"post-438","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-3","8":"category-2","9":"tag-centos","10":"tag-redis"},"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=\/wp\/v2\/posts\/438","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=438"}],"version-history":[{"count":4,"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=\/wp\/v2\/posts\/438\/revisions"}],"predecessor-version":[{"id":591,"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=\/wp\/v2\/posts\/438\/revisions\/591"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=\/wp\/v2\/media\/441"}],"wp:attachment":[{"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=438"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=438"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=438"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}