{"id":622,"date":"2016-06-20T15:37:09","date_gmt":"2016-06-20T10:07:09","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=622"},"modified":"2016-06-20T15:37:09","modified_gmt":"2016-06-20T10:07:09","slug":"redismaster-and-slave-setup","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/redismaster-and-slave-setup\/","title":{"rendered":"RedisMaster and Slave Setup"},"content":{"rendered":"<h2><b>1. Install Linux dependencies GCC and Make(On Redis Server)<\/b><\/h2>\n<pre>sudo yum -y install gcc make<\/pre>\n<p>&nbsp;<\/p>\n<h2><a name=\"TOC-2.-Download-Untar-and-Make-Redis-3.0\"><\/a><b>2. Download, Untar and Make Redis 3.0<br \/>\n<\/b><\/h2>\n<pre>wget http:\/\/&lt;Download the latest file from the redis official site&gt;\r\ntar xzf redis-3.3.0-rc3.tar.gz\r\ncd redis-3.0.0-rc3\r\nmake<\/pre>\n<p>&nbsp;<\/p>\n<h2><a name=\"TOC-3.-Create-Directories-and-Copy-Redis-Files\"><\/a><b>3.\u00a0Create Directories and Copy Redis Files<\/b><\/h2>\n<pre>sudo mkdir \/etc\/redis \/var\/lib\/redis\r\nsudo cp src\/redis-server src\/redis-cli \/usr\/local\/bin\r\nsudo cp redis.conf \/etc\/redis<\/pre>\n<p>&nbsp;<\/p>\n<h2><a name=\"TOC-4.-Configure-Redis.Conf-Use-any-editor-\"><\/a><b>4. Configure Redis.Conf (Use any editor)<br \/>\n<\/b><\/h2>\n<pre>sudo vim \/etc\/redis\/redis.conf<\/pre>\n<p>daemonize yes<br \/>\nbind\u00a0 0.0.0.0<br \/>\ndir \/var\/lib\/redis<br \/>\npidfile \/var\/run\/redis.pid<br \/>\nport 6379<br \/>\ndir \/var\/lib\/redis<br \/>\nlogfile &#8220;\/var\/log\/redis.log&#8221;<\/p>\n<h2><a name=\"TOC-5.-Download-init-Script\"><\/a><b>5. Download init Script<\/b><\/h2>\n<pre>wget <a href=\"https:\/\/www.google.com\/url?q=https%3A%2F%2Fraw.github.com%2Fsaxenap%2Finstall-redis-amazon-linux-centos%2Fmaster%2Fredis-server&amp;sa=D&amp;sntz=1&amp;usg=AFrqEzcPF5GGu-ypIvEXAx1OXAKEP-_m4g\" target=\"_blank\" rel=\"noopener\">https:\/\/raw.github.com\/saxenap\/install-redis-amazon-linux-centos\/master\/redis-server<\/a><\/pre>\n<p>&nbsp;<\/p>\n<h2><a name=\"TOC-6.-Move-and-Configure-Redis-Server\"><\/a><b>6. Move and Configure Redis-Server<\/b><\/h2>\n<p>Note: The redis-server to be moved below is the one downloaded in 5 above.<\/p>\n<pre>sudo mv redis-server \/etc\/init.d\r\nsudo chmod 755 \/etc\/init.d\/redis-server\r\nsudo nano \/etc\/init.d\/redis-server<\/pre>\n<pre>redis=\"\/usr\/local\/bin\/redis-server\"<\/pre>\n<p>&nbsp;<\/p>\n<h2><a name=\"TOC-7.-Auto-Enable-Redis-Server\"><\/a><b>7. Auto-Enable Redis-Server<\/b><\/h2>\n<pre>sudo chkconfig --add redis-server\r\nsudo chkconfig --level 345 redis-server on<\/pre>\n<p>&nbsp;<\/p>\n<h2><a name=\"TOC-8.-Start-Redis-Server\"><\/a><b>8. Start Redis Server<\/b><\/h2>\n<pre>sudo service redis-server start\r\n\r\n\r\n<\/pre>\n<h2><a name=\"TOC-9.-On-Redis-Slave-Server-\"><\/a><b>9. (On Redis Slave Server)<\/b><\/h2>\n<pre>Follow the steps from 1 to 6 except step 4, for the step 4 use any editor(vim)\r\nand specify the settings under the \/etc\/redis\/redis.conf file -\r\ndaemonize yes\r\nslaveof &lt;hostname or IPaddress&gt; 6379\r\npidfile \/var\/run\/redis.pid\r\nport 6379\r\n\r\n\r\n<\/pre>\n<h2><a name=\"TOC-10.-Auto-Enable-Redis-Server\"><\/a><b>10. Auto-Enable Redis-Server<\/b><\/h2>\n<pre>sudo chkconfig --add redi-server &amp;&amp; sudo chkconfig --level 345 redis-server on<\/pre>\n<p>&nbsp;<\/p>\n<h2><a name=\"TOC-11.-Start-Redis-Server\"><\/a><b>11. Start Redis Server<\/b><\/h2>\n<pre>sudo service redis-server start<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>1. Install Linux dependencies GCC and Make(On Redis Server) sudo yum -y install gcc make &nbsp; 2. Download, Untar and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1022],"tags":[],"class_list":["post-622","post","type-post","status-publish","format-standard","hentry","category-web-architecture","psol-cat-web-architecture"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phn2x7-a2","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/622","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=622"}],"version-history":[{"count":0,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/622\/revisions"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=622"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=622"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=622"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}