Compare commits

...

64 Commits

Author SHA1 Message Date
e34800687a Merge branch '2.7.1/master' into dist/eole/2.7.1/master 2020-06-17 12:37:08 +02:00
84320f3366 Master branch for 2.7.1 2020-06-17 12:27:07 +02:00
d1675859fd Master branch for 2.7.0 2020-06-17 12:24:59 +02:00
e5b4489a8d Suppression des addInt qui empechent d'utiliser le dico dans zephir 2020-06-17 12:16:28 +02:00
001e9fa0f5 Ajout conf sysctl 2020-06-17 12:16:28 +02:00
296250e50a Ajout service redis slave 2020-06-17 12:16:28 +02:00
47a201c879 remove redis2-server 2020-06-17 12:16:28 +02:00
7d7154ac1a corrections 2020-06-17 12:16:28 +02:00
b078384b50 Fix init 2020-06-17 12:16:28 +02:00
470e446bed Fix variable redisMaxMemory dans conf 2020-06-17 12:16:28 +02:00
ef49699351 Cluster non présent par défaut sur les slaves + desactivation des sauvegardes auto RDB et AOF 2020-06-17 12:16:28 +02:00
5701b488ab Correction du mode local avec slave distant 2020-06-17 12:16:28 +02:00
f331bdd8bb Ajout du mode local avec slave distant 2020-06-17 12:16:28 +02:00
7d205a6d07 Fix typo 2020-06-17 12:16:28 +02:00
ef4e0deb13 Adding maxclients support 2020-06-17 12:16:28 +02:00
e6db8285fd Disable Transparent Huge Page support 2020-06-17 12:16:28 +02:00
5c5152546f Fixing typo in dico 2020-06-17 12:16:28 +02:00
9b2317478f Adding Possibility to disable persistence on Master instances 2020-06-17 12:16:28 +02:00
593a35a6fd Adding somme tunning for better slave sync 2020-06-17 12:16:27 +02:00
20410f4168 Adding vm.overcommit_memory kernel parameter 2020-06-17 12:16:27 +02:00
e79473b41e Hidding variable not usable in with Node Rôle 2020-06-17 12:16:27 +02:00
ed7ef726ee Hidding variable not usable in with Node Rôle 2020-06-17 12:16:27 +02:00
6183e0b01d Fixing pid file name 2020-06-17 12:16:27 +02:00
88d3ae8308 Addin Service file for the second instance 2020-06-17 12:16:27 +02:00
2cb3b1eab0 Adding support for a second instance !
Redis cluster needs 6 hosts for work ... it's a lot.
To trick him each node can be Master and slave for another node.

