Skip to content

Commit 18e6158

Browse files
authored
Merge 4782b32 into 5733cd6
2 parents 5733cd6 + 4782b32 commit 18e6158

12 files changed

Lines changed: 1448 additions & 1354 deletions

Makefile

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,50 @@ cluster-enabled yes
274274
cluster-config-file /tmp/redis_cluster_node5.conf
275275
endef
276276

277+
# STABLE CLUSTER REDIS NODES
278+
# The structure of this cluster is not changed by the tests!
279+
define REDIS_STABLE_CLUSTER_NODE1_CONF
280+
daemonize yes
281+
protected-mode no
282+
requirepass cluster
283+
port 7479
284+
cluster-node-timeout 15000
285+
pidfile /tmp/redis_stable_cluster_node1.pid
286+
logfile /tmp/redis_stable_cluster_node1.log
287+
save ""
288+
appendonly no
289+
cluster-enabled yes
290+
cluster-config-file /tmp/redis_stable_cluster_node1.conf
291+
endef
292+
293+
define REDIS_STABLE_CLUSTER_NODE2_CONF
294+
daemonize yes
295+
protected-mode no
296+
requirepass cluster
297+
port 7480
298+
cluster-node-timeout 15000
299+
pidfile /tmp/redis_stable_cluster_node2.pid
300+
logfile /tmp/redis_stable_cluster_node2.log
301+
save ""
302+
appendonly no
303+
cluster-enabled yes
304+
cluster-config-file /tmp/redis_stable_cluster_node2.conf
305+
endef
306+
307+
define REDIS_STABLE_CLUSTER_NODE3_CONF
308+
daemonize yes
309+
protected-mode no
310+
requirepass cluster
311+
port 7481
312+
cluster-node-timeout 15000
313+
pidfile /tmp/redis_stable_cluster_node3.pid
314+
logfile /tmp/redis_stable_cluster_node3.log
315+
save ""
316+
appendonly no
317+
cluster-enabled yes
318+
cluster-config-file /tmp/redis_stable_cluster_node3.conf
319+
endef
320+
277321
# UDS REDIS NODES
278322
define REDIS_UDS
279323
daemonize yes
@@ -355,6 +399,9 @@ export REDIS_CLUSTER_NODE2_CONF
355399
export REDIS_CLUSTER_NODE3_CONF
356400
export REDIS_CLUSTER_NODE4_CONF
357401
export REDIS_CLUSTER_NODE5_CONF
402+
export REDIS_STABLE_CLUSTER_NODE1_CONF
403+
export REDIS_STABLE_CLUSTER_NODE2_CONF
404+
export REDIS_STABLE_CLUSTER_NODE3_CONF
358405
export REDIS_UDS
359406
export REDIS_UNAVAILABLE_CONF
360407
export STUNNEL_CONF
@@ -393,8 +440,12 @@ start: stunnel cleanup
393440
echo "$$REDIS_CLUSTER_NODE3_CONF" | redis-server -
394441
echo "$$REDIS_CLUSTER_NODE4_CONF" | redis-server -
395442
echo "$$REDIS_CLUSTER_NODE5_CONF" | redis-server -
443+
echo "$$REDIS_STABLE_CLUSTER_NODE1_CONF" | redis-server -
444+
echo "$$REDIS_STABLE_CLUSTER_NODE2_CONF" | redis-server -
445+
echo "$$REDIS_STABLE_CLUSTER_NODE3_CONF" | redis-server -
396446
echo "$$REDIS_UDS" | redis-server -
397447
echo "$$REDIS_UNAVAILABLE_CONF" | redis-server -
448+
redis-cli -a cluster --cluster create 127.0.0.1:7479 127.0.0.1:7480 127.0.0.1:7481 --cluster-yes
398449

399450
cleanup:
400451
- rm -vf /tmp/redis_cluster_node*.conf 2>/dev/null
@@ -426,6 +477,9 @@ stop:
426477
kill `cat /tmp/redis_cluster_node3.pid` || true
427478
kill `cat /tmp/redis_cluster_node4.pid` || true
428479
kill `cat /tmp/redis_cluster_node5.pid` || true
480+
kill `cat /tmp/redis_stable_cluster_node1.pid`
481+
kill `cat /tmp/redis_stable_cluster_node2.pid`
482+
kill `cat /tmp/redis_stable_cluster_node3.pid`
429483
kill `cat /tmp/redis_uds.pid` || true
430484
kill `cat /tmp/stunnel.pid` || true
431485
[ -f /tmp/redis_unavailable.pid ] && kill `cat /tmp/redis_unavailable.pid` || true
@@ -439,6 +493,9 @@ stop:
439493
rm -f /tmp/redis_cluster_node3.conf
440494
rm -f /tmp/redis_cluster_node4.conf
441495
rm -f /tmp/redis_cluster_node5.conf
496+
rm -f /tmp/redis_stable_cluster_node1.conf
497+
rm -f /tmp/redis_stable_cluster_node2.conf
498+
rm -f /tmp/redis_stable_cluster_node3.conf
442499

443500
test: compile-module start
444501
sleep 2

src/test/java/redis/clients/jedis/HostAndPorts.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ public final class HostAndPorts {
88
private static List<HostAndPort> redisHostAndPortList = new ArrayList<>();
99
private static List<HostAndPort> sentinelHostAndPortList = new ArrayList<>();
1010
private static List<HostAndPort> clusterHostAndPortList = new ArrayList<>();
11+
private static List<HostAndPort> stableClusterHostAndPortList = new ArrayList<>();
1112

1213
static {
1314
redisHostAndPortList.add(new HostAndPort("localhost", Protocol.DEFAULT_PORT));
@@ -34,6 +35,10 @@ public final class HostAndPorts {
3435
clusterHostAndPortList.add(new HostAndPort("localhost", 7382));
3536
clusterHostAndPortList.add(new HostAndPort("localhost", 7383));
3637
clusterHostAndPortList.add(new HostAndPort("localhost", 7384));
38+
39+
stableClusterHostAndPortList.add(new HostAndPort("localhost", 7479));
40+
stableClusterHostAndPortList.add(new HostAndPort("localhost", 7480));
41+
stableClusterHostAndPortList.add(new HostAndPort("localhost", 7481));
3742
}
3843

3944
public static List<HostAndPort> parseHosts(String envHosts,
@@ -71,6 +76,10 @@ public static List<HostAndPort> getClusterServers() {
7176
return clusterHostAndPortList;
7277
}
7378

79+
public static List<HostAndPort> getStableClusterServers() {
80+
return stableClusterHostAndPortList;
81+
}
82+
7483
private HostAndPorts() {
7584
throw new InstantiationError("Must not instantiate this class");
7685
}

0 commit comments

Comments
 (0)