change makefile to accept "start" and "stop" to be able to start the testing environment and stopping it for manual testing purposes.
raising down-after-milliseconds of sentinel 1 to avoid taking the master down and up all the time. change sleep to 10 seconds after doing a "salveof" to avoid false negatives.
This commit is contained in:
21
Makefile
21
Makefile
@@ -33,7 +33,7 @@ port 26379
|
||||
daemonize yes
|
||||
sentinel monitor mymaster 127.0.0.1 6379 1
|
||||
sentinel auth-pass mymaster foobared
|
||||
sentinel down-after-milliseconds mymaster 1000
|
||||
sentinel down-after-milliseconds mymaster 3000
|
||||
sentinel failover-timeout mymaster 900000
|
||||
sentinel can-failover mymaster yes
|
||||
sentinel parallel-syncs mymaster 1
|
||||
@@ -73,6 +73,25 @@ export REDIS_SENTINEL1
|
||||
export REDIS_SENTINEL2
|
||||
export REDIS_SENTINEL3
|
||||
|
||||
start:
|
||||
echo "$$REDIS1_CONF" | redis-server -
|
||||
echo "$$REDIS2_CONF" | redis-server -
|
||||
echo "$$REDIS3_CONF" | redis-server -
|
||||
echo "$$REDIS4_CONF" | redis-server -
|
||||
echo "$$REDIS_SENTINEL1" | redis-sentinel -
|
||||
echo "$$REDIS_SENTINEL2" | redis-sentinel -
|
||||
echo "$$REDIS_SENTINEL3" | redis-sentinel -
|
||||
|
||||
stop:
|
||||
kill `cat /tmp/redis1.pid`
|
||||
kill `cat /tmp/redis2.pid`
|
||||
# this get's segfaulted by the tests
|
||||
kill `cat /tmp/redis3.pid` || true
|
||||
kill `cat /tmp/redis4.pid`
|
||||
kill `cat /tmp/sentinel1.pid`
|
||||
kill `cat /tmp/sentinel2.pid`
|
||||
kill `cat /tmp/sentinel3.pid`
|
||||
|
||||
test:
|
||||
echo "$$REDIS1_CONF" | redis-server -
|
||||
echo "$$REDIS2_CONF" | redis-server -
|
||||
|
||||
@@ -25,7 +25,7 @@ public class JedisSentinelTest {
|
||||
// TODO: The sleep is to give time to the slave to synchronize with the
|
||||
// master and also let know the sentinels about this new topology. We
|
||||
// should find a better way to do this.
|
||||
Thread.sleep(5000);
|
||||
Thread.sleep(10000);
|
||||
}
|
||||
|
||||
@After
|
||||
|
||||
Reference in New Issue
Block a user