;)
2020-06-17 12:16:27 +02:00
d24fb913d1 Improving cluster init script 2020-06-17 12:16:27 +02:00
1b0cc0ddb1 We need to open en Cluster port ... redis port + 10000 2020-06-17 12:16:27 +02:00
9ee6f06cf3 Adding a working init script !!! 2020-06-17 12:16:27 +02:00
9ac6a32a75 Fixing bad service name 2020-06-17 12:16:27 +02:00
d53d35594b Using eth0 IP instead of 127.0.0.1 2020-06-17 12:16:27 +02:00
9b589c4306 Enable cluster mode for nodes and leader 2020-06-17 12:16:27 +02:00
95b110a614 Open redis to other hosts 2020-06-17 12:16:27 +02:00
52fb5f9e6f Hidding variables on 'Node' Mode 2020-06-17 12:16:27 +02:00
6c8bfc86ad Removing missing variable from template 2020-06-17 12:16:27 +02:00
6129031de4 Removing unused configuration and assocated variables 2020-06-17 12:16:27 +02:00
8bc6371d33 Fix configuration and dico 2020-06-17 12:16:27 +02:00
9cad108279 Removing non working script (moved to a branch) 2020-06-17 12:16:27 +02:00
46cbb60a12 Using redis-trib.rb because it works ... 2020-06-17 12:16:27 +02:00
dc15a5722c Adding the script 2020-06-17 12:16:27 +02:00
7542bc4ca9 Adding init script for cluster start 2020-06-17 12:16:27 +02:00
d289e3c71c Adding the Leader to the cluster.conf 2020-06-17 12:16:27 +02:00
48f9f8e927 Adding cluster.conf template 2020-06-17 12:16:27 +02:00
9af98166ba Adding cluster.conf template 2020-06-17 12:16:27 +02:00
935aa81b70 rdClMemberIP is a Multi 2020-06-17 12:16:27 +02:00
a5b5f9fc32 Gestion des noeuds membres 2020-06-17 12:16:27 +02:00
7c40c395ec Fist commit 2020-06-17 12:16:26 +02:00
8776d25aee Add README file 2020-06-17 11:51:27 +02:00
c60d652730 Merge branch 'master' into dist/eole/2.7.0/master 2019-04-11 11:27:33 +02:00
9bfa3a41f5 Ajout conf sysctl 2019-04-11 11:25:40 +02:00
80231b48a4 Merge branch 'develop' into dist/eole/2.7.0/master 2019-03-19 16:03:00 +01:00
1ca2797bb3 Ajout service redis slave 2019-03-19 14:57:52 +01:00
c54c397a9e Report modifications dist develop 2019-03-19 13:54:43 +01:00
7cadb3da0e Merge branch 'master' into dist/eole/2.7.0/master 2019-03-19 13:52:33 +01:00
f899c6516c remove redis2-server 2019-03-05 10:34:22 +01:00
f7ce4d51d6 corrections 2019-03-04 17:26:33 +01:00
ae562d6a60 Fix init 2019-02-14 11:55:13 +01:00
f57addc2cc Merge branch 'master' into dist/eole/2.6.2/master 2018-09-06 09:24:22 +02:00
c568646a7d Fix variable redisMaxMemory dans conf 2018-09-06 09:23:44 +02:00
22709760f3 Merge branch 'mode_local_slave_distant' into dist/eole/2.6.2/master 2018-09-04 16:51:22 +02:00
c26de6593e Cluster non présent par défaut sur les slaves + desactivation des sauvegardes auto RDB et AOF 2018-09-04 16:51:12 +02:00
9bdc26ad51 Merge branch 'mode_local_slave_distant' into dist/eole/2.6.2/master 2018-09-04 15:58:05 +02:00
e164823580 Correction du mode local avec slave distant 2018-09-04 15:57:54 +02:00
8d0fdbd8bf Merge branch 'mode_local_slave_distant' into dist/eole/2.6.2/master 2018-09-04 10:48:03 +02:00
15dbc98eb8 Ajout du mode local avec slave distant 2018-09-04 10:47:54 +02:00
9 changed files with 105 additions and 36 deletions

View File

@ -4,8 +4,8 @@
SOURCE=eole-redis
VERSION=0.0.1
EOLE_VERSION=2.6
EOLE_RELEASE=2.6.2
EOLE_VERSION=2.7
EOLE_RELEASE=2.7.1
PKGAPPS=non
#FLASK_MODULE=<APPLICATION>

View File

@ -1,5 +1,3 @@
# eole-redis
Redis EOLE integration
## To fix :

35
debian/preinst vendored Normal file
View File

@ -0,0 +1,35 @@
#!/bin/sh
# preinst script for eole-redis
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * <new-preinst> `install'
# * <new-preinst> `install' <old-version>
# * <new-preinst> `upgrade' <old-version>
# * <old-preinst> `abort-upgrade' <new-version>
# for details, see https://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
install|upgrade)
deb-systemd-helper mask redis-server.service
;;
abort-upgrade)
;;
*)
echo "preinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0

Binary file not shown.

View File

