Browse Source

Cluster non présent par défaut sur les slaves + desactivation des sauvegardes auto RDB et AOF

mode_local_slave_distant
Teddy Cornaut 10 months ago
parent
commit
c26de6593e
3 changed files with 24 additions and 4 deletions
  1. 7
    2
      dicos/90_redis.xml
  2. 12
    2
      tmpl/redis-slave.conf
  3. 5
    0
      tmpl/redis.conf

+ 7
- 2
dicos/90_redis.xml View File

@@ -31,8 +31,9 @@
31 31
             <variable name='redisSlaveInstance' type='oui/non' description="Voulez-vous lancer une instance esclave Redis sur ce serveur ?">
32 32
                 <value>non</value>
33 33
             </variable>
34
+
34 35
             <!-- Instance Principale-->
35
-            <variable name='redisInstanceName' type='string' description="Nom de l'instance secondaire"/>
36
+            <variable name='redisInstanceName' type='string' description="Nom de l'instance principale"/>
36 37
             <variable name='redisPort' type='number' description="Port d'écoute du service Redis">
37 38
                 <value>6379</value>
38 39
             </variable>
@@ -102,9 +103,12 @@
102 103
 			<variable name='rdCliOutBuffSoftLimit' type='number' description="Client output buffer soft limit (for slave)">
103 104
 				<value>256</value>
104 105
 			</variable>
105
-			<variable name='rdSaveDisable' type='oui/non' description="Désactiver la presistence des données sur les maitres">
106
+			<variable name='rdSaveDisable' type='oui/non' description="Désactiver la persistence des données sur les maitres et esclaves">
106 107
 				<value>non</value>
107 108
 			</variable>
109
+            <variable name='rdAOFDisable' type='oui/non' description="Désactiver la sauvegarde AOF sur les maitres et esclaves">
110
+                <value>non</value>
111
+            </variable>
108 112
 		</family>
109 113
         <separators>
110 114
             <separator name='redisInstanceName'>Instance Principale</separator>
@@ -161,6 +165,7 @@
161 165
             <target type='variable'>redisSlaveInstanceName</target>
162 166
             <target type='variable'>redisSlaveInstanceMaster</target>
163 167
             <target type='variable'>redisClPortSlave</target>
168
+            <target type='variable'>redisClPort</target>
164 169
         </condition>
165 170
 
166 171
         <condition name='disabled_if_not_in' source='redisMode'>

+ 12
- 2
tmpl/redis-slave.conf View File

@@ -85,9 +85,9 @@ port %%redisPortSlave
85 85
 
86 86
 %if %%redisMode == 'Local avec slave distant'
87 87
 
88
-slaveof %%redisMasterIPSlave redisMasterPortSlave
88
+slaveof %%redisMasterIPSlave %%redisMasterPortSlave
89 89
 
90
-%endif
90
+%end if
91 91
 
92 92
 # TCP listen() backlog.
93 93
 #
@@ -205,9 +205,13 @@ databases 16
205 205
 #
206 206
 #   save ""
207 207
 
208
+%if %%rdSaveDisable == 'oui'
209
+save ""
210
+%else
208 211
 save 900 1
209 212
 save 300 10
210 213
 save 60 10000
214
+%end if
211 215
 
212 216
 # By default Redis will stop accepting writes if RDB snapshots are enabled
213 217
 # (at least one save point) and the latest background save failed.
@@ -378,7 +382,11 @@ maxmemory-policy %%redisMemoryPolicySlave
378 382
 #
379 383
 # Please check http://redis.io/topics/persistence for more information.
380 384
 
385
+%if %%rdAOFDisable == 'oui'
386
+appendonly no
387
+%else
381 388
 appendonly yes
389
+%end if
382 390
 
383 391
 # The name of the append only file (default: "appendonly.aof")
384 392
 
@@ -494,6 +502,7 @@ aof-load-truncated yes
494 502
 # Set it to 0 or a negative value for unlimited execution without warnings.
495 503
 lua-time-limit 5000
496 504
 
505
+%if %%getVar('redisMode','Local') == "Cluster"
497 506
 ################################ REDIS CLUSTER  ###############################
498 507
 #
499 508
 # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -601,6 +610,7 @@ cluster-require-full-coverage yes
601 610
 
602 611
 # In order to setup your cluster make sure to read the documentation
603 612
 # available at http://redis.io web site.
613
+%end if
604 614
 
605 615
 ################################## SLOW LOG ###################################
606 616
 

+ 5
- 0
tmpl/redis.conf View File

@@ -376,7 +376,12 @@ maxmemory-policy %%redisMemoryPolicy
376 376
 #
377 377
 # Please check http://redis.io/topics/persistence for more information.
378 378
 
379
+%if %%rdAOFDisable == 'oui'
380
+appendonly no
381
+%else
379 382
 appendonly yes
383
+%end if
384
+
380 385
 
381 386
 # The name of the append only file (default: "appendonly.aof")
382 387
 

Loading…
Cancel
Save