Skip to content

Commit d9ce190

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

File tree

2 files changed

+72
-15
lines changed

2 files changed

+72
-15
lines changed

docker-compose.yml

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,61 @@ services:
8686
profiles:
8787
- sentinel
8888
- all-stack
89-
- all
89+
- all
90+
91+
redisRing1:
92+
image: ${CLIENT_LIBS_TEST_IMAGE:-redislabs/client-libs-test:7.4.1}
93+
container_name: redis-ring-1
94+
environment:
95+
- TLS_ENABLED=yes
96+
- REDIS_CLUSTER=no
97+
- PORT=6390
98+
command: ${REDIS_EXTRA_ARGS:---enable-debug-command yes --enable-module-command yes --tls-auth-clients optional --save ""}
99+
ports:
100+
- 6390:6390
101+
volumes:
102+
- "./dockers/ring1:/redis/work"
103+
profiles:
104+
- ring
105+
- cluster
106+
- sentinel
107+
- all-stack
108+
- all
109+
110+
redisRing2:
111+
image: ${CLIENT_LIBS_TEST_IMAGE:-redislabs/client-libs-test:7.4.1}
112+
container_name: redis-ring-2
113+
environment:
114+
- TLS_ENABLED=yes
115+
- REDIS_CLUSTER=no
116+
- PORT=6391
117+
command: ${REDIS_EXTRA_ARGS:---enable-debug-command yes --enable-module-command yes --tls-auth-clients optional --save ""}
118+
ports:
119+
- 6391:6391
120+
volumes:
121+
- "./dockers/ring2:/redis/work"
122+
profiles:
123+
- ring
124+
- cluster
125+
- sentinel
126+
- all-stack
127+
- all
128+
129+
redisRing3:
130+
image: ${CLIENT_LIBS_TEST_IMAGE:-redislabs/client-libs-test:7.4.1}
131+
container_name: redis-ring-3
132+
environment:
133+
- TLS_ENABLED=yes
134+
- REDIS_CLUSTER=no
135+
- PORT=6392
136+
command: ${REDIS_EXTRA_ARGS:---enable-debug-command yes --enable-module-command yes --tls-auth-clients optional --save ""}
137+
ports:
138+
- 6392:6392
139+
volumes:
140+
- "./dockers/ring3:/redis/work"
141+
profiles:
142+
- ring
143+
- cluster
144+
- sentinel
145+
- all-stack
146+
- 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)