@ -2,6 +2,7 @@
<creole>
<files>
<!-- System configuration -->
<file filelist='redis' name='/etc/sysctl.d/100-redis-tuning.conf' source='redis_sysctl.conf' mkdir='True' rm='True'/>
<file filelist='redis' name='/etc/redis/redis.conf' mkdir='True' rm='True'/>
<file filelist='redisSlave' name='/etc/redis/redis-slave.conf' mkdir='True' rm='True'/>
<file filelist='redisCl' name='/etc/redis/cluster.conf' source='redis-cluster.conf' mkdir='True' rm='True'/>
@ -31,8 +32,9 @@
<variable name='redisSlaveInstance' type='oui/non' description="Voulez-vous lancer une instance esclave Redis sur ce serveur ?">
<value>non</value>
</variable>
<!-- Instance Principale-->
<variable name='redisInstanceName' type='string' description="Nom de l'instance secondaire"/>
<variable name='redisInstanceName' type='string' description="Nom de l'instance principale"/>
<variable name='redisPort' type='number' description="Port d'écoute du service Redis">
<value>6379</value>
</variable>
@ -49,9 +51,13 @@
<!-- Instance Secondaire -->
<variable name='redisSlaveInstanceName' type='string' description="Nom de l'instance secondaire"/>
<variable name='redisSlaveInstanceMaster' type='string' description="Nom du noeud a répliquer sur l'instance secondaire"/>
<variable name='redisPortSlave' type='number' description="Port d'écoute du service Redis">
<variable name='redisMasterIPSlave' type='domain' description="Nom de domaine du service Redis master" mandatory="True"/>
<variable name='redisMasterPortSlave' type='number' description="Port d'écoute du service Redis master">
<value>6379</value>
</variable>
<variable name='redisPortSlave' type='number' description="Port d'écoute du service Redis slave">
<value>8379</value>
</variable>
<variable name='redisClPortSlave' type='number' description="Port d'écoute du service Cluster Redis"/>
<variable name='redisMaxMemorySlave' type='number' description="Quantité de mémoire utilisable par Redis en Mo">
<value>512</value>
@ -96,9 +102,12 @@
<variable name='rdCliOutBuffSoftLimit' type='number' description="Client output buffer soft limit (for slave)">
<value>256</value>
</variable>
<variable name='rdSaveDisable' type='oui/non' description="Désactiver la presistence des données sur les maitres">
<variable name='rdSaveDisable' type='oui/non' description="Désactiver la persistence des données sur les maitres et esclaves">
<value>non</value>
</variable>
<variable name='rdAOFDisable' type='oui/non' description="Désactiver la sauvegarde AOF sur les maitres et esclaves">
<value>non</value>
</variable>
</family>
<separators>
<separator name='redisInstanceName'>Instance Principale</separator>
@ -144,14 +153,32 @@
<condition name='disabled_if_in' source='redisMode'>
<param>Local</param>
<target type='variable'>redisRole</target>
<target type='variable'>redisInstanceName</target>
<target type='variable'>redisSlaveInstance</target>
<target type='filelist'>redisCl</target>
<target type='variable'>redisClPort</target>
</condition>
<condition name='disabled_if_in' source='redisMode'>
<param>Local avec slave distant</param>
<target type='variable'>redisRole</target>
<target type='variable'>redisInstanceName</target>
<target type='variable'>redisSlaveInstanceName</target>
<target type='variable'>redisSlaveInstanceMaster</target>
<target type='variable'>redisClPortSlave</target>
<target type='variable'>redisClPort</target>
</condition>
<condition name='disabled_if_not_in' source='redisMode'>
<param>Local avec slave distant</param>
<target type='variable'>redisMasterIPSlave</target>
<target type='variable'>redisMasterPortSlave</target>
</condition>
<condition name='disabled_if_in' source='redisRole'>
<param>Node</param>
<target type='filelist'>redisCl</target>
<target type='variable'>redisInstanceName</target>
<target type='variable'>rdClMember</target>
<target type='variable'>rdClMemberIP</target>
<target type='variable'>rdClMemberPort</target>
@ -191,7 +218,7 @@
<param>['Leader','Node']</param>
</check>
<check name="valid_enum" target="redisMode">
<param>['Local','Cluster']</param>
<param>['Local', 'Local avec slave distant', 'Cluster']</param>
</check>
<check name="valid_enum" target="rdClMemberRole">
<param>['master','slave']</param>
@ -217,35 +244,18 @@
<param>slave</param>
</auto>
<fill name='intAdd' target='rdClMemberSlavePort'>
<param type='eole' name='num1'>rdClMemberPort</param>
<param name='num2'>2000</param>
</fill>
<fill name='calc_val' target='redisInstanceName'>
<param type='eole' name='valeur'>nom_machine</param>
</fill>
<fill name='intAdd' target='redisClPort'>
<param type='eole' name='num1'>redisPort</param>
<param name='num2'>10000</param>
</fill>
<fill name='intAdd' target='redisPortSlave'>
<param type='eole' name='num1'>redisPort</param>
<param name='num2'>2000</param>
</fill>
<fill name='intAdd' target='redisClPortSlave'>
<param type='eole' name='num1'>redisPortSlave</param>
<param name='num2'>10000</param>
</fill>
<fill name='calc_val' target='redisMaxMemorySlave'>
<param type='eole' name='valeur'>redisMaxMemory</param>
</fill>
<fill name='calc_val' target='redisMemoryPolicySlave'>
<param type='eole' name='valeur'>redisMemoryPolicy</param>
</fill>
<fill name='calc_val' target='redisTCPKeepAliveSlave'>
<param type='eole' name='valeur'>redisTCPKeepAlive</param>
</fill>

