{"id":6963,"date":"2017-09-06T11:42:54","date_gmt":"2017-09-06T03:42:54","guid":{"rendered":"http:\/\/rmohan.com\/?p=6963"},"modified":"2017-09-06T11:42:54","modified_gmt":"2017-09-06T03:42:54","slug":"redis-3","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=6963","title":{"rendered":"redis 3"},"content":{"rendered":"<p>CentOS Redis 3 and 6.8 installed on the startup script, strong Redis is not to say, and directly see the following article explain.<\/p>\n<p>Step 1: Download, compile and install<\/p>\n<p>cd  \/opt<br \/>\nwget http:\/\/download.redis.io\/releases\/redis-3.2.5.tar.gz<\/p>\n<p>tar zxvf redis-3.2.5.tar.gz<\/p>\n<p>cd redis-3.2.5<\/p>\n<p>yum install -y gcc*<br \/>\nyum install -y tcl<br \/>\nmake MALLOC=libc<br \/>\nmake<br \/>\nmake test <\/p>\n<p>cd deps<br \/>\nmake hiredis jemalloc linenoise lua geohash-int<br \/>\ncd ..<br \/>\nmake install <\/p>\n<p>[root@cluster1 redis-3.2.5]# cd utils\/<br \/>\n[root@cluster1 utils]# ls<br \/>\nbuild-static-symbols.tcl  corrupt_rdb.c   generate-command-help.rb  hyperloglog        lru            redis_init_script      redis-sha1.rb  speed-regression.tcl<br \/>\ncluster_fail_time.tcl     create-cluster  hashtable                 install_server.sh  redis-copy.rb  redis_init_script.tpl  releasetools   whatisdoing.sh<br \/>\n[root@cluster1 utils]# chmod +x install_server.sh<br \/>\n[root@cluster1 utils]# .\/install_server.sh<br \/>\nWelcome to the redis service installer<br \/>\nThis script will help you easily set up a running redis server<\/p>\n<p>Please select the redis port for this instance: [6379]<br \/>\nSelecting default: 6379<br \/>\nPlease select the redis config file name [\/etc\/redis\/6379.conf]<br \/>\nSelected default &#8211; \/etc\/redis\/6379.conf<br \/>\nPlease select the redis log file name [\/var\/log\/redis_6379.log]<br \/>\nSelected default &#8211; \/var\/log\/redis_6379.log<br \/>\nPlease select the data directory for this instance [\/var\/lib\/redis\/6379]<br \/>\nSelected default &#8211; \/var\/lib\/redis\/6379<br \/>\nPlease select the redis executable path [\/usr\/local\/bin\/redis-server]<br \/>\nSelected config:<br \/>\nPort           : 6379<br \/>\nConfig file    : \/etc\/redis\/6379.conf<br \/>\nLog file       : \/var\/log\/redis_6379.log<br \/>\nData dir       : \/var\/lib\/redis\/6379<br \/>\nExecutable     : \/usr\/local\/bin\/redis-server<br \/>\nCli Executable : \/usr\/local\/bin\/redis-cli<br \/>\nIs this ok? Then press ENTER to go on or Ctrl-C to abort.<br \/>\nCopied \/tmp\/6379.conf => \/etc\/init.d\/redis_6379<br \/>\nInstalling service&#8230;<br \/>\nSuccessfully added to chkconfig!<br \/>\nSuccessfully added to runlevels 345!<br \/>\nStarting Redis server&#8230;<br \/>\nInstallation successful!<\/p>\n<p>daemonize no<br \/>\nport 6379<br \/>\nlogfile &#8220;&#8221;<br \/>\npidfile \/var\/run\/redis.pid<br \/>\n# requirepass foobared<br \/>\ndir .\/<\/p>\n<p>daemonize yes<br \/>\nport 6379<br \/>\nlogfile &#8220;\/var\/log\/redis\/6379.log&#8221;<br \/>\npidfile \/var\/run\/redis_6379.pid<br \/>\nrequirepass 9k3NgZq%gO<br \/>\ndir \/data\/redis<\/p>\n<p>grep vm.overcommit_memory \/etc\/sysctl.conf<br \/>\necho &#8220;vm.overcommit_memory = 1&#8221; >> \/etc\/sysctl.conf<br \/>\nsed -i &#8220;s\/vm.overcommit_memory = 0\/vm.overcommit_memory = 1\/g&#8221; \/etc\/sysctl.conf<br \/>\nsysctl -p<\/p>\n<p>Redis<br \/>\nchkconfig redis on<br \/>\nchkconfig &#8211;list redis<br \/>\nservice redis start<br \/>\nservice redis stop<\/p>\n<p>update Redis on CentOS 6.5<\/p>\n<p>First, make sure the following repos, EPEL and REMI, are installed:<br \/>\nsudo rpm -Uvh http:\/\/download.fedoraproject.org\/pub\/epel\/6\/x86_64\/epel-release-6-8.noarch.rpm<br \/>\nsudo rpm -Uvh http:\/\/rpms.remirepo.net\/enterprise\/remi-release-6.rpm<br \/>\nCheck the version of Redis in REMI repo: (As of June 2015, the version is 2.8.13)<br \/>\nyum &#8211;enablerepo=remi info redis<br \/>\nThen install related dependency (jemalloc) from EPEL repo:<br \/>\nsudo yum &#8211;enablerepo=epel install jemalloc<br \/>\nBefore installation, you should stop the old Redis daemon:<br \/>\nsudo service redis stop<br \/>\nThen install the newer version of Redis:<br \/>\nsudo yum &#8211;enablerepo=remi install redis<br \/>\nEdit Redis configuration file if needed:<br \/>\nsudo vi \/etc\/redis.conf<br \/>\nRestart Redis daemon, and make it auto-start on reboot:<br \/>\nsudo service redis start<br \/>\nsudo chkconfig redis on<br \/>\nFinally, check the version of currently installed Redis:<br \/>\nredis-cli info | grep redis_version<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CentOS Redis 3 and 6.8 installed on the startup script, strong Redis is not to say, and directly see the following article explain.<\/p>\n<p>Step 1: Download, compile and install<\/p>\n<p>cd \/opt wget http:\/\/download.redis.io\/releases\/redis-3.2.5.tar.gz<\/p>\n<p>tar zxvf redis-3.2.5.tar.gz<\/p>\n<p>cd redis-3.2.5<\/p>\n<p>yum install -y gcc* yum install -y tcl make MALLOC=libc make make test <\/p>\n<p>cd deps make [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[79],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6963"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6963"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6963\/revisions"}],"predecessor-version":[{"id":6964,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6963\/revisions\/6964"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6963"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6963"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6963"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}