Skip to content

Commit 095fa9c

Browse files
author
李金松
committed
Implemented read-write separation based on JedisSentineled
1 parent cd33977 commit 095fa9c

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

src/main/java/redis/clients/jedis/Protocol.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public final class Protocol {
2323

2424
public static final String DEFAULT_HOST = "127.0.0.1";
2525
public static final int DEFAULT_PORT = 6379;
26-
public static final int DEFAULT_SENTINEL_PORT = 26378;
26+
public static final int DEFAULT_SENTINEL_PORT = 26379;
2727
public static final int DEFAULT_TIMEOUT = 2000;
2828
public static final int DEFAULT_DATABASE = 0;
2929
public static final int CLUSTER_HASHSLOTS = 16384;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ public final class HostAndPorts {
2121
}
2222

2323
sentinelHostAndPortList.add(new HostAndPort("localhost", Protocol.DEFAULT_SENTINEL_PORT));
24-
sentinelHostAndPortList.add(new HostAndPort("10.148.17.43", Protocol.DEFAULT_SENTINEL_PORT + 1));
24+
sentinelHostAndPortList.add(new HostAndPort("localhost", Protocol.DEFAULT_SENTINEL_PORT + 1));
2525
sentinelHostAndPortList.add(new HostAndPort("localhost", Protocol.DEFAULT_SENTINEL_PORT + 2));
26-
sentinelHostAndPortList.add(new HostAndPort("10.148.17.43", Protocol.DEFAULT_SENTINEL_PORT + 3));
26+
sentinelHostAndPortList.add(new HostAndPort("localhost", Protocol.DEFAULT_SENTINEL_PORT + 3));
2727
sentinelHostAndPortList.add(new HostAndPort("localhost", Protocol.DEFAULT_SENTINEL_PORT + 4));
2828

2929
clusterHostAndPortList.add(new HostAndPort("localhost", 7379));

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ public class SentineledConnectionProviderTest {
3333
protected static final HostAndPort sentinel2 = HostAndPorts.getSentinelServers().get(3);
3434

3535
protected Set<HostAndPort> sentinels = new HashSet<>();
36-
// protected String password = "foobared";
37-
protected String password = "0a2eb141353cf115";
36+
protected String password = "foobared";
3837

3938
@BeforeEach
4039
public void setUp() throws Exception {

0 commit comments

Comments
 (0)