Gestion des noeuds membres

This commit is contained in:
Philippe Caseiro 2018-05-11 15:03:44 +02:00
parent 7c40c395ec
commit a5b5f9fc32
2 changed files with 14 additions and 2 deletions

View File

@ -9,6 +9,7 @@
</service_access> </service_access>
<service_restriction service='ead_web'> <service_restriction service='ead_web'>
<ip interface='auto' netmask='rdClmask' netmask_type='SymLinkOption' ip_type='SymLinkOption'>rdClIP</ip> <ip interface='auto' netmask='rdClmask' netmask_type='SymLinkOption' ip_type='SymLinkOption'>rdClIP</ip>
<ip interface='auto' netmask='255.255.255.255' ip_type='SymLinkOption'>redisMasterIP</ip>
</service_restriction> </service_restriction>
</files> </files>
<variables> <variables>
@ -36,7 +37,6 @@
<variable name='rdClIP' type='ip' description="Adresse IP réseau autorisée a utiliser le service Redis" multi='True'/> <variable name='rdClIP' type='ip' description="Adresse IP réseau autorisée a utiliser le service Redis" multi='True'/>
<variable name='rdClmask' type='ip' description="Masque de sous réseau"/> <variable name='rdClmask' type='ip' description="Masque de sous réseau"/>
<!-- Cluster configration Part --> <!-- Cluster configration Part -->
<variable name='redisRole' type='string' description="Role du serveur Redis"> <variable name='redisRole' type='string' description="Role du serveur Redis">
<value>Leader</value> <value>Leader</value>
@ -44,10 +44,14 @@
<variable name='redisMasterIP' type='ip' description="Adresse IP du Leader Redis"/> <variable name='redisMasterIP' type='ip' description="Adresse IP du Leader Redis"/>
<variable name='redisMasterPort' type='number' description="Port d'écoute du Leader Redis"/> <variable name='redisMasterPort' type='number' description="Port d'écoute du Leader Redis"/>
<variable name='redisMasterPassword' type='string' description="Passphrase d'accès à la grappe Redis"/> <variable name='redisMasterPassword' type='string' description="Passphrase d'accès à la grappe Redis"/>
<variable name='rdClMemberIP' type='ip' description="Adresse IP du Noeud"/>
<variable name='rdClMemberRole' type='ip' description="Rôle du membre"/>
<variable name='rdClMemberMaster' type='ip' description="Noeud source des données pour ce membre"/>
</family> </family>
<separators> <separators>
<separator name='rdClIP'>Autorisation d'accès au service Redis</separator> <separator name='rdClIP'>Autorisation d'accès au service Redis</separator>
<separator name='redisRole'>Grappe Redis</separator> <separator name='redisRole'>Grappe Redis</separator>
<separator name='rdClMemberIP'>Serveurs membres de la grappe Redis</separator>
</separators> </separators>
</variables> </variables>
<constraints> <constraints>
@ -73,6 +77,11 @@
<target type='variable'>redisMasterPort</target> <target type='variable'>redisMasterPort</target>
</condition> </condition>
<condition name='disabled_if_in' source='rdClMemberRole'>
<param>master</param>
<target type='variable'>rdClMemberMaster</target>
</condition>
<group master='rdClIP'> <group master='rdClIP'>
<slave>rdClmask</slave> <slave>rdClmask</slave>
</group> </group>
@ -82,6 +91,9 @@
<check name="valid_enum" target="redisMode"> <check name="valid_enum" target="redisMode">
<param>['Local','Cluster']</param> <param>['Local','Cluster']</param>
</check> </check>
<check name="valid_enum" target="rdClMemberRole">
<param>['master','slave']</param>
</check>
<check name="valid_enum" target="redisMemoryPolicy"> <check name="valid_enum" target="redisMemoryPolicy">
<param>['noeviction', 'allkeys-lru','volatile-lru','volatile-random', 'allkeys-random','volatile-ttl']</param> <param>['noeviction', 'allkeys-lru','volatile-lru','volatile-random', 'allkeys-random','volatile-ttl']</param>
</check> </check>

View File

@ -707,7 +707,7 @@ aof-load-truncated yes
# Set it to 0 or a negative value for unlimited execution without warnings. # Set it to 0 or a negative value for unlimited execution without warnings.
lua-time-limit 5000 lua-time-limit 5000
%if %%getVar('redisMode','Local') == "Cluster" %if %%getVar('redisMode','Local') == "Cluster" and %%getVar('redisRole','Node') == 'Leader'
################################ REDIS CLUSTER ############################### ################################ REDIS CLUSTER ###############################
# #
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++