From 2031ec7d649e1f896491638bffbade9d7c649482 Mon Sep 17 00:00:00 2001 From: Philippe Caseiro Date: Tue, 15 May 2018 12:17:25 +0200 Subject: [PATCH] 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. ;) --- creolefuncs/redis.py | 3 + dicos/90_redis.xml | 147 ++++++- postservice/90-redis-init | 34 +- tmpl/redis-cluster.conf | 12 +- tmpl/redis-slave.conf | 834 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 1007 insertions(+), 23 deletions(-) create mode 100644 tmpl/redis-slave.conf diff --git a/creolefuncs/redis.py b/creolefuncs/redis.py index 87bb432..967f764 100644 --- a/creolefuncs/redis.py +++ b/creolefuncs/redis.py @@ -6,3 +6,6 @@ # def add(num1, num2): return str(int(num1) + int(num2)).decode("utf-8") + +def intAdd(num1, num2): + return int(num1) + int(num2) diff --git a/dicos/90_redis.xml b/dicos/90_redis.xml index c0e40da..2f74723 100644 --- a/dicos/90_redis.xml +++ b/dicos/90_redis.xml @@ -3,12 +3,16 @@ + redis-server + redis2-server redisPort redisClPort - redis-server + redisPortSlave + redisClPortSlave + redis-server rdClIP @@ -24,10 +28,15 @@ Local - + + non + + + + 6379 - + 512 @@ -37,6 +46,23 @@ 60 + + + + + 6379 + + + + 512 + + + noeviction + + + 60 + + @@ -46,11 +72,23 @@ - + + 6379 + - + + + non + + + + +