From a7352f5612f77a75cccd223a70d95165887ba99f Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Wed, 19 Sep 2018 12:07:54 +0200 Subject: [PATCH] DATAREDIS-869 - Use changed nomenclature in documentation and readme. Original Pull Request: #355 --- Makefile | 2 +- README.md | 4 ++-- src/main/asciidoc/new-features.adoc | 2 +- src/main/asciidoc/reference/redis-cluster.adoc | 8 ++++---- src/main/asciidoc/reference/redis.adoc | 10 +++++----- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 13d7e6558..cda10c460 100644 --- a/Makefile +++ b/Makefile @@ -105,7 +105,7 @@ cluster-start: work/cluster-7379.pid work/cluster-7380.pid work/cluster-7381.pid work/meet-%: -work/redis/bin/redis-cli -p $* cluster meet 127.0.0.1 7379 -# Handled separately because this node is a slave +# Handled separately because this node is a replica work/meet-7382: -work/redis/bin/redis-cli -p 7382 cluster meet 127.0.0.1 7379 sleep 2 diff --git a/README.md b/README.md index 3901e51cf..6a33445c0 100644 --- a/README.md +++ b/README.md @@ -104,8 +104,8 @@ Running the tests requires you to have a RedisServer running at its default port You can alternatively use the provided `Makefile` which runs the build plus downloads and spins up the following environment: * 1 Single Node -* HA Redis (1 Master, 2 Slaves, 3 Sentinels). -* Redis Cluster (3 Masters, 1 Slave) +* HA Redis (1 Master, 2 Replicas, 3 Sentinels). +* Redis Cluster (3 Masters, 1 Replica) ```bash make test diff --git a/src/main/asciidoc/new-features.adoc b/src/main/asciidoc/new-features.adoc index 8bad4f155..d349f4717 100644 --- a/src/main/asciidoc/new-features.adoc +++ b/src/main/asciidoc/new-features.adoc @@ -7,7 +7,7 @@ This section briefly covers items that are new and noteworthy in the latest rele == New in Spring Data Redis 2.1 * Unix domain socket connections using <>. -* <> support using Lettuce. +* <> support using Lettuce. * <> integration. * `@TypeAlias` Support for Redis repositories. * Cluster-wide `SCAN` using Lettuce and `SCAN` execution on a selected node supported by both drivers. diff --git a/src/main/asciidoc/reference/redis-cluster.adoc b/src/main/asciidoc/reference/redis-cluster.adoc index 04f30f618..7406d17d0 100644 --- a/src/main/asciidoc/reference/redis-cluster.adoc +++ b/src/main/asciidoc/reference/redis-cluster.adoc @@ -67,7 +67,7 @@ NOTE: The initial configuration points driver libraries to an initial set of clu == Working With Redis Cluster Connection -As mentioned earlier, Redis Cluster behaves differently from single-node Redis or even a Sentinel-monitored master-slave environment. This is because the automatic sharding maps a key to one of 16384 slots, which are distributed across the nodes. Therefore, commands that involve more than one key must assert all keys map to the exact same slot to avoid cross-slot execution errors. +As mentioned earlier, Redis Cluster behaves differently from single-node Redis or even a Sentinel-monitored master-replica environment. This is because the automatic sharding maps a key to one of 16384 slots, which are distributed across the nodes. Therefore, commands that involve more than one key must assert all keys map to the exact same slot to avoid cross-slot execution errors. A single cluster node serves only a dedicated set of keys. Commands issued against one particular server return results only for those keys served by that server. As a simple example, consider the `KEYS` command. When issued to a server in a cluster environment, it returns only the keys served by the node the request is sent to and not necessarily all keys within the cluster. So, to get all keys in a cluster environment, you must read the keys from all the known master nodes. While redirects for specific keys to the corresponding slot-serving node are handled by the driver libraries, higher-level functions, such as collecting information across nodes or sending commands to all nodes in the cluster, are covered by `RedisClusterConnection`. Picking up the keys example from earlier, this means that the `keys(pattern)` method picks up every master node in the cluster and simultaneously executes the `KEYS` command on every master node while picking up the results and returning the cumulated set of keys. To just request the keys of a single node `RedisClusterConnection` provides overloads for those methods (for example, `keys(node, pattern)`). @@ -102,10 +102,10 @@ connection.keys(NODE_7380, "*"); < connection.keys(NODE_7381, "*"); <10> connection.keys(NODE_7382, "*"); <11> ---- -<1> Master node serving slots 0 to 5460 replicated to slave at 7382 +<1> Master node serving slots 0 to 5460 replicated to replica at 7382 <2> Master node serving slots 5461 to 10922 <3> Master node serving slots 10923 to 16383 -<4> Slave node holding replicants of the master at 7379 +<4> Replica node holding replicants of the master at 7379 <5> Request routed to node at 7381 serving slot 12182 <6> Request routed to node at 7379 serving slot 5061 <7> Request routed to nodes at 7379, 7380, 7381 -> [thing1, thing2] @@ -166,5 +166,5 @@ The following example shows how to access `RedisClusterConnection` with `RedisTe ClusterOperations clusterOps = redisTemplate.opsForCluster(); clusterOps.shutdown(NODE_7379); <1> ---- -<1> Shut down node at 7379 and cross fingers there is a slave in place that can take over. +<1> Shut down node at 7379 and cross fingers there is a replica in place that can take over. ==== diff --git a/src/main/asciidoc/reference/redis.adoc b/src/main/asciidoc/reference/redis.adoc index f5bd97d90..19c159e5b 100644 --- a/src/main/asciidoc/reference/redis.adoc +++ b/src/main/asciidoc/reference/redis.adoc @@ -109,15 +109,15 @@ class RedisConfiguration { } ---- -[[redis:write-to-master-read-from-slave]] -=== Write to Master, Read from Slave +[[redis:write-to-master-read-from-replica]] +=== Write to Master, Read from Replica -The Redis Master/Slave setup -- without automatic failover (for automatic failover see: <>) -- not only allows data to be safely stored at more nodes. It also allows, by using <>, reading data from slaves while pushing writes to the master. You can set the read/write strategy to be used by using `LettuceClientConfiguration`, as shown in the following example: +The Redis Master/Replica setup -- without automatic failover (for automatic failover see: <>) -- not only allows data to be safely stored at more nodes. It also allows, by using <>, reading data from replicas while pushing writes to the master. You can set the read/write strategy to be used by using `LettuceClientConfiguration`, as shown in the following example: [source,java] ---- @Configuration -class WriteToMasterReadFromSlaveConfiguration { +class WriteToMasterReadFromReplicaConfiguration { @Bean public LettuceConnectionFactory redisConnectionFactory() { @@ -133,7 +133,7 @@ class WriteToMasterReadFromSlaveConfiguration { } ---- -TIP: For environments reporting non-public addresses through the `INFO` command (for example, when using AWS), use `RedisStaticMasterSlaveConfiguration` instead of `RedisStandaloneConfiguration`. +TIP: For environments reporting non-public addresses through the `INFO` command (for example, when using AWS), use `RedisStaticMasterReplicaConfiguration` instead of `RedisStandaloneConfiguration`. [[redis:sentinel]] == Redis Sentinel Support