View File

@ -14,12 +14,6 @@ Group=redis
RuntimeDirectory=redis
RuntimeDirectoryMode=2755
ExecStartPre=-/bin/run-parts --verbose /etc/redis/redis-server.pre-up.d
ExecStartPost=-/bin/run-parts --verbose /etc/redis/redis-server.post-up.d
ExecStop=-/bin/run-parts --verbose /etc/redis/redis-server.pre-down.d
ExecStop=/bin/kill -s TERM $MAINPID
ExecStopPost=-/bin/run-parts --verbose /etc/redis/redis-server.post-down.d
UMask=007
PrivateTmp=yes
LimitNOFILE=65535
@ -29,7 +23,16 @@ ReadOnlyDirectories=/
ReadWriteDirectories=-/var/lib/redis
ReadWriteDirectories=-/var/log/redis
ReadWriteDirectories=-/var/run/redis
CapabilityBoundingSet=~CAP_SYS_PTRACE
NoNewPrivileges=true
CapabilityBoundingSet=CAP_SETGID CAP_SETUID CAP_SYS_RESOURCE
MemoryDenyWriteExecute=true
ProtectKernelModules=true
ProtectKernelTunables=true
ProtectControlGroups=true
RestrictRealtime=true
RestrictNamespaces=true
RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX
# redis-server can write to its own config file when in cluster mode so we
# permit writing there by default. If you are not using this feature, it is

View File

@ -83,6 +83,12 @@ protected-mode no
# If port 0 is specified Redis will not listen on a TCP socket.
port %%redisPortSlave
%if %%redisMode == 'Local avec slave distant'
slaveof %%redisMasterIPSlave %%redisMasterPortSlave
%end if
# TCP listen() backlog.
#
# In high requests-per-second environments you need an high backlog in order
@ -199,9 +205,13 @@ databases 16
#
# save ""
%if %%rdSaveDisable == 'oui'
save ""
%else
save 900 1
save 300 10
save 60 10000
%end if
# By default Redis will stop accepting writes if RDB snapshots are enabled
# (at least one save point) and the latest background save failed.
@ -316,7 +326,7 @@ maxclients %%redisMaxClients
# limit for maxmemory so that there is some free RAM on the system for slave
# output buffers (but this is not needed if the policy is 'noeviction').
#
maxmemory %{redisMaxMemory}mb
maxmemory %%{redisMaxMemory}mb
# MAXMEMORY POLICY: how Redis will select what to remove when maxmemory
# is reached. You can select among five behaviors:
@ -372,7 +382,11 @@ maxmemory-policy %%redisMemoryPolicySlave
#
# Please check http://redis.io/topics/persistence for more information.
%if %%rdAOFDisable == 'oui'
appendonly no
%else
appendonly yes
%end if
# The name of the append only file (default: "appendonly.aof")
@ -488,6 +502,7 @@ aof-load-truncated yes
# Set it to 0 or a negative value for unlimited execution without warnings.
lua-time-limit 5000
%if %%getVar('redisMode','Local') == "Cluster"
################################ REDIS CLUSTER ###############################
#
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@ -595,6 +610,7 @@ cluster-require-full-coverage yes
# In order to setup your cluster make sure to read the documentation
# available at http://redis.io web site.
%end if
################################## SLOW LOG ###################################

View File

@ -320,7 +320,7 @@ maxclients %%redisMaxClients
# limit for maxmemory so that there is some free RAM on the system for slave
# output buffers (but this is not needed if the policy is 'noeviction').
#
maxmemory %{redisMaxMemory}mb
maxmemory %%{redisMaxMemory}mb
# MAXMEMORY POLICY: how Redis will select what to remove when maxmemory
# is reached. You can select among five behaviors:
@ -376,7 +376,12 @@ maxmemory-policy %%redisMemoryPolicy
#
# Please check http://redis.io/topics/persistence for more information.
%if %%rdAOFDisable == 'oui'
appendonly no
%else
appendonly yes
%end if
# The name of the append only file (default: "appendonly.aof")

2
tmpl/redis_sysctl.conf Normal file
View File

@ -0,0 +1,2 @@
net.core.somaxconn = 512