Skip to content

Commit f40d761

Browse files
committed
add ring redis servers
1 parent f19f65b commit f40d761

File tree

2 files changed

+71
-15
lines changed

2 files changed

+71
-15
lines changed

docker-compose.yml

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22

33
services:
4-
54
redis:
65
image: ${CLIENT_LIBS_TEST_IMAGE:-redislabs/client-libs-test:7.4.1}
76
container_name: redis-standalone
@@ -84,6 +83,63 @@ services:
8483
volumes:
8584
- "./dockers/sentinel.conf:/redis.conf"
8685
profiles:
86+
- sentinel
87+
- all-stack
88+
- all
89+
90+
redisRing1:
91+
image: ${CLIENT_LIBS_TEST_IMAGE:-redislabs/client-libs-test:7.4.1}
92+
container_name: redis-ring-1
93+
environment:
94+
- TLS_ENABLED=yes
95+
- REDIS_CLUSTER=no
96+
- PORT=6390
97+
command: ${REDIS_EXTRA_ARGS:---enable-debug-command yes --enable-module-command yes --tls-auth-clients optional --save ""}
98+
ports:
99+
- 6390:6390
100+
volumes:
101+
- "./dockers/ring1:/redis/work"
102+
profiles:
103+
- ring
104+
- cluster
105+
- sentinel
106+
- all-stack
107+
- all
108+
109+
redisRing2:
110+
image: ${CLIENT_LIBS_TEST_IMAGE:-redislabs/client-libs-test:7.4.1}
111+
container_name: redis-ring-2
112+
environment:
113+
- TLS_ENABLED=yes
114+
- REDIS_CLUSTER=no
115+
- PORT=6391
116+
command: ${REDIS_EXTRA_ARGS:---enable-debug-command yes --enable-module-command yes --tls-auth-clients optional --save ""}
117+
ports:
118+
- 6391:6391
119+
volumes:
120+
- "./dockers/ring2:/redis/work"
121+
profiles:
122+
- ring
123+
- cluster
124+
- sentinel
125+
- all-stack
126+
- all
127+
128+
redisRing3:
129+
image: ${CLIENT_LIBS_TEST_IMAGE:-redislabs/client-libs-test:7.4.1}
130+
container_name: redis-ring-3
131+
environment:
132+
- TLS_ENABLED=yes
133+
- REDIS_CLUSTER=no
134+
- PORT=6392
135+
command: ${REDIS_EXTRA_ARGS:---enable-debug-command yes --enable-module-command yes --tls-auth-clients optional --save ""}
136+
ports:
137+
- 6392:6392
138+
volumes:
139+
- "./dockers/ring3:/redis/work"
140+
profiles:
141+
- ring
142+
- cluster
87143
- sentinel
88144
- all-stack
89145
- all

osscluster_test.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -730,30 +730,30 @@ var _ = Describe("ClusterClient", func() {
730730
End: 4999,
731731
Nodes: []redis.ClusterNode{{
732732
ID: "",
733-
Addr: "127.0.0.1:8220",
733+
Addr: "127.0.0.1:16379",
734734
}, {
735735
ID: "",
736-
Addr: "127.0.0.1:8223",
736+
Addr: "127.0.0.1:16382",
737737
}},
738738
}, {
739739
Start: 5000,
740740
End: 9999,
741741
Nodes: []redis.ClusterNode{{
742742
ID: "",
743-
Addr: "127.0.0.1:8221",
743+
Addr: "127.0.0.1:16380",
744744
}, {
745745
ID: "",
746-
Addr: "127.0.0.1:8224",
746+
Addr: "127.0.0.1:16383",
747747
}},
748748
}, {
749749
Start: 10000,
750750
End: 16383,
751751
Nodes: []redis.ClusterNode{{
752752
ID: "",
753-
Addr: "127.0.0.1:8222",
753+
Addr: "127.0.0.1:16381",
754754
}, {
755755
ID: "",
756-
Addr: "127.0.0.1:8225",
756+
Addr: "127.0.0.1:16384",
757757
}},
758758
}}
759759
Expect(assertSlotsEqual(res, wanted)).NotTo(HaveOccurred())
@@ -1122,14 +1122,14 @@ var _ = Describe("ClusterClient", func() {
11221122
client, err := client.SlaveForKey(ctx, "test")
11231123
Expect(err).ToNot(HaveOccurred())
11241124
info := client.Info(ctx, "server")
1125-
Expect(info.Val()).Should(ContainSubstring("tcp_port:8224"))
1125+
Expect(info.Val()).Should(ContainSubstring("tcp_port:16383"))
11261126
})
11271127

11281128
It("should return correct master for key", func() {
11291129
client, err := client.MasterForKey(ctx, "test")
11301130
Expect(err).ToNot(HaveOccurred())
11311131
info := client.Info(ctx, "server")
1132-
Expect(info.Val()).Should(ContainSubstring("tcp_port:8221"))
1132+
Expect(info.Val()).Should(ContainSubstring("tcp_port:16380"))
11331133
})
11341134

11351135
assertClusterClient()
@@ -1286,25 +1286,25 @@ var _ = Describe("ClusterClient", func() {
12861286
Start: 0,
12871287
End: 4999,
12881288
Nodes: []redis.ClusterNode{{
1289-
Addr: ":8220",
1289+
Addr: ":16379",
12901290
}, {
1291-
Addr: ":8223",
1291+
Addr: ":16382",
12921292
}},
12931293
}, {
12941294
Start: 5000,
12951295
End: 9999,
12961296
Nodes: []redis.ClusterNode{{
1297-
Addr: ":8221",
1297+
Addr: ":16380",
12981298
}, {
1299-
Addr: ":8224",
1299+
Addr: ":16383",
13001300
}},
13011301
}, {
13021302
Start: 10000,
13031303
End: 16383,
13041304
Nodes: []redis.ClusterNode{{
1305-
Addr: ":8222",
1305+
Addr: ":16381",
13061306
}, {
1307-
Addr: ":8225",
1307+
Addr: ":16384",
13081308
}},
13091309
}}
13101310
return slots, nil

0 commit comments

Comments
 (0)