{"id":866,"date":"2020-04-04T00:51:29","date_gmt":"2020-04-03T21:51:29","guid":{"rendered":"https:\/\/microimpuls.com\/docs\/smarty\/scaling-and-redundancy\/%d0%bd%d0%b0%d1%81%d1%82%d1%80%d0%be%d0%b9%d0%ba%d0%b0-redis-cluster"},"modified":"2022-08-17T10:38:47","modified_gmt":"2022-08-17T07:38:47","slug":"redis-cluster-setup","status":"publish","type":"docs","link":"https:\/\/microimpuls.com\/en\/docs\/smarty\/scaling-and-redundancy\/redis-cluster-setup","title":{"rendered":"Configure Redis Cluster and Connections in Smarty"},"content":{"rendered":"<p>To ensure load distribution on the cache between multiple servers and fault tolerance, you need to use Redis in cluster mode, as well as Smarty.<\/p>\n\n\n\n<p>The optimal scheme is to configure the Redis Master Node on each Smarty server in Multi-Master mode. To ensure fault tolerance Redis minimum number of servers cluster \u2014 3.<\/p>\n\n\n\n\n\n<h2 class=\"wp-block-heading\">Instructions for setting up Redis Cluster in Multi-Master mode<\/h2>\n\n\n\n<p>For example, you need to configure 3 nodes on servers with IP addresses:<br>10.0.0.1<br>10.0.0.2<br>10.0.0.3<\/p>\n\n\n\n<p>Schematically, it looks like this:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1436\" height=\"467\" src=\"https:\/\/microimpuls.com\/wp-content\/uploads\/2020\/09\/SmartyRedisCluster-2.png\" alt=\"\" class=\"wp-image-1223\"\/><\/figure>\n\n\n\n<p>This configuration will survive the loss of two of the cluster\u2019s three servers.<\/p>\n\n\n\n<p>On each server must be installed redis-server version at least 3.0. It is recommended to use the latest version of Redis 5.x.<\/p>\n\n\n\n<p>On Debian, the Redis server can be installed using the command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">apt install redis server<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Configuring listening interfaces<\/h4>\n\n\n\n<p>In \/etc\/redis\/redis.conf you need to change the option <code>protected-mode<\/code> significance <strong>no<\/strong>and <code>bind<\/code> into <strong>0.0.0.0<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">protected-mode no\nbind 0.0.0.0<\/pre>\n\n\n\n<p>This will allow Redis to listen to connections on all interfaces.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Setting up port access<\/h4>\n\n\n\n<p>To secure the system, you must prevent access to ports 7000, 7001, 7002, 17001, 17002, 17003 on each server by default, and open access to these ports only to other nodes of the Redis cluster. For example, when using the ufw utility for iptables on the first server, you need to execute commands:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ufw allow in from 10.0.0.2 to any port 7000 proto tcp\nufw allow in from 10.0.0.2 to any port 7001 proto tcp\nufw allow in from 10.0.0.2 to any port 7002 proto tcp\nufw allow in from 10.0.0.2 to any port 17000 proto tcp\nufw allow in from 10.0.0.2 to any port 17001 proto tcp\nufw allow in from 10.0.0.2 to any port 17002 proto tcp\nufw allow in from 10.0.0.3 to any port 7000 proto tcp\nufw allow in from 10.0.0.3 to any port 7001 proto tcp\nufw allow in from 10.0.0.3 to any port 7002 proto tcp\nufw allow in from 10.0.0.3 to any port 17000 proto tcp\nufw allow from 10.0.0.3 to any port 17001 proto tcp\nufw allow from 10.0.0.3 to any port 17002 proto tcp\nufw allow out to any<\/pre>\n\n\n\n<p>On server two:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ufw allow in from 10.0.0.1 to any port 7000 proto tcp\nufw allow in from 10.0.0.1 to any port 7001 proto tcp\nufw allow in from 10.0.0.1 to any port 7002 proto tcp\nufw allow in from 10.0.0.1 to any port 17000 proto tcp\nufw allow from 10.0.0.1 to any port 17001 proto tcp\nufw allow from 10.0.0.1 to any port 17002 proto tcp\nufw allow in from 10.0.0.3 to any port 7000 proto tcp\nufw allow in from 10.0.0.3 to any port 7001 proto tcp\nufw allow in from 10.0.0.3 to any port 7002 proto tcp\nufw allow in from 10.0.0.3 to any port 17000 proto tcp\nufw allow from 10.0.0.3 to any port 17001 proto tcp\nufw allow from 10.0.0.3 to any port 17002 proto tcp\nufw allow out to any<\/pre>\n\n\n\n<p>On server three:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ufw allow in from 10.0.0.1 to any port 7000 proto tcp\nufw allow in from 10.0.0.1 to any port 7001 proto tcp\nufw allow in from 10.0.0.1 to any port 7002 proto tcp\nufw allow in from 10.0.0.1 to any port 17000 proto tcp\nufw allow from 10.0.0.1 to any port 17001 proto tcp\nufw allow from 10.0.0.1 to any port 17002 proto tcp\nufw allow in from 10.0.0.2 to any port 7000 proto tcp\nufw allow in from 10.0.0.2 to any port 7001 proto tcp\nufw allow in from 10.0.0.2 to any port 7002 proto tcp\nufw allow in from 10.0.0.2 to any port 17000 proto tcp\nufw allow in from 10.0.0.2 to any port 17001 proto tcp\nufw allow in from 10.0.0.2 to any port 17002 proto tcp\nufw allow out to any<\/pre>\n\n\n\n<p>Ports 7000, 7001, 7002 will be used to connect to Redis, and ports 17000, 17001, 17002 will be used by Redis to communicate between cluster nodes.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Installation of the utility redis-trib<\/h4>\n\n\n\n<p>On the first server, a command must be executed:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">wget https:\/\/bootstrap.pypa.io\/get-pip.py &amp;&amp; python get-pip.py &amp;&amp; rm get-pip.py \npip install redis-trib<\/pre>\n\n\n\n<p>The redis-trib utility is used to configure the cluster and manage nodes.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Installation of the Redis launch script<\/h4>\n\n\n\n<p>To easily add Redis configurations and run nodes, you need to add a service to systemd:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">touch \/etc\/systemd\/system\/redis-cluster-node@service<\/pre>\n\n\n\n<p>Then write the following script into this file:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">[Unit]<br>Description=redis cluster instance at port %i<br>After=network.target<br>Documentation=http:\/\/redis.io\/documentation, man:redis-server(1)<br><br>[Service]<br>Type=forking=<br>ExecStart=\/usr\/bin\/redis-server \/etc\/redis\/redis.conf \\<br>    -cluster-enabled yes \\<br>    --dbfilename dump_%i.rdb \\<br>    --port%i --cluster-config-file nodes_%i.conf<br>    --pidfile \/var\/run\/redis\/redis-server_%i.pid\\<br>    --logfile \/var\/log\/redis\/redis-server_%i.log<br><br>PIDFile=\/var\/run\/redis\/redis-server_%i.pid<br>TimeoutStopSec=0<br>Restart=always<br>User=redis<br>Group=redis<br>RunTimeDirect=redis<br><br>ExecStartPre=-\/bin\/run-parts --verbose \/etc\/redis\/redis-server.pre-up.d<br>ExecStartPost=-\/bin\/run-parts --verbose \/etc\/redis\/redis-server.post-up.d<br>ExecStop=-\/bin\/run-parts --verbose \/etc\/redis\/redis-server.pre-down.d<br>ExecStop=\/bin\/kill -s TERM $MAINPID<br>ExecStopPost=-\/bin\/run-parts --verbose \/etc\/redis\/redis-server.post-down.d<br><br>UMask=007<br>PrivateTmp=yes<br>LimitNOFILE = 65535<br>PrivateDevices=yes<br>ProtectHome=yes<br>ReadOnlyDirectories=\/<br>ReadWriteDirectories=-\/var\/lib\/redis<br>ReadWriteDirectories=-\/var\/log\/redis<br>ReadWriteDirectories=-\/var\/run\/redis<br>CapabilityBoundingSet=~CAP_SYS_PTRACE<br><br>#redisserver writes its own config file when in cluster mode so we allow<br># writing there (NB. ProtectSystem=true over ProtectSystem=full)<br>ProtectSystem = true<br>ReadWriteDirectories=-\/etc\/redis<br><br>[Install]<br>WantedBy=multi-user.target<\/pre>\n\n\n\n<p>Then execute the command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">systemctl daemon-reload<\/pre>\n\n\n\n<p>This should be done on each server of the cluster.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Recommended settings for speed<\/h4>\n\n\n\n<p>The configuration file \/etc\/redis\/redis.conf needs an option value <code>stop-writes-on-bgsave-error<\/code> substitute <strong>no<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">stop-writes-on-bgsave-error no<\/pre>\n\n\n\n<p>Also, to improve performance, it is recommended to disable persistence, but then when rebooting the Redis server, the entire cache will be reset, as a result of which some useful data for the service will be lost, for example, saved positions for watching movies and programs. To do this, comment on the options <code>save<\/code> and add <code>save<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">save\n#save9001\nsave 300 10\n#save 6010000<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Addition of Redis instances<\/h4>\n\n\n\n<p>On each server it is necessary to perform:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">systemctl enable redis-cluster-node@7000<br>systemctl enable redis-cluster-node@7001<br>systemctl enable redis-cluster-node@7002<\/pre>\n\n\n\n<p>Then start the added instances:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">systemctl start redis-cluster-node@7000.service<br>systemctl start redis-cluster-node@7001.service<br>systemctl start redis-cluster-node@7002.service<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Creation of a cluster<\/h4>\n\n\n\n<p>On the first server, you need to execute the command to create a Master-node cluster:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">redis-trib.py create 10.0.0.1:7000 10.0.0.2:7000 10.0.0.3:7000<\/pre>\n\n\n\n<p>Then evenly add cluster replicas (these commands must be executed only on the first server where the redis-trib utility is installed):<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">redis-trib.py replicate --slave-addr 10.0.0.2:7001 --master-addr 10.0.0. 1:7000\nredis-trib.py replicate --slave-addr 10.0.0.3:7002 --master-addr 10.0.0. 1:7000\nredis-trib.py replicate --slave-addr 10.0.0.3:7001 --master-addr 10.0.0. 2:7000\nredis-trib.py replicate --slave-addr 10.0.0.1:7002 --master-addr 10.0.0. 2:7000\nredis-trib.py replicate --slave-addr 10.0.0.1:7001 --master-addr 10.0.0.3:7000\nredis-trib.py replicate --slave-addr 10.0.0.2:7002 --master-addr 10.0.0.3:7000<\/pre>\n\n\n\n<p>Then you can check the list of added cluster nodes:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">redis-trib.py list --addr 10.0.0. 1:7000<\/pre>\n\n\n\n<p>Attention! When adding replicas, sometimes they can connect to the wrong masters to whom it was necessary according to the cluster scheme. If this happens, remove the wrong node from the cluster and add again, for example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">redis-trib.py del_node --addr 10.0.0.3:7002\nredis-trib.py replicate --slave-addr 10.0.0.3:7002 --master-addr 10.0.0. 1:7000<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Cluster verification<\/h4>\n\n\n\n<p>For verification, we will write down the value <strong>bar <\/strong>keyed <code>foo<\/code> on the first node, and read it on the other nodes:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">redis-cli -h 10.0.0.1 -p 7000 -c set foo bar\nredis-cli -h 10.0.0.2 -p 7000 -c get foo\nredis-cli -h 10.0.0.3 -p 7002 -c get foo<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Configure the connection to the Redis cluster in Smarty<\/h2>\n\n\n\n<p>In the Smarty configuration file <code>\/etc\/microimpuls\/smarty\/smarty.py<\/code> each Smarty server must have a block <code>CACHES<\/code> as follows:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">CACHES = {\n\"default\":\n\"Backend\": \"core.cache.backends.RedisCache,\"\n\u201cLOCATION\u201d: \u201credis:\/\/ 10.0.0.1:7000\/0\",\"\n\"OPTIONS\":\n\"REDIS_CLIENT_CLASS\": \"rediscluster.client.RedisCluster,\"\n\"REDIS_CLIENT_KWARGS\": {\"read_from_replicas: True },\n\"CONNECTION_POOL_CLASS\": \"core.cache.cluster_connection.ClusterConnectionPool,\"\n\"CONNECTION_POOL_KWARGS\": {\n\"startup_nodes\":\n{\"host\": \"10.0.0.1\", \"port\": \"7000\", \"server_type: \"master\"},\n{\"host\": \"10.0.0.1\", \"port\": \"7001\", \"server_type: \"slave\"},\n{\"host\": \"10.0.0.1\", \"port\": \"7002\", \"server_type: \"slave\"},\n]\n}\n}\n}\n}<\/pre>\n\n\n\n<p>As a value <code>LOCATION<\/code> on each server you must specify the address of the local node Redis cluster, and in the block <code>startup_nodes<\/code> specify the local master node and slay nodes of the cluster.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Recovery of the damaged Redis cluster<\/h2>\n\n\n\n<h4 class=\"wp-block-heading\">Partial recovery of the cluster<\/h4>\n\n\n\n<p>If there is a loss of several nodes of the cluster (for example, two), then the following steps must be performed to restore the cluster on the remaining server (for example, server 10.0.0.1).<\/p>\n\n\n\n<p>Lifting two new nodes:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">systemctl start redis-cluster-node@8000\nsystemctl start redis-cluster-node@8001<\/pre>\n\n\n\n<p>Restore data from the remaining working node:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">redis-trib.py rescue --existing-addr 10.0.0.1:7000 --new-addr 10.0.0. 1:8000\nredis-trib.py rescue --existing-addr 10.0.0.1:7000 --new-addr 10.0.0.1:8001<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Full recovery of the cluster<\/h4>\n\n\n\n<p>On all servers stop all processes of cluster radish<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">systemctl stop redis-cluster-node@7000<br>systemctl stop redis-cluster-node@7001<br>systemctl stop redis-cluster-node@7002<\/pre>\n\n\n\n<p>Then remove all files from the <code>\/var\/lib\/redis\/<\/code>.<\/p>\n\n\n\n<p>Re-start instances and create a cluster, as in the initial configuration.<\/p>","protected":false},"featured_media":0,"parent":857,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_links_to":"","_links_to_target":""},"doc_tag":[],"class_list":["post-866","docs","type-docs","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Redis Cluster \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0432 Smarty<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/microimpuls.com\/en\/docs\/smarty\/scaling-and-redundancy\/redis-cluster-setup\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Redis Cluster \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0432 Smarty\" \/>\n<meta property=\"og:description\" content=\"\u0414\u043b\u044f \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043d\u0430 \u043a\u0435\u0448 \u043c\u0435\u0436\u0434\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c\u0438 \u0438 \u043e\u0442\u043a\u0430\u0437\u043e\u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0441\u0442\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Redis \u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435, \u0442\u0430\u043a\u0436\u0435 \u043a\u0430\u043a \u0438 Smarty. \u041e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0445\u0435\u043c\u043e\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Master-\u043d\u043e\u0434\u044b Redis \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435 Smarty \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 Multi-Master. \u0414\u043b\u044f \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u043e\u0442\u043a\u0430\u0437\u043e\u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0441\u0442\u0438 Redis \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 &#8212; 3. \u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043f\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 Redis Cluster \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 Multi-Master \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/microimpuls.com\/en\/docs\/smarty\/scaling-and-redundancy\/redis-cluster-setup\/\" \/>\n<meta property=\"og:site_name\" content=\"Microimpuls\" \/>\n<meta property=\"article:modified_time\" content=\"2022-08-17T07:38:47+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/microimpuls.com\/wp-content\/uploads\/2020\/09\/SmartyRedisCluster-2.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/microimpuls.com\/docs\/smarty\/scaling-and-redundancy\/redis-cluster-setup\",\"url\":\"https:\/\/microimpuls.com\/docs\/smarty\/scaling-and-redundancy\/redis-cluster-setup\",\"name\":\"\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Redis Cluster \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0432 Smarty\",\"isPartOf\":{\"@id\":\"https:\/\/micro.im\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/microimpuls.com\/docs\/smarty\/scaling-and-redundancy\/redis-cluster-setup#primaryimage\"},\"image\":{\"@id\":\"https:\/\/microimpuls.com\/docs\/smarty\/scaling-and-redundancy\/redis-cluster-setup#primaryimage\"},\"thumbnailUrl\":\"https:\/\/microimpuls.com\/wp-content\/uploads\/2020\/09\/SmartyRedisCluster-2.png\",\"datePublished\":\"2020-04-03T21:51:29+00:00\",\"dateModified\":\"2022-08-17T07:38:47+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/microimpuls.com\/docs\/smarty\/scaling-and-redundancy\/redis-cluster-setup#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/microimpuls.com\/docs\/smarty\/scaling-and-redundancy\/redis-cluster-setup\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/microimpuls.com\/docs\/smarty\/scaling-and-redundancy\/redis-cluster-setup#primaryimage\",\"url\":\"https:\/\/microimpuls.com\/wp-content\/uploads\/2020\/09\/SmartyRedisCluster-2.png\",\"contentUrl\":\"https:\/\/microimpuls.com\/wp-content\/uploads\/2020\/09\/SmartyRedisCluster-2.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/microimpuls.com\/docs\/smarty\/scaling-and-redundancy\/redis-cluster-setup#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u0413\u043b\u0430\u0432\u043d\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\",\"item\":\"https:\/\/micro.im\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Smarty\",\"item\":\"https:\/\/microimpuls.com\/docs\/smarty\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"\u041c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u043e\u0442\u043a\u0430\u0437\u043e\u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0441\u0442\u044c\",\"item\":\"https:\/\/microimpuls.com\/docs\/smarty\/scaling-and-redundancy\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Redis Cluster \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0432 Smarty\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/micro.im\/#website\",\"url\":\"https:\/\/micro.im\/\",\"name\":\"Microimpuls\",\"description\":\"\u041a\u043e\u043c\u043f\u043b\u0435\u043a\u0441\u043d\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u043b\u044f OTT \u0438 IPTV\",\"publisher\":{\"@id\":\"https:\/\/micro.im\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/micro.im\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/micro.im\/#organization\",\"name\":\"Microimpuls\",\"url\":\"https:\/\/micro.im\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/micro.im\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/microimpuls.com\/wp-content\/uploads\/2024\/12\/mi-logo-square-en-black.png\",\"contentUrl\":\"https:\/\/microimpuls.com\/wp-content\/uploads\/2024\/12\/mi-logo-square-en-black.png\",\"width\":208,\"height\":219,\"caption\":\"Microimpuls\"},\"image\":{\"@id\":\"https:\/\/micro.im\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Configure Redis Cluster and Connections in Smarty","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/microimpuls.com\/en\/docs\/smarty\/scaling-and-redundancy\/redis-cluster-setup\/","og_locale":"en_US","og_type":"article","og_title":"\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Redis Cluster \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0432 Smarty","og_description":"\u0414\u043b\u044f \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043d\u0430 \u043a\u0435\u0448 \u043c\u0435\u0436\u0434\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c\u0438 \u0438 \u043e\u0442\u043a\u0430\u0437\u043e\u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0441\u0442\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Redis \u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435, \u0442\u0430\u043a\u0436\u0435 \u043a\u0430\u043a \u0438 Smarty. \u041e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0445\u0435\u043c\u043e\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Master-\u043d\u043e\u0434\u044b Redis \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435 Smarty \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 Multi-Master. \u0414\u043b\u044f \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u043e\u0442\u043a\u0430\u0437\u043e\u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0441\u0442\u0438 Redis \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 &#8212; 3. \u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043f\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 Redis Cluster \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 Multi-Master \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c [&hellip;]","og_url":"https:\/\/microimpuls.com\/en\/docs\/smarty\/scaling-and-redundancy\/redis-cluster-setup\/","og_site_name":"Microimpuls","article_modified_time":"2022-08-17T07:38:47+00:00","og_image":[{"url":"https:\/\/microimpuls.com\/wp-content\/uploads\/2020\/09\/SmartyRedisCluster-2.png","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/microimpuls.com\/docs\/smarty\/scaling-and-redundancy\/redis-cluster-setup","url":"https:\/\/microimpuls.com\/docs\/smarty\/scaling-and-redundancy\/redis-cluster-setup","name":"Configure Redis Cluster and Connections in Smarty","isPartOf":{"@id":"https:\/\/micro.im\/#website"},"primaryImageOfPage":{"@id":"https:\/\/microimpuls.com\/docs\/smarty\/scaling-and-redundancy\/redis-cluster-setup#primaryimage"},"image":{"@id":"https:\/\/microimpuls.com\/docs\/smarty\/scaling-and-redundancy\/redis-cluster-setup#primaryimage"},"thumbnailUrl":"https:\/\/microimpuls.com\/wp-content\/uploads\/2020\/09\/SmartyRedisCluster-2.png","datePublished":"2020-04-03T21:51:29+00:00","dateModified":"2022-08-17T07:38:47+00:00","breadcrumb":{"@id":"https:\/\/microimpuls.com\/docs\/smarty\/scaling-and-redundancy\/redis-cluster-setup#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/microimpuls.com\/docs\/smarty\/scaling-and-redundancy\/redis-cluster-setup"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/microimpuls.com\/docs\/smarty\/scaling-and-redundancy\/redis-cluster-setup#primaryimage","url":"https:\/\/microimpuls.com\/wp-content\/uploads\/2020\/09\/SmartyRedisCluster-2.png","contentUrl":"https:\/\/microimpuls.com\/wp-content\/uploads\/2020\/09\/SmartyRedisCluster-2.png"},{"@type":"BreadcrumbList","@id":"https:\/\/microimpuls.com\/docs\/smarty\/scaling-and-redundancy\/redis-cluster-setup#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u0413\u043b\u0430\u0432\u043d\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430","item":"https:\/\/micro.im\/"},{"@type":"ListItem","position":2,"name":"Smarty","item":"https:\/\/microimpuls.com\/docs\/smarty"},{"@type":"ListItem","position":3,"name":"\u041c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u043e\u0442\u043a\u0430\u0437\u043e\u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0441\u0442\u044c","item":"https:\/\/microimpuls.com\/docs\/smarty\/scaling-and-redundancy"},{"@type":"ListItem","position":4,"name":"\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Redis Cluster \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0432 Smarty"}]},{"@type":"WebSite","@id":"https:\/\/micro.im\/#website","url":"https:\/\/micro.im\/","name":"Microimpulses","description":"Comprehensive solutions for OTT and IPTV","publisher":{"@id":"https:\/\/micro.im\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/micro.im\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/micro.im\/#organization","name":"Microimpulses","url":"https:\/\/micro.im\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/micro.im\/#\/schema\/logo\/image\/","url":"https:\/\/microimpuls.com\/wp-content\/uploads\/2024\/12\/mi-logo-square-en-black.png","contentUrl":"https:\/\/microimpuls.com\/wp-content\/uploads\/2024\/12\/mi-logo-square-en-black.png","width":208,"height":219,"caption":"Microimpuls"},"image":{"@id":"https:\/\/micro.im\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/microimpuls.com\/en\/wp-json\/wp\/v2\/docs\/866","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/microimpuls.com\/en\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/microimpuls.com\/en\/wp-json\/wp\/v2\/types\/docs"}],"replies":[{"embeddable":true,"href":"https:\/\/microimpuls.com\/en\/wp-json\/wp\/v2\/comments?post=866"}],"version-history":[{"count":24,"href":"https:\/\/microimpuls.com\/en\/wp-json\/wp\/v2\/docs\/866\/revisions"}],"predecessor-version":[{"id":3146,"href":"https:\/\/microimpuls.com\/en\/wp-json\/wp\/v2\/docs\/866\/revisions\/3146"}],"up":[{"embeddable":true,"href":"https:\/\/microimpuls.com\/en\/wp-json\/wp\/v2\/docs\/857"}],"next":[{"title":"Enabling data compression in the cache","link":"https:\/\/microimpuls.com\/en\/docs\/smarty\/scaling-and-redundancy\/enable-redis-cache-compression","href":"https:\/\/microimpuls.com\/en\/wp-json\/wp\/v2\/docs\/858"}],"wp:attachment":[{"href":"https:\/\/microimpuls.com\/en\/wp-json\/wp\/v2\/media?parent=866"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/microimpuls.com\/en\/wp-json\/wp\/v2\/doc_tag?post=866"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}