url
stringlengths 38
157
| content
stringlengths 72
15.1M
|
---|---|
https://redis.io/docs/latest/integrate/redisvl/.html | <section class="prose w-full py-12 max-w-none">
<h1>
RedisVL
</h1>
<p class="text-lg -mt-5 mb-10">
This is the Redis vector library.
</p>
<nav>
<a href="/docs/latest/integrate/redisvl/overview/">
RedisVL Overview
</a>
<p>
An overview of RedisVL
</p>
<a href="/docs/latest/integrate/redisvl/user-guide/">
RedisVL user guide
</a>
<p>
The RedisVL user guide
</p>
<a href="/docs/latest/integrate/redisvl/api/">
API Guide
</a>
<p>
The RedisVL API guide
</p>
</nav>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/integrate/redisvl/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/clusters/add-node/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Add a node
</h1>
<p class="text-lg -mt-5 mb-10">
Add a node to your existing Redis Enterprise cluster.
</p>
<p>
When you install Redis Enterprise Software on the first node of a cluster, you create the new cluster.
After you install the first node, you can add more nodes to the cluster.
</p>
<h2 id="prerequisites">
Prerequisites
</h2>
<p>
Before you add a node to the cluster:
</p>
<ul>
<li>
<p>
The clocks on all nodes must always be
<a href="/docs/latest/operate/rs/clusters/configure/sync-clocks/">
synchronized
</a>
.
</p>
<p>
If the clock in the node you are trying to join to the cluster is not synchronized with the nodes already in the cluster,
the action fails and an error message is shown indicating that you must synchronize the clocks first.
</p>
</li>
<li>
<p>
You must
<a href="/docs/latest/operate/rs/networking/cluster-dns/">
update the DNS records
</a>
each time a node is added or replaced.
</p>
</li>
<li>
<p>
We recommend that you add nodes one after the other rather than in parallel
to avoid errors that occur because the connection to the other nodes in the cluster cannot be verified.
</p>
</li>
</ul>
<h2 id="add-node">
Add node
</h2>
<p>
To add a node to an existing cluster:
</p>
<ol>
<li>
<p>
<a href="/docs/latest/operate/rs/installing-upgrading/">
Install the Redis Enterprise Software installation package
</a>
on a clean installation
of a
<a href="/docs/latest/operate/rs/installing-upgrading/install/plan-deployment/supported-platforms/">
supported operating system
</a>
.
</p>
</li>
<li>
<p>
To connect to the Cluster Manager UI of the new Redis Enterprise Software installation, go to: <https://URL or IP address:8443>
</p>
<p>
For example, if you installed Redis Enterprise Software on a machine with IP addressΒ 10.0.1.34, go to
<code>
https://10.0.1.34:8443
</code>
.
</p>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Tip:
</div>
TheΒ management UI uses TLS encryption with a default certificate.
You can also
<a href="/docs/latest/operate/rs/security/certificates/updating-certificates/">
replace the TLS certificate
</a>
with a custom certificate.
</div>
</div>
</li>
<li>
<p>
Select
<strong>
Join cluster
</strong>
.
</p>
</li>
<li>
<p>
For
<strong>
Cluster identification
</strong>
, enter the internal IP address or DNS name of a node that is a cluster member.
</p>
<p>
If the node only has one IP address, enter that IP address.
</p>
</li>
<li>
<p>
For
<strong>
Cluster sign in
</strong>
, enter the credentials of the cluster administrator.
</p>
<p>
The cluster administrator is the user account that you create when you configure the first node in the cluster.
</p>
</li>
<li>
<p>
Click
<strong>
Next
</strong>
.
</p>
</li>
<li>
<p>
Configure storage and network settings:
</p>
<ol>
<li>
<p>
Enter a path for
<a href="/docs/latest/operate/rs/installing-upgrading/install/plan-deployment/persistent-ephemeral-storage/">
<em>
Ephemeral storage
</em>
</a>
, or leave the default path.
</p>
</li>
<li>
<p>
Enter a path for
<a href="/docs/latest/operate/rs/installing-upgrading/install/plan-deployment/persistent-ephemeral-storage/">
<em>
Persistent storage
</em>
</a>
,
or leave the default path.
</p>
</li>
<li>
<p>
To enable
<a href="/docs/latest/operate/rs/databases/auto-tiering/">
<em>
Auto Tiering
</em>
</a>
,
select
<strong>
Enable flash storage
</strong>
and enter the path to the flash storage.
</p>
</li>
<li>
<p>
If the cluster is configured to support
<a href="/docs/latest/operate/rs/clusters/configure/rack-zone-awareness/">
rack-zone awareness
</a>
, set the
<strong>
Rack-zone ID
</strong>
for the new node.
</p>
</li>
<li>
<p>
If your machine has multiple IP addresses, assign a single IPv4 type address for
<strong>
Node-to-node communication (internal traffic)
</strong>
and multiple IPv4/IPv6 type addresses for
<strong>
External traffic
</strong>
.
</p>
</li>
</ol>
</li>
<li>
<p>
Select
<strong>
Join cluster
</strong>
.
</p>
</li>
</ol>
<p>
The node is added to the cluster.
You can see it in the list of nodes in the cluster.
</p>
<p>
If you see an error when you add the node, try adding the node again.
</p>
<h2 id="verify-node">
Verify node
</h2>
<p>
We recommend that you verify the node is functioning properly using one of the following methods:
</p>
<ul>
<li>
<p>
Cluster Manager UI method:
</p>
<ol>
<li>
<p>
On the
<strong>
Nodes
</strong>
screen, click
<a href="/docs/latest/images/rs/buttons/button-toggle-actions-vertical.png#no-click" sdata-lightbox="/images/rs/buttons/button-toggle-actions-vertical.png#no-click">
<img alt="More actions button" class="inline" src="/docs/latest/images/rs/buttons/button-toggle-actions-vertical.png#no-click" width="22px"/>
</a>
for the node you want to verify.
</p>
</li>
<li>
<p>
Select
<strong>
Verify node
</strong>
from the list.
</p>
</li>
</ol>
<a href="/docs/latest/images/rs/screenshots/nodes/secondary-nodes-more-actions.png" sdata-lightbox="/images/rs/screenshots/nodes/secondary-nodes-more-actions.png">
<img alt="Click the more actions button for a node to access node actions." src="/docs/latest/images/rs/screenshots/nodes/secondary-nodes-more-actions.png"/>
</a>
</li>
<li>
<p>
Command-line method:
</p>
<p>
Run the
<a href="/docs/latest/operate/rs/references/cli-utilities/rlcheck/">
<code>
rlcheck
</code>
</a>
utility from the node's command line.
</p>
</li>
</ul>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/clusters/add-node/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/develop/data-types/probabilistic/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Probabilistic
</h1>
<p class="text-lg -mt-5 mb-10">
Probabilistic data structures in Redis
</p>
<p>
<em>
Probabilistic data structures
</em>
give approximations of statistics such as
counts, frequencies, and rankings rather than precise values.
The advantage of using approximations is that they are adequate for
many common purposes but are much more efficient to calculate. They
sometimes have other advantages too, such as obfuscating times, locations,
and other sensitive data.
</p>
<p>
Probabilistic data structures are not available by default in the basic
Redis server, so you should install Redis Stack or Redis Enterprise,
both of which include probabilistic structures and other useful modules.
See
<a href="/docs/latest/operate/oss_and_stack/install/install-stack/">
Install Redis Stack
</a>
or
<a href="/docs/latest/operate/rs/installing-upgrading/install/">
Install Redis Enterprise
</a>
for full installation instructions.
</p>
<nav>
<a href="/docs/latest/develop/data-types/probabilistic/hyperloglogs/">
HyperLogLog
</a>
<p>
HyperLogLog is a probabilistic data structure that estimates the cardinality of a set.
</p>
<a href="/docs/latest/develop/data-types/probabilistic/bloom-filter/">
Bloom filter
</a>
<p>
Bloom filters are a probabilistic data structure that checks for presence of an element in a set
</p>
<a href="/docs/latest/develop/data-types/probabilistic/cuckoo-filter/">
Cuckoo filter
</a>
<p>
Cuckoo filters are a probabilistic data structure that checks for presence of an element in a set
</p>
<a href="/docs/latest/develop/data-types/probabilistic/t-digest/">
t-digest
</a>
<p>
t-digest is a probabilistic data structure that allows you to estimate the percentile of a data stream.
</p>
<a href="/docs/latest/develop/data-types/probabilistic/top-k/">
Top-K
</a>
<p>
Top-K is a probabilistic data structure that allows you to find the most frequent items in a data stream.
</p>
<a href="/docs/latest/develop/data-types/probabilistic/count-min-sketch/">
Count-min sketch
</a>
<p>
Count-min sketch is a probabilistic data structure that estimates the frequency of an element in a data stream.
</p>
<a href="/docs/latest/develop/data-types/probabilistic/configuration/">
Configuration Parameters
</a>
<p>
RedisBloom supports multiple module configuration parameters. All of these parameters can only be set at load-time.
</p>
</nav>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/develop/data-types/probabilistic/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/commands/json.numincrby/.html | <section class="prose w-full py-12">
<h1 class="command-name">
JSON.NUMINCRBY
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">JSON.NUMINCRBY key path value</pre>
<dl class="grid grid-cols-[auto,1fr] gap-2 mb-12">
<dt class="font-semibold text-redis-ink-900 m-0">
Available in:
</dt>
<dd class="m-0">
<a href="/docs/stack">
Redis Stack
</a>
/
<a href="/docs/data-types/json">
JSON 1.0.0
</a>
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
Time complexity:
</dt>
<dd class="m-0">
O(1) when path is evaluated to a single value, O(N) when path is evaluated to multiple values, where N is the size of the key
</dd>
</dl>
<p>
Increment the number value stored at
<code>
path
</code>
by
<code>
number
</code>
</p>
<p>
<a href="#examples">
Examples
</a>
</p>
<h2 id="required-arguments">
Required arguments
</h2>
<details open="">
<summary>
<code>
key
</code>
</summary>
<p>
is key to modify.
</p>
</details>
<details open="">
<summary>
<code>
path
</code>
</summary>
<p>
is JSONPath to specify.
</p>
</details>
<details open="">
<summary>
<code>
value
</code>
</summary>
<p>
is number value to increment.
</p>
</details>
<h2 id="return">
Return
</h2>
<p>
JSON.NUMINCRBY returns a bulk string reply specified as a stringified new value for each path, or
<code>
nil
</code>
, if the matching JSON value is not a number.
For more information about replies, see
<a href="/docs/latest/develop/reference/protocol-spec/">
Redis serialization protocol specification
</a>
.
</p>
<h2 id="examples">
Examples
</h2>
<details open="">
<summary>
<b>
Increment number values
</b>
</summary>
<p>
Create a document.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis> JSON.SET doc . <span class="s1">'{"a":"b","b":[{"a":2}, {"a":5}, {"a":"c"}]}'</span>
</span></span><span class="line"><span class="cl">OK</span></span></code></pre>
</div>
<p>
Increment a value of
<code>
a
</code>
object by 2. The command fails to find a number and returns
<code>
null
</code>
.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis> JSON.NUMINCRBY doc $.a <span class="m">2</span>
</span></span><span class="line"><span class="cl"><span class="s2">"[null]"</span></span></span></code></pre>
</div>
<p>
Recursively find and increment a value of all
<code>
a
</code>
objects. The command increments numbers it finds and returns
<code>
null
</code>
for nonnumber values.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis> JSON.NUMINCRBY doc $..a <span class="m">2</span>
</span></span><span class="line"><span class="cl"><span class="s2">"[null,4,7,null]"</span></span></span></code></pre>
</div>
</details>
<h2 id="see-also">
See also
</h2>
<p>
<a href="/docs/latest/commands/json.arrindex/">
<code>
JSON.ARRINDEX
</code>
</a>
|
<a href="/docs/latest/commands/json.arrinsert/">
<code>
JSON.ARRINSERT
</code>
</a>
</p>
<h2 id="related-topics">
Related topics
</h2>
<ul>
<li>
<a href="/docs/latest/develop/data-types/json/">
RedisJSON
</a>
</li>
<li>
<a href="/docs/latest/develop/interact/search-and-query/indexing/">
Index and search JSON documents
</a>
</li>
</ul>
<br/>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/json.numincrby/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/recover/.html | <section class="prose w-full py-12 max-w-none">
<h1>
rladmin recover
</h1>
<p class="text-lg -mt-5 mb-10">
Recovers databases in recovery mode.
</p>
<p>
Recovers databases in recovery mode after events such as cluster failure, and restores the databases' configurations and data from stored persistence files. See
<a href="/docs/latest/operate/rs/7.4/databases/recover/">
Recover a failed database
</a>
for detailed instructions.
</p>
<p>
Database persistence files are stored in
<code>
/var/opt/redislabs/persist/redis/
</code>
by default, but you can specify a different directory to use for database recovery with
<a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/node/recovery-path/">
<code>
rladmin node <id> recovery_path set <path>
</code>
</a>
.
</p>
<h2 id="recover-all">
<code>
recover all
</code>
</h2>
<p>
Recovers all databases in recovery mode.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin recover all
</span></span><span class="line"><span class="cl"> <span class="o">[</span> only_configuration <span class="o">]</span>
</span></span></code></pre>
</div>
<h3 id="parameters">
Parameters
</h3>
<table>
<thead>
<tr>
<th>
Parameters
</th>
<th>
Type/Value
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
only_configuration
</td>
<td>
</td>
<td>
Recover database configuration without data
</td>
</tr>
</tbody>
</table>
<h3 id="returns">
Returns
</h3>
<p>
Returns
<code>
Completed successfully
</code>
if the database was recovered. Otherwise, returns an error.
</p>
<h3 id="example">
Example
</h3>
<pre tabindex="0"><code>$ rladmin recover all
0% [ 0 recovered | 0 failed ] | | Elapsed Time: 0:00:00[first-db (db:1) recovery] Initiated.[second-db (db:2) recovery] Initiated.
50% [ 0 recovered | 0 failed ] |### | Elapsed Time: 0:00:04[first-db (db:1) recovery] Completed successfully
75% [ 1 recovered | 0 failed ] |###### | Elapsed Time: 0:00:06[second-db (db:2) recovery] Completed successfully
100% [ 2 recovered | 0 failed ] |#########| Elapsed Time: 0:00:08
</code></pre>
<h2 id="recover-db">
<code>
recover db
</code>
</h2>
<p>
Recovers a specific database in recovery mode.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin recover db <span class="o">{</span> db:<id> <span class="p">|</span> <name> <span class="o">}</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> only_configuration <span class="o">]</span>
</span></span></code></pre>
</div>
<h3 id="parameters-1">
Parameters
</h3>
<table>
<thead>
<tr>
<th>
Parameters
</th>
<th>
Type/Value
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
db
</td>
<td>
db:<id>
<br/>
name
</td>
<td>
Database to recover
</td>
</tr>
<tr>
<td>
only_configuration
</td>
<td>
</td>
<td>
Recover database configuration without data
</td>
</tr>
</tbody>
</table>
<h3 id="returns-1">
Returns
</h3>
<p>
Returns
<code>
Completed successfully
</code>
if the database was recovered. Otherwise, returns an error.
</p>
<h3 id="example-1">
Example
</h3>
<pre tabindex="0"><code>$ rladmin recover db db:1
0% [ 0 recovered | 0 failed ] | | Elapsed Time: 0:00:00[demo-db (db:1) recovery] Initiated.
50% [ 0 recovered | 0 failed ] |### | Elapsed Time: 0:00:00[demo-db (db:1) recovery] Completed successfully
100% [ 1 recovered | 0 failed ] |######| Elapsed Time: 0:00:02
</code></pre>
<h2 id="recover-list">
<code>
recover list
</code>
</h2>
<p>
Shows a list of all databases that are currently in recovery mode.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin recover list
</span></span></code></pre>
</div>
<h3 id="parameters-2">
Parameters
</h3>
<p>
None
</p>
<h3 id="returns-2">
Returns
</h3>
<p>
Displays a list of all recoverable databases. If no databases are in recovery mode, returns
<code>
No recoverable databases found
</code>
.
</p>
<h3 id="example-2">
Example
</h3>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ rladmin recover list
</span></span><span class="line"><span class="cl">DATABASES IN RECOVERY STATE:
</span></span><span class="line"><span class="cl">DB:ID NAME TYPE SHARDS REPLICATION PERSISTENCE STATUS
</span></span><span class="line"><span class="cl">db:5 tr01 redis <span class="m">1</span> enabled aof missing-files
</span></span><span class="line"><span class="cl">db:6 tr02 redis <span class="m">4</span> enabled snapshot ready
</span></span></code></pre>
</div>
<h2 id="recover-s3_import">
<code>
recover s3_import
</code>
</h2>
<p>
Imports current database snapshot files from an AWS S3 bucket to a directory on the node.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin recover s3_import
</span></span><span class="line"><span class="cl"> s3_bucket <bucket name>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> s3_prefix <prefix> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> s3_access_key_id <access key>
</span></span><span class="line"><span class="cl"> s3_secret_access_key <secret access key>
</span></span><span class="line"><span class="cl"> import_path <path>
</span></span></code></pre>
</div>
<h3 id="parameters-3">
Parameters
</h3>
<table>
<thead>
<tr>
<th>
Parameters
</th>
<th>
Type/Value
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
s3_bucket
</td>
<td>
string
</td>
<td>
S3 bucket name
</td>
</tr>
<tr>
<td>
s3_prefix
</td>
<td>
string
</td>
<td>
S3 object prefix
</td>
</tr>
<tr>
<td>
s3_access_key_id
</td>
<td>
string
</td>
<td>
S3 access key ID
</td>
</tr>
<tr>
<td>
s3_secret_access_key
</td>
<td>
string
</td>
<td>
S3 secret access key
</td>
</tr>
<tr>
<td>
import_path
</td>
<td>
filepath
</td>
<td>
Local import path where all database snapshots will be imported
</td>
</tr>
</tbody>
</table>
<h3 id="returns-3">
Returns
</h3>
<p>
Returns
<code>
Completed successfully
</code>
if the database files were imported. Otherwise, returns an error.
</p>
<h3 id="example-3">
Example
</h3>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin recover s3_import s3_bucket <bucket-name> s3_prefix <s3-prefix>/ s3_access_key_id <access-key> s3_secret_access_key <secret-access-key> import_path /tmp
</span></span></code></pre>
</div>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/recover/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/7.4/references/rest-api/objects/ldap/.html | <section class="prose w-full py-12 max-w-none">
<h1>
LDAP object
</h1>
<p class="text-lg -mt-5 mb-10">
An object that contains the cluster's LDAP configuration
</p>
<p>
An API object that represents the cluster's
<a href="/docs/latest/operate/rs/7.4/security/access-control/ldap/">
LDAP
</a>
configuration.
</p>
<table>
<thead>
<tr>
<th>
Name
</th>
<th>
Type/Value
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
bind_dn
</td>
<td>
string
</td>
<td>
DN used when binding with the LDAP server to run queries
</td>
</tr>
<tr>
<td>
bind_pass
</td>
<td>
string
</td>
<td>
Password used when binding with the LDAP server to run queries
</td>
</tr>
<tr>
<td>
ca_cert
</td>
<td>
string
</td>
<td>
PEM-encoded CA certificate(s) used to validate TLS connections to the LDAP server
</td>
</tr>
<tr>
<td>
cache_ttl
</td>
<td>
integer (default:Β 300)
</td>
<td>
Maximum TTL (in seconds) of cached entries
</td>
</tr>
<tr>
<td>
control_plane
</td>
<td>
boolean (default:Β false)
</td>
<td>
Use LDAP for user authentication/authorization in the control plane
</td>
</tr>
<tr>
<td>
data_plane
</td>
<td>
boolean (default:Β false)
</td>
<td>
Use LDAP for user authentication/authorization in the data plane
</td>
</tr>
<tr>
<td>
directory_timeout_s
</td>
<td>
integer (range:Β 5-60) (default:Β 5)
</td>
<td>
The connection timeout to the LDAP server when authenticating a user, in seconds
</td>
</tr>
<tr>
<td>
dn_group_attr
</td>
<td>
string
</td>
<td>
The name of an attribute of the LDAP user entity that contains a list of the groups that user belongs to. (Mutually exclusive with "dn_group_query")
</td>
</tr>
<tr>
<td>
dn_group_query
</td>
<td>
complex object
</td>
<td>
An LDAP search query for mapping from a user DN to the groups the user is a member of. The substring "%D" in the filter will be replaced with the user's DN. (Mutually exclusive with "dn_group_attr")
</td>
</tr>
<tr>
<td>
starttls
</td>
<td>
boolean (default:Β false)
</td>
<td>
Use StartTLS negotiation for the LDAP connection
</td>
</tr>
<tr>
<td>
uris
</td>
<td>
array of strings
</td>
<td>
URIs of LDAP servers that only contain the schema, host, and port
</td>
</tr>
<tr>
<td>
user_dn_query
</td>
<td>
complex object
</td>
<td>
An LDAP search query for mapping from a username to a user DN. The substring "%u" in the filter will be replaced with the username. (Mutually exclusive with "user_dn_template")
</td>
</tr>
<tr>
<td>
user_dn_template
</td>
<td>
string
</td>
<td>
A string template that maps between the username, provided to the cluster for authentication, and the LDAP DN. The substring "%u" will be replaced with the username. (Mutually exclusive with "user_dn_query")
</td>
</tr>
</tbody>
</table>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/references/rest-api/objects/ldap/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/develop/interact/programmability/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Redis programmability
</h1>
<p class="text-lg -mt-5 mb-10">
Extending Redis with Lua and Redis Functions
</p>
<p>
Redis provides a programming interface that lets you execute custom scripts on the server itself. In Redis 7 and beyond, you can use
<a href="/docs/latest/develop/interact/programmability/functions-intro/">
Redis Functions
</a>
to manage and run your scripts. In Redis 6.2 and below, you use
<a href="/docs/latest/develop/interact/programmability/eval-intro/">
Lua scripting with the EVAL command
</a>
to program the server.
</p>
<h2 id="background">
Background
</h2>
<p>
Redis is, by
<a href="https://github.com/redis/redis/blob/unstable/MANIFESTO#L7">
definition
</a>
, a
<em>
"domain-specific language for abstract data types"
</em>
.
The language that Redis speaks consists of its
<a href="/docs/latest/commands/">
commands
</a>
.
Most the commands specialize at manipulating core
<a href="/docs/latest/develop/data-types/">
data types
</a>
in different ways.
In many cases, these commands provide all the functionality that a developer requires for managing application data in Redis.
</p>
<p>
The term
<strong>
programmability
</strong>
in Redis means having the ability to execute arbitrary user-defined logic by the server.
We refer to such pieces of logic as
<strong>
scripts
</strong>
.
In our case, scripts enable processing the data where it lives, a.k.a
<em>
data locality
</em>
.
Furthermore, the responsible embedding of programmatic workflows in the Redis server can help in reducing network traffic and improving overall performance.
Developers can use this capability for implementing robust, application-specific APIs.
Such APIs can encapsulate business logic and maintain a data model across multiple keys and different data structures.
</p>
<p>
User scripts are executed in Redis by an embedded, sandboxed scripting engine.
Presently, Redis supports a single scripting engine, the
<a href="https://www.lua.org/">
Lua 5.1
</a>
interpreter.
</p>
<p>
Please refer to the
<a href="/docs/latest/develop/interact/programmability/lua-api">
Redis Lua API Reference
</a>
page for complete documentation.
</p>
<h2 id="running-scripts">
Running scripts
</h2>
<p>
Redis provides two means for running scripts.
</p>
<p>
Firstly, and ever since Redis 2.6.0, the
<a href="/docs/latest/commands/eval/">
<code>
EVAL
</code>
</a>
command enables running server-side scripts.
Eval scripts provide a quick and straightforward way to have Redis run your scripts ad-hoc.
However, using them means that the scripted logic is a part of your application (not an extension of the Redis server).
Every applicative instance that runs a script must have the script's source code readily available for loading at any time.
That is because scripts are only cached by the server and are volatile.
As your application grows, this approach can become harder to develop and maintain.
</p>
<p>
Secondly, added in v7.0, Redis Functions are essentially scripts that are first-class database elements.
As such, functions decouple scripting from application logic and enable independent development, testing, and deployment of scripts.
To use functions, they need to be loaded first, and then they are available for use by all connected clients.
In this case, loading a function to the database becomes an administrative deployment task (such as loading a Redis module, for example), which separates the script from the application.
</p>
<p>
Please refer to the following pages for more information:
</p>
<ul>
<li>
<a href="/docs/latest/develop/interact/programmability/eval-intro/">
Redis Eval Scripts
</a>
</li>
<li>
<a href="/docs/latest/develop/interact/programmability/functions-intro/">
Redis Functions
</a>
</li>
</ul>
<p>
When running a script or a function, Redis guarantees its atomic execution.
The script's execution blocks all server activities during its entire time, similarly to the semantics of
<a href="/docs/latest/develop/interact/transactions/">
transactions
</a>
.
These semantics mean that all of the script's effects either have yet to happen or had already happened.
The blocking semantics of an executed script apply to all connected clients at all times.
</p>
<p>
Note that the potential downside of this blocking approach is that executing slow scripts is not a good idea.
It is not hard to create fast scripts because scripting's overhead is very low.
However, if you intend to use a slow script in your application, be aware that all other clients are blocked and can't execute any command while it is running.
</p>
<h2 id="read-only-scripts">
Read-only scripts
</h2>
<p>
A read-only script is a script that only executes commands that don't modify any keys within Redis.
Read-only scripts can be executed either by adding the
<code>
no-writes
</code>
<a href="/docs/latest/develop/interact/programmability/lua-api#script_flags">
flag
</a>
to the script or by executing the script with one of the read-only script command variants:
<a href="/docs/latest/commands/eval_ro/">
<code>
EVAL_RO
</code>
</a>
,
<a href="/docs/latest/commands/evalsha_ro/">
<code>
EVALSHA_RO
</code>
</a>
, or
<a href="/docs/latest/commands/fcall_ro/">
<code>
FCALL_RO
</code>
</a>
.
They have the following properties:
</p>
<ul>
<li>
They can always be executed on replicas.
</li>
<li>
They can always be killed by the
<a href="/docs/latest/commands/script-kill/">
<code>
SCRIPT KILL
</code>
</a>
command.
</li>
<li>
They never fail with OOM error when redis is over the memory limit.
</li>
<li>
They are not blocked during write pauses, such as those that occur during coordinated failovers.
</li>
<li>
They cannot execute any command that may modify the data set.
</li>
<li>
Currently
<a href="/docs/latest/commands/publish/">
<code>
PUBLISH
</code>
</a>
,
<a href="/docs/latest/commands/spublish/">
<code>
SPUBLISH
</code>
</a>
and
<a href="/docs/latest/commands/pfcount/">
<code>
PFCOUNT
</code>
</a>
are also considered write commands in scripts, because they could attempt to propagate commands to replicas and AOF file.
</li>
</ul>
<p>
In addition to the benefits provided by all read-only scripts, the read-only script commands have the following advantages:
</p>
<ul>
<li>
They can be used to configure an ACL user to only be able to execute read-only scripts.
</li>
<li>
Many clients also better support routing the read-only script commands to replicas for applications that want to use replicas for read scaling.
</li>
</ul>
<h4 id="read-only-script-history">
Read-only script history
</h4>
<p>
Read-only scripts and read-only script commands were introduced in Redis 7.0
</p>
<ul>
<li>
Before Redis 7.0.1
<a href="/docs/latest/commands/publish/">
<code>
PUBLISH
</code>
</a>
,
<a href="/docs/latest/commands/spublish/">
<code>
SPUBLISH
</code>
</a>
and
<a href="/docs/latest/commands/pfcount/">
<code>
PFCOUNT
</code>
</a>
were not considered write commands in scripts
</li>
<li>
Before Redis 7.0.1 the
<code>
no-writes
</code>
<a href="/docs/latest/develop/interact/programmability/lua-api#script_flags">
flag
</a>
did not imply
<code>
allow-oom
</code>
</li>
<li>
Before Redis 7.0.1 the
<code>
no-writes
</code>
flag did not permit the script to run during write pauses.
</li>
</ul>
<p>
The recommended approach is to use the standard scripting commands with the
<code>
no-writes
</code>
flag unless you need one of the previously mentioned features.
</p>
<h2 id="sandboxed-script-context">
Sandboxed script context
</h2>
<p>
Redis places the engine that executes user scripts inside a sandbox.
The sandbox attempts to prevent accidental misuse and reduce potential threats from the server's environment.
</p>
<p>
Scripts should never try to access the Redis server's underlying host systems, such as the file system, network, or attempt to perform any other system call other than those supported by the API.
</p>
<p>
Scripts should operate solely on data stored in Redis and data provided as arguments to their execution.
</p>
<h2 id="maximum-execution-time">
Maximum execution time
</h2>
<p>
Scripts are subject to a maximum execution time (set by default to five seconds).
This default timeout is enormous since a script usually runs in less than a millisecond.
The limit is in place to handle accidental infinite loops created during development.
</p>
<p>
It is possible to modify the maximum time a script can be executed with millisecond precision,
either via
<code>
redis.conf
</code>
or by using the
<a href="/docs/latest/commands/config-set/">
<code>
CONFIG SET
</code>
</a>
command.
The configuration parameter affecting max execution time is called
<code>
busy-reply-threshold
</code>
.
</p>
<p>
When a script reaches the timeout threshold, it isn't terminated by Redis automatically.
Doing so would violate the contract between Redis and the scripting engine that ensures that scripts are atomic.
Interrupting the execution of a script has the potential of leaving the dataset with half-written changes.
</p>
<p>
Therefore, when a script executes longer than the configured timeout, the following happens:
</p>
<ul>
<li>
Redis logs that a script is running for too long.
</li>
<li>
It starts accepting commands again from other clients but will reply with a BUSY error to all the clients sending normal commands. The only commands allowed in this state are
<a href="/docs/latest/commands/script-kill/">
<code>
SCRIPT KILL
</code>
</a>
,
<a href="/docs/latest/commands/function-kill/">
<code>
FUNCTION KILL
</code>
</a>
, and
<code>
SHUTDOWN NOSAVE
</code>
.
</li>
<li>
It is possible to terminate a script that only executes read-only commands using the
<a href="/docs/latest/commands/script-kill/">
<code>
SCRIPT KILL
</code>
</a>
and
<a href="/docs/latest/commands/function-kill/">
<code>
FUNCTION KILL
</code>
</a>
commands. These commands do not violate the scripting semantic as no data was written to the dataset by the script yet.
</li>
<li>
If the script had already performed even a single write operation, the only command allowed is
<code>
SHUTDOWN NOSAVE
</code>
that stops the server without saving the current data set on disk (basically, the server is aborted).
</li>
</ul>
<nav>
<a href="/docs/latest/develop/interact/programmability/functions-intro/">
Redis functions
</a>
<p>
Scripting with Redis 7 and beyond
</p>
<a href="/docs/latest/develop/interact/programmability/eval-intro/">
Scripting with Lua
</a>
<p>
Executing Lua in Redis
</p>
<a href="/docs/latest/develop/interact/programmability/lua-api/">
Redis Lua API reference
</a>
<p>
Executing Lua in Redis
</p>
<a href="/docs/latest/develop/interact/programmability/lua-debugging/">
Debugging Lua scripts in Redis
</a>
<p>
How to use the built-in Lua debugger
</p>
</nav>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/develop/interact/programmability/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/7.4/security/encryption/tls/ciphers/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Configure cipher suites
</h1>
<p class="text-lg -mt-5 mb-10">
Shows how to configure cipher suites.
</p>
<p>
Ciphers are algorithms that help secure connections between clients and servers. You can change the ciphers to improve the security of your Redis Enterprise cluster and databases. The default settings are in line with industry best practices, but you can customize them to match the security policy of your organization.
</p>
<h2 id="tls-12-cipher-suites">
TLS 1.2 cipher suites
</h2>
<table>
<thead>
<tr>
<th>
Name
</th>
<th>
Configurable
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
control_cipher_suites
</td>
<td>
<span title="Yes">
β
Yes
</span>
</td>
<td>
Cipher list for TLS 1.2 communications for cluster administration (control plane)
</td>
</tr>
<tr>
<td>
data_cipher_list
</td>
<td>
<span title="Yes">
β
Yes
</span>
</td>
<td>
Cipher list for TLS 1.2 communications between applications and databases (data plane)
</td>
</tr>
<tr>
<td>
sentinel_cipher_suites
</td>
<td>
<span title="Yes">
β
Yes
</span>
</td>
<td>
Cipher list for
<a href="/docs/latest/operate/rs/7.4/databases/durability-ha/discovery-service/">
discovery service
</a>
(Sentinel) TLS 1.2 communications
</td>
</tr>
</tbody>
</table>
<h2 id="tls-13-cipher-suites">
TLS 1.3 cipher suites
</h2>
<table>
<thead>
<tr>
<th>
Name
</th>
<th>
Configurable
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
control_cipher_suites_tls_1_3
</td>
<td>
<span title="No">
β No
</span>
</td>
<td>
Cipher list for TLS 1.3 communications for cluster administration (control plane)
</td>
</tr>
<tr>
<td>
data_cipher_suites_tls_1_3
</td>
<td>
<span title="Yes">
β
Yes
</span>
</td>
<td>
Cipher list for TLS 1.3 communications between applications and databases (data plane)
</td>
</tr>
<tr>
<td>
sentinel_cipher_suites_tls_1_3
</td>
<td>
<span title="No">
β No
</span>
</td>
<td>
Cipher list for
<a href="/docs/latest/operate/rs/7.4/databases/durability-ha/discovery-service/">
discovery service
</a>
(Sentinel) TLS 1.3 communications
</td>
</tr>
</tbody>
</table>
<h2 id="configure-cipher-suites">
Configure cipher suites
</h2>
<p>
You can configure ciphers with the
<a href="#edit-ciphers-ui">
Cluster Manager UI
</a>
,
<a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/cluster/config/">
<code>
rladmin
</code>
</a>
, or the
<a href="/docs/latest/operate/rs/7.4/references/rest-api/requests/cluster/#put-cluster">
REST API
</a>
.
</p>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Warning:
</div>
Configuring cipher suites overwrites existing ciphers rather than appending new ciphers to the list.
</div>
</div>
<p>
When you modify your cipher suites, make sure:
</p>
<ul>
<li>
The configured TLS version matches the required cipher suites.
</li>
<li>
The certificates in use are properly signed to support the required cipher suites.
</li>
</ul>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Note:
</div>
<ul>
<li>
<p>
Redis Enterprise Software doesn't support static
<a href="https://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange">
DiffieβHellman (
<code>
DH
</code>
) key exchange
</a>
ciphers.
</p>
</li>
<li>
<p>
It does support Ephemeral DiffieβHellman (
<code>
DHE
</code>
or
<code>
ECDHE
</code>
) key exchange ciphers on Red Hat Enterprise Linux (RHEL) 8 and Bionic OS.
</p>
</li>
</ul>
</div>
</div>
<h3 id="edit-ciphers-ui">
Edit cipher suites in the UI
</h3>
<p>
To configure cipher suites using the Cluster Manager UI:
</p>
<ol>
<li>
<p>
Go to
<strong>
Cluster > Security
</strong>
, then select the
<strong>
TLS
</strong>
tab.
</p>
</li>
<li>
<p>
In the
<strong>
Cipher suites lists
</strong>
section, click
<strong>
Configure
</strong>
:
</p>
<a href="/docs/latest/images/rs/screenshots/cluster/security-tls-cipher-suites-view.png" sdata-lightbox="/images/rs/screenshots/cluster/security-tls-cipher-suites-view.png">
<img alt="Cipher suites lists as shown in the Cluster Manager UI." src="/docs/latest/images/rs/screenshots/cluster/security-tls-cipher-suites-view.png"/>
</a>
</li>
<li>
<p>
Edit the TLS cipher suites in the text boxes:
</p>
<a href="/docs/latest/images/rs/screenshots/cluster/security-tls-cipher-suites-edit.png" sdata-lightbox="/images/rs/screenshots/cluster/security-tls-cipher-suites-edit.png">
<img alt="Edit cipher suites drawer in the Cluster Manager UI." src="/docs/latest/images/rs/screenshots/cluster/security-tls-cipher-suites-edit.png"/>
</a>
</li>
<li>
<p>
Click
<strong>
Save
</strong>
.
</p>
</li>
</ol>
<h3 id="control-plane-ciphers-tls-1-2">
Control plane cipher suites
</h3>
<p>
As of Redis Enterprise Software version 6.0.12, control plane cipher suites can use the BoringSSL library format for TLS connections to the Cluster Manager UI. See the BoringSSL documentation for a full list of available
<a href="https://github.com/google/boringssl/blob/master/ssl/test/runner/cipher_suites.go#L99-L131">
BoringSSL configurations
</a>
.
</p>
<h4 id="configure-tls-12-control-plane-cipher-suites">
Configure TLS 1.2 control plane cipher suites
</h4>
<p>
To configure TLS 1.2 cipher suites for cluster communication, use the following
<a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/">
<code>
rladmin
</code>
</a>
command syntax:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin cluster config control_cipher_suites <BoringSSL cipher list>
</span></span></code></pre>
</div>
<p>
See the example below to configure cipher suites for the control plane:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin cluster config control_cipher_suites ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305
</span></span></code></pre>
</div>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Note:
</div>
<ul>
<li>
The deprecated 3DES and RC4 cipher suites are no longer supported.
</li>
</ul>
</div>
</div>
<h3 id="data-plane-ciphers-tls-1-2">
Data plane cipher suites
</h3>
<p>
Data plane cipher suites use the OpenSSL library format in Redis Enterprise Software version 6.0.20 or later. For a list of available OpenSSL configurations, see
<a href="https://www.openssl.org/docs/man1.1.1/man1/ciphers.html">
Ciphers
</a>
(OpenSSL).
</p>
<h4 id="configure-tls-12-data-plane-cipher-suites">
Configure TLS 1.2 data plane cipher suites
</h4>
<p>
To configure TLS 1.2 cipher suites for communications between applications and databases, use the following
<a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/">
<code>
rladmin
</code>
</a>
command syntax:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin cluster config data_cipher_list <OpenSSL cipher list>
</span></span></code></pre>
</div>
<p>
See the example below to configure cipher suites for the data plane:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin cluster config data_cipher_list AES128-SHA:AES256-SHA
</span></span></code></pre>
</div>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Note:
</div>
<ul>
<li>
The deprecated 3DES and RC4 cipher suites are no longer supported.
</li>
</ul>
</div>
</div>
<h4 id="configure-tls-13-data-plane-cipher-suites">
Configure TLS 1.3 data plane cipher suites
</h4>
<p>
To configure TLS 1.3 cipher suites for communications between applications and databases, use the following
<a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/">
<code>
rladmin
</code>
</a>
command syntax:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin cluster config data_cipher_suites_tls_1_3 <OpenSSL cipher list>
</span></span></code></pre>
</div>
<p>
The following example configures TLS 1.3 cipher suites for the data plane:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin cluster config data_cipher_suites_tls_1_3 TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256
</span></span></code></pre>
</div>
<h3 id="discovery-service-ciphers-tls-1-2">
Discovery service cipher suites
</h3>
<p>
Sentinel service cipher suites use the golang.org OpenSSL format for
<a href="/docs/latest/operate/rs/7.4/databases/durability-ha/discovery-service/">
discovery service
</a>
TLS connections in Redis Enterprise Software version 6.0.20 or later. See their documentation for a list of
<a href="https://golang.org/src/crypto/tls/cipher_suites.go">
available configurations
</a>
.
</p>
<h4 id="configure-tls-12-discovery-service-cipher-suites">
Configure TLS 1.2 discovery service cipher suites
</h4>
<p>
To configure TLS 1.2 cipher suites for the discovery service cipher suites, use the following
<a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/">
<code>
rladmin
</code>
</a>
command syntax:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin cluster config sentinel_cipher_suites <golang cipher list>
</span></span></code></pre>
</div>
<p>
See the example below to configure cipher suites for the sentinel service:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin cluster config sentinel_cipher_suites TLS_RSA_WITH_AES_128_CBC_SHA:TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
</span></span></code></pre>
</div>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/security/encryption/tls/ciphers/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/commands/tdigest.merge/.html | <section class="prose w-full py-12">
<h1 class="command-name">
TDIGEST.MERGE
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">TDIGEST.MERGE destination-key numkeys source-key [source-key ...]
[COMPRESSION compression] [OVERRIDE]</pre>
<dl class="grid grid-cols-[auto,1fr] gap-2 mb-12">
<dt class="font-semibold text-redis-ink-900 m-0">
Available in:
</dt>
<dd class="m-0">
<a href="/docs/stack">
Redis Stack
</a>
/
<a href="/docs/data-types/probabilistic">
Bloom 2.4.0
</a>
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
Time complexity:
</dt>
<dd class="m-0">
O(N*K), where N is the number of centroids and K being the number of input sketches
</dd>
</dl>
<p>
Merges multiple t-digest sketches into a single sketch.
</p>
<h2 id="required-arguments">
Required arguments
</h2>
<details open="">
<summary>
<code>
destination-key
</code>
</summary>
<p>
is key name for a t-digest sketch to merge observation values to.
</p>
<p>
If
<code>
destination-key
</code>
does not exist - a new sketch is created.
</p>
<p>
If
<code>
destination-key
</code>
is an existing sketch, its values are merged with the values of the source keys. To override the destination key contents use
<code>
OVERRIDE
</code>
.
</p>
</details>
<details open="">
<summary>
<code>
numkeys
</code>
</summary>
Number of sketches to merge observation values from (1 or more).
</details>
<details open="">
<summary>
<code>
source-key
</code>
</summary>
each is a key name for a t-digest sketch to merge observation values from.
</details>
<h2 id="optional-arguments">
Optional arguments
</h2>
<details open="">
<summary>
<code>
COMPRESSION compression
</code>
</summary>
<p>
is a controllable tradeoff between accuracy and memory consumption. 100 is a common value for normal uses. 1000 is more accurate. If no value is passed by default the compression will be 100. For more information on scaling of accuracy versus the compression parameter see
<a href="https://www.sciencedirect.com/science/article/pii/S2665963820300403">
<em>
The t-digest: Efficient estimates of distributions
</em>
</a>
.
</p>
<p>
When
<code>
COMPRESSION
</code>
is not specified:
</p>
<ul>
<li>
If
<code>
destination-key
</code>
does not exist or if
<code>
OVERRIDE
</code>
is specified, the compression is set to the maximal value among all source sketches.
</li>
<li>
If
<code>
destination-key
</code>
already exists and
<code>
OVERRIDE
</code>
is not specified, its compression is not changed.
</li>
</ul>
</details>
<details open="">
<summary>
<code>
OVERRIDE
</code>
</summary>
When specified, if `destination-key` already exists, it is overwritten.
</details>
<h2 id="return-value">
Return value
</h2>
<p>
OK on success, error otherwise.
</p>
<h2 id="examples">
Examples
</h2>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis> TDIGEST.CREATE s1
</span></span><span class="line"><span class="cl">OK
</span></span><span class="line"><span class="cl">redis> TDIGEST.CREATE s2
</span></span><span class="line"><span class="cl">OK
</span></span><span class="line"><span class="cl">redis> TDIGEST.ADD s1 10.0 20.0
</span></span><span class="line"><span class="cl">OK
</span></span><span class="line"><span class="cl">redis> TDIGEST.ADD s2 30.0 40.0
</span></span><span class="line"><span class="cl">OK
</span></span><span class="line"><span class="cl">redis> TDIGEST.MERGE sM <span class="m">2</span> s1 s2
</span></span><span class="line"><span class="cl">OK
</span></span><span class="line"><span class="cl">redis> TDIGEST.BYRANK sM <span class="m">0</span> <span class="m">1</span> <span class="m">2</span> <span class="m">3</span> <span class="m">4</span>
</span></span><span class="line"><span class="cl">1<span class="o">)</span> <span class="s2">"10"</span>
</span></span><span class="line"><span class="cl">2<span class="o">)</span> <span class="s2">"20"</span>
</span></span><span class="line"><span class="cl">3<span class="o">)</span> <span class="s2">"30"</span>
</span></span><span class="line"><span class="cl">4<span class="o">)</span> <span class="s2">"40"</span>
</span></span><span class="line"><span class="cl">5<span class="o">)</span> <span class="s2">"inf"</span></span></span></code></pre>
</div>
<br/>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/tdigest.merge/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/7.4/references/rest-api/requests/bdbs/modules/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Database modules requests
</h1>
<p class="text-lg -mt-5 mb-10">
Redis module requests
</p>
<h2 id="configure-module">
Configure module
</h2>
<table>
<thead>
<tr>
<th>
Method
</th>
<th>
Path
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="/docs/latest/operate/rs/7.4/references/rest-api/requests/bdbs/modules/config/#post-bdb-modules-config">
POST
</a>
</td>
<td>
<code>
/v1/bdbs/{uid}/modules/config
</code>
</td>
<td>
Configure module
</td>
</tr>
</tbody>
</table>
<h2 id="upgrade-module">
Upgrade module
</h2>
<table>
<thead>
<tr>
<th>
Method
</th>
<th>
Path
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="/docs/latest/operate/rs/7.4/references/rest-api/requests/bdbs/modules/upgrade/#post-bdb-modules-upgrade">
POST
</a>
</td>
<td>
<code>
/v1/bdbs/{uid}/modules/upgrade
</code>
</td>
<td>
Upgrade module
</td>
</tr>
</tbody>
</table>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/references/rest-api/requests/bdbs/modules/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redistimeseries/redistimeseries-1.2-release-notes/.html | <section class="prose w-full py-12 max-w-none">
<h1>
RedisTimeSeries 1.2 release rotes
</h1>
<p class="text-lg -mt-5 mb-10">
Added compression. Stable ingestion time independent of the number of the data points on a time series. API performance improvements. Extended client support.
</p>
<h2 id="requirements">
Requirements
</h2>
<p>
RedisTimeSeries v1.2.7 requires:
</p>
<ul>
<li>
Minimum Redis compatibility version (database): 5.0.0
</li>
<li>
Minimum Redis Enterprise Software version (cluster): 6.0.12
</li>
</ul>
<h2 id="v127-june-2020">
v1.2.7 (June 2020)
</h2>
<p>
This is a maintenance release for version 1.2.
</p>
<p>
Details:
</p>
<ul>
<li>
<p>
Bugfixes:
</p>
<ul>
<li>
#
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/issues/414">
414
</a>
Crash when a query had an empty label
<code>
(foo,)
</code>
</li>
</ul>
</li>
</ul>
<h2 id="v126-may-2020">
v1.2.6 (May 2020)
</h2>
<p>
This is a maintenance release for version 1.2.
</p>
<p>
Details:
</p>
<ul>
<li>
<p>
Minor enhancements:
</p>
<ul>
<li>
#
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/403">
403
</a>
Support for multi-value filtering in
<code>
TS.MGET
</code>
and
<code>
TS.MRANGE
</code>
.
</li>
</ul>
</li>
<li>
<p>
Bugfixes:
</p>
<ul>
<li>
#
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/378">
378
</a>
Using
<code>
snprintf
</code>
to ensure the same precision of floating-point value replies.
</li>
<li>
#
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/374">
374
</a>
<code>
TS.RANGE
</code>
crashed when COUNT argument was missing.
</li>
<li>
#
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/395">
395
</a>
Check minimum compatible Redis version at module load time.
</li>
</ul>
</li>
</ul>
<h2 id="v125-march-2020">
v1.2.5 (March 2020)
</h2>
<p>
Headlines:
</p>
<ul>
<li>
This release improves overall stability and provides fixes for issues found after the previous release.
</li>
</ul>
<p>
Details:
</p>
<ul>
<li>
Bugfixes:
<ul>
<li>
#
<a href="https://github.com/redistimeseries/redistimeseries/issues/358">
358
</a>
<a href="https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!topic/redistimeseries/wH0R69e8lOs">
Wrong behaviour
</a>
in
<code>
TS.RANGE
</code>
due to shifting left.
</li>
<li>
#
<a href="https://github.com/redistimeseries/redistimeseries/issues/353">
353
</a>
Crash where the name of a time-series was already taken due to auto-compaction.
</li>
</ul>
</li>
</ul>
<h2 id="v123-february-2020">
v1.2.3 (February 2020)
</h2>
<p>
Headlines:
</p>
<ul>
<li>
This release improves overall stability and provides fixes for issues found after the previous release.
</li>
</ul>
<p>
Details:
</p>
<ul>
<li>
Bugfixes:
<ul>
<li>
#
<a href="https://github.com/redistimeseries/redistimeseries/issues/338">
338
</a>
reverting #
<a href="https://github.com/redistimeseries/redistimeseries/issues/319">
319
</a>
. Aggregation should happen on deterministic time buckets.
</li>
</ul>
</li>
</ul>
<h2 id="v12-ga-122---january-2020">
v1.2 GA (1.2.2 - January 2020)
</h2>
<p>
This is the general availability (GA) release of RedisTimeSeries 1.2 (1.2.2).
</p>
<p>
Headlines:
</p>
<ul>
<li>
Compression added which can reduce memory up to 98% and improve read performance up to 50%.
</li>
<li>
Stable ingestion time independent of the number of the data points on a time-series.
</li>
<li>
Reviewed API with performance improvements and removed ambiguity.
</li>
<li>
Extended
<a href="/docs/latest/develop/data-types/timeseries/clients/">
client support
</a>
</li>
</ul>
<p>
(we will blog about this release soon including performance improvements results and the link here)
</p>
<p>
Full details:
</p>
<ul>
<li>
<p>
Added functionality
</p>
<ul>
<li>
#
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/issues/261">
261
</a>
Samples are compressed using
<code>
Double Delta compression
</code>
which results in cost savings and faster query times.
</li>
<li>
Based on the
<a href="https://www.vldb.org/pvldb/vol8/p1816-teller.pdf">
Gorilla paper
</a>
.
<ul>
<li>
In theory, this can save space up to 98%. (2 bits per sample in stead of 128).
</li>
<li>
In practice, a memory reduction of 5-8x is common but depends on the use case.
</li>
</ul>
</li>
<li>
Initial benchmarks show 94% memory savings and performance improvements in reads up to XX%.
</li>
<li>
<code>
UNCOMPRESSED
</code>
option in
<code>
TS.CREATE
</code>
.
</li>
</ul>
</li>
<li>
<p>
API changes / Enhancements
</p>
<ul>
<li>
#
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/issues/241">
241
</a>
Overwriting the last sample with the same timestamp is not allowed.
</li>
<li>
#
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/issues/242">
242
</a>
revised
<code>
TS.INCRBY/DECRBY
</code>
</li>
<li>
Returns a timestamp. The behaviour is now aligned with
<code>
TS.ADD
</code>
.
</li>
<li>
The
<code>
RESET
</code>
functionality was removed.
<code>
RESET
</code>
contradicted the rewriting of the last sample (#
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/issues/241">
241
</a>
).
Alternatively, you can reconstruct similar behaviour by
<ul>
<li>
<code>
TS.ADD ts * 1
</code>
+
<code>
sum
</code>
aggregation
</li>
<li>
<code>
TS.INCRBY ts 1
</code>
+
<code>
range
</code>
aggregation
</li>
</ul>
</li>
<li>
#
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/issues/317">
317
</a>
Aligning response on empty series of
<code>
TS.GET
</code>
with
<code>
TS.RANGE
</code>
.
</li>
<li>
#
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/issues/285">
285
</a>
#
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/issues/318">
318
</a>
Changed default behaviour of
<code>
TS.MRANGE
</code>
and
<code>
TS.MGET
</code>
to no longer returns the labels of each time-series in order reduce network traffic. Optional
<code>
WITHLABELS
</code>
argument added.
</li>
<li>
#
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/issues/319">
319
</a>
<code>
TS.RANGE
</code>
and
<code>
TS.MRANGE
</code>
aggregation starting from requested timestamp.
</li>
</ul>
</li>
<li>
<p>
Performance improvements
</p>
<ul>
<li>
#
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/issues/237">
237
</a>
Downsampling after time window is closed vs. downsampling with each sample.
</li>
<li>
#
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/issues/285">
285
</a>
#
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/issues/318">
318
</a>
Optional
<code>
WITHLABELS
</code>
argument added. This feature improves read performance drastically.
</li>
</ul>
</li>
<li>
<p>
Minor Enhancements
</p>
<ul>
<li>
#
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/issues/230">
230
</a>
<code>
TS.INFO
</code>
now includes
<code>
total samples
</code>
,
<code>
memory usage
</code>
,
<code>
first time stamp
</code>
, ...
</li>
<li>
#
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/issues/230">
230
</a>
<code>
MEMORY
</code>
calculates series memory footprint.
</li>
</ul>
</li>
<li>
<p>
Bugfixes since 1.0.3
</p>
<ul>
<li>
#
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/issues/204">
204
</a>
Module initialization params changed to 64 bits.
</li>
<li>
#
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/issues/266">
266
</a>
Memory leak in the aggregator context.
</li>
<li>
#
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/issues/260">
260
</a>
Better error messages.
</li>
<li>
#
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/issues/259">
259
</a>
#
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/issues/257">
257
</a>
#
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/issues/219">
219
</a>
Miscellaneous.
</li>
<li>
#
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/issues/320">
320
</a>
Delete the existing key prior to restoring it.
</li>
<li>
#
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/issues/323">
323
</a>
Empty first sample on aggregation.
</li>
</ul>
</li>
</ul>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Note:
</div>
The version inside Redis will be 10202 or 1.2.2 in semantic versioning.
</div>
</div>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redistimeseries/redistimeseries-1.2-release-notes/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/release-notes/rs-6-4-2-releases/rs-6-4-2-30/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Redis Enterprise Software release notes 6.4.2-30 (February 2023)
</h1>
<p class="text-lg -mt-5 mb-10">
Pub/sub ACLs & default permissions. Validate client certificates by subject attributes.
</p>
<p>
β
<a href="https://redis.com/redis-enterprise-software/download-center/software/">
βRedis Enterprise Software version 6.4.2
</a>
is now available!
</p>
<p>
This version offers:
</p>
<ul>
<li>
<p>
Extended validation of client certificates via mTLS (mutual TLS) full subject support
</p>
</li>
<li>
<p>
Support for default restrictive permissions when using publish/subscribe commands and ACLs (access control lists)
</p>
</li>
<li>
<p>
Enhanced TLS performance when Redis returns large arrays in responses
</p>
</li>
<li>
<p>
Compatibility with
<a href="https://github.com/redis/redis">
open source Redis 6.2.7
</a>
</p>
</li>
<li>
<p>
Additional enhancements and bug fixes
</p>
</li>
</ul>
<p>
The following table shows the MD5 checksums for the available packages:
</p>
<table>
<thead>
<tr>
<th>
Package
</th>
<th>
MD5 checksum (6.4.2-30 February release)
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
Ubuntu 16
</td>
<td>
b0dbecaa974ca08245dda55d53b6fe9b
</td>
</tr>
<tr>
<td>
Ubuntu 18
</td>
<td>
a5192e8b0734db80d6b7c2b98a170c58
</td>
</tr>
<tr>
<td>
RedHat Enterprise Linux (RHEL) 7
<br/>
Oracle Enterprise Linux (OL) 7
</td>
<td>
c1537855dcfe7a7cedf9031ce01e2b9b
</td>
</tr>
<tr>
<td>
RedHat Enterprise Linux (RHEL) 8
<br/>
Oracle Enterprise Linux (OL) 8
<br/>
Rocky Enterprise Linux
</td>
<td>
a24dc749d6dcb5df2162d7a41791c7aa
</td>
</tr>
</tbody>
</table>
<h2 id="new-features-and-enhancements">
New features and enhancements
</h2>
<h4 id="validate-client-certificates-by-subject-attributes">
Validate client certificates by subject attributes
</h4>
<p>
You can now validate client certificates by their
<code>
Subject
</code>
attributes. When a client attempts to connect to a database, Redis Enterprise Software compares the values of the client certificate subject attributes to the subject values allowed by the database. Clients can connect to the database only if the subject values match. This gives more flexibility in controlling which clients can access which databases.
</p>
<p>
See
<a href="/docs/latest/operate/rs/security/encryption/tls/enable-tls/">
Enable TLS
</a>
for more information.
</p>
<h4 id="default-pubsub-acl-permissions">
Default pub/sub ACL permissions
</h4>
<p>
Redis is continuously enhancing its ACL (access control list) functionality and coverage. Redis version 6.2 enhances
<a href="/docs/latest/operate/oss_and_stack/management/security/acl/">
ACLs
</a>
to allow and disallow pub/sub channels.
</p>
<p>
Part of protecting pub/sub channels requires changing the default access from permissive to restrictive, which blocks all pub/sub channels unless specifically permitted by an ACL rule. To allow this transition across all databases in the cluster, Redis Enterprise Software 6.4.2 provides a new configuration option
<code>
acl-pubsub-default
</code>
that sets the cluster-wide default for all channels to either permitted or restricted.
</p>
<p>
The 6.4.2 installation-provided value of
<code>
acl-pubsub-default
</code>
is permissive (
<code>
allchannels
</code>
) to comply with earlier Redis versions. After you upgrade all databases in the cluster to Redis DB version 6.2 (or later in future versions), you can use
<code>
rladmin
</code>
or the REST API to change the value to restrictive (
<code>
resetchannels
</code>
).
</p>
<p>
To allow certain users to access specific pub/sub channels, define the appropriate ACL. Redis Enterprise Software 6.4.2 enhances the admin console (UI), CLI, and REST API to support pub/sub channel ACL definitions.
</p>
<p>
If you use ACLs and pub/sub channels, we recommend you review your databases and ACL settings and plan to change your cluster to restricted mode. This will help you prepare for future Redis Enterprise Software releases that use restrictive
<code>
resetchannels
</code>
as the new default for
<code>
acl-pubsub-default
</code>
.
</p>
<h4 id="redis-modules">
Redis modules
</h4>
<p>
Redis Enterprise Software v6.4.2 includes the following Redis modules:
</p>
<ul>
<li>
<p>
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisearch/redisearch-2.4-release-notes#v2416-november-2022">
RediSearch v2.4.16
</a>
</p>
</li>
<li>
<p>
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisjson/redisjson-2.2-release-notes#v220-july-2022">
RedisJSON v2.2.0
</a>
</p>
</li>
<li>
<p>
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/bloom/release-notes/redisbloom-2.2-release-notes/#v2218-july-2022">
RedisBloom v2.2.18
</a>
</p>
</li>
<li>
<p>
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisgraph/redisgraph-2.8-release-notes#v2820-september-2022">
RedisGraph v2.8.20
</a>
</p>
</li>
<li>
<p>
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redistimeseries/redistimeseries-1.6-release-notes#v1617-july-2022">
RedisTimeSeries v1.6.17
</a>
</p>
</li>
</ul>
<p>
See
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/install/upgrade-module/">
Upgrade modules
</a>
to learn how to upgrade a module for a database.
</p>
<h4 id="installations-upgrades-and-troubleshooting">
Installations, upgrades, and troubleshooting
</h4>
<ul>
<li>
<p>
Added the ability for
<code>
install.sh
</code>
to run even if βupgrade modeβ is already enabled to allow reruns in case of a previous run failure (RS77319)
</p>
</li>
<li>
<p>
Added log messages to the
<code>
redis_mgr
</code>
process (RS77891), the job_scheduler process (RS82673), and the
<code>
install.sh
</code>
script (RS82673)
</p>
</li>
<li>
<p>
Improved
<code>
rladmin
</code>
error messages for certificate validation (RS79933)
</p>
</li>
<li>
<p>
Added internode encryption ports to command-line utility
<code>
rlcheck
</code>
validation (RS68965)
</p>
</li>
<li>
<p>
Added an alert to notify when a node operation (such as maintenance mode) failed, aborted, or was canceled. The alert is enabled by default (RS76089)
</p>
</li>
</ul>
<h2 id="version-changes">
Version changes
</h2>
<h3 id="breaking-changes">
Breaking changes
</h3>
<ul>
<li>
REST API: the
<code>
authorized_names
</code>
field of the
<a href="/docs/latest/operate/rs/references/rest-api/objects/bdb/">
BDB object
</a>
is deprecated. Use the new
<code>
authorized_subjects
</code>
field instead.
</li>
</ul>
<h3 id="new-default-redis-db-version">
New default Redis DB version
</h3>
<p>
Both Redis Enterprise Software versions 6.2.x and 6.4.x package two Redis DB versions: Redis DB 6.0 and Redis DB 6.2. Until now, the default Redis DB version for creating new databases and upgrading existing databases was 6.0 (enforced by the
<code>
redis_upgrade_policy
</code>
parameter).
</p>
<p>
To allow customers more flexibility in future upgrades, starting with Redis Enterprise Software 6.4.2, the default Redis DB version for new and upgraded databases is now 6.2 for all upgrade policies (
<code>
redis_upgrade_policy=major
</code>
and
<code>
redis_upgrade_policy=latest
</code>
).
</p>
<table>
<thead>
<tr>
<th>
Redis
<br/>
Enterprise
</th>
<th>
Bundled Redis
<br/>
DB versions
</th>
<th>
Default DB version
<br/>
(upgraded/new databases)
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
6.2.x
</td>
<td>
6.0, 6.2
</td>
<td>
6.0
</td>
</tr>
<tr>
<td>
6.4.2
</td>
<td>
6.0, 6.2
</td>
<td>
6.2
</td>
</tr>
</tbody>
</table>
<p>
You can override the default version with
<a href="/docs/latest/operate/rs/references/cli-utilities/rladmin/tune/#tune-cluster">
<code>
rladmin
</code>
</a>
; however, we recommend that you don't change this setting.
</p>
<h3 id="deprecations">
Deprecations
</h3>
<h4 id="ubuntu-1604">
Ubuntu 16.04
</h4>
<p>
Ubuntu 16 support is considered deprecated and will be removed in a future release. Ubuntu 16.04 LTS (Xenial) has reached the end of its free initial five-year security maintenance period as of April 30, 2021.
</p>
<h4 id="active-active-database-persistence">
Active-Active database persistence
</h4>
<p>
The snapshot option for Active-Active database persistence is deprecated. We advise customers running Active-Active databases, configured with snapshot data persistence, to reconfigure their data persistence mode to use the AOF (Append Only File) option with the following command:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">crdb-cli crdb update --crdb-guid <CRDB_GUID> <span class="se">\
</span></span></span><span class="line"><span class="cl"><span class="se"></span> --default-db-config <span class="s1">'{"data_persistence": "aof", "aof_policy":"appendfsync-every-sec"}'</span>
</span></span></code></pre>
</div>
<h4 id="tls-10-and-tls-11">
TLS 1.0 and TLS 1.1
</h4>
<p>
TLS 1.0 and TLS 1.1 connections are considered deprecated in favor of TLS 1.2 or later.
Please verify that all clients, apps, and connections support TLS 1.2. Support for the earlier protocols will be removed in a future release.
Certain operating systems, such as RHEL 8, have already removed support for the earlier protocols. Redis Enterprise Software cannot support connection protocols that are not supported by the underlying operating system.
</p>
<h4 id="3des-encryption-cipher">
3DES encryption cipher
</h4>
<p>
The 3DES encryption cipher is considered deprecated in favor of stronger ciphers like AES.
Please verify that all clients, apps, and connections support the AES cipher. Support for 3DES will be removed in a future release.
Certain operating systems, such as RHEL 8, have already removed support for 3DES. Redis Enterprise Software cannot support cipher suites that are not supported by the underlying operating system.
</p>
<h2 id="resolved-issues">
Resolved issues
</h2>
<ul>
<li>
<p>
RS72866 - Improved performance for client connections which use TLS
</p>
</li>
<li>
<p>
RS78241 - Fixed shard placement to always respect rack-zone restrictions and avoid a state where a primary (master) and replica are on the same rack, even if temporarily
</p>
</li>
<li>
<p>
RS78144 - Removed the dependency on system-wide
<code>
ldconfig
</code>
so non-interactive processes will use their own dynamic libraries without impacting external services
</p>
</li>
<li>
<p>
RS78028 - Fixed race condition during rolling upgrade that might result in shards repeatedly restarting
</p>
</li>
<li>
<p>
RS77964 - Fixed module deletion to remove the old directory with the module
</p>
</li>
<li>
<p>
RS75259 - Fixed node to prevent using plain text communication instead of TLS after losing connectivity
</p>
</li>
<li>
<p>
RS69616 - Fixed validation for internode communication ports
</p>
</li>
<li>
<p>
RS83535 - Fixed
<code>
sentinel_service
</code>
to start on RHEL 8 with DISA STIG profile
</p>
</li>
<li>
<p>
RS87191 - Fixed a cross slot error when using Auto Tiering with Replica Of, in case a key on the source database swapped from RAM to flash and expired while it was also part of Lua script execution
</p>
</li>
</ul>
<h2 id="known-limitations">
Known limitations
</h2>
<h3 id="feature-limitations">
Feature limitations
</h3>
<ul>
<li>
RS101204 - High memory consumption caused by the
<code>
persistence_mgr
</code>
service when AOF persistence is configured for every second. Monitor RAM usage of the process. In case of high usage, the temporary workaround is to restart the service by running
<code>
supervisorctl restart persistence_mgr
</code>
. A permanent fix is to install or upgrade to the 6.4.2 June maintenance release.
</li>
</ul>
<h3 id="upgrade-limitations">
Upgrade limitations
</h3>
<p>
Before you upgrade a cluster that hosts Active-Active databases with modules to v6.4.2-30, perform the following steps:
</p>
<ol>
<li>
<p>
Use
<code>
crdb-cli
</code>
to verify that the modules (
<code>
modules
</code>
) and their versions (in
<code>
module_list
</code>
) are as they appear in the database configuration and in the default database configuration:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">crdb-cli crdb get --crdb-guid <crdb-guid>
</span></span></code></pre>
</div>
</li>
<li>
<p>
From the admin console's
<strong>
redis modules
</strong>
tab, validate that these modules with their specific versions are loaded to the cluster.
</p>
</li>
<li>
<p>
If one or more of the modules/versions are missing or if you need help,
<a href="https://redis.com/company/support/">
contact Redis support
</a>
before taking additional steps.
</p>
</li>
</ol>
<p>
This limitation has been fixed and resolved as of
<a href="/docs/latest/operate/rs/release-notes/rs-6-4-2-releases/rs-6-4-2-43/">
v6.4.2-43
</a>
.
</p>
<h3 id="operating-system-limitations">
Operating system limitations
</h3>
<h4 id="rhel-7-and-rhel-8">
RHEL 7 and RHEL 8
</h4>
<p>
If you have a custom installation with a non-default
<code>
$installdir
</code>
and use Active-Active or Auto Tiering features, failures might occur when you upgrade. This issue will be fixed in a future maintenance release.
</p>
<h4 id="rhel-8">
RHEL 8
</h4>
<p>
Due to module binary differences between RHEL 7 and RHEL 8, you cannot upgrade RHEL 7 clusters to RHEL 8 when they host databases using modules. Instead, you need to create a new cluster on RHEL 8 and then migrate existing data from your RHEL 7 cluster. This does not apply to clusters that do not use modules.
</p>
<h2 id="security">
Security
</h2>
<h4 id="open-source-redis-security-fixes-compatibility">
Open source Redis security fixes compatibility
</h4>
<p>
As part of Redis's commitment to security, Redis Enterprise Software implements the latest
<a href="https://github.com/redis/redis/releases">
security fixes
</a>
available with
<a href="https://github.com/redis/redis">
open source Redis
</a>
. The following open source Redis
<a href="https://github.com/redis/redis/security/advisories">
CVEs
</a>
do not affect Redis Enterprise:
</p>
<ul>
<li>
<p>
<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-32625">
CVE-2021-32625
</a>
β Redis Enterprise is not impacted by the CVE that was found and fixed in open source Redis since Redis Enterprise does not implement LCS. Additional information about the open source Redis fix is on the
<a href="https://github.com/redis/redis/releases">
Redis GitHub page
</a>
(Redis 6.2.4, Redis 6.0.14)
</p>
</li>
<li>
<p>
<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-32672">
CVE-2021-32672
</a>
β Redis Enterprise is not impacted by the CVE that was found and fixed in open source Redis because the LUA debugger is unsupported in Redis Enterprise. Additional information about the open source Redis fix is on the
<a href="https://github.com/redis/redis/releases">
Redis GitHub page
</a>
(Redis 6.2.6, Redis 6.0.16)
</p>
</li>
<li>
<p>
<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-32675">
CVE-2021-32675
</a>
β Redis Enterprise is not impacted by the CVE that was found and fixed in open source Redis because the proxy in Redis Enterprise does not forward unauthenticated requests. Additional information about the open source Redis fix is on the
<a href="https://github.com/redis/redis/releases">
Redis GitHub page
</a>
(Redis 6.2.6, Redis 6.0.16)
</p>
</li>
<li>
<p>
<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-32762">
CVE-2021-32762
</a>
β Redis Enterprise is not impacted by the CVE that was found and fixed in open source Redis because the memory allocator used in Redis Enterprise is not vulnerable. Additional information about the open source Redis fix is on the
<a href="https://github.com/redis/redis/releases">
Redis GitHub page
</a>
(Redis 6.2.6, Redis 6.0.16)
</p>
</li>
<li>
<p>
<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-41099">
CVE-2021-41099
</a>
β Redis Enterprise is not impacted by the CVE that was found and fixed in open source Redis because the
<code>
proto-max-bulk-len CONFIG
</code>
is blocked in Redis Enterprise. Additional information about the open source Redis fix is on the
<a href="https://github.com/redis/redis/releases">
Redis GitHub page
</a>
(Redis 6.2.6, Redis 6.0.16)
</p>
</li>
</ul>
<p>
Redis Enterprise has already included the fixes for the relevant CVEs. Some CVEs announced for open source Redis do not affect Redis Enterprise due to different and additional functionality available in Redis Enterprise that is not available in open source Redis.
</p>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/release-notes/rs-6-4-2-releases/rs-6-4-2-30/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/kubernetes/re-clusters/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Redis Enterprise clusters (REC)
</h1>
<p class="text-lg -mt-5 mb-10">
Articles to help you manage your Redis Enterprise clusters (REC).
</p>
<p>
This section contains articles to help you manage your Redis Enterprise clusters (REC).
</p>
<nav>
<a href="/docs/latest/operate/kubernetes/re-clusters/connect-to-admin-console/">
Connect to the admin console
</a>
<p>
Connect to the Redis Enterprise admin console to manage your Redis Enterprise cluster.
</p>
<a href="/docs/latest/operate/kubernetes/re-clusters/auto-tiering/">
Use Auto Tiering on Kubernetes
</a>
<p>
Deploy a cluster with Auto Tiering on Kubernetes.
</p>
<a href="/docs/latest/operate/kubernetes/re-clusters/multi-namespace/">
Manage databases in multiple namespaces
</a>
<p>
Redis Enterprise for Kubernetes allows you to deploy to multiple namespaces within your Kubernetes cluster. This article shows you how to configure your Redis Enterprise cluster to connect to databases in multiple namespaces
</p>
<a href="/docs/latest/operate/kubernetes/re-clusters/cluster-recovery/">
Recover a Redis Enterprise cluster on Kubernetes
</a>
<p>
This task describes how to recover a Redis Enterprise cluster on Kubernetes.
</p>
<a href="/docs/latest/operate/kubernetes/re-clusters/expand-pvc/">
Expand PersistentVolumeClaim (PVC)
</a>
<p>
Expand your persistent volume claim by editing the REC.
</p>
<a href="/docs/latest/operate/kubernetes/re-clusters/connect-prometheus-operator/">
Connect the Prometheus operator to Redis Enterprise for Kubernetes
</a>
<p>
This article describes how to configure a Prometheus operator custom resource to allow it to export metrics from Redis Enterprise for Kubernetes.
</p>
</nav>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/kubernetes/re-clusters/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/7.4/references/rest-api/requests/bdbs/syncer_state/crdt/.html | <section class="prose w-full py-12 max-w-none">
<h1>
CRDT syncer state requests
</h1>
<p class="text-lg -mt-5 mb-10">
CRDT syncer state requests
</p>
<table>
<thead>
<tr>
<th>
Method
</th>
<th>
Path
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="#get-syncer-state">
GET
</a>
</td>
<td>
<code>
/v1/bdbs/{uid}/syncer_state/crdt
</code>
</td>
<td>
Get a CRDB's syncer state
</td>
</tr>
</tbody>
</table>
<h2 id="get-syncer-state">
Get CRDB syncer state
</h2>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">GET /v1/bdbs/<span class="o">{</span>int: uid<span class="o">}</span>/syncer_state/crdt
</span></span></code></pre>
</div>
<p>
Get a CRDB's syncer state as JSON.
</p>
<h3 id="permissions">
Permissions
</h3>
<table>
<thead>
<tr>
<th>
Permission name
</th>
<th>
Roles
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="/docs/latest/operate/rs/7.4/references/rest-api/permissions/#view_bdb_info">
view_bdb_info
</a>
</td>
<td>
admin
<br/>
cluster_member
<br/>
cluster_viewer
<br/>
db_member
<br/>
db_viewer
</td>
</tr>
</tbody>
</table>
<h3 id="get-request">
Request
</h3>
<h4 id="example-http-request">
Example HTTP request
</h4>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">GET /v1/bdbs/1/syncer_state/crdt
</span></span></code></pre>
</div>
<h4 id="headers">
Headers
</h4>
<table>
<thead>
<tr>
<th>
Key
</th>
<th>
Value
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
Host
</td>
<td>
The domain name or IP of the cluster.
</td>
</tr>
<tr>
<td>
Accept
</td>
<td>
application/json
</td>
</tr>
</tbody>
</table>
<h4 id="url-parameters">
URL parameters
</h4>
<table>
<thead>
<tr>
<th>
Field
</th>
<th>
Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
uid
</td>
<td>
integer
</td>
<td>
The unique ID of the database requested.
</td>
</tr>
</tbody>
</table>
<h3 id="get-response">
Response
</h3>
<p>
Returns a JSON object that represents the syncer state.
</p>
<h4 id="example-json-body">
Example JSON body
</h4>
<div class="highlight">
<pre class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"DB"</span><span class="p">:</span> <span class="mi">22</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"RunID"</span><span class="p">:</span> <span class="mi">1584086516</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="c1">// additional fields...
</span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="p">}</span>
</span></span></code></pre>
</div>
<h4 id="get-status-codes">
Status codes
</h4>
<table>
<thead>
<tr>
<th>
Code
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1">
200 OK
</a>
</td>
<td>
OK
</td>
</tr>
<tr>
<td>
<a href="https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5">
404 Not Found
</a>
</td>
<td>
Syncer state key does not exist
</td>
</tr>
<tr>
<td>
<a href="https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.1">
500 Internal Server Error
</a>
</td>
<td>
Internal error
</td>
</tr>
<tr>
<td>
<a href="https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.4">
503 Service Unavailable
</a>
</td>
<td>
Redis connection error, service unavailable
</td>
</tr>
</tbody>
</table>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/references/rest-api/requests/bdbs/syncer_state/crdt/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/7.4/databases/import-export/migrate-to-active-active/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Migrate a database to Active-Active
</h1>
<p class="text-lg -mt-5 mb-10">
Use Replica Of to migrate your database to an Active-Active database.
</p>
<p>
If you have data in a single-region Redis Enterprise Software database that you want to migrate to an
<a href="/docs/latest/operate/rs/7.4/databases/active-active/">
Active-Active database
</a>
,
you'll need to create a new Active-Active database and migrate the data into the new database as a
<a href="/docs/latest/operate/rs/7.4/databases/import-export/replica-of/">
Replica Of
</a>
the existing database.
This process will gradually populate the data in the Active-Active database.
</p>
<p>
Before data migration starts, all data is flushed from the Active-Active database.
The data is migrated to the Active-Active instance where you configured migration, and the data from that instance is copied to the other Active-Active instances.
</p>
<p>
When data migration is finished, turn off migration and connect your applications to the Active-Active database.
</p>
<a href="/docs/latest/images/rs/A-A_migration.png" sdata-lightbox="/images/rs/A-A_migration.png">
<img alt="Active-Active data migration process" src="/docs/latest/images/rs/A-A_migration.png" width="75%"/>
</a>
<h2 id="prerequisites">
Prerequisites
</h2>
<ul>
<li>
<p>
During the migration, any applications that connect to the Active-Active database must be
<strong>
read-only
</strong>
to ensure the dataset is identical to the source database during the migration process. However, you can continue to write to the source database during the migration process.
</p>
</li>
<li>
<p>
If you used the mDNS protocol for the cluster name (FQDN),
the
<a href="/docs/latest/operate/rs/7.4/networking/mdns/">
client mDNS prerequisites
</a>
must be met in order to communicate with other clusters.
</p>
</li>
</ul>
<h2 id="migrate-from-a-redis-enterprise-cluster">
Migrate from a Redis Enterprise cluster
</h2>
<p>
You can migrate a Redis Enterprise database from the
<a href="#migrate-from-the-same-cluster">
same cluster
</a>
or a
<a href="#migrate-from-a-different-cluster">
different cluster
</a>
.
</p>
<h3 id="migrate-from-the-same-cluster">
Migrate from the same cluster
</h3>
<p>
To migrate a database to Active-Active in the same Redis Enterprise cluster:
</p>
<ol>
<li>
<p>
Create a new Active-Active database. For prerequisites and detailed instructions, see
<a href="/docs/latest/operate/rs/7.4/databases/active-active/create/">
Create an Active-Active geo-replicated database
</a>
.
</p>
</li>
<li>
<p>
After the Active-Active database is active, click
<strong>
Edit
</strong>
on the
<strong>
Configuration
</strong>
screen.
</p>
</li>
<li>
<p>
Expand the
<strong>
Migrate to Active-Active
</strong>
section:
</p>
<a href="/docs/latest/images/rs/screenshots/databases/migrate-to-active-active/migrate-to-active-active-section.png" sdata-lightbox="/images/rs/screenshots/databases/migrate-to-active-active/migrate-to-active-active-section.png">
<img alt="Migrate to Active-Active section." src="/docs/latest/images/rs/screenshots/databases/migrate-to-active-active/migrate-to-active-active-section.png"/>
</a>
</li>
<li>
<p>
Click
<strong>
+ Add source database
</strong>
.
</p>
</li>
<li>
<p>
In the
<strong>
Migrate to Active-Active
</strong>
dialog, select
<strong>
Current cluster
</strong>
:
</p>
<a href="/docs/latest/images/rs/screenshots/databases/migrate-to-active-active/migrate-to-active-active-dialog-current-cluster.png" sdata-lightbox="/images/rs/screenshots/databases/migrate-to-active-active/migrate-to-active-active-dialog-current-cluster.png">
<img alt="Migrate to Active-Active dialog with Current cluster tab selected." src="/docs/latest/images/rs/screenshots/databases/migrate-to-active-active/migrate-to-active-active-dialog-current-cluster.png"/>
</a>
</li>
<li>
<p>
Select the source database from the list.
</p>
</li>
<li>
<p>
Click
<strong>
Add source
</strong>
.
</p>
</li>
<li>
<p>
Click
<strong>
Save
</strong>
.
</p>
</li>
</ol>
<h3 id="migrate-from-a-different-cluster">
Migrate from a different cluster
</h3>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Note:
</div>
For a source database on a different Redis Enterprise Software cluster,
you can
<a href="/docs/latest/operate/rs/7.4/databases/import-export/replica-of/#data-compression-for-replica-of">
compress the replication data
</a>
to save bandwidth.
</div>
</div>
<p>
To migrate a database to Active-Active in different Redis Enterprise clusters:
</p>
<ol>
<li>
<p>
Sign in to the Cluster Manager UI of the cluster hosting the source database.
</p>
<ol>
<li>
<p>
In
<strong>
Databases
</strong>
, select the source database and then select the
<strong>
Configuration
</strong>
tab.
</p>
</li>
<li>
<p>
In the
<strong>
Replica Of
</strong>
section, select
<strong>
Use this database as a source for another database
</strong>
.
</p>
</li>
<li>
<p>
Copy the Replica Of source URL.
</p>
<a href="/docs/latest/images/rs/screenshots/databases/config-replica-of-copy-source-url.png" sdata-lightbox="/images/rs/screenshots/databases/config-replica-of-copy-source-url.png">
<img alt="Copy the Replica Of source URL from the Connection link to destination dialog." src="/docs/latest/images/rs/screenshots/databases/config-replica-of-copy-source-url.png"/>
</a>
<p>
To change the internal password, select
<strong>
Regenerate password
</strong>
.
</p>
<p>
If you regenerate the password, replication to existing destinations fails until their credentials are updated with the new password.
</p>
</li>
</ol>
</li>
<li>
<p>
Sign in to the Cluster Manager UI of the destination databaseβs cluster.
</p>
</li>
<li>
<p>
Create a new Active-Active database. For prerequisites and detailed instructions, see
<a href="/docs/latest/operate/rs/7.4/databases/active-active/create/">
Create an Active-Active geo-replicated database
</a>
.
</p>
</li>
<li>
<p>
After the Active-Active database is active, click
<strong>
Edit
</strong>
on the
<strong>
Configuration
</strong>
screen.
</p>
</li>
<li>
<p>
Expand the
<strong>
Migrate to Active-Active
</strong>
section:
</p>
<a href="/docs/latest/images/rs/screenshots/databases/migrate-to-active-active/migrate-to-active-active-section.png" sdata-lightbox="/images/rs/screenshots/databases/migrate-to-active-active/migrate-to-active-active-section.png">
<img alt="Migrate to Active-Active section." src="/docs/latest/images/rs/screenshots/databases/migrate-to-active-active/migrate-to-active-active-section.png"/>
</a>
</li>
<li>
<p>
Click
<strong>
+ Add source database
</strong>
.
</p>
</li>
<li>
<p>
In the
<strong>
Migrate to Active-Active
</strong>
dialog, select
<strong>
External
</strong>
:
</p>
<a href="/docs/latest/images/rs/screenshots/databases/migrate-to-active-active/migrate-to-active-active-dialog-external.png" sdata-lightbox="/images/rs/screenshots/databases/migrate-to-active-active/migrate-to-active-active-dialog-external.png">
<img alt="Migrate to Active-Active dialog with External tab selected." src="/docs/latest/images/rs/screenshots/databases/migrate-to-active-active/migrate-to-active-active-dialog-external.png"/>
</a>
</li>
<li>
<p>
For
<strong>
Source database URL
</strong>
, enter the Replica Of source URL you copied in step 1.
</p>
</li>
<li>
<p>
Click
<strong>
Add source
</strong>
.
</p>
</li>
<li>
<p>
Click
<strong>
Save
</strong>
.
</p>
</li>
</ol>
<h2 id="migrate-from-redis-community-edition">
Migrate from Redis Community Edition
</h2>
<p>
To migrate a Redis Community Edition database to Active-Active:
</p>
<ol>
<li>
<p>
Create a new Active-Active database. For prerequisites and detailed instructions, see
<a href="/docs/latest/operate/rs/7.4/databases/active-active/create/">
Create an Active-Active geo-replicated database
</a>
.
</p>
</li>
<li>
<p>
After the Active-Active database is active, click
<strong>
Edit
</strong>
on the
<strong>
Configuration
</strong>
screen.
</p>
</li>
<li>
<p>
Expand the
<strong>
Migrate to Active-Active
</strong>
section:
</p>
<a href="/docs/latest/images/rs/screenshots/databases/migrate-to-active-active/migrate-to-active-active-section.png" sdata-lightbox="/images/rs/screenshots/databases/migrate-to-active-active/migrate-to-active-active-section.png">
<img alt="Migrate to Active-Active section." src="/docs/latest/images/rs/screenshots/databases/migrate-to-active-active/migrate-to-active-active-section.png"/>
</a>
</li>
<li>
<p>
Click
<strong>
+ Add source database
</strong>
.
</p>
</li>
<li>
<p>
In the
<strong>
Migrate to Active-Active
</strong>
dialog, select
<strong>
External
</strong>
:
</p>
<a href="/docs/latest/images/rs/screenshots/databases/migrate-to-active-active/migrate-to-active-active-dialog-external.png" sdata-lightbox="/images/rs/screenshots/databases/migrate-to-active-active/migrate-to-active-active-dialog-external.png">
<img alt="Migrate to Active-Active dialog with External tab selected." src="/docs/latest/images/rs/screenshots/databases/migrate-to-active-active/migrate-to-active-active-dialog-external.png"/>
</a>
</li>
<li>
<p>
Enter the
<strong>
Source database URL
</strong>
:
</p>
<ul>
<li>
<p>
If the database has a password:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">redis://:<password>@<host>:<port>
</span></span></code></pre>
</div>
<p>
Where the password is the Redis password represented with URL encoding escape characters.
</p>
</li>
<li>
<p>
If the database does not have a password:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">redis://<host>:<port>
</span></span></code></pre>
</div>
</li>
</ul>
</li>
<li>
<p>
Click
<strong>
Add source
</strong>
.
</p>
</li>
<li>
<p>
Click
<strong>
Save
</strong>
.
</p>
</li>
</ol>
<h2 id="stop-sync-after-migration">
Stop sync after migration
</h2>
<ol>
<li>
<p>
Wait until the migration is complete, indicated by the
<strong>
Status
</strong>
<em>
Synced
</em>
.
</p>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Note:
</div>
Migration can take minutes to hours to complete depending on the dataset size and network quality.
</div>
</div>
</li>
<li>
<p>
On the Active-Active database's
<strong>
Configuration
</strong>
screen, click
<strong>
Edit
</strong>
.
</p>
</li>
<li>
<p>
In the
<strong>
Migrate to Active-Active
</strong>
section, click
<strong>
Stop sync
</strong>
:
</p>
<a href="/docs/latest/images/rs/screenshots/databases/migrate-to-active-active/migrate-to-active-active-synced.png" sdata-lightbox="/images/rs/screenshots/databases/migrate-to-active-active/migrate-to-active-active-synced.png">
<img alt="The Migrate to Active-Active section shows the Active-Active database is synced with the source database." src="/docs/latest/images/rs/screenshots/databases/migrate-to-active-active/migrate-to-active-active-synced.png"/>
</a>
</li>
<li>
<p>
In the
<strong>
Stop synchronization
</strong>
dialog, click
<strong>
Stop
</strong>
to proceed.
</p>
</li>
<li>
<p>
Redirect client connections to the Active-Active database after
<strong>
Status
</strong>
changes to
<em>
Sync stopped
</em>
:
</p>
<a href="/docs/latest/images/rs/screenshots/databases/migrate-to-active-active/migrate-to-active-active-sync-stopped.png" sdata-lightbox="/images/rs/screenshots/databases/migrate-to-active-active/migrate-to-active-active-sync-stopped.png">
<img alt="The Migrate to Active-Active section shows the Active-Active database stopped syncing with the source database." src="/docs/latest/images/rs/screenshots/databases/migrate-to-active-active/migrate-to-active-active-sync-stopped.png"/>
</a>
</li>
</ol>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/databases/import-export/migrate-to-active-active/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/upgrade/.html | <section class="prose w-full py-12 max-w-none">
<h1>
rladmin upgrade
</h1>
<p class="text-lg -mt-5 mb-10">
Upgrades the version of a module or Redis Enterprise Software for a database.
</p>
<p>
Upgrades the version of a module or Redis Enterprise Software for a database.
</p>
<h2 id="upgrade-db">
<code>
upgrade db
</code>
</h2>
<p>
Schedules a restart of the primary and replica processes of a database and then upgrades the database to the latest version of Redis Enterprise Software.
</p>
<p>
For more information, see
<a href="/docs/latest/operate/rs/7.4/installing-upgrading/upgrading/">
Upgrade an existing Redis Software Deployment
</a>
.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin upgrade db <span class="o">{</span> db:<id> <span class="p">|</span> <name> <span class="o">}</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> preserve_roles <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> keep_redis_version <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> discard_data <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> force_discard <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> parallel_shards_upgrade <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> keep_crdt_protocol_version <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> redis_version <version> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> force <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> <span class="o">{</span> latest_with_modules <span class="p">|</span> and module module_name <module name> version <version> module_args <arguments string> <span class="o">}</span> <span class="o">]</span>
</span></span></code></pre>
</div>
<p>
As of v6.2.4, the default behavior for
<code>
upgrade db
</code>
has changed. It is now controlled by a new parameter that sets the default upgrade policy used to create new databases and to upgrade ones already in the cluster. To learn more, see
<a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/tune/#tune-cluster">
<code>
tune cluster default_redis_version
</code>
</a>
.
</p>
<h3 id="parameters">
Parameters
</h3>
<table>
<thead>
<tr>
<th>
Parameters
</th>
<th>
Type/Value
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
db
</td>
<td>
db:<id>
<br/>
name
</td>
<td>
Database to upgrade
</td>
</tr>
<tr>
<td>
and module
</td>
<td>
<a href="#upgrade-module">
upgrade module
</a>
command
</td>
<td>
Clause that allows the upgrade of a database and a specified Redis module in a single step with only one restart (can be specified multiple times)
</td>
</tr>
<tr>
<td>
discard_data
</td>
<td>
</td>
<td>
Indicates that data will not be saved after the upgrade
</td>
</tr>
<tr>
<td>
force
</td>
<td>
</td>
<td>
Forces upgrade and skips warnings and confirmations
</td>
</tr>
<tr>
<td>
force_discard
</td>
<td>
</td>
<td>
Forces
<code>
discard_data
</code>
if replication or persistence is enabled
</td>
</tr>
<tr>
<td>
keep_crdt_protocol_version
</td>
<td>
</td>
<td>
Keeps the current CRDT protocol version
</td>
</tr>
<tr>
<td>
keep_redis_version
</td>
<td>
</td>
<td>
Upgrades to a new patch release, not to the latest major.minor version
</td>
</tr>
<tr>
<td>
latest_with_modules
</td>
<td>
</td>
<td>
Upgrades the Redis Enterprise Software version and all modules in the database
</td>
</tr>
<tr>
<td>
parallel_shards_upgrade
</td>
<td>
integer
<br/>
'all'
</td>
<td>
Maximum number of shards to upgrade all at once
</td>
</tr>
<tr>
<td>
preserve_roles
</td>
<td>
</td>
<td>
Performs an additional failover to guarantee the shards' roles are preserved
</td>
</tr>
<tr>
<td>
redis_version
</td>
<td>
Redis version
</td>
<td>
Upgrades the database to the specified version instead of the latest version
</td>
</tr>
</tbody>
</table>
<h3 id="returns">
Returns
</h3>
<p>
Returns
<code>
Done
</code>
if the upgrade completed. Otherwise, it returns an error.
</p>
<h3 id="example">
Example
</h3>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ rladmin upgrade db db:5
</span></span><span class="line"><span class="cl">Monitoring e39c8e87-75f9-4891-8c86-78cf151b720b
</span></span><span class="line"><span class="cl">active - SMUpgradeBDB init
</span></span><span class="line"><span class="cl">active - SMUpgradeBDB check_slaves
</span></span><span class="line"><span class="cl">.active - SMUpgradeBDB prepare
</span></span><span class="line"><span class="cl">active - SMUpgradeBDB stop_forwarding
</span></span><span class="line"><span class="cl">oactive - SMUpgradeBDB start_wd
</span></span><span class="line"><span class="cl">active - SMUpgradeBDB wait_for_version
</span></span><span class="line"><span class="cl">.completed - SMUpgradeBDB
</span></span><span class="line"><span class="cl">Done
</span></span></code></pre>
</div>
<h2 id="upgrade-module">
<code>
upgrade module
</code>
</h2>
<p>
Upgrades Redis modules in use by a specific database.
</p>
<p>
For more information, see
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/install/upgrade-module/">
Upgrade modules
</a>
.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin upgrade module
</span></span><span class="line"><span class="cl"> db_name <span class="o">{</span> db:<id> <span class="p">|</span> <name> <span class="o">}</span>
</span></span><span class="line"><span class="cl"> module_name <mod_name>
</span></span><span class="line"><span class="cl"> version <version>
</span></span><span class="line"><span class="cl"> module_args <args_str>
</span></span></code></pre>
</div>
<h3 id="parameters-1">
Parameters
</h3>
<table>
<thead>
<tr>
<th>
Parameters
</th>
<th>
Type/Value
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
db_name
</td>
<td>
db:<id>
<br/>
name
</td>
<td>
Upgrade a module for the specified database
</td>
</tr>
<tr>
<td>
module_name
</td>
<td>
'ReJSON'
<br/>
'graph'
<br/>
'search'
<br/>
'bf'
<br/>
'rg'
<br/>
'timeseries'
</td>
<td>
Redis module to upgrade
</td>
</tr>
<tr>
<td>
version
</td>
<td>
module version number
</td>
<td>
Upgrades the module to the specified version
</td>
</tr>
<tr>
<td>
module_args
</td>
<td>
'keep_args'
<br/>
string
</td>
<td>
Module configuration options
</td>
</tr>
</tbody>
</table>
<p>
For more information about module configuration options, see
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/install/add-module-to-database/#module-configuration-options">
Module configuration options
</a>
.
</p>
<h3 id="returns-1">
Returns
</h3>
<p>
Returns
<code>
Done
</code>
if the upgrade completed. Otherwise, it returns an error.
</p>
<h3 id="example-1">
Example
</h3>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ rladmin upgrade module db_name db:8 module_name graph version <span class="m">20812</span> module_args <span class="s2">""</span>
</span></span><span class="line"><span class="cl">Monitoring 21ac7659-e44c-4cc9-b243-a07922b2a6cc
</span></span><span class="line"><span class="cl">active - SMUpgradeBDB init
</span></span><span class="line"><span class="cl">active - SMUpgradeBDB wait_for_version
</span></span><span class="line"><span class="cl">Ocompleted - SMUpgradeBDB
</span></span><span class="line"><span class="cl">Done
</span></span></code></pre>
</div>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/upgrade/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/failover/.html | <section class="prose w-full py-12 max-w-none">
<h1>
rladmin failover
</h1>
<p class="text-lg -mt-5 mb-10">
Fail over primary shards of a database to their replicas.
</p>
<p>
Fails over one or more primary (also known as master) shards of a database and promotes their respective replicas to primary shards.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin failover
</span></span><span class="line"><span class="cl"> <span class="o">[</span>db <span class="o">{</span> db:<id> <span class="p">|</span> <name> <span class="o">}]</span>
</span></span><span class="line"><span class="cl"> shard <id1 ... idN>
</span></span><span class="line"><span class="cl"> <span class="o">[</span>immediate<span class="o">]</span>
</span></span></code></pre>
</div>
<h3 id="parameters">
Parameters
</h3>
<table>
<thead>
<tr>
<th>
Parameter
</th>
<th>
Type/Value
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
db
</td>
<td>
db:<id>
<br/>
name
</td>
<td>
Fail over shards for the specified database
</td>
</tr>
<tr>
<td>
shard
</td>
<td>
one or more primary shard IDs
</td>
<td>
Primary shard or shards to fail over
</td>
</tr>
<tr>
<td>
immediate
</td>
<td>
</td>
<td>
Perform failover without verifying the replica shards are in full sync with the master shards
</td>
</tr>
</tbody>
</table>
<h3 id="returns">
Returns
</h3>
<p>
Returns
<code>
Finished successfully
</code>
if the failover completed. Otherwise, it returns an error.
</p>
<p>
Use
<a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/status/#status-shards">
<code>
rladmin status shards
</code>
</a>
to verify that the failover completed.
</p>
<h3 id="example">
Example
</h3>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ rladmin status shards
</span></span><span class="line"><span class="cl">SHARDS:
</span></span><span class="line"><span class="cl">DB:ID NAME ID NODE ROLE SLOTS USED_MEMORY STATUS
</span></span><span class="line"><span class="cl">db:5 tr01 redis:12 node:1 slave 0-16383 3.02MB OK
</span></span><span class="line"><span class="cl">db:5 tr01 redis:13 node:2 master 0-16383 3.09MB OK
</span></span><span class="line"><span class="cl">$ rladmin failover shard <span class="m">13</span>
</span></span><span class="line"><span class="cl">Executing shard fail-over: OOO.
</span></span><span class="line"><span class="cl">Finished successfully
</span></span><span class="line"><span class="cl">$ rladmin status shards
</span></span><span class="line"><span class="cl">SHARDS:
</span></span><span class="line"><span class="cl">DB:ID NAME ID NODE ROLE SLOTS USED_MEMORY STATUS
</span></span><span class="line"><span class="cl">db:5 tr01 redis:12 node:1 master 0-16383 3.12MB OK
</span></span><span class="line"><span class="cl">db:5 tr01 redis:13 node:2 slave 0-16383 2.99MB OK
</span></span></code></pre>
</div>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/failover/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/7.4/clusters/optimize/oss-cluster-api/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Redis OSS Cluster API
</h1>
<p class="text-lg -mt-5 mb-10">
Use the Redis OSS Cluster API to improve performance and keep applications current with cluster topology changes.
</p>
<p>
OSS Cluster API reduces access times and latency with near-linear scalability.
The OSS Cluster API provides a simple mechanism for Redis clients to know the cluster topology.
</p>
<p>
Clients must first connect to the master node to get the cluster topology,
and then they connect directly to the Redis proxy on each node that hosts a master shard.
</p>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Note:
</div>
You must use a client that supports the cluster API to connect to a database
that has the cluster API enabled.
</div>
</div>
<p>
You can use the Redis OSS Cluster API along with other Redis Enterprise Software high availability
to get high performance with low latency
and let applications stay current with cluster topology changes, including add node, remove node, and node failover.
</p>
<p>
For more about working with the OSS Cluster API in Redis Enterprise Software, see
<a href="/docs/latest/operate/rs/7.4/databases/configure/oss-cluster-api/">
Enable OSS Cluster API
</a>
.
</p>
<p>
To learn how to enable OSS Cluster API in Redis Cloud, see
<a href="/docs/latest/operate/rc/databases/configuration/clustering/#cluster-api">
Clustering Redis databases
</a>
.
</p>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/clusters/optimize/oss-cluster-api/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/tune/.html | <section class="prose w-full py-12 max-w-none">
<h1>
rladmin tune
</h1>
<p class="text-lg -mt-5 mb-10">
Configures parameters for databases, proxies, nodes, and clusters.
</p>
<p>
Configures parameters for databases, proxies, nodes, and clusters.
</p>
<h2 id="tune-cluster">
<code>
tune cluster
</code>
</h2>
<p>
Configures cluster parameters.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin tune cluster
</span></span><span class="line"><span class="cl"> <span class="o">[</span> repl_diskless <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> redis_provision_node_threshold <size> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> redis_migrate_node_threshold <size> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> redis_provision_node_threshold_percent <percent> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> redis_migrate_node_threshold_percent <percent> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> max_simultaneous_backups <number> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> failure_detection_sensitivity <span class="o">{</span> high <span class="p">|</span> low <span class="o">}</span> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> watchdog_profile <span class="o">{</span> cloud <span class="p">|</span> local-network <span class="o">}</span> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> slave_ha <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> slave_ha_grace_period <seconds> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> slave_ha_cooldown_period <seconds> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> slave_ha_bdb_cooldown_period <seconds> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> max_saved_events_per_type <value> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> parallel_shards_upgrade <value> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> default_concurrent_restore_actions <value> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> show_internals <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> expose_hostnames_for_all_suffixes <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> redis_upgrade_policy <span class="o">{</span> latest <span class="p">|</span> major <span class="o">}</span> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> default_redis_version <value> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> default_non_sharded_proxy_policy <span class="o">{</span> single <span class="p">|</span> all-master-shards <span class="p">|</span> all-nodes <span class="o">}</span> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> default_sharded_proxy_policy <span class="o">{</span> single <span class="p">|</span> all-master-shards <span class="p">|</span> all-nodes <span class="o">}</span> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> default_shards_placement <span class="o">{</span> dense <span class="p">|</span> sparse <span class="o">}</span> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> data_internode_encryption <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> db_conns_auditing <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> acl_pubsub_default <span class="o">{</span> resetchannels <span class="p">|</span> allchannels <span class="o">}</span> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> resp3_default <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> automatic_node_offload <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span>
</span></span></code></pre>
</div>
<h3 id="parameters">
Parameters
</h3>
<table>
<thead>
<tr>
<th>
Parameters
</th>
<th>
Type/Value
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
acl_pubsub_default
</td>
<td>
<code>
resetchannels
</code>
<br/>
<code>
allchannels
</code>
</td>
<td>
Default pub/sub ACL rule for all databases in the cluster:
<br/>
β’
<code>
resetchannels
</code>
blocks access to all channels (restrictive)
<br/>
β’
<code>
allchannels
</code>
allows access to all channels (permissive)
</td>
</tr>
<tr>
<td>
automatic_node_offload
</td>
<td>
<code>
enabled
</code>
<br/>
<code>
disabled
</code>
</td>
<td>
Define whether automatic node offload migration will take place
</td>
</tr>
<tr>
<td>
data_internode_encryption
</td>
<td>
<code>
enabled
</code>
<br/>
<code>
disabled
</code>
</td>
<td>
Activates or deactivates
<a href="/docs/latest/operate/rs/7.4/security/encryption/internode-encryption/">
internode encryption
</a>
for new databases
</td>
</tr>
<tr>
<td>
db_conns_auditing
</td>
<td>
<code>
enabled
</code>
<br/>
<code>
disabled
</code>
</td>
<td>
Activates or deactivates
<a href="/docs/latest/operate/rs/7.4/security/audit-events/">
connection auditing
</a>
by default for new databases of a cluster
</td>
</tr>
<tr>
<td>
default_concurrent_restore_actions
</td>
<td>
integer
<br/>
<code>
all
</code>
</td>
<td>
Default number of concurrent actions when restoring a node from a snapshot (positive integer or "all")
</td>
</tr>
<tr>
<td>
default_non_sharded_proxy_policy
</td>
<td>
<code>
single
</code>
<br/>
<br/>
<code>
all-master-shards
</code>
<br/>
<br/>
<code>
all-nodes
</code>
</td>
<td>
Default
<a href="/docs/latest/operate/rs/7.4/databases/configure/proxy-policy/">
proxy policy
</a>
for newly created non-sharded databases' endpoints
</td>
</tr>
<tr>
<td>
default_redis_version
</td>
<td>
version number
</td>
<td>
The default Redis database compatibility version used to create new databases.
<br/>
<br/>
The value parameter should be a version number in the form of "x.y" where
<em>
x
</em>
represents the major version number and
<em>
y
</em>
represents the minor version number. The final value corresponds to the desired version of Redis.
<br/>
<br/>
You cannot set
<em>
default_redis_version
</em>
to a value higher than that supported by the current
<em>
redis_upgrade_policy
</em>
value.
</td>
</tr>
<tr>
<td>
default_sharded_proxy_policy
</td>
<td>
<code>
single
</code>
<br/>
<br/>
<code>
all-master-shards
</code>
<br/>
<br/>
<code>
all-nodes
</code>
</td>
<td>
Default
<a href="/docs/latest/operate/rs/7.4/databases/configure/proxy-policy/">
proxy policy
</a>
for newly created sharded databases' endpoints
</td>
</tr>
<tr>
<td>
default_shards_placement
</td>
<td>
<code>
dense
</code>
<br/>
<code>
sparse
</code>
</td>
<td>
New databases place shards according to the default
<a href="/docs/latest/operate/rs/7.4/databases/memory-performance/shard-placement-policy/">
shard placement policy
</a>
</td>
</tr>
<tr>
<td>
expose_hostnames_for_all_suffixes
</td>
<td>
<code>
enabled
</code>
<br/>
<code>
disabled
</code>
</td>
<td>
Exposes hostnames for all DNS suffixes
</td>
</tr>
<tr>
<td>
failure_detection_sensitivity
</td>
<td>
<code>
high
</code>
<br/>
<code>
low
</code>
</td>
<td>
Predefined thresholds and timeouts for failure detection (previously known as
<code>
watchdog_profile
</code>
)
<br/>
β’
<code>
high
</code>
(previously
<code>
local-network
</code>
) β high failure detection sensitivity, lower thresholds, faster failure detection and failover
<br/>
β’
<code>
low
</code>
(previously
<code>
cloud
</code>
) β low failure detection sensitivity, higher tolerance for latency variance (also called network jitter)
</td>
</tr>
<tr>
<td>
login_lockout_counter_reset_after
</td>
<td>
time in seconds
</td>
<td>
Time after failed login attempt before the counter resets to 0
</td>
</tr>
<tr>
<td>
login_lockout_duration
</td>
<td>
time in seconds
</td>
<td>
Time a locked account remains locked ( "0" means only an admin can unlock the account)
</td>
</tr>
<tr>
<td>
login_lockout_threshold
</td>
<td>
integer
</td>
<td>
Number of failed sign-in attempts to trigger locking a user account ("0" means never lock the account)
</td>
</tr>
<tr>
<td>
max_saved_events_per_type
</td>
<td>
integer
</td>
<td>
Maximum number of events each type saved in CCS per object type
</td>
</tr>
<tr>
<td>
max_simultaneous_backups
</td>
<td>
integer (default: 4)
</td>
<td>
Number of database backups allowed to run at the same time. Combines with
<code>
max_redis_forks
</code>
(set by
<a href="#tune-node">
<code>
tune node
</code>
</a>
) to determine the number of shard backups allowed to run simultaneously.
</td>
</tr>
<tr>
<td>
parallel_shards_upgrade
</td>
<td>
integer
<br/>
<code>
all
</code>
</td>
<td>
Number of shards upgraded in parallel during DB upgrade (positive integer or "all")
</td>
</tr>
<tr>
<td>
redis_migrate_node_threshold
</td>
<td>
size in MB
</td>
<td>
Memory (in MBs by default or can be specified) needed to migrate a database between nodes
</td>
</tr>
<tr>
<td>
redis_migrate_node_threshold_percent
</td>
<td>
percentage
</td>
<td>
Memory (in percentage) needed to migrate a database between nodes
</td>
</tr>
<tr>
<td>
redis_provision_node_threshold
</td>
<td>
size in MB
</td>
<td>
Memory (in MBs by default or can be specified) needed to provision a new database
</td>
</tr>
<tr>
<td>
redis_provision_node_threshold_percent
</td>
<td>
percentage
</td>
<td>
Memory (in percentage) needed to provision a new database
</td>
</tr>
<tr>
<td>
redis_upgrade_policy
</td>
<td>
<code>
latest
</code>
<br/>
<code>
major
</code>
</td>
<td>
When you upgrade or create a new Redis database, this policy determines which version of Redis database compatibility is used.
<br/>
<br/>
Supported values are:
<ul>
<li>
<p>
<code>
latest
</code>
, which applies the most recent Redis compatibility update (
<em>
effective default prior to v6.2.4
</em>
)
</p>
<p>
</p>
</li>
<li>
<code>
major
</code>
, which applies the most recent major release compatibility update (
<em>
default as of v6.2.4
</em>
).
</li>
</ul>
</td>
</tr>
<tr>
<td>
repl_diskless
</td>
<td>
<code>
enabled
</code>
<br/>
<code>
disabled
</code>
</td>
<td>
Activates or deactivates diskless replication (can be overridden per database)
</td>
</tr>
<tr>
<td>
resp3_default
</td>
<td>
<code>
enabled
</code>
<br/>
<code>
disabled
</code>
</td>
<td>
Determines the default value of the
<code>
resp3
</code>
option upon upgrading a database to version 7.2 (defaults to
<code>
enabled
</code>
)
</td>
</tr>
<tr>
<td>
show_internals
</td>
<td>
<code>
enabled
</code>
<br/>
<code>
disabled
</code>
</td>
<td>
Controls the visibility of internal databases that are only used for the cluster's management
</td>
</tr>
<tr>
<td>
slave_ha
</td>
<td>
<code>
enabled
</code>
<br/>
<code>
disabled
</code>
</td>
<td>
Activates or deactivates
<a href="/docs/latest/operate/rs/7.4/databases/configure/replica-ha/">
replica high availability
</a>
in the cluster
<br/>
(enabled by default; use
<a href="#tune-db">
<code>
rladmin tune db
</code>
</a>
to change
<code>
slave_ha
</code>
for a specific database)
<br/>
<br/>
Deprecated as of Redis Enterprise Software v7.2.4.
</td>
</tr>
<tr>
<td>
slave_ha_bdb_cooldown_period
</td>
<td>
time in seconds (default: 7200)
</td>
<td>
Time (in seconds) a database must wait after its shards are relocated by
<a href="/docs/latest/operate/rs/7.4/databases/configure/replica-ha/">
replica high availability
</a>
before it can go through another shard migration if another node fails (default is 2 hours)
</td>
</tr>
<tr>
<td>
slave_ha_cooldown_period
</td>
<td>
time in seconds (default: 3600)
</td>
<td>
Time (in seconds)
<a href="/docs/latest/operate/rs/7.4/databases/configure/replica-ha/">
replica high availability
</a>
must wait after relocating shards due to node failure before performing another shard migration for any database in the cluster (default is 1 hour)
</td>
</tr>
<tr>
<td>
slave_ha_grace_period
</td>
<td>
time in seconds (default: 600)
</td>
<td>
Time (in seconds) between when a node fails and when
<a href="/docs/latest/operate/rs/7.4/databases/configure/replica-ha/">
replica high availability
</a>
starts relocating shards to another node
</td>
</tr>
<tr>
<td>
watchdog_profile
</td>
<td>
<code>
cloud
</code>
<br/>
<code>
local-network
</code>
</td>
<td>
Watchdog profiles with preconfigured thresholds and timeouts (deprecated as of Redis Enterprise Software v6.4.2-69; use
<span class="break-all">
<code>
failure_detection_sensitivity
</code>
</span>
instead)
<br/>
β’
<code>
cloud
</code>
is suitable for common cloud environments and has a higher tolerance for latency variance (also called network jitter).
<br/>
β’
<code>
local-network
</code>
is suitable for dedicated LANs and has better failure detection and failover times.
</td>
</tr>
</tbody>
</table>
<h3 id="returns">
Returns
</h3>
<p>
Returns
<code>
Finished successfully
</code>
if the cluster configuration was changed. Otherwise, it returns an error.
</p>
<p>
Use
<a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/info/#info-cluster">
<code>
rladmin info cluster
</code>
</a>
to verify the cluster configuration was changed.
</p>
<h3 id="example">
Example
</h3>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ rladmin tune cluster slave_ha enabled
</span></span><span class="line"><span class="cl">Finished successfully
</span></span><span class="line"><span class="cl">$ rladmin info cluster <span class="p">|</span> grep slave_ha
</span></span><span class="line"><span class="cl"> slave_ha: enabled
</span></span></code></pre>
</div>
<h2 id="tune-db">
<code>
tune db
</code>
</h2>
<p>
Configures database parameters.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin tune db <span class="o">{</span> db:<id> <span class="p">|</span> <name> <span class="o">}</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> slave_buffer <auto <span class="p">|</span> valueMB <span class="p">|</span> hard:soft:time> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> client_buffer <value> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> repl_backlog <valueMB <span class="p">|</span> auto> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> crdt_repl_backlog <valueMB <span class="p">|</span> auto> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> repl_timeout <seconds> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> repl_diskless <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="p">|</span> default <span class="o">}</span> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> master_persistence <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> maxclients <value> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> schedpolicy <span class="o">{</span> cmp <span class="p">|</span> mru <span class="p">|</span> spread <span class="p">|</span> mnp <span class="o">}</span> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> max_shard_pipeline <value> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> conns <value> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> conns_type <value> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> max_client_pipeline <value> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> max_connections <value> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> max_aof_file_size <size> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> max_aof_load_time <seconds> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> oss_cluster <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> oss_cluster_api_preferred_ip_type <value> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> slave_ha <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> slave_ha_priority <value> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> skip_import_analyze <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> mkms <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> continue_on_error <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> gradual_src_mode <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> gradual_sync_mode <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="p">|</span> auto <span class="o">}</span> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> gradual_sync_max_shards_per_source <value> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> module_name <value> <span class="o">]</span> <span class="o">[</span> module_config_params <value> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> crdt_xadd_id_uniqueness_mode <span class="o">{</span> liberal <span class="p">|</span> semi-strict <span class="p">|</span> strict <span class="o">}</span> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> metrics_export_all <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> syncer_mode <span class="o">{</span> distributed <span class="p">|</span> centralized <span class="o">}]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> syncer_monitoring <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> mtls_allow_weak_hashing <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> mtls_allow_outdated_cert <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> data_internode_encryption <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> db_conns_auditing <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> resp3 <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span>
</span></span></code></pre>
</div>
<h3 id="parameters-1">
Parameters
</h3>
<table>
<thead>
<tr>
<th>
Parameter
</th>
<th>
Type/Value
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
db:id
</td>
<td>
integer
</td>
<td>
ID of the specified database
</td>
</tr>
<tr>
<td>
name
</td>
<td>
string
</td>
<td>
Name of the specified database
</td>
</tr>
<tr>
<td>
client_buffer
</td>
<td>
value in MB hard:soft:time
</td>
<td>
Redis client output buffer limits
</td>
</tr>
<tr>
<td>
conns
</td>
<td>
integer
</td>
<td>
Size of internal connection pool, specified per-thread or per-shard depending on conns_type
</td>
</tr>
<tr>
<td>
conns_type
</td>
<td>
<code>
per-thread
</code>
<br/>
<code>
per-shard
</code>
</td>
<td>
Specifies connection pool size as either per-thread or per-shard
</td>
</tr>
<tr>
<td>
continue_on_error
</td>
<td>
</td>
<td>
Flag that skips tuning shards that can't be reached
</td>
</tr>
<tr>
<td>
crdt_repl_backlog
</td>
<td>
value in MB
<br/>
<code>
auto
</code>
</td>
<td>
Size of the Active-Active replication buffer
</td>
</tr>
<tr>
<td>
crdt_xadd_id_uniqueness_mode
</td>
<td>
<code>
liberal
</code>
<br/>
<code>
semi-strict
</code>
<br/>
<code>
strict
</code>
</td>
<td>
XADD's behavior in an Active-Active database, defined as liberal, semi-strict, or strict (see descriptions below)
</td>
</tr>
<tr>
<td>
data_internode_encryption
</td>
<td>
<code>
enabled
</code>
<br/>
<code>
disabled
</code>
</td>
<td>
Activates or deactivates
<a href="/docs/latest/operate/rs/7.4/security/encryption/internode-encryption/">
internode encryption
</a>
for the database
</td>
</tr>
<tr>
<td>
db_conns_auditing
</td>
<td>
<code>
enabled
</code>
<br/>
<code>
disabled
</code>
</td>
<td>
Activates or deactivates database
<a href="/docs/latest/operate/rs/7.4/security/audit-events/">
connection auditing
</a>
for a database
</td>
</tr>
<tr>
<td>
gradual_src_mode
</td>
<td>
<code>
enabled
</code>
<br/>
<code>
disabled
</code>
</td>
<td>
Activates or deactivates gradual sync of sources
</td>
</tr>
<tr>
<td>
gradual_sync_max_shards_per_source
</td>
<td>
integer
</td>
<td>
Number of shards per sync source that can be replicated in parallel (positive integer)
</td>
</tr>
<tr>
<td>
gradual_sync_mode
</td>
<td>
<code>
enabled
</code>
<br/>
<code>
disabled
</code>
<br/>
<code>
auto
</code>
</td>
<td>
Activates, deactivates, or automatically determines gradual sync of source shards
</td>
</tr>
<tr>
<td>
master_persistence
</td>
<td>
<code>
enabled
</code>
<br/>
<code>
disabled
</code>
</td>
<td>
If enabled, persists the primary shard in addition to replica shards in a replicated and persistent database.
</td>
</tr>
<tr>
<td>
max_aof_file_size
</td>
<td>
size in MB
</td>
<td>
Maximum size (in MB, if not specified) of
<a href="/docs/latest/glossary/#letter-a">
AoF
</a>
file (minimum value is 10 GB)
</td>
</tr>
<tr>
<td>
max_aof_load_time
</td>
<td>
time in seconds
</td>
<td>
Time limit in seconds to load a shard from an append-only file (AOF). If exceeded, an AOF rewrite is initiated to decrease future load time.
<br/>
Minimum: 2700 seconds (45 minutes)
<br/>
Default: 3600 seconds (1 hour)
</td>
</tr>
<tr>
<td>
max_client_pipeline
</td>
<td>
integer
</td>
<td>
Maximum commands in the proxy's pipeline per client connection (max value is 2047, default value is 200)
</td>
</tr>
<tr>
<td>
max_connections
</td>
<td>
integer
</td>
<td>
Maximum client connections to the database's endpoint (default value is 0, which is unlimited)
</td>
</tr>
<tr>
<td>
max_shard_pipeline
</td>
<td>
integer
</td>
<td>
Maximum commands in the proxy's pipeline per shard connection (default value is 200)
</td>
</tr>
<tr>
<td>
maxclients
</td>
<td>
integer
</td>
<td>
Controls the maximum client connections between the proxy and shards (default value is 10000)
</td>
</tr>
<tr>
<td>
metrics_export_all
</td>
<td>
<code>
enabled
</code>
<br/>
<code>
disabled
</code>
</td>
<td>
Activates the exporter to expose all shard metrics
</td>
</tr>
<tr>
<td>
mkms
</td>
<td>
<code>
enabled
</code>
<br/>
<code>
disabled
</code>
</td>
<td>
Activates multi-key multi-slot commands
</td>
</tr>
<tr>
<td>
module_config_params
</td>
<td>
string
</td>
<td>
Configures module arguments at runtime. Enclose
<code>
module_config_params
</code>
within quotation marks.
</td>
</tr>
<tr>
<td>
module_name
</td>
<td>
<code>
search
</code>
<br/>
<code>
ReJSON
</code>
<br/>
<code>
graph
</code>
<br/>
<code>
timeseries
</code>
<br/>
<code>
bf
</code>
<br/>
<code>
rg
</code>
</td>
<td>
The module to configure with
<code>
module_config_params
</code>
</td>
</tr>
<tr>
<td>
mtls_allow_outdated_cert
</td>
<td>
<code>
enabled
</code>
<br/>
<code>
disabled
</code>
</td>
<td>
Activates outdated certificates in mTLS connections
</td>
</tr>
<tr>
<td>
mtls_allow_weak_hashing
</td>
<td>
<code>
enabled
</code>
<br/>
<code>
disabled
</code>
</td>
<td>
Activates weak hashing (less than 2048 bits) in mTLS connections
</td>
</tr>
<tr>
<td>
oss_cluster
</td>
<td>
<code>
enabled
</code>
<br/>
<code>
disabled
</code>
</td>
<td>
Activates OSS cluster API
</td>
</tr>
<tr>
<td>
oss_cluster_api_preferred_ip_type
</td>
<td>
<code>
internal
</code>
<br/>
<code>
external
</code>
</td>
<td>
IP type for the endpoint and database in the OSS cluster API (default is internal)
</td>
</tr>
<tr>
<td>
repl_backlog
</td>
<td>
size in MB
<br/>
<code>
auto
</code>
</td>
<td>
Size of the replication buffer
</td>
</tr>
<tr>
<td>
repl_diskless
</td>
<td>
<code>
enabled
</code>
<br/>
<code>
disabled
</code>
<br/>
<code>
default
</code>
</td>
<td>
Activates or deactivates diskless replication (defaults to the cluster setting)
</td>
</tr>
<tr>
<td>
repl_timeout
</td>
<td>
time in seconds
</td>
<td>
Replication timeout (in seconds)
</td>
</tr>
<tr>
<td>
resp3
</td>
<td>
<code>
enabled
</code>
<br/>
<code>
disabled
</code>
</td>
<td>
Enables or deactivates RESP3 support (defaults to
<code>
enabled
</code>
)
</td>
</tr>
<tr>
<td>
schedpolicy
</td>
<td>
<code>
cmp
</code>
<br/>
<code>
mru
</code>
<br/>
<code>
spread
</code>
<br/>
<code>
mnp
</code>
</td>
<td>
Controls how server-side connections are used when forwarding traffic to shards
</td>
</tr>
<tr>
<td>
skip_import_analyze
</td>
<td>
<code>
enabled
</code>
<br/>
<code>
disabled
</code>
</td>
<td>
Skips the analyzing step when importing a database
</td>
</tr>
<tr>
<td>
slave_buffer
</td>
<td>
<code>
auto
</code>
<br/>
value in MB
<br/>
hard:soft:time
</td>
<td>
Redis replica output buffer limits
<br/>
β’
<code>
auto
</code>
: dynamically adjusts the buffer limit based on the shardβs current used memory
<br/>
β’ value in MB: sets the buffer limit in MB
<br/>
β’ hard:soft:time: sets the hard limit (maximum buffer size in MB), soft limit in MB, and the time in seconds that the soft limit can be exceeded
</td>
</tr>
<tr>
<td>
slave_ha
</td>
<td>
<code>
enabled
</code>
<br/>
<code>
disabled
</code>
</td>
<td>
Activates or deactivates replica high availability (defaults to the cluster setting)
</td>
</tr>
<tr>
<td>
slave_ha_priority
</td>
<td>
integer
</td>
<td>
Priority of the database in the replica high-availability mechanism
</td>
</tr>
<tr>
<td>
syncer_mode
</td>
<td>
<code>
distributed
</code>
<br/>
<code>
centralized
</code>
</td>
<td>
Configures syncer to run in distributed or centralized mode. For distributed syncer, the DMC policy must be all-nodes or all-master-nodes
</td>
</tr>
<tr>
<td>
syncer_monitoring
</td>
<td>
<code>
enabled
</code>
<br/>
<code>
disabled
</code>
</td>
<td>
Activates syncer monitoring
</td>
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
<th>
XADD behavior mode
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
liberal
</td>
<td>
XADD succeeds with any valid ID (not recommended, allows duplicate IDs)
</td>
</tr>
<tr>
<td>
semi-strict
</td>
<td>
Allows a full ID. Partial IDs are completed with the unique database instance ID (not recommended, allows duplicate IDs).
</td>
</tr>
<tr>
<td>
strict
</td>
<td>
XADD fails if a full ID is given. Partial IDs are completed using the unique database instance ID.
</td>
</tr>
</tbody>
</table>
<h3 id="returns-1">
Returns
</h3>
<p>
Returns
<code>
Finished successfully
</code>
if the database configuration was changed. Otherwise, it returns an error.
</p>
<p>
Use
<a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/info/#info-db">
<code>
rladmin info db
</code>
</a>
to verify the database configuration was changed.
</p>
<h3 id="example-1">
Example
</h3>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ rladmin tune db db:4 repl_timeout <span class="m">300</span>
</span></span><span class="line"><span class="cl">Tuning database: o
</span></span><span class="line"><span class="cl">Finished successfully
</span></span><span class="line"><span class="cl">$ rladmin info db db:4 <span class="p">|</span> grep repl_timeout
</span></span><span class="line"><span class="cl"> repl_timeout: <span class="m">300</span> seconds
</span></span></code></pre>
</div>
<h2 id="tune-node">
<code>
tune node
</code>
</h2>
<p>
Configures node parameters.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">tune node <span class="o">{</span> <id> <span class="p">|</span> all <span class="o">}</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> max_listeners <value> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> max_redis_forks <value> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> max_redis_servers <value> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> max_slave_full_syncs <value> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> quorum_only <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span> <span class="o">]</span>
</span></span></code></pre>
</div>
<h3 id="parameters-2">
Parameters
</h3>
<table>
<thead>
<tr>
<th>
Parameter
</th>
<th>
Type/Value
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
id
</td>
<td>
integer
</td>
<td>
ID of the specified node
</td>
</tr>
<tr>
<td>
all
</td>
<td>
</td>
<td>
Configures settings for all nodes
</td>
</tr>
<tr>
<td>
max_listeners
</td>
<td>
integer
</td>
<td>
Maximum number of endpoints that may be bound to the node
</td>
</tr>
<tr>
<td>
max_redis_forks
</td>
<td>
integer
</td>
<td>
Maximum number of background processes forked from shards that may exist on the node at any given time
</td>
</tr>
<tr>
<td>
max_redis_servers
</td>
<td>
integer
</td>
<td>
Maximum number of shards allowed to reside on the node
</td>
</tr>
<tr>
<td>
max_slave_full_syncs
</td>
<td>
integer
</td>
<td>
Maximum number of simultaneous replica full-syncs that may be running at any given time (0: Unlimited, -1: Use cluster settings)
</td>
</tr>
<tr>
<td>
quorum_only
</td>
<td>
<code>
enabled
</code>
<br/>
<code>
disabled
</code>
</td>
<td>
If activated, configures the node as a
<a href="/docs/latest/glossary/#letter-p">
quorum-only node
</a>
</td>
</tr>
</tbody>
</table>
<h3 id="returns-2">
Returns
</h3>
<p>
Returns
<code>
Finished successfully
</code>
if the node configuration was changed. Otherwise, it returns an error.
</p>
<p>
Use
<a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/info/#info-node">
<code>
rladmin info node
</code>
</a>
to verify the node configuration was changed.
</p>
<h3 id="example-2">
Example
</h3>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ rladmin tune node <span class="m">3</span> max_redis_servers <span class="m">120</span>
</span></span><span class="line"><span class="cl">Finished successfully
</span></span><span class="line"><span class="cl">$ rladmin info node <span class="m">3</span> <span class="p">|</span> grep <span class="s2">"max redis servers"</span>
</span></span><span class="line"><span class="cl"> max redis servers: <span class="m">120</span>
</span></span></code></pre>
</div>
<h2 id="tune-proxy">
<code>
tune proxy
</code>
</h2>
<p>
Configures proxy parameters.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin tune proxy <span class="o">{</span> <id> <span class="p">|</span> all <span class="o">}</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> mode <span class="o">{</span> static <span class="p">|</span> dynamic <span class="o">}</span> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> threads <value> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> max_threads <value> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> scale_threshold <value> <span class="o">]</span>
</span></span><span class="line"><span class="cl"> <span class="o">[</span> scale_duration <seconds> <span class="o">]</span>
</span></span></code></pre>
</div>
<h3 id="parameters-3">
Parameters
</h3>
<table>
<thead>
<tr>
<th>
Parameter
</th>
<th>
Type/Value
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
id
</td>
<td>
integer
</td>
<td>
ID of the specified proxy
</td>
</tr>
<tr>
<td>
all
</td>
<td>
</td>
<td>
Configures settings for all proxies
</td>
</tr>
<tr>
<td>
max_threads
</td>
<td>
integer, (range:Β 1-255)
</td>
<td>
Maximum number of threads allowed
</td>
</tr>
<tr>
<td>
mode
</td>
<td>
<code>
static
</code>
<br/>
<code>
dynamic
</code>
</td>
<td>
Determines if the proxy automatically adjusts the number of threads based on load size
</td>
</tr>
<tr>
<td>
scale_duration
</td>
<td>
time in seconds, (range:Β 10-300)
</td>
<td>
Time of scale_threshold CPU utilization before the automatic proxy automatically scales
</td>
</tr>
<tr>
<td>
scale_threshold
</td>
<td>
percentage, (range:Β 50-99)
</td>
<td>
CPU utilization threshold that triggers spawning new threads
</td>
</tr>
<tr>
<td>
threads
</td>
<td>
integer, (range:Β 1-255)
</td>
<td>
Initial number of threads created at startup
</td>
</tr>
</tbody>
</table>
<h3 id="returns-3">
Returns
</h3>
<p>
Returns
<code>
OK
</code>
if the proxy configuration was changed. Otherwise, it returns an error.
</p>
<p>
Use
<a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/info/#info-proxy">
<code>
rladmin info proxy
</code>
</a>
to verify the proxy configuration was changed.
</p>
<h3 id="example-3">
Example
</h3>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ rladmin tune proxy <span class="m">2</span> scale_threshold <span class="m">75</span>
</span></span><span class="line"><span class="cl">Configuring proxies:
</span></span><span class="line"><span class="cl"> - proxy:2: ok
</span></span><span class="line"><span class="cl">$ rladmin info proxy <span class="m">2</span> <span class="p">|</span> grep scale_threshold
</span></span><span class="line"><span class="cl"> scale_threshold: <span class="m">75</span> <span class="o">(</span>%<span class="o">)</span>
</span></span></code></pre>
</div>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/tune/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/develop/tools/insight/release-notes/v2.0/.html | <section class="prose w-full py-12">
<h1>
RedisInsight v2.0, Nov 2021
</h1>
<p class="text-lg -mt-5 mb-10">
RedisInsight v2.0.2
</p>
<h2 id="206-april-2022">
2.0.6 (April 2022)
</h2>
<p>
This is the General Availability (GA) release of RedisInsight 2.0.6
</p>
<h3 id="headlines">
Headlines:
</h3>
<ul>
<li>
SNI support - added SNI support to indicate a hostname in the TLS handshake
</li>
<li>
Save Profiler logs into a file - now you can save and download Profiler logs into a .TXT file
</li>
<li>
Customize delimiters in Tree view - added support for custom delimiters in Tree view
</li>
<li>
Support for node grouping and pulsing in RedisGraph visualizations in Workbench
</li>
</ul>
<h3 id="details">
Details
</h3>
<p>
<strong>
Features and improvements:
</strong>
</p>
<ul>
<li>
<a href="https://github.com/RedisInsight/RedisInsight/pull/548">
#548
</a>
,
<a href="https://github.com/RedisInsight/RedisInsight/pull/542">
#542
</a>
Added SNI support - use the "Add Database Manually" form to see the new "Use SNI" option under the TLS section to specify the server name and connect to your Redis Database
</li>
<li>
<a href="https://github.com/RedisInsight/RedisInsight/pull/521/files">
#521
</a>
Added an option to save Profiler logs. Enable saving before starting the Profiler to save the logs into a .TXT file and download it to analyze them outside of the application
</li>
<li>
<a href="https://github.com/RedisInsight/RedisInsight/pull/496">
#496
</a>
Now you can specify your own delimiters to work with namespaces in the Tree view, default delimiter is colon (':')
</li>
<li>
<a href="https://github.com/RedisInsight/RedisInsight/pull/473">
#473
</a>
Added a link to GitHub repository of RedisInsight to quickly find and access it - you can see the icon below the "Settings"
</li>
<li>
<a href="https://github.com/RedisInsight/RedisInsight/pull/586">
#586
</a>
Added support for node grouping and pulsing in the visualisations for RedisGraph in Workbench
</li>
<li>
<a href="https://github.com/RedisInsight/RedisInsight/pull/455">
#455
</a>
Limited the movement of the special editor with Cypher highlights to Workbench Editor area (to work with it, just type in RedisGraph commands in Workbench)
</li>
<li>
<a href="https://github.com/RedisInsight/RedisInsight/pull/462">
#462
</a>
Provided additional information about database indexes in the form to add a database using host and port
</li>
<li>
<a href="https://github.com/RedisInsight/RedisInsight/pull/489">
#489
</a>
Reworked user experience with filters per key type and key name in Browser
</li>
<li>
<a href="https://github.com/RedisInsight/RedisInsight/pull/535">
#535
</a>
Added highlights of timestamps and improved text wrapping in Profiler
</li>
</ul>
<h3 id="bug-fixes">
Bug fixes:
</h3>
<ul>
<li>
<a href="https://github.com/RedisInsight/RedisInsight/pull/581">
#581
</a>
Fixed the issue with displaying keys in multi-shard databases
</li>
<li>
<a href="https://github.com/RedisInsight/RedisInsight/pull/576">
#576
</a>
Fixed encoding in Workbench
</li>
</ul>
<h2 id="205-march-2022-ga">
2.0.5 (March 2022, GA)
</h2>
<p>
This is the General Availability (GA) release of RedisInsight 2.0.
</p>
<h3 id="headlines-1">
Headlines
</h3>
<ul>
<li>
<strong>
Tree view
</strong>
- A new view of the keys in Browser, which automatically groups keys scanned in your database into folders based on key namespaces. Now you can navigate through and analyze your list of keys quicker by opening only folders with namespaces you want.
</li>
<li>
<strong>
Support for Apple M1 (arm64)
</strong>
- You can download it
<a href="https://redis.com/redis-enterprise/redis-insight/#insight-form">
here
</a>
.
</li>
<li>
<strong>
Added auto-discovery of local databases
</strong>
- RedisInsight will automatically find and add your local databases when you open the application for the first time.
</li>
<li>
<strong>
A dedicated Editor for Cypher syntax
</strong>
- Workbench supports autocomplete and highlighting of Cypher syntax for RedisGraph queries.
</li>
</ul>
<h3 id="details-1">
Details
</h3>
<ul>
<li>
You can switch to the Tree view in Browser to see all the keys grouped into folders according to their namespaces. Note that we use the colon (:) as a default separator, and it is not customizable yet.
</li>
<li>
Added support for Apple M1 (arm64).
</li>
<li>
Added a mechanism to auto-discover local databases based on the following parameters:
<ul>
<li>
The mechanism only triggers when you open the application for the first time.
</li>
<li>
The database has standalone connection type.
</li>
<li>
The database uses the default username and requires no password or TLS certificates.
</li>
</ul>
</li>
<li>
Added new built-in guides in Workbench for additional capabilities.
</li>
<li>
Added tutorials in Workbench for Redis Stack databases that describe common use cases for Redis capabilities.
</li>
<li>
Added a new dedicated Editor to Workbench with support for Cypher syntax autocomplete and highlighting. Use the "Shift+Space" shortcut inside of the quotes for your query to open the dedicated Editor.
</li>
<li>
Show modules uploaded to databases in the list of databases.
</li>
<li>
Added support for returning to the previous command in Workbench Editor. Use arrow up when your cursor is at the beginning of the first row to return to the previous command. Note: there is no support for the reverse direction yet, so use it with caution.
</li>
</ul>
<p>
If you installed RedisInsight-preview before, this folder will still exist at the following path:
</p>
<ul>
<li>
For MacOs:
<usershomedir>
/.redisinsight-preview
</usershomedir>
</li>
<li>
For Windows: C:/Users/{Username}/.redisinsight-preview
</li>
<li>
For Linux:
<usershomedir>
/.redisinsight-preview
</usershomedir>
</li>
</ul>
<h2 id="204-february-2022">
2.0.4 (February 2022)
</h2>
<p>
This is the maintenance release of RedisInsight Preview 2.0 (v2.0.4)!
</p>
<h3 id="headlines-2">
Headlines
</h3>
<ul>
<li>
Fixes to the issues found
</li>
<li>
Profiler
<ul>
<li>
Added RedisInsight Profiler, which uses the MONITOR command to analyze every command sent to the redis instance in real-time.
</li>
</ul>
</li>
<li>
Workbench:
<ul>
<li>
Added support for RedisGears and RedisBloom on the intelligent Redis command auto-complete.
</li>
<li>
Keep command results previously received in the Workbench.
</li>
<li>
Support for repeating commands.
</li>
</ul>
</li>
<li>
CLI:
<ul>
<li>
Added support for RedisGears and RedisBloom on the intelligent Redis command auto-complete.
</li>
<li>
Support for repeating commands.
</li>
</ul>
</li>
<li>
Command Helper:
<ul>
<li>
Added information about RedisGears and RedisBloom Redis commands.
</li>
</ul>
</li>
</ul>
<h3 id="details-2">
Details
</h3>
<ul>
<li>
Profiler
<ul>
<li>
Added RedisInsight Profiler, which uses the MONITOR command to analyze every command sent to the redis instance in real-time. Note: Running the MONITOR command is dangerous to the performance of your production server, so run it reasonably and remember to stop the Profiler.
</li>
</ul>
</li>
<li>
Workbench:
<ul>
<li>
Added support for RedisGears and RedisBloom on the intelligent Redis command auto-complete, so the list of similar commands and their arguments are displayed when you start typing any RedisGears or RedisBloom commands.
</li>
<li>
Keep command results (up to 1MB) previously received in the Workbench, so they are available even after you restart the application.
</li>
<li>
Connect Workbench to the database index selected when adding a database.
</li>
<li>
To repeat any command in Workbench, just enter any integer and then a Redis command with arguments.
</li>
</ul>
</li>
<li>
CLI:
<ul>
<li>
Added support for RedisGears and RedisBloom on the intelligent Redis command auto-complete, so hints with arguments are displayed when you enter any RedisGears or RedisBloom commands
</li>
<li>
CLI is by default connected to the database index selected when adding a database. Added displaying of the database index connected.
</li>
<li>
To repeat any command in CLI, just enter any integer and then a Redis command with arguments.
</li>
</ul>
</li>
<li>
Command Helper:
<ul>
<li>
Added information about RedisGears and RedisBloom Redis commands.
</li>
</ul>
</li>
<li>
Core:
<ul>
<li>
Fixed an issue with displaying parameter values in the Overview when no information is received for these parameters.
</li>
</ul>
</li>
</ul>
<h2 id="203-december-2021">
2.0.3 (December 2021)
</h2>
<p>
This is the maintenance release of RedisInsight Preview 2.0 (v2.0.3).
</p>
<h3 id="headlines-3">
Headlines
</h3>
<ul>
<li>
Workbench:
<ul>
<li>
Added indications of commands
</li>
<li>
New hints with the list of command arguments
</li>
<li>
Reworked navigation for the built-in guides
</li>
</ul>
</li>
<li>
Help Center:
<ul>
<li>
Added a page with list of supported keyboard shortcuts
</li>
</ul>
</li>
<li>
Core:
<ul>
<li>
Uncoupled Command Helper from CLI
</li>
<li>
Renamed
<code>
ZSET
</code>
to Sorted Set
</li>
</ul>
</li>
</ul>
<h3 id="details-3">
Details
</h3>
<ul>
<li>
Browser:
<ul>
<li>
Changed the format of TTL in the list of keys
</li>
</ul>
</li>
<li>
CLI:
<ul>
<li>
Fixed a bug with
<code>
FT.CREATE
</code>
command that rendered the window blank
</li>
</ul>
</li>
<li>
Workbench:
<ul>
<li>
Fixed a bug to avoid executing the Redis command one more time when the view of results is changed
</li>
<li>
Added a new information message when there are no results to display
</li>
<li>
Added indications of commands (currently, not clickable) in Editor area to point out the lines where commands start
</li>
<li>
Added new hints in Editor to display the list of command arguments with the following keyboard shortcuts:
<ul>
<li>
Ctrl+Shift+Space for Windows and Linux
</li>
<li>
β β§ Space for Mac
</li>
</ul>
</li>
<li>
Added support for remembering the state (expanded or collapsed) for left side panel in Workbench
</li>
<li>
Reworked navigation for the built-in guides
</li>
<li>
Changed icons for default and custom plugins
</li>
</ul>
</li>
<li>
Command Helper:
<ul>
<li>
Changed titles of command groups to make them consistent with redis.io
</li>
</ul>
</li>
<li>
Help Center:
<ul>
<li>
Added a page with supported keyboard shortcuts
</li>
</ul>
</li>
<li>
Core:
<ul>
<li>
Reworked logic to open CLI and Command Helper, added an option to open Command Helper without a need to open CLI
</li>
<li>
Changed fonts and colors across the application to enhance readability
</li>
<li>
Renamed
<code>
ZSET
</code>
to Sorted Set
</li>
<li>
Added description of RedisGears and RedisBloom commands to hints in CLI, Command Helper, and Workbench
</li>
<li>
Added support for automatic updates to the list of commands and their description in CLI, Command Helper, and Workbench
</li>
</ul>
</li>
</ul>
<h2 id="202-november-2021">
2.0.2 (November 2021)
</h2>
<p>
This is the public preview release of RedisInsight 2.0 (v2.0.2).
</p>
<p>
RedisInsight 2.0 is a complete product rewrite based on a new tech stack. This version contains a number of must-have and most-used capabilities from previous releases, plus a number of differentiators and delights.
</p>
<p>
RedisInsight-preview 2.0 can be installed along with the current GA (1.11) version of RedisInsight with no issues.
</p>
<h3 id="headlines-4">
Headlines
</h3>
<ul>
<li>
Developed using a new tech stack based on Electron, Elastic UI, and Monaco Editor
</li>
<li>
Introducing Workbench - advanced command line interface with intelligent command auto-complete and complex data visualizations
</li>
<li>
Ability to write and render your own data visualizations within Workbench
</li>
<li>
Built-in click-through Redis guides available
</li>
<li>
Support for Light and Dark themes
</li>
<li>
Enhanced user experience with Browser
</li>
</ul>
<h3 id="details-4">
Details
</h3>
<ul>
<li>
Core:
<ul>
<li>
Enhanced user experience with the list of databases:
<ul>
<li>
View, sort and edit databases added
</li>
<li>
Multiple deletion of databases
</li>
</ul>
</li>
<li>
Ability to connect to Redis Standalone, Redis Cluster and Redis Sentinel
</li>
<li>
Auto discovery of databases managed by Redis Enterprise, Redis Cloud (Flexible), and Redis Sentinel
</li>
<li>
Support for Redis OSS Cluster API
</li>
<li>
Support for TLS connection
</li>
<li>
Works with Microsoft Azure (official support upcoming)
</li>
</ul>
</li>
<li>
Workbench:
<ul>
<li>
Advanced command-line interface that lets you run commands against your Redis server
</li>
<li>
Workbench editor allows comments, multi-line formatting and multi-command execution
</li>
<li>
Intelligent Redis command auto-complete and syntax highlighting with support for
<a href="https://oss.redis.com/redisearch/">
RediSearch
</a>
,
<a href="https://oss.redis.com/redisjson/">
RedisJSON
</a>
,
<a href="https://oss.redis.com/redisgraph/">
RedisGraph
</a>
,
<a href="https://oss.redis.com/redistimeseries/">
RedisTimeSeries
</a>
,
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/triggers-and-functions/">
RedisGears
</a>
,
<a href="https://oss.redis.com/redisai/">
RedisAI
</a>
,
<a href="https://oss.redis.com/redisbloom/">
RedisBloom
</a>
</li>
<li>
Allows rendering custom data visualization per Redis command using externally developed plugins
</li>
</ul>
</li>
<li>
Browser:
<ul>
<li>
Browse, filter and visualize key-value Redis data structures
<ul>
<li>
Visual cues per data type
</li>
<li>
Quick view of size and ttl in the main browser view
</li>
<li>
Ability to filter by pattern and/or data type
</li>
<li>
Ability to change the number of keys to scan through during filtering
</li>
</ul>
</li>
<li>
CRUD support for Lists, Hashes, Strings, Sets, Sorted Sets
<ul>
<li>
Search within the data structure (except for Strings)
</li>
</ul>
</li>
<li>
CRUD support for
<a href="https://oss.redis.com/redisjson/">
RedisJSON
</a>
</li>
</ul>
</li>
<li>
Database overview:
<ul>
<li>
A number of metrics always on display within the database workspace
<ul>
<li>
Metrics updated every 5 second
</li>
<li>
CPU, number of keys, commands/sec, network input, network output, total memory, number of connected clients
</li>
</ul>
</li>
<li>
Enabled modules per Redis server listed
</li>
</ul>
</li>
<li>
CLI:
<ul>
<li>
Command-line interface with enhanced type-ahead command help
</li>
<li>
Embedded command helper where you can filter and search for Redis commands
</li>
</ul>
</li>
<li>
RediSearch:
<ul>
<li>
Tabular visualizations within Workbench of
<a href="https://oss.redis.com/redisearch/">
RediSearch
</a>
index queries and aggregations (support for FT.INFO, FT.SEARCH and FT.AGGREGATE)
</li>
</ul>
</li>
<li>
Custom plugins:
<ul>
<li>
Ability to build your own visualization plugins to be rendered within Workbench
</li>
<li>
<a href="https://github.com/redisinsight/redisinsight">
Documentation
</a>
on how to develop custom plugins and a reference example are provided
</li>
</ul>
</li>
<li>
Built-in guides:
<ul>
<li>
Built-in click-through guides for Redis capabilities
</li>
<li>
Added a guide on Document Capabilities within Redis
</li>
</ul>
</li>
<li>
User interface (UI):
<ul>
<li>
Light/dark themes available
</li>
<li>
Colour palette adjusted to the highest level of
<a href="https://www.w3.org/WAI/standards-guidelines/wcag/">
Web content accessibility guidelines
</a>
</li>
</ul>
</li>
<li>
Data encryption:
<ul>
<li>
Optional ability to encrypt sensitive data such as connection certificates and passwords
</li>
</ul>
</li>
</ul>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/develop/tools/insight/release-notes/v2.0/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rc/api/get-started/enable-the-api/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Enable the API
</h1>
<p class="text-lg -mt-5 mb-10">
Use the Redis Cloud dashboard to enable the REST API.
</p>
<p>
If you have a Redis Cloud subscription, you can use a REST API to manage your subscription programmatically.
</p>
<p>
For security reasons, the Redis Cloud API is disabled by default.
</p>
<p>
To enable the API:
</p>
<ol>
<li>
<p>
Sign in to your
<a href="https://cloud.redis.io">
Redis Cloud account
</a>
as an account owner.
</p>
</li>
<li>
<p>
From the menu, choose
<strong>
Access Management
</strong>
.
</p>
</li>
<li>
<p>
When the
<strong>
Access Management
</strong>
screen appears, select the
<strong>
API Keys
</strong>
tab.
</p>
<a href="/docs/latest/images/rc/access-management-api-keys-tab.png" sdata-lightbox="/images/rc/access-management-api-keys-tab.png">
<img alt="Use the **API Keys** tab of the **Access Management** screen to manage your REST API keys." src="/docs/latest/images/rc/access-management-api-keys-tab.png" width="75%"/>
</a>
</li>
<li>
<p>
If a
<strong>
Copy
</strong>
button appears to the right of the API account key, the API is enabled. This button copies the account key to the Clipboard.
</p>
<a href="/docs/latest/images/rc/button-access-management-api-key-copy.png" sdata-lightbox="/images/rc/button-access-management-api-key-copy.png">
<img alt="Use the **Copy** button to copy the access key to the Clipboard." src="/docs/latest/images/rc/button-access-management-api-key-copy.png"/>
</a>
<p>
If you see an
<strong>
Enable API
</strong>
button, select it to enable the API and generate your API account key.
</p>
<a href="/docs/latest/images/rc/button-access-management-enable-api.png" sdata-lightbox="/images/rc/button-access-management-enable-api.png">
<img alt="Use the **Enable API** button to enable the REST API for your account." src="/docs/latest/images/rc/button-access-management-enable-api.png"/>
</a>
</li>
</ol>
<p>
To authenticate REST API calls, you need to combine the API account key with an
<a href="/docs/latest/operate/rc/api/get-started/manage-api-keys/#api-user-keys">
API user key
</a>
to make API calls.
</p>
<p>
Only account owners can see the access key in the account settings.
</p>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Warning:
</div>
Make sure that you keep your access keys secret. Anyone who sends an API request with a valid access key can make changes to your account.
</div>
</div>
<p>
To manage your API keys or to limit IP addresses for user keys, see
<a href="/docs/latest/operate/rc/api/get-started/manage-api-keys/">
Manage API keys
</a>
.
</p>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rc/api/get-started/enable-the-api/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/references/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Reference
</h1>
<nav>
<a href="/docs/latest/operate/rs/references/supported-platforms/">
Supported platforms
</a>
<p>
Redis Enterprise Software is supported on several operating systems, cloud environments, and virtual environments.
</p>
<a href="/docs/latest/operate/rs/references/upgrade-paths/">
Supported upgrade paths for Redis Software
</a>
<p>
Supported paths to upgrade a Redis Software cluster.
</p>
<a href="/docs/latest/operate/rs/references/client_references/">
Develop with Redis clients
</a>
<p>
Redis client libraries allow you to connect to Redis instances from within your application. This section provides an overview of several recommended Redis clients for popular programming and scripting languages.
</p>
<a href="/docs/latest/operate/rs/references/memtier-benchmark/">
Benchmark an Auto Tiering enabled database
</a>
<br/>
<br/>
<a href="/docs/latest/operate/rs/references/cli-utilities/">
Command-line utilities
</a>
<p>
Reference for Redis Enterprise Software command-line utilities, including rladmin, redis-cli, crdb-cli, and rlcheck.
</p>
<a href="/docs/latest/operate/rs/references/metrics/">
Real-time metrics
</a>
<p>
Documents the metrics that are tracked with Redis Enterprise Software.
</p>
<a href="/docs/latest/operate/rs/references/compatibility/">
Redis Enterprise compatibility with Redis Community Edition
</a>
<p>
Redis Enterprise compatibility with Redis Community Edition.
</p>
<a href="/docs/latest/operate/rs/references/rest-api/">
REST API
</a>
<p>
Documents the REST API available to Redis Enterprise Software deployments.
</p>
<a href="/docs/latest/operate/rs/references/terminology/">
Terminology in Redis Enterprise Software
</a>
<p>
Explains terms used in Redis Enterprise Software and its docs.
</p>
</nav>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/references/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/security/access-control/redis-acl-overview/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Overview of Redis ACLs in Redis Enterprise Software
</h1>
<p class="text-lg -mt-5 mb-10">
An overview of Redis ACLs, syntax, and ACL command support in Redis Enterprise Software.
</p>
<p>
Redis access control lists (Redis ACLs) allow you to define named permissions for specific Redis commands, keys, and pub/sub channels. You can use defined Redis ACLs for multiple databases and roles.
</p>
<h2 id="predefined-redis-acls">
Predefined Redis ACLs
</h2>
<p>
Redis Enterprise Software provides one predefined Redis ACL named
<strong>
Full Access
</strong>
. This ACL allows all commands on all keys and cannot be edited.
</p>
<h2 id="redis-acl-syntax">
Redis ACL syntax
</h2>
<p>
Redis ACLs are defined by a
<a href="/docs/latest/operate/oss_and_stack/management/security/acl/">
Redis syntax
</a>
where you specify the commands or command categories that are allowed for specific keys.
</p>
<h3 id="commands-and-categories">
Commands and categories
</h3>
<p>
Redis ACL rules can allow or block specific
<a href="/docs/latest/commands/">
Redis commands
</a>
or
<a href="/docs/latest/operate/oss_and_stack/management/security/acl/#command-categories">
command categories
</a>
.
</p>
<ul>
<li>
<p>
<code>
+
</code>
includes commands
</p>
</li>
<li>
<p>
<code>
-
</code>
excludes commands
</p>
</li>
<li>
<p>
<code>
+@
</code>
includes command categories
</p>
</li>
<li>
<p>
<code>
-@
</code>
excludes command categories
</p>
</li>
</ul>
<p>
The following example allows all
<code>
read
</code>
commands and the
<code>
SET
</code>
command:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">+@read +SET
</span></span></code></pre>
</div>
<p>
Module commands have several ACL limitations:
</p>
<ul>
<li>
<p>
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/">
Redis modules
</a>
do not have command categories.
</p>
</li>
<li>
<p>
Other
<a href="/docs/latest/operate/oss_and_stack/management/security/acl/#command-categories">
command category
</a>
ACLs, such as
<code>
+@read
</code>
and
<code>
+@write
</code>
, do not include Redis module commands.
<code>
+@all
</code>
is the only exception because it allows all Redis commands.
</p>
</li>
<li>
<p>
You have to include individual module commands in a Redis ACL rule to allow them.
</p>
<p>
For example, the following Redis ACL rule allows read-only commands and the RediSearch commands
<code>
FT.INFO
</code>
and
<code>
FT.SEARCH
</code>
:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">+@read +FT.INFO +FT.SEARCH
</span></span></code></pre>
</div>
</li>
</ul>
<h3 id="key-patterns">
Key patterns
</h3>
<p>
To define access to specific keys or key patterns, use the following prefixes:
</p>
<ul>
<li>
<p>
<code>
~
</code>
or
<code>
%RW~
</code>
allows read and write access to keys.
</p>
</li>
<li>
<p>
<code>
%R~
</code>
allows read access to keys.
</p>
</li>
<li>
<p>
<code>
%W~
</code>
allows write access to keys.
</p>
</li>
</ul>
<p>
<code>
%RW~
</code>
,
<code>
%R~
</code>
, and
<code>
%W~
</code>
are only supported for databases with Redis version 7.2 or later.
</p>
<p>
The following example allows read and write access to all keys that start with "app1" and read-only access to all keys that start with "app2":
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">~app1* %R~app2*
</span></span></code></pre>
</div>
<h3 id="pubsub-channels">
Pub/sub channels
</h3>
<p>
The
<code>
&
</code>
prefix allows access to
<a href="/docs/latest/develop/interact/pubsub/">
pub/sub channels
</a>
(only supported for databases with Redis version 6.2 or later).
</p>
<p>
To limit access to specific channels, include
<code>
resetchannels
</code>
before the allowed channels:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">resetchannels <span class="p">&</span>channel1 <span class="p">&</span>channel2
</span></span></code></pre>
</div>
<h3 id="selectors">
Selectors
</h3>
<p>
<a href="/docs/latest/operate/oss_and_stack/management/security/acl/#selectors">
Selectors
</a>
let you define multiple sets of rules in a single Redis ACL (only supported for databases with Redis version 7.2 or later). A command is allowed if it matches the base rule or any selector in the Redis ACL.
</p>
<ul>
<li>
<p>
<code>
(<rule set>)
</code>
creates a new selector.
</p>
</li>
<li>
<p>
<code>
clearselectors
</code>
deletes all existing selectors for a user. This action does not delete the base ACL rule.
</p>
</li>
</ul>
<p>
In the following example, the base rule allows
<code>
GET key1
</code>
and the selector allows
<code>
SET key2
</code>
:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">+GET ~key1 <span class="o">(</span>+SET ~key2<span class="o">)</span>
</span></span></code></pre>
</div>
<h2 id="default-pubsub-permissions">
Default pub/sub permissions
</h2>
<p>
Redis database version 6.2 introduced pub/sub ACL rules that determine which
<a href="/docs/latest/develop/interact/pubsub/">
pub/sub channels
</a>
a user can access.
</p>
<p>
The configuration option
<code>
acl-pubsub-default
</code>
, added in Redis Enterprise Software version 6.4.2, determines the cluster-wide default level of access for all pub/sub channels. Redis Enterprise Software uses the following pub/sub permissions by default:
</p>
<ul>
<li>
<p>
For versions 6.4.2 and 7.2,
<code>
acl-pubsub-default
</code>
is permissive (
<code>
allchannels
</code>
or
<code>
&*
</code>
) by default to accommodate earlier Redis versions.
</p>
</li>
<li>
<p>
In future versions,
<code>
acl-pubsub-default
</code>
will change to restrictive (
<code>
resetchannels
</code>
). Restrictive permissions block all pub/sub channels by default, unless explicitly permitted by an ACL rule.
</p>
</li>
</ul>
<p>
If you use ACLs and pub/sub channels, you should review your databases and ACL settings and plan to transition your cluster to restrictive pub/sub permissions in preparation for future Redis Enterprise Software releases.
</p>
<h3 id="prepare-for-restrictive-pubsub-permissions">
Prepare for restrictive pub/sub permissions
</h3>
<p>
To secure pub/sub channels and prepare your cluster for future Redis Enterprise Software releases that default to restrictive pub/sub permissions:
</p>
<ol>
<li>
<p>
Upgrade Redis databases:
</p>
<ul>
<li>
<p>
For Redis Enterprise Software version 6.4.2, upgrade all databases in the cluster to Redis DB version 6.2.
</p>
</li>
<li>
<p>
For Redis Enterprise Software version 7.2, upgrade all databases in the cluster to Redis DB version 7.2 or 6.2.
</p>
</li>
</ul>
</li>
<li>
<p>
Create or update ACLs with permissions for specific channels using the
<code>
resetchannels &channel
</code>
format.
</p>
</li>
<li>
<p>
Associate the ACLs with relevant databases.
</p>
</li>
<li>
<p>
Set default pub/sub permissions (
<code>
acl-pubsub-default
</code>
) to restrictive. See
<a href="#change-default-pubsub-permissions">
Change default pub/sub permissions
</a>
for details.
</p>
</li>
<li>
<p>
If any issues occur, you can temporarily change the default pub/sub setting back to permissive. Resolve any problematic ACLs before making pub/sub permissions restrictive again.
</p>
</li>
</ol>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Note:
</div>
<p>
When you change the cluster's default pub/sub permissions to restrictive,
<code>
&*
</code>
is added to the
<strong>
Full Access
</strong>
ACL. Before you make this change, consider the following:
</p>
<ul>
<li>
<p>
Because pub/sub ACL syntax was added in Redis 6.2, you can't associate the
<strong>
Full Access
</strong>
ACL with database versions 6.0 or lower after this change.
</p>
</li>
<li>
<p>
The
<strong>
Full Access
</strong>
ACL is not reverted if you change
<code>
acl-pubsub-default
</code>
to permissive again.
</p>
</li>
<li>
<p>
Every database with the default user enabled uses the
<strong>
Full Access
</strong>
ACL.
</p>
</li>
</ul>
</div>
</div>
<h3 id="change-default-pubsub-permissions">
Change default pub/sub permissions
</h3>
<p>
As of Redis Enterprise version 6.4.2, you can configure
<code>
acl_pubsub_default
</code>
, which determines the default pub/sub permissions for all databases in the cluster. You can set
<code>
acl_pubsub_default
</code>
to the following values:
</p>
<ul>
<li>
<p>
<code>
resetchannels
</code>
is restrictive and blocks access to all channels by default.
</p>
</li>
<li>
<p>
<code>
allchannels
</code>
is permissive and allows access to all channels by default.
</p>
</li>
</ul>
<p>
To make default pub/sub permissions restrictive:
</p>
<ol>
<li>
<p>
<a href="/docs/latest/operate/rs/installing-upgrading/upgrading/upgrade-database/">
Upgrade all databases
</a>
in the cluster to Redis version 6.2 or later.
</p>
</li>
<li>
<p>
Set the default to restrictive (
<code>
resetchannels
</code>
) using one of the following methods:
</p>
<ul>
<li>
<p>
New Cluster Manager UI (only available for Redis Enterprise versions 7.2 and later):
</p>
<ol>
<li>
<p>
Navigate to
<strong>
Access Control > Settings > Pub/Sub ACLs
</strong>
and select
<strong>
Edit
</strong>
.
</p>
</li>
<li>
<p>
For
<strong>
Default permissions for Pub/Sub ACLs
</strong>
, select
<strong>
Restrictive
</strong>
, then
<strong>
Save
</strong>
.
</p>
</li>
</ol>
</li>
<li>
<p>
<a href="/docs/latest/operate/rs/references/cli-utilities/rladmin/tune/#tune-cluster">
<code>
rladmin tune cluster
</code>
</a>
:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin tune cluster acl_pubsub_default resetchannels
</span></span></code></pre>
</div>
</li>
<li>
<p>
<a href="/docs/latest/operate/rs/references/rest-api/requests/cluster/policy/#put-cluster-policy">
Update cluster policy
</a>
REST API request:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">PUT /v1/cluster/policy
</span></span><span class="line"><span class="cl"><span class="o">{</span> <span class="s2">"acl_pubsub_default"</span>: <span class="s2">"resetchannels"</span> <span class="o">}</span>
</span></span></code></pre>
</div>
</li>
</ul>
</li>
</ol>
<h2 id="acl-command-support">
ACL command support
</h2>
<p>
Redis Enterprise Software does not support certain Redis ACL commands. Instead, you can manage access controls from the Cluster Manager UI.
</p>
<table>
<thead>
<tr>
<th style="text-align:left">
Command
</th>
<th style="text-align:left">
Supported
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">
<a href="/docs/latest/commands/acl-cat/">
ACL CAT
</a>
</td>
<td style="text-align:left">
<span title="Supported">
β
Supported
</span>
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/commands/acl-deluser/">
ACL DELUSER
</a>
</td>
<td style="text-align:left">
<span title="Not supported">
β Not supported
</span>
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/commands/acl-dryrun/">
ACL DRYRUN
</a>
</td>
<td style="text-align:left">
<span title="Supported">
β
Supported
</span>
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/commands/acl-genpass/">
ACL GENPASS
</a>
</td>
<td style="text-align:left">
<span title="Not supported">
β Not supported
</span>
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/commands/acl-getuser/">
ACL GETUSER
</a>
</td>
<td style="text-align:left">
<span title="Supported">
β
Supported
</span>
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/commands/acl-help/">
ACL HELP
</a>
</td>
<td style="text-align:left">
<span title="Supported">
β
Supported
</span>
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/commands/acl-list/">
ACL LIST
</a>
</td>
<td style="text-align:left">
<span title="Supported">
β
Supported
</span>
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/commands/acl-load/">
ACL LOAD
</a>
</td>
<td style="text-align:left">
<span title="Not supported">
β Not supported
</span>
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/commands/acl-log/">
ACL LOG
</a>
</td>
<td style="text-align:left">
<span title="Not supported">
β Not supported
</span>
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/commands/acl-save/">
ACL SAVE
</a>
</td>
<td style="text-align:left">
<span title="Not supported">
β Not supported
</span>
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/commands/acl-setuser/">
ACL SETUSER
</a>
</td>
<td style="text-align:left">
<span title="Not supported">
β Not supported
</span>
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/commands/acl-users/">
ACL USERS
</a>
</td>
<td style="text-align:left">
<span title="Supported">
β
Supported
</span>
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/commands/acl-whoami/">
ACL WHOAMI
</a>
</td>
<td style="text-align:left">
<span title="Supported">
β
Supported
</span>
</td>
</tr>
</tbody>
</table>
<p>
Redis ACLs also have the following differences in Redis Enterprise Software:
</p>
<ul>
<li>
<p>
The
<code>
MULTI
</code>
,
<code>
EXEC
</code>
,
<code>
DISCARD
</code>
commands are always allowed, but ACLs are enforced on
<code>
MULTI
</code>
subcommands.
</p>
</li>
<li>
<p>
Nested selectors are not supported.
</p>
<p>
For example, the following selectors are not valid in Redis Enterprise:
<nobr>
<code>
+GET ~key1 (+SET (+SET ~key2) ~key3)
</code>
</nobr>
</p>
</li>
<li>
<p>
Key and pub/sub patterns do not allow the following characters:
<code>
'(', ')'
</code>
</p>
</li>
<li>
<p>
The following password configuration syntax is not supported:
<code>
'>', '<', '#!', 'resetpass'
</code>
</p>
<p>
To configure passwords in Redis Enterprise Software, use one of the following methods:
</p>
<ul>
<li>
<p>
<a href="/docs/latest/operate/rs/references/cli-utilities/rladmin/cluster/reset_password/">
<code>
rladmin cluster reset_password
</code>
</a>
:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin cluster reset_password <user email>
</span></span></code></pre>
</div>
</li>
<li>
<p>
REST API
<a href="/docs/latest/operate/rs/references/rest-api/requests/users/#put-user">
<code>
PUT /v1/users
</code>
</a>
request and provide
<code>
password
</code>
</p>
</li>
</ul>
</li>
</ul>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/security/access-control/redis-acl-overview/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/commands/ft.create/.html | <section class="prose w-full py-12">
<h1 class="command-name">
FT.CREATE
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">FT.CREATE index
[ON HASH | JSON]
[PREFIX count prefix [prefix ...]]
[FILTER {filter}]
[LANGUAGE default_lang]
[LANGUAGE_FIELD lang_attribute]
[SCORE default_score]
[SCORE_FIELD score_attribute]
[PAYLOAD_FIELD payload_attribute]
[MAXTEXTFIELDS]
[TEMPORARY seconds]
[NOOFFSETS]
[NOHL]
[NOFIELDS]
[NOFREQS]
[STOPWORDS count [stopword ...]]
[SKIPINITIALSCAN]
SCHEMA field_name [AS alias] TEXT | TAG | NUMERIC | GEO | VECTOR | GEOSHAPE [ SORTABLE [UNF]]
[NOINDEX] [ field_name [AS alias] TEXT | TAG | NUMERIC | GEO | VECTOR | GEOSHAPE [ SORTABLE [UNF]] [NOINDEX] ...]
</pre>
<dl class="grid grid-cols-[auto,1fr] gap-2 mb-12">
<dt class="font-semibold text-redis-ink-900 m-0">
Available in:
</dt>
<dd class="m-0">
<a href="/docs/stack">
Redis Stack
</a>
/
<a href="/docs/interact/search-and-query">
Search 1.0.0
</a>
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
Time complexity:
</dt>
<dd class="m-0">
O(K) at creation where K is the number of fields, O(N) if scanning the keyspace is triggered, where N is the number of keys in the keyspace
</dd>
</dl>
<h2 id="description">
Description
</h2>
<p>
Create an index with the given specification. For usage, see
<a href="#examples">
Examples
</a>
.
</p>
<h2 id="required-arguments">
Required arguments
</h2>
<p>
<a name="index">
</a>
</p>
<details open="">
<p>
</p>
<summary>
<code>
index
</code>
</summary>
<p>
is index name to create.
If such index already exists, returns an error reply
<code>
(error) Index already exists
</code>
.
</p>
</details>
<p>
<a name="SCHEMA">
</a>
</p>
<details open="">
<p>
</p>
<summary>
<code>
SCHEMA {identifier} AS {attribute} {attribute type} {options...
</code>
</summary>
<p>
after the SCHEMA keyword, declares which fields to index:
</p>
<ul>
<li>
<p>
<code>
{identifier}
</code>
for hashes, is a field name within the hash.
For JSON, the identifier is a JSON Path expression.
</p>
</li>
<li>
<p>
<code>
AS {attribute}
</code>
defines the attribute associated to the identifier. For example, you can use this feature to alias a complex JSONPath expression with more memorable (and easier to type) name.
</p>
</li>
</ul>
<p>
Field types are:
</p>
<ul>
<li>
<p>
<code>
TEXT
</code>
- Allows full-text search queries against the value in this attribute.
</p>
</li>
<li>
<p>
<code>
TAG
</code>
- Allows exact-match queries, such as categories or primary keys, against the value in this attribute. For more information, see
<a href="/docs/latest/develop/interact/search-and-query/advanced-concepts/tags/">
Tag Fields
</a>
.
</p>
</li>
<li>
<p>
<code>
NUMERIC
</code>
- Allows numeric range queries against the value in this attribute. See
<a href="/docs/latest/develop/interact/search-and-query/query/">
query syntax docs
</a>
for details on how to use numeric ranges.
</p>
</li>
<li>
<p>
<code>
GEO
</code>
- Allows radius range queries against the value (point) in this attribute. The value of the attribute must be a string containing a longitude (first) and latitude separated by a comma.
</p>
</li>
<li>
<p>
<code>
VECTOR
</code>
- Allows vector queries against the value in this attribute. This requires
<a href="/docs/latest/develop/interact/search-and-query/advanced-concepts/dialects/#dialect-2">
query dialect 2
</a>
or above (introduced in
<a href="https://github.com/RediSearch/RediSearch/releases/tag/v2.4.3">
RediSearch v2.4
</a>
). For more information, see
<a href="/docs/latest/develop/interact/search-and-query/advanced-concepts/vectors/">
Vector Fields
</a>
.
</p>
</li>
<li>
<p>
<code>
GEOSHAPE
</code>
- Allows polygon queries against the value in this attribute. The value of the attribute must follow a
<a href="https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry">
WKT notation
</a>
list of 2D points representing the polygon edges
<code>
POLYGON((x1 y1, x2 y2, ...)
</code>
separated by a comma. A
<code>
GEOSHAPE
</code>
field type can be followed by one of the following coordinate systems:
</p>
<ul>
<li>
<code>
SPHERICAL
</code>
for Geographic longitude and latitude coordinates
</li>
<li>
<code>
FLAT
</code>
for Cartesian X Y coordinates
</li>
</ul>
<p>
The default coordinate system is
<code>
SPHERICAL
</code>
.
</p>
<p>
Currently
<code>
GEOSHAPE
</code>
doesn't support JSON multi-value and
<code>
SORTABLE
</code>
option.
</p>
</li>
</ul>
<p>
Field options are:
</p>
<ul>
<li>
<p>
<code>
SORTABLE
</code>
-
<code>
NUMERIC
</code>
,
<code>
TAG
</code>
,
<code>
TEXT
</code>
, or
<code>
GEO
</code>
attributes can have an optional
<strong>
SORTABLE
</strong>
argument. As the user
<a href="/docs/latest/develop/interact/search-and-query/advanced-concepts/sorting/">
sorts the results by the value of this attribute
</a>
, the results are available with very low latency. Note that his adds memory overhead, so consider not declaring it on large text attributes. You can sort an attribute without the
<code>
SORTABLE
</code>
option, but the latency is not as good as with
<code>
SORTABLE
</code>
.
</p>
</li>
<li>
<p>
<code>
UNF
</code>
- By default, for hashes (not with JSON)
<code>
SORTABLE
</code>
applies a normalization to the indexed value (characters set to lowercase, removal of diacritics). When using the unnormalized form (UNF), you can disable the normalization and keep the original form of the value. With JSON,
<code>
UNF
</code>
is implicit with
<code>
SORTABLE
</code>
(normalization is disabled).
</p>
</li>
<li>
<p>
<code>
NOSTEM
</code>
- Text attributes can have the NOSTEM argument that disables stemming when indexing its values. This may be ideal for things like proper names.
</p>
</li>
<li>
<p>
<code>
NOINDEX
</code>
- Attributes can have the
<code>
NOINDEX
</code>
option, which means they will not be indexed. This is useful in conjunction with
<code>
SORTABLE
</code>
, to create attributes whose update using PARTIAL will not cause full reindexing of the document. If an attribute has NOINDEX and doesn't have SORTABLE, it will just be ignored by the index.
</p>
</li>
<li>
<p>
<code>
PHONETIC {matcher}
</code>
- Declaring a text attribute as
<code>
PHONETIC
</code>
will perform phonetic matching on it in searches by default. The obligatory {matcher} argument specifies the phonetic algorithm and language used. The following matchers are supported:
</p>
<ul>
<li>
<code>
dm:en
</code>
- Double metaphone for English
</li>
<li>
<code>
dm:fr
</code>
- Double metaphone for French
</li>
<li>
<code>
dm:pt
</code>
- Double metaphone for Portuguese
</li>
<li>
<code>
dm:es
</code>
- Double metaphone for Spanish
</li>
</ul>
<p>
For more information, see
<a href="/docs/latest/develop/interact/search-and-query/advanced-concepts/phonetic_matching/">
Phonetic Matching
</a>
.
</p>
</li>
<li>
<p>
<code>
WEIGHT {weight}
</code>
for
<code>
TEXT
</code>
attributes, declares the importance of this attribute when calculating result accuracy. This is a multiplication factor, and defaults to 1 if not specified.
</p>
</li>
<li>
<p>
<code>
SEPARATOR {sep}
</code>
for
<code>
TAG
</code>
attributes, indicates how the text contained in the attribute is to be split into individual tags. The default is
<code>
,
</code>
. The value must be a single character.
</p>
</li>
<li>
<p>
<code>
CASESENSITIVE
</code>
for
<code>
TAG
</code>
attributes, keeps the original letter cases of the tags. If not specified, the characters are converted to lowercase.
</p>
</li>
<li>
<p>
<code>
WITHSUFFIXTRIE
</code>
for
<code>
TEXT
</code>
and
<code>
TAG
</code>
attributes, keeps a suffix trie with all terms which match the suffix. It is used to optimize
<code>
contains
</code>
(
<em>
foo
</em>
) and
<code>
suffix
</code>
(*foo) queries. Otherwise, a brute-force search on the trie is performed. If suffix trie exists for some fields, these queries will be disabled for other fields.
</p>
</li>
<li>
<p>
<code>
INDEXEMPTY
</code>
for
<code>
TEXT
</code>
and
<code>
TAG
</code>
attributes, introduced in v2.10, allows you to index and search for empty strings. By default, empty strings are not indexed.
</p>
</li>
<li>
<p>
<code>
INDEXMISSING
</code>
for all field types, introduced in v2.10, allows you to search for missing values, that is, documents that do not contain a specific field. Note the difference between a field with an empty value and a document with a missing value. By default, missing values are not indexed.
</p>
</li>
</ul>
</details>
<h2 id="optional-arguments">
Optional arguments
</h2>
<p>
<a name="ON">
</a>
</p>
<details open="">
<p>
</p>
<summary>
<code>
ON {data_type}
</code>
</summary>
<p>
currently supports HASH (default) and JSON. To index JSON, you must have the
<a href="/docs/latest/develop/data-types/json/">
RedisJSON
</a>
module installed.
</p>
</details>
<p>
<a name="PREFIX">
</a>
</p>
<details open="">
<p>
</p>
<summary>
<code>
PREFIX {count} {prefix}
</code>
</summary>
<p>
tells the index which keys it should index. You can add several prefixes to index. Because the argument is optional, the default is
<code>
*
</code>
(all keys).
</p>
</details>
<p>
<a name="FILTER">
</a>
</p>
<details open="">
<p>
</p>
<summary>
<code>
FILTER {filter}
</code>
</summary>
<p>
is a filter expression with the full RediSearch aggregation expression language. It is possible to use
<code>
@__key
</code>
to access the key that was just added/changed. A field can be used to set field name by passing
<code>
'FILTER @indexName=="myindexname"'
</code>
.
</p>
</details>
<p>
<a name="LANGUAGE">
</a>
</p>
<details open="">
<p>
</p>
<summary>
<code>
LANGUAGE {default_lang}
</code>
</summary>
<p>
if set, indicates the default language for documents in the index. Default is English.
</p>
</details>
<p>
<a name="LANGUAGE_FIELD">
</a>
</p>
<details open="">
<p>
</p>
<summary>
<code>
LANGUAGE_FIELD {lang_attribute}
</code>
</summary>
<p>
is a document attribute set as the document language.
</p>
<p>
A stemmer is used for the supplied language during indexing. If an unsupported language is sent, the command returns an error. The supported languages are Arabic, Basque, Catalan, Danish, Dutch, English, Finnish, French, German, Greek, Hungarian,
Indonesian, Irish, Italian, Lithuanian, Nepali, Norwegian, Portuguese, Romanian, Russian,
Spanish, Swedish, Tamil, Turkish, and Chinese.
</p>
<p>
When adding Chinese language documents, set
<code>
LANGUAGE chinese
</code>
for the indexer to properly tokenize the terms. If you use the default language, then search terms are extracted based on punctuation characters and whitespace. The Chinese language tokenizer makes use of a segmentation algorithm (via
<a href="https://github.com/lionsoul2014/friso">
Friso
</a>
), which segments text and checks it against a predefined dictionary. See
<a href="/docs/latest/develop/interact/search-and-query/advanced-concepts/stemming/">
Stemming
</a>
for more information.
</p>
</details>
<p>
<a name="SCORE">
</a>
</p>
<details open="">
<p>
</p>
<summary>
<code>
SCORE {default_score}
</code>
</summary>
<p>
is default score for documents in the index. Default score is 1.0.
</p>
</details>
<p>
<a name="SCORE_FIELD">
</a>
</p>
<details open="">
<p>
</p>
<summary>
<code>
SCORE_FIELD {score_attribute}
</code>
</summary>
<p>
is document attribute that you use as the document rank based on the user ranking. Ranking must be between 0.0 and 1.0. If not set, the default score is 1.
</p>
</details>
<p>
<a name="PAYLOAD_FIELD">
</a>
</p>
<details open="">
<p>
</p>
<summary>
<code>
PAYLOAD_FIELD {payload_attribute}
</code>
</summary>
<p>
is document attribute that you use as a binary safe payload string to the document that can be evaluated at query time by a custom scoring function or retrieved to the client.
</p>
</details>
<p>
<a name="MAXTEXTFIELDS">
</a>
</p>
<details open="">
<p>
</p>
<summary>
<code>
MAXTEXTFIELDS
</code>
</summary>
<p>
forces RediSearch to encode indexes as if there were more than 32 text attributes, which allows you to add additional attributes (beyond 32) using
<a href="/docs/latest/commands/ft.alter/">
<code>
FT.ALTER
</code>
</a>
. For efficiency, RediSearch encodes indexes differently if they are created with less than 32 text attributes.
</p>
</details>
<p>
<a name="NOOFFSETS">
</a>
</p>
<details open="">
<p>
</p>
<summary>
<code>
NOOFFSETS
</code>
</summary>
<p>
does not store term offsets for documents. It saves memory, but does not allow exact searches or highlighting. It implies
<code>
NOHL
</code>
.
</p>
</details>
<p>
<a name="TEMPORARY">
</a>
</p>
<details open="">
<p>
</p>
<summary>
<code>
TEMPORARY {seconds}
</code>
</summary>
<p>
creates a lightweight temporary index that expires after a specified period of inactivity, in seconds. The internal idle timer is reset whenever the index is searched or added to. Because such indexes are lightweight, you can create thousands of such indexes without negative performance implications and, therefore, you should consider using
<code>
SKIPINITIALSCAN
</code>
to avoid costly scanning.
</p>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Warning:
</div>
When temporary indexes expire, they drop all the records associated with them.
<a href="/docs/latest/commands/ft.dropindex/">
<code>
FT.DROPINDEX
</code>
</a>
was introduced with a default of not deleting docs and a
<code>
DD
</code>
flag that enforced deletion.
However, for temporary indexes, documents are deleted along with the index.
Historically, RediSearch used an FT.ADD command, which made a connection between the document and the index. Then, FT.DROP, also a hystoric command, deleted documents by default.
In version 2.x, RediSearch indexes hashes and JSONs, and the dependency between the index and documents no longer exists.
</div>
</div>
</details>
<p>
<a name="NOHL">
</a>
</p>
<details open="">
<p>
</p>
<summary>
<code>
NOHL
</code>
</summary>
<p>
conserves storage space and memory by disabling highlighting support. If set, the corresponding byte offsets for term positions are not stored.
<code>
NOHL
</code>
is also implied by
<code>
NOOFFSETS
</code>
.
</p>
</details>
<p>
<a name="NOFIELDS">
</a>
</p>
<details open="">
<p>
</p>
<summary>
<code>
NOFIELDS
</code>
</summary>
<p>
does not store attribute bits for each term. It saves memory, but it does not allow
filtering by specific attributes.
</p>
</details>
<p>
<a name="NOFREQS">
</a>
</p>
<details open="">
<p>
</p>
<summary>
<code>
NOFREQS
</code>
</summary>
<p>
avoids saving the term frequencies in the index. It saves memory, but does not allow sorting based on the frequencies of a given term within the document.
</p>
</details>
<p>
<a name="STOPWORDS">
</a>
</p>
<details open="">
<p>
</p>
<summary>
<code>
STOPWORDS {count}
</code>
</summary>
<p>
sets the index with a custom stopword list, to be ignored during indexing and search time.
<code>
{count}
</code>
is the number of stopwords, followed by a list of stopword arguments exactly the length of
<code>
{count}
</code>
.
</p>
<p>
If not set, FT.CREATE takes the default list of stopwords. If
<code>
{count}
</code>
is set to 0, the index does not have stopwords.
</p>
</details>
<p>
<a name="SKIPINITIALSCAN">
</a>
</p>
<details open="">
<p>
</p>
<summary>
<code>
SKIPINITIALSCAN
</code>
</summary>
<p>
if set, does not scan and index.
</p>
</details>
<p>
<note>
<b>
Notes:
</b>
</note>
</p>
<ul>
<li>
<p>
<strong>
Attribute number limits:
</strong>
RediSearch supports up to 1024 attributes per schema, out of which at most 128 can be TEXT attributes. On 32 bit builds, at most 64 attributes can be TEXT attributes. The more attributes you have, the larger your index, as each additional 8 attributes require one extra byte per index record to encode. You can always use the
<code>
NOFIELDS
</code>
option and not encode attribute information into the index, for saving space, if you do not need filtering by text attributes. This will still allow filtering by numeric and geo attributes.
</p>
</li>
<li>
<p>
<strong>
Running in clustered databases:
</strong>
When having several indices in a clustered database, you need to make sure the documents you want to index reside on the same shard as the index. You can achieve this by having your documents tagged by the index name.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379> HSET doc:1<span class="o">{</span>idx<span class="o">}</span> ...
</span></span><span class="line"><span class="cl">127.0.0.1:6379> FT.CREATE idx ... PREFIX <span class="m">1</span> doc: ...</span></span></code></pre>
</div>
<p>
When Running RediSearch in a clustered database, you can span the index across shards using
<a href="https://github.com/RedisLabsModules/RSCoordinator">
RSCoordinator
</a>
. In this case the above does not apply.
</p>
</li>
</ul>
<h2 id="return">
Return
</h2>
<p>
FT.CREATE returns a simple string reply
<code>
OK
</code>
if executed correctly, or an error reply otherwise.
</p>
<h2 id="examples">
Examples
</h2>
<details open="">
<summary>
<b>
Create an index
</b>
</summary>
<p>
Create an index that stores the title, publication date, and categories of blog post hashes whose keys start with
<code>
blog:post:
</code>
(for example,
<code>
blog:post:1
</code>
).
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379> FT.CREATE idx ON HASH PREFIX <span class="m">1</span> blog:post: SCHEMA title TEXT SORTABLE published_at NUMERIC SORTABLE category TAG SORTABLE
</span></span><span class="line"><span class="cl">OK</span></span></code></pre>
</div>
<p>
Index the
<code>
sku
</code>
attribute from a hash as both a
<code>
TAG
</code>
and as
<code>
TEXT
</code>
:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379> FT.CREATE idx ON HASH PREFIX <span class="m">1</span> blog:post: SCHEMA sku AS sku_text TEXT sku AS sku_tag TAG SORTABLE</span></span></code></pre>
</div>
<p>
Index two different hashes, one containing author data and one containing books, in the same index:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379> FT.CREATE author-books-idx ON HASH PREFIX <span class="m">2</span> author:details: book:details: SCHEMA
</span></span><span class="line"><span class="cl">author_id TAG SORTABLE author_ids TAG title TEXT name TEXT</span></span></code></pre>
</div>
<p>
In this example, keys for author data use the key pattern
<code>
author:details:<id>
</code>
while keys for book data use the pattern
<code>
book:details:<id>
</code>
.
</p>
<p>
Index authors whose names start with G.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379> FT.CREATE g-authors-idx ON HASH PREFIX <span class="m">1</span> author:details FILTER <span class="s1">'startswith(@name, "G")'</span> SCHEMA name TEXT</span></span></code></pre>
</div>
<p>
Index only books that have a subtitle.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379> FT.CREATE subtitled-books-idx ON HASH PREFIX <span class="m">1</span> book:details FILTER <span class="s1">'@subtitle != ""'</span> SCHEMA title TEXT</span></span></code></pre>
</div>
<p>
Index books that have a "categories" attribute where each category is separated by a
<code>
;
</code>
character.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379> FT.CREATE books-idx ON HASH PREFIX <span class="m">1</span> book:details SCHEMA title TEXT categories TAG SEPARATOR <span class="s2">";"</span></span></span></code></pre>
</div>
</details>
<details open="">
<summary>
<b>
Index a JSON document using a JSON Path expression
</b>
</summary>
<p>
The following example uses data similar to the hash examples above but uses JSON instead.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379> FT.CREATE idx ON JSON SCHEMA $.title AS title TEXT $.categories AS categories TAG</span></span></code></pre>
</div>
</details>
<h2 id="see-also">
See also
</h2>
<p>
<a href="/docs/latest/commands/ft.alter/">
<code>
FT.ALTER
</code>
</a>
|
<a href="/docs/latest/commands/ft.dropindex/">
<code>
FT.DROPINDEX
</code>
</a>
</p>
<h2 id="related-topics">
Related topics
</h2>
<ul>
<li>
<a href="/docs/latest/develop/interact/search-and-query/">
RediSearch
</a>
</li>
<li>
<a href="/docs/latest/develop/data-types/json/">
RedisJSON
</a>
</li>
<li>
<a href="https://github.com/lionsoul2014/friso">
Friso
</a>
</li>
<li>
<a href="/docs/latest/develop/interact/search-and-query/advanced-concepts/stemming/">
Stemming
</a>
</li>
<li>
<a href="/docs/latest/develop/interact/search-and-query/advanced-concepts/phonetic_matching/">
Phonetic Matching
</a>
</li>
<li>
<a href="https://github.com/RedisLabsModules/RSCoordinator">
RSCoordinator
</a>
</li>
</ul>
<br/>
<h2>
History
</h2>
<ul>
<li>
Starting with Redis version 2.0.0: Added
<code>
PAYLOAD_FIELD
</code>
argument for backward support of
<code>
FT.SEARCH
</code>
deprecated
<code>
WITHPAYLOADS
</code>
argument
</li>
<li>
Starting with Redis version 2.0.0: Deprecated
<code>
PAYLOAD_FIELD
</code>
argument
</li>
</ul>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/ft.create/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/triggers-and-functions/concepts/triggers/keyspace_triggers/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Keyspace triggers
</h1>
<p class="text-lg -mt-5 mb-10">
Execute a JavaScript function based on a keyspace notification
</p>
<div class="banner-article rounded-md">
<p>
The Redis Stack triggers and functions feature preview has ended and it will not be promoted to GA.
</p>
</div>
<p>
Keyspace triggers allow you to register a function that will be executed whenever an event occurs in the database. Most events are triggered by command invocations, but there are two special events that can occur independently of a command:
</p>
<ol>
<li>
Expired: This event is fired when a key expires from the database.
</li>
<li>
Evicted: This event is fired when a key is evicted from the database.
</li>
</ol>
<p>
For a complete list of supported events, please refer to the
<a href="/docs/latest/develop/use/keyspace-notifications#events-generated-by-different-commands">
Redis keyspace notifications page
</a>
.
</p>
<p>
To register a keyspace trigger, you need to use the
<code>
redis.registerKeySpaceTrigger
</code>
API when loading your library. The following example demonstrates how to register a database trigger that adds a "last updated" field whenever a hash key is modified:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-js" data-lang="js"><span class="line"><span class="cl"><span class="err">#</span><span class="o">!</span><span class="nx">js</span> <span class="nx">api_version</span><span class="o">=</span><span class="mf">1.0</span> <span class="nx">name</span><span class="o">=</span><span class="nx">myFirstLibrary</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="nx">redis</span><span class="p">.</span><span class="nx">registerKeySpaceTrigger</span><span class="p">(</span><span class="s2">"consumer"</span><span class="p">,</span> <span class="s2">""</span><span class="p">,</span> <span class="kd">function</span><span class="p">(</span><span class="nx">client</span><span class="p">,</span> <span class="nx">data</span><span class="p">){</span>
</span></span><span class="line"><span class="cl"> <span class="k">if</span> <span class="p">(</span><span class="nx">client</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="s2">"type"</span><span class="p">,</span> <span class="nx">data</span><span class="p">.</span><span class="nx">key</span><span class="p">)</span> <span class="o">!=</span> <span class="s2">"hash"</span><span class="p">)</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="c1">// key is not a has, do not touch it.
</span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="k">return</span><span class="p">;</span>
</span></span><span class="line"><span class="cl"> <span class="p">}</span>
</span></span><span class="line"><span class="cl"> <span class="c1">// get the current time in ms
</span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="kd">var</span> <span class="nx">curr_time</span> <span class="o">=</span> <span class="nx">client</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="s2">"time"</span><span class="p">)[</span><span class="mi">0</span><span class="p">];</span>
</span></span><span class="line"><span class="cl"> <span class="c1">// set '__last_updated__' with the current time value
</span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="nx">client</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="s1">'hset'</span><span class="p">,</span> <span class="nx">data</span><span class="p">.</span><span class="nx">key</span><span class="p">,</span> <span class="s1">'__last_updated__'</span><span class="p">,</span> <span class="nx">curr_time</span><span class="p">);</span>
</span></span><span class="line"><span class="cl"><span class="p">});</span>
</span></span></code></pre>
</div>
<p>
Argument Description:
</p>
<ul>
<li>
<code>
consumer
</code>
: The consumer name.
</li>
<li>
<code>
prefix
</code>
: The key prefix on which the trigger should be fired.
</li>
<li>
<code>
callback
</code>
: The callback function to invoke, following the same rules of
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/triggers-and-functions/concepts/sync_async/">
Sync and Async invocation
</a>
. The callback will only be invoked on the primary shard.
</li>
</ul>
<p>
Run the example:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379> hset h x <span class="m">1</span>
</span></span><span class="line"><span class="cl"><span class="o">(</span>integer<span class="o">)</span> <span class="m">1</span>
</span></span><span class="line"><span class="cl">127.0.0.1:6379> hgetall h
</span></span><span class="line"><span class="cl">1<span class="o">)</span> <span class="s2">"x"</span>
</span></span><span class="line"><span class="cl">2<span class="o">)</span> <span class="s2">"1"</span>
</span></span><span class="line"><span class="cl">3<span class="o">)</span> <span class="s2">"__last_updated__"</span>
</span></span><span class="line"><span class="cl">4<span class="o">)</span> <span class="s2">"1658390831"</span>
</span></span><span class="line"><span class="cl">127.0.0.1:6379> hincrby h x <span class="m">1</span>
</span></span><span class="line"><span class="cl"><span class="o">(</span>integer<span class="o">)</span> <span class="m">2</span>
</span></span><span class="line"><span class="cl">127.0.0.1:6379> hgetall h
</span></span><span class="line"><span class="cl">1<span class="o">)</span> <span class="s2">"x"</span>
</span></span><span class="line"><span class="cl">2<span class="o">)</span> <span class="s2">"2"</span>
</span></span><span class="line"><span class="cl">3<span class="o">)</span> <span class="s2">"__last_updated__"</span>
</span></span><span class="line"><span class="cl">4<span class="o">)</span> <span class="s2">"1658390910"</span>
</span></span></code></pre>
</div>
<p>
The
<code>
data
</code>
argument, which is passed to the consumer callback, are in the following format:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"event"</span><span class="p">:</span> <span class="s2">"<the event name that fired the trigger>"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"key"</span><span class="p">:</span> <span class="s2">"<key name that the event was fired on as String>"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"key_raw"</span><span class="p">:</span> <span class="s2">"<key name that the event was fired on as ArrayBuffer>"</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span></code></pre>
</div>
<p>
Notice that the
<code>
key
</code>
field is given only if the key can be decoded as a
<code>
JS
</code>
<code>
String
</code>
, otherwise the value will be
<code>
null
</code>
.
</p>
<p>
We can display trigger information using
<code>
TFUNCTION LIST
</code>
command:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379> TFUNCTION list vvv
</span></span><span class="line"><span class="cl">1<span class="o">)</span> 1<span class="o">)</span> <span class="s2">"engine"</span>
</span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="s2">"js"</span>
</span></span><span class="line"><span class="cl"> 3<span class="o">)</span> <span class="s2">"api_version"</span>
</span></span><span class="line"><span class="cl"> 4<span class="o">)</span> <span class="s2">"1.0"</span>
</span></span><span class="line"><span class="cl"> 5<span class="o">)</span> <span class="s2">"name"</span>
</span></span><span class="line"><span class="cl"> 6<span class="o">)</span> <span class="s2">"foo"</span>
</span></span><span class="line"><span class="cl"> 7<span class="o">)</span> <span class="s2">"pending_jobs"</span>
</span></span><span class="line"><span class="cl"> 8<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">0</span>
</span></span><span class="line"><span class="cl"> 9<span class="o">)</span> <span class="s2">"user"</span>
</span></span><span class="line"><span class="cl"> 10<span class="o">)</span> <span class="s2">"default"</span>
</span></span><span class="line"><span class="cl"> 11<span class="o">)</span> <span class="s2">"functions"</span>
</span></span><span class="line"><span class="cl"> 12<span class="o">)</span> <span class="o">(</span>empty array<span class="o">)</span>
</span></span><span class="line"><span class="cl"> 13<span class="o">)</span> <span class="s2">"keyspace_triggers"</span>
</span></span><span class="line"><span class="cl"> 14<span class="o">)</span> <span class="o">(</span>empty array<span class="o">)</span>
</span></span><span class="line"><span class="cl"> 15<span class="o">)</span> <span class="s2">"stream_triggers"</span>
</span></span><span class="line"><span class="cl"> 16<span class="o">)</span> 1<span class="o">)</span> 1<span class="o">)</span> <span class="s2">"name"</span>
</span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="s2">"consumer"</span>
</span></span><span class="line"><span class="cl"> 3<span class="o">)</span> <span class="s2">"num_triggered"</span>
</span></span><span class="line"><span class="cl"> 4<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">2</span>
</span></span><span class="line"><span class="cl"> 5<span class="o">)</span> <span class="s2">"num_finished"</span>
</span></span><span class="line"><span class="cl"> 6<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">2</span>
</span></span><span class="line"><span class="cl"> 7<span class="o">)</span> <span class="s2">"num_success"</span>
</span></span><span class="line"><span class="cl"> 8<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">1</span>
</span></span><span class="line"><span class="cl"> 9<span class="o">)</span> <span class="s2">"num_failed"</span>
</span></span><span class="line"><span class="cl"> 10<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">1</span>
</span></span><span class="line"><span class="cl"> 11<span class="o">)</span> <span class="s2">"last_error"</span>
</span></span><span class="line"><span class="cl"> 12<span class="o">)</span> <span class="s2">"TypeError: redis.call is not a function"</span>
</span></span><span class="line"><span class="cl"> 13<span class="o">)</span> <span class="s2">"last_exection_time"</span>
</span></span><span class="line"><span class="cl"> 14<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">0</span>
</span></span><span class="line"><span class="cl"> 15<span class="o">)</span> <span class="s2">"total_exection_time"</span>
</span></span><span class="line"><span class="cl"> 16<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">0</span>
</span></span><span class="line"><span class="cl"> 17<span class="o">)</span> <span class="s2">"avg_exection_time"</span>
</span></span><span class="line"><span class="cl"> 18<span class="o">)</span> <span class="s2">"0"</span>
</span></span></code></pre>
</div>
<h2 id="trigger-guarantees">
Trigger guarantees
</h2>
<p>
If the callback function passed to the trigger is a
<code>
JS
</code>
function (not a Coroutine), it is guaranteed that the callback will be invoked atomically along side the operation that caused the trigger; meaning all clients will see the data only after the callback has completed. In addition, it is guaranteed that the effect of the callback will be replicated to the replica and the AOF in a
<code>
multi/exec
</code>
block together with the command that fired the trigger.
</p>
<p>
If the callback is a Coroutine, it will be executed in the background and there is no guarantee on where or if it will be executed. The guarantees are the same as described on
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/triggers-and-functions/concepts/sync_async/">
sync and async invocation
</a>
.
</p>
<h2 id="upgrades">
Upgrades
</h2>
<p>
When upgrading existing trigger code using the
<code>
REPLACE
</code>
option of
<code>
TFUNCTION LOAD
</code>
command, all trigger parameters can be modified.
</p>
<h2 id="advanced-usage">
Advanced usage
</h2>
<p>
For most use cases, the
<code>
registerKeySpaceTrigger
</code>
API is sufficient. But there are some use cases where you might need a better guarantee on when a trigger will be fired. Let's look at the following example:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-js" data-lang="js"><span class="line"><span class="cl"><span class="err">#</span><span class="o">!</span><span class="nx">js</span> <span class="nx">api_version</span><span class="o">=</span><span class="mf">1.0</span> <span class="nx">name</span><span class="o">=</span><span class="nx">myFirstLibrary</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="nx">redis</span><span class="p">.</span><span class="nx">registerKeySpaceTrigger</span><span class="p">(</span><span class="s2">"consumer"</span><span class="p">,</span> <span class="s2">""</span><span class="p">,</span> <span class="kd">function</span><span class="p">(</span><span class="nx">client</span><span class="p">,</span> <span class="nx">data</span><span class="p">){</span>
</span></span><span class="line"><span class="cl"> <span class="k">if</span> <span class="p">(</span><span class="nx">client</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="s2">"type"</span><span class="p">,</span> <span class="nx">data</span><span class="p">.</span><span class="nx">key</span><span class="p">)</span> <span class="o">!=</span> <span class="s2">"hash"</span><span class="p">)</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="c1">// key is not a has, do not touch it.
</span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="k">return</span><span class="p">;</span>
</span></span><span class="line"><span class="cl"> <span class="p">}</span>
</span></span><span class="line"><span class="cl"> <span class="kd">var</span> <span class="nx">name</span> <span class="o">=</span> <span class="nx">client</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="s1">'hget'</span><span class="p">,</span> <span class="nx">data</span><span class="p">.</span><span class="nx">key</span><span class="p">,</span> <span class="s1">'name'</span><span class="p">);</span>
</span></span><span class="line"><span class="cl"> <span class="nx">client</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="s1">'incr'</span><span class="p">,</span> <span class="sb">`name_</span><span class="si">${</span><span class="nx">name</span><span class="si">}</span><span class="sb">`</span><span class="p">);</span>
</span></span><span class="line"><span class="cl"><span class="p">});</span>
</span></span></code></pre>
</div>
<p>
Whenever a hash key is changed, the example above will read the field
<code>
name
</code>
from the hash, for example
<code>
tom
</code>
, and increase the value of the key
<code>
name_tom
</code>
. (
<strong>
Notice: This function will not work properly on cluster. We need to use
<code>
{}
</code>
on the key's name to make sure we are writing to a key located on the current shard. For the sake of simplicity we will ignore the cluster issues for the time being
</strong>
). Running the function will give the following results:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379> hset x name tom
</span></span><span class="line"><span class="cl"><span class="o">(</span>integer<span class="o">)</span> <span class="m">1</span>
</span></span><span class="line"><span class="cl">127.0.0.1:6379> hset x name jerry
</span></span><span class="line"><span class="cl"><span class="o">(</span>integer<span class="o">)</span> <span class="m">0</span>
</span></span><span class="line"><span class="cl">127.0.0.1:6379> get name_tom
</span></span><span class="line"><span class="cl"><span class="s2">"1"</span>
</span></span><span class="line"><span class="cl">127.0.0.1:6379> get name_jerry
</span></span><span class="line"><span class="cl"><span class="s2">"1"</span>
</span></span></code></pre>
</div>
<p>
We can see that the key
<code>
name_tom
</code>
was incremented once, and the key
<code>
name_jerry
</code>
was incremented once. Will we get the same results if we wrap the
<code>
hset
</code>
call with a
<code>
multi
</code>
/
<code>
exec
</code>
?
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379> multi
</span></span><span class="line"><span class="cl">OK
</span></span><span class="line"><span class="cl">127.0.0.1:6379<span class="o">(</span>TX<span class="o">)</span>> hset x name tom
</span></span><span class="line"><span class="cl">QUEUED
</span></span><span class="line"><span class="cl">127.0.0.1:6379<span class="o">(</span>TX<span class="o">)</span>> hset x name jerry
</span></span><span class="line"><span class="cl">QUEUED
</span></span><span class="line"><span class="cl">127.0.0.1:6379<span class="o">(</span>TX<span class="o">)</span>> <span class="nb">exec</span>
</span></span><span class="line"><span class="cl">1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">1</span>
</span></span><span class="line"><span class="cl">2<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">0</span>
</span></span><span class="line"><span class="cl">127.0.0.1:6379> get name_tom
</span></span><span class="line"><span class="cl"><span class="o">(</span>nil<span class="o">)</span>
</span></span><span class="line"><span class="cl">127.0.0.1:6379> get name_jerry
</span></span><span class="line"><span class="cl"><span class="s2">"2"</span>
</span></span></code></pre>
</div>
<p>
What just happened?
<code>
name_jerry
</code>
was incremented twice while
<code>
name_tom
</code>
was not incremented at all. This happened because, in case of a
<code>
multi
</code>
/
<code>
exec
</code>
or Lua function, the notifications are fired at the end of the transaction, so all the clients will receive notifications of the last value written, which is
<code>
jerry
</code>
.
</p>
<p>
To fix the code and still get the expected results even on
<code>
multi
</code>
/
<code>
exec
</code>
. Triggers and functions allows you to specify an optional callback that will run exactly when the notification happened (and not at the end of the transaction). The constraint on this callback is that it can only
<strong>
read
</strong>
data without performing any writes. The new code will be as follow:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-js" data-lang="js"><span class="line"><span class="cl"><span class="err">#</span><span class="o">!</span><span class="nx">js</span> <span class="nx">api_version</span><span class="o">=</span><span class="mf">1.0</span> <span class="nx">name</span><span class="o">=</span><span class="nx">lib</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="nx">redis</span><span class="p">.</span><span class="nx">registerKeySpaceTrigger</span><span class="p">(</span><span class="s2">"consumer"</span><span class="p">,</span> <span class="s2">""</span><span class="p">,</span> <span class="kd">function</span><span class="p">(</span><span class="nx">client</span><span class="p">,</span> <span class="nx">data</span><span class="p">){</span>
</span></span><span class="line"><span class="cl"> <span class="k">if</span> <span class="p">(</span><span class="nx">data</span><span class="p">.</span><span class="nx">name</span> <span class="o">!==</span> <span class="kc">undefined</span><span class="p">)</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nx">client</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="s1">'incr'</span><span class="p">,</span> <span class="sb">`name_</span><span class="si">${</span><span class="nx">data</span><span class="p">.</span><span class="nx">name</span><span class="si">}</span><span class="sb">`</span><span class="p">);</span>
</span></span><span class="line"><span class="cl"> <span class="p">}</span>
</span></span><span class="line"><span class="cl"><span class="p">},{</span>
</span></span><span class="line"><span class="cl"> <span class="nx">onTriggerFired</span><span class="o">:</span> <span class="p">(</span><span class="nx">client</span><span class="p">,</span> <span class="nx">data</span><span class="p">)</span> <span class="p">=></span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="k">if</span> <span class="p">(</span><span class="nx">client</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="s2">"type"</span><span class="p">,</span> <span class="nx">data</span><span class="p">.</span><span class="nx">key</span><span class="p">)</span> <span class="o">!=</span> <span class="s2">"hash"</span><span class="p">)</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="c1">// key is not a has, do not touch it.
</span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="k">return</span><span class="p">;</span>
</span></span><span class="line"><span class="cl"> <span class="p">}</span>
</span></span><span class="line"><span class="cl"> <span class="nx">data</span><span class="p">.</span><span class="nx">name</span> <span class="o">=</span> <span class="nx">client</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="s1">'hget'</span><span class="p">,</span> <span class="nx">data</span><span class="p">.</span><span class="nx">key</span><span class="p">,</span> <span class="s1">'name'</span><span class="p">);</span>
</span></span><span class="line"><span class="cl"> <span class="p">}</span>
</span></span><span class="line"><span class="cl"><span class="p">});</span>
</span></span></code></pre>
</div>
<p>
The above code gives an optional function argument,
<code>
onTriggerFired
</code>
, to our trigger. The function will be fired right after a key change and will allow us to read the content of the key. We are adding the content into the
<code>
data
</code>
argument, which will be given to the actual trigger function that can write the data. The above code works as expected:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379> multi
</span></span><span class="line"><span class="cl">OK
</span></span><span class="line"><span class="cl">127.0.0.1:6379<span class="o">(</span>TX<span class="o">)</span>> hset x name tom
</span></span><span class="line"><span class="cl">QUEUED
</span></span><span class="line"><span class="cl">127.0.0.1:6379<span class="o">(</span>TX<span class="o">)</span>> hset x name jerry
</span></span><span class="line"><span class="cl">QUEUED
</span></span><span class="line"><span class="cl">127.0.0.1:6379<span class="o">(</span>TX<span class="o">)</span>> <span class="nb">exec</span>
</span></span><span class="line"><span class="cl">1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">1</span>
</span></span><span class="line"><span class="cl">2<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">0</span>
</span></span><span class="line"><span class="cl">127.0.0.1:6379> get name_tom
</span></span><span class="line"><span class="cl"><span class="s2">"1"</span>
</span></span><span class="line"><span class="cl">127.0.0.1:6379> get name_jerry
</span></span><span class="line"><span class="cl"><span class="s2">"1"</span>
</span></span></code></pre>
</div>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/triggers-and-functions/concepts/triggers/keyspace_triggers/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/commands/cms.merge.html | <section class="prose w-full py-12">
<h1 class="command-name">
CMS.MERGE
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">CMS.MERGE destination numKeys source [source ...] [WEIGHTS weight
[weight ...]]</pre>
<dl class="grid grid-cols-[auto,1fr] gap-2 mb-12">
<dt class="font-semibold text-redis-ink-900 m-0">
Available in:
</dt>
<dd class="m-0">
<a href="/docs/stack">
Redis Stack
</a>
/
<a href="/docs/data-types/probabilistic">
Bloom 2.0.0
</a>
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
Time complexity:
</dt>
<dd class="m-0">
O(n) where n is the number of sketches
</dd>
</dl>
<p>
Merges several sketches into one sketch. All sketches must have identical width and depth. Weights can be used to multiply certain sketches. Default weight is 1.
</p>
<h3 id="parameters">
Parameters:
</h3>
<ul>
<li>
<strong>
dest
</strong>
: The name of destination sketch. Must be initialized.
</li>
<li>
<strong>
numKeys
</strong>
: Number of sketches to be merged.
</li>
<li>
<strong>
src
</strong>
: Names of source sketches to be merged.
</li>
<li>
<strong>
weight
</strong>
: Multiple of each sketch. Default =1.
</li>
</ul>
<h2 id="return">
Return
</h2>
<p>
<a href="/docs/latest/develop/reference/protocol-spec/#simple-strings">
Simple string reply
</a>
-
<code>
OK
</code>
if executed correctly, or [] otherwise.
</p>
<h2 id="examples">
Examples
</h2>
<pre tabindex="0"><code>redis> CMS.MERGE dest 2 test1 test2 WEIGHTS 1 3
OK
</code></pre>
<br/>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/cms.merge/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/commands/zintercard/.html | <section class="prose w-full py-12">
<h1 class="command-name">
ZINTERCARD
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">ZINTERCARD numkeys key [key ...] [LIMITΒ limit]</pre>
<dl class="grid grid-cols-[auto,1fr] gap-2 mb-12">
<dt class="font-semibold text-redis-ink-900 m-0">
Available since:
</dt>
<dd class="m-0">
7.0.0
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
Time complexity:
</dt>
<dd class="m-0">
O(N*K) worst case with N being the smallest input sorted set, K being the number of input sorted sets.
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
ACL categories:
</dt>
<dd class="m-0">
<code>
@read
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@sortedset
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@slow
</code>
<span class="mr-1 last:hidden">
,
</span>
</dd>
</dl>
<p>
This command is similar to
<a href="/docs/latest/commands/zinter/">
<code>
ZINTER
</code>
</a>
, but instead of returning the result set, it returns just the cardinality of the result.
</p>
<p>
Keys that do not exist are considered to be empty sets.
With one of the keys being an empty set, the resulting set is also empty (since set intersection with an empty set always results in an empty set).
</p>
<p>
By default, the command calculates the cardinality of the intersection of all given sets.
When provided with the optional
<code>
LIMIT
</code>
argument (which defaults to 0 and means unlimited), if the intersection cardinality reaches limit partway through the computation, the algorithm will exit and yield limit as the cardinality.
Such implementation ensures a significant speedup for queries where the limit is lower than the actual intersection cardinality.
</p>
<h2 id="examples">
Examples
</h2>
<div class="bg-slate-900 border-b border-slate-700 rounded-t-xl px-4 py-3 w-full flex">
<svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20">
<path d="M2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10Z">
</path>
</svg>
<svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20">
<path d="M10 2.5L18.6603 17.5L1.33975 17.5L10 2.5Z">
</path>
</svg>
<svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20">
<path d="M10 2.5L12.0776 7.9322L17.886 8.22949L13.3617 11.8841L14.8738 17.5L10 14.3264L5.1262 17.5L6.63834 11.8841L2.11403 8.22949L7.92238 7.9322L10 2.5Z">
</path>
</svg>
</div>
<form class="redis-cli overflow-y-auto max-h-80">
<pre tabindex="0">redis> ZADD zset1 1 "one"
(integer) 1
redis> ZADD zset1 2 "two"
(integer) 1
redis> ZADD zset2 1 "one"
(integer) 1
redis> ZADD zset2 2 "two"
(integer) 1
redis> ZADD zset2 3 "three"
(integer) 1
redis> ZINTER 2 zset1 zset2
1) "one"
2) "two"
redis> ZINTERCARD 2 zset1 zset2
(integer) 2
redis> ZINTERCARD 2 zset1 zset2 LIMIT 1
(integer) 1
</pre>
<div class="prompt" style="">
<span>
redis>
</span>
<input autocomplete="off" name="prompt" spellcheck="false" type="text"/>
</div>
</form>
<h2 id="resp2resp3-reply">
RESP2/RESP3 Reply
</h2>
<a href="../../develop/reference/protocol-spec#integers">
Integer reply
</a>
: the number of members in the resulting intersection.
<br/>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/zintercard/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/commands/del/.html | <section class="prose w-full py-12">
<h1 class="command-name">
DEL
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">DEL key [key ...]</pre>
<dl class="grid grid-cols-[auto,1fr] gap-2 mb-12">
<dt class="font-semibold text-redis-ink-900 m-0">
Available since:
</dt>
<dd class="m-0">
1.0.0
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
Time complexity:
</dt>
<dd class="m-0">
O(N) where N is the number of keys that will be removed. When a key to remove holds a value other than a string, the individual complexity for this key is O(M) where M is the number of elements in the list, set, sorted set or hash. Removing a single key that holds a string value is O(1).
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
ACL categories:
</dt>
<dd class="m-0">
<code>
@keyspace
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@write
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@slow
</code>
<span class="mr-1 last:hidden">
,
</span>
</dd>
</dl>
<p>
Removes the specified keys.
A key is ignored if it does not exist.
</p>
<h2 id="examples">
Examples
</h2>
<div class="codetabs cli group flex justify-start items-center flex-wrap box-border rounded-lg mt-0 mb-0 mx-auto bg-slate-900" id="cmds_generic-stepdel">
<input checked="" class="radiotab w-0 h-0" data-lang="redis-cli" id="redis-cli_cmds_generic-stepdel" name="cmds_generic-stepdel" tabindex="1" type="radio"/>
<label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="redis-cli_cmds_generic-stepdel" title="Open example">
>_ Redis CLI
</label>
<div aria-labelledby="tab-cmds_generic-stepdel" class="panel order-last hidden w-full mt-0 relative" id="panel_redis-cli_cmds_generic-stepdel" role="tabpanel" tabindex="0">
<div class="highlight">
<pre class="chroma"><code class="language-plaintext" data-lang="plaintext"><span class="line hl"><span class="cl">> SET key1 "Hello"
</span></span><span class="line hl"><span class="cl">"OK"
</span></span><span class="line hl"><span class="cl">> SET key2 "World"
</span></span><span class="line hl"><span class="cl">"OK"
</span></span><span class="line hl"><span class="cl">> DEL key1 key2 key3
</span></span><span class="line hl"><span class="cl">(integer) 2</span></span></code></pre>
</div>
<button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_redis-cli_cmds_generic-stepdel')" tabindex="1" title="Copy to clipboard">
<svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">
<path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z">
</path>
</svg>
<div class="tooltip relative inline-block">
<span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4">
Copied!
</span>
</div>
</button>
<div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible">
<div class="flex-1 text-xs text-white overflow-ellipsis">
Are you tired of using redis-cli? Try Redis Insight - the developer GUI for Redis.
</div>
<div class="text-right">
<a class="rounded rounded-mx px-2 py-1 flex items-center text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.com/redis-enterprise/redis-insight/" tabindex="1" title="Get Redis Insight">
<svg class="w-4 h-4 mr-1" fill="none" height="14" viewbox="0 0 14 14" width="14" xmlns="http://www.w3.org/2000/svg">
<path d="M2.26236 5.66895L1.21732 6.07172L7.00018 8.65693V7.79842L2.26236 5.66895Z" fill="#fca5a5">
</path>
<path d="M2.26236 8.02271L1.21732 8.42548L7.00018 11.0119V10.1516L2.26236 8.02271Z" fill="#fca5a5">
</path>
<path d="M1.21732 3.7175L7.00018 6.30392V2.87805L8.66273 2.13423L7.00018 1.49512L1.21732 3.7175Z" fill="#fca5a5">
</path>
<path d="M7.00018 2.8781V6.30366L1.21732 3.71724V5.20004L7.00018 7.79705V8.65526L1.21732 6.07217V7.55496L7.00018 10.1553V11.0135L1.21732 8.42376V9.90656H1.18878L7.00018 12.5051L8.66273 11.7613V2.13428L7.00018 2.8781Z" fill="#f87171">
</path>
<path d="M9.07336 11.5777L10.7359 10.8338V4.01538L9.07336 4.7592V11.5777Z" fill="#f87171">
</path>
<path d="M9.07336 4.75867L10.7359 4.01485L9.07336 3.37573V4.75867Z" fill="#fca5a5">
</path>
<path d="M11.1481 10.6497L12.8112 9.90591V5.896L11.1487 6.63982L11.1481 10.6497Z" fill="#f87171">
</path>
<path d="M11.1481 6.63954L12.8112 5.89572L11.1481 5.25781V6.63954Z" fill="#fca5a5">
</path>
</svg>
<span>
Get Redis Insight
</span>
</a>
</div>
</div>
</div>
<input class="radiotab w-0 h-0" data-lang="python" id="Python_cmds_generic-stepdel" name="cmds_generic-stepdel" tabindex="1" type="radio"/>
<label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="Python_cmds_generic-stepdel" title="Open example">
Python
</label>
<div aria-labelledby="tab-cmds_generic-stepdel" class="panel order-last hidden w-full mt-0 relative" id="panel_Python_cmds_generic-stepdel" role="tabpanel" tabindex="0">
<div class="highlight">
<pre class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">r</span> <span class="o">=</span> <span class="n">redis</span><span class="o">.</span><span class="n">Redis</span><span class="p">(</span><span class="n">decode_responses</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line hl"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"key1"</span><span class="p">,</span> <span class="s2">"Hello"</span><span class="p">)</span>
</span></span><span class="line hl"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res</span><span class="p">)</span>
</span></span><span class="line hl"><span class="cl"><span class="c1"># >>> True</span>
</span></span><span class="line hl"><span class="cl">
</span></span><span class="line hl"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"key2"</span><span class="p">,</span> <span class="s2">"World"</span><span class="p">)</span>
</span></span><span class="line hl"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res</span><span class="p">)</span>
</span></span><span class="line hl"><span class="cl"><span class="c1"># >>> True</span>
</span></span><span class="line hl"><span class="cl">
</span></span><span class="line hl"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">delete</span><span class="p">(</span><span class="s2">"key1"</span><span class="p">,</span> <span class="s2">"key2"</span><span class="p">,</span> <span class="s2">"key3"</span><span class="p">)</span>
</span></span><span class="line hl"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res</span><span class="p">)</span>
</span></span><span class="line hl"><span class="cl"><span class="c1"># >>> 2</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"mykey"</span><span class="p">,</span> <span class="s2">"Hello"</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="c1"># >>> True</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">expire</span><span class="p">(</span><span class="s2">"mykey"</span><span class="p">,</span> <span class="mi">10</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="c1"># >>> True</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">ttl</span><span class="p">(</span><span class="s2">"mykey"</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="c1"># >>> 10</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"mykey"</span><span class="p">,</span> <span class="s2">"Hello World"</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="c1"># >>> True</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">ttl</span><span class="p">(</span><span class="s2">"mykey"</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="c1"># >>> -1</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">expire</span><span class="p">(</span><span class="s2">"mykey"</span><span class="p">,</span> <span class="mi">10</span><span class="p">,</span> <span class="n">xx</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="c1"># >>> False</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">ttl</span><span class="p">(</span><span class="s2">"mykey"</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="c1"># >>> -1</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">expire</span><span class="p">(</span><span class="s2">"mykey"</span><span class="p">,</span> <span class="mi">10</span><span class="p">,</span> <span class="n">nx</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="c1"># >>> True</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">ttl</span><span class="p">(</span><span class="s2">"mykey"</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="c1"># >>> 10</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"mykey"</span><span class="p">,</span> <span class="s2">"Hello"</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="c1"># >>> True</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">expire</span><span class="p">(</span><span class="s2">"mykey"</span><span class="p">,</span> <span class="mi">10</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="c1"># >>> True</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">ttl</span><span class="p">(</span><span class="s2">"mykey"</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="c1"># >>> 10</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">sadd</span><span class="p">(</span><span class="s2">"myset"</span><span class="p">,</span> <span class="o">*</span><span class="nb">set</span><span class="p">([</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="s2">"foo"</span><span class="p">,</span> <span class="s2">"foobar"</span><span class="p">,</span> <span class="s2">"feelsgood"</span><span class="p">]))</span>
</span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="c1"># >>> 6</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">r</span><span class="o">.</span><span class="n">sscan_iter</span><span class="p">(</span><span class="s2">"myset"</span><span class="p">,</span> <span class="n">match</span><span class="o">=</span><span class="s2">"f*"</span><span class="p">))</span>
</span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="c1"># >>> ['foobar', 'foo', 'feelsgood']</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">cursor</span><span class="p">,</span> <span class="n">key</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">scan</span><span class="p">(</span><span class="n">cursor</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">match</span><span class="o">=</span><span class="s1">'*11*'</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">cursor</span><span class="p">,</span> <span class="n">key</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">cursor</span><span class="p">,</span> <span class="n">key</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">scan</span><span class="p">(</span><span class="n">cursor</span><span class="p">,</span> <span class="n">match</span><span class="o">=</span><span class="s1">'*11*'</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">cursor</span><span class="p">,</span> <span class="n">key</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">cursor</span><span class="p">,</span> <span class="n">key</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">scan</span><span class="p">(</span><span class="n">cursor</span><span class="p">,</span> <span class="n">match</span><span class="o">=</span><span class="s1">'*11*'</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">cursor</span><span class="p">,</span> <span class="n">key</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">cursor</span><span class="p">,</span> <span class="n">key</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">scan</span><span class="p">(</span><span class="n">cursor</span><span class="p">,</span> <span class="n">match</span><span class="o">=</span><span class="s1">'*11*'</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">cursor</span><span class="p">,</span> <span class="n">key</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">cursor</span><span class="p">,</span> <span class="n">keys</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">scan</span><span class="p">(</span><span class="n">cursor</span><span class="p">,</span> <span class="n">match</span><span class="o">=</span><span class="s1">'*11*'</span><span class="p">,</span> <span class="n">count</span><span class="o">=</span><span class="mi">1000</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">cursor</span><span class="p">,</span> <span class="n">keys</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">geoadd</span><span class="p">(</span><span class="s2">"geokey"</span><span class="p">,</span> <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="s2">"value"</span><span class="p">))</span>
</span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="c1"># >>> 1</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">zadd</span><span class="p">(</span><span class="s2">"zkey"</span><span class="p">,</span> <span class="p">{</span><span class="s2">"value"</span><span class="p">:</span> <span class="mi">1000</span><span class="p">})</span>
</span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="c1"># >>> 1</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">type</span><span class="p">(</span><span class="s2">"geokey"</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="c1"># >>> zset</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">type</span><span class="p">(</span><span class="s2">"zkey"</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="c1"># >>> zset</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">cursor</span><span class="p">,</span> <span class="n">keys</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">scan</span><span class="p">(</span><span class="n">cursor</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">_type</span><span class="o">=</span><span class="s2">"zset"</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">keys</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="c1"># >>> ['zkey', 'geokey']</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">hset</span><span class="p">(</span><span class="s2">"myhash"</span><span class="p">,</span> <span class="n">mapping</span><span class="o">=</span><span class="p">{</span><span class="s2">"a"</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span> <span class="s2">"b"</span><span class="p">:</span> <span class="mi">2</span><span class="p">})</span>
</span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">res</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="c1"># >>> 2</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">cursor</span><span class="p">,</span> <span class="n">keys</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">hscan</span><span class="p">(</span><span class="s2">"myhash"</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">keys</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="c1"># >>> {'a': '1', 'b': '2'}</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">cursor</span><span class="p">,</span> <span class="n">keys</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">hscan</span><span class="p">(</span><span class="s2">"myhash"</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">no_values</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">keys</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="c1"># >>> ['a', 'b']</span>
</span></span><span class="line"><span class="cl">
</span></span></code></pre>
</div>
<button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_Python_cmds_generic-stepdel')" tabindex="1" title="Copy to clipboard">
<svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">
<path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z">
</path>
</svg>
<div class="tooltip relative inline-block">
<span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4">
Copied!
</span>
</div>
</button>
<button aria-controls="panel_Python_cmds_generic-stepdel" class="visibility-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-2 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="toggleVisibleLines(this)" tabindex="1" title="Toggle visibility">
<svg class="hidden" fill="currentColor" id="visibility-off" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">
<path d="m31.45 27.05-2.2-2.2q1.3-3.55-1.35-5.9-2.65-2.35-5.75-1.2l-2.2-2.2q.85-.55 1.9-.8 1.05-.25 2.15-.25 3.55 0 6.025 2.475Q32.5 19.45 32.5 23q0 1.1-.275 2.175-.275 1.075-.775 1.875Zm6.45 6.45-2-2q2.45-1.8 4.275-4.025Q42 25.25 42.85 23q-2.5-5.55-7.5-8.775Q30.35 11 24.5 11q-2.1 0-4.3.4-2.2.4-3.45.95L14.45 10q1.75-.8 4.475-1.4Q21.65 8 24.25 8q7.15 0 13.075 4.075Q43.25 16.15 46 23q-1.3 3.2-3.35 5.85-2.05 2.65-4.75 4.65Zm2.9 11.3-8.4-8.25q-1.75.7-3.95 1.075T24 38q-7.3 0-13.25-4.075T2 23q1-2.6 2.775-5.075T9.1 13.2L2.8 6.9l2.1-2.15L42.75 42.6ZM11.15 15.3q-1.85 1.35-3.575 3.55Q5.85 21.05 5.1 23q2.55 5.55 7.675 8.775Q17.9 35 24.4 35q1.65 0 3.25-.2t2.4-.6l-3.2-3.2q-.55.25-1.35.375T24 31.5q-3.5 0-6-2.45T15.5 23q0-.75.125-1.5T16 20.15Zm15.25 7.1Zm-5.8 2.9Z">
</path>
</svg>
<svg fill="currentColor" id="visibility-on" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">
<path d="M24 31.5q3.55 0 6.025-2.475Q32.5 26.55 32.5 23q0-3.55-2.475-6.025Q27.55 14.5 24 14.5q-3.55 0-6.025 2.475Q15.5 19.45 15.5 23q0 3.55 2.475 6.025Q20.45 31.5 24 31.5Zm0-2.9q-2.35 0-3.975-1.625T18.4 23q0-2.35 1.625-3.975T24 17.4q2.35 0 3.975 1.625T29.6 23q0 2.35-1.625 3.975T24 28.6Zm0 9.4q-7.3 0-13.2-4.15Q4.9 29.7 2 23q2.9-6.7 8.8-10.85Q16.7 8 24 8q7.3 0 13.2 4.15Q43.1 16.3 46 23q-2.9 6.7-8.8 10.85Q31.3 38 24 38Zm0-15Zm0 12q6.05 0 11.125-3.275T42.85 23q-2.65-5.45-7.725-8.725Q30.05 11 24 11t-11.125 3.275Q7.8 17.55 5.1 23q2.7 5.45 7.775 8.725Q17.95 35 24 35Z">
</path>
</svg>
</button>
<div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible">
<a class="rounded rounded-mx px-3 py-1 text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.io/docs/latest/develop/connect/clients/python/redis-py/" tabindex="1" title="Quick-Start">
Python Quick-Start
</a>
<div class="w-1/2">
</div>
<div class="flex-1 text-right">
<a class="button text-neutral-400 hover:text-slate-100 h-6 w-6 p-1" href="https://github.com/redis/redis-py/tree/master/doctests/cmds_generic.py" tabindex="1" title="Improve this code example">
<svg fill="github" height="16" viewbox="0 0 18 16" width="18" xmlns="http://www.w3.org/2000/svg">
<path clip-rule="evenodd" d="M8.99953 1.43397e-06C7.09918 -0.000897921 5.26058 0.674713 3.81295 1.90585C2.36533 3.13699 1.40324 4.84324 1.09896 6.71907C0.794684 8.5949 1.1681 10.5178 2.15233 12.1434C3.13657 13.769 4.66734 14.9912 6.47053 15.591C6.87053 15.664 7.01653 15.417 7.01653 15.205C7.01653 15.015 7.00953 14.512 7.00553 13.845C4.78053 14.328 4.31053 12.772 4.31053 12.772C4.16325 12.2887 3.84837 11.8739 3.42253 11.602C2.69653 11.102 3.47753 11.116 3.47753 11.116C3.73043 11.1515 3.97191 11.2442 4.18365 11.3869C4.39539 11.5297 4.57182 11.7189 4.69953 11.94C4.80755 12.1377 4.95378 12.3119 5.12972 12.4526C5.30567 12.5933 5.50782 12.6976 5.72442 12.7595C5.94103 12.8214 6.16778 12.8396 6.39148 12.813C6.61519 12.7865 6.83139 12.7158 7.02753 12.605C7.06381 12.1992 7.24399 11.8197 7.53553 11.535C5.75953 11.335 3.89153 10.647 3.89153 7.581C3.88005 6.78603 4.17513 6.01716 4.71553 5.434C4.47318 4.74369 4.50322 3.98693 4.79953 3.318C4.79953 3.318 5.47053 3.103 6.99953 4.138C8.31074 3.77905 9.69432 3.77905 11.0055 4.138C12.5325 3.103 13.2055 3.318 13.2055 3.318C13.5012 3.9877 13.5294 4.74513 13.2845 5.435C13.8221 6.01928 14.114 6.78817 14.0995 7.582C14.0995 10.655 12.2285 11.332 10.4465 11.53C10.6375 11.724 10.7847 11.9566 10.8784 12.2123C10.972 12.4679 11.0099 12.7405 10.9895 13.012C10.9895 14.081 10.9795 14.944 10.9795 15.206C10.9795 15.42 11.1235 15.669 11.5295 15.591C13.3328 14.9911 14.8636 13.7689 15.8479 12.1432C16.8321 10.5175 17.2054 8.59447 16.901 6.71858C16.5966 4.84268 15.6343 3.13642 14.1865 1.90536C12.7387 0.674306 10.9 -0.0011359 8.99953 1.43397e-06Z" fill="white" fill-rule="evenodd">
</path>
</svg>
</a>
</div>
</div>
</div>
<input class="radiotab w-0 h-0" data-lang="javascript" id="Nodejs_cmds_generic-stepdel" name="cmds_generic-stepdel" tabindex="1" type="radio"/>
<label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="Nodejs_cmds_generic-stepdel" title="Open example">
Node.js
</label>
<div aria-labelledby="tab-cmds_generic-stepdel" class="panel order-last hidden w-full mt-0 relative" id="panel_Nodejs_cmds_generic-stepdel" role="tabpanel" tabindex="0">
<div class="highlight">
<pre class="chroma"><code class="language-javascript" data-lang="javascript"><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="kr">import</span> <span class="p">{</span> <span class="nx">createClient</span> <span class="p">}</span> <span class="nx">from</span> <span class="s1">'redis'</span><span class="p">;</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">client</span> <span class="o">=</span> <span class="nx">createClient</span><span class="p">();</span>
</span></span><span class="line"><span class="cl"><span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">connect</span><span class="p">().</span><span class="k">catch</span><span class="p">(</span><span class="nx">console</span><span class="p">.</span><span class="nx">error</span><span class="p">);</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line hl"><span class="cl"><span class="kr">const</span> <span class="nx">delRes1</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">'key1'</span><span class="p">,</span> <span class="s1">'Hello'</span><span class="p">);</span>
</span></span><span class="line hl"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">delRes1</span><span class="p">);</span> <span class="c1">// OK
</span></span></span><span class="line hl"><span class="cl"><span class="c1"></span>
</span></span><span class="line hl"><span class="cl"><span class="kr">const</span> <span class="nx">delRes2</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">'key2'</span><span class="p">,</span> <span class="s1">'World'</span><span class="p">);</span>
</span></span><span class="line hl"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">delRes2</span><span class="p">);</span> <span class="c1">// OK
</span></span></span><span class="line hl"><span class="cl"><span class="c1"></span>
</span></span><span class="line hl"><span class="cl"><span class="kr">const</span> <span class="nx">delRes3</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">del</span><span class="p">([</span><span class="s1">'key1'</span><span class="p">,</span> <span class="s1">'key2'</span><span class="p">,</span> <span class="s1">'key3'</span><span class="p">]);</span>
</span></span><span class="line hl"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">delRes3</span><span class="p">);</span> <span class="c1">// 2
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">expireRes1</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">'mykey'</span><span class="p">,</span> <span class="s1">'Hello'</span><span class="p">);</span>
</span></span><span class="line"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">expireRes1</span><span class="p">);</span> <span class="c1">// OK
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">expireRes2</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">expire</span><span class="p">(</span><span class="s1">'mykey'</span><span class="p">,</span> <span class="mi">10</span><span class="p">);</span>
</span></span><span class="line"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">expireRes2</span><span class="p">);</span> <span class="c1">// true
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">expireRes3</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">ttl</span><span class="p">(</span><span class="s1">'mykey'</span><span class="p">);</span>
</span></span><span class="line"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">expireRes3</span><span class="p">);</span> <span class="c1">// 10
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">expireRes4</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">'mykey'</span><span class="p">,</span> <span class="s1">'Hello World'</span><span class="p">);</span>
</span></span><span class="line"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">expireRes4</span><span class="p">);</span> <span class="c1">// OK
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">expireRes5</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">ttl</span><span class="p">(</span><span class="s1">'mykey'</span><span class="p">);</span>
</span></span><span class="line"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">expireRes5</span><span class="p">);</span> <span class="c1">// -1
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">expireRes6</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">expire</span><span class="p">(</span><span class="s1">'mykey'</span><span class="p">,</span> <span class="mi">10</span><span class="p">,</span> <span class="s2">"XX"</span><span class="p">);</span>
</span></span><span class="line"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">expireRes6</span><span class="p">);</span> <span class="c1">// false
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">expireRes7</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">ttl</span><span class="p">(</span><span class="s1">'mykey'</span><span class="p">);</span>
</span></span><span class="line"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">expireRes7</span><span class="p">);</span> <span class="c1">// -1
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">expireRes8</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">expire</span><span class="p">(</span><span class="s1">'mykey'</span><span class="p">,</span> <span class="mi">10</span><span class="p">,</span> <span class="s2">"NX"</span><span class="p">);</span>
</span></span><span class="line"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">expireRes8</span><span class="p">);</span> <span class="c1">// true
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">expireRes9</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">ttl</span><span class="p">(</span><span class="s1">'mykey'</span><span class="p">);</span>
</span></span><span class="line"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">expireRes9</span><span class="p">);</span> <span class="c1">// 10
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">ttlRes1</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">'mykey'</span><span class="p">,</span> <span class="s1">'Hello'</span><span class="p">);</span>
</span></span><span class="line"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">ttlRes1</span><span class="p">);</span> <span class="c1">// OK
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">ttlRes2</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">expire</span><span class="p">(</span><span class="s1">'mykey'</span><span class="p">,</span> <span class="mi">10</span><span class="p">);</span>
</span></span><span class="line"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">ttlRes2</span><span class="p">);</span> <span class="c1">// true
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">ttlRes3</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">ttl</span><span class="p">(</span><span class="s1">'mykey'</span><span class="p">);</span>
</span></span><span class="line"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">ttlRes3</span><span class="p">);</span> <span class="c1">// 10
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">scan1Res1</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">sAdd</span><span class="p">(</span><span class="s1">'myset'</span><span class="p">,</span> <span class="p">[</span><span class="s1">'1'</span><span class="p">,</span> <span class="s1">'2'</span><span class="p">,</span> <span class="s1">'3'</span><span class="p">,</span> <span class="s1">'foo'</span><span class="p">,</span> <span class="s1">'foobar'</span><span class="p">,</span> <span class="s1">'feelsgood'</span><span class="p">]);</span>
</span></span><span class="line"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">scan1Res1</span><span class="p">);</span> <span class="c1">// 6
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">scan1Res2</span> <span class="o">=</span> <span class="p">[];</span>
</span></span><span class="line"><span class="cl"><span class="k">for</span> <span class="kr">await</span> <span class="p">(</span><span class="kr">const</span> <span class="nx">value</span> <span class="k">of</span> <span class="nx">client</span><span class="p">.</span><span class="nx">sScanIterator</span><span class="p">(</span><span class="s1">'myset'</span><span class="p">,</span> <span class="p">{</span> <span class="nx">MATCH</span><span class="o">:</span> <span class="s1">'f*'</span> <span class="p">}))</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nx">scan1Res2</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="nx">value</span><span class="p">);</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span><span class="line"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">scan1Res2</span><span class="p">);</span> <span class="c1">// ['foo', 'foobar', 'feelsgood']
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl"><span class="kd">let</span> <span class="nx">cursor</span> <span class="o">=</span> <span class="s1">'0'</span><span class="p">;</span>
</span></span><span class="line"><span class="cl"><span class="kd">let</span> <span class="nx">scanResult</span><span class="p">;</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="nx">scanResult</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">scan</span><span class="p">(</span><span class="nx">cursor</span><span class="p">,</span> <span class="p">{</span> <span class="nx">MATCH</span><span class="o">:</span> <span class="s1">'*11*'</span> <span class="p">});</span>
</span></span><span class="line"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">scanResult</span><span class="p">.</span><span class="nx">cursor</span><span class="p">,</span> <span class="nx">scanResult</span><span class="p">.</span><span class="nx">keys</span><span class="p">);</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="nx">scanResult</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">scan</span><span class="p">(</span><span class="nx">scanResult</span><span class="p">.</span><span class="nx">cursor</span><span class="p">,</span> <span class="p">{</span> <span class="nx">MATCH</span><span class="o">:</span> <span class="s1">'*11*'</span> <span class="p">});</span>
</span></span><span class="line"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">scanResult</span><span class="p">.</span><span class="nx">cursor</span><span class="p">,</span> <span class="nx">scanResult</span><span class="p">.</span><span class="nx">keys</span><span class="p">);</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="nx">scanResult</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">scan</span><span class="p">(</span><span class="nx">scanResult</span><span class="p">.</span><span class="nx">cursor</span><span class="p">,</span> <span class="p">{</span> <span class="nx">MATCH</span><span class="o">:</span> <span class="s1">'*11*'</span> <span class="p">});</span>
</span></span><span class="line"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">scanResult</span><span class="p">.</span><span class="nx">cursor</span><span class="p">,</span> <span class="nx">scanResult</span><span class="p">.</span><span class="nx">keys</span><span class="p">);</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="nx">scanResult</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">scan</span><span class="p">(</span><span class="nx">scanResult</span><span class="p">.</span><span class="nx">cursor</span><span class="p">,</span> <span class="p">{</span> <span class="nx">MATCH</span><span class="o">:</span> <span class="s1">'*11*'</span> <span class="p">});</span>
</span></span><span class="line"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">scanResult</span><span class="p">.</span><span class="nx">cursor</span><span class="p">,</span> <span class="nx">scanResult</span><span class="p">.</span><span class="nx">keys</span><span class="p">);</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="nx">scanResult</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">scan</span><span class="p">(</span><span class="nx">scanResult</span><span class="p">.</span><span class="nx">cursor</span><span class="p">,</span> <span class="p">{</span> <span class="nx">MATCH</span><span class="o">:</span> <span class="s1">'*11*'</span><span class="p">,</span> <span class="nx">COUNT</span><span class="o">:</span> <span class="mi">1000</span> <span class="p">});</span>
</span></span><span class="line"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">scanResult</span><span class="p">.</span><span class="nx">cursor</span><span class="p">,</span> <span class="nx">scanResult</span><span class="p">.</span><span class="nx">keys</span><span class="p">);</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">scan3Res1</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">geoAdd</span><span class="p">(</span><span class="s1">'geokey'</span><span class="p">,</span> <span class="p">{</span> <span class="nx">longitude</span><span class="o">:</span> <span class="mi">0</span><span class="p">,</span> <span class="nx">latitude</span><span class="o">:</span> <span class="mi">0</span><span class="p">,</span> <span class="nx">member</span><span class="o">:</span> <span class="s1">'value'</span> <span class="p">});</span>
</span></span><span class="line"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">scan3Res1</span><span class="p">);</span> <span class="c1">// 1
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">scan3Res2</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">zAdd</span><span class="p">(</span><span class="s1">'zkey'</span><span class="p">,</span> <span class="p">[{</span> <span class="nx">score</span><span class="o">:</span> <span class="mi">1000</span><span class="p">,</span> <span class="nx">value</span><span class="o">:</span> <span class="s1">'value'</span> <span class="p">}]);</span>
</span></span><span class="line"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">scan3Res2</span><span class="p">);</span> <span class="c1">// 1
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">scan3Res3</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">type</span><span class="p">(</span><span class="s1">'geokey'</span><span class="p">);</span>
</span></span><span class="line"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">scan3Res3</span><span class="p">);</span> <span class="c1">// zset
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">scan3Res4</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">type</span><span class="p">(</span><span class="s1">'zkey'</span><span class="p">);</span>
</span></span><span class="line"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">scan3Res4</span><span class="p">);</span> <span class="c1">// zset
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">scan3Res5</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">scan</span><span class="p">(</span><span class="s1">'0'</span><span class="p">,</span> <span class="p">{</span> <span class="nx">TYPE</span><span class="o">:</span> <span class="s1">'zset'</span> <span class="p">});</span>
</span></span><span class="line"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">scan3Res5</span><span class="p">.</span><span class="nx">keys</span><span class="p">);</span> <span class="c1">// ['zkey', 'geokey']
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">scan4Res1</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">hSet</span><span class="p">(</span><span class="s1">'myhash'</span><span class="p">,</span> <span class="p">{</span> <span class="nx">a</span><span class="o">:</span> <span class="mi">1</span><span class="p">,</span> <span class="nx">b</span><span class="o">:</span> <span class="mi">2</span> <span class="p">});</span>
</span></span><span class="line"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">scan4Res1</span><span class="p">);</span> <span class="c1">// 2
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">scan4Res2</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">hScan</span><span class="p">(</span><span class="s1">'myhash'</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
</span></span><span class="line"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">scan4Res2</span><span class="p">.</span><span class="nx">tuples</span><span class="p">);</span> <span class="c1">// [{field: 'a', value: '1'}, {field: 'b', value: '2'}]
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">scan4Res3</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">hScan</span><span class="p">(</span><span class="s1">'myhash'</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="p">{</span> <span class="nx">COUNT</span><span class="o">:</span> <span class="mi">10</span> <span class="p">});</span>
</span></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">items</span> <span class="o">=</span> <span class="nx">scan4Res3</span><span class="p">.</span><span class="nx">tuples</span><span class="p">.</span><span class="nx">map</span><span class="p">((</span><span class="nx">item</span><span class="p">)</span> <span class="p">=></span> <span class="nx">item</span><span class="p">.</span><span class="nx">field</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">items</span><span class="p">);</span> <span class="c1">// ['a', 'b']
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl"><span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">quit</span><span class="p">();</span>
</span></span></code></pre>
</div>
<button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_Nodejs_cmds_generic-stepdel')" tabindex="1" title="Copy to clipboard">
<svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">
<path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z">
</path>
</svg>
<div class="tooltip relative inline-block">
<span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4">
Copied!
</span>
</div>
</button>
<button aria-controls="panel_Nodejs_cmds_generic-stepdel" class="visibility-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-2 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="toggleVisibleLines(this)" tabindex="1" title="Toggle visibility">
<svg class="hidden" fill="currentColor" id="visibility-off" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">
<path d="m31.45 27.05-2.2-2.2q1.3-3.55-1.35-5.9-2.65-2.35-5.75-1.2l-2.2-2.2q.85-.55 1.9-.8 1.05-.25 2.15-.25 3.55 0 6.025 2.475Q32.5 19.45 32.5 23q0 1.1-.275 2.175-.275 1.075-.775 1.875Zm6.45 6.45-2-2q2.45-1.8 4.275-4.025Q42 25.25 42.85 23q-2.5-5.55-7.5-8.775Q30.35 11 24.5 11q-2.1 0-4.3.4-2.2.4-3.45.95L14.45 10q1.75-.8 4.475-1.4Q21.65 8 24.25 8q7.15 0 13.075 4.075Q43.25 16.15 46 23q-1.3 3.2-3.35 5.85-2.05 2.65-4.75 4.65Zm2.9 11.3-8.4-8.25q-1.75.7-3.95 1.075T24 38q-7.3 0-13.25-4.075T2 23q1-2.6 2.775-5.075T9.1 13.2L2.8 6.9l2.1-2.15L42.75 42.6ZM11.15 15.3q-1.85 1.35-3.575 3.55Q5.85 21.05 5.1 23q2.55 5.55 7.675 8.775Q17.9 35 24.4 35q1.65 0 3.25-.2t2.4-.6l-3.2-3.2q-.55.25-1.35.375T24 31.5q-3.5 0-6-2.45T15.5 23q0-.75.125-1.5T16 20.15Zm15.25 7.1Zm-5.8 2.9Z">
</path>
</svg>
<svg fill="currentColor" id="visibility-on" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">
<path d="M24 31.5q3.55 0 6.025-2.475Q32.5 26.55 32.5 23q0-3.55-2.475-6.025Q27.55 14.5 24 14.5q-3.55 0-6.025 2.475Q15.5 19.45 15.5 23q0 3.55 2.475 6.025Q20.45 31.5 24 31.5Zm0-2.9q-2.35 0-3.975-1.625T18.4 23q0-2.35 1.625-3.975T24 17.4q2.35 0 3.975 1.625T29.6 23q0 2.35-1.625 3.975T24 28.6Zm0 9.4q-7.3 0-13.2-4.15Q4.9 29.7 2 23q2.9-6.7 8.8-10.85Q16.7 8 24 8q7.3 0 13.2 4.15Q43.1 16.3 46 23q-2.9 6.7-8.8 10.85Q31.3 38 24 38Zm0-15Zm0 12q6.05 0 11.125-3.275T42.85 23q-2.65-5.45-7.725-8.725Q30.05 11 24 11t-11.125 3.275Q7.8 17.55 5.1 23q2.7 5.45 7.775 8.725Q17.95 35 24 35Z">
</path>
</svg>
</button>
<div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible">
<a class="rounded rounded-mx px-3 py-1 text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.io/docs/latest/develop/connect/clients/nodejs/" tabindex="1" title="Quick-Start">
Node.js Quick-Start
</a>
<div class="w-1/2">
</div>
<div class="flex-1 text-right">
<a class="button text-neutral-400 hover:text-slate-100 h-6 w-6 p-1" href="https://github.com/redis/node-redis/tree/emb-examples/doctests/cmds-generic.js" tabindex="1" title="Improve this code example">
<svg fill="github" height="16" viewbox="0 0 18 16" width="18" xmlns="http://www.w3.org/2000/svg">
<path clip-rule="evenodd" d="M8.99953 1.43397e-06C7.09918 -0.000897921 5.26058 0.674713 3.81295 1.90585C2.36533 3.13699 1.40324 4.84324 1.09896 6.71907C0.794684 8.5949 1.1681 10.5178 2.15233 12.1434C3.13657 13.769 4.66734 14.9912 6.47053 15.591C6.87053 15.664 7.01653 15.417 7.01653 15.205C7.01653 15.015 7.00953 14.512 7.00553 13.845C4.78053 14.328 4.31053 12.772 4.31053 12.772C4.16325 12.2887 3.84837 11.8739 3.42253 11.602C2.69653 11.102 3.47753 11.116 3.47753 11.116C3.73043 11.1515 3.97191 11.2442 4.18365 11.3869C4.39539 11.5297 4.57182 11.7189 4.69953 11.94C4.80755 12.1377 4.95378 12.3119 5.12972 12.4526C5.30567 12.5933 5.50782 12.6976 5.72442 12.7595C5.94103 12.8214 6.16778 12.8396 6.39148 12.813C6.61519 12.7865 6.83139 12.7158 7.02753 12.605C7.06381 12.1992 7.24399 11.8197 7.53553 11.535C5.75953 11.335 3.89153 10.647 3.89153 7.581C3.88005 6.78603 4.17513 6.01716 4.71553 5.434C4.47318 4.74369 4.50322 3.98693 4.79953 3.318C4.79953 3.318 5.47053 3.103 6.99953 4.138C8.31074 3.77905 9.69432 3.77905 11.0055 4.138C12.5325 3.103 13.2055 3.318 13.2055 3.318C13.5012 3.9877 13.5294 4.74513 13.2845 5.435C13.8221 6.01928 14.114 6.78817 14.0995 7.582C14.0995 10.655 12.2285 11.332 10.4465 11.53C10.6375 11.724 10.7847 11.9566 10.8784 12.2123C10.972 12.4679 11.0099 12.7405 10.9895 13.012C10.9895 14.081 10.9795 14.944 10.9795 15.206C10.9795 15.42 11.1235 15.669 11.5295 15.591C13.3328 14.9911 14.8636 13.7689 15.8479 12.1432C16.8321 10.5175 17.2054 8.59447 16.901 6.71858C16.5966 4.84268 15.6343 3.13642 14.1865 1.90536C12.7387 0.674306 10.9 -0.0011359 8.99953 1.43397e-06Z" fill="white" fill-rule="evenodd">
</path>
</svg>
</a>
</div>
</div>
</div>
<input class="radiotab w-0 h-0" data-lang="java" id="Java_cmds_generic-stepdel" name="cmds_generic-stepdel" tabindex="1" type="radio"/>
<label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="Java_cmds_generic-stepdel" title="Open example">
Java
</label>
<div aria-labelledby="tab-cmds_generic-stepdel" class="panel order-last hidden w-full mt-0 relative" id="panel_Java_cmds_generic-stepdel" role="tabpanel" tabindex="0">
<div class="highlight">
<pre class="chroma"><code class="language-java" data-lang="java"><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis.clients.jedis.UnifiedJedis</span><span class="o">;</span>
</span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">redis.clients.jedis.args.ExpiryOption</span><span class="o">;</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="kd">public</span> <span class="kd">class</span> <span class="nc">CmdsGenericExample</span> <span class="o">{</span>
</span></span><span class="line"><span class="cl"> <span class="kd">public</span> <span class="kt">void</span> <span class="nf">run</span><span class="o">()</span> <span class="o">{</span>
</span></span><span class="line"><span class="cl"> <span class="n">UnifiedJedis</span> <span class="n">jedis</span> <span class="o">=</span> <span class="k">new</span> <span class="n">UnifiedJedis</span><span class="o">(</span><span class="s">"redis://localhost:6379"</span><span class="o">);</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line hl"><span class="cl"> <span class="n">String</span> <span class="n">delResult1</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">set</span><span class="o">(</span><span class="s">"key1"</span><span class="o">,</span> <span class="s">"Hello"</span><span class="o">);</span>
</span></span><span class="line hl"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">delResult1</span><span class="o">);</span> <span class="c1">// >>> OK
</span></span></span><span class="line hl"><span class="cl"><span class="c1"></span>
</span></span><span class="line hl"><span class="cl"> <span class="n">String</span> <span class="n">delResult2</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">set</span><span class="o">(</span><span class="s">"key2"</span><span class="o">,</span> <span class="s">"World"</span><span class="o">);</span>
</span></span><span class="line hl"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">delResult2</span><span class="o">);</span> <span class="c1">// >>> OK
</span></span></span><span class="line hl"><span class="cl"><span class="c1"></span>
</span></span><span class="line hl"><span class="cl"> <span class="kt">long</span> <span class="n">delResult3</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">del</span><span class="o">(</span><span class="s">"key1"</span><span class="o">,</span> <span class="s">"key2"</span><span class="o">,</span> <span class="s">"key3"</span><span class="o">);</span>
</span></span><span class="line hl"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">delResult3</span><span class="o">);</span> <span class="c1">// >>> 2
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'del' step.
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="n">String</span> <span class="n">expireResult1</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">set</span><span class="o">(</span><span class="s">"mykey"</span><span class="o">,</span> <span class="s">"Hello"</span><span class="o">);</span>
</span></span><span class="line"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">expireResult1</span><span class="o">);</span> <span class="c1">// >>> OK
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl"> <span class="kt">long</span> <span class="n">expireResult2</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">expire</span><span class="o">(</span><span class="s">"mykey"</span><span class="o">,</span> <span class="mi">10</span><span class="o">);</span>
</span></span><span class="line"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">expireResult2</span><span class="o">);</span> <span class="c1">// >>> 1
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl"> <span class="kt">long</span> <span class="n">expireResult3</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">ttl</span><span class="o">(</span><span class="s">"mykey"</span><span class="o">);</span>
</span></span><span class="line"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">expireResult3</span><span class="o">);</span> <span class="c1">// >>> 10
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl"> <span class="n">String</span> <span class="n">expireResult4</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">set</span><span class="o">(</span><span class="s">"mykey"</span><span class="o">,</span> <span class="s">"Hello World"</span><span class="o">);</span>
</span></span><span class="line"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">expireResult4</span><span class="o">);</span> <span class="c1">// >>> OK
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl"> <span class="kt">long</span> <span class="n">expireResult5</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">ttl</span><span class="o">(</span><span class="s">"mykey"</span><span class="o">);</span>
</span></span><span class="line"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">expireResult5</span><span class="o">);</span> <span class="c1">// >>> -1
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl"> <span class="kt">long</span> <span class="n">expireResult6</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">expire</span><span class="o">(</span><span class="s">"mykey"</span><span class="o">,</span> <span class="mi">10</span><span class="o">,</span> <span class="n">ExpiryOption</span><span class="o">.</span><span class="na">XX</span><span class="o">);</span>
</span></span><span class="line"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">expireResult6</span><span class="o">);</span> <span class="c1">// >>> 0
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl"> <span class="kt">long</span> <span class="n">expireResult7</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">ttl</span><span class="o">(</span><span class="s">"mykey"</span><span class="o">);</span>
</span></span><span class="line"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">expireResult7</span><span class="o">);</span> <span class="c1">// >>> -1
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl"> <span class="kt">long</span> <span class="n">expireResult8</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">expire</span><span class="o">(</span><span class="s">"mykey"</span><span class="o">,</span> <span class="mi">10</span><span class="o">,</span> <span class="n">ExpiryOption</span><span class="o">.</span><span class="na">NX</span><span class="o">);</span>
</span></span><span class="line"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">expireResult8</span><span class="o">);</span> <span class="c1">// >>> 1
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl"> <span class="kt">long</span> <span class="n">expireResult9</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">ttl</span><span class="o">(</span><span class="s">"mykey"</span><span class="o">);</span>
</span></span><span class="line"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">expireResult9</span><span class="o">);</span> <span class="c1">// >>> 10
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'expire' step.
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="n">String</span> <span class="n">ttlResult1</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">set</span><span class="o">(</span><span class="s">"mykey"</span><span class="o">,</span> <span class="s">"Hello"</span><span class="o">);</span>
</span></span><span class="line"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">ttlResult1</span><span class="o">);</span> <span class="c1">// >>> OK
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl"> <span class="kt">long</span> <span class="n">ttlResult2</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">expire</span><span class="o">(</span><span class="s">"mykey"</span><span class="o">,</span> <span class="mi">10</span><span class="o">);</span>
</span></span><span class="line"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">ttlResult2</span><span class="o">);</span> <span class="c1">// >>> 1
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl"> <span class="kt">long</span> <span class="n">ttlResult3</span> <span class="o">=</span> <span class="n">jedis</span><span class="o">.</span><span class="na">ttl</span><span class="o">(</span><span class="s">"mykey"</span><span class="o">);</span>
</span></span><span class="line"><span class="cl"> <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">ttlResult3</span><span class="o">);</span> <span class="c1">// >>> 10
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'ttl' step.
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="o">}</span>
</span></span><span class="line"><span class="cl"><span class="o">}</span>
</span></span><span class="line"><span class="cl">
</span></span></code></pre>
</div>
<button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_Java_cmds_generic-stepdel')" tabindex="1" title="Copy to clipboard">
<svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">
<path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z">
</path>
</svg>
<div class="tooltip relative inline-block">
<span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4">
Copied!
</span>
</div>
</button>
<button aria-controls="panel_Java_cmds_generic-stepdel" class="visibility-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-2 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="toggleVisibleLines(this)" tabindex="1" title="Toggle visibility">
<svg class="hidden" fill="currentColor" id="visibility-off" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">
<path d="m31.45 27.05-2.2-2.2q1.3-3.55-1.35-5.9-2.65-2.35-5.75-1.2l-2.2-2.2q.85-.55 1.9-.8 1.05-.25 2.15-.25 3.55 0 6.025 2.475Q32.5 19.45 32.5 23q0 1.1-.275 2.175-.275 1.075-.775 1.875Zm6.45 6.45-2-2q2.45-1.8 4.275-4.025Q42 25.25 42.85 23q-2.5-5.55-7.5-8.775Q30.35 11 24.5 11q-2.1 0-4.3.4-2.2.4-3.45.95L14.45 10q1.75-.8 4.475-1.4Q21.65 8 24.25 8q7.15 0 13.075 4.075Q43.25 16.15 46 23q-1.3 3.2-3.35 5.85-2.05 2.65-4.75 4.65Zm2.9 11.3-8.4-8.25q-1.75.7-3.95 1.075T24 38q-7.3 0-13.25-4.075T2 23q1-2.6 2.775-5.075T9.1 13.2L2.8 6.9l2.1-2.15L42.75 42.6ZM11.15 15.3q-1.85 1.35-3.575 3.55Q5.85 21.05 5.1 23q2.55 5.55 7.675 8.775Q17.9 35 24.4 35q1.65 0 3.25-.2t2.4-.6l-3.2-3.2q-.55.25-1.35.375T24 31.5q-3.5 0-6-2.45T15.5 23q0-.75.125-1.5T16 20.15Zm15.25 7.1Zm-5.8 2.9Z">
</path>
</svg>
<svg fill="currentColor" id="visibility-on" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">
<path d="M24 31.5q3.55 0 6.025-2.475Q32.5 26.55 32.5 23q0-3.55-2.475-6.025Q27.55 14.5 24 14.5q-3.55 0-6.025 2.475Q15.5 19.45 15.5 23q0 3.55 2.475 6.025Q20.45 31.5 24 31.5Zm0-2.9q-2.35 0-3.975-1.625T18.4 23q0-2.35 1.625-3.975T24 17.4q2.35 0 3.975 1.625T29.6 23q0 2.35-1.625 3.975T24 28.6Zm0 9.4q-7.3 0-13.2-4.15Q4.9 29.7 2 23q2.9-6.7 8.8-10.85Q16.7 8 24 8q7.3 0 13.2 4.15Q43.1 16.3 46 23q-2.9 6.7-8.8 10.85Q31.3 38 24 38Zm0-15Zm0 12q6.05 0 11.125-3.275T42.85 23q-2.65-5.45-7.725-8.725Q30.05 11 24 11t-11.125 3.275Q7.8 17.55 5.1 23q2.7 5.45 7.775 8.725Q17.95 35 24 35Z">
</path>
</svg>
</button>
<div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible">
<a class="rounded rounded-mx px-3 py-1 text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.io/docs/latest/develop/connect/clients/java/jedis/" tabindex="1" title="Quick-Start">
Java Quick-Start
</a>
<div class="w-1/2">
</div>
<div class="flex-1 text-right">
<a class="button text-neutral-400 hover:text-slate-100 h-6 w-6 p-1" href="https://github.com/redis/jedis/tree/master/src/test/java/io/redis/examples/CmdsGenericExample.java" tabindex="1" title="Improve this code example">
<svg fill="github" height="16" viewbox="0 0 18 16" width="18" xmlns="http://www.w3.org/2000/svg">
<path clip-rule="evenodd" d="M8.99953 1.43397e-06C7.09918 -0.000897921 5.26058 0.674713 3.81295 1.90585C2.36533 3.13699 1.40324 4.84324 1.09896 6.71907C0.794684 8.5949 1.1681 10.5178 2.15233 12.1434C3.13657 13.769 4.66734 14.9912 6.47053 15.591C6.87053 15.664 7.01653 15.417 7.01653 15.205C7.01653 15.015 7.00953 14.512 7.00553 13.845C4.78053 14.328 4.31053 12.772 4.31053 12.772C4.16325 12.2887 3.84837 11.8739 3.42253 11.602C2.69653 11.102 3.47753 11.116 3.47753 11.116C3.73043 11.1515 3.97191 11.2442 4.18365 11.3869C4.39539 11.5297 4.57182 11.7189 4.69953 11.94C4.80755 12.1377 4.95378 12.3119 5.12972 12.4526C5.30567 12.5933 5.50782 12.6976 5.72442 12.7595C5.94103 12.8214 6.16778 12.8396 6.39148 12.813C6.61519 12.7865 6.83139 12.7158 7.02753 12.605C7.06381 12.1992 7.24399 11.8197 7.53553 11.535C5.75953 11.335 3.89153 10.647 3.89153 7.581C3.88005 6.78603 4.17513 6.01716 4.71553 5.434C4.47318 4.74369 4.50322 3.98693 4.79953 3.318C4.79953 3.318 5.47053 3.103 6.99953 4.138C8.31074 3.77905 9.69432 3.77905 11.0055 4.138C12.5325 3.103 13.2055 3.318 13.2055 3.318C13.5012 3.9877 13.5294 4.74513 13.2845 5.435C13.8221 6.01928 14.114 6.78817 14.0995 7.582C14.0995 10.655 12.2285 11.332 10.4465 11.53C10.6375 11.724 10.7847 11.9566 10.8784 12.2123C10.972 12.4679 11.0099 12.7405 10.9895 13.012C10.9895 14.081 10.9795 14.944 10.9795 15.206C10.9795 15.42 11.1235 15.669 11.5295 15.591C13.3328 14.9911 14.8636 13.7689 15.8479 12.1432C16.8321 10.5175 17.2054 8.59447 16.901 6.71858C16.5966 4.84268 15.6343 3.13642 14.1865 1.90536C12.7387 0.674306 10.9 -0.0011359 8.99953 1.43397e-06Z" fill="white" fill-rule="evenodd">
</path>
</svg>
</a>
</div>
</div>
</div>
<input class="radiotab w-0 h-0" data-lang="go" id="Go_cmds_generic-stepdel" name="cmds_generic-stepdel" tabindex="1" type="radio"/>
<label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="Go_cmds_generic-stepdel" title="Open example">
Go
</label>
<div aria-labelledby="tab-cmds_generic-stepdel" class="panel order-last hidden w-full mt-0 relative" id="panel_Go_cmds_generic-stepdel" role="tabpanel" tabindex="0">
<div class="highlight">
<pre class="chroma"><code class="language-go" data-lang="go"><span class="line"><span class="cl"><span class="kn">package</span> <span class="nx">example_commands_test</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="p">(</span>
</span></span><span class="line"><span class="cl"> <span class="s">"context"</span>
</span></span><span class="line"><span class="cl"> <span class="s">"fmt"</span>
</span></span><span class="line"><span class="cl"> <span class="s">"math"</span>
</span></span><span class="line"><span class="cl"> <span class="s">"time"</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="s">"github.com/redis/go-redis/v9"</span>
</span></span><span class="line"><span class="cl"><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="kd">func</span> <span class="nf">ExampleClient_del_cmd</span><span class="p">()</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nx">ctx</span> <span class="o">:=</span> <span class="nx">context</span><span class="p">.</span><span class="nf">Background</span><span class="p">()</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="nx">rdb</span> <span class="o">:=</span> <span class="nx">redis</span><span class="p">.</span><span class="nf">NewClient</span><span class="p">(</span><span class="o">&</span><span class="nx">redis</span><span class="p">.</span><span class="nx">Options</span><span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nx">Addr</span><span class="p">:</span> <span class="s">"localhost:6379"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nx">Password</span><span class="p">:</span> <span class="s">""</span><span class="p">,</span> <span class="c1">// no password docs
</span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="nx">DB</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="c1">// use default DB
</span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="p">})</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line hl"><span class="cl"> <span class="nx">delResult1</span><span class="p">,</span> <span class="nx">err</span> <span class="o">:=</span> <span class="nx">rdb</span><span class="p">.</span><span class="nf">Set</span><span class="p">(</span><span class="nx">ctx</span><span class="p">,</span> <span class="s">"key1"</span><span class="p">,</span> <span class="s">"Hello"</span><span class="p">,</span> <span class="mi">0</span><span class="p">).</span><span class="nf">Result</span><span class="p">()</span>
</span></span><span class="line hl"><span class="cl">
</span></span><span class="line hl"><span class="cl"> <span class="k">if</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span>
</span></span><span class="line hl"><span class="cl"> <span class="nb">panic</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span>
</span></span><span class="line hl"><span class="cl"> <span class="p">}</span>
</span></span><span class="line hl"><span class="cl">
</span></span><span class="line hl"><span class="cl"> <span class="nx">fmt</span><span class="p">.</span><span class="nf">Println</span><span class="p">(</span><span class="nx">delResult1</span><span class="p">)</span> <span class="c1">// >>> OK
</span></span></span><span class="line hl"><span class="cl"><span class="c1"></span>
</span></span><span class="line hl"><span class="cl"> <span class="nx">delResult2</span><span class="p">,</span> <span class="nx">err</span> <span class="o">:=</span> <span class="nx">rdb</span><span class="p">.</span><span class="nf">Set</span><span class="p">(</span><span class="nx">ctx</span><span class="p">,</span> <span class="s">"key2"</span><span class="p">,</span> <span class="s">"World"</span><span class="p">,</span> <span class="mi">0</span><span class="p">).</span><span class="nf">Result</span><span class="p">()</span>
</span></span><span class="line hl"><span class="cl">
</span></span><span class="line hl"><span class="cl"> <span class="k">if</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span>
</span></span><span class="line hl"><span class="cl"> <span class="nb">panic</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span>
</span></span><span class="line hl"><span class="cl"> <span class="p">}</span>
</span></span><span class="line hl"><span class="cl">
</span></span><span class="line hl"><span class="cl"> <span class="nx">fmt</span><span class="p">.</span><span class="nf">Println</span><span class="p">(</span><span class="nx">delResult2</span><span class="p">)</span> <span class="c1">// >>> OK
</span></span></span><span class="line hl"><span class="cl"><span class="c1"></span>
</span></span><span class="line hl"><span class="cl"> <span class="nx">delResult3</span><span class="p">,</span> <span class="nx">err</span> <span class="o">:=</span> <span class="nx">rdb</span><span class="p">.</span><span class="nf">Del</span><span class="p">(</span><span class="nx">ctx</span><span class="p">,</span> <span class="s">"key1"</span><span class="p">,</span> <span class="s">"key2"</span><span class="p">,</span> <span class="s">"key3"</span><span class="p">).</span><span class="nf">Result</span><span class="p">()</span>
</span></span><span class="line hl"><span class="cl">
</span></span><span class="line hl"><span class="cl"> <span class="k">if</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span>
</span></span><span class="line hl"><span class="cl"> <span class="nb">panic</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span>
</span></span><span class="line hl"><span class="cl"> <span class="p">}</span>
</span></span><span class="line hl"><span class="cl">
</span></span><span class="line hl"><span class="cl"> <span class="nx">fmt</span><span class="p">.</span><span class="nf">Println</span><span class="p">(</span><span class="nx">delResult3</span><span class="p">)</span> <span class="c1">// >>> 2
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="kd">func</span> <span class="nf">ExampleClient_expire_cmd</span><span class="p">()</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nx">ctx</span> <span class="o">:=</span> <span class="nx">context</span><span class="p">.</span><span class="nf">Background</span><span class="p">()</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="nx">rdb</span> <span class="o">:=</span> <span class="nx">redis</span><span class="p">.</span><span class="nf">NewClient</span><span class="p">(</span><span class="o">&</span><span class="nx">redis</span><span class="p">.</span><span class="nx">Options</span><span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nx">Addr</span><span class="p">:</span> <span class="s">"localhost:6379"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nx">Password</span><span class="p">:</span> <span class="s">""</span><span class="p">,</span> <span class="c1">// no password docs
</span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="nx">DB</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="c1">// use default DB
</span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="p">})</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="nx">expireResult1</span><span class="p">,</span> <span class="nx">err</span> <span class="o">:=</span> <span class="nx">rdb</span><span class="p">.</span><span class="nf">Set</span><span class="p">(</span><span class="nx">ctx</span><span class="p">,</span> <span class="s">"mykey"</span><span class="p">,</span> <span class="s">"Hello"</span><span class="p">,</span> <span class="mi">0</span><span class="p">).</span><span class="nf">Result</span><span class="p">()</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="k">if</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nb">panic</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"> <span class="p">}</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="nx">fmt</span><span class="p">.</span><span class="nf">Println</span><span class="p">(</span><span class="nx">expireResult1</span><span class="p">)</span> <span class="c1">// >>> OK
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl"> <span class="nx">expireResult2</span><span class="p">,</span> <span class="nx">err</span> <span class="o">:=</span> <span class="nx">rdb</span><span class="p">.</span><span class="nf">Expire</span><span class="p">(</span><span class="nx">ctx</span><span class="p">,</span> <span class="s">"mykey"</span><span class="p">,</span> <span class="mi">10</span><span class="o">*</span><span class="nx">time</span><span class="p">.</span><span class="nx">Second</span><span class="p">).</span><span class="nf">Result</span><span class="p">()</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="k">if</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nb">panic</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"> <span class="p">}</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="nx">fmt</span><span class="p">.</span><span class="nf">Println</span><span class="p">(</span><span class="nx">expireResult2</span><span class="p">)</span> <span class="c1">// >>> true
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl"> <span class="nx">expireResult3</span><span class="p">,</span> <span class="nx">err</span> <span class="o">:=</span> <span class="nx">rdb</span><span class="p">.</span><span class="nf">TTL</span><span class="p">(</span><span class="nx">ctx</span><span class="p">,</span> <span class="s">"mykey"</span><span class="p">).</span><span class="nf">Result</span><span class="p">()</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="k">if</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nb">panic</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"> <span class="p">}</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="nx">fmt</span><span class="p">.</span><span class="nf">Println</span><span class="p">(</span><span class="nx">math</span><span class="p">.</span><span class="nf">Round</span><span class="p">(</span><span class="nx">expireResult3</span><span class="p">.</span><span class="nf">Seconds</span><span class="p">()))</span> <span class="c1">// >>> 10
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl"> <span class="nx">expireResult4</span><span class="p">,</span> <span class="nx">err</span> <span class="o">:=</span> <span class="nx">rdb</span><span class="p">.</span><span class="nf">Set</span><span class="p">(</span><span class="nx">ctx</span><span class="p">,</span> <span class="s">"mykey"</span><span class="p">,</span> <span class="s">"Hello World"</span><span class="p">,</span> <span class="mi">0</span><span class="p">).</span><span class="nf">Result</span><span class="p">()</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="k">if</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nb">panic</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"> <span class="p">}</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="nx">fmt</span><span class="p">.</span><span class="nf">Println</span><span class="p">(</span><span class="nx">expireResult4</span><span class="p">)</span> <span class="c1">// >>> OK
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl"> <span class="nx">expireResult5</span><span class="p">,</span> <span class="nx">err</span> <span class="o">:=</span> <span class="nx">rdb</span><span class="p">.</span><span class="nf">TTL</span><span class="p">(</span><span class="nx">ctx</span><span class="p">,</span> <span class="s">"mykey"</span><span class="p">).</span><span class="nf">Result</span><span class="p">()</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="k">if</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nb">panic</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"> <span class="p">}</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="nx">fmt</span><span class="p">.</span><span class="nf">Println</span><span class="p">(</span><span class="nx">expireResult5</span><span class="p">)</span> <span class="c1">// >>> -1ns
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl"> <span class="nx">expireResult6</span><span class="p">,</span> <span class="nx">err</span> <span class="o">:=</span> <span class="nx">rdb</span><span class="p">.</span><span class="nf">ExpireXX</span><span class="p">(</span><span class="nx">ctx</span><span class="p">,</span> <span class="s">"mykey"</span><span class="p">,</span> <span class="mi">10</span><span class="o">*</span><span class="nx">time</span><span class="p">.</span><span class="nx">Second</span><span class="p">).</span><span class="nf">Result</span><span class="p">()</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="k">if</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nb">panic</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"> <span class="p">}</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="nx">fmt</span><span class="p">.</span><span class="nf">Println</span><span class="p">(</span><span class="nx">expireResult6</span><span class="p">)</span> <span class="c1">// >>> false
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl"> <span class="nx">expireResult7</span><span class="p">,</span> <span class="nx">err</span> <span class="o">:=</span> <span class="nx">rdb</span><span class="p">.</span><span class="nf">TTL</span><span class="p">(</span><span class="nx">ctx</span><span class="p">,</span> <span class="s">"mykey"</span><span class="p">).</span><span class="nf">Result</span><span class="p">()</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="k">if</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nb">panic</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"> <span class="p">}</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="nx">fmt</span><span class="p">.</span><span class="nf">Println</span><span class="p">(</span><span class="nx">expireResult7</span><span class="p">)</span> <span class="c1">// >>> -1ns
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl"> <span class="nx">expireResult8</span><span class="p">,</span> <span class="nx">err</span> <span class="o">:=</span> <span class="nx">rdb</span><span class="p">.</span><span class="nf">ExpireNX</span><span class="p">(</span><span class="nx">ctx</span><span class="p">,</span> <span class="s">"mykey"</span><span class="p">,</span> <span class="mi">10</span><span class="o">*</span><span class="nx">time</span><span class="p">.</span><span class="nx">Second</span><span class="p">).</span><span class="nf">Result</span><span class="p">()</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="k">if</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nb">panic</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"> <span class="p">}</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="nx">fmt</span><span class="p">.</span><span class="nf">Println</span><span class="p">(</span><span class="nx">expireResult8</span><span class="p">)</span> <span class="c1">// >>> true
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl"> <span class="nx">expireResult9</span><span class="p">,</span> <span class="nx">err</span> <span class="o">:=</span> <span class="nx">rdb</span><span class="p">.</span><span class="nf">TTL</span><span class="p">(</span><span class="nx">ctx</span><span class="p">,</span> <span class="s">"mykey"</span><span class="p">).</span><span class="nf">Result</span><span class="p">()</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="k">if</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nb">panic</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"> <span class="p">}</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="nx">fmt</span><span class="p">.</span><span class="nf">Println</span><span class="p">(</span><span class="nx">math</span><span class="p">.</span><span class="nf">Round</span><span class="p">(</span><span class="nx">expireResult9</span><span class="p">.</span><span class="nf">Seconds</span><span class="p">()))</span> <span class="c1">// >>> 10
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="kd">func</span> <span class="nf">ExampleClient_ttl_cmd</span><span class="p">()</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nx">ctx</span> <span class="o">:=</span> <span class="nx">context</span><span class="p">.</span><span class="nf">Background</span><span class="p">()</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="nx">rdb</span> <span class="o">:=</span> <span class="nx">redis</span><span class="p">.</span><span class="nf">NewClient</span><span class="p">(</span><span class="o">&</span><span class="nx">redis</span><span class="p">.</span><span class="nx">Options</span><span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nx">Addr</span><span class="p">:</span> <span class="s">"localhost:6379"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nx">Password</span><span class="p">:</span> <span class="s">""</span><span class="p">,</span> <span class="c1">// no password docs
</span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="nx">DB</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="c1">// use default DB
</span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="p">})</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="nx">ttlResult1</span><span class="p">,</span> <span class="nx">err</span> <span class="o">:=</span> <span class="nx">rdb</span><span class="p">.</span><span class="nf">Set</span><span class="p">(</span><span class="nx">ctx</span><span class="p">,</span> <span class="s">"mykey"</span><span class="p">,</span> <span class="s">"Hello"</span><span class="p">,</span> <span class="mi">10</span><span class="o">*</span><span class="nx">time</span><span class="p">.</span><span class="nx">Second</span><span class="p">).</span><span class="nf">Result</span><span class="p">()</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="k">if</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nb">panic</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"> <span class="p">}</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="nx">fmt</span><span class="p">.</span><span class="nf">Println</span><span class="p">(</span><span class="nx">ttlResult1</span><span class="p">)</span> <span class="c1">// >>> OK
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl"> <span class="nx">ttlResult2</span><span class="p">,</span> <span class="nx">err</span> <span class="o">:=</span> <span class="nx">rdb</span><span class="p">.</span><span class="nf">TTL</span><span class="p">(</span><span class="nx">ctx</span><span class="p">,</span> <span class="s">"mykey"</span><span class="p">).</span><span class="nf">Result</span><span class="p">()</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="k">if</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nb">panic</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"> <span class="p">}</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="nx">fmt</span><span class="p">.</span><span class="nf">Println</span><span class="p">(</span><span class="nx">math</span><span class="p">.</span><span class="nf">Round</span><span class="p">(</span><span class="nx">ttlResult2</span><span class="p">.</span><span class="nf">Seconds</span><span class="p">()))</span> <span class="c1">// >>> 10
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span></code></pre>
</div>
<button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_Go_cmds_generic-stepdel')" tabindex="1" title="Copy to clipboard">
<svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">
<path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z">
</path>
</svg>
<div class="tooltip relative inline-block">
<span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4">
Copied!
</span>
</div>
</button>
<button aria-controls="panel_Go_cmds_generic-stepdel" class="visibility-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-2 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="toggleVisibleLines(this)" tabindex="1" title="Toggle visibility">
<svg class="hidden" fill="currentColor" id="visibility-off" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">
<path d="m31.45 27.05-2.2-2.2q1.3-3.55-1.35-5.9-2.65-2.35-5.75-1.2l-2.2-2.2q.85-.55 1.9-.8 1.05-.25 2.15-.25 3.55 0 6.025 2.475Q32.5 19.45 32.5 23q0 1.1-.275 2.175-.275 1.075-.775 1.875Zm6.45 6.45-2-2q2.45-1.8 4.275-4.025Q42 25.25 42.85 23q-2.5-5.55-7.5-8.775Q30.35 11 24.5 11q-2.1 0-4.3.4-2.2.4-3.45.95L14.45 10q1.75-.8 4.475-1.4Q21.65 8 24.25 8q7.15 0 13.075 4.075Q43.25 16.15 46 23q-1.3 3.2-3.35 5.85-2.05 2.65-4.75 4.65Zm2.9 11.3-8.4-8.25q-1.75.7-3.95 1.075T24 38q-7.3 0-13.25-4.075T2 23q1-2.6 2.775-5.075T9.1 13.2L2.8 6.9l2.1-2.15L42.75 42.6ZM11.15 15.3q-1.85 1.35-3.575 3.55Q5.85 21.05 5.1 23q2.55 5.55 7.675 8.775Q17.9 35 24.4 35q1.65 0 3.25-.2t2.4-.6l-3.2-3.2q-.55.25-1.35.375T24 31.5q-3.5 0-6-2.45T15.5 23q0-.75.125-1.5T16 20.15Zm15.25 7.1Zm-5.8 2.9Z">
</path>
</svg>
<svg fill="currentColor" id="visibility-on" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">
<path d="M24 31.5q3.55 0 6.025-2.475Q32.5 26.55 32.5 23q0-3.55-2.475-6.025Q27.55 14.5 24 14.5q-3.55 0-6.025 2.475Q15.5 19.45 15.5 23q0 3.55 2.475 6.025Q20.45 31.5 24 31.5Zm0-2.9q-2.35 0-3.975-1.625T18.4 23q0-2.35 1.625-3.975T24 17.4q2.35 0 3.975 1.625T29.6 23q0 2.35-1.625 3.975T24 28.6Zm0 9.4q-7.3 0-13.2-4.15Q4.9 29.7 2 23q2.9-6.7 8.8-10.85Q16.7 8 24 8q7.3 0 13.2 4.15Q43.1 16.3 46 23q-2.9 6.7-8.8 10.85Q31.3 38 24 38Zm0-15Zm0 12q6.05 0 11.125-3.275T42.85 23q-2.65-5.45-7.725-8.725Q30.05 11 24 11t-11.125 3.275Q7.8 17.55 5.1 23q2.7 5.45 7.775 8.725Q17.95 35 24 35Z">
</path>
</svg>
</button>
<div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible">
<a class="rounded rounded-mx px-3 py-1 text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.io/docs/latest/develop/connect/clients/go/" tabindex="1" title="Quick-Start">
Go Quick-Start
</a>
<div class="w-1/2">
</div>
<div class="flex-1 text-right">
<a class="button text-neutral-400 hover:text-slate-100 h-6 w-6 p-1" href="https://github.com/redis/go-redis/tree/master/doctests/cmds_generic_test.go" tabindex="1" title="Improve this code example">
<svg fill="github" height="16" viewbox="0 0 18 16" width="18" xmlns="http://www.w3.org/2000/svg">
<path clip-rule="evenodd" d="M8.99953 1.43397e-06C7.09918 -0.000897921 5.26058 0.674713 3.81295 1.90585C2.36533 3.13699 1.40324 4.84324 1.09896 6.71907C0.794684 8.5949 1.1681 10.5178 2.15233 12.1434C3.13657 13.769 4.66734 14.9912 6.47053 15.591C6.87053 15.664 7.01653 15.417 7.01653 15.205C7.01653 15.015 7.00953 14.512 7.00553 13.845C4.78053 14.328 4.31053 12.772 4.31053 12.772C4.16325 12.2887 3.84837 11.8739 3.42253 11.602C2.69653 11.102 3.47753 11.116 3.47753 11.116C3.73043 11.1515 3.97191 11.2442 4.18365 11.3869C4.39539 11.5297 4.57182 11.7189 4.69953 11.94C4.80755 12.1377 4.95378 12.3119 5.12972 12.4526C5.30567 12.5933 5.50782 12.6976 5.72442 12.7595C5.94103 12.8214 6.16778 12.8396 6.39148 12.813C6.61519 12.7865 6.83139 12.7158 7.02753 12.605C7.06381 12.1992 7.24399 11.8197 7.53553 11.535C5.75953 11.335 3.89153 10.647 3.89153 7.581C3.88005 6.78603 4.17513 6.01716 4.71553 5.434C4.47318 4.74369 4.50322 3.98693 4.79953 3.318C4.79953 3.318 5.47053 3.103 6.99953 4.138C8.31074 3.77905 9.69432 3.77905 11.0055 4.138C12.5325 3.103 13.2055 3.318 13.2055 3.318C13.5012 3.9877 13.5294 4.74513 13.2845 5.435C13.8221 6.01928 14.114 6.78817 14.0995 7.582C14.0995 10.655 12.2285 11.332 10.4465 11.53C10.6375 11.724 10.7847 11.9566 10.8784 12.2123C10.972 12.4679 11.0099 12.7405 10.9895 13.012C10.9895 14.081 10.9795 14.944 10.9795 15.206C10.9795 15.42 11.1235 15.669 11.5295 15.591C13.3328 14.9911 14.8636 13.7689 15.8479 12.1432C16.8321 10.5175 17.2054 8.59447 16.901 6.71858C16.5966 4.84268 15.6343 3.13642 14.1865 1.90536C12.7387 0.674306 10.9 -0.0011359 8.99953 1.43397e-06Z" fill="white" fill-rule="evenodd">
</path>
</svg>
</a>
</div>
</div>
</div>
<input class="radiotab w-0 h-0" data-lang="dotnet" id="Csharp_cmds_generic-stepdel" name="cmds_generic-stepdel" tabindex="1" type="radio"/>
<label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900 hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out" for="Csharp_cmds_generic-stepdel" title="Open example">
C#
</label>
<div aria-labelledby="tab-cmds_generic-stepdel" class="panel order-last hidden w-full mt-0 relative" id="panel_Csharp_cmds_generic-stepdel" role="tabpanel" tabindex="0">
<div class="highlight">
<pre class="chroma"><code class="language-C#" data-lang="C#"><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="k">using</span> <span class="nn">NRedisStack.Tests</span><span class="p">;</span>
</span></span><span class="line"><span class="cl"><span class="k">using</span> <span class="nn">StackExchange.Redis</span><span class="p">;</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="k">public</span> <span class="k">class</span> <span class="nc">CmdsGenericExample</span>
</span></span><span class="line"><span class="cl"><span class="p">{</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="k">public</span> <span class="k">void</span> <span class="n">run</span><span class="p">()</span>
</span></span><span class="line"><span class="cl"> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="kt">var</span> <span class="n">muxer</span> <span class="p">=</span> <span class="n">ConnectionMultiplexer</span><span class="p">.</span><span class="n">Connect</span><span class="p">(</span><span class="s">"localhost:6379"</span><span class="p">);</span>
</span></span><span class="line"><span class="cl"> <span class="kt">var</span> <span class="n">db</span> <span class="p">=</span> <span class="n">muxer</span><span class="p">.</span><span class="n">GetDatabase</span><span class="p">();</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'copy' step.</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line hl"><span class="cl"> <span class="kt">bool</span> <span class="n">delResult1</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">StringSet</span><span class="p">(</span><span class="s">"key1"</span><span class="p">,</span> <span class="s">"Hello"</span><span class="p">);</span>
</span></span><span class="line hl"><span class="cl"> <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="n">delResult1</span><span class="p">);</span> <span class="c1">// >>> true</span>
</span></span><span class="line hl"><span class="cl">
</span></span><span class="line hl"><span class="cl"> <span class="kt">bool</span> <span class="n">delResult2</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">StringSet</span><span class="p">(</span><span class="s">"key2"</span><span class="p">,</span> <span class="s">"World"</span><span class="p">);</span>
</span></span><span class="line hl"><span class="cl"> <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="n">delResult2</span><span class="p">);</span> <span class="c1">// >>> true</span>
</span></span><span class="line hl"><span class="cl">
</span></span><span class="line hl"><span class="cl"> <span class="kt">long</span> <span class="n">delResult3</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">KeyDelete</span><span class="p">(</span><span class="k">new</span> <span class="n">RedisKey</span><span class="p">[]</span> <span class="p">{</span> <span class="s">"key1"</span><span class="p">,</span> <span class="s">"key2"</span><span class="p">,</span> <span class="s">"key3"</span> <span class="p">});</span>
</span></span><span class="line hl"><span class="cl"> <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="n">delResult3</span><span class="p">);</span> <span class="c1">// >>> 2</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'del' step.</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'dump' step.</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'exists' step.</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="kt">bool</span> <span class="n">expireResult1</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">StringSet</span><span class="p">(</span><span class="s">"mykey"</span><span class="p">,</span> <span class="s">"Hello"</span><span class="p">);</span>
</span></span><span class="line"><span class="cl"> <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="n">expireResult1</span><span class="p">);</span> <span class="c1">// >>> true</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="kt">bool</span> <span class="n">expireResult2</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">KeyExpire</span><span class="p">(</span><span class="s">"mykey"</span><span class="p">,</span> <span class="k">new</span> <span class="n">TimeSpan</span><span class="p">(</span><span class="m">0</span><span class="p">,</span> <span class="m">0</span><span class="p">,</span> <span class="m">10</span><span class="p">));</span>
</span></span><span class="line"><span class="cl"> <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="n">expireResult2</span><span class="p">);</span> <span class="c1">// >>> true</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="n">TimeSpan</span> <span class="n">expireResult3</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">KeyTimeToLive</span><span class="p">(</span><span class="s">"mykey"</span><span class="p">)</span> <span class="p">??</span> <span class="n">TimeSpan</span><span class="p">.</span><span class="n">Zero</span><span class="p">;</span>
</span></span><span class="line"><span class="cl"> <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="n">Math</span><span class="p">.</span><span class="n">Round</span><span class="p">(</span><span class="n">expireResult3</span><span class="p">.</span><span class="n">TotalSeconds</span><span class="p">));</span> <span class="c1">// >>> 10</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="kt">bool</span> <span class="n">expireResult4</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">StringSet</span><span class="p">(</span><span class="s">"mykey"</span><span class="p">,</span> <span class="s">"Hello World"</span><span class="p">);</span>
</span></span><span class="line"><span class="cl"> <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="n">expireResult4</span><span class="p">);</span> <span class="c1">// >>> true</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="n">TimeSpan</span> <span class="n">expireResult5</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">KeyTimeToLive</span><span class="p">(</span><span class="s">"mykey"</span><span class="p">)</span> <span class="p">??</span> <span class="n">TimeSpan</span><span class="p">.</span><span class="n">Zero</span><span class="p">;</span>
</span></span><span class="line"><span class="cl"> <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="n">Math</span><span class="p">.</span><span class="n">Round</span><span class="p">(</span><span class="n">expireResult5</span><span class="p">.</span><span class="n">TotalSeconds</span><span class="p">).</span><span class="n">ToString</span><span class="p">());</span> <span class="c1">// >>> 0</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="kt">bool</span> <span class="n">expireResult6</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">KeyExpire</span><span class="p">(</span><span class="s">"mykey"</span><span class="p">,</span> <span class="k">new</span> <span class="n">TimeSpan</span><span class="p">(</span><span class="m">0</span><span class="p">,</span> <span class="m">0</span><span class="p">,</span> <span class="m">10</span><span class="p">),</span> <span class="n">ExpireWhen</span><span class="p">.</span><span class="n">HasExpiry</span><span class="p">);</span>
</span></span><span class="line"><span class="cl"> <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="n">expireResult6</span><span class="p">);</span> <span class="c1">// >>> false</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="n">TimeSpan</span> <span class="n">expireResult7</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">KeyTimeToLive</span><span class="p">(</span><span class="s">"mykey"</span><span class="p">)</span> <span class="p">??</span> <span class="n">TimeSpan</span><span class="p">.</span><span class="n">Zero</span><span class="p">;</span>
</span></span><span class="line"><span class="cl"> <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="n">Math</span><span class="p">.</span><span class="n">Round</span><span class="p">(</span><span class="n">expireResult7</span><span class="p">.</span><span class="n">TotalSeconds</span><span class="p">));</span> <span class="c1">// >>> 0</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="kt">bool</span> <span class="n">expireResult8</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">KeyExpire</span><span class="p">(</span><span class="s">"mykey"</span><span class="p">,</span> <span class="k">new</span> <span class="n">TimeSpan</span><span class="p">(</span><span class="m">0</span><span class="p">,</span> <span class="m">0</span><span class="p">,</span> <span class="m">10</span><span class="p">),</span> <span class="n">ExpireWhen</span><span class="p">.</span><span class="n">HasNoExpiry</span><span class="p">);</span>
</span></span><span class="line"><span class="cl"> <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="n">expireResult8</span><span class="p">);</span> <span class="c1">// >>> true</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="n">TimeSpan</span> <span class="n">expireResult9</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">KeyTimeToLive</span><span class="p">(</span><span class="s">"mykey"</span><span class="p">)</span> <span class="p">??</span> <span class="n">TimeSpan</span><span class="p">.</span><span class="n">Zero</span><span class="p">;</span>
</span></span><span class="line"><span class="cl"> <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="n">Math</span><span class="p">.</span><span class="n">Round</span><span class="p">(</span><span class="n">expireResult9</span><span class="p">.</span><span class="n">TotalSeconds</span><span class="p">));</span> <span class="c1">// >>> 10</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'expire' step.</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'expireat' step.</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'expiretime' step.</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'keys' step.</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'migrate' step.</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'move' step.</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'object_encoding' step.</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'object_freq' step.</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'object_idletime' step.</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'object_refcount' step.</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'persist' step.</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'pexpire' step.</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'pexpireat' step.</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'pexpiretime' step.</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'pttl' step.</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'randomkey' step.</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'rename' step.</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'renamenx' step.</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'restore' step.</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'scan1' step.</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'scan2' step.</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'scan3' step.</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'scan4' step.</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'sort' step.</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'sort_ro' step.</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'touch' step.</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="kt">bool</span> <span class="n">ttlResult1</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">StringSet</span><span class="p">(</span><span class="s">"mykey"</span><span class="p">,</span> <span class="s">"Hello"</span><span class="p">);</span>
</span></span><span class="line"><span class="cl"> <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="n">ttlResult1</span><span class="p">);</span> <span class="c1">// >>> true</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="kt">bool</span> <span class="n">ttlResult2</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">KeyExpire</span><span class="p">(</span><span class="s">"mykey"</span><span class="p">,</span> <span class="k">new</span> <span class="n">TimeSpan</span><span class="p">(</span><span class="m">0</span><span class="p">,</span> <span class="m">0</span><span class="p">,</span> <span class="m">10</span><span class="p">));</span>
</span></span><span class="line"><span class="cl"> <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="n">ttlResult2</span><span class="p">);</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="n">TimeSpan</span> <span class="n">ttlResult3</span> <span class="p">=</span> <span class="n">db</span><span class="p">.</span><span class="n">KeyTimeToLive</span><span class="p">(</span><span class="s">"mykey"</span><span class="p">)</span> <span class="p">??</span> <span class="n">TimeSpan</span><span class="p">.</span><span class="n">Zero</span><span class="p">;</span>
</span></span><span class="line"><span class="cl"> <span class="kt">string</span> <span class="n">ttlRes</span> <span class="p">=</span> <span class="n">Math</span><span class="p">.</span><span class="n">Round</span><span class="p">(</span><span class="n">ttlResult3</span><span class="p">.</span><span class="n">TotalSeconds</span><span class="p">).</span><span class="n">ToString</span><span class="p">();</span>
</span></span><span class="line"><span class="cl"> <span class="n">Console</span><span class="p">.</span><span class="n">WriteLine</span><span class="p">(</span><span class="n">Math</span><span class="p">.</span><span class="n">Round</span><span class="p">(</span><span class="n">ttlResult3</span><span class="p">.</span><span class="n">TotalSeconds</span><span class="p">));</span> <span class="c1">// >>> 10</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'ttl' step.</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'type' step.</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'unlink' step.</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'wait' step.</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="c1">// Tests for 'waitaof' step.</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="p">}</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span><span class="line"><span class="cl">
</span></span></code></pre>
</div>
<button class="clipboard-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-10 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="copyCodeToClipboard('#panel_Csharp_cmds_generic-stepdel')" tabindex="1" title="Copy to clipboard">
<svg fill="currentColor" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">
<path d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z">
</path>
</svg>
<div class="tooltip relative inline-block">
<span class="tooltiptext hidden bg-slate-200 rounded rounded-mx text-slate-800 text-center text-xs p-1 absolute right-6 bottom-4">
Copied!
</span>
</div>
</button>
<button aria-controls="panel_Csharp_cmds_generic-stepdel" class="visibility-button text-neutral-400 hover:text-slate-100 bg-slate-600 absolute -top-8 right-2 h-7 w-7 mr-2 mt-2 p-1 rounded rounded-mx" onclick="toggleVisibleLines(this)" tabindex="1" title="Toggle visibility">
<svg class="hidden" fill="currentColor" id="visibility-off" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">
<path d="m31.45 27.05-2.2-2.2q1.3-3.55-1.35-5.9-2.65-2.35-5.75-1.2l-2.2-2.2q.85-.55 1.9-.8 1.05-.25 2.15-.25 3.55 0 6.025 2.475Q32.5 19.45 32.5 23q0 1.1-.275 2.175-.275 1.075-.775 1.875Zm6.45 6.45-2-2q2.45-1.8 4.275-4.025Q42 25.25 42.85 23q-2.5-5.55-7.5-8.775Q30.35 11 24.5 11q-2.1 0-4.3.4-2.2.4-3.45.95L14.45 10q1.75-.8 4.475-1.4Q21.65 8 24.25 8q7.15 0 13.075 4.075Q43.25 16.15 46 23q-1.3 3.2-3.35 5.85-2.05 2.65-4.75 4.65Zm2.9 11.3-8.4-8.25q-1.75.7-3.95 1.075T24 38q-7.3 0-13.25-4.075T2 23q1-2.6 2.775-5.075T9.1 13.2L2.8 6.9l2.1-2.15L42.75 42.6ZM11.15 15.3q-1.85 1.35-3.575 3.55Q5.85 21.05 5.1 23q2.55 5.55 7.675 8.775Q17.9 35 24.4 35q1.65 0 3.25-.2t2.4-.6l-3.2-3.2q-.55.25-1.35.375T24 31.5q-3.5 0-6-2.45T15.5 23q0-.75.125-1.5T16 20.15Zm15.25 7.1Zm-5.8 2.9Z">
</path>
</svg>
<svg fill="currentColor" id="visibility-on" viewbox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">
<path d="M24 31.5q3.55 0 6.025-2.475Q32.5 26.55 32.5 23q0-3.55-2.475-6.025Q27.55 14.5 24 14.5q-3.55 0-6.025 2.475Q15.5 19.45 15.5 23q0 3.55 2.475 6.025Q20.45 31.5 24 31.5Zm0-2.9q-2.35 0-3.975-1.625T18.4 23q0-2.35 1.625-3.975T24 17.4q2.35 0 3.975 1.625T29.6 23q0 2.35-1.625 3.975T24 28.6Zm0 9.4q-7.3 0-13.2-4.15Q4.9 29.7 2 23q2.9-6.7 8.8-10.85Q16.7 8 24 8q7.3 0 13.2 4.15Q43.1 16.3 46 23q-2.9 6.7-8.8 10.85Q31.3 38 24 38Zm0-15Zm0 12q6.05 0 11.125-3.275T42.85 23q-2.65-5.45-7.725-8.725Q30.05 11 24 11t-11.125 3.275Q7.8 17.55 5.1 23q2.7 5.45 7.775 8.725Q17.95 35 24 35Z">
</path>
</svg>
</button>
<div class="cli-footer flex items-center justify-between rounded-b-md bg-slate-900 mt-0 px-4 pt-0 mb-0 transition-opacity ease-in-out duration-300 opacity-0 invisible group-hover:opacity-100 group-hover:visible">
<a class="rounded rounded-mx px-3 py-1 text-white text-xs hover:text-white hover:bg-slate-600 hover:border-transparent focus:outline-none focus:ring-2 focus:white focus:border-slate-500" href="https://redis.io/docs/latest/develop/connect/clients/dotnet/" tabindex="1" title="Quick-Start">
C# Quick-Start
</a>
<div class="w-1/2">
</div>
<div class="flex-1 text-right">
<a class="button text-neutral-400 hover:text-slate-100 h-6 w-6 p-1" href="https://github.com/redis/NRedisStack/tree/master/tests/Doc/CmdsGenericExample.cs" tabindex="1" title="Improve this code example">
<svg fill="github" height="16" viewbox="0 0 18 16" width="18" xmlns="http://www.w3.org/2000/svg">
<path clip-rule="evenodd" d="M8.99953 1.43397e-06C7.09918 -0.000897921 5.26058 0.674713 3.81295 1.90585C2.36533 3.13699 1.40324 4.84324 1.09896 6.71907C0.794684 8.5949 1.1681 10.5178 2.15233 12.1434C3.13657 13.769 4.66734 14.9912 6.47053 15.591C6.87053 15.664 7.01653 15.417 7.01653 15.205C7.01653 15.015 7.00953 14.512 7.00553 13.845C4.78053 14.328 4.31053 12.772 4.31053 12.772C4.16325 12.2887 3.84837 11.8739 3.42253 11.602C2.69653 11.102 3.47753 11.116 3.47753 11.116C3.73043 11.1515 3.97191 11.2442 4.18365 11.3869C4.39539 11.5297 4.57182 11.7189 4.69953 11.94C4.80755 12.1377 4.95378 12.3119 5.12972 12.4526C5.30567 12.5933 5.50782 12.6976 5.72442 12.7595C5.94103 12.8214 6.16778 12.8396 6.39148 12.813C6.61519 12.7865 6.83139 12.7158 7.02753 12.605C7.06381 12.1992 7.24399 11.8197 7.53553 11.535C5.75953 11.335 3.89153 10.647 3.89153 7.581C3.88005 6.78603 4.17513 6.01716 4.71553 5.434C4.47318 4.74369 4.50322 3.98693 4.79953 3.318C4.79953 3.318 5.47053 3.103 6.99953 4.138C8.31074 3.77905 9.69432 3.77905 11.0055 4.138C12.5325 3.103 13.2055 3.318 13.2055 3.318C13.5012 3.9877 13.5294 4.74513 13.2845 5.435C13.8221 6.01928 14.114 6.78817 14.0995 7.582C14.0995 10.655 12.2285 11.332 10.4465 11.53C10.6375 11.724 10.7847 11.9566 10.8784 12.2123C10.972 12.4679 11.0099 12.7405 10.9895 13.012C10.9895 14.081 10.9795 14.944 10.9795 15.206C10.9795 15.42 11.1235 15.669 11.5295 15.591C13.3328 14.9911 14.8636 13.7689 15.8479 12.1432C16.8321 10.5175 17.2054 8.59447 16.901 6.71858C16.5966 4.84268 15.6343 3.13642 14.1865 1.90536C12.7387 0.674306 10.9 -0.0011359 8.99953 1.43397e-06Z" fill="white" fill-rule="evenodd">
</path>
</svg>
</a>
</div>
</div>
</div>
</div>
<p>
Give these commands a try in the interactive console:
</p>
<div class="bg-slate-900 border-b border-slate-700 rounded-t-xl px-4 py-3 w-full flex">
<svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20">
<path d="M2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10Z">
</path>
</svg>
<svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20">
<path d="M10 2.5L18.6603 17.5L1.33975 17.5L10 2.5Z">
</path>
</svg>
<svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20">
<path d="M10 2.5L12.0776 7.9322L17.886 8.22949L13.3617 11.8841L14.8738 17.5L10 14.3264L5.1262 17.5L6.63834 11.8841L2.11403 8.22949L7.92238 7.9322L10 2.5Z">
</path>
</svg>
</div>
<form class="redis-cli overflow-y-auto max-h-80">
<pre tabindex="0">redis> SET key1 "Hello"
"OK"
redis> SET key2 "World"
"OK"
redis> DEL key1 key2 key3
(integer) 2
</pre>
<div class="prompt" style="">
<span>
redis>
</span>
<input autocomplete="off" name="prompt" spellcheck="false" type="text"/>
</div>
</form>
<h2 id="resp2resp3-reply">
RESP2/RESP3 Reply
</h2>
<a href="../../develop/reference/protocol-spec#integers">
Integer reply
</a>
: the number of keys that were removed.
<br/>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/del/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/commands/module-loadex/.html | <section class="prose w-full py-12">
<h1 class="command-name">
MODULE LOADEX
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">MODULE LOADEX path [CONFIGΒ name value [CONFIG name value ...]]
[ARGSΒ args [args ...]]</pre>
<dl class="grid grid-cols-[auto,1fr] gap-2 mb-12">
<dt class="font-semibold text-redis-ink-900 m-0">
Available since:
</dt>
<dd class="m-0">
7.0.0
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
Time complexity:
</dt>
<dd class="m-0">
O(1)
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
ACL categories:
</dt>
<dd class="m-0">
<code>
@admin
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@slow
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@dangerous
</code>
<span class="mr-1 last:hidden">
,
</span>
</dd>
</dl>
<p>
Loads a module from a dynamic library at runtime with configuration directives.
</p>
<p>
This is an extended version of the
<a href="/docs/latest/commands/module-load/">
<code>
MODULE LOAD
</code>
</a>
command.
</p>
<p>
It loads and initializes the Redis module from the dynamic library specified by the
<code>
path
</code>
argument. The
<code>
path
</code>
should be the absolute path of the library, including the full filename.
</p>
<p>
You can use the optional
<code>
CONFIG
</code>
argument to provide the module with configuration directives.
Any additional arguments that follow the
<code>
ARGS
</code>
keyword are passed unmodified to the module.
</p>
<p>
<strong>
Note
</strong>
: modules can also be loaded at server startup with
<code>
loadmodule
</code>
configuration directive in
<code>
redis.conf
</code>
.
</p>
<h2 id="resp2resp3-reply">
RESP2/RESP3 Reply
</h2>
<a href="../../develop/reference/protocol-spec#simple-strings">
Simple string reply
</a>
:
<code>
OK
</code>
if the module was loaded.
<br/>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/module-loadex/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/commands/sort_ro/.html | <section class="prose w-full py-12">
<h1 class="command-name">
SORT_RO
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">SORT_RO key [BYΒ pattern] [LIMITΒ offset count] [GETΒ pattern [GET
pattern ...]] [ASC | DESC] [ALPHA]</pre>
<dl class="grid grid-cols-[auto,1fr] gap-2 mb-12">
<dt class="font-semibold text-redis-ink-900 m-0">
Available since:
</dt>
<dd class="m-0">
7.0.0
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
Time complexity:
</dt>
<dd class="m-0">
O(N+M*log(M)) where N is the number of elements in the list or set to sort, and M the number of returned elements. When the elements are not sorted, complexity is O(N).
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
ACL categories:
</dt>
<dd class="m-0">
<code>
@read
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@set
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@sortedset
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@list
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@slow
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@dangerous
</code>
<span class="mr-1 last:hidden">
,
</span>
</dd>
</dl>
<p>
Read-only variant of the
<a href="/docs/latest/commands/sort/">
<code>
SORT
</code>
</a>
command. It is exactly like the original
<a href="/docs/latest/commands/sort/">
<code>
SORT
</code>
</a>
but refuses the
<code>
STORE
</code>
option and can safely be used in read-only replicas.
</p>
<p>
Since the original
<a href="/docs/latest/commands/sort/">
<code>
SORT
</code>
</a>
has a
<code>
STORE
</code>
option it is technically flagged as a writing command in the Redis command table. For this reason read-only replicas in a Redis Cluster will redirect it to the master instance even if the connection is in read-only mode (see the
<a href="/docs/latest/commands/readonly/">
<code>
READONLY
</code>
</a>
command of Redis Cluster).
</p>
<p>
The
<code>
SORT_RO
</code>
variant was introduced in order to allow
<a href="/docs/latest/commands/sort/">
<code>
SORT
</code>
</a>
behavior in read-only replicas without breaking compatibility on command flags.
</p>
<p>
See original
<a href="/docs/latest/commands/sort/">
<code>
SORT
</code>
</a>
for more details.
</p>
<h2 id="examples">
Examples
</h2>
<pre tabindex="0"><code>SORT_RO mylist BY weight_*->fieldname GET object_*->fieldname
</code></pre>
<h2 id="resp2resp3-reply">
RESP2/RESP3 Reply
</h2>
<a href="../../develop/reference/protocol-spec#arrays">
Array reply
</a>
: a list of sorted elements.
<br/>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/sort_ro/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/commands/command-getkeysandflags/.html | <section class="prose w-full py-12">
<h1 class="command-name">
COMMAND GETKEYSANDFLAGS
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">COMMAND GETKEYSANDFLAGS command [arg [arg ...]]</pre>
<dl class="grid grid-cols-[auto,1fr] gap-2 mb-12">
<dt class="font-semibold text-redis-ink-900 m-0">
Available since:
</dt>
<dd class="m-0">
7.0.0
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
Time complexity:
</dt>
<dd class="m-0">
O(N) where N is the number of arguments to the command
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
ACL categories:
</dt>
<dd class="m-0">
<code>
@slow
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@connection
</code>
<span class="mr-1 last:hidden">
,
</span>
</dd>
</dl>
<p>
Returns
<a href="/docs/latest/develop/reference/protocol-spec/#arrays">
Array reply
</a>
of keys from a full Redis command and their usage flags.
</p>
<p>
<code>
COMMAND GETKEYSANDFLAGS
</code>
is a helper command to let you find the keys from a full Redis command together with flags indicating what each key is used for.
</p>
<p>
<a href="/docs/latest/commands/command/">
<code>
COMMAND
</code>
</a>
provides information on how to find the key names of each command (see
<code>
firstkey
</code>
,
<a href="/docs/latest/develop/reference/key-specs#logical-operation-flags">
key specifications
</a>
, and
<code>
movablekeys
</code>
),
but in some cases it's not possible to find keys of certain commands and then the entire command must be parsed to discover some / all key names.
You can use
<a href="/docs/latest/commands/command-getkeys/">
<code>
COMMAND GETKEYS
</code>
</a>
or
<code>
COMMAND GETKEYSANDFLAGS
</code>
to discover key names directly from how Redis parses the commands.
</p>
<p>
Refer to
<a href="/docs/latest/develop/reference/key-specs#logical-operation-flags">
key specifications
</a>
for information about the meaning of the key flags.
</p>
<h2 id="examples">
Examples
</h2>
<div class="bg-slate-900 border-b border-slate-700 rounded-t-xl px-4 py-3 w-full flex">
<svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20">
<path d="M2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10Z">
</path>
</svg>
<svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20">
<path d="M10 2.5L18.6603 17.5L1.33975 17.5L10 2.5Z">
</path>
</svg>
<svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20">
<path d="M10 2.5L12.0776 7.9322L17.886 8.22949L13.3617 11.8841L14.8738 17.5L10 14.3264L5.1262 17.5L6.63834 11.8841L2.11403 8.22949L7.92238 7.9322L10 2.5Z">
</path>
</svg>
</div>
<form class="redis-cli overflow-y-auto max-h-80">
<pre tabindex="0">redis> COMMAND GETKEYS MSET a b c d e f
1) "a"
2) "c"
3) "e"
redis> COMMAND GETKEYS EVAL "not consulted" 3 key1 key2 key3 arg1 arg2 arg3 argN
1) "key1"
2) "key2"
3) "key3"
redis> COMMAND GETKEYSANDFLAGS LMOVE mylist1 mylist2 left left
1) 1) "mylist1"
2) 1) "RW"
2) "access"
3) "delete"
2) 1) "mylist2"
2) 1) "RW"
2) "insert"
</pre>
<div class="prompt" style="">
<span>
redis>
</span>
<input autocomplete="off" name="prompt" spellcheck="false" type="text"/>
</div>
</form>
<h2 id="resp2resp3-reply">
RESP2/RESP3 Reply
</h2>
<a href="../../develop/reference/protocol-spec#arrays">
Array reply
</a>
: a list of keys from the given command and their usage flags.
<br/>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/command-getkeysandflags/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/cluster/stats_archiver/.html | <section class="prose w-full py-12 max-w-none">
<h1>
rladmin cluster stats_archiver
</h1>
<p class="text-lg -mt-5 mb-10">
Enables/deactivates the stats archiver.
</p>
<p>
Enables or deactivates the stats archiver, which logs statistics in CSV (comma-separated values) format.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin cluster stats_archiver <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span>
</span></span></code></pre>
</div>
<h3 id="parameters">
Parameters
</h3>
<table>
<thead>
<tr>
<th>
Parameter
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
enabled
</td>
<td>
Turn on the stats archiver
</td>
</tr>
<tr>
<td>
disabled
</td>
<td>
Turn off the stats archiver
</td>
</tr>
</tbody>
</table>
<h3 id="returns">
Returns
</h3>
<p>
Returns the updated status of the stats archiver.
</p>
<h3 id="example">
Example
</h3>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ rladmin cluster stats_archiver enabled
</span></span><span class="line"><span class="cl">Status: enabled
</span></span></code></pre>
</div>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/cluster/stats_archiver/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/cluster/master/.html | <section class="prose w-full py-12 max-w-none">
<h1>
rladmin cluster master
</h1>
<p class="text-lg -mt-5 mb-10">
Identifies or changes the cluster's master node.
</p>
<p>
Identifies the cluster's master node. Use
<code>
set
</code>
to change the cluster's master to a different node.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">cluster master <span class="o">[</span> <span class="nb">set</span> <node_id> <span class="o">]</span>
</span></span></code></pre>
</div>
<h3 id="parameters">
Parameters
</h3>
<table>
<thead>
<tr>
<th>
Parameter
</th>
<th>
Type/Value
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
node_id
</td>
<td>
integer
</td>
<td>
Unique node ID
</td>
</tr>
</tbody>
</table>
<h3 id="returns">
Returns
</h3>
<p>
Returns the ID of the cluster's master node. Otherwise, it returns an error message.
</p>
<h3 id="example">
Example
</h3>
<p>
Identify the cluster's master node:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ rladmin cluster master
</span></span><span class="line"><span class="cl">Node <span class="m">1</span> is the cluster master node
</span></span></code></pre>
</div>
<p>
Change the cluster master to node 3:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ rladmin cluster master <span class="nb">set</span> <span class="m">3</span>
</span></span><span class="line"><span class="cl">Node <span class="m">3</span> <span class="nb">set</span> to be the cluster master node
</span></span></code></pre>
</div>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/cluster/master/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/develop/reference/eviction/.html | <section class="prose w-full py-12">
<h1>
Key eviction
</h1>
<p class="text-lg -mt-5 mb-10">
Overview of Redis key eviction policies (LRU, LFU, etc.)
</p>
<p>
Redis is commonly used as a cache to speed up read accesses to a slower server
or database. Since cache entries are copies of persistently-stored data, it
is usually safe to evict them when the cache runs out of memory (they can be
cached again in the future if necessary).
</p>
<p>
Redis lets you specify an eviction policy to evict keys automatically
when the size of the cache exceeds a set memory limit. Whenever a client
runs a new command that adds more data to the cache, Redis checks the memory usage.
If it is greater than the limit, Redis evicts keys according to the chosen
eviction policy until the total memory used is back below the limit.
</p>
<p>
Note that when a command adds a lot of data to the cache (for example, a big set
intersection stored into a new key), this might temporarily exceed the limit by
a large amount.
</p>
<p>
The sections below explain how to
<a href="#maxmem">
configure the memory limit
</a>
for the cache
and also describe the available
<a href="#eviction-policies">
eviction policies
</a>
and when to
use them.
</p>
<h2 id="maxmem">
Using the
<code>
maxmemory
</code>
configuration directive
</h2>
<p>
The
<code>
maxmemory
</code>
configuration directive specifies
the maximum amount of memory to use for the cache data. You can
set
<code>
maxmemory
</code>
with the
<a href="https://github.com/redis/redis/blob/7.4.0/redis.conf">
<code>
redis.conf
</code>
</a>
file at startup time. For example, to configure a memory limit of 100 megabytes,
you can use the following directive inside
<code>
redis.conf
</code>
:
</p>
<pre tabindex="0"><code>maxmemory 100mb
</code></pre>
<p>
You can also use
<a href="/docs/latest/commands/config-set/">
<code>
CONFIG SET
</code>
</a>
to
set
<code>
maxmemory
</code>
at runtime using
<a href="/docs/latest/develop/tools/cli/">
<code>
redis-cli
</code>
</a>
:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">> CONFIG SET maxmemory 100mb
</span></span></code></pre>
</div>
<p>
Set
<code>
maxmemory
</code>
to zero to specify that you don't want to limit the memory
for the dataset. This is the default behavior for 64-bit systems, while 32-bit
systems use an implicit memory limit of 3GB.
</p>
<p>
When the size of your cache exceeds the limit set by
<code>
maxmemory
</code>
, Redis will
enforce your chosen
<a href="#eviction-policies">
eviction policy
</a>
to prevent any
further growth of the cache.
</p>
<h3 id="setting-maxmemory-for-a-replicated-or-persisted-instance">
Setting
<code>
maxmemory
</code>
for a replicated or persisted instance
</h3>
<p>
If you are using
<a href="/docs/latest/operate/rs/databases/durability-ha/replication/">
replication
</a>
or
<a href="/docs/latest/operate/rs/databases/configure/database-persistence/">
persistence
</a>
for a server, Redis will use some RAM as a buffer to store the set of updates waiting
to be written to the replicas or AOF files.
The memory used by this buffer is not included in the total that
is compared to
<code>
maxmemory
</code>
to see if eviction is required.
</p>
<p>
This is because the key evictions themselves generate updates that must be added
to the buffer. If the updates were counted among the used
memory then in some circumstances, the memory saved by
evicting keys would be immediately used up by the update data added to the buffer.
This, in turn, would trigger even more evictions and the resulting feedback loop
could evict many items from the cache unnecessarily.
</p>
<p>
If you are using replication or persistence, we recommend that you set
<code>
maxmemory
</code>
to leave a little RAM free to store the buffers. Note that this is not
necessary for the
<code>
noeviction
</code>
policy (see
<a href="#eviction-policies">
the section below
</a>
for more information about eviction policies).
</p>
<p>
The
<a href="/docs/latest/commands/info/">
<code>
INFO
</code>
</a>
command returns a
<code>
mem_not_counted_for_evict
</code>
value in the
<code>
memory
</code>
section (you can use
the
<code>
INFO memory
</code>
option to see just this section). This is the amount of
memory currently used by the buffers. Although the exact amount will vary,
you can use it to estimate how much to subtract from the total available RAM
before setting
<code>
maxmemory
</code>
.
</p>
<h2 id="eviction-policies">
Eviction policies
</h2>
<p>
Use the
<code>
maxmemory-policy
</code>
configuration directive to select the eviction
policy you want to use when the limit set by
<code>
maxmemory
</code>
is reached.
</p>
<p>
The following policies are available:
</p>
<ul>
<li>
<code>
noeviction
</code>
: Keys are not evicted but the server will return an error
when you try to execute commands that cache new data. If your database uses replication
then this condition only applies to the primary database. Note that commands that only
read existing data still work as normal.
</li>
<li>
<code>
allkeys-lru
</code>
: Evict the
<a href="#apx-lru">
least recently used
</a>
(LRU) keys.
</li>
<li>
<code>
allkeys-lfu
</code>
: Evict the
<a href="#lfu-eviction">
least frequently used
</a>
(LFU) keys.
</li>
<li>
<code>
allkeys-random
</code>
: Evict keys at random.
</li>
<li>
<code>
volatile-lru
</code>
: Evict the least recently used keys that have the
<code>
expire
</code>
field
set to
<code>
true
</code>
.
</li>
<li>
<code>
volatile-lfu
</code>
: Evict the least frequently used keys that have the
<code>
expire
</code>
field
set to
<code>
true
</code>
.
</li>
<li>
<code>
volatile-random
</code>
: Evict keys at random only if they have the
<code>
expire
</code>
field set
to
<code>
true
</code>
.
</li>
<li>
<code>
volatile-ttl
</code>
: Evict keys with the
<code>
expire
</code>
field set to
<code>
true
</code>
that have the
shortest remaining time-to-live (TTL) value.
</li>
</ul>
<p>
The
<code>
volatile-xxx
</code>
policies behave like
<code>
noeviction
</code>
if no keys have the
<code>
expire
</code>
field set to true, or for
<code>
volatile-ttl
</code>
, if no keys have a time-to-live value set.
</p>
<p>
You should choose an eviction policy that fits the way your app
accesses keys. You may be able to predict the access pattern in advance
but you can also use information from the
<code>
INFO
</code>
command at runtime to
check or improve your choice of policy (see
<a href="#using-the-info-command">
Using the
<code>
INFO
</code>
command
</a>
below for more information).
</p>
<p>
As a rule of thumb:
</p>
<ul>
<li>
Use
<code>
allkeys-lru
</code>
when you expect that a subset of elements will be accessed far
more often than the rest. This is a very common case according to the
<a href="https://en.wikipedia.org/wiki/Pareto_principle">
Pareto principle
</a>
, so
<code>
allkeys-lru
</code>
is a good default option if you have no reason to prefer any others.
</li>
<li>
Use
<code>
allkeys-random
</code>
when you expect all keys to be accessed with roughly equal
frequency. An example of this is when your app reads data items in a repeating cycle.
</li>
<li>
Use
<code>
volatile-ttl
</code>
if your code can estimate which keys are good candidates for eviction
and assign short TTLs to them. Note also that if you make good use of
key expiration, then you are less likely to run into the cache memory limit because keys
will often expire before they need to be evicted.
</li>
</ul>
<p>
The
<code>
volatile-lru
</code>
and
<code>
volatile-random
</code>
policies are mainly useful when you want to use
a single Redis instance for both caching and for a set of persistent keys. However,
you should consider running two separate Redis instances in a case like this, if possible.
</p>
<p>
Also note that setting an
<code>
expire
</code>
value for a key costs memory, so a
policy like
<code>
allkeys-lru
</code>
is more memory efficient since it doesn't need an
<code>
expire
</code>
value to operate.
</p>
<h3 id="using-the-info-command">
Using the
<code>
INFO
</code>
command
</h3>
<p>
The
<a href="/docs/latest/commands/info/">
<code>
INFO
</code>
</a>
command provides several pieces
of data that are useful for checking the performance of your cache. In particular,
the
<code>
INFO stats
</code>
section includes two important entries,
<code>
keyspace_hits
</code>
(the number of
times keys were successfully found in the cache) and
<code>
keyspace_misses
</code>
(the number
of times a key was requested but was not in the cache). The calculation below gives
the percentage of attempted accesses that were satisfied from the cache:
</p>
<pre tabindex="0"><code>keyspace_hits / (keyspace_hits + keyspace_misses) * 100
</code></pre>
<p>
Check that this is roughly equal to what you would expect for your app
(naturally, a higher percentage indicates better cache performance).
</p>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Note:
</div>
When the
<a href="/docs/latest/commands/exists/">
<code>
EXISTS
</code>
</a>
command reports that a key is absent then this is counted as a keyspace miss.
</div>
</div>
<p>
If the percentage of hits is lower than expected, then this might
mean you are not using the best eviction policy. For example, if
you believe that a small subset of "hot" data (that will easily fit into the
cache) should account for about 75% of accesses, you could reasonably
expect the percentage of keyspace hits to be around 75%. If the actual
percentage is lower, check the value of
<code>
evicted_keys
</code>
(also returned by
<code>
INFO stats
</code>
). A high proportion of evictions would suggest that the
wrong keys are being evicted too often by your chosen policy
(so
<code>
allkeys-lru
</code>
might be a good option here). If the
value of
<code>
evicted_keys
</code>
is low and you are using key expiration, check
<code>
expired_keys
</code>
to see how many keys have expired. If this number is high,
you might be using a TTL that is too low or you are choosing the wrong
keys to expire and this is causing keys to disappear from the cache
before they should.
</p>
<p>
Other useful pieces of information returned by
<code>
INFO
</code>
include:
</p>
<ul>
<li>
<code>
used_memory_dataset
</code>
: (
<code>
memory
</code>
section) The amount of memory used for
cached data. If this is greater than
<code>
maxmemory
</code>
, then the difference
is the amount by which
<code>
maxmemory
</code>
has been exceeded.
</li>
<li>
<code>
current_eviction_exceeded_time
</code>
: (
<code>
stats
</code>
section) The time since
the cache last started to exceed
<code>
maxmemory
</code>
.
</li>
<li>
<code>
commandstats
</code>
section: Among other things, this reports the number of
times each command issued to the server has been rejected. If you are
using
<code>
noeviction
</code>
or one of the
<code>
volatile_xxx
</code>
policies, you can use
this to find which commands are being stopped by the
<code>
maxmemory
</code>
limit
and how often it is happening.
</li>
</ul>
<h2 id="apx-lru">
Approximated LRU algorithm
</h2>
<p>
The Redis LRU algorithm uses an approximation of the least recently used
keys rather than calculating them exactly. It samples a small number of keys
at random and then evicts the ones with the longest time since last access.
</p>
<p>
From Redis 3.0 onwards, the algorithm also tracks a pool of good
candidates for eviction. This improves the performance of the algorithm, making
it a close approximation to a true LRU algorithm.
</p>
<p>
You can tune the performance of the algorithm by changing the number of samples to check
before every eviction with the
<code>
maxmemory-samples
</code>
configuration directive:
</p>
<pre tabindex="0"><code>maxmemory-samples 5
</code></pre>
<p>
The reason Redis does not use a true LRU implementation is because it
costs more memory. However, the approximation is virtually equivalent for an
application using Redis. This figure compares
the LRU approximation used by Redis with true LRU.
</p>
<p>
<img alt="LRU comparison" src="lru_comparison.png"/>
</p>
<p>
The test to generate the above graphs filled a Redis server with a given number of keys. The keys were accessed from the first to the last. The first keys are the best candidates for eviction using an LRU algorithm. Later more 50% of keys are added, in order to force half of the old keys to be evicted.
</p>
<p>
You can see three kind of dots in the graphs, forming three distinct bands.
</p>
<ul>
<li>
The light gray band are objects that were evicted.
</li>
<li>
The gray band are objects that were not evicted.
</li>
<li>
The green band are objects that were added.
</li>
</ul>
<p>
In a theoretical LRU implementation we expect that, among the old keys, the first half will be expired. The Redis LRU algorithm will instead only
<em>
probabilistically
</em>
expire the older keys.
</p>
<p>
As you can see Redis 3.0 does a better job with 5 samples compared to Redis 2.8, however most objects that are among the latest accessed are still retained by Redis 2.8. Using a sample size of 10 in Redis 3.0 the approximation is very close to the theoretical performance of Redis 3.0.
</p>
<p>
Note that LRU is just a model to predict how likely a given key will be accessed in the future. Moreover, if your data access pattern closely
resembles the power law, most of the accesses will be in the set of keys
the LRU approximated algorithm can handle well.
</p>
<p>
In simulations we found that using a power law access pattern, the difference between true LRU and Redis approximation were minimal or non-existent.
</p>
<p>
However you can raise the sample size to 10 at the cost of some additional CPU
usage to closely approximate true LRU, and check if this makes a
difference in your cache misses rate.
</p>
<p>
To experiment in production with different values for the sample size by using
the
<code>
CONFIG SET maxmemory-samples <count>
</code>
command, is very simple.
</p>
<h2 id="lfu-eviction">
LFU eviction
</h2>
<p>
Starting with Redis 4.0, the
<a href="http://antirez.com/news/109">
Least Frequently Used eviction mode
</a>
is available. This mode may work better (provide a better
hits/misses ratio) in certain cases. In LFU mode, Redis will try to track
the frequency of access of items, so the ones used rarely are evicted. This means
the keys used often have a higher chance of remaining in memory.
</p>
<p>
To configure the LFU mode, the following policies are available:
</p>
<ul>
<li>
<code>
volatile-lfu
</code>
Evict using approximated LFU among the keys with an expire set.
</li>
<li>
<code>
allkeys-lfu
</code>
Evict any key using approximated LFU.
</li>
</ul>
<p>
LFU is approximated like LRU: it uses a probabilistic counter, called a
<a href="https://en.wikipedia.org/wiki/Approximate_counting_algorithm">
Morris counter
</a>
to estimate the object access frequency using just a few bits per object, combined with a decay period so that the counter is reduced over time. At some point we no longer want to consider keys as frequently accessed, even if they were in the past, so that the algorithm can adapt to a shift in the access pattern.
</p>
<p>
That information is sampled similarly to what happens for LRU (as explained in the previous section of this documentation) to select a candidate for eviction.
</p>
<p>
However unlike LRU, LFU has certain tunable parameters: for example, how fast
should a frequent item lower in rank if it gets no longer accessed? It is also possible to tune the Morris counters range to better adapt the algorithm to specific use cases.
</p>
<p>
By default Redis is configured to:
</p>
<ul>
<li>
Saturate the counter at, around, one million requests.
</li>
<li>
Decay the counter every one minute.
</li>
</ul>
<p>
Those should be reasonable values and were tested experimentally, but the user may want to play with these configuration settings to pick optimal values.
</p>
<p>
Instructions about how to tune these parameters can be found inside the example
<code>
redis.conf
</code>
file in the source distribution. Briefly, they are:
</p>
<pre tabindex="0"><code>lfu-log-factor 10
lfu-decay-time 1
</code></pre>
<p>
The decay time is the obvious one, it is the amount of minutes a counter should be decayed, when sampled and found to be older than that value. A special value of
<code>
0
</code>
means: we will never decay the counter.
</p>
<p>
The counter
<em>
logarithm factor
</em>
changes how many hits are needed to saturate the frequency counter, which is just in the range 0-255. The higher the factor, the more accesses are needed to reach the maximum. The lower the factor, the better is the resolution of the counter for low accesses, according to the following table:
</p>
<pre tabindex="0"><code>+--------+------------+------------+------------+------------+------------+
| factor | 100 hits | 1000 hits | 100K hits | 1M hits | 10M hits |
+--------+------------+------------+------------+------------+------------+
| 0 | 104 | 255 | 255 | 255 | 255 |
+--------+------------+------------+------------+------------+------------+
| 1 | 18 | 49 | 255 | 255 | 255 |
+--------+------------+------------+------------+------------+------------+
| 10 | 10 | 18 | 142 | 255 | 255 |
+--------+------------+------------+------------+------------+------------+
| 100 | 8 | 11 | 49 | 143 | 255 |
+--------+------------+------------+------------+------------+------------+
</code></pre>
<p>
So basically the factor is a trade off between better distinguishing items with low accesses VS distinguishing items with high accesses. More information is available in the example
<code>
redis.conf
</code>
file.
</p>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/develop/reference/eviction/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/references/rest-api/requests/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Redis Enterprise REST API requests
</h1>
<p class="text-lg -mt-5 mb-10">
Documents the requests supported by the Redis Enterprise Software REST API calls.
</p>
<p>
A REST API request requires the following components:
</p>
<ul>
<li>
<a href="https://restfulapi.net/http-methods/">
HTTP method
</a>
(
<code>
GET
</code>
,
<code>
PUT
</code>
,
<code>
PATCH
</code>
,
<code>
POST
</code>
,
<code>
DELETE
</code>
)
</li>
<li>
Base URL
</li>
<li>
Endpoint
</li>
</ul>
<p>
Some requests may also require:
</p>
<ul>
<li>
URL parameters
</li>
<li>
<a href="https://en.wikipedia.org/wiki/Query_string">
Query parameters
</a>
</li>
<li>
<a href="http://www.json.org">
JSON
</a>
request body
</li>
<li>
<a href="/docs/latest/operate/rs/references/rest-api/permissions/">
Permissions
</a>
</li>
</ul>
<table>
<thead>
<tr>
<th style="text-align:left">
Request
</th>
<th style="text-align:left">
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/rs/references/rest-api/requests/actions/">
actions
</a>
</td>
<td style="text-align:left">
Actions requests
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/rs/references/rest-api/requests/bdbs/">
bdbs
</a>
</td>
<td style="text-align:left">
Database requests
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/rs/references/rest-api/requests/bootstrap/">
bootstrap
</a>
</td>
<td style="text-align:left">
Bootstrap requests
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/rs/references/rest-api/requests/cluster/">
cluster
</a>
</td>
<td style="text-align:left">
Cluster settings requests
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/rs/references/rest-api/requests/cm_settings/">
cm_settings
</a>
</td>
<td style="text-align:left">
REST API requests for Cluster Manager UI settings
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/rs/references/rest-api/requests/crdb_tasks/">
crdb_tasks
</a>
</td>
<td style="text-align:left">
Active-Active database task status requests
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/rs/references/rest-api/requests/crdbs/">
crdbs
</a>
</td>
<td style="text-align:left">
Active-Active database requests
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/rs/references/rest-api/requests/debuginfo/">
debuginfo
</a>
</td>
<td style="text-align:left">
Debug info requests
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/rs/references/rest-api/requests/endpoints-stats/">
endpoints/stats
</a>
</td>
<td style="text-align:left">
Endpoint statistics requests
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/rs/references/rest-api/requests/jsonschema/">
jsonschema
</a>
</td>
<td style="text-align:left">
API object JSON schema requests
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/rs/references/rest-api/requests/ldap_mappings/">
ldap_mappings
</a>
</td>
<td style="text-align:left">
LDAP mappings requests
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/rs/references/rest-api/requests/license/">
license
</a>
</td>
<td style="text-align:left">
License requests
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/rs/references/rest-api/requests/logs/">
logs
</a>
</td>
<td style="text-align:left">
Cluster event logs requests
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/rs/references/rest-api/requests/modules/">
modules
</a>
</td>
<td style="text-align:left">
Redis modules requests
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/rs/references/rest-api/requests/nodes/">
nodes
</a>
</td>
<td style="text-align:left">
Node requests
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/rs/references/rest-api/requests/ocsp/">
ocsp
</a>
</td>
<td style="text-align:left">
OCSP requests
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/rs/references/rest-api/requests/proxies/">
proxies
</a>
</td>
<td style="text-align:left">
Proxy requests
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/rs/references/rest-api/requests/redis_acls/">
redis_acls
</a>
</td>
<td style="text-align:left">
Redis access control list (ACL) requests
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/rs/references/rest-api/requests/roles/">
roles
</a>
</td>
<td style="text-align:left">
Roles requests
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/rs/references/rest-api/requests/shards/">
shards
</a>
</td>
<td style="text-align:left">
REST API requests for database shards
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/rs/references/rest-api/requests/suffix/">
suffix
</a>
</td>
<td style="text-align:left">
DNS suffix requests
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/rs/references/rest-api/requests/suffixes/">
suffixes
</a>
</td>
<td style="text-align:left">
DNS suffixes requests
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/rs/references/rest-api/requests/users/">
users
</a>
</td>
<td style="text-align:left">
User requests
</td>
</tr>
</tbody>
</table>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/references/rest-api/requests/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/7.4/references/rest-api/objects/bootstrap/policy/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Policy object
</h1>
<p class="text-lg -mt-5 mb-10">
Documents the policy object used with Redis Enterprise Software REST API calls.
</p>
<table>
<thead>
<tr>
<th>
Name
</th>
<th>
Type/Value
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
default_fork_evict_ram
</td>
<td>
boolean (default:Β false)
</td>
<td>
If true, the databases should evict data from RAM to ensure successful replication or persistence
</td>
</tr>
<tr>
<td>
default_non_sharded_proxy_policy
</td>
<td>
<strong>
'single'
</strong>
<br/>
'all-master-shards'
<br/>
'all-nodes'
</td>
<td>
Default proxy_policy for newly created non-sharded databases' endpoints
</td>
</tr>
<tr>
<td>
default_sharded_proxy_policy
</td>
<td>
'single'
<br/>
<strong>
'all-master-shards'
</strong>
<br/>
'all-nodes'
</td>
<td>
Default proxy_policy for newly created sharded databases' endpoints
</td>
</tr>
<tr>
<td>
default_shards_placement
</td>
<td>
'dense'
<br/>
<strong>
'sparse'
</strong>
</td>
<td>
Default shards_placement for newly created databases
</td>
</tr>
<tr>
<td>
rack_aware
</td>
<td>
boolean
</td>
<td>
Cluster rack awareness
</td>
</tr>
<tr>
<td>
shards_overbooking
</td>
<td>
boolean (default:Β true)
</td>
<td>
If true, all databases' memory_size settings are ignored during shards placement
</td>
</tr>
</tbody>
</table>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/references/rest-api/objects/bootstrap/policy/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/integrate/redis-data-integration/reference/data-transformation/filter/.html | <section class="prose w-full py-12 max-w-none">
<h1>
filter
</h1>
<p class="text-lg -mt-5 mb-10">
Filter records
</p>
<p>
Filter records
</p>
<p>
<strong>
Properties
</strong>
</p>
<table>
<thead>
<tr>
<th>
Name
</th>
<th>
Type
</th>
<th>
Description
</th>
<th>
Required
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<strong>
expression
</strong>
</td>
<td>
<code>
string
</code>
</td>
<td>
Expression
<br/>
</td>
<td>
yes
</td>
</tr>
<tr>
<td>
<strong>
language
</strong>
</td>
<td>
<code>
string
</code>
</td>
<td>
Language
<br/>
Enum:
<code>
"jmespath"
</code>
,
<code>
"sql"
</code>
<br/>
</td>
<td>
yes
</td>
</tr>
</tbody>
</table>
<p>
<strong>
Additional Properties:
</strong>
not allowed
</p>
<p>
<strong>
Example
</strong>
</p>
<div class="highlight">
<pre class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">source</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">server_name</span><span class="p">:</span><span class="w"> </span><span class="l">redislabs</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">schema</span><span class="p">:</span><span class="w"> </span><span class="l">dbo</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">table</span><span class="p">:</span><span class="w"> </span><span class="l">emp</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">transform</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span>- <span class="nt">uses</span><span class="p">:</span><span class="w"> </span><span class="l">filter</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">with</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">language</span><span class="p">:</span><span class="w"> </span><span class="l">sql</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">expression</span><span class="p">:</span><span class="w"> </span><span class="l">age>20</span><span class="w">
</span></span></span></code></pre>
</div>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/integrate/redis-data-integration/reference/data-transformation/filter/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/commands/client-setinfo/.html | <section class="prose w-full py-12">
<h1 class="command-name">
CLIENT SETINFO
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">CLIENT SETINFO <LIB-NAMEΒ libname | LIB-VERΒ libver></pre>
<dl class="grid grid-cols-[auto,1fr] gap-2 mb-12">
<dt class="font-semibold text-redis-ink-900 m-0">
Available since:
</dt>
<dd class="m-0">
7.2.0
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
Time complexity:
</dt>
<dd class="m-0">
O(1)
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
ACL categories:
</dt>
<dd class="m-0">
<code>
@slow
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@connection
</code>
<span class="mr-1 last:hidden">
,
</span>
</dd>
</dl>
<p>
The
<code>
CLIENT SETINFO
</code>
command assigns various info attributes to the current connection which are displayed in the output of
<a href="/docs/latest/commands/client-list/">
<code>
CLIENT LIST
</code>
</a>
and
<a href="/docs/latest/commands/client-info/">
<code>
CLIENT INFO
</code>
</a>
.
</p>
<p>
Client libraries are expected to pipeline this command after authentication on all connections
and ignore failures since they could be connected to an older version that doesn't support them.
</p>
<p>
Currently the supported attributes are:
</p>
<ul>
<li>
<code>
lib-name
</code>
- meant to hold the name of the client library that's in use.
</li>
<li>
<code>
lib-ver
</code>
- meant to hold the client library's version.
</li>
</ul>
<p>
There is no limit to the length of these attributes. However it is not possible to use spaces, newlines, or other non-printable characters that would violate the format of the
<a href="/docs/latest/commands/client-list/">
<code>
CLIENT LIST
</code>
</a>
reply.
</p>
<p>
<a href="https://redis.io/docs/latest/develop/connect/clients/">
Official client libraries
</a>
allow extending
<code>
lib-name
</code>
with a custom suffix to expose additional information about the client.
For example, high-level libraries like
<a href="https://github.com/redis/redis-om-spring">
redis-om-spring
</a>
can report their version.
The resulting
<code>
lib-name
</code>
would be
<code>
jedis(redis-om-spring_v1.0.0)
</code>
.
Brace characters are used to delimit the custom suffix and should be avoided in the suffix itself.
We recommend using the following format for the custom suffixes for third-party libraries
<code>
(?<custom-name>[ -~]+)[ -~]v(?<custom-version>[\d\.]+)
</code>
and use
<code>
;
</code>
to delimit multiple suffixes.
</p>
<p>
Note that these attributes are
<strong>
not
</strong>
cleared by the RESET command.
</p>
<h2 id="resp2resp3-reply">
RESP2/RESP3 Reply
</h2>
<a href="../../develop/reference/protocol-spec#simple-strings">
Simple string reply
</a>
:
<code>
OK
</code>
if the attribute name was successfully set.
<br/>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/client-setinfo/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisce/redisce-7.4-release-notes/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Redis Community Edition 7.4 release notes
</h1>
<p class="text-lg -mt-5 mb-10">
Redis Community Edition 7.4 release notes.
</p>
<h2 id="redis-community-edition-741-october-2024">
Redis Community Edition 7.4.1 (October 2024)
</h2>
<p>
Upgrade urgency SECURITY: See security fixes below.
</p>
<h3 id="security-fixes">
Security fixes
</h3>
<ul>
<li>
(CVE-2024-31449) Lua library commands may lead to stack overflow and potential RCE.
</li>
<li>
(CVE-2024-31227) Potential Denial-of-service due to malformed ACL selectors.
</li>
<li>
(CVE-2024-31228) Potential Denial-of-service due to unbounded pattern matching.
</li>
</ul>
<p>
For more information, see the
<a href="https://redis.io/blog/security-advisory-cve-2024-31449-cve-2024-31227-cve-2024-31228/">
Redis blog post
</a>
about these vulnerabilities.
</p>
<h2 id="redis-community-edition-74-july-2024">
Redis Community Edition 7.4 (July 2024)
</h2>
<p>
This is the General Availability release of Redis Community Edition 7.4.
</p>
<p>
<strong>
Changes to new 7.4 features (compared to 7.4 RC2)
</strong>
</p>
<ul>
<li>
<a href="https://github.com/redis/redis/pull/13391">
#13391
</a>
,
<a href="https://github.com/redis/redis/pull/13438">
#13438
</a>
Hash - expiration of individual fields: RDB file format changes
</li>
<li>
<a href="https://github.com/redis/redis/pull/13372">
#13372
</a>
Hash - expiration of individual fields: rename and fix counting of
<code>
expired_subkeys
</code>
metric
</li>
<li>
<a href="https://github.com/redis/redis/pull/13372">
#13372
</a>
Hash - expiration of individual fields: rename
<code>
INFO
</code>
keyspace field to
<code>
subexpiry
</code>
</li>
</ul>
<p>
<strong>
Configuration parameters
</strong>
</p>
<ul>
<li>
<a href="https://github.com/redis/redis/pull/13400">
#13400
</a>
Add hide-user-data-from-log - allows hiding user data from the log file
</li>
</ul>
<p>
<strong>
Bug fixes
</strong>
</p>
<ul>
<li>
<a href="https://github.com/redis/redis/pull/13407">
#13407
</a>
Trigger Lua GC after
<code>
SCRIPT LOAD
</code>
</li>
<li>
<a href="https://github.com/redis/redis/pull/13380">
#13380
</a>
Fix possible crash due to OOM panic on invalid command
</li>
<li>
<a href="https://github.com/redis/redis/pull/13383">
#13383
</a>
<code>
FUNCTION FLUSH
</code>
- improve Lua GC behavior and fix thread race in ASYNC mode
</li>
<li>
<a href="https://github.com/redis/redis/pull/13408">
#13408
</a>
<code>
HEXPIRE
</code>
-like commands should emit
<code>
HDEL
</code>
keyspace notification if expire time is in the past
</li>
</ul>
<h2 id="redis-community-edition-74-rc2-june-2024">
Redis Community Edition 7.4-rc2 (June 2024)
</h2>
<p>
Upgrade urgency LOW: This is the second Release Candidate for Redis Community Edition 7.4.
</p>
<p>
<strong>
Performance and resource utilization improvements
</strong>
</p>
<ul>
<li>
<a href="https://github.com/redis/redis/pull/13296">
#13296
</a>
Optimize CPU cache efficiency
</li>
</ul>
<p>
<strong>
Changes to new 7.4 new features (compared to 7.4 RC1)
</strong>
</p>
<ul>
<li>
<a href="https://github.com/redis/redis/pull/13343">
#13343
</a>
Hash - expiration of individual fields: when key does not exist - reply with an array (nonexisting code for each field)
</li>
<li>
<a href="https://github.com/redis/redis/pull/13329">
#13329
</a>
Hash - expiration of individual fields: new keyspace event:
<code>
hexpired
</code>
</li>
</ul>
<p>
<strong>
Modules API - Potentially breaking changes to new 7.4 features (compared to 7.4 RC1)
</strong>
</p>
<ul>
<li>
<a href="https://github.com/redis/redis/pull/13326">
#13326
</a>
Hash - expiration of individual fields: avoid lazy expire when called from a Modules API function
</li>
</ul>
<h2 id="redis-community-edition-74-rc1-june-2024">
Redis Community Edition 7.4-rc1 (June 2024)
</h2>
<p>
Upgrade urgency LOW: This is the first Release Candidate for Redis Community Edition 7.4.
</p>
<p>
Here is a comprehensive list of changes in this release compared to 7.2.5.
</p>
<p>
<strong>
New Features
</strong>
</p>
<ul>
<li>
<a href="https://github.com/redis/redis/pull/13303">
#13303
</a>
Hash - expiration of individual fields. 9 commands were introduced:
<ul>
<li>
<code>
HEXPIRE
</code>
and
<code>
HPEXPIRE
</code>
set the remaining time to live for specific fields
</li>
<li>
<code>
HEXPIREAT
</code>
and
<code>
HPEXPIREAT
</code>
set the expiration time to a UNIX timestamp for specific fields
</li>
<li>
<code>
HPERSIST
</code>
removes the expiration for specific fields
</li>
<li>
<code>
HEXPIRETIME
</code>
and
<code>
HPEXPIRETIME
</code>
get the expiration time for specific fields
</li>
<li>
<code>
HTTL
</code>
and
<code>
HPTTL
</code>
get the remaining time to live for specific fields
</li>
</ul>
</li>
<li>
<a href="https://github.com/redis/redis/pull/13117">
#13117
</a>
<code>
XREAD
</code>
: new id value
<code>
+
</code>
to start reading from the last message
</li>
<li>
<a href="https://github.com/redis/redis/pull/12765">
#12765
</a>
<code>
HSCAN
</code>
: new
<code>
NOVALUES
</code>
flag to report only field names
</li>
<li>
<a href="https://github.com/redis/redis/pull/12728">
#12728
</a>
<code>
SORT
</code>
,
<code>
SORT_RO
</code>
: allow
<code>
BY
</code>
and
<code>
GET
</code>
options in cluster mode when the pattern maps to the same slot as the key
</li>
<li>
<a href="https://github.com/redis/redis/pull/12299">
#12299
</a>
<code>
CLIENT KILL
</code>
: new optional filter:
<code>
MAXAGE maxage
</code>
- kill connections older than
<code>
maxage
</code>
seconds
</li>
<li>
<a href="https://github.com/redis/redis/pull/12971">
#12971
</a>
Lua: expose
<code>
os.clock()
</code>
API for getting the elapsed time of Lua code execution
</li>
<li>
<a href="https://github.com/redis/redis/pull/13276">
#13276
</a>
Allow
<code>
SPUBLISH
</code>
command within
<code>
MULTI ... EXEC
</code>
transactions on replica
</li>
</ul>
<p>
<strong>
Bug fixes
</strong>
</p>
<ul>
<li>
<a href="https://github.com/redis/redis/pull/12898">
#12898
</a>
<code>
XREADGROUP
</code>
: fix entries-read inconsistency between master and replicas
</li>
<li>
<a href="https://github.com/redis/redis/pull/13042">
#13042
</a>
<code>
SORT ... STORE
</code>
: fix created lists to respect list compression and packing configs
</li>
<li>
<a href="https://github.com/redis/redis/pull/12817">
#12817
</a>
,
<a href="https://github.com/redis/redis/pull/12905">
#12905
</a>
Fix race condition issues between the main thread and module threads
</li>
<li>
<a href="https://github.com/redis/redis/pull/12577">
#12577
</a>
Unsubscribe all clients from replica for shard channel if the master ownership changes
</li>
<li>
<a href="https://github.com/redis/redis/pull/12622">
#12622
</a>
<code>
WAITAOF
</code>
could timeout or hang if used after a module command that propagated effects only to replicas and not to AOF
</li>
<li>
<a href="https://github.com/redis/redis/pull/11734">
#11734
</a>
<code>
BITCOUNT
</code>
and
<code>
BITPOS
</code>
with nonexistent key and illegal arguments return an error, not 0
</li>
<li>
<a href="https://github.com/redis/redis/pull/12394">
#12394
</a>
<code>
BITCOUNT
</code>
: check for wrong argument before checking if key exists
</li>
<li>
<a href="https://github.com/redis/redis/pull/12961">
#12961
</a>
Allow execution of read-only transactions when out of memory
</li>
<li>
<a href="https://github.com/redis/redis/pull/13274">
#13274
</a>
Fix crash when a client performs ACL change that disconnects itself
</li>
<li>
<a href="https://github.com/redis/redis/pull/13311">
#13311
</a>
Cluster: Fix crash due to unblocking client during slot migration
</li>
</ul>
<p>
<strong>
Security improvements
</strong>
</p>
<ul>
<li>
<a href="https://github.com/redis/redis/pull/13108">
#13108
</a>
Lua: LRU eviction for scripts generated with
<code>
EVAL
</code>
*** BEHAVIOR CHANGE ***
</li>
<li>
<a href="https://github.com/redis/redis/pull/12961">
#12961
</a>
Restrict the total request size of
<code>
MULTI ... EXEC
</code>
transactions
</li>
<li>
<a href="https://github.com/redis/redis/pull/12860">
#12860
</a>
Redact ACL username information and mark
<code>
*-key-file-pass configs
</code>
as sensitive
</li>
</ul>
<p>
<strong>
Performance and resource utilization improvements
</strong>
</p>
<ul>
<li>
<a href="https://github.com/redis/redis/pull/12838">
#12838
</a>
Improve performance when many clients call
<code>
PUNSUBSCRIBE
</code>
/
<code>
SUNSUBSCRIBE
</code>
simultaneously
</li>
<li>
<a href="https://github.com/redis/redis/pull/12627">
#12627
</a>
Reduce lag when waking
<code>
WAITAOF
</code>
clients and there is not much traffic
</li>
<li>
<a href="https://github.com/redis/redis/pull/12754">
#12754
</a>
Optimize
<code>
KEYS
</code>
when pattern includes hashtag and implies a single slot
</li>
<li>
<a href="https://github.com/redis/redis/pull/11695">
#11695
</a>
Reduce memory and improve performance by replacing cluster metadata with slot specific dictionaries
</li>
<li>
<a href="https://github.com/redis/redis/pull/13087">
#13087
</a>
<code>
SCRIPT FLUSH ASYNC
</code>
now does not block the main thread
</li>
<li>
<a href="https://github.com/redis/redis/pull/12996">
#12996
</a>
Active memory defragmentation efficiency improvements
</li>
<li>
<a href="https://github.com/redis/redis/pull/12899">
#12899
</a>
Improve performance of read/update operation during rehashing
</li>
<li>
<a href="https://github.com/redis/redis/pull/12536">
#12536
</a>
<code>
SCAN ... MATCH
</code>
: Improve performance when the pattern implies cluster slot
</li>
<li>
<a href="https://github.com/redis/redis/pull/12450">
#12450
</a>
<code>
ZRANGE ... LIMIT
</code>
: improved performance
</li>
</ul>
<p>
<strong>
Other general improvements
</strong>
</p>
<ul>
<li>
<a href="https://github.com/redis/redis/pull/13133">
#13133
</a>
Lua: allocate VM code with jemalloc instead of libc and count it as used memory *** BEHAVIOR CHANGE ***
</li>
<li>
<a href="https://github.com/redis/redis/pull/12171">
#12171
</a>
<code>
ACL LOAD
</code>
: do not disconnect all clients *** BEHAVIOR CHANGE ***
</li>
<li>
<a href="https://github.com/redis/redis/pull/13020">
#13020
</a>
Allow adjusting defrag configurations while active defragmentation is running
</li>
<li>
<a href="https://github.com/redis/redis/pull/12949">
#12949
</a>
Increase the accuracy of avg_ttl (the average keyspace keys TTL)
</li>
<li>
<a href="https://github.com/redis/redis/pull/12977">
#12977
</a>
Allow running
<code>
WAITAOF
</code>
in scripts
</li>
<li>
<a href="https://github.com/redis/redis/pull/12782">
#12782
</a>
Implement TCP Keep-Alives across most Unix-like systems
</li>
<li>
<a href="https://github.com/redis/redis/pull/12707">
#12707
</a>
Improved error codes when rejecting scripts in cluster mode
</li>
<li>
<a href="https://github.com/redis/redis/pull/12596">
#12596
</a>
Support
<code>
XREAD ... BLOCK
</code>
in scripts; rejected only if it ends up blocking
</li>
</ul>
<p>
<strong>
New metrics
</strong>
</p>
<ul>
<li>
<a href="https://github.com/redis/redis/pull/12849">
#12849
</a>
<code>
INFO
</code>
:
<code>
pubsub_clients
</code>
- number of clients in Pub/Sub mode
</li>
<li>
<a href="https://github.com/redis/redis/pull/12966">
#12966
</a>
<code>
INFO
</code>
:
<code>
watching_clients
</code>
- number of clients that are watching keys
</li>
<li>
<a href="https://github.com/redis/redis/pull/12966">
#12966
</a>
<code>
INFO
</code>
:
<code>
total_watched_keys
</code>
- number of watched keys
</li>
<li>
<a href="https://github.com/redis/redis/pull/12476">
#12476
</a>
<code>
INFO
</code>
:
<code>
client_query_buffer_limit_disconnections
</code>
- count client input buffer OOM events
</li>
<li>
<a href="https://github.com/redis/redis/pull/12476">
#12476
</a>
<code>
INFO
</code>
:
<code>
client_output_buffer_limit_disconnections
</code>
- count client output buffer OOM events
</li>
<li>
<a href="https://github.com/redis/redis/pull/12996">
#12996
</a>
<code>
INFO
</code>
:
<code>
allocator_muzzy
</code>
- memory returned to the OS but still shows as RSS until the OS reclaims it
</li>
<li>
<a href="https://github.com/redis/redis/pull/13108">
#13108
</a>
<code>
INFO
</code>
:
<code>
evicted_scripts
</code>
- number of evicted eval scripts. Users can check it to see if they are abusing EVAL
</li>
<li>
<a href="https://github.com/redis/redis/pull/12996">
#12996
</a>
<code>
MEMORY STATS
</code>
:
<code>
allocator.muzzy
</code>
- memory returned to the OS but still shows as RSS until the OS reclaims it
</li>
<li>
<a href="https://github.com/redis/redis/pull/12913">
#12913
</a>
<code>
INFO MEMORY
</code>
<code>
mem_overhead_db_hashtable_rehashing
</code>
- memory resharding overhead (only the memory that will be released soon)
</li>
<li>
<a href="https://github.com/redis/redis/pull/12913">
#12913
</a>
<code>
MEMORY STATS
</code>
:
<code>
overhead.db.hashtable.lut
</code>
- total overhead of dictionary buckets in databases
</li>
<li>
<a href="https://github.com/redis/redis/pull/12913">
#12913
</a>
<code>
MEMORY STATS
</code>
:
<code>
overhead.db.hashtable.rehashing
</code>
- temporary memory overhead of database dictionaries currently being rehashed
</li>
<li>
<a href="https://github.com/redis/redis/pull/12913">
#12913
</a>
<code>
MEMORY STATS
</code>
:
<code>
db.dict.rehashing.count
</code>
- number of top level dictionaries currently being rehashed
</li>
<li>
<a href="https://github.com/redis/redis/pull/12966">
#12966
</a>
<code>
CLIENT LIST
</code>
:
<code>
watch
</code>
- number of keys each client is currently watching
</li>
</ul>
<p>
<strong>
Modules API
</strong>
</p>
<ul>
<li>
<a href="https://github.com/redis/redis/pull/12985">
#12985
</a>
New API calls:
<code>
RM_TryCalloc
</code>
and
<code>
RM_TryRealloc
</code>
- allow modules to handle memory allocation failures gracefully
</li>
<li>
<a href="https://github.com/redis/redis/pull/13069">
#13069
</a>
New API call:
<code>
RM_ClusterKeySlot
</code>
- which slot a key will hash to
</li>
<li>
<a href="https://github.com/redis/redis/pull/13069">
#13069
</a>
New API call:
<code>
RM_ClusterCanonicalKeyNameInSlot
</code>
- get a consistent key that will map to a slot
</li>
<li>
<a href="https://github.com/redis/redis/pull/12486">
#12486
</a>
New API call:
<code>
RM_AddACLCategory
</code>
- allow modules to declare new ACL categories
</li>
</ul>
<p>
<strong>
Configuration parameters
</strong>
</p>
<ul>
<li>
<a href="https://github.com/redis/redis/pull/12178">
#12178
</a>
New configuration parameters:
<code>
max-new-connections-per-cycle
</code>
and
<code>
max-new-tls-connections-per-cycle
</code>
to limit the number of new client connections per event-loop cycle
</li>
<li>
<a href="https://github.com/redis/redis/pull/7351">
#7351
</a>
Rename some CPU configuration parameters for style alignment. Added alias to the old names to avoid breaking change
</li>
</ul>
<p>
<strong>
CLI tools
</strong>
</p>
<ul>
<li>
<a href="https://github.com/redis/redis/pull/10609">
#10609
</a>
redis-cli: new
<code>
-t <timeout>
</code>
argument: specify server connection timeout in seconds
</li>
<li>
<a href="https://github.com/redis/redis/pull/11315">
#11315
</a>
redis-cli: new
<code>
-4
</code>
and
<code>
-6
</code>
flags to prefer IPV4 or IPV6 on DNS lookup
</li>
<li>
<a href="https://github.com/redis/redis/pull/12862">
#12862
</a>
redis-cli: allows pressing up arrow to return any command (including sensitive commands which are still not persisted)
</li>
<li>
<a href="https://github.com/redis/redis/pull/12543">
#12543
</a>
redis-cli: add reverse history search (like Ctrl+R in terminals)
</li>
<li>
<a href="https://github.com/redis/redis/pull/12826">
#12826
</a>
redis-cli: add
<code>
--keystats
</code>
and
<code>
--keystats-samples
</code>
to combines
<code>
--memkeys
</code>
and
<code>
--bigkeys
</code>
with additional distribution data
</li>
<li>
<a href="https://github.com/redis/redis/pull/12735">
#12735
</a>
redis-cli: fix:
<code>
--bigkeys
</code>
and
<code>
--memkeys
</code>
now work on cluster replicas
</li>
<li>
<a href="https://github.com/redis/redis/pull/9411">
#9411
</a>
redis-benchmark: add support for binary strings
</li>
<li>
<a href="https://github.com/redis/redis/pull/12986">
#12986
</a>
redis-benchmark: fix: pick random slot for a node to distribute operation across slots
</li>
</ul>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisce/redisce-7.4-release-notes/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/clusters/replace-node/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Replace a cluster node
</h1>
<p class="text-lg -mt-5 mb-10">
Replace a node in your cluster that is down.
</p>
<p>
A failed node will appear as
<code>
Down
</code>
(
<a href="/docs/latest/images/rs/icons/node-down-icon.png#no-click" sdata-lightbox="/images/rs/icons/node-down-icon.png#no-click">
<img alt="Node down icon" class="inline" src="/docs/latest/images/rs/icons/node-down-icon.png#no-click"/>
</a>
) in the
<strong>
Nodes
</strong>
list.
</p>
<p>
To replace a failed node:
</p>
<ol>
<li>
<p>
Prepare a new node identical to the old one.
</p>
</li>
<li>
<p>
Install and
configure Redis Enterprise Software on the node. See
<a href="/docs/latest/operate/rs/installing-upgrading/">
Install and setup
</a>
for more information.
</p>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Note:
</div>
If you are using
<a href="/docs/latest/operate/rs/databases/auto-tiering/">
Auto Tiering
</a>
, make sure the required flash storage is set up on this new node.
</div>
</div>
</li>
<li>
<p>
<a href="/docs/latest/operate/rs/clusters/add-node/">
Add the node
</a>
to the cluster. Make sure the new node has as much available memory as the faulty
node.
</p>
<p>
If the new node does not have enough memory, you will be prompted to add a node with enough memory.
</p>
</li>
<li>
<p>
A message will appear informing you that the cluster has a faulty node
and that the new node will replace the faulty node.
</p>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Note:
</div>
<ul>
<li>
If there is a faulty node in the cluster to which you are adding a node, Redis Enterprise Software will use the new node to replace the faulty one.
</li>
<li>
Any existing
<a href="/docs/latest/operate/rs/networking/cluster-dns/">
DNS records
</a>
must be updated
each time a node is added or replaced.
</li>
</ul>
</div>
</div>
</li>
</ol>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/clusters/replace-node/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/commands/xinfo-groups/.html | <section class="prose w-full py-12">
<h1 class="command-name">
XINFO GROUPS
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">XINFO GROUPS key</pre>
<dl class="grid grid-cols-[auto,1fr] gap-2 mb-12">
<dt class="font-semibold text-redis-ink-900 m-0">
Available since:
</dt>
<dd class="m-0">
5.0.0
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
Time complexity:
</dt>
<dd class="m-0">
O(1)
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
ACL categories:
</dt>
<dd class="m-0">
<code>
@read
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@stream
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@slow
</code>
<span class="mr-1 last:hidden">
,
</span>
</dd>
</dl>
<p>
This command returns the list of all consumer groups of the stream stored at
<code>
<key>
</code>
.
</p>
<p>
By default, only the following information is provided for each of the groups:
</p>
<ul>
<li>
<strong>
name
</strong>
: the consumer group's name
</li>
<li>
<strong>
consumers
</strong>
: the number of consumers in the group
</li>
<li>
<strong>
pending
</strong>
: the length of the group's pending entries list (PEL), which are messages that were delivered but are yet to be acknowledged
</li>
<li>
<strong>
last-delivered-id
</strong>
: the ID of the last entry delivered to the group's consumers
</li>
<li>
<strong>
entries-read
</strong>
: the logical "read counter" of the last entry delivered to the group's consumers
</li>
<li>
<strong>
lag
</strong>
: the number of entries in the stream that are still waiting to be delivered to the group's consumers, or a NULL when that number can't be determined.
</li>
</ul>
<h3 id="consumer-group-lag">
Consumer group lag
</h3>
<p>
The lag of a given consumer group is the number of entries in the range between the group's
<code>
entries_read
</code>
and the stream's
<code>
entries_added
</code>
.
Put differently, it is the number of entries that are yet to be delivered to the group's consumers.
</p>
<p>
The values and trends of this metric are helpful in making scaling decisions about the consumer group.
You can address high lag values by adding more consumers to the group, whereas low values may indicate that you can remove consumers from the group to scale it down.
</p>
<p>
Redis reports the lag of a consumer group by keeping two counters: the number of all entries added to the stream and the number of logical reads made by the consumer group.
The lag is the difference between these two.
</p>
<p>
The stream's counter (the
<code>
entries_added
</code>
field of the
<a href="/docs/latest/commands/xinfo-stream/">
<code>
XINFO STREAM
</code>
</a>
command) is incremented by one with every
<a href="/docs/latest/commands/xadd/">
<code>
XADD
</code>
</a>
and counts all of the entries added to the stream during its lifetime.
</p>
<p>
The consumer group's counter,
<code>
entries_read
</code>
, is the logical counter of entries the group had read.
It is important to note that this counter is only a heuristic rather than an accurate counter, and therefore the use of the term "logical".
The counter attempts to reflect the number of entries that the group
<strong>
should have read
</strong>
to get to its current
<code>
last-delivered-id
</code>
.
The
<code>
entries_read
</code>
counter is accurate only in a perfect world, where a consumer group starts at the stream's first entry and processes all of its entries (i.e., no entries deleted before processing).
</p>
<p>
There are two special cases in which this mechanism is unable to report the lag:
</p>
<ol>
<li>
A consumer group is created or set with an arbitrary last delivered ID (the
<a href="/docs/latest/commands/xgroup-create/">
<code>
XGROUP CREATE
</code>
</a>
and
<a href="/docs/latest/commands/xgroup-setid/">
<code>
XGROUP SETID
</code>
</a>
commands, respectively).
An arbitrary ID is any ID that isn't the ID of the stream's first entry, its last entry or the zero ("0-0") ID.
</li>
<li>
One or more entries between the group's
<code>
last-delivered-id
</code>
and the stream's
<code>
last-generated-id
</code>
were deleted (with
<a href="/docs/latest/commands/xdel/">
<code>
XDEL
</code>
</a>
or a trimming operation).
</li>
</ol>
<p>
In both cases, the group's read counter is considered invalid, and the returned value is set to NULL to signal that the lag isn't currently available.
</p>
<p>
However, the lag is only temporarily unavailable.
It is restored automatically during regular operation as consumers keep processing messages.
Once the consumer group delivers the last message in the stream to its members, it will be set with the correct logical read counter, and tracking its lag can be resumed.
</p>
<h2 id="examples">
Examples
</h2>
<pre tabindex="0"><code>> XINFO GROUPS mystream
1) 1) "name"
2) "mygroup"
3) "consumers"
4) (integer) 2
5) "pending"
6) (integer) 2
7) "last-delivered-id"
8) "1638126030001-0"
9) "entries-read"
10) (integer) 2
11) "lag"
12) (integer) 0
2) 1) "name"
2) "some-other-group"
3) "consumers"
4) (integer) 1
5) "pending"
6) (integer) 0
7) "last-delivered-id"
8) "1638126028070-0"
9) "entries-read"
10) (integer) 1
11) "lag"
12) (integer) 1
</code></pre>
<h2 id="resp2resp3-reply">
RESP2/RESP3 Reply
</h2>
<a href="../../develop/reference/protocol-spec#arrays">
Array reply
</a>
: a list of consumer groups.
<br/>
<h2>
History
</h2>
<ul>
<li>
Starting with Redis version 7.0.0: Added the
<code>
entries-read
</code>
and
<code>
lag
</code>
fields
</li>
</ul>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/xinfo-groups/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/commands/spublish/.html | <section class="prose w-full py-12">
<h1 class="command-name">
SPUBLISH
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">SPUBLISH shardchannel message</pre>
<dl class="grid grid-cols-[auto,1fr] gap-2 mb-12">
<dt class="font-semibold text-redis-ink-900 m-0">
Available since:
</dt>
<dd class="m-0">
7.0.0
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
Time complexity:
</dt>
<dd class="m-0">
O(N) where N is the number of clients subscribed to the receiving shard channel.
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
ACL categories:
</dt>
<dd class="m-0">
<code>
@pubsub
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@fast
</code>
<span class="mr-1 last:hidden">
,
</span>
</dd>
</dl>
<p>
Posts a message to the given shard channel.
</p>
<p>
In Redis Cluster, shard channels are assigned to slots by the same algorithm used to assign keys to slots.
A shard message must be sent to a node that own the slot the shard channel is hashed to.
The cluster makes sure that published shard messages are forwarded to all the node in the shard, so clients can subscribe to a shard channel by connecting to any one of the nodes in the shard.
</p>
<p>
For more information about sharded pubsub, see
<a href="/docs/latest/develop/interact/pubsub/#sharded-pubsub">
Sharded Pubsub
</a>
.
</p>
<h2 id="examples">
Examples
</h2>
<p>
For example the following command publish to channel
<code>
orders
</code>
with a subscriber already waiting for message(s).
</p>
<pre tabindex="0"><code>> spublish orders hello
(integer) 1
</code></pre>
<h2 id="resp2resp3-reply">
RESP2/RESP3 Reply
</h2>
<a href="../../develop/reference/protocol-spec#integers">
Integer reply
</a>
: the number of clients that the message was sent to. Note that in a Redis Cluster, only clients that are connected to the same node as the publishing client are included in the count
<br/>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/spublish/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/7.4/databases/connect/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Connect to a database
</h1>
<p class="text-lg -mt-5 mb-10">
Learn how to connect your application to a Redis database hosted by Redis Enterprise Software and test your connection.
</p>
<p>
After you
<a href="/docs/latest/operate/rs/7.4/clusters/new-cluster-setup/">
set up a cluster
</a>
and
<a href="/docs/latest/operate/rs/7.4/databases/create/">
create a Redis database
</a>
, you can connect to your database.
</p>
<p>
To connect to your database, you need the database endpoint, which includes the cluster name (FQDN) and the database port. To view and copy public and private endpoints for a database in the cluster, see the databaseβs
<strong>
Configuration > General
</strong>
section in the Cluster Manager UI.
</p>
<a href="/docs/latest/images/rs/screenshots/databases/config-general-endpoints.png" sdata-lightbox="/images/rs/screenshots/databases/config-general-endpoints.png">
<img alt="View public and private endpoints from the General section of the database's Configuration screen." src="/docs/latest/images/rs/screenshots/databases/config-general-endpoints.png" width="75%"/>
</a>
<p>
If you try to connect with the FQDN, and the database does not respond, try connecting with the IP address. If this succeeds, DNS is not properly configured. To set up DNS, see
<a href="/docs/latest/operate/rs/7.4/networking/cluster-dns/">
Configure cluster DNS
</a>
.
</p>
<p>
If you want to secure your connection, set up
<a href="/docs/latest/operate/rs/7.4/security/encryption/tls/">
TLS
</a>
.
</p>
<h2 id="connect-to-a-database">
Connect to a database
</h2>
<p>
Use one of the following connection methods to connect to your database:
</p>
<ul>
<li>
<p>
<a href="/docs/latest/operate/rs/7.4/references/cli-utilities/redis-cli/">
<code>
redis-cli
</code>
</a>
utility
</p>
</li>
<li>
<p>
<a href="https://redis.com/redis-enterprise/redis-insight/">
Redis Insight
</a>
</p>
</li>
<li>
<p>
<a href="/docs/latest/develop/clients/">
Redis client
</a>
for your preferred programming language
</p>
</li>
</ul>
<p>
For examples, see
<a href="/docs/latest/operate/rs/7.4/databases/connect/test-client-connectivity/">
Test client connection
</a>
.
</p>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/databases/connect/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rc/security/access-control/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Access control
</h1>
<p class="text-lg -mt-5 mb-10">
Control who can access the Redis Cloud console and databases.
</p>
<p>
Redis Cloud offers you a few different ways to control who can access and make changes to your databases.
</p>
<nav>
<a href="/docs/latest/operate/rc/security/access-control/access-management/">
Access management
</a>
<p>
Control who can make changes to your databases using the Redis Cloud console.
</p>
<a href="/docs/latest/operate/rc/security/access-control/social-login/">
Social login
</a>
<p>
Social login with Redis Cloud.
</p>
<a href="/docs/latest/operate/rc/security/access-control/multi-factor-authentication/">
Multi-factor authentication
</a>
<p>
Redis Cloud supports multi-factor authentication to reduce the risk of unauthorized Redis Cloud console access.
</p>
<a href="/docs/latest/operate/rc/security/access-control/saml-sso/">
SAML single sign-on
</a>
<p>
Redis Cloud supports both IdP-initiated and SP-initiated single sign-on (SSO) with SAML (Security Assertion Markup Language). You can use any identity provider to integrate with Redis Cloud as long as it supports the SAML protocol, or you can refer to integration guides for a few specific providers.
</p>
<a href="/docs/latest/operate/rc/security/access-control/data-access-control/">
Data access control
</a>
<p>
Control who can access your databases using the default user database password and role-based access control.
</p>
</nav>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rc/security/access-control/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/commands/monitor/.html | <section class="prose w-full py-12">
<h1 class="command-name">
MONITOR
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">MONITOR</pre>
<dl class="grid grid-cols-[auto,1fr] gap-2 mb-12">
<dt class="font-semibold text-redis-ink-900 m-0">
Available since:
</dt>
<dd class="m-0">
1.0.0
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
Time complexity:
</dt>
<dd class="m-0">
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
ACL categories:
</dt>
<dd class="m-0">
<code>
@admin
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@slow
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@dangerous
</code>
<span class="mr-1 last:hidden">
,
</span>
</dd>
</dl>
<p>
<code>
MONITOR
</code>
is a debugging command that streams back every command processed by
the Redis server.
It can help in understanding what is happening to the database.
This command can both be used via
<code>
redis-cli
</code>
and via
<code>
telnet
</code>
.
</p>
<p>
The ability to see all the requests processed by the server is useful in order
to spot bugs in an application both when using Redis as a database and as a
distributed caching system.
</p>
<pre tabindex="0"><code>$ redis-cli monitor
1339518083.107412 [0 127.0.0.1:60866] "keys" "*"
1339518087.877697 [0 127.0.0.1:60866] "dbsize"
1339518090.420270 [0 127.0.0.1:60866] "set" "x" "6"
1339518096.506257 [0 127.0.0.1:60866] "get" "x"
1339518099.363765 [0 127.0.0.1:60866] "eval" "return redis.call('set','x','7')" "0"
1339518100.363799 [0 lua] "set" "x" "7"
1339518100.544926 [0 127.0.0.1:60866] "del" "x"
</code></pre>
<p>
Use
<code>
SIGINT
</code>
(Ctrl-C) to stop a
<code>
MONITOR
</code>
stream running via
<code>
redis-cli
</code>
.
</p>
<pre tabindex="0"><code>$ telnet localhost 6379
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
MONITOR
+OK
+1339518083.107412 [0 127.0.0.1:60866] "keys" "*"
+1339518087.877697 [0 127.0.0.1:60866] "dbsize"
+1339518090.420270 [0 127.0.0.1:60866] "set" "x" "6"
+1339518096.506257 [0 127.0.0.1:60866] "get" "x"
+1339518099.363765 [0 127.0.0.1:60866] "del" "x"
+1339518100.544926 [0 127.0.0.1:60866] "get" "x"
QUIT
+OK
Connection closed by foreign host.
</code></pre>
<p>
Manually issue the
<a href="/docs/latest/commands/quit/">
<code>
QUIT
</code>
</a>
or
<a href="/docs/latest/commands/reset/">
<code>
RESET
</code>
</a>
commands to stop a
<code>
MONITOR
</code>
stream running
via
<code>
telnet
</code>
.
</p>
<h2 id="commands-not-logged-by-monitor">
Commands not logged by MONITOR
</h2>
<p>
Because of security concerns, no administrative commands are logged
by
<code>
MONITOR
</code>
's output and sensitive data is redacted in the command
<a href="/docs/latest/commands/auth/">
<code>
AUTH
</code>
</a>
.
</p>
<p>
Furthermore, the command
<a href="/docs/latest/commands/quit/">
<code>
QUIT
</code>
</a>
is also not logged.
</p>
<h2 id="cost-of-running-monitor">
Cost of running MONITOR
</h2>
<p>
Because
<code>
MONITOR
</code>
streams back
<strong>
all
</strong>
commands, its use comes at a cost.
The following (totally unscientific) benchmark numbers illustrate what the cost
of running
<code>
MONITOR
</code>
can be.
</p>
<p>
Benchmark result
<strong>
without
</strong>
<code>
MONITOR
</code>
running:
</p>
<pre tabindex="0"><code>$ src/redis-benchmark -c 10 -n 100000 -q
PING_INLINE: 101936.80 requests per second
PING_BULK: 102880.66 requests per second
SET: 95419.85 requests per second
GET: 104275.29 requests per second
INCR: 93283.58 requests per second
</code></pre>
<p>
Benchmark result
<strong>
with
</strong>
<code>
MONITOR
</code>
running (
<code>
redis-cli monitor > /dev/null
</code>
):
</p>
<pre tabindex="0"><code>$ src/redis-benchmark -c 10 -n 100000 -q
PING_INLINE: 58479.53 requests per second
PING_BULK: 59136.61 requests per second
SET: 41823.50 requests per second
GET: 45330.91 requests per second
INCR: 41771.09 requests per second
</code></pre>
<p>
In this particular case, running a single
<code>
MONITOR
</code>
client can reduce the
throughput by more than 50%.
Running more
<code>
MONITOR
</code>
clients will reduce throughput even more.
</p>
<h2 id="behavior-change-history">
Behavior change history
</h2>
<ul>
<li>
<code>
>= 6.0.0
</code>
:
<a href="/docs/latest/commands/auth/">
<code>
AUTH
</code>
</a>
excluded from the command's output.
</li>
<li>
<code>
>= 6.2.0
</code>
: "
<a href="/docs/latest/commands/reset/">
<code>
RESET
</code>
</a>
can be called to exit monitor mode.
</li>
<li>
<code>
>= 6.2.4
</code>
: "
<a href="/docs/latest/commands/auth/">
<code>
AUTH
</code>
</a>
,
<a href="/docs/latest/commands/hello/">
<code>
HELLO
</code>
</a>
,
<a href="/docs/latest/commands/eval/">
<code>
EVAL
</code>
</a>
,
<a href="/docs/latest/commands/eval_ro/">
<code>
EVAL_RO
</code>
</a>
,
<a href="/docs/latest/commands/evalsha/">
<code>
EVALSHA
</code>
</a>
and
<a href="/docs/latest/commands/evalsha_ro/">
<code>
EVALSHA_RO
</code>
</a>
included in the command's output.
</li>
</ul>
<h2 id="resp2resp3-reply">
RESP2/RESP3 Reply
</h2>
<strong>
Non-standard return value
</strong>
. Dumps the received commands in an infinite flow.
<br/>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/monitor/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/kubernetes/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Redis Enterprise for Kubernetes
</h1>
<p class="text-lg -mt-5 mb-10">
The Redis Enterprise operators allows you to use Redis Enterprise for Kubernetes.
</p>
<p>
Kubernetes provides enterprise orchestration of containers and has been widely adopted. Redis Enterprise for Kubernetes provides a simple way to get a Redis Enterprise cluster on Kubernetes and enables more complex deployment scenarios.
</p>
<nav>
<a href="/docs/latest/operate/kubernetes/architecture/">
Redis Enterprise for Kubernetes architecture
</a>
<p>
Overview of the architecture and components of Redis Enterprise for Kubernetes.
</p>
<a href="/docs/latest/operate/kubernetes/deployment/">
Deployment
</a>
<p>
This section lists the different ways to set up and run Redis Enterprise for Kubernetes. You can deploy on variety of Kubernetes distributions both on-prem and in the cloud via our Redis Enterprise operator for Kubernetes.
</p>
<a href="/docs/latest/operate/kubernetes/upgrade/">
Upgrade Redis Enterprise for Kubernetes
</a>
<p>
Information about upgrading your Redis Enterprise cluster on Kubernetes.
</p>
<a href="/docs/latest/operate/kubernetes/re-clusters/">
Redis Enterprise clusters (REC)
</a>
<p>
Articles to help you manage your Redis Enterprise clusters (REC).
</p>
<a href="/docs/latest/operate/kubernetes/re-databases/">
Redis Enterprise databases (REDB)
</a>
<p>
Articles to help you manage your Redis Enterprise databases (REDBs).
</p>
<a href="/docs/latest/operate/kubernetes/active-active/">
Active-Active databases
</a>
<p>
Content related to Active-Active Redis Enterprise databases for Kubernetes.
</p>
<a href="/docs/latest/operate/kubernetes/networking/">
Networking
</a>
<br/>
<br/>
<a href="/docs/latest/operate/kubernetes/security/">
Security
</a>
<p>
Security settings and configuration for Redis Enterprise for Kubernetes
</p>
<a href="/docs/latest/operate/kubernetes/logs/">
Redis Enterprise Software logs on Kubernetes
</a>
<p>
This section provides information about how logs are stored and accessed.
</p>
<a href="/docs/latest/operate/kubernetes/delete-custom-resources/">
Delete custom resources
</a>
<p>
This article explains how to delete Redis Enterprise clusters and Redis Enterprise databases from your Kubernetes environment.
</p>
<a href="/docs/latest/operate/kubernetes/recommendations/">
Configuration recommendations
</a>
<p>
Settings and configuration recommendations for your Redis Enterprise deployment.
</p>
<a href="/docs/latest/operate/kubernetes/reference/">
Reference
</a>
<p>
Reference material for the operator, cluster, and database deployment options.
</p>
<a href="/docs/latest/operate/kubernetes/release-notes/">
Redis Enterprise Software for Kubernetes release notes
</a>
<p>
Redis Enterprise Software for Kubernetes operator release notes.
</p>
<a href="/docs/latest/operate/kubernetes/faqs/">
Redis Enterprise for Kubernetes FAQs
</a>
<br/>
<br/>
<a href="/docs/latest/operate/kubernetes/kubernetes-archive/">
Archive
</a>
<p>
Describes where to view the archive of Redis Enterprise for Kubernetes documentation.
</p>
</nav>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/kubernetes/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/security/access-control/create-db-roles/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Create roles with database access only
</h1>
<p class="text-lg -mt-5 mb-10">
Create roles with database access only.
</p>
<p>
Roles with database access grant the ability to access and interact with a database's data. Database access privileges are determined by defining
<a href="/docs/latest/operate/rs/security/access-control/redis-acl-overview/">
Redis ACLs
</a>
and adding them to roles.
</p>
<p>
To create a role that grants database access without granting access to the Redis Enterprise Cluster Manager UI and REST API:
</p>
<ol>
<li>
<p>
<a href="#define-redis-acls">
Define Redis ACLs
</a>
that determine database access privileges.
</p>
</li>
<li>
<p>
<a href="#create-roles-with-acls">
Create a role with ACLs
</a>
added and leave the
<strong>
Cluster management role
</strong>
as
<strong>
None
</strong>
.
</p>
</li>
</ol>
<h2 id="define-redis-acls">
Define Redis ACLs
</h2>
<p>
To define a Redis ACL rule that you can assign to a role:
</p>
<ol>
<li>
<p>
From
<strong>
Access Control > Redis ACLs
</strong>
, you can either:
</p>
<ul>
<li>
<p>
Point to a Redis ACL and select
<a href="/docs/latest/images/rs/buttons/edit-button.png#no-click" sdata-lightbox="/images/rs/buttons/edit-button.png#no-click">
<img alt="The Edit button" class="inline" src="/docs/latest/images/rs/buttons/edit-button.png#no-click" width="25px"/>
</a>
to edit an existing Redis ACL.
</p>
</li>
<li>
<p>
Select
<strong>
+ Add Redis ACL
</strong>
to create a new Redis ACL.
</p>
</li>
</ul>
</li>
<li>
<p>
Enter a descriptive name for the Redis ACL. This will be used to associate the ACL rule with the role.
</p>
</li>
<li>
<p>
Define the ACL rule. For more information about Redis ACL rules and syntax, see the
<a href="/docs/latest/operate/rs/security/access-control/redis-acl-overview/">
Redis ACL overview
</a>
.
</p>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Note:
</div>
The
<strong>
ACL builder
</strong>
does not support selectors and key permissions. Use
<strong>
Free text command
</strong>
to manually define them instead.
</div>
</div>
</li>
<li>
<p>
Select
<strong>
Save
</strong>
.
</p>
</li>
</ol>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Note:
</div>
For multi-key commands on multi-slot keys, the return value is
<code>
failure
</code>
, but the command runs on the keys that are allowed.
</div>
</div>
<h2 id="create-roles-with-acls">
Create roles with ACLs
</h2>
<p>
To create a role that grants database access to users but blocks access to the Redis Enterprise Cluster Manager UI and REST API, set the
<strong>
Cluster management role
</strong>
to
<strong>
None
</strong>
.
</p>
<p>
To define a role for database access:
</p>
<ol>
<li>
<p>
From
<strong>
Access Control
</strong>
>
<strong>
Roles
</strong>
, you can:
</p>
<ul>
<li>
<p>
Point to a role and select
<a href="/docs/latest/images/rs/buttons/edit-button.png#no-click" sdata-lightbox="/images/rs/buttons/edit-button.png#no-click">
<img alt="The Edit button" class="inline" src="/docs/latest/images/rs/buttons/edit-button.png#no-click" width="25px"/>
</a>
to edit an existing role.
</p>
</li>
<li>
<p>
Select
<strong>
+ Add role
</strong>
to create a new role.
</p>
</li>
</ul>
<a href="/docs/latest/images/rs/access-control-role-panel.png" sdata-lightbox="/images/rs/access-control-role-panel.png">
<img alt="Add role with name" src="/docs/latest/images/rs/access-control-role-panel.png"/>
</a>
</li>
<li>
<p>
Enter a descriptive name for the role. This will be used to reference the role when configuring users.
</p>
</li>
<li>
<p>
Leave
<strong>
Cluster management role
</strong>
as the default
<strong>
None
</strong>
.
</p>
<a href="/docs/latest/images/rs/access-control-role-name.png" sdata-lightbox="/images/rs/access-control-role-name.png">
<img alt="Add role with name" src="/docs/latest/images/rs/access-control-role-name.png"/>
</a>
</li>
<li>
<p>
Select
<strong>
+ Add ACL
</strong>
.
</p>
<a href="/docs/latest/images/rs/access-control-role-acl.png" sdata-lightbox="/images/rs/access-control-role-acl.png">
<img alt="Add role database acl" src="/docs/latest/images/rs/access-control-role-acl.png"/>
</a>
</li>
<li>
<p>
Choose a Redis ACL and databases to associate with the role.
</p>
<a href="/docs/latest/images/rs/screenshots/access-control/access-control-role-databases.png" sdata-lightbox="/images/rs/screenshots/access-control/access-control-role-databases.png">
<img alt="Add databases to access" src="/docs/latest/images/rs/screenshots/access-control/access-control-role-databases.png"/>
</a>
</li>
<li>
<p>
Select the check mark
<a href="/docs/latest/images/rs/buttons/checkmark-button.png#no-click" sdata-lightbox="/images/rs/buttons/checkmark-button.png#no-click">
<img alt="The Check button" class="inline" src="/docs/latest/images/rs/buttons/checkmark-button.png#no-click" width="25px"/>
</a>
to confirm.
</p>
</li>
<li>
<p>
Select
<strong>
Save
</strong>
.
</p>
<a href="/docs/latest/images/rs/access-control-role-save.png" sdata-lightbox="/images/rs/access-control-role-save.png">
<img alt="Add databases to access" src="/docs/latest/images/rs/access-control-role-save.png"/>
</a>
</li>
</ol>
<p>
You can
<a href="/docs/latest/operate/rs/security/access-control/create-users/#assign-roles-to-users">
assign the new role to users
</a>
to grant database access.
</p>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/security/access-control/create-db-roles/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/kubernetes/faqs/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Redis Enterprise for Kubernetes FAQs
</h1>
<p>
Here are some frequently asked questions about Redis Enterprise on integration platforms.
</p>
<h2 id="what-is-an-operator">
What is an Operator?
</h2>
<p>
An operator is a
<a href="https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources#custom-controllers">
Kubernetes custom controller
</a>
which extends the native K8s API. Refer to the article
<a href="/docs/latest/operate/kubernetes/architecture/">
Redis Enterprise K8s Operator-based deployments β Overview
</a>
.
</p>
<h2 id="does-redis-enterprise-operator-support-multiple-recs-per-namespace">
Does Redis Enterprise operator support multiple RECs per namespace?
</h2>
<p>
Redis Enterprise for Kubernetes may only deploy a single Redis Enterprise cluster (REC) per
<a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/">
namespace
</a>
. Each REC can run multiple databases while maintaining high capacity and performance.
</p>
<h2 id="do-i-need-to-deploy-a-redis-enterprise-operator-per-namespace">
Do I need to deploy a Redis Enterprise operator per namespace?
</h2>
<p>
Yes, one operator per namespace, each managing a single Redis Enterprise cluster.
Each REC can run multiple databases while maintaining high capacity and performance.
</p>
<h2 id="how-can-i-see-the-custom-resource-definitions-crds-created-for-my-redis-enterprise-cluster">
How can I see the custom resource definitions (CRDs) created for my Redis Enterprise cluster?
</h2>
<p>
Run the following:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">kubectl get rec
</span></span><span class="line"><span class="cl">kubectl describe rec <my-cluster-name>
</span></span></code></pre>
</div>
<h2 id="how-can-i-change-the-redis-enterprise-cluster-admin-user-password">
How can I change the Redis Enterprise cluster admin user password?
</h2>
<p>
The cluster admin user password is created by the operator during the deployment of the Redis Enterprise cluster (REC) and is stored in a Kubernetes
<a href="https://kubernetes.io/docs/concepts/configuration/secret/">
secret
</a>
.
</p>
<p>
See
<a href="/docs/latest/operate/kubernetes/security/manage-rec-credentials/">
Manage REC credentials
</a>
for instructions on changing the admin password.
</p>
<h2 id="how-is-using-redis-enterprise-operator-superior-to-using-helm-charts">
How is using Redis Enterprise operator superior to using Helm charts?
</h2>
<p>
While
<a href="https://helm.sh/docs/topics/charts/">
Helm charts
</a>
help automate multi-resource deployments, they do not provide the lifecycle management and lack many of the benefits provided by the operator:
</p>
<ul>
<li>
Operators are a K8s standard, while Helm is a proprietary tool
<ul>
<li>
Using operators means better packaging for different Kubernetes deployments and distributions, as Helm is not supported in a straightforward way everywhere
</li>
</ul>
</li>
<li>
Operators allow full control over the Redis Enterprise cluster lifecycle
<ul>
<li>
Weβve experienced difficulties managing the state and lifecycle of the application through Helm, as it essentially only allows to determine the resources being deployed, which is a problem when upgrading and evolve the Redis Enterprise Cluster settings
</li>
</ul>
</li>
<li>
Operators support advanced flows which would otherwise require using an additional third party product
</li>
</ul>
<h2 id="how-to-connect-to-the-redis-enterprise-cluster-user-interface">
How to connect to the Redis Enterprise cluster user interface
</h2>
<p>
Create a
<a href="https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#port-forward">
port forwarding
</a>
rule to expose the cluster user interface (UI) port. For example, when the default port 8443 is used, run:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">kubectl port-forward βnamespace <namespace> service/<name>-cluster-ui 8443:8443
</span></span></code></pre>
</div>
<p>
Connect to the UI by pointing your browser to
<code>
https://localhost:8443
</code>
</p>
<h2 id="how-should-i-size-redis-enterprise-cluster-nodes">
How should I size Redis Enterprise cluster nodes?
</h2>
<p>
For nodes hosting the Redis Enterprise cluster
<a href="https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/">
statefulSet
</a>
<a href="https://kubernetes.io/docs/concepts/workloads/pods/">
pods
</a>
, follow the guidelines provided for Redis Enterprise in the
<a href="/docs/latest/operate/rs/installing-upgrading/install/plan-deployment/hardware-requirements/">
hardware requirements
</a>
.
</p>
<p>
For additional information please also refer to
<a href="/docs/latest/operate/kubernetes/recommendations/persistent-volumes/">
Kubernetes operator deployment β persistent volumes
</a>
.
</p>
<h2 id="how-to-retrieve-the-usernamepassword-for-a-redis-enterprise-cluster">
How to retrieve the username/password for a Redis Enterprise Cluster?
</h2>
<p>
The Redis Enterprise cluster stores the username/password of the UI in a K8s
<a href="https://kubernetes.io/docs/concepts/configuration/secret/">
secret
</a>
.
</p>
<p>
Find the secret by retrieving secrets and locating one of type
<a href="https://kubernetes.io/docs/concepts/workloads/pods/">
Opaque
</a>
with a name identical or containing your Redis Enterprise cluster name.
</p>
<p>
For example, run:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">kubectl get secrets
</span></span></code></pre>
</div>
<p>
A possible response may look like this:
</p>
<table>
<thead>
<tr>
<th>
NAME
</th>
<th>
TYPE
</th>
<th>
DATA
</th>
<th>
AGE
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
redis-enterprise-cluster
</td>
<td>
Opaque
</td>
<td>
2
</td>
<td>
5d
</td>
</tr>
</tbody>
</table>
<p>
To retrieve the secret run:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">kubectl get secret redis-enterprise-cluster -o yaml
</span></span></code></pre>
</div>
<p>
A possible response may look like this:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">apiVersion</span><span class="p">:</span><span class="w"> </span><span class="l">v1</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">data</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">password</span><span class="p">:</span><span class="w"> </span><span class="l">Q2h5N1BBY28=</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">username</span><span class="p">:</span><span class="w"> </span><span class="l">cmVkaXNsYWJzLnNi</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">kind</span><span class="p">:</span><span class="w"> </span><span class="l">Secret</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">metadata</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">creationTimestamp</span><span class="p">:</span><span class="w"> </span><span class="ld">2018-09-03T14:06:39Z</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">labels</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">app</span><span class="p">:</span><span class="w"> </span><span class="l">redis-enterprise</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">redis.io/cluster</span><span class="p">:</span><span class="w"> </span><span class="l">test</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l">redis-enterprise-cluster</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">namespace</span><span class="p">:</span><span class="w"> </span><span class="l">redis</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">ownerReferences</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">β apiVersion</span><span class="p">:</span><span class="w"> </span><span class="l">app.redislabs.com/v1alpha1</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">blockOwnerDeletion</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">controller</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">kind</span><span class="p">:</span><span class="w"> </span><span class="l">RedisEnterpriseCluster</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l">test</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">uid</span><span class="p">:</span><span class="w"> </span><span class="l">8b247469-c715-11e8-a5d5-0a778671fc2e</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">resourceVersion</span><span class="p">:</span><span class="w"> </span><span class="l">β911969β</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">selfLink</span><span class="p">:</span><span class="w"> </span><span class="l">/api/v1/namespaces/redis/secrets/redis-enterprise-cluster</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">uid</span><span class="p">:</span><span class="w"> </span><span class="l">8c4ff52e-c715-11e8-80f5-02cc4fca9682</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l">Opaque</span><span class="w">
</span></span></span></code></pre>
</div>
<p>
Next, decode, for example, the password field. Run:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl"><span class="nb">echo</span> <span class="s2">"Q2h5N1BBY28="</span> <span class="p">|</span> base64 β-decode
</span></span></code></pre>
</div>
<h2 id="how-to-retrieve-the-usernamepassword-for-a-redis-enterprise-cluster-through-the-openshift-console">
How to retrieve the username/password for a Redis Enterprise Cluster through the OpenShift Console?
</h2>
<p>
To retrieve your password, navigate to the OpenShift management console, select your project name, go to Resources->Secrets->your_cluster_name
</p>
<p>
Retrieve your password by selecting βReveal Secret.β
<a href="/docs/latest/images/rs/openshift-password-retrieval.png" sdata-lightbox="/images/rs/openshift-password-retrieval.png">
<img src="/docs/latest/images/rs/openshift-password-retrieval.png"/>
</a>
</p>
<h2 id="what-capabilities-privileges-and-permissions-are-defined-by-the-security-context-constraint-scc-yaml">
What capabilities, privileges and permissions are defined by the Security Context Constraint (SCC) yaml?
</h2>
<p>
The
<code>
scc.yaml
</code>
file is defined like this:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">kind</span><span class="p">:</span><span class="w"> </span><span class="l">SecurityContextConstraints</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">apiVersion</span><span class="p">:</span><span class="w"> </span><span class="l">security.openshift.io/v1</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">metadata</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l">redis-enterprise-scc</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">allowPrivilegedContainer</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">allowedCapabilities</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span>- <span class="l">SYS_RESOURCE</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">runAsUser</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l">MustRunAs</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">uid</span><span class="p">:</span><span class="w"> </span><span class="m">1001</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">FSGroup</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l">MustRunAs</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">ranges</span><span class="p">:</span><span class="w"> </span><span class="m">1001</span><span class="p">,</span><span class="m">1001</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">seLinuxContext</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l">RunAsAny</span><span class="w">
</span></span></span></code></pre>
</div>
<p>
(
<a href="https://github.com/RedisLabs/redis-enterprise-k8s-docs/blob/master/openshift/scc.yaml">
latest version on GitHub
</a>
)
</p>
<p>
(
<a href="https://github.com/RedisLabs/redis-enterprise-k8s-docs/tags">
latest version on GitHub
</a>
)
</p>
<p>
The SYS_RESOURCE capability is required by the Redis Enterprise cluster (REC) container so that REC can set correct out of memory (OOM) scores to its processes inside the container.
Also, some of the REC services must be able to increase default resource limits, especially the number of open file descriptors.
</p>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Note:
</div>
<ul>
<li>
Removing NET_RAW blocks 'ping' from being used on the solution containers.
</li>
<li>
These changes were made as of release 5.4.6-1183 to better align the deployment with container and Kubernetes security best practices:
<ul>
<li>
The NET_RAW capability requirement in PSP was removed.
</li>
<li>
The allowPrivilegeEscalation is set to 'false' by default.
</li>
</ul>
</li>
</ul>
</div>
</div>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/kubernetes/faqs/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/integrate/redis-data-integration/installation/install-vm/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Install on VMs
</h1>
<p class="text-lg -mt-5 mb-10">
Learn how to install RDI on one or more VMs
</p>
<p>
This guide explains how to install Redis Data Integration (RDI) on one or more VMs and integrate it with
your source database. You can also
<a href="/docs/latest/integrate/redis-data-integration/installation/install-k8s/">
Install RDI on Kubernetes
</a>
.
</p>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Note:
</div>
We recommend you use RDI v1.4.0. The previous version, RDI v1.2.8,
will not work on VMs where IPv6 is disabled. This problem is solved with version 1.4.0.
</div>
</div>
<h2 id="install-rdi-on-vms">
Install RDI on VMs
</h2>
<p>
You would normally install RDI on two VMs for high availability (HA) but you can also install
one just one VM if you don't need this. For example, you might not need HA during
development and testing.
</p>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Note:
</div>
<p>
You can't install RDI on a host where a Redis Enterprise cluster
is also installed, due to incompatible network rules. If you want to install RDI on a
host that you have previously used for Redis Enterprise then you must
use
<a href="https://www.netfilter.org/projects/iptables/index.html">
<code>
iptables
</code>
</a>
to
"clean" the host before installation with the following command line:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"> sudo iptables-save <span class="p">|</span> awk <span class="s1">'/^[*]/ { print $1 }
</span></span></span><span class="line"><span class="cl"><span class="s1"> /^:[A-Z]+ [^-]/ { print $1 " ACCEPT" ; }
</span></span></span><span class="line"><span class="cl"><span class="s1"> /COMMIT/ { print $0; }'</span> <span class="p">|</span> sudo iptables-restore
</span></span></code></pre>
</div>
<p>
You may encounter problems if you use
<code>
iptables
</code>
v1.6.1 and earlier in
<code>
nftables
</code>
mode. Use
<code>
iptables
</code>
versions later than v1.6.1 or enable the
<code>
iptables
</code>
legacy mode with the following commands:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">update-alternatives --set iptables /usr/sbin/iptables-legacy
</span></span><span class="line"><span class="cl">update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy
</span></span></code></pre>
</div>
<p>
Also,
<code>
iptables
</code>
versions 1.8.0-1.8.4 have known issues that can prevent RDI
from working, especially on RHEL 8. Ideally, use
<code>
iptables
</code>
v1.8.8, which is
known to work correctly with RDI.
</p>
</div>
</div>
<p>
The supported OS versions for RDI are:
</p>
<ul>
<li>
RHEL 8 & 9
</li>
<li>
Ubuntu 18.04 & 20.04
</li>
</ul>
<p>
You must run the RDI installer as a privileged user because it installs
<a href="https://containerd.io/">
containerd
</a>
and registers services. However, you don't
need any special privileges to run RDI processes for normal operation.
</p>
<p>
RDI has a few
requirements for cloud VMs that you must implement before running the
RDI installer, or else installation will fail. The following sections
give full pre-installation instructions for
<a href="#firewall-rhel">
RHEL
</a>
and
<a href="#firewall-ubuntu">
Ubuntu
</a>
.
</p>
<h3 id="firewall-rhel">
RHEL
</h3>
<p>
We recommend you turn off
<a href="https://firewalld.org/documentation/">
<code>
firewalld
</code>
</a>
before installation using the command:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">systemctl disable firewalld --now
</span></span></code></pre>
</div>
<p>
However, if you do need to use
<code>
firewalld
</code>
, you must add the following rules:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">firewall-cmd --permanent --add-port<span class="o">=</span>6443/tcp <span class="c1">#apiserver</span>
</span></span><span class="line"><span class="cl">firewall-cmd --permanent --zone<span class="o">=</span>trusted --add-source<span class="o">=</span>10.42.0.0/16 <span class="c1">#pods</span>
</span></span><span class="line"><span class="cl">firewall-cmd --permanent --zone<span class="o">=</span>trusted --add-source<span class="o">=</span>10.43.0.0/16 <span class="c1">#services</span>
</span></span><span class="line"><span class="cl">firewall-cmd --reload
</span></span></code></pre>
</div>
<p>
You should also add
<a href="https://firewalld.org/documentation/howto/open-a-port-or-service.html">
port rules
</a>
for all the
<a href="/docs/latest/integrate/redis-data-integration/reference/ports/">
RDI services
</a>
you intend to use:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">firewall-cmd --permanent --add-port<span class="o">=</span>8080/tcp <span class="c1"># (Required) rdi-operator/rdi-api</span>
</span></span><span class="line"><span class="cl">firewall-cmd --permanent --add-port<span class="o">=</span>9090/tcp <span class="c1"># vm-dis-reloader</span>
</span></span><span class="line"><span class="cl">firewall-cmd --permanent --add-port<span class="o">=</span>9092/tcp <span class="c1"># prometheus-service</span>
</span></span><span class="line"><span class="cl">firewall-cmd --permanent --add-port<span class="o">=</span>9121/tcp <span class="c1"># rdi-metric-exporter</span>
</span></span></code></pre>
</div>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Note:
</div>
You may also need to add similar rules to open other ports if your setup requires them.
</div>
</div>
<p>
If you have
<code>
nm-cloud-setup.service
</code>
enabled, you must disable it and reboot the
node with the following commands:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">systemctl disable nm-cloud-setup.service nm-cloud-setup.timer
</span></span><span class="line"><span class="cl">reboot
</span></span></code></pre>
</div>
<h3 id="firewall-ubuntu">
Ubuntu
</h3>
<p>
We recommend you turn off
<a href="https://wiki.ubuntu.com/UncomplicatedFirewall">
Uncomplicated Firewall
</a>
(
<code>
ufw
</code>
)
before installation with the command:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">ufw disable
</span></span></code></pre>
</div>
<p>
However, if you do need to use
<code>
ufw
</code>
, you must add the following rules:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">ufw allow 6443/tcp <span class="c1">#apiserver</span>
</span></span><span class="line"><span class="cl">ufw allow from 10.42.0.0/16 to any <span class="c1">#pods</span>
</span></span><span class="line"><span class="cl">ufw allow from 10.43.0.0/16 to any <span class="c1">#services</span>
</span></span></code></pre>
</div>
<p>
You should also add
<a href="https://ubuntu.com/server/docs/firewalls">
port rules
</a>
for all the
<a href="/docs/latest/integrate/redis-data-integration/reference/ports/">
RDI services
</a>
you intend to use:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">ufw allow 8080/tcp <span class="c1"># (Required) rdi-operator/rdi-api</span>
</span></span><span class="line"><span class="cl">ufw allow 9090/tcp <span class="c1"># vm-dis-reloader</span>
</span></span><span class="line"><span class="cl">ufw allow 9092/tcp <span class="c1"># prometheus-service</span>
</span></span><span class="line"><span class="cl">ufw allow 9121/tcp <span class="c1"># rdi-metric-exporter</span>
</span></span></code></pre>
</div>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Note:
</div>
You may also need to add similar rules to open other ports if your setup requires them.
</div>
</div>
<h2 id="hardware-sizing">
Hardware sizing
</h2>
<p>
RDI is mainly CPU and network bound.
Each of the RDI VMs should have:
</p>
<ul>
<li>
CPU: A minimum of 4 CPU cores. You should consider adding
2-6 extra cores on top of this if your dataset is big and you want to ingest the
baseline snapshot as fast as possible.
</li>
<li>
RAM: 2GB
</li>
<li>
Disk: 25GB of disk (this includes the OS footprint)
</li>
<li>
10GB or more network interface
</li>
</ul>
<h2 id="installation-steps">
Installation steps
</h2>
<p>
Follow the steps below for each of your VMs:
</p>
<ol>
<li>
<p>
Download the RDI installer from the
<a href="https://cloud.redis.io/#/rlec-downloads">
Redis download center
</a>
(under the
<em>
Modules, Tools & Integration
</em>
dropdown)
and extract it to your preferred installation folder.
</p>
</li>
<li>
<p>
Go to the installation folder:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="nb">cd</span> rdi_install/<span class="nv">$RDI_VERSION</span>
</span></span></code></pre>
</div>
</li>
<li>
<p>
Run the installer as a privileged user:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">sudo ./install.sh
</span></span></code></pre>
</div>
</li>
</ol>
<p>
RDI uses a database on your Redis Enterprise cluster to store its state
information.
<em>
This requires Redis Enterprise v6.4 or greater
</em>
.
</p>
<p>
The installer gives you instructions to help you create secrets and create your pipeline.
It will ask you for cluster admin credentials during installation. You should supply
these if you want the installer to create the RDI database for you.
</p>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Note:
</div>
The installer does not create the RDI Redis database with
<a href="https://en.wikipedia.org/wiki/Transport_Layer_Security">
TLS
</a>
/
<a href="https://en.wikipedia.org/wiki/Mutual_authentication#mTLS">
mTLS
</a>
.
If you want to use TLS or other advanced options then you must create the Redis database
yourself using the Redis Enterprise console.
</div>
</div>
<p>
If you donβt want the installation to create the RDI database for you:
</p>
<ul>
<li>
Use the Redis console to create a database with 250MB RAM with 1 primary and 1 replica.
</li>
<li>
If you are deploying RDI for a production environment then secure this database with a password
and TLS.
</li>
<li>
Provide the installation with the required RDI database details.
</li>
</ul>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Note:
</div>
<p>
If you specify
<code>
localhost
</code>
as the address of the RDI database server during
installation then the connection will fail if the actual IP address changes for the local
VM. For this reason, we recommend that you don't use
<code>
localhost
</code>
for the address. However,
if you do encounter this problem, you can fix it using the following commands on the VM
that is running RDI itself:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">sudo k3s kubectl delete nodes --all
</span></span><span class="line"><span class="cl">sudo service k3s restart
</span></span></code></pre>
</div>
</div>
</div>
<p>
After the installation is finished, RDI is ready for use.
</p>
<h2 id="silent-installation">
"Silent" installation
</h2>
<p>
You can use the
<a href="#installation-steps">
installer script
</a>
or the
<a href="/docs/latest/integrate/redis-data-integration/reference/cli/redis-di-install/">
<code>
redis-di install
</code>
</a>
command with the
<code>
--file
</code>
option (or the shorter version
<code>
-f
</code>
) to supply answers
to the installer's questions automatically using properties from a
<a href="https://toml.io/en/">
TOML
</a>
file:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">./install.sh --file silent.toml
</span></span></code></pre>
</div>
<h3 id="silent-install-example">
Silent install example
</h3>
<p>
The following TOML file example shows the properties for a typical
silent install configuration:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-toml" data-lang="toml"><span class="line"><span class="cl"><span class="nx">title</span> <span class="p">=</span> <span class="s2">"RDI Silent Installer Config"</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="nx">scaffold</span> <span class="p">=</span> <span class="kc">true</span>
</span></span><span class="line"><span class="cl"><span class="nx">deploy_directory</span> <span class="p">=</span> <span class="s2">"/opt/rdi/config"</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c"># If you are *not* using an existing RDI database and you want</span>
</span></span><span class="line"><span class="cl"><span class="c"># the installer to create one then remove the properties in this</span>
</span></span><span class="line"><span class="cl"><span class="c"># section, apart from :</span>
</span></span><span class="line"><span class="cl"><span class="c"># - `password`</span>
</span></span><span class="line"><span class="cl"><span class="c"># - `use_existing_rdi` - set this to `false`</span>
</span></span><span class="line"><span class="cl"><span class="c"># Also, uncomment the [rdi.cluster] section below.</span>
</span></span><span class="line"><span class="cl"><span class="p">[</span><span class="nx">rdi</span><span class="p">.</span><span class="nx">database</span><span class="p">]</span>
</span></span><span class="line"><span class="cl"><span class="nx">host</span> <span class="p">=</span> <span class="s2">"localhost"</span>
</span></span><span class="line"><span class="cl"><span class="nx">port</span> <span class="p">=</span> <span class="mi">12001</span>
</span></span><span class="line"><span class="cl"><span class="nx">username</span> <span class="p">=</span> <span class="s2">"username"</span>
</span></span><span class="line"><span class="cl"><span class="nx">password</span> <span class="p">=</span> <span class="s2">"password"</span>
</span></span><span class="line"><span class="cl"><span class="nx">use_existing_rdi</span> <span class="p">=</span> <span class="kc">true</span>
</span></span><span class="line"><span class="cl"><span class="nx">ssl</span> <span class="p">=</span> <span class="kc">true</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c"># Uncomment this section and remove properties from the</span>
</span></span><span class="line"><span class="cl"><span class="c"># [rdi.database] section as described above if you</span>
</span></span><span class="line"><span class="cl"><span class="c"># are *not* using an existing RDI database and you want</span>
</span></span><span class="line"><span class="cl"><span class="c"># the installer to create one.</span>
</span></span><span class="line"><span class="cl"><span class="c"># [rdi.cluster]</span>
</span></span><span class="line"><span class="cl"><span class="c"># host = "localhost"</span>
</span></span><span class="line"><span class="cl"><span class="c"># port = 9443</span>
</span></span><span class="line"><span class="cl"><span class="c"># username = "username"</span>
</span></span><span class="line"><span class="cl"><span class="c"># password = "password"</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c"># Uncomment the properties in this section only if the RDI</span>
</span></span><span class="line"><span class="cl"><span class="c"># database uses TLS/mTLS.</span>
</span></span><span class="line"><span class="cl"><span class="c"># [rdi.database.certificates]</span>
</span></span><span class="line"><span class="cl"><span class="c"># ca = "/home/ubuntu/rdi/certs/ca.crt"</span>
</span></span><span class="line"><span class="cl"><span class="c"># cert = "/home/ubuntu/rdi/certs/client.crt"</span>
</span></span><span class="line"><span class="cl"><span class="c"># key = "/home/ubuntu/rdi/certs/client.key"</span>
</span></span><span class="line"><span class="cl"><span class="c"># passphrase = "foobar"</span>
</span></span></code></pre>
</div>
<p>
The sections below describe the properties in more detail.
</p>
<h3 id="silent-install-properties">
Silent install properties
</h3>
<h4 id="root">
Root
</h4>
<table>
<thead>
<tr>
<th>
Property
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>
title
</code>
</td>
<td>
Text to identify the file. RDI doesn't use use this, so you can use any text you like.
</td>
</tr>
<tr>
<td>
<code>
high_availability
</code>
</td>
<td>
Do you want to enable replication on the RDI database (true/false)? You should only use this if you ask the installer to create the RDI database for you.
</td>
</tr>
<tr>
<td>
<code>
scaffold
</code>
</td>
<td>
Do you want to enable
<a href="/docs/latest/integrate/redis-data-integration/reference/cli/redis-di-scaffold/">
scaffolding
</a>
during the install? (true/false)
</td>
</tr>
<tr>
<td>
<code>
db_index
</code>
</td>
<td>
Integer to specify the source database type for scaffolding. The options are 2 (MySQL/MariaDB), 3 (Oracle), 4 (PostgreSQL), and 5 (SQL Server).
</td>
</tr>
<tr>
<td>
<code>
deploy_directory
</code>
</td>
<td>
Path to the directory where you want to store the RDI configuration.
</td>
</tr>
</tbody>
</table>
<h4 id="rdidatabase">
<code>
rdi.database
</code>
</h4>
<p>
Use the properties in this section if you want to use an existing RDI database.
See
<a href="#rdicluster">
<code>
rdi.cluster
</code>
</a>
below if you want the installer to create a new
RDI database. However, you should still supply the
<code>
password
</code>
in this
section and set
<code>
use_existing_rdi
</code>
to
<code>
false
</code>
if the installer creates the
database.
</p>
<table>
<thead>
<tr>
<th>
Property
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>
host
</code>
</td>
<td>
Hostname for the Redis database to store RDI state.
</td>
</tr>
<tr>
<td>
<code>
port
</code>
</td>
<td>
Port for the RDI database.
</td>
</tr>
<tr>
<td>
<code>
username
</code>
</td>
<td>
Username for the RDI database.
</td>
</tr>
<tr>
<td>
<code>
password
</code>
</td>
<td>
Password for the RDI database.
</td>
</tr>
<tr>
<td>
<code>
use_existing_rdi
</code>
</td>
<td>
Do you want to use an existing RDI instance (true) or create a new one (false)? If you enable SSL (see the property below), this will be set to true, overriding the value you specify here.
</td>
</tr>
<tr>
<td>
<code>
ssl
</code>
</td>
<td>
Is SSL enabled for the RDI database (true/false)? If this is false then RDI will ignore the settings in the
<a href="#rdidatabasecertificates">
<code>
rdi.database.certificates
</code>
</a>
section.
</td>
</tr>
</tbody>
</table>
<h4 id="rdicluster">
<code>
rdi.cluster
</code>
</h4>
<p>
Use the properties in this section if you are
<em>
not
</em>
using an existing RDI database
and you want the installer to create one.
See
<a href="#rdidatabase">
<code>
rdi.database
</code>
</a>
above if you want to use an existing RDI database.
</p>
<table>
<thead>
<tr>
<th>
Property
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>
host
</code>
</td>
<td>
Hostname of the Redis cluster to use for RDI.
</td>
</tr>
<tr>
<td>
<code>
port
</code>
</td>
<td>
Port for the cluster.
</td>
</tr>
<tr>
<td>
<code>
username
</code>
</td>
<td>
Username for the cluster.
</td>
</tr>
<tr>
<td>
<code>
password
</code>
</td>
<td>
Password for the cluster.
</td>
</tr>
</tbody>
</table>
<h4 id="rdidatabasecertificates">
<code>
rdi.database.certificates
</code>
</h4>
<p>
Use these properties only if the RDI database requires
<a href="https://en.wikipedia.org/wiki/Transport_Layer_Security">
TLS
</a>
or
<a href="https://en.wikipedia.org/wiki/Mutual_authentication#mTLS">
mTLS
</a>
.
You must also set
<code>
ssl
</code>
to
<code>
true
</code>
in the
<a href="#rdidatabase">
<code>
rdi.database
</code>
</a>
section to enable these properties.
</p>
<table>
<thead>
<tr>
<th>
Property
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>
ca
</code>
</td>
<td>
Path to the CA certificate file.
</td>
</tr>
<tr>
<td>
<code>
cert
</code>
</td>
<td>
Path to the client certificate file.
</td>
</tr>
<tr>
<td>
<code>
key
</code>
</td>
<td>
Path to the key file.
</td>
</tr>
<tr>
<td>
<code>
passphrase
</code>
</td>
<td>
Password for the private key (string).
</td>
</tr>
</tbody>
</table>
<h2 id="prepare-your-source-database">
Prepare your source database
</h2>
<p>
You must also configure your source database to use the CDC connector. See the
<a href="/docs/latest/integrate/redis-data-integration/data-pipelines/prepare-dbs/">
Prepare source databases
</a>
section to learn how to do this.
</p>
<h2 id="deploy-a-pipeline">
Deploy a pipeline
</h2>
<p>
When the installation is complete, and you have prepared the source database for CDC,
you are ready to start using RDI. See the guides to
<a href="/docs/latest/integrate/redis-data-integration/data-pipelines/data-pipelines/">
configuring
</a>
and
<a href="/docs/latest/integrate/redis-data-integration/data-pipelines/deploy/">
deploying
</a>
RDI pipelines for more information. You can also configure and deploy a pipeline
using
<a href="/docs/latest/develop/tools/insight/rdi-connector/">
Redis Insight
</a>
.
</p>
<h2 id="uninstall-rdi">
Uninstall RDI
</h2>
<p>
If you want to remove your RDI installation, go to the installation folder and run
the uninstall script as a privileged user:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">sudo ./uninstall.sh
</span></span></code></pre>
</div>
<p>
The script will check you are sure before you proceed:
</p>
<pre tabindex="0"><code>This will uninstall RDI and its dependencies, are you sure? [y, N]
</code></pre>
<p>
If you type anything other than "y" here, the script will abort without making any changes
to RDI or your source database.
</p>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/integrate/redis-data-integration/installation/install-vm/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/integrate/write-behind/reference/cli/redis-di-monitor/.html | <section class="prose w-full py-12 max-w-none">
<h1>
redis-di monitor
</h1>
<p class="text-lg -mt-5 mb-10">
Monitors Write-behind by collecting metrics and exporting to Prometheus
</p>
<h2 id="usage">
Usage
</h2>
<pre tabindex="0"><code>Usage: redis-di monitor [OPTIONS]
</code></pre>
<h2 id="options">
Options
</h2>
<ul>
<li>
<p>
<code>
loglevel
</code>
:
</p>
<ul>
<li>
Type: Choice(['DEBUG', 'INFO', 'WARN', 'ERROR', 'CRITICAL'])
</li>
<li>
Default:
<code>
info
</code>
</li>
<li>
Usage:
<code>
--loglevel -log-level
</code>
</li>
</ul>
</li>
<li>
<p>
<code>
rdi_host
</code>
(REQUIRED):
</p>
<ul>
<li>
Type: STRING
</li>
<li>
Default:
<code>
none
</code>
</li>
<li>
Usage:
<code>
--rdi-host
</code>
</li>
</ul>
<p>
Host/IP of Write-behind Database
</p>
</li>
<li>
<p>
<code>
rdi_port
</code>
(REQUIRED):
</p>
<ul>
<li>
Type: <IntRange 1000<=x<=65535>
</li>
<li>
Default:
<code>
none
</code>
</li>
<li>
Usage:
<code>
--rdi-port
</code>
</li>
</ul>
<p>
Port of Write-behind Database
</p>
</li>
<li>
<p>
<code>
rdi_password
</code>
:
</p>
<ul>
<li>
Type: STRING
</li>
<li>
Default:
<code>
none
</code>
</li>
<li>
Usage:
<code>
--rdi-password
</code>
</li>
</ul>
<p>
Write-behind Database Password
</p>
</li>
<li>
<p>
<code>
rdi_key
</code>
:
</p>
<ul>
<li>
Type: STRING
</li>
<li>
Default:
<code>
none
</code>
</li>
<li>
Usage:
<code>
--rdi-key
</code>
</li>
</ul>
<p>
Private key file to authenticate with
</p>
</li>
<li>
<p>
<code>
rdi_cert
</code>
:
</p>
<ul>
<li>
Type: STRING
</li>
<li>
Default:
<code>
none
</code>
</li>
<li>
Usage:
<code>
--rdi-cert
</code>
</li>
</ul>
<p>
Client certificate file to authenticate with
</p>
</li>
<li>
<p>
<code>
rdi_cacert
</code>
:
</p>
<ul>
<li>
Type: STRING
</li>
<li>
Default:
<code>
none
</code>
</li>
<li>
Usage:
<code>
--rdi-cacert
</code>
</li>
</ul>
<p>
CA certificate file to verify with
</p>
</li>
<li>
<p>
<code>
rdi_key_password
</code>
:
</p>
<ul>
<li>
Type: STRING
</li>
<li>
Default:
<code>
none
</code>
</li>
<li>
Usage:
<code>
--rdi-key-password
</code>
</li>
</ul>
<p>
Password for unlocking an encrypted private key
</p>
</li>
<li>
<p>
<code>
exporter_port
</code>
:
</p>
<ul>
<li>
Type: <IntRange 1000<=x<=65535>
</li>
<li>
Default:
<code>
9121
</code>
</li>
<li>
Usage:
<code>
--exporter-port
</code>
</li>
</ul>
<p>
HTTP port to start the exporter on
</p>
</li>
<li>
<p>
<code>
collect_interval
</code>
:
</p>
<ul>
<li>
Type: <IntRange 1<=x<=60>
</li>
<li>
Default:
<code>
5
</code>
</li>
<li>
Usage:
<code>
--collect-interval
</code>
</li>
</ul>
<p>
Metrics collection interval (seconds)
</p>
</li>
<li>
<p>
<code>
help
</code>
:
</p>
<ul>
<li>
Type: BOOL
</li>
<li>
Default:
<code>
false
</code>
</li>
<li>
Usage:
<code>
--help
</code>
</li>
</ul>
<p>
Show this message and exit.
</p>
</li>
</ul>
<h2 id="cli-help">
CLI help
</h2>
<pre tabindex="0"><code>Usage: redis-di monitor [OPTIONS]
Monitors Write-behind by collecting metrics and exporting to Prometheus
Options:
-log-level, --loglevel [DEBUG|INFO|WARN|ERROR|CRITICAL]
[default: INFO]
--rdi-host TEXT Host/IP of Write-behind Database [required]
--rdi-port INTEGER RANGE Port of Write-behind Database [1000<=x<=65535;
required]
--rdi-password TEXT Write-behind Database Password
--rdi-key TEXT Private key file to authenticate with
--rdi-cert TEXT Client certificate file to authenticate with
--rdi-cacert TEXT CA certificate file to verify with
--rdi-key-password TEXT Password for unlocking an encrypted private
key
--exporter-port INTEGER RANGE HTTP port to start the exporter on
[1000<=x<=65535]
--collect-interval INTEGER RANGE
Metrics collection interval (seconds)
[1<=x<=60]
--help Show this message and exit.
</code></pre>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/integrate/write-behind/reference/cli/redis-di-monitor/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/7.4/databases/active-active/develop/data-types/sets/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Sets in Active-Active databases
</h1>
<p class="text-lg -mt-5 mb-10">
Information about using sets with an Active-Active database.
</p>
<p>
A Redis set is an unordered collection of strings. It is possible to
add, remove, and test for the existence of members with Redis commands.
A Redis set maintains a unique collection of elements. Sets can be great
for maintaining a list of events (click streams), users (in a group
conversation), products (in recommendation lists), engagements (likes,
shares) and so on.
</p>
<p>
Sets in Active-Active databases behave the same and maintain additional metadata to
achieve an "OR-Set" behavior to handle concurrent conflicting
writes.Β With the OR-Set behavior, writes across multiple Active-Active database instances
are typically unioned except in cases of conflicts. Conflicting instance
writes can happen when aΒ Active-Active database instance deletes an element while the
other adds the same element. In this case and observed remove rule is
followed. That is, remove can only remove instances it has already seen
and in all other cases element add wins.
</p>
<p>
Here is an example of an "add wins" case:
</p>
<table>
<thead>
<tr>
<th style="text-align:right">
<strong>
Time
</strong>
</th>
<th style="text-align:center">
<strong>
CRDB Instance1
</strong>
</th>
<th style="text-align:center">
<strong>
CRDB Instance2
</strong>
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:right">
t1
</td>
<td style="text-align:center">
SADD key1 βaβ
</td>
<td style="text-align:center">
</td>
</tr>
<tr>
<td style="text-align:right">
t2
</td>
<td style="text-align:center">
</td>
<td style="text-align:center">
SADD key1 βbβ
</td>
</tr>
<tr>
<td style="text-align:right">
t3
</td>
<td style="text-align:center">
SMEMBERS key1 βaβ
</td>
<td style="text-align:center">
SMEMBERS key1 βbβ
</td>
</tr>
<tr>
<td style="text-align:right">
t4
</td>
<td style="text-align:center">
β Sync β
</td>
<td style="text-align:center">
β Sync β
</td>
</tr>
<tr>
<td style="text-align:right">
t3
</td>
<td style="text-align:center">
SMEMBERS key1 βaβ βbβ
</td>
<td style="text-align:center">
SMEMBERS key1 βaβ βbβ
</td>
</tr>
</tbody>
</table>
<p>
Here is an example of an "observed remove" case.
</p>
<table>
<thead>
<tr>
<th style="text-align:right">
<strong>
Time
</strong>
</th>
<th style="text-align:center">
<strong>
CRDB Instance1
</strong>
</th>
<th style="text-align:center">
<strong>
CRDB Instance2
</strong>
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:right">
t1
</td>
<td style="text-align:center">
SMEMBERS key1 βaβ βbβ
</td>
<td style="text-align:center">
SMEMBERS key1 βaβ βbβ
</td>
</tr>
<tr>
<td style="text-align:right">
t2
</td>
<td style="text-align:center">
SREM key1 βaβ
</td>
<td style="text-align:center">
SADD key1 βcβ
</td>
</tr>
<tr>
<td style="text-align:right">
t3
</td>
<td style="text-align:center">
SREM key1 βcβ
</td>
<td style="text-align:center">
</td>
</tr>
<tr>
<td style="text-align:right">
t4
</td>
<td style="text-align:center">
β Sync β
</td>
<td style="text-align:center">
β Sync β
</td>
</tr>
<tr>
<td style="text-align:right">
t3
</td>
<td style="text-align:center">
SMEMBERS key1 βcβ βbβ
</td>
<td style="text-align:center">
SMEMBERS key1 βcβ βbβ
</td>
</tr>
</tbody>
</table>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/databases/active-active/develop/data-types/sets/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/commands/srem/.html | <section class="prose w-full py-12">
<h1 class="command-name">
SREM
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">SREM key member [member ...]</pre>
<dl class="grid grid-cols-[auto,1fr] gap-2 mb-12">
<dt class="font-semibold text-redis-ink-900 m-0">
Available since:
</dt>
<dd class="m-0">
1.0.0
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
Time complexity:
</dt>
<dd class="m-0">
O(N) where N is the number of members to be removed.
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
ACL categories:
</dt>
<dd class="m-0">
<code>
@write
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@set
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@fast
</code>
<span class="mr-1 last:hidden">
,
</span>
</dd>
</dl>
<p>
Remove the specified members from the set stored at
<code>
key
</code>
.
Specified members that are not a member of this set are ignored.
If
<code>
key
</code>
does not exist, it is treated as an empty set and this command returns
<code>
0
</code>
.
</p>
<p>
An error is returned when the value stored at
<code>
key
</code>
is not a set.
</p>
<h2 id="examples">
Examples
</h2>
<div class="bg-slate-900 border-b border-slate-700 rounded-t-xl px-4 py-3 w-full flex">
<svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20">
<path d="M2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10Z">
</path>
</svg>
<svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20">
<path d="M10 2.5L18.6603 17.5L1.33975 17.5L10 2.5Z">
</path>
</svg>
<svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20">
<path d="M10 2.5L12.0776 7.9322L17.886 8.22949L13.3617 11.8841L14.8738 17.5L10 14.3264L5.1262 17.5L6.63834 11.8841L2.11403 8.22949L7.92238 7.9322L10 2.5Z">
</path>
</svg>
</div>
<form class="redis-cli overflow-y-auto max-h-80">
<pre tabindex="0">redis> SADD myset "one"
(integer) 1
redis> SADD myset "two"
(integer) 1
redis> SADD myset "three"
(integer) 1
redis> SREM myset "one"
(integer) 1
redis> SREM myset "four"
(integer) 0
redis> SMEMBERS myset
1) "two"
2) "three"
</pre>
<div class="prompt" style="">
<span>
redis>
</span>
<input autocomplete="off" name="prompt" spellcheck="false" type="text"/>
</div>
</form>
<h2 id="resp2-reply">
RESP2 Reply
</h2>
<a href="../../develop/reference/protocol-spec#integers">
Integer reply
</a>
: the number of members that were removed from the set, not including non existing members.
<h2 id="resp3-reply">
RESP3 Reply
</h2>
<a href="../../develop/reference/protocol-spec#integers">
Integer reply
</a>
: Number of members that were removed from the set, not including non existing members.
<br/>
<h2>
History
</h2>
<ul>
<li>
Starting with Redis version 2.4.0: Accepts multiple
<code>
member
</code>
arguments.
</li>
</ul>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/srem/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/7.4/references/rest-api/requests/crdbs/flush/.html | <section class="prose w-full py-12 max-w-none">
<h1>
CRDB flush requests
</h1>
<p class="text-lg -mt-5 mb-10">
Flush Active-Active database requests
</p>
<table>
<thead>
<tr>
<th>
Method
</th>
<th>
Path
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="#put-crdbs-flush">
PUT
</a>
</td>
<td>
<code>
/v1/crdbs/{crdb_guid}/flush
</code>
</td>
<td>
Flush an Active-Active database
</td>
</tr>
</tbody>
</table>
<h2 id="put-crdbs-flush">
Flush an Active-Active database
</h2>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">PUT /v1/crdbs/<span class="o">{</span>crdb_guid<span class="o">}</span>/flush
</span></span></code></pre>
</div>
<p>
Flush an Active-Active database.
</p>
<h3 id="put-request">
Request
</h3>
<h4 id="example-http-request">
Example HTTP request
</h4>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">PUT /crdbs/552bbccb-99f3-4142-bd17-93d245f0bc79/flush
</span></span></code></pre>
</div>
<h4 id="headers">
Headers
</h4>
<table>
<thead>
<tr>
<th>
Key
</th>
<th>
Value
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
X-Task-ID
</td>
<td>
string
</td>
<td>
Specified task ID
</td>
</tr>
<tr>
<td>
X-Result-TTL
</td>
<td>
integer
</td>
<td>
Time (in seconds) to keep task result
</td>
</tr>
</tbody>
</table>
<h4 id="url-parameters">
URL parameters
</h4>
<table>
<thead>
<tr>
<th>
Field
</th>
<th>
Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
crdb_guid
</td>
<td>
string
</td>
<td>
Globally unique Active-Active database ID (GUID)
</td>
</tr>
</tbody>
</table>
<h3 id="put-response">
Response
</h3>
<p>
Returns a
<a href="/docs/latest/operate/rs/7.4/references/rest-api/objects/crdb_task/">
CRDB task object
</a>
.
</p>
<h4 id="put-status-codes">
Status codes
</h4>
<table>
<thead>
<tr>
<th>
Code
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1">
200 OK
</a>
</td>
<td>
Action was successful.
</td>
</tr>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1">
400 Bad Request
</a>
</td>
<td>
The request is invalid or malformed.
</td>
</tr>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.2">
401 Unauthorized
</a>
</td>
<td>
Unauthorized request. Invalid credentials
</td>
</tr>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5">
404 Not Found
</a>
</td>
<td>
Configuration or Active-Active database not found.
</td>
</tr>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.7">
406 Not Acceptable
</a>
</td>
<td>
Configuration cannot be accepted, typically because it was already committed.
</td>
</tr>
</tbody>
</table>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/references/rest-api/requests/crdbs/flush/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/references/rest-api/requests/cm_settings/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Cluster Manager settings requests
</h1>
<p class="text-lg -mt-5 mb-10">
REST API requests for Cluster Manager UI settings
</p>
<table>
<thead>
<tr>
<th>
Method
</th>
<th>
Path
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="#get-cm-settings">
GET
</a>
</td>
<td>
<code>
/v1/cm_settings
</code>
</td>
<td>
Get Cluster Manager UI settings
</td>
</tr>
<tr>
<td>
<a href="#put-cm-settings">
PUT
</a>
</td>
<td>
<code>
/v1/cm_settings
</code>
</td>
<td>
Update Cluster Manager UI settings
</td>
</tr>
</tbody>
</table>
<h2 id="get-cm-settings">
Get CM settings
</h2>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">GET /v1/cm_settings
</span></span></code></pre>
</div>
<p>
Get Cluster Manager UI settings.
</p>
<h3 id="permissions">
Permissions
</h3>
<table>
<thead>
<tr>
<th>
Permission name
</th>
<th>
Roles
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="/docs/latest/operate/rs/references/rest-api/permissions/#view_cluster_info">
view_cluster_info
</a>
</td>
<td>
admin
<br/>
cluster_member
<br/>
cluster_viewer
<br/>
db_member
<br/>
db_viewer
<br/>
user_manager
</td>
</tr>
</tbody>
</table>
<h3 id="get-request">
Request
</h3>
<h4 id="example-http-request">
Example HTTP request
</h4>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">GET /cm_settings
</span></span></code></pre>
</div>
<h4 id="headers">
Headers
</h4>
<table>
<thead>
<tr>
<th>
Key
</th>
<th>
Value
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
Host
</td>
<td>
cnm.cluster.fqdn
</td>
<td>
Domain name
</td>
</tr>
<tr>
<td>
Accept
</td>
<td>
application/json
</td>
<td>
Accepted media type
</td>
</tr>
</tbody>
</table>
<h3 id="get-response">
Response
</h3>
<p>
Returns a
<a href="/docs/latest/operate/rs/references/rest-api/objects/cm_settings/">
cm_settings object
</a>
.
</p>
<h4 id="example-json-body">
Example JSON body
</h4>
<div class="highlight">
<pre class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"timezone"</span><span class="p">:</span> <span class="s2">"UTC"</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span></code></pre>
</div>
<h4 id="get-status-codes">
Status codes
</h4>
<table>
<thead>
<tr>
<th>
Code
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="https://www.rfc-editor.org/rfc/rfc9110.html#name-200-ok">
200 OK
</a>
</td>
<td>
No error
</td>
</tr>
</tbody>
</table>
<h2 id="put-cm-settings">
Update CM settings
</h2>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">PUT /v1/cm_settings
</span></span></code></pre>
</div>
<p>
Update Cluster Manager UI settings.
</p>
<h3 id="permissions-1">
Permissions
</h3>
<table>
<thead>
<tr>
<th>
Permission name
</th>
<th>
Roles
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="/docs/latest/operate/rs/references/rest-api/permissions/#update_cluster">
update_cluster
</a>
</td>
<td>
admin
</td>
</tr>
</tbody>
</table>
<h3 id="put-request">
Request
</h3>
<h4 id="example-http-request-1">
Example HTTP request
</h4>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">PUT /cm_settings
</span></span></code></pre>
</div>
<h4 id="example-json-body-1">
Example JSON body
</h4>
<div class="highlight">
<pre class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"timezone"</span><span class="p">:</span> <span class="s2">"US/Pacific"</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span></code></pre>
</div>
<h4 id="headers-1">
Headers
</h4>
<table>
<thead>
<tr>
<th>
Key
</th>
<th>
Value
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
Host
</td>
<td>
cnm.cluster.fqdn
</td>
<td>
Domain name
</td>
</tr>
<tr>
<td>
Accept
</td>
<td>
application/json
</td>
<td>
Accepted media type
</td>
</tr>
</tbody>
</table>
<h4 id="body">
Body
</h4>
<p>
Include a
<a href="/docs/latest/operate/rs/references/rest-api/objects/cm_settings/">
cm_settings object
</a>
with updated fields in the request body.
</p>
<h3 id="put-response">
Response
</h3>
<p>
Returns a
<a href="/docs/latest/operate/rs/references/rest-api/objects/cm_settings/">
cm_settings object
</a>
with the updated fields.
</p>
<h4 id="example-json-body-2">
Example JSON body
</h4>
<div class="highlight">
<pre class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"timezone"</span><span class="p">:</span> <span class="s2">"US/Pacific"</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span></code></pre>
</div>
<h4 id="put-status-codes">
Status codes
</h4>
<table>
<thead>
<tr>
<th>
Code
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="https://www.rfc-editor.org/rfc/rfc9110.html#name-200-ok">
200 OK
</a>
</td>
<td>
Success, time zone config has been set.
</td>
</tr>
<tr>
<td>
<a href="https://www.rfc-editor.org/rfc/rfc9110.html#name-400-bad-request">
400 Bad Request
</a>
</td>
<td>
Bad or missing configuration parameters.
</td>
</tr>
</tbody>
</table>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/references/rest-api/requests/cm_settings/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/search/search-active-active/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Search and query Active-Active databases
</h1>
<p class="text-lg -mt-5 mb-10">
Search and query Active-Active databases.
</p>
<p>
Starting with RediSearch 2.x, supported in Redis Enterprise Software (RS) 6.0 and later, you can
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/install/add-module-to-database/">
enable search and query
</a>
for
<a href="/docs/latest/operate/rs/databases/active-active/">
Active-Active databases
</a>
at the time of creation.
</p>
<p>
You can run search operations on any instance of an Active-Active database.
</p>
<h2 id="how-it-works">
How it works
</h2>
<ol>
<li>
Create an Active-Active database with RediSearch 2.x enabled.
</li>
<li>
<a href="/docs/latest/commands/ft.create">
Create the index
</a>
on each instance of the database.
</li>
<li>
If you are using
<a href="/docs/latest/develop/interact/search-and-query/advanced-concepts/synonyms/">
synonyms
</a>
, you need to add them to each replica.
</li>
<li>
The index is maintained by each instance outside of the database keyspace, so only updates to the hashes in the databases are synchronized.
</li>
</ol>
<h2 id="command-compatibility">
Command compatibility
</h2>
<p>
Active-Active databases do not support the following search and query commands:
</p>
<ul>
<li>
<a href="/docs/latest/commands/ft.dropindex">
<code>
FT.DROPINDEX
</code>
</a>
</li>
<li>
<a href="/docs/latest/commands/ft.sugadd">
<code>
FT.SUGADD
</code>
</a>
</li>
<li>
<a href="/docs/latest/commands/ft.sugget">
<code>
FT.SUGGET
</code>
</a>
</li>
<li>
<a href="/docs/latest/commands/ft.sugdel">
<code>
FT.SUGDEL
</code>
</a>
</li>
<li>
<a href="/docs/latest/commands/ft.suglen">
<code>
FT.SUGLEN
</code>
</a>
</li>
</ul>
<h2 id="example">
Example
</h2>
<p>
Here's an example to help visualize Active-Active search and query:
</p>
<table>
<thead>
<tr>
<th style="text-align:center">
Time
</th>
<th style="text-align:left">
Description
</th>
<th style="text-align:left">
CRDB Instance1
</th>
<th style="text-align:left">
RediSearch Instance 1
</th>
<th style="text-align:left">
CRDB Instance 2
</th>
<th style="text-align:left">
RediSearch Instance 2
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center">
t0
</td>
<td style="text-align:left">
Create the index on each instance
</td>
<td style="text-align:left">
</td>
<td style="text-align:left">
FT.CREATE idx ....
</td>
<td style="text-align:left">
</td>
<td style="text-align:left">
FT.CREATE idx ....
</td>
</tr>
<tr>
<td style="text-align:center">
t1
</td>
<td style="text-align:left">
Add doc1 as a hash on instance 1; RediSearch indexes doc1 on instance 1
</td>
<td style="text-align:left">
HSET doc1 field1 "a"
</td>
<td style="text-align:left">
(Index doc1 field1 "a")
</td>
<td style="text-align:left">
</td>
<td style="text-align:left">
</td>
</tr>
<tr>
<td style="text-align:center">
t2
</td>
<td style="text-align:left">
Add doc2 as a hash on instance 2; RediSearch indexes doc2 on instance 2
</td>
<td style="text-align:left">
</td>
<td style="text-align:left">
</td>
<td style="text-align:left">
HSET doc1 field2 "b"
</td>
<td style="text-align:left">
(Index doc1 field2 "b")
</td>
</tr>
<tr>
<td style="text-align:center">
t3
</td>
<td style="text-align:left">
Searching for "a" in each instance only finds the result in instance 1
</td>
<td style="text-align:left">
</td>
<td style="text-align:left">
FT.Search idx "a"
<br/>
1) 1
<br/>
2) doc1
</td>
<td style="text-align:left">
</td>
<td style="text-align:left">
FT.Search idx "a"
<br/>
1) 0
</td>
</tr>
<tr>
<td style="text-align:center">
t4
</td>
<td style="text-align:left">
Active-Active synchronization
</td>
<td style="text-align:left">
- Sync -
</td>
<td style="text-align:left">
</td>
<td style="text-align:left">
- Sync -
</td>
<td style="text-align:left">
</td>
</tr>
<tr>
<td style="text-align:center">
t5
</td>
<td style="text-align:left">
Both hashes are found in each instance
</td>
<td style="text-align:left">
HGETALL doc1
<br/>
1) "field2"
<br/>
2) "b"
<br/>
3) "field1"
<br/>
4) "a"
</td>
<td style="text-align:left">
</td>
<td style="text-align:left">
HGETALL doc1
<br/>
1) "field2"
<br/>
2) "b"
<br/>
3) "field1"
<br/>
4) "a"
</td>
<td style="text-align:left">
</td>
</tr>
<tr>
<td style="text-align:center">
t6
</td>
<td style="text-align:left">
Searching for "a" in each instance finds both documents
</td>
<td style="text-align:left">
</td>
<td style="text-align:left">
FT.Search idx "a"
<br/>
1) 1
<br/>
2) doc1
</td>
<td style="text-align:left">
</td>
<td style="text-align:left">
FT.Search idx "a"
<br/>
1) 1
<br/>
2) doc1
</td>
</tr>
</tbody>
</table>
<p>
The practical result is that you have a geo-distributed database with a high level of consistency that can also run search operations on any instance.
</p>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/search/search-active-active/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/commands/cf.addnx/.html | <section class="prose w-full py-12">
<h1 class="command-name">
CF.ADDNX
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">CF.ADDNX key item</pre>
<dl class="grid grid-cols-[auto,1fr] gap-2 mb-12">
<dt class="font-semibold text-redis-ink-900 m-0">
Available in:
</dt>
<dd class="m-0">
<a href="/docs/stack">
Redis Stack
</a>
/
<a href="/docs/data-types/probabilistic">
Bloom 1.0.0
</a>
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
Time complexity:
</dt>
<dd class="m-0">
O(k + i), where k is the number of sub-filters and i is maxIterations
</dd>
</dl>
<p>
Adds an item to a cuckoo filter if the item does not exist.
</p>
<p>
This command is similar to the combination of
<a href="/docs/latest/commands/cf.exists/">
<code>
CF.EXISTS
</code>
</a>
and
<a href="/docs/latest/commands/cf.add/">
<code>
CF.ADD
</code>
</a>
. It does not add an item into the filter if its fingerprint already exists.
</p>
<p>
<note>
<b>
Notes:
</b>
</note>
</p>
<ul>
<li>
This command is slower than
<a href="/docs/latest/commands/cf.add/">
<code>
CF.ADD
</code>
</a>
because it first checks whether the item exists.
</li>
<li>
Since
<a href="/docs/latest/commands/cf.exists/">
<code>
CF.EXISTS
</code>
</a>
can result in false positive,
<code>
CF.ADDNX
</code>
may not add an item because it is supposedly already exist, which may be wrong.
</li>
</ul>
<h2 id="required-arguments">
Required arguments
</h2>
<details open="">
<summary>
<code>
key
</code>
</summary>
<p>
is key name for a cuckoo filter to add items to.
</p>
<p>
If
<code>
key
</code>
does not exist - a new cuckoo filter is created.
</p>
</details>
<details open="">
<summary>
<code>
item
</code>
</summary>
<p>
is an item to add.
</p>
</details>
<h2 id="return-value">
Return value
</h2>
<p>
Returns one of these replies:
</p>
<ul>
<li>
<a href="/docs/latest/develop/reference/protocol-spec/#integers">
Integer reply
</a>
, where
<code>
0
</code>
means that the item's fingerprint already exist in the filter, and
<code>
1
</code>
means that the item has been successfully added to the filter.
</li>
<li>
[] on error (invalid arguments, wrong key type, etc.) and also when the filter is full.
</li>
</ul>
<h2 id="examples">
Examples
</h2>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis> CF.ADDNX cf item
</span></span><span class="line"><span class="cl"><span class="o">(</span>integer<span class="o">)</span> <span class="m">1</span>
</span></span><span class="line"><span class="cl">redis> CF.ADDNX cf item
</span></span><span class="line"><span class="cl"><span class="o">(</span>integer<span class="o">)</span> <span class="m">0</span></span></span></code></pre>
</div>
<br/>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/cf.addnx/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/install/add-module-to-cluster/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Install a module on a cluster
</h1>
<p>
<a href="/docs/latest/operate/rs/">
Redis Enterprise Software
</a>
comes packaged with several modules. As of version 7.8.2, Redis Enterprise Software includes three feature sets, compatible with different Redis database versions. You can view the installed modules, their versions, and their minimum compatible Redis database versions from
<strong>
Cluster > Modules
</strong>
in the Cluster Manager UI.
</p>
<p>
To use other modules or upgrade an existing module to a more recent version, you need to install the new module package on your cluster.
</p>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Warning:
</div>
<ul>
<li>
<p>
Some module versions are not supported or recommended for use with Redis Enterprise.
</p>
</li>
<li>
<p>
We recommend consulting
<a href="https://redis.com/company/support/">
Redis support
</a>
before you upgrade a module on the cluster, especially if the cluster is used in production.
</p>
</li>
</ul>
</div>
</div>
<h2 id="get-packaged-modules">
Get packaged modules
</h2>
<p>
To install or upgrade a module on a
<a href="/docs/latest/operate/rs/">
Redis Enterprise Software
</a>
cluster, you need a module package.
</p>
<ul>
<li>
<p>
For versions of official Redis modules that are not available from the
<a href="https://redislabs.com/download-center/modules/">
Redis download center
</a>
,
<a href="https://redis.com/company/support/">
contact support
</a>
.
</p>
</li>
<li>
<p>
For custom-packaged modules, download a
<a href="https://redislabs.com/community/redis-modules-hub/">
custom-packaged module
</a>
from the developer.
</p>
</li>
</ul>
<h2 id="add-a-module-to-a-cluster">
Add a module to a cluster
</h2>
<p>
Use one of the following methods to add a module to a Redis Enterprise cluster:
</p>
<ul>
<li>
<p>
REST API
<a href="/docs/latest/operate/rs/references/rest-api/requests/modules/#post-module-v2">
<code>
POST
</code>
request to the
<code>
/v2/modules
</code>
</a>
endpoint
</p>
</li>
<li>
<p>
Redis Enterprise Cluster Manager UI
</p>
</li>
<li>
<p>
For RedisGears, follow these
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/gears-v1/installing-redisgears/">
installation instructions
</a>
</p>
</li>
</ul>
<h3 id="rest-api-method">
REST API method
</h3>
<p>
To add a module to the cluster using the REST API:
</p>
<ol>
<li>
<p>
Copy the module package to a node in the cluster.
</p>
</li>
<li>
<p>
Add the module to the cluster with a
<a href="/docs/latest/operate/rs/references/rest-api/requests/modules/#post-module-v2">
<code>
POST
</code>
request to the
<code>
/v2/modules
</code>
</a>
endpoint:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">POST https://<span class="o">[</span>host<span class="o">][</span>:port<span class="o">]</span>/v2/modules
</span></span><span class="line"><span class="cl"><span class="s2">"module=@/tmp/redisearch.Linux-ubuntu16.04-x86_64.2.2.6.zip"</span>
</span></span></code></pre>
</div>
<p>
Here, the
<em>
module
</em>
parameter specifies the full path of the module package and must be submitted as form-data. In addition, the package must be available and accessible to the server processing the request.
</p>
</li>
<li>
<p>
If the module installation succeeds, the
<code>
POST
</code>
request returns a
<a href="/docs/latest/operate/rs/references/rest-api/objects/module/">
JSON object
</a>
that represents the new module. If it fails, it may return a JSON object with an
<code>
error_code
</code>
and
<code>
description
</code>
with more details.
</p>
</li>
</ol>
<h3 id="cluster-manager-ui-method">
Cluster Manager UI method
</h3>
<p>
To add a module to the cluster using the Cluster Manager UI:
</p>
<ol>
<li>
<p>
Go to
<strong>
Cluster > Modules
</strong>
.
</p>
</li>
<li>
<p>
Select
<strong>
Upload module
</strong>
.
</p>
</li>
<li>
<p>
Use the file browser to add the packaged module.
</p>
</li>
</ol>
<h2 id="next-steps">
Next steps
</h2>
<ul>
<li>
Create a database and
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/install/add-module-to-database/">
enable the new module
</a>
.
</li>
<li>
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/install/upgrade-module/">
Upgrade a module
</a>
to the new version.
</li>
</ul>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/install/add-module-to-cluster/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/7.4/references/rest-api/objects/state-machine/.html | <section class="prose w-full py-12 max-w-none">
<h1>
State machine object
</h1>
<p class="text-lg -mt-5 mb-10">
An object that represents a state machine.
</p>
<p>
A state machine object tracks the status of database actions.
</p>
<p>
A state machine contains the following attributes:
</p>
<table>
<thead>
<tr>
<th>
Name
</th>
<th>
Type/Value
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
action_uid
</td>
<td>
string
</td>
<td>
A globally unique identifier of the action
</td>
</tr>
<tr>
<td>
object_name
</td>
<td>
string
</td>
<td>
Name of the object being manipulated by the state machine
</td>
</tr>
<tr>
<td>
status
</td>
<td>
pending
</td>
<td>
Requested state machine has not started
</td>
</tr>
<tr>
<td>
</td>
<td>
active
</td>
<td>
State machine is currently running
</td>
</tr>
<tr>
<td>
</td>
<td>
completed
</td>
<td>
Operation complete
</td>
</tr>
<tr>
<td>
</td>
<td>
failed
</td>
<td>
Operation or state machine failed
</td>
</tr>
<tr>
<td>
name
</td>
<td>
string
</td>
<td>
Name of the running (or failed) state machine
</td>
</tr>
<tr>
<td>
state
</td>
<td>
string
</td>
<td>
Current state within the state machine, when known
</td>
</tr>
<tr>
<td>
error
</td>
<td>
string
</td>
<td>
A descriptive error string for failed state machine, when known
</td>
</tr>
</tbody>
</table>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/references/rest-api/objects/state-machine/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/security/access-control/create-users/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Create users
</h1>
<p class="text-lg -mt-5 mb-10">
Create users and assign access control roles.
</p>
<h2 id="prerequisites">
Prerequisites
</h2>
<p>
Before you create other users:
</p>
<ol>
<li>
<p>
Review the
<a href="/docs/latest/operate/rs/security/access-control/">
access control overview
</a>
to learn how to use role-based access control (RBAC) to manage users' cluster access and database access.
</p>
</li>
<li>
<p>
Create roles you can assign to users. See
<a href="/docs/latest/operate/rs/security/access-control/create-cluster-roles/">
Create roles with cluster access only
</a>
,
<a href="/docs/latest/operate/rs/security/access-control/create-db-roles/">
Create roles with database access only
</a>
, or
<a href="/docs/latest/operate/rs/security/access-control/create-combined-roles/">
Create roles with combined access
</a>
for instructions.
</p>
</li>
</ol>
<h2 id="add-users">
Add users
</h2>
<p>
To add a user to the cluster:
</p>
<ol>
<li>
<p>
From the
<strong>
Access Control > Users
</strong>
tab in the Cluster Manager UI, select
<strong>
+ Add user
</strong>
.
</p>
<a href="/docs/latest/images/rs/access-control-user-panel.png" sdata-lightbox="/images/rs/access-control-user-panel.png">
<img alt="Add role with name" src="/docs/latest/images/rs/access-control-user-panel.png"/>
</a>
</li>
<li>
<p>
Enter the name, email, and password of the new user.
</p>
<a href="/docs/latest/images/rs/access-control-user-add.png" sdata-lightbox="/images/rs/access-control-user-add.png">
<img alt="Add role with name" src="/docs/latest/images/rs/access-control-user-add.png"/>
</a>
</li>
<li>
<p>
Assign a
<strong>
Role
</strong>
to the user to grant permissions for cluster management and data access.
</p>
<a href="/docs/latest/images/rs/access-control-user-role-select.png" sdata-lightbox="/images/rs/access-control-user-role-select.png">
<img alt="Add role to user." src="/docs/latest/images/rs/access-control-user-role-select.png" width="300px"/>
</a>
</li>
<li>
<p>
Select the
<strong>
Alerts
</strong>
the user should receive by email:
</p>
<ul>
<li>
<p>
<strong>
Receive alerts for databases
</strong>
- The alerts that are enabled for the selected databases will be sent to the user. Choose
<strong>
All databases
</strong>
or
<strong>
Customize
</strong>
to select the individual databases to send alerts for.
</p>
</li>
<li>
<p>
<strong>
Receive cluster alerts
</strong>
- The alerts that are enabled for the cluster in
<strong>
Cluster > Alerts Settings
</strong>
are sent to the user.
</p>
</li>
</ul>
</li>
<li>
<p>
Select
<strong>
Save
</strong>
.
</p>
</li>
</ol>
<h2 id="assign-roles-to-users">
Assign roles to users
</h2>
<p>
Assign a role, associated with specific databases and access control lists (ACLs), to a user to grant database access:
</p>
<ol>
<li>
<p>
From the
<strong>
Access Control > Users
</strong>
tab in the Cluster Manager UI, you can:
</p>
<ul>
<li>
<p>
Point to an existing user and select
<a href="/docs/latest/images/rs/buttons/edit-button.png#no-click" sdata-lightbox="/images/rs/buttons/edit-button.png#no-click">
<img alt="The Edit button" class="inline" src="/docs/latest/images/rs/buttons/edit-button.png#no-click" width="25px"/>
</a>
to edit the user.
</p>
</li>
<li>
<p>
Select
<strong>
+ Add user
</strong>
to
<a href="/docs/latest/operate/rs/security/access-control/create-users/">
create a new user
</a>
.
</p>
</li>
</ul>
</li>
<li>
<p>
Select a role to assign to the user.
</p>
<a href="/docs/latest/images/rs/access-control-user-role-select.png" sdata-lightbox="/images/rs/access-control-user-role-select.png">
<img alt="Add role to user." src="/docs/latest/images/rs/access-control-user-role-select.png" width="300px"/>
</a>
</li>
<li>
<p>
Select
<strong>
Save
</strong>
.
</p>
</li>
</ol>
<h2 id="next-steps">
Next steps
</h2>
<p>
Depending on the type of the user's assigned role (cluster management role or data access role), the user can now:
</p>
<ul>
<li>
<p>
<a href="/docs/latest/operate/rs/databases/connect/">
Connect to a database
</a>
associated with the role and run limited Redis commands, depending on the role's Redis ACLs.
</p>
</li>
<li>
<p>
Sign in to the Redis Enterprise Software Cluster Manager UI.
</p>
</li>
<li>
<p>
Make a
<a href="/docs/latest/operate/rs/references/rest-api/">
REST API
</a>
request.
</p>
</li>
</ul>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/security/access-control/create-users/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/commands/tdigest.revrank/.html | <section class="prose w-full py-12">
<h1 class="command-name">
TDIGEST.REVRANK
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">TDIGEST.REVRANK key value [value ...]</pre>
<dl class="grid grid-cols-[auto,1fr] gap-2 mb-12">
<dt class="font-semibold text-redis-ink-900 m-0">
Available in:
</dt>
<dd class="m-0">
<a href="/docs/stack">
Redis Stack
</a>
/
<a href="/docs/data-types/probabilistic">
Bloom 2.4.0
</a>
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
Time complexity:
</dt>
<dd class="m-0">
O(N) where N is the number of values specified.
</dd>
</dl>
<p>
Returns, for each input value (floating-point), the estimated reverse rank of the value (the number of observations in the sketch that are larger than the value + half the number of observations that are equal to the value).
</p>
<p>
Multiple reverse ranks can be retrieved in a single call.
</p>
<h2 id="required-arguments">
Required arguments
</h2>
<details open="">
<summary>
<code>
key
</code>
</summary>
is key name for an existing t-digest sketch.
</details>
<details open="">
<summary>
<code>
value
</code>
</summary>
is input value for which the reverse rank should be estimated.
<h2 id="return-value">
Return value
</h2>
<p>
<a href="/docs/latest/develop/reference/protocol-spec/#arrays">
Array reply
</a>
- an array of integers populated with revrank_1, revrank_2, ..., revrank_V:
</p>
<ul>
<li>
-1 - when
<code>
value
</code>
is larger than the value of the largest observation.
</li>
<li>
The number of observations - when
<code>
value
</code>
is smaller than the value of the smallest observation.
</li>
<li>
Otherwise: an estimation of the number of (observations larger than
<code>
value
</code>
+ half the observations equal to
<code>
value
</code>
).
</li>
</ul>
<p>
0 is the reverse rank of the value of the largest observation.
</p>
<p>
<em>
n
</em>
-1 is the reverse rank of the value of the smallest observation;
<em>
n
</em>
denotes the number of observations added to the sketch.
</p>
<p>
All values are -2 if the sketch is empty.
</p>
<h2 id="examples">
Examples
</h2>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis> TDIGEST.CREATE s COMPRESSION <span class="m">1000</span>
</span></span><span class="line"><span class="cl">OK
</span></span><span class="line"><span class="cl">redis> TDIGEST.ADD s <span class="m">10</span> <span class="m">20</span> <span class="m">30</span> <span class="m">40</span> <span class="m">50</span> <span class="m">60</span>
</span></span><span class="line"><span class="cl">OK
</span></span><span class="line"><span class="cl">redis> TDIGEST.RANK s <span class="m">0</span> <span class="m">10</span> <span class="m">20</span> <span class="m">30</span> <span class="m">40</span> <span class="m">50</span> <span class="m">60</span> <span class="m">70</span>
</span></span><span class="line"><span class="cl">1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> -1
</span></span><span class="line"><span class="cl">2<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">0</span>
</span></span><span class="line"><span class="cl">3<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">1</span>
</span></span><span class="line"><span class="cl">4<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">2</span>
</span></span><span class="line"><span class="cl">5<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">3</span>
</span></span><span class="line"><span class="cl">6<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">4</span>
</span></span><span class="line"><span class="cl">7<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">5</span>
</span></span><span class="line"><span class="cl">8<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">6</span>
</span></span><span class="line"><span class="cl">redis> TDIGEST.REVRANK s <span class="m">0</span> <span class="m">10</span> <span class="m">20</span> <span class="m">30</span> <span class="m">40</span> <span class="m">50</span> <span class="m">60</span> <span class="m">70</span>
</span></span><span class="line"><span class="cl">1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">6</span>
</span></span><span class="line"><span class="cl">2<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">5</span>
</span></span><span class="line"><span class="cl">3<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">4</span>
</span></span><span class="line"><span class="cl">4<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">3</span>
</span></span><span class="line"><span class="cl">5<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">2</span>
</span></span><span class="line"><span class="cl">6<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">1</span>
</span></span><span class="line"><span class="cl">7<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">0</span>
</span></span><span class="line"><span class="cl">8<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> -1</span></span></code></pre>
</div>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis> TDIGEST.CREATE s COMPRESSION <span class="m">1000</span>
</span></span><span class="line"><span class="cl">OK
</span></span><span class="line"><span class="cl">redis> TDIGEST.ADD s <span class="m">10</span> <span class="m">10</span> <span class="m">10</span> <span class="m">10</span> <span class="m">20</span> <span class="m">20</span>
</span></span><span class="line"><span class="cl">OK
</span></span><span class="line"><span class="cl">redis> TDIGEST.RANK s <span class="m">10</span> <span class="m">20</span>
</span></span><span class="line"><span class="cl">1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">2</span>
</span></span><span class="line"><span class="cl">2<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">5</span>
</span></span><span class="line"><span class="cl">redis> TDIGEST.REVRANK s <span class="m">10</span> <span class="m">20</span>
</span></span><span class="line"><span class="cl">1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">4</span>
</span></span><span class="line"><span class="cl">2<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">1</span></span></span></code></pre>
</div>
<br/>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/tdigest.revrank/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</details>
</section>
|
https://redis.io/docs/latest/operate/rs/7.4/references/rest-api/objects/statistics/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Statistics
</h1>
<p class="text-lg -mt-5 mb-10">
An object that contains metrics for clusters, databases, nodes, or shards
</p>
<h2 id="statistics-overview">
Statistics overview
</h2>
<p>
Clusters, databases, nodes, and shards collect various statistics at regular time intervals. View the statistics for these objects using
<code>
GET stats
</code>
requests to their respective endpoints:
</p>
<ul>
<li>
<a href="/docs/latest/operate/rs/7.4/references/rest-api/requests/cluster/stats/">
Cluster stats
</a>
</li>
<li>
<a href="/docs/latest/operate/rs/7.4/references/rest-api/requests/bdbs/stats/">
Database stats
</a>
</li>
<li>
<a href="/docs/latest/operate/rs/7.4/references/rest-api/requests/nodes/stats/">
Node stats
</a>
</li>
<li>
<a href="/docs/latest/operate/rs/7.4/references/rest-api/requests/shards/stats/">
Shard stats
</a>
</li>
</ul>
<p>
View endpoint stats using
<code>
GET
</code>
requests, see:
</p>
<ul>
<li>
<a href="/docs/latest/operate/rs/7.4/references/rest-api/requests/endpoints-stats/">
Endpoint stats
</a>
</li>
</ul>
<h3 id="response-object">
Response object
</h3>
<p>
Statistics returned from API requests always contain the following fields:
</p>
<ul>
<li>
<code>
interval
</code>
: a string that represents the statistics time interval. Valid values include:
<ul>
<li>
1sec
</li>
<li>
10sec
</li>
<li>
5min
</li>
<li>
15min
</li>
<li>
1hour
</li>
<li>
12hour
</li>
<li>
1week
</li>
</ul>
</li>
<li>
<code>
stime
</code>
: a timestamp that represents the beginning of the interval, in the format "2015-05-27T12:00:00Z"
</li>
<li>
<code>
etime
</code>
: a timestamp that represents the end of the interval, in the format "2015-05-27T12:00:00Z"
</li>
</ul>
<p>
The statistics returned by the API also contain fields that represent the values of different metrics for an object during the specified time interval.
</p>
<p>
More details about the metrics relevant to each object:
</p>
<ul>
<li>
<a href="/docs/latest/operate/rs/7.4/references/rest-api/objects/statistics/cluster-metrics/">
Cluster metrics
</a>
</li>
<li>
<a href="/docs/latest/operate/rs/7.4/references/rest-api/objects/statistics/db-metrics/">
DB metrics
</a>
</li>
<li>
<a href="/docs/latest/operate/rs/7.4/references/rest-api/objects/statistics/node-metrics/">
Node metrics
</a>
</li>
<li>
<a href="/docs/latest/operate/rs/7.4/references/rest-api/objects/statistics/shard-metrics/">
Shard metrics
</a>
</li>
</ul>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Note:
</div>
Certain statistics are not documented because they are for internal use only and should be ignored. Some statistics will only appear in API responses when they are relevant.
</div>
</div>
<h3 id="optional-url-parameters">
Optional URL parameters
</h3>
<p>
There are several optional URL parameters you can pass to the various
<code>
GET stats
</code>
requests to filter the returned statistics.
</p>
<ul>
<li>
<code>
stime
</code>
: limit the start of the time range of the returned statistics
</li>
<li>
<code>
etime
</code>
: limit the end of the time range of the returned statistics
</li>
<li>
<code>
metrics
</code>
: only return the statistics for the specified metrics (comma-separated list)
</li>
</ul>
<h2 id="maximum-number-of-samples-per-interval">
Maximum number of samples per interval
</h2>
<p>
The system retains a maximum number of most recent samples for each interval.
</p>
<table>
<thead>
<tr>
<th>
Interval
</th>
<th>
Max samples
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
1sec
</td>
<td>
10
</td>
</tr>
<tr>
<td>
10sec
</td>
<td>
30
</td>
</tr>
<tr>
<td>
5min
</td>
<td>
12
</td>
</tr>
<tr>
<td>
15min
</td>
<td>
96
</td>
</tr>
<tr>
<td>
1hour
</td>
<td>
168
</td>
</tr>
<tr>
<td>
12hour
</td>
<td>
62
</td>
</tr>
<tr>
<td>
1week
</td>
<td>
53
</td>
</tr>
</tbody>
</table>
<p>
The actual number of samples returned by a
<code>
GET stats
</code>
request depends on how many samples are available and any filters applied by the optional URL parameters. For example, newly created objects (clusters, nodes, databases, or shards) or a narrow time filter range will return fewer samples.
</p>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Note:
</div>
To reduce load generated by stats collection, relatively inactive databases or shards (less than 5 ops/sec) do not collect 1sec stats at one second intervals. Instead, they collect 1sec stats every 2-5 seconds but still retain the same maximum number of samples.
</div>
</div>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/references/rest-api/objects/statistics/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/develop/data-types/timeseries/configuration.html | <section class="prose w-full py-12">
<h1>
Configuration Parameters
</h1>
<p class="text-lg -mt-5 mb-10">
RedisTimeSeries supports multiple module configuration parameters. All of these parameters can only be set at load-time.
</p>
<h2 id="setting-configuration-parameters-on-module-load">
Setting configuration parameters on module load
</h2>
<p>
Setting configuration parameters at load-time is done by appending arguments after the
<code>
--loadmodule
</code>
argument when starting a server from the command line or after the
<code>
loadmodule
</code>
directive in a Redis config file. For example:
</p>
<p>
In
<a href="/docs/latest/operate/oss_and_stack/management/config/">
redis.conf
</a>
:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">loadmodule ./redistimeseries.so <span class="o">[</span>OPT VAL<span class="o">]</span>...
</span></span></code></pre>
</div>
<p>
From the
<a href="/docs/latest/develop/tools/cli/">
Redis CLI
</a>
, using the
<a href="/docs/latest/commands/module-load/">
MODULE LOAD
</a>
command:
</p>
<pre tabindex="0"><code>127.0.0.6379> MODULE LOAD redistimeseries.so [OPT VAL]...
</code></pre>
<p>
From the command line:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ redis-server --loadmodule ./redistimeseries.so <span class="o">[</span>OPT VAL<span class="o">]</span>...
</span></span></code></pre>
</div>
<h2 id="redistimeseries-configuration-parameters">
RedisTimeSeries configuration parameters
</h2>
<p>
The following table summarizes which configuration parameters can be set at module load-time and run-time:
</p>
<table>
<thead>
<tr>
<th style="text-align:left">
Configuration Parameter
</th>
<th style="text-align:left">
Load-time
</th>
<th style="text-align:left">
Run-time
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">
<a href="#num_threads">
NUM_THREADS
</a>
(since RedisTimeSeries v1.6)
</td>
<td style="text-align:left">
β
</td>
<td style="text-align:left">
β¬
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="#compaction_policy">
COMPACTION_POLICY
</a>
</td>
<td style="text-align:left">
β
</td>
<td style="text-align:left">
β¬
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="#retention_policy">
RETENTION_POLICY
</a>
</td>
<td style="text-align:left">
β
</td>
<td style="text-align:left">
β¬
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="#duplicate_policy">
DUPLICATE_POLICY
</a>
</td>
<td style="text-align:left">
β
</td>
<td style="text-align:left">
β¬
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="#encoding">
ENCODING
</a>
(since RedisTimeSeries v1.6)
</td>
<td style="text-align:left">
β
</td>
<td style="text-align:left">
β¬
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="#chunk_size_bytes">
CHUNK_SIZE_BYTES
</a>
</td>
<td style="text-align:left">
β
</td>
<td style="text-align:left">
β¬
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="#oss_global_password">
OSS_GLOBAL_PASSWORD
</a>
(since RedisTimeSeries v1.8.4)
</td>
<td style="text-align:left">
β
</td>
<td style="text-align:left">
β¬
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="#ignore_max_time_diff-and-ignore_max_val_diff">
IGNORE_MAX_TIME_DIFF
</a>
(since RedisTimeSeries v1.12)
</td>
<td style="text-align:left">
β
</td>
<td style="text-align:left">
β¬
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="#ignore_max_time_diff-and-ignore_max_val_diff">
IGNORE_MAX_VAL_DIFF
</a>
(since RedisTimeSeries v1.12)
</td>
<td style="text-align:left">
β
</td>
<td style="text-align:left">
β¬
</td>
</tr>
</tbody>
</table>
<h3 id="num_threads">
NUM_THREADS
</h3>
<p>
The maximal number of per-shard threads for cross-key queries when using cluster mode (TS.MRANGE, TS.MREVRANGE, TS.MGET, and TS.QUERYINDEX). The value must be equal to or greater than 1. Note that increasing this value may either increase or decrease the performance!
</p>
<h4 id="default">
Default
</h4>
<p>
<code>
3
</code>
</p>
<h4 id="example">
Example
</h4>
<pre tabindex="0"><code>$ redis-server --loadmodule ./redistimeseries.so NUM_THREADS 3
</code></pre>
<h3 id="compaction_policy">
COMPACTION_POLICY
</h3>
<p>
Default compaction rules for newly created key with
<a href="/docs/latest/commands/ts.add/">
<code>
TS.ADD
</code>
</a>
,
<a href="/docs/latest/commands/ts.incrby/">
<code>
TS.INCRBY
</code>
</a>
, and
<a href="/docs/latest/commands/ts.decrby/">
<code>
TS.DECRBY
</code>
</a>
.
</p>
<p>
Note that
<code>
COMPACTION_POLICY
</code>
has no effect on keys created with
<a href="/docs/latest/commands/ts.create/">
<code>
TS.CREATE
</code>
</a>
. To understand the motivation for this behavior, consider the following scenario: Suppose a
<code>
COMPACTION_POLICY
</code>
is defined, but then one wants to manually create an additional compaction rule (using
<a href="/docs/latest/commands/ts.createrule/">
<code>
TS.CREATERULE
</code>
</a>
) which requires first creating an empty destination key (using
<a href="/docs/latest/commands/ts.create/">
<code>
TS.CREATE
</code>
</a>
). But now there is a problem: due to the
<code>
COMPACTION_POLICY
</code>
, automatic compactions would be undesirably created for that destination key.
</p>
<p>
Each rule is separated by a semicolon (
<code>
;
</code>
), the rule consists of multiple fields that are separated by a colon (
<code>
:
</code>
):
</p>
<ul>
<li>
<p>
Aggregation type: One of the following:
</p>
<table>
<thead>
<tr>
<th>
aggregator
</th>
<th>
description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>
avg
</code>
</td>
<td>
arithmetic mean of all values
</td>
</tr>
<tr>
<td>
<code>
sum
</code>
</td>
<td>
sum of all values
</td>
</tr>
<tr>
<td>
<code>
min
</code>
</td>
<td>
minimum value
</td>
</tr>
<tr>
<td>
<code>
max
</code>
</td>
<td>
maximum value
</td>
</tr>
<tr>
<td>
<code>
range
</code>
</td>
<td>
difference between the highest and the lowest value
</td>
</tr>
<tr>
<td>
<code>
count
</code>
</td>
<td>
number of values
</td>
</tr>
<tr>
<td>
<code>
first
</code>
</td>
<td>
the value with the lowest timestamp in the bucket
</td>
</tr>
<tr>
<td>
<code>
last
</code>
</td>
<td>
the value with the highest timestamp in the bucket
</td>
</tr>
<tr>
<td>
<code>
std.p
</code>
</td>
<td>
population standard deviation of the values
</td>
</tr>
<tr>
<td>
<code>
std.s
</code>
</td>
<td>
sample standard deviation of the values
</td>
</tr>
<tr>
<td>
<code>
var.p
</code>
</td>
<td>
population variance of the values
</td>
</tr>
<tr>
<td>
<code>
var.s
</code>
</td>
<td>
sample variance of the values
</td>
</tr>
<tr>
<td>
<code>
twa
</code>
</td>
<td>
time-weighted average of all values (since RedisTimeSeries v1.8)
</td>
</tr>
</tbody>
</table>
</li>
<li>
<p>
Duration of each time bucket - number and the time representation (Example for one minute:
<code>
1M
</code>
,
<code>
60s
</code>
, or
<code>
60000m
</code>
)
</p>
<ul>
<li>
m - millisecond
</li>
<li>
s - seconds
</li>
<li>
M - minute
</li>
<li>
h - hour
</li>
<li>
d - day
</li>
</ul>
</li>
<li>
<p>
Retention time - number and the time representation (Example for one minute:
<code>
1M
</code>
,
<code>
60s
</code>
, or
<code>
60000m
</code>
)
</p>
<ul>
<li>
m - millisecond
</li>
<li>
s - seconds
</li>
<li>
M - minute
</li>
<li>
h - hour
</li>
<li>
d - day
</li>
</ul>
<p>
<code>
0m
</code>
,
<code>
0s
</code>
,
<code>
0M
</code>
,
<code>
0h
</code>
, or
<code>
0d
</code>
means no expiration.
</p>
</li>
<li>
<p>
(since RedisTimeSeries v1.8):
</p>
<p>
Optional: Time bucket alignment - number and the time representation (Example for one minute:
<code>
1M
</code>
,
<code>
60s
</code>
, or
<code>
60000m
</code>
)
</p>
<ul>
<li>
m - millisecond
</li>
<li>
s - seconds
</li>
<li>
M - minute
</li>
<li>
h - hour
</li>
<li>
d - day
</li>
</ul>
<p>
Assure that there is a bucket that starts at exactly
<em>
alignTimestamp
</em>
after the epoch and align all other buckets accordingly. Default value: 0 (aligned with the epoch). Example: if
<em>
bucketDuration
</em>
is 24 hours, setting
<em>
alignTimestamp
</em>
to
<code>
6h
</code>
(6 hours after the Epoch) will ensure that each bucketβs timeframe is [06:00 .. 06:00).
</p>
</li>
</ul>
<p>
When a compaction policy is defined, compaction rules will be created automatically for newly created time series, and their key would be set to:
</p>
<ul>
<li>
<p>
Before RedisTimeSeries v1.8:
</p>
<p>
<em>
key_dur_agg
</em>
where
<em>
key
</em>
is the key of the source time series,
<em>
dur
</em>
is the bucket duration, and
<em>
agg
</em>
is the aggregator.
</p>
</li>
<li>
<p>
Since RedisTimeSeries v1.8:
</p>
<p>
<em>
key_dur_agg_aln
</em>
where
<em>
key
</em>
is the key of the source time series,
<em>
dur
</em>
is the bucket duration,
<em>
agg
</em>
is the aggregator, and
<em>
aln
</em>
is the alignment timestamp.
</p>
</li>
</ul>
<p>
Examples:
</p>
<ul>
<li>
<code>
max:1M:1h
</code>
- Aggregate using
<code>
max
</code>
over one minute and retain the last hour
</li>
<li>
<code>
twa:1d:0m:360M
</code>
- Aggregate daily [06:00 .. 06:00) using
<code>
twa
</code>
; no expiration
</li>
</ul>
<h4 id="default-1">
Default
</h4>
<p>
No compaction rules.
</p>
<h4 id="example-1">
Example
</h4>
<pre tabindex="0"><code>$ redis-server --loadmodule ./redistimeseries.so COMPACTION_POLICY max:1m:1h;min:10s:5d:10d;last:5M:10m;avg:2h:10d;avg:3d:100d
</code></pre>
<h3 id="retention_policy">
RETENTION_POLICY
</h3>
<p>
Default retention period, in milliseconds, for newly created keys.
</p>
<p>
Retention period is the maximum age of samples compared to highest reported timestamp, per key. Samples are expired based solely on the difference between their timestamp and the timestamps passed to subsequent
<a href="/docs/latest/commands/ts.add/">
<code>
TS.ADD
</code>
</a>
,
<a href="/docs/latest/commands/ts.madd/">
<code>
TS.MADD
</code>
</a>
,
<a href="/docs/latest/commands/ts.incrby/">
<code>
TS.INCRBY
</code>
</a>
, and
<a href="/docs/latest/commands/ts.decrby/">
<code>
TS.DECRBY
</code>
</a>
calls.
</p>
<p>
The value
<code>
0
</code>
means no expiration.
</p>
<p>
When both
<code>
COMPACTION_POLICY
</code>
and
<code>
RETENTION_POLICY
</code>
are specified, the retention of newly created compactions is according to the retention time specified in
<code>
COMPACTION_POLICY
</code>
.
</p>
<h4 id="default-2">
Default
</h4>
<p>
0
</p>
<h4 id="example-2">
Example
</h4>
<p>
Setting the default retention to 300 days:
</p>
<pre tabindex="0"><code>$ redis-server --loadmodule ./redistimeseries.so RETENTION_POLICY 25920000000
</code></pre>
<h3 id="duplicate_policy">
DUPLICATE_POLICY
</h3>
<p>
Is policy for handling insertion (
<a href="/docs/latest/commands/ts.add/">
<code>
TS.ADD
</code>
</a>
and
<a href="/docs/latest/commands/ts.madd/">
<code>
TS.MADD
</code>
</a>
) of multiple samples with identical timestamps, with one of the following values:
</p>
<table>
<thead>
<tr>
<th>
policy
</th>
<th>
description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>
BLOCK
</code>
</td>
<td>
ignore any newly reported value and reply with an error
</td>
</tr>
<tr>
<td>
<code>
FIRST
</code>
</td>
<td>
ignore any newly reported value
</td>
</tr>
<tr>
<td>
<code>
LAST
</code>
</td>
<td>
override with the newly reported value
</td>
</tr>
<tr>
<td>
<code>
MIN
</code>
</td>
<td>
only override if the value is lower than the existing value
</td>
</tr>
<tr>
<td>
<code>
MAX
</code>
</td>
<td>
only override if the value is higher than the existing value
</td>
</tr>
<tr>
<td>
<code>
SUM
</code>
</td>
<td>
If a previous sample exists, add the new sample to it so that the updated value is equal to (previous + new). If no previous sample exists, set the updated value equal to the new value.
</td>
</tr>
</tbody>
</table>
<h4 id="precedence-order">
Precedence order
</h4>
<p>
Since the duplication policy can be provided at different levels, the actual precedence of the used policy will be:
</p>
<ol>
<li>
<a href="/docs/latest/commands/ts.add/">
<code>
TS.ADD
</code>
</a>
's
<code>
ON_DUPLICATE_policy
</code>
optional argument
</li>
<li>
Key-level policy (as set with
<a href="/docs/latest/commands/ts.create/">
<code>
TS.CREATE
</code>
</a>
's and
<a href="/docs/latest/commands/ts.alter/">
<code>
TS.ALTER
</code>
</a>
's
<code>
DUPLICATE_POLICY
</code>
optional argument)
</li>
<li>
The
<code>
DUPLICATE_POLICY
</code>
module configuration parameter
</li>
<li>
The default policy
</li>
</ol>
<h4 id="default-3">
Default
</h4>
<p>
The default policy is
<code>
BLOCK
</code>
. Both new and pre-existing keys will conform to this default policy.
</p>
<h4 id="example-3">
Example
</h4>
<pre tabindex="0"><code>$ redis-server --loadmodule ./redistimeseries.so DUPLICATE_POLICY LAST
</code></pre>
<h3 id="encoding">
ENCODING
</h3>
<p>
Default chunk encoding for automatically created keys when
<a href="#COMPACTION_POLICY">
COMPACTION_POLICY
</a>
is configured.
</p>
<p>
Possible values:
<code>
COMPRESSED
</code>
,
<code>
UNCOMPRESSED
</code>
.
</p>
<p>
Note: Before RedisTimeSeries 1.6 this configuration parameter was named
<code>
CHUNK_TYPE
</code>
.
</p>
<h4 id="default-4">
Default
</h4>
<p>
<code>
COMPRESSED
</code>
</p>
<h4 id="example-4">
Example
</h4>
<pre tabindex="0"><code>$ redis-server --loadmodule ./redistimeseries.so COMPACTION_POLICY max:1m:1h; ENCODING COMPRESSED
</code></pre>
<h3 id="chunk_size_bytes">
CHUNK_SIZE_BYTES
</h3>
<p>
Default initial allocation size, in bytes, for the data part of each new chunk, for newly created time series. Actual chunks may consume more memory.
</p>
<h4 id="default-5">
Default
</h4>
<p>
4096
</p>
<h4 id="example-5">
Example
</h4>
<pre tabindex="0"><code>$ redis-server --loadmodule ./redistimeseries.so COMPACTION_POLICY max:1m:1h; CHUNK_SIZE_BYTES 2048
</code></pre>
<h3 id="oss_global_password">
OSS_GLOBAL_PASSWORD
</h3>
<p>
Global Redis Community Edition cluster password used for connecting to other shards.
</p>
<h4 id="default-6">
Default
</h4>
<p>
Not set
</p>
<h4 id="example-6">
Example
</h4>
<pre tabindex="0"><code>$ redis-server --loadmodule ./redistimeseries.so OSS_GLOBAL_PASSWORD password
</code></pre>
<h3 id="ignore_max_time_diff-and-ignore_max_val_diff">
IGNORE_MAX_TIME_DIFF and IGNORE_MAX_VAL_DIFF
</h3>
<p>
Default values for newly created keys.
</p>
<p>
Many sensors report data periodically. Often, the difference between the measured value and the previous measured value is negligible and related to random noise or to measurement accuracy limitations. In such situations it may be preferable not to add the new measurement to the time series.
</p>
<p>
A new sample is considered a duplicate and is ignored if the following conditions are met:
</p>
<ol>
<li>
The time series is not a compaction;
</li>
<li>
The time series'
<code>
DUPLICATE_POLICY
</code>
IS
<code>
LAST
</code>
;
</li>
<li>
The sample is added in-order (
<code>
timestamp β₯ max_timestamp
</code>
);
</li>
<li>
The difference of the current timestamp from the previous timestamp (
<code>
timestamp - max_timestamp
</code>
) is less than or equal to
<code>
IGNORE_MAX_TIME_DIFF
</code>
;
</li>
<li>
The absolute value difference of the current value from the value at the previous maximum timestamp (
<code>
abs(value - value_at_max_timestamp
</code>
) is less than or equal to
<code>
IGNORE_MAX_VAL_DIFF
</code>
.
</li>
</ol>
<p>
where
<code>
max_timestamp
</code>
is the timestamp of the sample with the largest timestamp in the time series, and
<code>
value_at_max_timestamp
</code>
is the value at
<code>
max_timestamp
</code>
.
</p>
<h4 id="defaults">
Defaults
</h4>
<p>
<code>
IGNORE_MAX_TIME_DIFF
</code>
: 0
</p>
<p>
<code>
IGNORE_MAX_VAL_DIFF
</code>
: 0.0
</p>
<h4 id="example-7">
Example
</h4>
<pre tabindex="0"><code>$ redis-server --loadmodule ./redistimeseries.so IGNORE_MAX_TIME_DIFF 1 IGNORE_MAX_VALUE_DIFF 0.1
</code></pre>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/develop/data-types/timeseries/configuration/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/7.4/references/rest-api/requests/suffix/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Suffix requests
</h1>
<p class="text-lg -mt-5 mb-10">
DNS suffix requests
</p>
<table>
<thead>
<tr>
<th>
Method
</th>
<th>
Path
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="#get-suffix">
GET
</a>
</td>
<td>
<code>
/v1/suffix/{name}
</code>
</td>
<td>
Get a single DNS suffix
</td>
</tr>
</tbody>
</table>
<h2 id="get-suffix">
Get suffix
</h2>
<pre><code>GET /v1/suffix/{string: name}
</code></pre>
<p>
Get a single DNS suffix.
</p>
<h3 id="get-request">
Request
</h3>
<h4 id="example-http-request">
Example HTTP request
</h4>
<pre><code>GET /suffix/cluster.fqdn
</code></pre>
<h4 id="request-headers">
Request headers
</h4>
<table>
<thead>
<tr>
<th>
Key
</th>
<th>
Value
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
Host
</td>
<td>
cnm.cluster.fqdn
</td>
<td>
Domain name
</td>
</tr>
<tr>
<td>
Accept
</td>
<td>
application/json
</td>
<td>
Accepted media type
</td>
</tr>
</tbody>
</table>
<h4 id="url-parameters">
URL parameters
</h4>
<table>
<thead>
<tr>
<th>
Field
</th>
<th>
Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
name
</td>
<td>
string
</td>
<td>
The unique name of the suffix requested.
</td>
</tr>
</tbody>
</table>
<h3 id="get-response">
Response
</h3>
<p>
Returns a
<a href="/docs/latest/operate/rs/7.4/references/rest-api/objects/suffix/">
suffix object
</a>
.
</p>
<h4 id="example-json-body">
Example JSON body
</h4>
<div class="highlight">
<pre class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"name"</span><span class="p">:</span> <span class="s2">"cluster.fqdn"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"// additional fields..."</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span></code></pre>
</div>
<h3 id="get-status-codes">
Status codes
</h3>
<table>
<thead>
<tr>
<th>
Code
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1">
200 OK
</a>
</td>
<td>
No error
</td>
</tr>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5">
404 Not Found
</a>
</td>
<td>
Suffix name does not exist
</td>
</tr>
</tbody>
</table>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/references/rest-api/requests/suffix/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/oss_and_stack/reference/arm/.html | <section class="prose w-full py-12 max-w-none">
<h1>
ARM support
</h1>
<p class="text-lg -mt-5 mb-10">
Exploring Redis on the ARM CPU Architecture
</p>
<p>
Redis versions 4.0 and above support the ARM processor in general, and
the Raspberry Pi specifically, as a main platform. Every new release of Redis is tested on the Pi
environment, and we update this documentation page with information about supported devices and other useful information. While Redis does run on Android, in the future we look forward to extend our testing efforts to Android
to also make it an officially supported platform.
</p>
<p>
We believe that Redis is ideal for IoT and embedded devices for several
reasons:
</p>
<ul>
<li>
Redis has a very small memory footprint and CPU requirements. It can run in small devices like the Raspberry Pi Zero without impacting the overall performance, using a small amount of memory while delivering good performance for many use cases.
</li>
<li>
The data structures of Redis are often an ideal way to model IoT/embedded use cases. Some examples include accumulating time series data, receiving or queuing commands to execute or respond to send back to the remote servers, and so forth.
</li>
<li>
Modeling data inside Redis can be very useful in order to make in-device decisions for appliances that must respond very quickly or when the remote servers are offline.
</li>
<li>
Redis can be used as a communication system between the processes running in the device.
</li>
<li>
The append-only file storage of Redis is well suited for SSD cards.
</li>
<li>
The stream data structure included in Redis versions 5.0 and higher was specifically designed for time series applications and has a very low memory overhead.
</li>
</ul>
<h2 id="redis-proccpualignment-requirements">
Redis /proc/cpu/alignment requirements
</h2>
<p>
Linux on ARM allows to trap unaligned accesses and fix them inside the kernel
in order to continue the execution of the offending program instead of
generating a
<code>
SIGBUS
</code>
. Redis 4.0 and greater are fixed in order to avoid any kind
of unaligned access, so there is no need to have a specific value for this
kernel configuration. Even when kernel alignment fixing set as disabled Redis should
run as expected.
</p>
<h2 id="building-redis-in-the-pi">
Building Redis in the Pi
</h2>
<ul>
<li>
Download Redis version 4.0 or higher.
</li>
<li>
Use
<code>
make
</code>
as usual to create the executable.
</li>
</ul>
<p>
There is nothing special in the process. The only difference is that by
default, Redis uses the
<code>
libc
</code>
allocator instead of defaulting to
<code>
jemalloc
</code>
as it does in other Linux based environments. This is because we believe
that for the small use cases inside embedded devices, memory fragmentation
is unlikely to be a problem. Moreover
<code>
jemalloc
</code>
on ARM may not be as tested
as the
<code>
libc
</code>
allocator.
</p>
<h2 id="performance">
Performance
</h2>
<p>
Performance testing of Redis was performed on the Raspberry Pi 3 and Pi 1 model B. The difference between the two Pis in terms of delivered performance is quite big. The benchmarks were performed via the
loopback interface, since most use cases will probably use Redis from within
the device and not via the network. The following numbers were obtained using
Redis 4.0.
</p>
<p>
Raspberry Pi 3:
</p>
<ul>
<li>
Test 1 : 5 millions writes with 1 million keys (even distribution among keys). No persistence, no pipelining. 28,000 ops/sec.
</li>
<li>
Test 2: Like test 1 but with pipelining using groups of 8 operations: 80,000 ops/sec.
</li>
<li>
Test 3: Like test 1 but with AOF enabled, fsync 1 sec: 23,000 ops/sec
</li>
<li>
Test 4: Like test 3, but with an AOF rewrite in progress: 21,000 ops/sec
</li>
</ul>
<p>
Raspberry Pi 1 model B:
</p>
<ul>
<li>
Test 1 : 5 millions writes with 1 million keys (even distribution among keys). No persistence, no pipelining. 2,200 ops/sec.
</li>
<li>
Test 2: Like test 1 but with pipelining using groups of 8 operations: 8,500 ops/sec.
</li>
<li>
Test 3: Like test 1 but with AOF enabled, fsync 1 sec: 1,820 ops/sec
</li>
<li>
Test 4: Like test 3, but with an AOF rewrite in progress: 1,000 ops/sec
</li>
</ul>
<p>
The benchmarks above are referring to simple
<a href="/commands/set">
<code>
SET
</code>
</a>
/
<a href="/commands/get">
<code>
GET
</code>
</a>
operations. The performance is similar for all the Redis fast operations (not running in linear time). However sorted sets may show slightly slower numbers.
</p>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/oss_and_stack/reference/arm/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/release-notes/legacy-release-notes/rs-5-5-preview-april-2019/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Redis Enterprise Software Release Notes 5.5 Preview (April 2019)
</h1>
<p class="text-lg -mt-5 mb-10">
Preview release. Databases support multiple modules.
</p>
<p>
Redis Enterprise Software (RS) 5.5 Preview Edition is now available.
</p>
<p>
RS 5.5 is a preview version that includes all the capabilities of Redis Enterprise 5.4,
plus support for creation of Redis databases with multiple modules and support for these modules:
</p>
<ul>
<li>
RediSearch (GA)
</li>
<li>
RedisGraph (GA)
</li>
<li>
RedisBloom (GA)
</li>
<li>
RedisJSON (GA)
</li>
<li>
RedisAI (Preview Version)
</li>
<li>
RedisTimeSeries (Preview Version)
</li>
<li>
RedisGears (Preview Version)
</li>
</ul>
<h2 id="new-features">
New features
</h2>
<p>
RS 5.5 lets you create Redis databases with multiple Redis modules.
</p>
<video autoplay="" class="video" controls="" loop="" muted="" playsinline="" preload="auto" title="Adding multiple modules" width="100%">
<source src="/images/rs/multiple-modules.mp4" type="video/mp4"/>
</video>
<h2 id="preview-considerations">
Preview considerations
</h2>
<p>
This preview version is a standalone version and is not supported for production environments.
You cannot upgrade to it from a lower version or upgrade from it to a higher version.
Unexpected behaviors/issues found in this release will be addressed in future releases.
</p>
<p>
This preview version is not supported for networks that are isolated from the internet.
</p>
<h2 id="installation-instructions">
Installation instructions
</h2>
<p>
To set up a cluster with nodes that can host databases with multiple modules, you must follow this procedure on each node in the cluster:
</p>
<ol>
<li>
<a href="/docs/latest/operate/rs/installing-upgrading/quickstarts/redis-enterprise-software-quickstart/">
Install RS 5.5
</a>
.
</li>
<li>
To install the modules, run:
<code>
sudo ./install-modules.sh
</code>
</li>
<li>
Either:
<ul>
<li>
Set up the node as the
<a href="/docs/latest/operate/rs/clusters/new-cluster-setup/">
first node in the cluster
</a>
.
</li>
<li>
<a href="/docs/latest/operate/rs/clusters/add-node/">
Join the node to an existing cluster
</a>
.
</li>
</ul>
</li>
</ol>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/release-notes/legacy-release-notes/rs-5-5-preview-april-2019/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/develop/interact/search-and-query/basic-constructs/configuration-parameters/.html | <section class="prose w-full py-12">
<h1>
Configuration parameters
</h1>
<p class="text-lg -mt-5 mb-10">
Querying and searching in Redis Stack can be tuned through multiple configuration parameters. Some of these parameters can only be set at load-time, while other parameters can be set either at load-time or at run-time.
</p>
<h2 id="set-configuration-parameters-at-module-load-time">
Set configuration parameters at module load-time
</h2>
<p>
Setting configuration parameters at load-time is done by appending arguments after the
<code>
--loadmodule
</code>
argument when starting a server from the command line, or after the
<code>
loadmodule
</code>
directive in a Redis config file. For example:
</p>
<p>
In
<a href="/docs/latest/operate/oss_and_stack/management/config/">
redis.conf
</a>
:
</p>
<pre tabindex="0"><code>loadmodule ./redisearch.so [OPT VAL]...
</code></pre>
<p>
From the
<a href="/docs/latest/develop/tools/cli/">
Redis CLI
</a>
, using the
<a href="/docs/latest/commands/module-load/">
MODULE LOAD
</a>
command:
</p>
<pre tabindex="0"><code>127.0.0.6379> MODULE LOAD redisearch.so [OPT VAL]...
</code></pre>
<p>
From the command line:
</p>
<pre tabindex="0"><code>$ redis-server --loadmodule ./redisearch.so [OPT VAL]...
</code></pre>
<h2 id="set-configuration-parameters-at-run-time-for-supported-parameters">
Set configuration parameters at run-time (for supported parameters)
</h2>
<p>
RediSearch exposes the
<code>
FT.CONFIG
</code>
endpoint to allow for the setting and retrieval of configuration parameters at run-time.
</p>
<p>
To set the value of a configuration parameter at run-time (for supported parameters), simply run:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">FT.CONFIG SET OPT1 VAL1
</span></span></code></pre>
</div>
<p>
Similarly, you can retrieve current configuration parameter values using:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">FT.CONFIG GET OPT1
</span></span><span class="line"><span class="cl">FT.CONFIG GET *
</span></span></code></pre>
</div>
<p>
Values set using
<a href="/docs/latest/commands/ft.config-set/">
<code>
FT.CONFIG SET
</code>
</a>
are not persisted after server restart.
</p>
<h2 id="redisearch-configuration-parameters">
RediSearch configuration parameters
</h2>
<p>
The following table summarizes which configuration parameters can be set at module load-time and run-time:
</p>
<table>
<thead>
<tr>
<th style="text-align:left">
Configuration Parameter
</th>
<th style="text-align:left">
Load-time
</th>
<th style="text-align:left">
Run-time
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">
<a href="#timeout">
TIMEOUT
</a>
</td>
<td style="text-align:left">
β
</td>
<td style="text-align:left">
β
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="#on_timeout">
ON_TIMEOUT
</a>
</td>
<td style="text-align:left">
β
</td>
<td style="text-align:left">
β
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="#safemode">
SAFEMODE
</a>
deprecated in v1.6
</td>
<td style="text-align:left">
β
</td>
<td style="text-align:left">
β
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="#concurrent_write_mode">
CONCURRENT_WRITE_MODE
</a>
</td>
<td style="text-align:left">
β
</td>
<td style="text-align:left">
β
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="#extload">
EXTLOAD
</a>
</td>
<td style="text-align:left">
β
</td>
<td style="text-align:left">
β
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="#minprefix">
MINPREFIX
</a>
</td>
<td style="text-align:left">
β
</td>
<td style="text-align:left">
β
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="#minstemlen">
MINSTEMLEN
</a>
</td>
<td style="text-align:left">
β
</td>
<td style="text-align:left">
β
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="#maxprefixexpansions">
MAXPREFIXEXPANSIONS
</a>
</td>
<td style="text-align:left">
β
</td>
<td style="text-align:left">
β
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="#maxdoctablesize">
MAXDOCTABLESIZE
</a>
</td>
<td style="text-align:left">
β
</td>
<td style="text-align:left">
β
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="#maxsearchresults">
MAXSEARCHRESULTS
</a>
</td>
<td style="text-align:left">
β
</td>
<td style="text-align:left">
β
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="#maxaggregateresults">
MAXAGGREGATERESULTS
</a>
</td>
<td style="text-align:left">
β
</td>
<td style="text-align:left">
β
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="#frisoini">
FRISOINI
</a>
</td>
<td style="text-align:left">
β
</td>
<td style="text-align:left">
β
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="#cursor_max_idle">
CURSOR_MAX_IDLE
</a>
</td>
<td style="text-align:left">
β
</td>
<td style="text-align:left">
β
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="#partial_indexed_docs">
PARTIAL_INDEXED_DOCS
</a>
</td>
<td style="text-align:left">
β
</td>
<td style="text-align:left">
β
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="#gc_scansize">
GC_SCANSIZE
</a>
</td>
<td style="text-align:left">
β
</td>
<td style="text-align:left">
β¬
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="#gc_policy">
GC_POLICY
</a>
</td>
<td style="text-align:left">
β
</td>
<td style="text-align:left">
β
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="#nogc">
NOGC
</a>
</td>
<td style="text-align:left">
β
</td>
<td style="text-align:left">
β
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="#fork_gc_run_interval">
FORK_GC_RUN_INTERVAL
</a>
</td>
<td style="text-align:left">
β
</td>
<td style="text-align:left">
β
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="#fork_gc_retry_interval">
FORK_GC_RETRY_INTERVAL
</a>
</td>
<td style="text-align:left">
β
</td>
<td style="text-align:left">
β
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="#fork_gc_clean_threshold">
FORK_GC_CLEAN_THRESHOLD
</a>
</td>
<td style="text-align:left">
β
</td>
<td style="text-align:left">
β
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="#upgrade_index">
UPGRADE_INDEX
</a>
</td>
<td style="text-align:left">
β
</td>
<td style="text-align:left">
β
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="#oss_global_password">
OSS_GLOBAL_PASSWORD
</a>
</td>
<td style="text-align:left">
β
</td>
<td style="text-align:left">
β¬
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="#default_dialect">
DEFAULT_DIALECT
</a>
</td>
<td style="text-align:left">
β
</td>
<td style="text-align:left">
β
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="#vss_max_resize">
VSS_MAX_RESIZE
</a>
</td>
<td style="text-align:left">
β
</td>
<td style="text-align:left">
β
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="#index_cursor_limit">
INDEX_CURSOR_LIMIT
</a>
</td>
<td style="text-align:left">
β
</td>
<td style="text-align:left">
β
</td>
</tr>
</tbody>
</table>
<hr/>
<h3 id="timeout">
TIMEOUT
</h3>
<p>
The maximum amount of time in milliseconds that a search query is allowed to run. If this time is exceeded, Redis returns the top results accumulated so far, or an error depending on the policy set with
<code>
ON_TIMEOUT
</code>
. The timeout can be disabled by setting it to 0.
</p>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Notes:
</div>
<ul>
<li>
<code>
TIMEOUT
</code>
refers to query time only.
</li>
<li>
Parsing the query is not counted towards
<code>
TIMEOUT
</code>
.
</li>
<li>
If
<code>
TIMEOUT
</code>
was not reached during the search, finalizing operations such as loading document content or reducers continue.
</li>
</ul>
</div>
</div>
<h4 id="default">
Default
</h4>
<p>
500
</p>
<h4 id="example">
Example
</h4>
<pre tabindex="0"><code>$ redis-server --loadmodule ./redisearch.so TIMEOUT 100
</code></pre>
<hr/>
<h3 id="on_timeout">
ON_TIMEOUT
</h3>
<p>
The response policy for queries that exceed the
<code>
TIMEOUT
</code>
setting can be one of the following:
</p>
<ul>
<li>
<strong>
RETURN
</strong>
: this policy will return the top results accumulated by the query until it timed out.
</li>
<li>
<strong>
FAIL
</strong>
: will return an error when the query exceeds the timeout value.
</li>
</ul>
<h4 id="default-1">
Default
</h4>
<p>
RETURN
</p>
<h4 id="example-1">
Example
</h4>
<pre tabindex="0"><code>$ redis-server --loadmodule ./redisearch.so ON_TIMEOUT fail
</code></pre>
<hr/>
<h3 id="safemode">
SAFEMODE
</h3>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Deprecated:
</div>
Deprecated in v1.6. From this version, SAFEMODE is the default. If you would still like to re-enable the concurrent mode for writes, use
<a href="#concurrent_write_mode">
CONCURRENT_WRITE_MODE
</a>
.
</div>
</div>
<p>
If present in the argument list, RediSearch will turn off concurrency for query processing and work in a single thread.
</p>
<p>
This is useful if data consistency is extremely important, and avoids a situation where deletion of documents while querying them can cause momentarily inconsistent results. For example, documents that were valid during the invocation of the query are not returned because they were deleted during query processing.
</p>
<h4 id="default-2">
Default
</h4>
<p>
Off (not present)
</p>
<h4 id="example-2">
Example
</h4>
<pre tabindex="0"><code>$ redis-server --loadmodule ./redisearch.so SAFEMODE
</code></pre>
<hr/>
<h3 id="concurrent_write_mode">
CONCURRENT_WRITE_MODE
</h3>
<p>
If enabled, write queries will be performed concurrently, but only the tokenization part is executed concurrently. The actual write operation still requires holding the Redis Global Lock.
</p>
<h4 id="default-3">
Default
</h4>
<p>
Not set - "disabled"
</p>
<h4 id="example-3">
Example
</h4>
<pre tabindex="0"><code>$ redis-server --loadmodule ./redisearch.so CONCURRENT_WRITE_MODE
</code></pre>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Note:
</div>
<ul>
<li>
Added in v1.6
</li>
</ul>
</div>
</div>
<hr/>
<h3 id="extload">
EXTLOAD
</h3>
<p>
If present, RediSearch will try to load an extension dynamic library from its specified file path. See
<a href="/docs/latest/develop/interact/search-and-query/administration/extensions/">
Extensions
</a>
for details.
</p>
<h4 id="default-4">
Default
</h4>
<p>
None
</p>
<h4 id="example-4">
Example
</h4>
<pre tabindex="0"><code>$ redis-server --loadmodule ./redisearch.so EXTLOAD ./ext/my_extension.so
</code></pre>
<hr/>
<h3 id="minprefix">
MINPREFIX
</h3>
<p>
The minimum number of characters allowed for prefix queries (e.g.,
<code>
hel*
</code>
). Setting it to 1 can hurt performance.
</p>
<h4 id="default-5">
Default
</h4>
<p>
2
</p>
<h4 id="example-5">
Example
</h4>
<pre tabindex="0"><code>$ redis-server --loadmodule ./redisearch.so MINPREFIX 3
</code></pre>
<hr/>
<h3 id="minstemlen">
MINSTEMLEN
</h3>
<p>
The minimum word length to stem. The default value is
<code>
4
</code>
. Setting it lower than
<code>
4
</code>
can reduce performance.
</p>
<h4 id="default-6">
Default
</h4>
<p>
4
</p>
<h4 id="example-6">
Example
</h4>
<pre tabindex="0"><code>$ redis-server --loadmodule ./redisearch.so MINSTEMLEN 3
</code></pre>
<hr/>
<h3 id="maxprefixexpansions">
MAXPREFIXEXPANSIONS
</h3>
<p>
The maximum number of expansions allowed for query prefixes. Setting it too high can cause performance issues. If MAXPREFIXEXPANSIONS is reached, the query will continue with the first acquired results. The configuration is applicable for all affix queries including prefix, suffix, and infix (contains) queries.
</p>
<h4 id="default-7">
Default
</h4>
<p>
200
</p>
<h4 id="example-7">
Example
</h4>
<pre tabindex="0"><code>$ redis-server --loadmodule ./redisearch.so MAXPREFIXEXPANSIONS 1000
</code></pre>
<hr/>
<h3 id="maxdoctablesize">
MAXDOCTABLESIZE
</h3>
<p>
The maximum size of the internal hash table used for storing the documents.
Note: this configuration option doesn't limit the number of documents that can be stored. It only affects the hash table internal array maximum size.
Decreasing this property can decrease the memory overhead in cases where the index holds a small number of documents that are constantly updated.
</p>
<h4 id="default-8">
Default
</h4>
<p>
1000000
</p>
<h4 id="example-8">
Example
</h4>
<pre tabindex="0"><code>$ redis-server --loadmodule ./redisearch.so MAXDOCTABLESIZE 3000000
</code></pre>
<hr/>
<h3 id="maxsearchresults">
MAXSEARCHRESULTS
</h3>
<p>
The maximum number of results to be returned by the
<a href="/docs/latest/commands/ft.search/">
<code>
FT.SEARCH
</code>
</a>
command if LIMIT is used.
Setting value to
<code>
-1
</code>
will remove the limit.
</p>
<h4 id="default-9">
Default
</h4>
<p>
1000000
</p>
<h4 id="example-9">
Example
</h4>
<pre tabindex="0"><code>$ redis-server --loadmodule ./redisearch.so MAXSEARCHRESULTS 3000000
</code></pre>
<hr/>
<h3 id="maxaggregateresults">
MAXAGGREGATERESULTS
</h3>
<p>
The maximum number of results to be returned by the
<a href="/docs/latest/commands/ft.aggregate/">
<code>
FT.AGGREGATE
</code>
</a>
command if LIMIT is used.
Setting value to
<code>
-1
</code>
will remove the limit.
</p>
<h4 id="default-10">
Default
</h4>
<p>
unlimited
</p>
<h4 id="example-10">
Example
</h4>
<pre tabindex="0"><code>$ redis-server --loadmodule ./redisearch.so MAXAGGREGATERESULTS 3000000
</code></pre>
<hr/>
<h3 id="frisoini">
FRISOINI
</h3>
<p>
If present, load the custom Chinese dictionary from the specified path. See
<a href="/docs/latest/develop/interact/search-and-query/advanced-concepts/chinese#using-custom-dictionaries">
Using custom dictionaries
</a>
for more details.
</p>
<h4 id="default-11">
Default
</h4>
<p>
Not set
</p>
<h4 id="example-11">
Example
</h4>
<pre tabindex="0"><code>$ redis-server --loadmodule ./redisearch.so FRISOINI /opt/dict/friso.ini
</code></pre>
<hr/>
<h3 id="cursor_max_idle">
CURSOR_MAX_IDLE
</h3>
<p>
The maximum idle time (in ms) that can be set to the
<a href="/docs/latest/develop/interact/search-and-query/advanced-concepts/aggregations#cursor-api">
cursor api
</a>
.
</p>
<h4 id="default-12">
Default
</h4>
<p>
300000
</p>
<h4 id="example-12">
Example
</h4>
<pre tabindex="0"><code>$ redis-server --loadmodule ./redisearch.so CURSOR_MAX_IDLE 500000
</code></pre>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Note:
</div>
<ul>
<li>
Added in v1.6
</li>
</ul>
</div>
</div>
<hr/>
<h3 id="partial_indexed_docs">
PARTIAL_INDEXED_DOCS
</h3>
<p>
Enable/disable the Redis command filter. The filter optimizes partial updates of hashes
and may avoid re-indexing the hash if changed fields are not part of the schema.
</p>
<h4 id="considerations">
Considerations
</h4>
<p>
The Redis command filter will be executed upon each Redis command. Though the filter is
optimized, this will introduce a small increase in latency on all commands.
<br/>
This configuration is best used with partially indexed documents where the non-indexed fields are updated frequently.
</p>
<h4 id="default-13">
Default
</h4>
<p>
0
</p>
<h4 id="example-13">
Example
</h4>
<pre tabindex="0"><code>$ redis-server --loadmodule ./redisearch.so PARTIAL_INDEXED_DOCS 1
</code></pre>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Note:
</div>
<ul>
<li>
Added in v2.0.0
</li>
</ul>
</div>
</div>
<hr/>
<h3 id="gc_scansize">
GC_SCANSIZE
</h3>
<p>
The bulk size of the internal GC used for cleaning up indexes.
</p>
<h4 id="default-14">
Default
</h4>
<p>
100
</p>
<h4 id="example-14">
Example
</h4>
<pre tabindex="0"><code>$ redis-server --loadmodule ./redisearch.so GC_SCANSIZE 10
</code></pre>
<hr/>
<h3 id="gc_policy">
GC_POLICY
</h3>
<p>
The garbage collection policy. Supported policies are:
</p>
<ul>
<li>
<strong>
FORK
</strong>
: uses a forked thread for garbage collection (v1.4.1 and above).
This is the default GC policy since version 1.6.1 and is ideal
for general purpose workloads.
</li>
<li>
<strong>
LEGACY
</strong>
: Uses a synchronous, in-process fork. This is ideal for read-heavy
and append-heavy workloads with very few updates/deletes.
Deprecated in v2.6.0.
</li>
</ul>
<h4 id="default-15">
Default
</h4>
<p>
FORK
</p>
<h4 id="example-15">
Example
</h4>
<pre tabindex="0"><code>$ redis-server --loadmodule ./redisearch.so GC_POLICY FORK
</code></pre>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Note:
</div>
<ul>
<li>
When the
<code>
GC_POLICY
</code>
is
<code>
FORK
</code>
it can be combined with the options below.
</li>
</ul>
</div>
</div>
<hr/>
<h3 id="nogc">
NOGC
</h3>
<p>
If set, Garbage Collection is disabled for all indexes. This is used mainly for debugging and testing and should not be set by users.
</p>
<h4 id="default-16">
Default
</h4>
<p>
Not set
</p>
<h4 id="example-16">
Example
</h4>
<pre tabindex="0"><code>$ redis-server --loadmodule ./redisearch.so NOGC
</code></pre>
<hr/>
<h3 id="fork_gc_run_interval">
FORK_GC_RUN_INTERVAL
</h3>
<p>
Interval (in seconds) between two consecutive
<code>
fork GC
</code>
runs.
</p>
<h4 id="default-17">
Default
</h4>
<p>
30
</p>
<h4 id="example-17">
Example
</h4>
<pre tabindex="0"><code>$ redis-server --loadmodule ./redisearch.so GC_POLICY FORK FORK_GC_RUN_INTERVAL 60
</code></pre>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Note:
</div>
<ul>
<li>
Can only be combined with
<code>
GC_POLICY FORK
</code>
</li>
</ul>
</div>
</div>
<hr/>
<h3 id="fork_gc_retry_interval">
FORK_GC_RETRY_INTERVAL
</h3>
<p>
Interval (in seconds) in which RediSearch will retry to run
<code>
fork GC
</code>
in case of a failure. Usually, a failure could happen when the Redis fork API does not allow for more than one fork to be created at the same time.
</p>
<h4 id="default-18">
Default
</h4>
<p>
5
</p>
<h4 id="example-18">
Example
</h4>
<pre tabindex="0"><code>$ redis-server --loadmodule ./redisearch.so GC_POLICY FORK FORK_GC_RETRY_INTERVAL 10
</code></pre>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Notes:
</div>
<ul>
<li>
Can only be combined with
<code>
GC_POLICY FORK
</code>
</li>
<li>
Added in v1.4.16
</li>
</ul>
</div>
</div>
<hr/>
<h3 id="fork_gc_clean_threshold">
FORK_GC_CLEAN_THRESHOLD
</h3>
<p>
The
<code>
fork GC
</code>
will only start to clean when the number of not cleaned documents exceeds this threshold, otherwise it will skip this run. While the default value is 100, it's highly recommended to change it to a higher number.
</p>
<h4 id="default-19">
Default
</h4>
<p>
100
</p>
<h4 id="example-19">
Example
</h4>
<pre tabindex="0"><code>$ redis-server --loadmodule ./redisearch.so GC_POLICY FORK FORK_GC_CLEAN_THRESHOLD 10000
</code></pre>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Notes:
</div>
<ul>
<li>
Can only be combined with
<code>
GC_POLICY FORK
</code>
</li>
<li>
Added in v1.4.16
</li>
</ul>
</div>
</div>
<hr/>
<h3 id="upgrade_index">
UPGRADE_INDEX
</h3>
<p>
This configuration is a special configuration option introduced to upgrade indices from v1.x RediSearch versions, otherwise known as legacy indices. This configuration option needs to be given for each legacy index, followed by the index name and all valid options for the index description (also referred to as the
<code>
ON
</code>
arguments for following hashes) as described on
<a href="/docs/latest/commands/ft.create/">
ft.create api
</a>
.
</p>
<h4 id="default-20">
Default
</h4>
<p>
There is no default for index name, and the other arguments have the same defaults as with the
<a href="/docs/latest/commands/ft.create/">
<code>
FT.CREATE
</code>
</a>
API.
</p>
<h4 id="example-20">
Example
</h4>
<pre tabindex="0"><code>$ redis-server --loadmodule ./redisearch.so UPGRADE_INDEX idx PREFIX 1 tt LANGUAGE french LANGUAGE_FIELD MyLang SCORE 0.5 SCORE_FIELD MyScore PAYLOAD_FIELD MyPayload UPGRADE_INDEX idx1
</code></pre>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Notes:
</div>
<ul>
<li>
If the RDB file does not contain a legacy index that's specified in the configuration, a warning message will be added to the log file, and loading will continue.
</li>
<li>
If the RDB file contains a legacy index that wasn't specifiedΒ in the configuration, loading will fail and the server won't start.
</li>
</ul>
</div>
</div>
<hr/>
<h3 id="oss_global_password">
OSS_GLOBAL_PASSWORD
</h3>
<p>
Global Redis Community Edition cluster password that will be used to connect to other shards.
</p>
<h4 id="default-21">
Default
</h4>
<p>
Not set
</p>
<h4 id="example-21">
Example
</h4>
<pre tabindex="0"><code>$ redis-server --loadmodule ./redisearch.so OSS_GLOBAL_PASSWORD password
</code></pre>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Notes:
</div>
<ul>
<li>
Only relevant when Coordinator is used
</li>
<li>
Added in v2.0.3
</li>
</ul>
</div>
</div>
<hr/>
<h3 id="default_dialect">
DEFAULT_DIALECT
</h3>
<p>
The default
<a href="/docs/latest/develop/interact/search-and-query/advanced-concepts/dialects/">
DIALECT
</a>
to be used by
<a href="/docs/latest/commands/ft.create/">
<code>
FT.CREATE
</code>
</a>
,
<a href="/docs/latest/commands/ft.aggregate/">
<code>
FT.AGGREGATE
</code>
</a>
,
<a href="/docs/latest/commands/ft.explain/">
<code>
FT.EXPLAIN
</code>
</a>
,
<a href="/docs/latest/commands/ft.explaincli/">
<code>
FT.EXPLAINCLI
</code>
</a>
, and
<a href="/docs/latest/commands/ft.spellcheck/">
<code>
FT.SPELLCHECK
</code>
</a>
.
See
<a href="/docs/latest/develop/interact/search-and-query/advanced-concepts/dialects/">
Query dialects
</a>
for more information.
</p>
<h4 id="default-22">
Default
</h4>
<p>
1
</p>
<h4 id="example-22">
Example
</h4>
<pre tabindex="0"><code>$ redis-server --loadmodule ./redisearch.so DEFAULT_DIALECT 2
</code></pre>
<hr/>
<h3 id="vss_max_resize">
VSS_MAX_RESIZE
</h3>
<p>
The maximum memory resize for vector similarity indexes in bytes. This value will override default memory limits if you need to allow for a large
<a href="/docs/latest/develop/interact/search-and-query/advanced-concepts/vectors/#creation-attributes-per-algorithm">
<code>
BLOCK_SIZE
</code>
</a>
.
</p>
<h4 id="default-23">
Default
</h4>
<p>
0
</p>
<h4 id="example-23">
Example
</h4>
<pre tabindex="0"><code>$ redis-server --loadmodule ./redisearch.so VSS_MAX_RESIZE 52428800 # 50MB
</code></pre>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Note:
</div>
<ul>
<li>
Added in v2.4.8
</li>
</ul>
</div>
</div>
<h3 id="index_cursor_limit">
INDEX_CURSOR_LIMIT
</h3>
<p>
The maximum number of cursors that can be opened, per shard, at any given time. Cursors can be opened by the user via
<a href="/docs/latest/commands/ft.aggregate/">
<code>
FT.AGGREGATE WITHCURSOR
</code>
</a>
. Cursors are also opened internally by the Redis Query Engine for long-running queries. Once
<code>
INDEX_CURSOR_LIMIT
</code>
is reached, any further attempts at opening a cursor will result in an error.
</p>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Notes:
</div>
<ul>
<li>
<p>
Caution should be used in modifying this parameter. Every open cursor results in additional memory usage.
</p>
</li>
<li>
<p>
Cursor usage should be regulated first by use of
<a href="/docs/latest/commands/ft.cursor-del/">
<code>
FT.CURSOR DEL
</code>
</a>
and/or
<a href="/docs/latest/commands/ft.aggregate/">
<code>
MAXIDLE
</code>
</a>
prior to modifying
<code>
INDEX_CURSOR_LIMIT
</code>
</p>
</li>
<li>
<p>
See
<a href="/docs/latest/develop/interact/search-and-query/advanced-concepts/aggregations#cursor-api">
Cursor API
</a>
for more details.
</p>
</li>
<li>
<p>
Added in 2.10.8
</p>
</li>
</ul>
</div>
</div>
<h4 id="default-24">
Default
</h4>
<p>
128
</p>
<h4 id="example-24">
Example
</h4>
<pre tabindex="0"><code>$ redis-server --loadmodule ./redisearch.so INDEX_CURSOR_LIMIT 180
</code></pre>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/develop/interact/search-and-query/basic-constructs/configuration-parameters/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rc/databases/back-up-data/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Back up and export a database
</h1>
<p>
The backup options for Redis Cloud databases depend on your plan:
</p>
<ul>
<li>
<p>
Redis Cloud Pro subscriptions can back up or export a database on-demand and schedule daily backups that occur during a set hour.
</p>
</li>
<li>
<p>
Paid Redis Cloud Essentials plans can back up or export a database on-demand and schedule backups that occur every 24 hours.
</p>
</li>
<li>
<p>
Free plans cannot back up or export a database through the Redis Cloud console.
</p>
</li>
</ul>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Note:
</div>
The number of database backups that can run simultaneously on a subscription is limited to 4 by default.
</div>
</div>
<p>
Backups are saved to predefined storage locations available to your subscription. Backup locations need to be available before you turn on database backups. To learn more, see
<a href="#set-up-backup-storage-locations">
Set up backup storage locations
</a>
.
</p>
<p>
Backups are saved in RDB format. If the database is comprised of multiple shards, an RDB file will be created for each shard of the database. For more information on restoring data from a backup, see
<a href="/docs/latest/operate/rc/databases/import-data/#restore-from-an-rdb-file">
Restore from an RDB file
</a>
.
</p>
<p>
Here, you'll learn how to store backups using different cloud providers.
</p>
<h2 id="turn-on-backups">
Turn on backups
</h2>
<p>
To turn on database backups:
</p>
<ol>
<li>
<p>
Sign in to the
<a href="https://cloud.redis.io/">
Redis Cloud console
</a>
.
</p>
</li>
<li>
<p>
Select the database to open the
<strong>
Database
</strong>
page and then select
<strong>
Edit database
</strong>
.
</p>
<a href="/docs/latest/images/rc/database-details-configuration-tab-general-flexible.png" sdata-lightbox="/images/rc/database-details-configuration-tab-general-flexible.png">
<img alt="The Configuration tab of the Database details screen." src="/docs/latest/images/rc/database-details-configuration-tab-general-flexible.png"/>
</a>
</li>
<li>
<p>
In the
<strong>
Durability
</strong>
section of the
<strong>
Configuration
</strong>
tab, locate the
<strong>
Remote backup
</strong>
setting:
</p>
<a href="/docs/latest/images/rc/database-details-configuration-tab-durability-flexible.png" sdata-lightbox="/images/rc/database-details-configuration-tab-durability-flexible.png">
<img alt="The Remote backup setting is located in the Durability section of the Configuration tab of the database details screen." src="/docs/latest/images/rc/database-details-configuration-tab-durability-flexible.png"/>
</a>
</li>
</ol>
<p>
When you enable
<strong>
Remote backup
</strong>
, additional options appear. The options vary according to your subscription.
</p>
<a href="/docs/latest/images/rc/database-details-configuration-durability-backup.png" sdata-lightbox="/images/rc/database-details-configuration-durability-backup.png">
<img alt="Backup settings appear when you enable the Remote backup settings." src="/docs/latest/images/rc/database-details-configuration-durability-backup.png"/>
</a>
<table>
<thead>
<tr>
<th style="text-align:left">
Setting name
</th>
<th style="text-align:left">
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">
<strong>
Interval
</strong>
</td>
<td style="text-align:left">
Defines the frequency of automatic backups. Paid Redis Cloud Essentials databases are backed up every 24 hours. Redis Cloud Pro databases can be set to 24, 12, 6, 4, 2, or 1 hour backup intervals.
</td>
</tr>
<tr>
<td style="text-align:left">
<strong>
Set backup time
</strong>
</td>
<td style="text-align:left">
When checked, this lets you set the hour of the
<strong>
Backup time
</strong>
. (
<em>
Redis Cloud Pro only
</em>
)
</td>
</tr>
<tr>
<td style="text-align:left">
<strong>
Backup time
</strong>
</td>
<td style="text-align:left">
Defines the hour automatic backups are made. Note that actual backup times will vary up in order to minimize customer access disruptions. (
<em>
Redis Cloud Pro only
</em>
)
<br/>
Times are expressed in
<a href="https://en.wikipedia.org/wiki/Coordinated_Universal_Time">
Coordinated Universal Time
</a>
(UTC).
</td>
</tr>
<tr>
<td style="text-align:left">
<strong>
Storage type
</strong>
</td>
<td style="text-align:left">
Defines the provider of the storage location, which can be:
<code>
AWS S3
</code>
,
<code>
Google Cloud Storage
</code>
,
<code>
Azure Blob Storage
</code>
, or
<code>
FTP
</code>
(FTPS).
</td>
</tr>
<tr>
<td style="text-align:left">
<strong>
Backup destination
</strong>
</td>
<td style="text-align:left">
Defines a URI representing the backup storage location.
</td>
</tr>
</tbody>
</table>
<h2 id="back-up-and-export-data-on-demand">
Back up and export data on demand
</h2>
<p>
After backups are turned on, you can back up your data at any time. Use the
<strong>
Backup now
</strong>
button in the
<strong>
Durability
</strong>
section.
</p>
<a href="/docs/latest/images/rc/button-database-backup-now.png" sdata-lightbox="/images/rc/button-database-backup-now.png">
<img alt="Use the Backup Now button to make backups on demand." src="/docs/latest/images/rc/button-database-backup-now.png"/>
</a>
<p>
You can only use the
<strong>
Backup now
</strong>
button after you turn on backups.
</p>
<h2 id="set-up-backup-storage-locations">
Set up backup storage locations
</h2>
<p>
Database backups can be stored to a cloud provider service or saved to a URI using FTP/FTPS.
</p>
<p>
Your subscription needs the ability to view permissions and update objects in the storage location. Specific details vary according to the provider. To learn more, consult the provider's documentation.
</p>
<p>
The following sections describe specific backup options. Be aware that provider features change frequently. For best results, use your provider's documentation for the latest info.
</p>
<h3 id="aws-s3">
AWS S3
</h3>
<p>
To store backups in an Amazon Web Services (AWS) Simple Storage Service (S3)
<a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/creating-buckets-s3.html">
bucket
</a>
:
</p>
<ol>
<li>
<p>
In the
<a href="https://console.aws.amazon.com/">
AWS Management Console
</a>
, use the
<strong>
Services
</strong>
menu to locate and select
<strong>
Storage
</strong>
>
<strong>
S3
</strong>
. This takes you to the Amazon S3 admin panel.
</p>
</li>
<li>
<p>
Use the
<strong>
Buckets
</strong>
list to locate and select your bucket. When the settings appear, select the
<strong>
Permissions
</strong>
tab, locate the
<strong>
Bucket policy
</strong>
section, and then click
<strong>
Edit
</strong>
.
</p>
<ul>
<li>
<p>
If there is no existing bucket policy, add the following JSON bucket policy. Replace
<code>
UNIQUE-BUCKET-NAME
</code>
with the name of your bucket.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"Version"</span><span class="p">:</span> <span class="s2">"2012-10-17"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"Id"</span><span class="p">:</span> <span class="s2">"MyBucketPolicy"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"Statement"</span><span class="p">:</span> <span class="p">[</span>
</span></span><span class="line"><span class="cl"> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"Sid"</span><span class="p">:</span> <span class="s2">"RedisCloudBackupsAccess"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"Effect"</span><span class="p">:</span> <span class="s2">"Allow"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"Principal"</span><span class="p">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"AWS"</span><span class="p">:</span> <span class="s2">"arn:aws:iam::168085023892:root"</span>
</span></span><span class="line"><span class="cl"> <span class="p">},</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"Action"</span><span class="p">:</span> <span class="p">[</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"s3:PutObject"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"s3:getObject"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"s3:DeleteObject"</span>
</span></span><span class="line"><span class="cl"> <span class="p">],</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"Resource"</span><span class="p">:</span> <span class="s2">"arn:aws:s3:::UNIQUE-BUCKET-NAME/*"</span>
</span></span><span class="line"><span class="cl"> <span class="p">}</span>
</span></span><span class="line"><span class="cl"> <span class="p">]</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span></code></pre>
</div>
</li>
<li>
<p>
If a bucket policy already exists, add the following JSON policy statement to the list of statements. Replace
<code>
UNIQUE-BUCKET-NAME
</code>
with the name of your bucket.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"Sid"</span><span class="p">:</span> <span class="s2">"RedisCloudBackupsAccess"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"Effect"</span><span class="p">:</span> <span class="s2">"Allow"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"Principal"</span><span class="p">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"AWS"</span><span class="p">:</span> <span class="s2">"arn:aws:iam::168085023892:root"</span>
</span></span><span class="line"><span class="cl"> <span class="p">},</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"Action"</span><span class="p">:</span> <span class="p">[</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"s3:PutObject"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"s3:getObject"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"s3:DeleteObject"</span>
</span></span><span class="line"><span class="cl"> <span class="p">],</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"Resource"</span><span class="p">:</span> <span class="s2">"arn:aws:s3:::UNIQUE-BUCKET-NAME/*"</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span></code></pre>
</div>
</li>
</ul>
</li>
<li>
<p>
Save your changes.
</p>
</li>
<li>
<p>
If the bucket is encrypted using
<a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingKMSEncryption.html">
SSE-KMS
</a>
, add the following statement to your
<a href="https://docs.aws.amazon.com/kms/latest/developerguide/key-policy-modifying.html">
key policy
</a>
. If you do not have a key policy, see
<a href="https://docs.aws.amazon.com/kms/latest/developerguide/key-policy-overview.html">
Creating a key policy
</a>
. Replace
<code>
UNIQUE-BUCKET-NAME
</code>
with the name of your bucket and
<code>
CUSTOM-KEY-ARN
</code>
with your key's
<a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference-arns.html">
Amazon Resource Name (ARN)
</a>
.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"Sid"</span><span class="p">:</span> <span class="s2">"Allow use of the key"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"Effect"</span><span class="p">:</span> <span class="s2">"Allow"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"Principal"</span><span class="p">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"AWS"</span><span class="p">:</span> <span class="s2">"arn:aws:iam::168085023892:root"</span>
</span></span><span class="line"><span class="cl"> <span class="p">},</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"Action"</span><span class="p">:</span> <span class="p">[</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"kms:Encrypt"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"kms:Decrypt"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"kms:ReEncrypt*"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"kms:GenerateDataKey*"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"kms:DescribeKey"</span>
</span></span><span class="line"><span class="cl"> <span class="p">],</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"Resource"</span><span class="p">:</span> <span class="p">[</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"arn:aws:s3:::UNIQUE-BUCKET-NAME/*"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"CUSTOM-KEY-ARN"</span>
</span></span><span class="line"><span class="cl"> <span class="p">]</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span></code></pre>
</div>
</li>
</ol>
<p>
Once the bucket is available and the permissions are set, use the name of your bucket as the
<strong>
Backup destination
</strong>
for your database's Remote backup settings. For example, suppose your bucket is named
<em>
backups-bucket
</em>
. In that case, set
<strong>
Backup destination
</strong>
to
<code>
s3://backups-bucket
</code>
.
</p>
<p>
To learn more, see
<a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucket-policies.html">
Using bucket policies
</a>
on the AWS docs.
</p>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Note:
</div>
An AWS S3 bucket can be used by only one Redis Cloud account. If you have more than one Redis Cloud account, repeat the setup steps for multiple buckets.
</div>
</div>
<h3 id="google-cloud-storage">
Google Cloud Storage
</h3>
<p>
To store backups in a Google Cloud Storage
<a href="https://cloud.google.com/storage/docs/creating-buckets">
bucket
</a>
:
</p>
<ol>
<li>
<p>
Sign in to the Google Cloud console.
</p>
</li>
<li>
<p>
In the console menu, locate the
<em>
Storage
</em>
section, then select
<strong>
Cloud StorageΒ >Β Buckets
</strong>
.
</p>
</li>
<li>
<p>
Create or select a bucket.
</p>
</li>
<li>
<p>
Select the
<strong>
Permissions
</strong>
tab.
</p>
</li>
<li>
<p>
Select the
<strong>
Grant Access
</strong>
button and then add:
</p>
<p>
<code>
[email protected]
</code>
</p>
</li>
<li>
<p>
Set
<strong>
Role
</strong>
to
<strong>
Storage Legacy Bucket Writer
</strong>
.
</p>
</li>
<li>
<p>
Save your changes.
</p>
</li>
<li>
<p>
Verify that your bucket does
<em>
not
</em>
have a set retention policy.
</p>
<p>
To do so:
</p>
<ol>
<li>
<p>
View the details of your bucket.
</p>
</li>
<li>
<p>
Select the
<strong>
Configuration
</strong>
tab.
</p>
</li>
<li>
<p>
Verify
<strong>
Protection
</strong>
->
<strong>
Bucket retention policy
</strong>
is set to
<strong>
none
</strong>
.
</p>
</li>
</ol>
<p>
If a policy is defined and you cannot delete it, you need to use a different bucket.
</p>
</li>
</ol>
<p>
Use the bucket details
<strong>
Configuration
</strong>
tab to locate the
<strong>
gsutil URI
</strong>
. This is the value you'll assign to your resource's backup path.
</p>
<p>
To learn more, see
<a href="https://cloud.google.com/storage/docs/access-control/using-iam-permissions#bucket-iam">
Use IAM permissions
</a>
.
</p>
<h3 id="azure-blob-storage">
Azure Blob Storage
</h3>
<p>
To store your backup in Microsoft Azure Blob Storage, sign in to the Azure portal and then:
</p>
<ol>
<li>
<p>
<a href="https://docs.microsoft.com/en-us/azure/storage/common/storage-account-create">
Create an Azure Storage account
</a>
if you do not already have one.
</p>
</li>
<li>
<p>
<a href="https://docs.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-portal#create-a-container">
Create a container
</a>
if you do not already have one.
</p>
</li>
<li>
<p>
Find your storage account's primary access key. See
<a href="https://docs.microsoft.com/en-us/azure/storage/common/storage-account-keys-manage">
Manage storage account access keys
</a>
for instructions.
</p>
</li>
</ol>
<p>
Set your resource's
<strong>
Backup Path
</strong>
to the path of your storage account.
</p>
<p>
The syntax for creating the backup varies according to your authorization mechanism. For example:
</p>
<p>
<code>
abs://:storage_account_access_key@storage_account_name/container_name/[path/]
</code>
</p>
<p>
Where:
</p>
<ul>
<li>
<em>
storage_account_access_key:
</em>
the primary access key to the
storage account
</li>
<li>
<em>
storage_account_name:
</em>
the storage account name
</li>
<li>
<em>
container_name:
</em>
the name of the container, if needed.
</li>
<li>
<em>
path
</em>
: the backups path, if needed.
</li>
</ul>
<p>
To learn more, see
<a href="https://docs.microsoft.com/en-us/azure/storage/common/storage-auth">
Authorizing access to data in Azure Storage
</a>
.
</p>
<h3 id="ftp-server">
FTP Server
</h3>
<p>
To store your backups on an FTP server, set its
<strong>
Backup Path
</strong>
using the following syntax:
</p>
<p>
<code>
<protocol>://[username]:[password]@[hostname]:[port]/[path]/
</code>
</p>
<p>
Where:
</p>
<ul>
<li>
<p>
<em>
protocol
</em>
: the server's protocol, can be either
<code>
ftp
</code>
or
<code>
ftps
</code>
.
</p>
</li>
<li>
<p>
<em>
username
</em>
: your username, if needed.
</p>
</li>
<li>
<p>
<em>
password
</em>
: your password, if needed.
</p>
</li>
<li>
<p>
<em>
hostname
</em>
: the hostname or IP address of the server.
</p>
</li>
<li>
<p>
<em>
port
</em>
: the port number of the server, if needed.
</p>
</li>
<li>
<p>
<em>
path
</em>
: the backup path, if needed.
</p>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Note:
</div>
If your FTP username or password contains special characters such as
<code>
@
</code>
,
<code>
\
</code>
, or
<code>
:
</code>
, you must URL encode (also known as Percent encode) these special characters. If you don't, your database may become stuck.
</div>
</div>
</li>
</ul>
<p>
The user account needs permission to write files to the server.
</p>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rc/databases/back-up-data/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/release-notes/rs-7-4-2-releases/rs-7-4-6-22/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Redis Enterprise Software release notes 7.4.6-22 (July 2024)
</h1>
<p class="text-lg -mt-5 mb-10">
Support for SHA-384 certificates in client authentication. New parameters for optimize_shard_placement and recover database REST API requests.
</p>
<p>
β
<a href="https://redis.com/redis-enterprise-software/download-center/software/">
βRedis Enterprise Software version 7.4.6
</a>
is now available! This release includes API enhancements that warranted a new minor version instead of a maintenance release for version 7.4.2. However, you can upgrade from 7.4.2 to 7.4.6 without issue.
</p>
<h2 id="highlights">
Highlights
</h2>
<p>
This version offers:
</p>
<ul>
<li>
<p>
Support for SHA-384 certificates in client authentication
</p>
</li>
<li>
<p>
New parameters for
<code>
optimize_shard_placement
</code>
and
<code>
recover
</code>
database REST API requests
</p>
</li>
</ul>
<h2 id="new-in-this-release">
New in this release
</h2>
<h3 id="enhancements">
Enhancements
</h3>
<ul>
<li>
<p>
Added support for SHA-384 certificates when using mutual TLS for client authentication.
</p>
</li>
<li>
<p>
Added an option to the
<a href="/docs/latest/operate/rs/references/rest-api/requests/bdbs/actions/optimize_shards_placement/">
optimize_shards_placement
</a>
REST API request to consider replication when calculating the databaseβs optimized shard placement.
</p>
</li>
<li>
<p>
Added
<code>
shard_uid
</code>
and
<code>
shard_role
</code>
for each persistence file in the response body of the
<a href="/docs/latest/operate/rs/references/rest-api/requests/bdbs/actions/recover/">
recover
</a>
REST API request. When the database has master_persistence enabled, these fields help identify the primary shard's persistence file, which is most up-to-date and recommended for recovery.
</p>
</li>
</ul>
<h4 id="redis-module-feature-sets">
Redis module feature sets
</h4>
<p>
Redis Enterprise comes packaged with several modules. As of version 7.4.2, Redis Enterprise includes two feature sets, compatible with different Redis database versions.
</p>
<p>
Bundled Redis modules compatible with Redis database version 7.2:
</p>
<ul>
<li>
<p>
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisearch/redisearch-2.8-release-notes/">
RediSearch 2.8.13
</a>
</p>
</li>
<li>
<p>
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisjson/redisjson-2.6-release-notes/">
RedisJSON 2.6.10
</a>
</p>
</li>
<li>
<p>
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redistimeseries/redistimeseries-1.10-release-notes/">
RedisTimeSeries 1.10.12
</a>
</p>
</li>
<li>
<p>
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisbloom/redisbloom-2.6-release-notes/">
RedisBloom 2.6.12
</a>
</p>
</li>
<li>
<p>
<a href="https://github.com/RedisGears/RedisGears/releases/tag/v2.0.20-m21">
RedisGears 2.0.20 preview
</a>
: The RedisGears preview will not be promoted to GA and will be removed in a future release.
</p>
</li>
</ul>
<p>
Bundled Redis modules compatible with Redis database versions 6.0 and 6.2:
</p>
<ul>
<li>
<p>
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisearch/redisearch-2.6-release-notes/">
RediSearch 2.6.18
</a>
</p>
</li>
<li>
<p>
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisjson/redisjson-2.4-release-notes/">
RedisJSON 2.4.9
</a>
</p>
</li>
<li>
<p>
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redistimeseries/redistimeseries-1.8-release-notes/">
RedisTimeSeries 1.8.13
</a>
</p>
</li>
<li>
<p>
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisbloom/redisbloom-2.4-release-notes/">
RedisBloom 2.4.9
</a>
</p>
</li>
<li>
<p>
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisgraph/redisgraph-2.10-release-notes/">
RedisGraph v2.10.15
</a>
: RedisGraph end-of-life has been announced and will be removed in a future release. See the
<a href="https://redis.io/blog/redisgraph-eol/">
RedisGraph end-of-life announcement
</a>
for more details.
</p>
</li>
</ul>
<h3 id="resolved-issues">
Resolved issues
</h3>
<ul>
<li>
<p>
RS118231: Fixed an issue where configuration changes to
<code>
slave_buffer
</code>
failed due to shard connection issues but incorrectly reported success.
</p>
</li>
<li>
<p>
RS117757: Increased the number of connections reserved for admin clients to 64 to prevent connection limit issues.
</p>
</li>
<li>
<p>
RS129900: Fixed an issue that prevented creating a database with modules that were uploaded during a cluster upgrade.
</p>
</li>
<li>
<p>
RS128254: Fixed a TLS protocol version compatibility issue with cluster upgrades by setting new nodes to TLS protocol version 1.2 if the cluster's current TLS protocol version is no longer supported.
</p>
</li>
<li>
<p>
RS125593: Added validation to verify the LDAP server URI contains a host and port when updating LDAP configuration.
</p>
</li>
</ul>
<h2 id="version-changes">
Version changes
</h2>
<ul>
<li>
Added validation to verify the LDAP server URI contains a host and port when updating LDAP configuration.
</li>
</ul>
<h3 id="product-lifecycle-updates">
Product lifecycle updates
</h3>
<h4 id="end-of-life-policy-extension">
End-of-life policy extension
</h4>
<p>
The end-of-life policy for Redis Enterprise Software versions 6.2 and later has been extended to 24 months after the formal release of the subsequent major version. For the updated end-of-life schedule, see the
<a href="/docs/latest/operate/rs/installing-upgrading/product-lifecycle/">
Redis Enterprise Software product lifecycle
</a>
.
</p>
<h4 id="supported-upgrade-paths">
Supported upgrade paths
</h4>
<p>
Redis Enterprise Software versions 6.2.4 and 6.2.8 do not support direct upgrades beyond version 7.4.x. Versions 6.2.10, 6.2.12, and 6.2.18 are part of the
<a href="/docs/latest/operate/rs/installing-upgrading/upgrading/upgrade-cluster/#supported-upgrade-paths">
upgrade path
</a>
. To upgrade from 6.2.4 or 6.2.8 to versions later than 7.4.x, an intermediate upgrade is required.
</p>
<p>
The next major Redis Enterprise Software release will still bundle Redis database version 6.2 and allow database upgrades from Redis database version 6.2 to 7.x.
</p>
<p>
See the
<a href="/docs/latest/operate/rs/installing-upgrading/product-lifecycle/">
Redis Enterprise Software product lifecycle
</a>
for more information about release numbers.
</p>
<h3 id="deprecations">
Deprecations
</h3>
<h4 id="legacy-ui-deprecation">
Legacy UI deprecation
</h4>
<p>
The legacy UI is deprecated in favor of the new Cluster Manager UI and will be removed in a future release.
</p>
<h4 id="redis-60-database-deprecation">
Redis 6.0 database deprecation
</h4>
<p>
Redis database version 6.0 is deprecated as of Redis Enterprise Software version 7.4.2 and will be removed in a future release.
</p>
<p>
To prepare for the future removal of Redis 6.0:
</p>
<ul>
<li>
<p>
For Redis Enterprise 6.2.* clusters, upgrade Redis 6.0 databases to Redis 6.2. See the
<a href="https://raw.githubusercontent.com/redis/redis/6.2/00-RELEASENOTES">
Redis 6.2 release notes
</a>
for the list of changes.
</p>
</li>
<li>
<p>
For Redis Enterprise 7.2.4 and 7.4.2 clusters, upgrade Redis 6.0 databases to Redis 7.2. Before you upgrade your databases, see the list of
<a href="/docs/latest/operate/rs/release-notes/rs-7-2-4-releases/rs-7-2-4-52/#redis-72-breaking-changes">
Redis 7.2 breaking changes
</a>
and update any applications that connect to your database to handle these changes.
</p>
</li>
</ul>
<h3 id="upcoming-changes">
Upcoming changes
</h3>
<h4 id="default-image-change-for-redis-enterprise-software-containers">
Default image change for Redis Enterprise Software containers
</h4>
<p>
Starting with version 7.6, Redis Enterprise Software containers with the image tag
<code>
x.y.z-build
</code>
will be based on RHEL instead of Ubuntu.
</p>
<p>
This change will only affect you if you use containers outside the official
<a href="/docs/latest/operate/kubernetes/">
Redis Enterprise for Kubernetes
</a>
product and use Ubuntu-specific commands.
</p>
<p>
To use Ubuntu-based images after this change, you can specify the operating system suffix in the image tag. For example, use the image tag
<code>
7.4.2-216.focal
</code>
instead of
<code>
7.4.2-216
</code>
.
</p>
<h3 id="supported-platforms">
Supported platforms
</h3>
<p>
The following table provides a snapshot of supported platforms as of this Redis Enterprise Software release. See the
<a href="/docs/latest/operate/rs/references/supported-platforms/">
supported platforms reference
</a>
for more details about operating system compatibility.
</p>
<p>
<span title="Check mark icon">
β
</span>
Supported β The platform is supported for this version of Redis Enterprise Software and Redis Stack modules.
</p>
<p>
<span class="font-serif" title="Warning icon">
β οΈ
</span>
Deprecation warning β The platform is still supported for this version of Redis Enterprise Software, but support will be removed in a future release.
</p>
<table>
<thead>
<tr>
<th>
Redis Enterprise
<br/>
major versions
</th>
<th style="text-align:center">
7.4
</th>
<th style="text-align:center">
7.2
</th>
<th style="text-align:center">
6.4
</th>
<th style="text-align:center">
6.2
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<strong>
Release date
</strong>
</td>
<td style="text-align:center">
Feb 2024
</td>
<td style="text-align:center">
Aug 2023
</td>
<td style="text-align:center">
Feb 2023
</td>
<td style="text-align:center">
Aug 2021
</td>
</tr>
<tr>
<td>
<a href="/docs/latest/operate/rs/installing-upgrading/product-lifecycle/#endoflife-schedule">
<strong>
End-of-life date
</strong>
</a>
</td>
<td style="text-align:center">
Determined after
<br/>
next major release
</td>
<td style="text-align:center">
Feb 2026
</td>
<td style="text-align:center">
Aug 2025
</td>
<td style="text-align:center">
Feb 2025
</td>
</tr>
<tr>
<td>
<strong>
Platforms
</strong>
</td>
<td style="text-align:center">
</td>
<td style="text-align:center">
</td>
<td style="text-align:center">
</td>
<td style="text-align:center">
</td>
</tr>
<tr>
<td>
RHEL 9 &
<br/>
compatible distros
<sup>
<a href="#table-note-1">
1
</a>
</sup>
</td>
<td style="text-align:center">
<span title="Supported">
β
</span>
</td>
<td style="text-align:center">
β
</td>
<td style="text-align:center">
β
</td>
<td style="text-align:center">
β
</td>
</tr>
<tr>
<td>
RHEL 8 &
<br/>
compatible distros
<sup>
<a href="#table-note-1">
1
</a>
</sup>
</td>
<td style="text-align:center">
<span title="Supported">
β
</span>
</td>
<td style="text-align:center">
<span title="Supported">
β
</span>
</td>
<td style="text-align:center">
<span title="Supported">
β
</span>
</td>
<td style="text-align:center">
<span title="Supported">
β
</span>
</td>
</tr>
<tr>
<td>
RHEL 7 &
<br/>
compatible distros
<sup>
<a href="#table-note-1">
1
</a>
</sup>
</td>
<td style="text-align:center">
β
</td>
<td style="text-align:center">
<span class="font-serif" title="Deprecated">
β οΈ
</span>
</td>
<td style="text-align:center">
<span title="Supported">
β
</span>
</td>
<td style="text-align:center">
<span title="Supported">
β
</span>
</td>
</tr>
<tr>
<td>
Ubuntu 20.04
<sup>
<a href="#table-note-2">
2
</a>
</sup>
</td>
<td style="text-align:center">
<span title="Supported">
β
</span>
</td>
<td style="text-align:center">
<span title="Supported">
β
</span>
</td>
<td style="text-align:center">
<span title="Supported">
β
</span>
</td>
<td style="text-align:center">
β
</td>
</tr>
<tr>
<td>
Ubuntu 18.04
<sup>
<a href="#table-note-2">
2
</a>
</sup>
</td>
<td style="text-align:center">
<span class="font-serif" title="Deprecated">
β οΈ
</span>
</td>
<td style="text-align:center">
<span class="font-serif" title="Deprecated">
β οΈ
</span>
</td>
<td style="text-align:center">
<span title="Supported">
β
</span>
</td>
<td style="text-align:center">
<span title="Supported">
β
</span>
</td>
</tr>
<tr>
<td>
Ubuntu 16.04
<sup>
<a href="#table-note-2">
2
</a>
</sup>
</td>
<td style="text-align:center">
β
</td>
<td style="text-align:center">
<span class="font-serif" title="Deprecated">
β οΈ
</span>
</td>
<td style="text-align:center">
<span title="Supported">
β
</span>
</td>
<td style="text-align:center">
<span title="Supported">
β
</span>
</td>
</tr>
<tr>
<td>
Amazon Linux 2
</td>
<td style="text-align:center">
<span title="Supported">
β
</span>
</td>
<td style="text-align:center">
<span title="Supported">
β
</span>
</td>
<td style="text-align:center">
<span title="Supported">
β
</span>
</td>
<td style="text-align:center">
β
</td>
</tr>
<tr>
<td>
Amazon Linux 1
</td>
<td style="text-align:center">
β
</td>
<td style="text-align:center">
<span title="Supported">
β
</span>
</td>
<td style="text-align:center">
<span title="Supported">
β
</span>
</td>
<td style="text-align:center">
<span title="Supported">
β
</span>
</td>
</tr>
<tr>
<td>
Kubernetes
<sup>
<a href="#table-note-3">
3
</a>
</sup>
</td>
<td style="text-align:center">
<span title="Supported">
β
</span>
</td>
<td style="text-align:center">
<span title="Supported">
β
</span>
</td>
<td style="text-align:center">
<span title="Supported">
β
</span>
</td>
<td style="text-align:center">
<span title="Supported">
β
</span>
</td>
</tr>
<tr>
<td>
Docker
<sup>
<a href="#table-note-4">
4
</a>
</sup>
</td>
<td style="text-align:center">
<span title="Supported">
β
</span>
</td>
<td style="text-align:center">
<span title="Supported">
β
</span>
</td>
<td style="text-align:center">
<span title="Supported">
β
</span>
</td>
<td style="text-align:center">
<span title="Supported">
β
</span>
</td>
</tr>
</tbody>
</table>
<ol>
<li>
<p>
<a name="table-note-1" style="display: block; height: 80px; margin-top: -80px;">
</a>
The RHEL-compatible distributions CentOS, CentOS Stream, Alma, and Rocky are supported if they have full RHEL compatibility. Oracle Linux running the Red Hat Compatible Kernel (RHCK) is supported, but the Unbreakable Enterprise Kernel (UEK) is not supported.
</p>
</li>
<li>
<p>
<a name="table-note-2" style="display: block; height: 80px; margin-top: -80px;">
</a>
The server version of Ubuntu is recommended for production installations. The desktop version is only recommended for development deployments.
</p>
</li>
<li>
<p>
<a name="table-note-3" style="display: block; height: 80px; margin-top: -80px;">
</a>
See the
<a href="/docs/latest/operate/kubernetes/reference/supported_k8s_distributions/">
Redis Enterprise for Kubernetes documentation
</a>
for details about support per version and Kubernetes distribution.
</p>
</li>
<li>
<p>
<a name="table-note-4" style="display: block; height: 80px; margin-top: -80px;">
</a>
<a href="/docs/latest/operate/rs/installing-upgrading/quickstarts/docker-quickstart/">
Docker images
</a>
of Redis Enterprise Software are certified for development and testing only.
</p>
</li>
</ol>
<h2 id="downloads">
Downloads
</h2>
<p>
The following table shows the SHA256 checksums for the available packages:
</p>
<table>
<thead>
<tr>
<th>
Package
</th>
<th>
SHA256 checksum (7.4.6-22 July release)
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
Ubuntu 18
</td>
<td>
<span class="break-all">
3bf13415cf013869b6417165c6bc2966cade201a08ac7c2a4a7286990fca03df
</span>
</td>
</tr>
<tr>
<td>
Ubuntu 20
</td>
<td>
<span class="break-all">
c0951fc688e8b02aeec06b0e98baf77988edef7fd2dc828b6af4126ecb9753ae
</span>
</td>
</tr>
<tr>
<td>
Red Hat Enterprise Linux (RHEL) 8
</td>
<td>
<span class="break-all">
4667c579c52f899a4992cfe5d97e7b4f70ae9f34f5ae9bf75f10cfe2869a80d4
</span>
</td>
</tr>
<tr>
<td>
Red Hat Enterprise Linux (RHEL) 9
</td>
<td>
<span class="break-all">
6c37b1483b5fb6110c8055c1526aa58eec1d29d3519e92310859101419248831
</span>
</td>
</tr>
<tr>
<td>
Amazon Linux 2
</td>
<td>
<span class="break-all">
5782ac40b18b813f1fd6244f45c7107bfe00baccf3e0f3439149bdd0cbbfd806
</span>
</td>
</tr>
</tbody>
</table>
<h2 id="known-issues">
Known issues
</h2>
<ul>
<li>
<p>
RS61676: Full chain certificate update fails if any certificate in the chain does not have a Common Name (CN).
</p>
</li>
<li>
<p>
RS119958: The
<code>
debuginfo
</code>
script fails with the error
<code>
/bin/tar: Argument list too long
</code>
if there are too many RocksDB log files. This issue only affects clusters with Auto Tiering.
</p>
</li>
</ul>
<h2 id="known-limitations">
Known limitations
</h2>
<h4 id="new-cluster-manager-ui-limitations">
New Cluster Manager UI limitations
</h4>
<p>
The following legacy UI features are not yet available in the new Cluster Manager UI:
</p>
<ul>
<li>
<p>
Remove a node.
</p>
<p>
Use the REST API or legacy UI instead. See
<a href="/docs/latest/operate/rs/clusters/remove-node/">
Remove a cluster node
</a>
for instructions.
</p>
</li>
<li>
<p>
Purge an Active-Active instance.
</p>
<p>
Use
<a href="/docs/latest/operate/rs/references/cli-utilities/crdb-cli/crdb/purge-instance/">
<code>
crdb-cli crdb purge-instance
</code>
</a>
instead.
</p>
</li>
<li>
<p>
Search and export the log.
</p>
</li>
</ul>
<h4 id="openssl-compatibility-issue-for-742-modules-on-amazon-linux-2">
OpenSSL compatibility issue for 7.4.2 modules on Amazon Linux 2
</h4>
<p>
Due to an OpenSSL 1.1 compatibility issue between modules and clusters, Redis Enterprise Software version 7.4.2-54 is not fully supported on Amazon Linux 2 clusters with databases that use the following modules: RedisGears, RediSearch, or RedisTimeSeries.
</p>
<p>
This issue will be fixed in a future maintenance release.
</p>
<h4 id="redisgraph-prevents-upgrade-to-rhel-9">
RedisGraph prevents upgrade to RHEL 9
</h4>
<p>
You cannot upgrade from a prior RHEL version to RHEL 9 if the Redis Enterprise cluster contains a RedisGraph module, even if unused by any database. The
<a href="https://redis.com/blog/redisgraph-eol/">
RedisGraph module has reached End-of-Life
</a>
and is completely unavailable in RHEL 9.
</p>
<h2 id="security">
Security
</h2>
<h4 id="open-source-redis-security-fixes-compatibility">
Open source Redis security fixes compatibility
</h4>
<p>
As part of Redis's commitment to security, Redis Enterprise Software implements the latest
<a href="https://github.com/redis/redis/releases">
security fixes
</a>
available with
<a href="https://github.com/redis/redis">
open source Redis
</a>
. Redis Enterprise has already included the fixes for the relevant CVEs.
</p>
<p>
Some CVEs announced for open source Redis do not affect Redis Enterprise due to different or additional functionality available in Redis Enterprise that is not available in open source Redis.
</p>
<p>
Redis Enterprise 7.4.6-22 supports open source Redis 7.2, 6.2, and 6.0. Below is the list of open source Redis CVEs fixed by version.
</p>
<p>
Redis 7.2.x:
</p>
<ul>
<li>
<p>
(CVE-2024-31449) An authenticated user may use a specially crafted Lua script to trigger a stack buffer overflow in the bit library, which may potentially lead to remote code execution.
</p>
</li>
<li>
<p>
(CVE-2024-31228) An authenticated user can trigger a denial-of-service by using specially crafted, long string match patterns on supported commands such as
<code>
KEYS
</code>
,
<code>
SCAN
</code>
,
<code>
PSUBSCRIBE
</code>
,
<code>
FUNCTION LIST
</code>
,
<code>
COMMAND LIST
</code>
, and ACL definitions. Matching of extremely long patterns may result in unbounded recursion, leading to stack overflow and process crashes.
</p>
</li>
<li>
<p>
(CVE-2023-41056) In some cases, Redis may incorrectly handle resizing of memory buffers, which can result in incorrect accounting of buffer sizes and lead to heap overflow and potential remote code execution.
</p>
</li>
<li>
<p>
(CVE-2023-41053) Redis does not correctly identify keys accessed by
<code>
SORT_RO
</code>
and, as a result, may grant users executing this command access to keys that are not explicitly authorized by the ACL configuration. (Redis 7.2.1)
</p>
</li>
</ul>
<p>
Redis 7.0.x:
</p>
<ul>
<li>
<p>
(CVE-2024-31449) An authenticated user may use a specially crafted Lua script to trigger a stack buffer overflow in the bit library, which may potentially lead to remote code execution.
</p>
</li>
<li>
<p>
(CVE-2024-31228) An authenticated user can trigger a denial-of-service by using specially crafted, long string match patterns on supported commands such as
<code>
KEYS
</code>
,
<code>
SCAN
</code>
,
<code>
PSUBSCRIBE
</code>
,
<code>
FUNCTION LIST
</code>
,
<code>
COMMAND LIST
</code>
, and ACL definitions. Matching of extremely long patterns may result in unbounded recursion, leading to stack overflow and process crashes.
</p>
</li>
<li>
<p>
(CVE-2023-41056) In some cases, Redis may incorrectly handle resizing of memory buffers, which can result in incorrect accounting of buffer sizes and lead to heap overflow and potential remote code execution.
</p>
</li>
<li>
<p>
(CVE-2023-41053) Redis does not correctly identify keys accessed by
<code>
SORT_RO
</code>
and, as a result, may grant users executing this command access to keys that are not explicitly authorized by the ACL configuration. (Redis 7.0.13)
</p>
</li>
<li>
<p>
(CVE-2023-36824) Extracting key names from a command and a list of arguments may, in some cases, trigger a heap overflow and result in reading random heap memory, heap corruption, and potentially remote code execution. Specifically: using
<code>
COMMAND GETKEYS*
</code>
and validation of key names in ACL rules. (Redis 7.0.12)
</p>
</li>
<li>
<p>
(CVE-2023-28856) Authenticated users can use the
<code>
HINCRBYFLOAT
</code>
command to create an invalid hash field that will crash Redis on access. (Redis 7.0.11)
</p>
</li>
<li>
<p>
(CVE-2023-28425) Specially crafted
<code>
MSETNX
</code>
commands can lead to assertion and denial-of-service. (Redis 7.0.10)
</p>
</li>
<li>
<p>
(CVE-2023-25155) Specially crafted
<code>
SRANDMEMBER
</code>
,
<code>
ZRANDMEMBER
</code>
, and
<code>
HRANDFIELD
</code>
commands can trigger an integer overflow, resulting in a runtime assertion and termination of the Redis server process. (Redis 7.0.9)
</p>
</li>
<li>
<p>
(CVE-2023-22458) Integer overflow in the Redis
<code>
HRANDFIELD
</code>
and
<code>
ZRANDMEMBER
</code>
commands can lead to denial-of-service. (Redis 7.0.8)
</p>
</li>
<li>
<p>
(CVE-2022-36021) String matching commands (like
<code>
SCAN
</code>
or
<code>
KEYS
</code>
) with a specially crafted pattern to trigger a denial-of-service attack on Redis can cause it to hang and consume 100% CPU time. (Redis 7.0.9)
</p>
</li>
<li>
<p>
(CVE-2022-35977) Integer overflow in the Redis
<code>
SETRANGE
</code>
and
<code>
SORT
</code>
/
<code>
SORT_RO
</code>
commands can drive Redis to OOM panic. (Redis 7.0.8)
</p>
</li>
<li>
<p>
(CVE-2022-35951) Executing an
<code>
XAUTOCLAIM
</code>
command on a stream key in a specific state, with a specially crafted
<code>
COUNT
</code>
argument, may cause an integer overflow, a subsequent heap overflow, and potentially lead to remote code execution. The problem affects Redis versions 7.0.0 or newer. (Redis 7.0.5)
</p>
</li>
<li>
<p>
(CVE-2022-31144) A specially crafted
<code>
XAUTOCLAIM
</code>
command on a stream key in a specific state may result in heap overflow and potentially remote code execution. The problem affects Redis versions 7.0.0 or newer. (Redis 7.0.4)
</p>
</li>
<li>
<p>
(CVE-2022-24834) A specially crafted Lua script executing in Redis can trigger a heap overflow in the cjson and cmsgpack libraries, and result in heap corruption and potentially remote code execution. The problem exists in all versions of Redis with Lua scripting support, starting from 2.6, and affects only authenticated and authorized users. (Redis 7.0.12)
</p>
</li>
<li>
<p>
(CVE-2022-24736) An attacker attempting to load a specially crafted Lua script can cause NULL pointer dereference which will result in a crash of the
<code>
redis-server
</code>
process. This issue affects all versions of Redis. (Redis 7.0.0)
</p>
</li>
<li>
<p>
(CVE-2022-24735) By exploiting weaknesses in the Lua script execution environment, an attacker with access to Redis can inject Lua code that will execute with the (potentially higher) privileges of another Redis user. (Redis 7.0.0)
</p>
</li>
</ul>
<p>
Redis 6.2.x:
</p>
<ul>
<li>
<p>
(CVE-2024-31449) An authenticated user may use a specially crafted Lua script to trigger a stack buffer overflow in the bit library, which may potentially lead to remote code execution.
</p>
</li>
<li>
<p>
(CVE-2024-31228) An authenticated user can trigger a denial-of-service by using specially crafted, long string match patterns on supported commands such as
<code>
KEYS
</code>
,
<code>
SCAN
</code>
,
<code>
PSUBSCRIBE
</code>
,
<code>
FUNCTION LIST
</code>
,
<code>
COMMAND LIST
</code>
, and ACL definitions. Matching of extremely long patterns may result in unbounded recursion, leading to stack overflow and process crashes.
</p>
</li>
<li>
<p>
(CVE-2023-28856) Authenticated users can use the
<code>
HINCRBYFLOAT
</code>
command to create an invalid hash field that will crash Redis on access. (Redis 6.2.12)
</p>
</li>
<li>
<p>
(CVE-2023-25155) Specially crafted
<code>
SRANDMEMBER
</code>
,
<code>
ZRANDMEMBER
</code>
, and
<code>
HRANDFIELD
</code>
commands can trigger an integer overflow, resulting in a runtime assertion and termination of the Redis server process. (Redis 6.2.11)
</p>
</li>
<li>
<p>
(CVE-2023-22458) Integer overflow in the Redis
<code>
HRANDFIELD
</code>
and
<code>
ZRANDMEMBER
</code>
commands can lead to denial-of-service. (Redis 6.2.9)
</p>
</li>
<li>
<p>
(CVE-2022-36021) String matching commands (like
<code>
SCAN
</code>
or
<code>
KEYS
</code>
) with a specially crafted pattern to trigger a denial-of-service attack on Redis can cause it to hang and consume 100% CPU time. (Redis 6.2.11)
</p>
</li>
<li>
<p>
(CVE-2022-35977) Integer overflow in the Redis
<code>
SETRANGE
</code>
and
<code>
SORT
</code>
/
<code>
SORT_RO
</code>
commands can drive Redis to OOM panic. (Redis 6.2.9)
</p>
</li>
<li>
<p>
(CVE-2022-24834) A specially crafted Lua script executing in Redis can trigger a heap overflow in the cjson and cmsgpack libraries, and result in heap corruption and potentially remote code execution. The problem exists in all versions of Redis with Lua scripting support, starting from 2.6, and affects only authenticated and authorized users. (Redis 6.2.13)
</p>
</li>
<li>
<p>
(CVE-2022-24736) An attacker attempting to load a specially crafted Lua script can cause NULL pointer dereference which will result in a crash of the
<code>
redis-server
</code>
process. This issue affects all versions of Redis. (Redis 6.2.7)
</p>
</li>
<li>
<p>
(CVE-2022-24735) By exploiting weaknesses in the Lua script execution environment, an attacker with access to Redis can inject Lua code that will execute with the (potentially higher) privileges of another Redis user. (Redis 6.2.7)
</p>
</li>
<li>
<p>
(CVE-2021-41099) Integer to heap buffer overflow handling certain string commands and network payloads, when
<code>
proto-max-bulk-len
</code>
is manually configured to a non-default, very large value. (Redis 6.2.6)
</p>
</li>
<li>
<p>
(CVE-2021-32762) Integer to heap buffer overflow issue in
<code>
redis-cli
</code>
and
<code>
redis-sentinel
</code>
parsing large multi-bulk replies on some older and less common platforms. (Redis 6.2.6)
</p>
</li>
<li>
<p>
(CVE-2021-32761) An integer overflow bug in Redis version 2.2 or newer can be exploited using the
<code>
BITFIELD
</code>
command to corrupt the heap and potentially result with remote code execution. (Redis 6.2.5)
</p>
</li>
<li>
<p>
(CVE-2021-32687) Integer to heap buffer overflow with intsets, when
<code>
set-max-intset-entries
</code>
is manually configured to a non-default, very large value. (Redis 6.2.6)
</p>
</li>
<li>
<p>
(CVE-2021-32675) Denial Of Service when processing RESP request payloads with a large number of elements on many connections. (Redis 6.2.6)
</p>
</li>
<li>
<p>
(CVE-2021-32672) Random heap reading issue with Lua Debugger. (Redis 6.2.6)
</p>
</li>
<li>
<p>
(CVE-2021-32628) Integer to heap buffer overflow handling ziplist-encoded data types, when configuring a large, non-default value for
<code>
hash-max-ziplist-entries
</code>
,
<code>
hash-max-ziplist-value
</code>
,
<code>
zset-max-ziplist-entries
</code>
or
<code>
zset-max-ziplist-value
</code>
. (Redis 6.2.6)
</p>
</li>
<li>
<p>
(CVE-2021-32627) Integer to heap buffer overflow issue with streams, when configuring a non-default, large value for
<code>
proto-max-bulk-len
</code>
and
<code>
client-query-buffer-limit
</code>
. (Redis 6.2.6)
</p>
</li>
<li>
<p>
(CVE-2021-32626) Specially crafted Lua scripts may result with Heap buffer overflow. (Redis 6.2.6)
</p>
</li>
<li>
<p>
(CVE-2021-32625) An integer overflow bug in Redis version 6.0 or newer can be exploited using the STRALGO LCS command to corrupt the heap and potentially result with remote code execution. This is a result of an incomplete fix by CVE-2021-29477. (Redis 6.2.4)
</p>
</li>
<li>
<p>
(CVE-2021-29478) An integer overflow bug in Redis 6.2 could be exploited to corrupt the heap and potentially result with remote code execution. The vulnerability involves changing the default set-max-intset-entries configuration value, creating a large set key that consists of integer values and using the COPY command to duplicate it. The integer overflow bug exists in all versions of Redis starting with 2.6, where it could result with a corrupted RDB or DUMP payload, but not exploited through COPY (which did not exist before 6.2). (Redis 6.2.3)
</p>
</li>
<li>
<p>
(CVE-2021-29477) An integer overflow bug in Redis version 6.0 or newer could be exploited using the STRALGO LCS command to corrupt the heap and potentially result in remote code execution. The integer overflow bug exists in all versions of Redis starting with 6.0. (Redis 6.2.3)
</p>
</li>
</ul>
<p>
Redis 6.0.x:
</p>
<ul>
<li>
<p>
(CVE-2022-24834) A specially crafted Lua script executing in Redis can trigger a heap overflow in the cjson and cmsgpack libraries, and result in heap corruption and potentially remote code execution. The problem exists in all versions of Redis with Lua scripting support, starting from 2.6, and affects only authenticated and authorized users. (Redis 6.0.20)
</p>
</li>
<li>
<p>
(CVE-2023-28856) Authenticated users can use the
<code>
HINCRBYFLOAT
</code>
command to create an invalid hash field that will crash Redis on access. (Redis 6.0.19)
</p>
</li>
<li>
<p>
(CVE-2023-25155) Specially crafted
<code>
SRANDMEMBER
</code>
,
<code>
ZRANDMEMBER
</code>
, and
<code>
HRANDFIELD
</code>
commands can trigger an integer overflow, resulting in a runtime assertion and termination of the Redis server process. (Redis 6.0.18)
</p>
</li>
<li>
<p>
(CVE-2022-36021) String matching commands (like
<code>
SCAN
</code>
or
<code>
KEYS
</code>
) with a specially crafted pattern to trigger a denial-of-service attack on Redis can cause it to hang and consume 100% CPU time. (Redis 6.0.18)
</p>
</li>
<li>
<p>
(CVE-2022-35977) Integer overflow in the Redis
<code>
SETRANGE
</code>
and
<code>
SORT
</code>
/
<code>
SORT_RO
</code>
commands can drive Redis to OOM panic. (Redis 6.0.17)
</p>
</li>
</ul>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/release-notes/rs-7-4-2-releases/rs-7-4-6-22/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/commands/xinfo/.html | <section class="prose w-full py-12">
<h1 class="command-name">
XINFO
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">XINFO</pre>
<dl class="grid grid-cols-[auto,1fr] gap-2 mb-12">
<dt class="font-semibold text-redis-ink-900 m-0">
Available since:
</dt>
<dd class="m-0">
5.0.0
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
Time complexity:
</dt>
<dd class="m-0">
Depends on subcommand.
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
ACL categories:
</dt>
<dd class="m-0">
<code>
@slow
</code>
<span class="mr-1 last:hidden">
,
</span>
</dd>
</dl>
<p>
This is a container command for stream introspection commands.
</p>
<p>
To see the list of available commands you can call
<a href="/docs/latest/commands/xinfo-help/">
<code>
XINFO HELP
</code>
</a>
.
</p>
<br/>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/xinfo/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/references/rest-api/objects/bdb/replica_sources_status/.html | <section class="prose w-full py-12 max-w-none">
<h1>
BDB replica sources status field
</h1>
<p class="text-lg -mt-5 mb-10">
Documents the bdb replica_sources status field used with Redis Enterprise Software REST API calls.
</p>
<p>
The
<code>
replica_sources
</code>
status field relates to the
<a href="/docs/latest/operate/rs/databases/import-export/replica-of/create/">
Replica Of
</a>
feature, which enables the creation of a Redis database (single- or multi-shard) that synchronizes data from another Redis database (single- or multi-shard).
</p>
<p>
The status field represents the Replica Of sync status for a specific sync source.
</p>
<p>
Possible status values:
</p>
<table>
<thead>
<tr>
<th>
Status
</th>
<th>
Description
</th>
<th>
Possible next status
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
'out-of-sync'
</td>
<td>
Sync process is disconnected from source and trying to reconnect
</td>
<td>
'syncing'
</td>
</tr>
<tr>
<td>
'syncing'
</td>
<td>
Sync process is in progress
</td>
<td>
'in-sync'
<br/>
'out-of-sync'
</td>
</tr>
<tr>
<td>
'in-sync'
</td>
<td>
Sync process finished successfully, and new commands are syncing on a regular basis
</td>
<td>
'syncing'
<br/>
'out-of-sync'
</td>
</tr>
</tbody>
</table>
<a href="/docs/latest/images/rs/rest-api-replica-sources-status.png#no-click" sdata-lightbox="/images/rs/rest-api-replica-sources-status.png#no-click">
<img alt="Replica sources status" src="/docs/latest/images/rs/rest-api-replica-sources-status.png#no-click"/>
</a>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/references/rest-api/objects/bdb/replica_sources_status/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/7.4/security/access-control/manage-users/login-lockout/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Manage user login
</h1>
<p class="text-lg -mt-5 mb-10">
Manage user login lockout and session timeout.
</p>
<p>
Redis Enterprise Software secures user access in a few different ways, including automatically:
</p>
<ul>
<li>
<p>
Locking user accounts after a series of authentication failures (invalid passwords)
</p>
</li>
<li>
<p>
Signing sessions out after a period of inactivity
</p>
</li>
</ul>
<p>
Here, you learn how to configure the relevant settings.
</p>
<h2 id="user-login-lockout">
User login lockout
</h2>
<p>
By default, after 5 failed login attempts within 15 minutes, the user account is locked for 30 minutes. You can change the user login lockout settings in the Cluster Manager UI or with
<a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/">
<code>
rladmin
</code>
</a>
.
</p>
<h3 id="view-login-lockout-settings">
View login lockout settings
</h3>
<p>
You can view the cluster's user login lockout settings from
<strong>
Cluster > Security > Preferences > Lockout threshold
</strong>
in the Cluster Manager UI or with
<a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/info/#info-cluster">
<code>
rladmin info cluster
</code>
</a>
:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ rladmin info cluster <span class="p">|</span> grep login_lockout
</span></span><span class="line"><span class="cl"> login_lockout_counter_reset_after: <span class="m">900</span>
</span></span><span class="line"><span class="cl"> login_lockout_duration: <span class="m">1800</span>
</span></span><span class="line"><span class="cl"> login_lockout_threshold: <span class="m">5</span>
</span></span></code></pre>
</div>
<h3 id="configure-user-login-lockout">
Configure user login lockout
</h3>
<p>
To change the user login lockout settings using the Cluster Manager UI:
</p>
<ol>
<li>
<p>
Go to
<strong>
Cluster > Security > Preferences
</strong>
, then select
<strong>
Edit
</strong>
.
</p>
</li>
<li>
<p>
In the
<strong>
Lockout threshold
</strong>
section, make sure the checkbox is selected.
</p>
<a href="/docs/latest/images/rs/screenshots/cluster/security-preferences-lockout-threshold.png" sdata-lightbox="/images/rs/screenshots/cluster/security-preferences-lockout-threshold.png">
<img alt="The Lockout threshold configuration section" src="/docs/latest/images/rs/screenshots/cluster/security-preferences-lockout-threshold.png"/>
</a>
</li>
<li>
<p>
Configure the following
<strong>
Lockout threshold
</strong>
settings:
</p>
<ol>
<li>
<p>
<strong>
Log-in attempts until user is revoked
</strong>
- The number of failed login attempts allowed before the user account is locked.
</p>
</li>
<li>
<p>
<strong>
Time between failed login attempts
</strong>
in seconds, minutes, or hours - The amount of time during which failed login attempts are counted.
</p>
</li>
<li>
<p>
For
<strong>
Unlock method
</strong>
, select one of the following:
</p>
<ul>
<li>
<p>
<strong>
Locked duration
</strong>
to set how long the user account is locked after excessive failed login attempts.
</p>
</li>
<li>
<p>
<strong>
Only Admin can unlock the user by resetting the password
</strong>
.
</p>
</li>
</ul>
</li>
</ol>
</li>
<li>
<p>
Select
<strong>
Save
</strong>
.
</p>
</li>
</ol>
<h3 id="change-allowed-login-attempts">
Change allowed login attempts
</h3>
<p>
To change the number of failed login attempts allowed before the user account is locked, use one of the following methods:
</p>
<ul>
<li>
<p>
<a href="#configure-user-login-lockout">
Cluster Manager UI
</a>
</p>
</li>
<li>
<p>
<a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/tune/#tune-cluster">
<code>
rladmin tune cluster
</code>
</a>
:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin tune cluster login_lockout_threshold <integer>
</span></span></code></pre>
</div>
<p>
For example, to set the lockout threshold to 10 failed login attempts, run:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin tune cluster login_lockout_threshold <span class="m">10</span>
</span></span></code></pre>
</div>
<p>
If you set the lockout threshold to 0, it turns off account lockout, and the cluster settings show
<code>
login_lockout_threshold: disabled
</code>
.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin tune cluster login_lockout_threshold <span class="m">0</span>
</span></span></code></pre>
</div>
</li>
</ul>
<h3 id="change-time-before-login-attempts-reset">
Change time before login attempts reset
</h3>
<p>
To change the amount of time during which failed login attempts are counted, use one of the following methods:
</p>
<ul>
<li>
<p>
<a href="#configure-user-login-lockout">
Cluster Manager UI
</a>
</p>
</li>
<li>
<p>
<a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/tune/#tune-cluster">
<code>
rladmin tune cluster
</code>
</a>
:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin tune cluster login_lockout_counter_reset_after <seconds>
</span></span></code></pre>
</div>
<p>
For example, to set the lockout reset to 1 hour, run:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin tune cluster login_lockout_counter_reset_after <span class="m">3600</span>
</span></span></code></pre>
</div>
</li>
</ul>
<h3 id="change-login-lockout-duration">
Change login lockout duration
</h3>
<p>
To change the amount of time that the user account is locked after excessive failed login attempts, use one of the following methods:
</p>
<ul>
<li>
<p>
<a href="#configure-user-login-lockout">
Cluster Manager UI
</a>
</p>
</li>
<li>
<p>
<a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/tune/#tune-cluster">
<code>
rladmin tune cluster
</code>
</a>
:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin tune cluster login_lockout_duration <login_lockout_duration>
</span></span></code></pre>
</div>
<p>
For example, to set the lockout duration to 1 hour, run:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin tune cluster login_lockout_duration <span class="m">3600</span>
</span></span></code></pre>
</div>
<p>
If you set the lockout duration to 0, then the account can be unlocked only when an administrator changes the account's password.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin tune cluster login_lockout_duration <span class="m">0</span>
</span></span></code></pre>
</div>
<p>
The cluster settings now show
<code>
login_lockout_duration: admin-release
</code>
.
</p>
</li>
</ul>
<h3 id="unlock-locked-user-accounts">
Unlock locked user accounts
</h3>
<p>
To unlock a user account in the Cluster Manager UI:
</p>
<ol>
<li>
<p>
Go to
<strong>
Access Control > Users
</strong>
. Locked users have a "User is locked out" label:
</p>
<a href="/docs/latest/images/rs/screenshots/access-control/users-locked-out.png" sdata-lightbox="/images/rs/screenshots/access-control/users-locked-out.png">
<img alt="The Access Control > Users configuration screen in the Cluster Manager UI" src="/docs/latest/images/rs/screenshots/access-control/users-locked-out.png"/>
</a>
</li>
<li>
<p>
Point to the user you want to unlock, then click
<strong>
Reset to unlock
</strong>
:
</p>
<a href="/docs/latest/images/rs/screenshots/access-control/users-reset-to-unlock.png" sdata-lightbox="/images/rs/screenshots/access-control/users-reset-to-unlock.png">
<img alt="Reset to unlock button appears when you point to a locked user in the list" src="/docs/latest/images/rs/screenshots/access-control/users-reset-to-unlock.png"/>
</a>
</li>
<li>
<p>
In the
<strong>
Reset user password
</strong>
dialog, enter a new password for the user:
</p>
<a href="/docs/latest/images/rs/screenshots/access-control/users-reset-user-password-dialog.png" sdata-lightbox="/images/rs/screenshots/access-control/users-reset-user-password-dialog.png">
<img alt="Reset user password dialog" src="/docs/latest/images/rs/screenshots/access-control/users-reset-user-password-dialog.png"/>
</a>
</li>
<li>
<p>
Select
<strong>
Save
</strong>
to reset the user's password and unlock their account.
</p>
</li>
</ol>
<p>
To unlock a user account or reset a user password with
<code>
rladmin
</code>
, run:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin cluster reset_password <user_email>
</span></span></code></pre>
</div>
<p>
To unlock a user account or reset a user password with the REST API, use
<a href="/docs/latest/operate/rs/7.4/references/rest-api/requests/users/#put-user">
<code>
PUT /v1/users
</code>
</a>
:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">PUT /v1/users
</span></span><span class="line"><span class="cl"><span class="o">{</span><span class="s2">"password"</span>: <span class="s2">"<new_password>"</span><span class="o">}</span>
</span></span></code></pre>
</div>
<h3 id="turn-off-login-lockout">
Turn off login lockout
</h3>
<p>
To turn off user login lockout and allow unlimited login attempts, use one of the following methods:
</p>
<ul>
<li>
<p>
Cluster Manager UI:
</p>
<ol>
<li>
<p>
Go to
<strong>
Cluster > Security > Preferences
</strong>
, then select
<strong>
Edit
</strong>
.
</p>
</li>
<li>
<p>
Clear the
<strong>
Lockout threshold
</strong>
checkbox.
</p>
</li>
<li>
<p>
Select
<strong>
Save
</strong>
.
</p>
</li>
</ol>
</li>
<li>
<p>
<a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/tune/#tune-cluster">
<code>
rladmin tune cluster
</code>
</a>
:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin tune cluster login_lockout_threshold <span class="m">0</span>
</span></span></code></pre>
</div>
</li>
</ul>
<p>
The cluster settings show
<code>
login_lockout_threshold: disabled
</code>
.
</p>
<h2 id="configure-session-timeout">
Configure session timeout
</h2>
<p>
The Redis Enterprise Cluster Manager UI supports session timeouts. By default, users are automatically logged out after 15 minutes of inactivity.
</p>
<p>
To customize the session timeout, use one of the following methods:
</p>
<ul>
<li>
<p>
Cluster Manager UI:
</p>
<ol>
<li>
<p>
Go to
<strong>
Cluster > Security > Preferences
</strong>
, then select
<strong>
Edit
</strong>
.
</p>
</li>
<li>
<p>
For
<strong>
Session timeout
</strong>
, select minutes or hours from the list and enter the timeout value.
</p>
</li>
<li>
<p>
Select
<strong>
Save
</strong>
.
</p>
</li>
</ol>
</li>
<li>
<p>
<a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/cluster/config/">
<code>
rladmin cluster config
</code>
</a>
:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin cluster config cm_session_timeout_minutes <number_of_min>
</span></span></code></pre>
</div>
<p>
The
<code>
<number_of_min>
</code>
is the number of minutes after which sessions will time out.
</p>
</li>
</ul>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/security/access-control/manage-users/login-lockout/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/commands/client-tracking/.html | <section class="prose w-full py-12">
<h1 class="command-name">
CLIENT TRACKING
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">CLIENT TRACKING <ON | OFF> [REDIRECTΒ client-id] [PREFIXΒ prefix
[PREFIX prefix ...]] [BCAST] [OPTIN] [OPTOUT] [NOLOOP]</pre>
<dl class="grid grid-cols-[auto,1fr] gap-2 mb-12">
<dt class="font-semibold text-redis-ink-900 m-0">
Available since:
</dt>
<dd class="m-0">
6.0.0
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
Time complexity:
</dt>
<dd class="m-0">
O(1). Some options may introduce additional complexity.
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
ACL categories:
</dt>
<dd class="m-0">
<code>
@slow
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@connection
</code>
<span class="mr-1 last:hidden">
,
</span>
</dd>
</dl>
<p>
This command enables the tracking feature of the Redis server, that is used
for
<a href="/docs/latest/develop/clients/client-side-caching/#tracking">
server assisted client side caching
</a>
.
</p>
<p>
When tracking is enabled Redis remembers the keys that the connection
requested, in order to send later invalidation messages when such keys are
modified. Invalidation messages are sent in the same connection (only available
when the RESP3 protocol is used) or redirected in a different connection
(available also with RESP2 and Pub/Sub). A special
<em>
broadcasting
</em>
mode is
available where clients participating in this protocol receive every
notification just subscribing to given key prefixes, regardless of the
keys that they requested. Given the complexity of the argument please
refer to
<a href="/docs/latest/develop/reference/client-side-caching/">
the main client side caching documentation
</a>
for the details. This manual page is only a reference for the options of this subcommand.
</p>
<p>
In order to enable tracking, use:
</p>
<pre><code>CLIENT TRACKING on ... options ...
</code></pre>
<p>
The feature will remain active in the current connection for all its life,
unless tracking is turned off with
<code>
CLIENT TRACKING off
</code>
at some point.
</p>
<p>
The following are the list of options that modify the behavior of the
command when enabling tracking:
</p>
<ul>
<li>
<code>
REDIRECT <id>
</code>
: send invalidation messages to the connection with the specified ID. The connection must exist. You can get the ID of a connection using
<a href="/docs/latest/commands/client-id/">
<code>
CLIENT ID
</code>
</a>
. If the connection we are redirecting to is terminated, when in RESP3 mode the connection with tracking enabled will receive
<code>
tracking-redir-broken
</code>
push messages in order to signal the condition.
</li>
<li>
<code>
BCAST
</code>
: enable tracking in broadcasting mode. In this mode invalidation messages are reported for all the prefixes specified, regardless of the keys requested by the connection. Instead when the broadcasting mode is not enabled, Redis will track which keys are fetched using read-only commands, and will report invalidation messages only for such keys.
</li>
<li>
<code>
PREFIX <prefix>
</code>
: for broadcasting, register a given key prefix, so that notifications will be provided only for keys starting with this string. This option can be given multiple times to register multiple prefixes. If broadcasting is enabled without this option, Redis will send notifications for every key. You can't delete a single prefix, but you can delete all prefixes by disabling and re-enabling tracking. Using this option adds the additional time complexity of O(N^2), where N is the total number of prefixes tracked.
</li>
<li>
<code>
OPTIN
</code>
: when broadcasting is NOT active, normally don't track keys in read only commands, unless they are called immediately after a
<code>
CLIENT CACHING yes
</code>
command.
</li>
<li>
<code>
OPTOUT
</code>
: when broadcasting is NOT active, normally track keys in read only commands, unless they are called immediately after a
<code>
CLIENT CACHING no
</code>
command.
</li>
<li>
<code>
NOLOOP
</code>
: don't send notifications about keys modified by this connection itself.
</li>
</ul>
<h2 id="resp2resp3-reply">
RESP2/RESP3 Reply
</h2>
<a href="../../develop/reference/protocol-spec#simple-strings">
Simple string reply
</a>
:
<code>
OK
</code>
if the connection was successfully put in tracking mode or if the tracking mode was successfully disabled. Otherwise, an error is returned.
<br/>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/client-tracking/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/references/compatibility/commands/generic/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Key commands compatibility
</h1>
<p class="text-lg -mt-5 mb-10">
Generic key commands compatible with Redis Enterprise.
</p>
<p>
The following table shows which Redis Community Edition
<a href="/docs/latest/commands/?group=generic">
key (generic) commands
</a>
are compatible with standard and Active-Active databases in Redis Enterprise Software and Redis Cloud.
</p>
<table>
<thead>
<tr>
<th style="text-align:left">
Command
</th>
<th style="text-align:left">
Redis
<br/>
Enterprise
</th>
<th style="text-align:left">
Redis
<br/>
Cloud
</th>
<th style="text-align:left">
Notes
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">
<a href="/docs/latest/commands/copy/">
COPY
</a>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active*
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active*
</nobr>
</span>
</td>
<td style="text-align:left">
For Active-Active or clustered databases, the source and destination keys must be in the same hash slot.
<br/>
<br/>
*Not supported for stream consumer group info.
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/commands/del/">
DEL
</a>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/commands/dump/">
DUMP
</a>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/commands/exists/">
EXISTS
</a>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/commands/expire/">
EXPIRE
</a>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/commands/expireat/">
EXPIREAT
</a>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/commands/expiretime/">
EXPIRETIME
</a>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/commands/keys/">
KEYS
</a>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/commands/migrate/">
MIGRATE
</a>
</td>
<td style="text-align:left">
<span title="Not supported">
β Standard
</span>
<br/>
<span title="Not supported">
<nobr>
β Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Not supported">
β Standard
</span>
<br/>
<span title="Not supported">
<nobr>
β Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/commands/move/">
MOVE
</a>
</td>
<td style="text-align:left">
<span title="Not supported">
β Standard
</span>
<br/>
<span title="Not supported">
<nobr>
β Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Not supported">
β Standard
</span>
<br/>
<span title="Not supported">
<nobr>
β Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
Redis Enterprise does not support shared databases due to potential negative performance impacts and blocks any related commands.
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/commands/object-encoding/">
OBJECT ENCODING
</a>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/commands/object-freq/">
OBJECT FREQ
</a>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/commands/object-idletime/">
OBJECT IDLETIME
</a>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/commands/object-refcount/">
OBJECT REFCOUNT
</a>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/commands/persist/">
PERSIST
</a>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/commands/pexpire/">
PEXPIRE
</a>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/commands/pexpireat/">
PEXPIREAT
</a>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/commands/pexpiretime/">
PEXPIRETIME
</a>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/commands/pttl/">
PTTL
</a>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/commands/randomkey/">
RANDOMKEY
</a>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/commands/rename/">
RENAME
</a>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active*
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active*
</nobr>
</span>
</td>
<td style="text-align:left">
For Active-Active or clustered databases, the original key and new key must be in the same hash slot.
<br/>
<br/>
*Not supported for stream consumer group info.
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/commands/renamenx/">
RENAMENX
</a>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
For Active-Active or clustered databases, the original key and new key must be in the same hash slot.
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/commands/restore/">
RESTORE
</a>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Not supported">
β Active-Active*
</span>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Not supported">
β Active-Active*
</span>
</td>
<td style="text-align:left">
*Only supported for module keys.
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/commands/scan/">
SCAN
</a>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/commands/sort/">
SORT
</a>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/commands/sort_ro/">
SORT_RO
</a>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/commands/touch/">
TOUCH
</a>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/commands/ttl/">
TTL
</a>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/commands/type/">
TYPE
</a>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/commands/unlink/">
UNLINK
</a>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/commands/wait/">
WAIT
</a>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Not supported">
<nobr>
β Active-Active*
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Not supported">
β Standard**
</span>
<br/>
<span title="Not supported">
<nobr>
β Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
*For Active-Active databases,
<code>
WAIT
</code>
commands are supported for primary and replica shard replication. You can contact support to enable
<code>
WAIT
</code>
for local replicas only.
<code>
WAIT
</code>
is not supported for cross-instance replication.
<br/>
<br/>
**
<code>
WAIT
</code>
commands are supported on Redis Cloud Flexible subscriptions.
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/commands/waitaof/">
WAITAOF
</a>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
</td>
</tr>
</tbody>
</table>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/references/compatibility/commands/generic/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/commands/cluster-setslot/.html | <section class="prose w-full py-12">
<h1 class="command-name">
CLUSTER SETSLOT
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">CLUSTER SETSLOT slot <IMPORTINGΒ node-id | MIGRATINGΒ node-id |
NODEΒ node-id | STABLE></pre>
<dl class="grid grid-cols-[auto,1fr] gap-2 mb-12">
<dt class="font-semibold text-redis-ink-900 m-0">
Available since:
</dt>
<dd class="m-0">
3.0.0
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
Time complexity:
</dt>
<dd class="m-0">
O(1)
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
ACL categories:
</dt>
<dd class="m-0">
<code>
@admin
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@slow
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@dangerous
</code>
<span class="mr-1 last:hidden">
,
</span>
</dd>
</dl>
<p>
<code>
CLUSTER SETSLOT
</code>
is responsible of changing the state of a hash slot in the receiving node in different ways. It can, depending on the subcommand used:
</p>
<ol>
<li>
<code>
MIGRATING
</code>
subcommand: Set a hash slot in
<em>
migrating
</em>
state.
</li>
<li>
<code>
IMPORTING
</code>
subcommand: Set a hash slot in
<em>
importing
</em>
state.
</li>
<li>
<code>
STABLE
</code>
subcommand: Clear any importing / migrating state from hash slot.
</li>
<li>
<code>
NODE
</code>
subcommand: Bind the hash slot to a different node.
</li>
</ol>
<p>
The command with its set of subcommands is useful in order to start and end cluster live resharding operations, which are accomplished by setting a hash slot in migrating state in the source node, and importing state in the destination node.
</p>
<p>
Each subcommand is documented below. At the end you'll find a description of
how live resharding is performed using this command and other related commands.
</p>
<h2 id="cluster-setslot-slot-migrating-destination-node-id">
CLUSTER SETSLOT
<code>
<slot>
</code>
MIGRATING
<code>
<destination-node-id>
</code>
</h2>
<p>
This subcommand sets a slot to
<em>
migrating
</em>
state. In order to set a slot
in this state, the node receiving the command must be the hash slot owner,
otherwise an error is returned.
</p>
<p>
When a slot is set in migrating state, the node changes behavior in the
following way:
</p>
<ol>
<li>
If a command is received about an existing key, the command is processed as usually.
</li>
<li>
If a command is received about a key that does not exists, an
<code>
ASK
</code>
redirection is emitted by the node, asking the client to retry only that specific query into
<code>
destination-node
</code>
. In this case the client should not update its hash slot to node mapping.
</li>
<li>
If the command contains multiple keys, in case none exist, the behavior is the same as point 2, if all exist, it is the same as point 1, however if only a partial number of keys exist, the command emits a
<code>
TRYAGAIN
</code>
error in order for the keys interested to finish being migrated to the target node, so that the multi keys command can be executed.
</li>
</ol>
<h2 id="cluster-setslot-slot-importing-source-node-id">
CLUSTER SETSLOT
<code>
<slot>
</code>
IMPORTING
<code>
<source-node-id>
</code>
</h2>
<p>
This subcommand is the reverse of
<code>
MIGRATING
</code>
, and prepares the destination
node to import keys from the specified source node. The command only works if
the node is not already owner of the specified hash slot.
</p>
<p>
When a slot is set in importing state, the node changes behavior in the following way:
</p>
<ol>
<li>
Commands about this hash slot are refused and a
<code>
MOVED
</code>
redirection is generated as usually, but in the case the command follows an
<a href="/docs/latest/commands/asking/">
<code>
ASKING
</code>
</a>
command, in this case the command is executed.
</li>
</ol>
<p>
In this way when a node in migrating state generates an
<code>
ASK
</code>
redirection, the client contacts the target node, sends
<a href="/docs/latest/commands/asking/">
<code>
ASKING
</code>
</a>
, and immediately after sends the command. This way commands about non-existing keys in the old node or keys already migrated to the target node are executed in the target node, so that:
</p>
<ol>
<li>
New keys are always created in the target node. During a hash slot migration we'll have to move only old keys, not new ones.
</li>
<li>
Commands about keys already migrated are correctly processed in the context of the node which is the target of the migration, the new hash slot owner, in order to guarantee consistency.
</li>
<li>
Without
<a href="/docs/latest/commands/asking/">
<code>
ASKING
</code>
</a>
the behavior is the same as usually. This guarantees that clients with a broken hash slots mapping will not write for error in the target node, creating a new version of a key that has yet to be migrated.
</li>
</ol>
<h2 id="cluster-setslot-slot-stable">
CLUSTER SETSLOT
<code>
<slot>
</code>
STABLE
</h2>
<p>
This subcommand just clears migrating / importing state from the slot. It is
mainly used to fix a cluster stuck in a wrong state by
<code>
redis-cli --cluster fix
</code>
.
Normally the two states are cleared automatically at the end of the migration
using the
<code>
SETSLOT ... NODE ...
</code>
subcommand as explained in the next section.
</p>
<h2 id="cluster-setslot-slot-node-node-id">
CLUSTER SETSLOT
<code>
<slot>
</code>
NODE
<code>
<node-id>
</code>
</h2>
<p>
The
<code>
NODE
</code>
subcommand is the one with the most complex semantics. It
associates the hash slot with the specified node, however the command works
only in specific situations and has different side effects depending on the
slot state. The following is the set of pre-conditions and side effects of the
command:
</p>
<ol>
<li>
If the current hash slot owner is the node receiving the command, but for effect of the command the slot would be assigned to a different node, the command will return an error if there are still keys for that hash slot in the node receiving the command.
</li>
<li>
If the slot is in
<em>
migrating
</em>
state, the state gets cleared when the slot is assigned to another node.
</li>
<li>
If the slot was in
<em>
importing
</em>
state in the node receiving the command, and the command assigns the slot to this node (which happens in the target node at the end of the resharding of a hash slot from one node to another), the command has the following side effects: A) the
<em>
importing
</em>
state is cleared. B) If the node config epoch is not already the greatest of the cluster, it generates a new one and assigns the new config epoch to itself. This way its new hash slot ownership will win over any past configuration created by previous failovers or slot migrations.
</li>
</ol>
<p>
It is important to note that step 3 is the only time when a Redis Cluster node will create a new config epoch without agreement from other nodes. This only happens when a manual configuration is operated. However it is impossible that this creates a non-transient setup where two nodes have the same config epoch, since Redis Cluster uses a config epoch collision resolution algorithm.
</p>
<h2 id="redis-cluster-live-resharding-explained">
Redis Cluster live resharding explained
</h2>
<p>
The
<code>
CLUSTER SETSLOT
</code>
command is an important piece used by Redis Cluster in order to migrate all the keys contained in one hash slot from one node to another. This is how the migration is orchestrated, with the help of other commands as well. We'll call the node that has the current ownership of the hash slot the
<code>
source
</code>
node, and the node where we want to migrate the
<code>
destination
</code>
node.
</p>
<ol>
<li>
Set the destination node slot to
<em>
importing
</em>
state using
<code>
CLUSTER SETSLOT <slot> IMPORTING <source-node-id>
</code>
.
</li>
<li>
Set the source node slot to
<em>
migrating
</em>
state using
<code>
CLUSTER SETSLOT <slot> MIGRATING <destination-node-id>
</code>
.
</li>
<li>
Get keys from the source node with
<a href="/docs/latest/commands/cluster-getkeysinslot/">
<code>
CLUSTER GETKEYSINSLOT
</code>
</a>
command and move them into the destination node using the
<a href="/docs/latest/commands/migrate/">
<code>
MIGRATE
</code>
</a>
command.
</li>
<li>
Send
<code>
CLUSTER SETSLOT <slot> NODE <destination-node-id>
</code>
to the destination node.
</li>
<li>
Send
<code>
CLUSTER SETSLOT <slot> NODE <destination-node-id>
</code>
to the source node.
</li>
<li>
Send
<code>
CLUSTER SETSLOT <slot> NODE <destination-node-id>
</code>
to the other master nodes (optional).
</li>
</ol>
<p>
Notes:
</p>
<ul>
<li>
The order of step 1 and 2 is important. We want the destination node to be ready to accept
<code>
ASK
</code>
redirections when the source node is configured to redirect.
</li>
<li>
The order of step 4 and 5 is important.
The destination node is responsible for propagating the change to the rest of the cluster.
If the source node is informed before the destination node and the destination node crashes before it is set as new slot owner, the slot is left with no owner, even after a successful failover.
</li>
<li>
Step 6, sending
<code>
SETSLOT
</code>
to the nodes not involved in the resharding, is not technically necessary since the configuration will eventually propagate itself.
However, it is a good idea to do so in order to stop nodes from pointing to the wrong node for the hash slot moved as soon as possible, resulting in less redirections to find the right node.
</li>
</ul>
<h2 id="resp2resp3-reply">
RESP2/RESP3 Reply
</h2>
<a href="../../develop/reference/protocol-spec#simple-strings">
Simple string reply
</a>
: all the sub-commands return
<code>
OK
</code>
if the command was successful. Otherwise an error is returned.
<br/>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/cluster-setslot/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/databases/active-active/develop/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Active-Active Redis applications
</h1>
<p class="text-lg -mt-5 mb-10">
General information to keep in mind while developing applications for an Active-Active database.
</p>
<p>
Developing globally distributed applications can be challenging, as
developers have to think about race conditions and complex combinations
of events under geo-failovers and cross-region write conflicts. In Redis Enterprise Software (RS), Active-Active databases
simplify developing such applications by directly using built-in smarts
for handling conflicting writes based on the data type in use. Instead
of depending on just simplistic "last-writer-wins" type conflict
resolution, geo-distributed Active-Active databases (formerly known as CRDBs) combines techniques defined in CRDT
(conflict-free replicated data types) research with Redis types to
provide smart and automatic conflict resolution based on the data types
intent.
</p>
<p>
An Active-Active database is a globally distributed database that spans multiple Redis
Enterprise Software clusters. Each Active-Active database can have many Active-Active database instances
that come with added smarts for handling globally distributed writes
using the proven
<a href="https://en.wikipedia.org/wiki/Conflict-free_replicated_data_type">
CRDT
</a>
approach.
<a href="https://en.wikipedia.org/wiki/Conflict-free_replicated_data_type">
CRDT
</a>
research describes a set of techniques for creating systems that can
handle conflicting writes. CRDBs are powered by Multi-Master Replication
(MMR) provides a straightforward and effective way to replicate your
data between regions and simplify development of complex applications
that can maintain correctness under geo-failovers and concurrent
cross-region writes to the same data.
</p>
<a href="/docs/latest/images/rs/crdbs.png" sdata-lightbox="/images/rs/crdbs.png">
<img alt="Geo-replication world map" src="/docs/latest/images/rs/crdbs.png"/>
</a>
<p>
Active-Active databases replicate data between multiple Redis Enterprise Software
clusters. Common uses for Active-Active databases include disaster recovery,
geographically redundant applications, and keeping data closer to your
user's locations. MMR is always multi-directional amongst the clusters
configured in the Active-Active database. For unidirectional replication, please see the
Replica Of capabilities in Redis Enterprise Software.
</p>
<h2 id="example-of-synchronization">
Example of synchronization
</h2>
<p>
In the example below, database writes are concurrent at theΒ point in
times t1 and t2 and happen before a sync can communicate the changes.
However, writes at times t4 and t6 are not concurrent as a sync happened
in between.
</p>
<table>
<thead>
<tr>
<th style="text-align:right">
<strong>
Time
</strong>
</th>
<th style="text-align:center">
<strong>
CRDB Instance1
</strong>
</th>
<th style="text-align:center">
<strong>
CRDB Instance2
</strong>
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:right">
t1
</td>
<td style="text-align:center">
SET key1 βaβ
</td>
<td style="text-align:center">
</td>
</tr>
<tr>
<td style="text-align:right">
t2
</td>
<td style="text-align:center">
</td>
<td style="text-align:center">
SET key1 βbβ
</td>
</tr>
<tr>
<td style="text-align:right">
t3
</td>
<td style="text-align:center">
β Sync β
</td>
<td style="text-align:center">
β Sync β
</td>
</tr>
<tr>
<td style="text-align:right">
t4
</td>
<td style="text-align:center">
SET key1 βcβ
</td>
<td style="text-align:center">
</td>
</tr>
<tr>
<td style="text-align:right">
t5
</td>
<td style="text-align:center">
β Sync β
</td>
<td style="text-align:center">
β Sync β
</td>
</tr>
<tr>
<td style="text-align:right">
t6
</td>
<td style="text-align:center">
</td>
<td style="text-align:center">
SET key1 βdβ
</td>
</tr>
</tbody>
</table>
<p>
<a href="/docs/latest/operate/rs/databases/active-active/">
Learn more about
synchronization
</a>
for
each supported data type and
<a href="/docs/latest/operate/rs/databases/active-active/develop/develop-for-aa/">
how to develop
</a>
with them on Redis Enterprise Software.
</p>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/databases/active-active/develop/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/7.4/references/rest-api/requests/ocsp/.html | <section class="prose w-full py-12 max-w-none">
<h1>
OCSP requests
</h1>
<p class="text-lg -mt-5 mb-10">
OCSP requests
</p>
<table>
<thead>
<tr>
<th>
Method
</th>
<th>
Path
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="#get-ocsp">
GET
</a>
</td>
<td>
<code>
/v1/ocsp
</code>
</td>
<td>
Get OCSP configuration
</td>
</tr>
<tr>
<td>
<a href="#put-ocsp">
PUT
</a>
</td>
<td>
<code>
/v1/ocsp
</code>
</td>
<td>
Update OCSP configuration
</td>
</tr>
</tbody>
</table>
<h2 id="get-ocsp">
Get OCSP configuration
</h2>
<pre><code>GET /v1/ocsp
</code></pre>
<p>
Gets the cluster's OCSP configuration.
</p>
<h4 id="required-permissions">
Required permissions
</h4>
<table>
<thead>
<tr>
<th>
Permission name
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="/docs/latest/operate/rs/7.4/references/rest-api/permissions/#view_ocsp_config">
view_ocsp_config
</a>
</td>
</tr>
</tbody>
</table>
<h3 id="get-request">
Request
</h3>
<h4 id="example-http-request">
Example HTTP request
</h4>
<pre><code>GET /ocsp
</code></pre>
<h4 id="request-headers">
Request headers
</h4>
<table>
<thead>
<tr>
<th>
Key
</th>
<th>
Value
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
Host
</td>
<td>
cnm.cluster.fqdn
</td>
<td>
Domain name
</td>
</tr>
<tr>
<td>
Accept
</td>
<td>
application/json
</td>
<td>
Accepted media type
</td>
</tr>
</tbody>
</table>
<h3 id="get-response">
Response
</h3>
<p>
Returns an
<a href="/docs/latest/operate/rs/7.4/references/rest-api/objects/ocsp/">
OCSP configuration object
</a>
.
</p>
<h4 id="example-json-body">
Example JSON body
</h4>
<div class="highlight">
<pre class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"ocsp_functionality"</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"responder_url"</span><span class="p">:</span> <span class="s2">"http://responder.ocsp.url.com"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"query_frequency"</span><span class="p">:</span> <span class="mi">3800</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"response_timeout"</span><span class="p">:</span> <span class="mi">2</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"recovery_frequency"</span><span class="p">:</span> <span class="mi">80</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"recovery_max_tries"</span><span class="p">:</span> <span class="mi">20</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span></code></pre>
</div>
<h3 id="get-error-codes">
Error codes
</h3>
<p>
When errors occur, the server returns a JSON object with
<code>
error_code
</code>
and
<code>
message
</code>
fields that provide additional information. The following are possible
<code>
error_code
</code>
values:
</p>
<table>
<thead>
<tr>
<th>
Code
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
ocsp_unsupported_by_capability
</td>
<td>
Not all nodes support OCSP capability
</td>
</tr>
</tbody>
</table>
<h3 id="get-status-codes">
Status codes
</h3>
<table>
<thead>
<tr>
<th>
Code
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1">
200 OK
</a>
</td>
<td>
Success
</td>
</tr>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.7">
406 Not Acceptable
</a>
</td>
<td>
Feature not supported in all nodes
</td>
</tr>
</tbody>
</table>
<h2 id="put-ocsp">
Update OCSP configuration
</h2>
<pre><code>PUT /v1/ocsp
</code></pre>
<p>
Updates the cluster's OCSP configuration.
</p>
<h4 id="required-permissions-1">
Required permissions
</h4>
<table>
<thead>
<tr>
<th>
Permission name
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="/docs/latest/operate/rs/7.4/references/rest-api/permissions/#config_ocsp">
config_ocsp
</a>
</td>
</tr>
</tbody>
</table>
<h3 id="put-request">
Request
</h3>
<h4 id="example-http-request-1">
Example HTTP request
</h4>
<pre><code>PUT /ocsp
</code></pre>
<h4 id="example-json-body-1">
Example JSON body
</h4>
<div class="highlight">
<pre class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"ocsp_functionality"</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"query_frequency"</span><span class="p">:</span> <span class="mi">3800</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"response_timeout"</span><span class="p">:</span> <span class="mi">2</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"recovery_frequency"</span><span class="p">:</span> <span class="mi">80</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"recovery_max_tries"</span><span class="p">:</span> <span class="mi">20</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span></code></pre>
</div>
<h4 id="request-headers-1">
Request headers
</h4>
<table>
<thead>
<tr>
<th>
Key
</th>
<th>
Value
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
Host
</td>
<td>
cnm.cluster.fqdn
</td>
<td>
Domain name
</td>
</tr>
<tr>
<td>
Accept
</td>
<td>
application/json
</td>
<td>
Accepted media type
</td>
</tr>
</tbody>
</table>
<h4 id="request-body">
Request body
</h4>
<p>
Include an
<a href="/docs/latest/operate/rs/7.4/references/rest-api/objects/ocsp/">
OCSP configuration object
</a>
with updated fields in the request body.
</p>
<h3 id="put-response">
Response
</h3>
<p>
Returns the updated
<a href="/docs/latest/operate/rs/7.4/references/rest-api/objects/ocsp/">
OCSP configuration object
</a>
.
</p>
<h3 id="put-error-codes">
Error codes
</h3>
<p>
When errors occur, the server returns a JSON object with
<code>
error_code
</code>
and
<code>
message
</code>
fields that provide additional information. The following are possible
<code>
error_code
</code>
values:
</p>
<table>
<thead>
<tr>
<th>
Code
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
invalid_schema
</td>
<td>
An illegal parameter or a parameter with an illegal value
</td>
</tr>
<tr>
<td>
no_responder_url
</td>
<td>
Tried to enable OCSP with no responder URL configured
</td>
</tr>
<tr>
<td>
ocsp_unsupported_by_capability
</td>
<td>
Not all nodes support OCSP capability
</td>
</tr>
</tbody>
</table>
<h3 id="put-status-codes">
Status codes
</h3>
<table>
<thead>
<tr>
<th>
Code
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1">
200 OK
</a>
</td>
<td>
Success, OCSP config has been set
</td>
</tr>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1">
400 Bad Request
</a>
</td>
<td>
Bad or missing configuration parameters
</td>
</tr>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.7">
406 Not Acceptable
</a>
</td>
<td>
Feature not supported in all nodes
</td>
</tr>
</tbody>
</table>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/references/rest-api/requests/ocsp/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/commands/topk.info.html | <section class="prose w-full py-12">
<h1 class="command-name">
TOPK.INFO
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">TOPK.INFO key</pre>
<dl class="grid grid-cols-[auto,1fr] gap-2 mb-12">
<dt class="font-semibold text-redis-ink-900 m-0">
Available in:
</dt>
<dd class="m-0">
<a href="/docs/stack">
Redis Stack
</a>
/
<a href="/docs/data-types/probabilistic">
Bloom 2.0.0
</a>
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
Time complexity:
</dt>
<dd class="m-0">
O(1)
</dd>
</dl>
<p>
Returns number of required items (k), width, depth and decay values.
</p>
<h3 id="parameters">
Parameters
</h3>
<ul>
<li>
<strong>
key
</strong>
: Name of sketch.
</li>
</ul>
<h2 id="return">
Return
</h2>
<p>
<a href="/docs/latest/develop/reference/protocol-spec/#arrays">
Array reply
</a>
with information of the filter.
</p>
<h2 id="examples">
Examples
</h2>
<pre tabindex="0"><code>TOPK.INFO topk
1) k
2) (integer) 50
3) width
4) (integer) 2000
5) depth
6) (integer) 7
7) decay
8) "0.92500000000000004"
</code></pre>
<br/>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/topk.info/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisgraph/redisgraph-2.8-release-notes/.html | <section class="prose w-full py-12 max-w-none">
<h1>
RedisGraph 2.8 release notes
</h1>
<p class="text-lg -mt-5 mb-10">
Introduces multi-labeled nodes, indexes over relationship properties, and additional expressivity (Cypher construct, functions, and operators). Major performance enhancements. Many bug fixes.
</p>
<h2 id="requirements">
Requirements
</h2>
<p>
RedisGraph v2.8.26 requires:
</p>
<ul>
<li>
Minimum Redis compatibility version (database): 6.2.0
</li>
<li>
Minimum Redis Enterprise Software version (cluster): 6.2.8
</li>
</ul>
<h2 id="v2826-march-2023">
v2.8.26 (March 2023)
</h2>
<p>
This is a maintenance release for RedisGraph 2.8.
</p>
<p>
Update urgency:
<code>
HIGH
</code>
: There is a critical bug that may affect a subset of users. Upgrade!
</p>
<p>
Details:
</p>
<ul>
<li>
<p>
Bug fixes:
</p>
<ul>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/issues/2880">
#2880
</a>
Potential crash when using WITH * expressions
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/issues/2917">
#2917
</a>
Potential crash when using CASE expressions (MOD-4873)
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/issues/2836">
#2836
</a>
Potential crash on *0 variable-length path (MOD-4817)
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/issues/2916">
#2916
</a>
Potential crash when executing concurrent queries that utilize full-text indices (MOD-4818)
</li>
</ul>
</li>
</ul>
<h2 id="v2825-february-2023">
v2.8.25 (February 2023)
</h2>
<p>
This is a maintenance release for RedisGraph 2.8.
</p>
<p>
Update urgency:
<code>
MODERATE
</code>
: Program an upgrade of the server, but it's not urgent.
</p>
<p>
Details:
</p>
<ul>
<li>
<p>
Bug fixes:
</p>
<ul>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/issues/2890">
#2890
</a>
Potential wrong results on variable-length path
</li>
</ul>
</li>
</ul>
<h2 id="v2824-february-2023">
v2.8.24 (February 2023)
</h2>
<p>
This is a maintenance release for RedisGraph 2.8.
</p>
<p>
Update urgency:
<code>
HIGH
</code>
: There is a critical bug that may affect a subset of users. Upgrade!
</p>
<p>
Details:
</p>
<ul>
<li>
<p>
Bug fixes:
</p>
<ul>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/issues/2777">
#2777
</a>
,
<a href="https://github.com/RedisGraph/RedisGraph/issues/2841">
#2841
</a>
Potential crash when sending queries from multiple connections and timeout is not 0
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/issues/2844">
#2844
</a>
Potential partial results when same parametrized query is running from multiple connections
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/issues/2739">
#2739
</a>
,
<a href="https://github.com/RedisGraph/RedisGraph/issues/2774">
#2774
</a>
Paths with exact variable length >1 are not matched
</li>
</ul>
</li>
<li>
<p>
Improvements:
</p>
<ul>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2758">
#2758
</a>
Improved edge deletion performance
</li>
</ul>
</li>
</ul>
<h2 id="v2821-january-2023">
v2.8.21 (January 2023)
</h2>
<p>
This is a maintenance release for RedisGraph 2.8.
</p>
<p>
Update urgency:
<code>
HIGH
</code>
: There is a critical bug that may affect a subset of users. Upgrade!
</p>
<p>
Details:
</p>
<ul>
<li>
<p>
Bug fixes:
</p>
<ul>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2754">
#2754
</a>
Partial sync may hang (MOD-4594)
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2695">
#2695
</a>
Potential crash on certain write queries (MOD-4286, MOD-4545)
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/issues/2637">
#2637
</a>
,
<a href="https://github.com/RedisGraph/RedisGraph/issues/2460">
#2460
</a>
,
<a href="https://github.com/RedisGraph/RedisGraph/issues/2680">
#2680
</a>
Crash on invalid queries
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/issues/2484">
#2484
</a>
Indexes can be created on invalid property names
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/issues/2672">
#2672
</a>
Wrong matching result on multiple labels
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/issues/2643">
#2643
</a>
Duplicate reports when matching relationship type
<code>
:R|R
</code>
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/issues/2687">
#2687
</a>
,
<a href="https://github.com/RedisGraph/RedisGraph/issues/2414">
#2414
</a>
Error when
<code>
UNWIND
</code>
ing relationships
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/issues/2635">
#2635
</a>
Cannot
<code>
UNWIND
</code>
an expression that is not a list
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/issues/2636">
#2636
</a>
<code>
MERGE
</code>
...
<code>
ON
</code>
... - cannot remove a property by setting it to null
</li>
</ul>
</li>
<li>
<p>
Improvements:
</p>
<ul>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2790">
#2790
</a>
Improved performance by disabling SuiteSparse:GraphBLAS' global free pool
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2757">
#2757
</a>
Improved performance of
<code>
indegree
</code>
and
<code>
outdegree
</code>
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/issues/2740">
#2740
</a>
Donβt show partial results for timed out
<code>
GRAPH.PROFILE
</code>
</li>
</ul>
</li>
</ul>
<h2 id="v2820-september-2022">
v2.8.20 (September 2022)
</h2>
<p>
This is a maintenance release for RedisGraph 2.8.
</p>
<p>
Update urgency:
<code>
MODERATE
</code>
: Program an upgrade of the server, but it's not urgent.
</p>
<p>
Details:
</p>
<ul>
<li>
<p>
Bug fixes:
</p>
<ul>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/issues/2591">
#2591
</a>
Potential crash trying to utilize a nonexistent index
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/issues/2558">
#2558
</a>
Multi-relationship properties created before index creation are not indexed
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/issues/2571">
#2571
</a>
<code>
min
</code>
and
<code>
max
</code>
return wrong results when the argument is an array
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/issues/2587">
#2587
</a>
Some queries generate a "forced unlocking commit flow" warning
</li>
</ul>
</li>
<li>
<p>
Improvements:
</p>
<ul>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/issues/2533">
#2533
</a>
Graph slow log can be reset with
<code>
GRAPH.SLOWLOG g RESET
</code>
</li>
</ul>
</li>
</ul>
<h2 id="v2819-august-2022">
v2.8.19 (August 2022)
</h2>
<p>
This is a maintenance release for RedisGraph 2.8.
</p>
<p>
Update urgency:
<code>
MODERATE
</code>
: Program an upgrade of the server, but it's not urgent.
</p>
<p>
Details:
</p>
<ul>
<li>
<p>
Bug fixes:
</p>
<ul>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/issues/2517">
#2517
</a>
Crash on invalid
<code>
REDUCE
</code>
queries
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/issues/2525">
#2525
</a>
<code>
toJSON
</code>
- node labels are not separated with a comma (
<code>
,
</code>
)
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/issues/2467">
#2467
</a>
Possibly wrong results when using a variable named
<code>
anon_N
</code>
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2522">
#2522
</a>
Deleting an edge index leaves traces
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/issues/2477">
#2477
</a>
Cannot extract the latitude or the longitude of a point
</li>
</ul>
</li>
<li>
<p>
Improvements:
</p>
<ul>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2519">
#2519
</a>
When a query is cached and then a relevant index is created, recalculate the execution plan
</li>
</ul>
</li>
</ul>
<h2 id="v2817-july-2022">
v2.8.17 (July 2022)
</h2>
<p>
This is a maintenance release for RedisGraph 2.8.
</p>
<p>
Update urgency:
<code>
HIGH
</code>
: There is a critical bug that may affect a subset of users. Upgrade!
</p>
<p>
Details:
</p>
<ul>
<li>
<p>
Bug fixes:
</p>
<ul>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2499">
#2499
</a>
Potential crash with concurrent connections due to missing lock - additional fixes
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/issues/2424">
#2424
</a>
Potential crash when using
<code>
ORDER BY
</code>
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/issues/2491">
#2491
</a>
Whitespaces between
<code>
MATCH
</code>
terms can render the query invalid
</li>
</ul>
</li>
</ul>
<h2 id="v2816-july-2022">
v2.8.16 (July 2022)
</h2>
<p>
This is a maintenance release for RedisGraph 2.8.
</p>
<p>
Update urgency:
<code>
HIGH
</code>
: There is a critical bug that may affect a subset of users. Upgrade!
</p>
<p>
Details:
</p>
<ul>
<li>
<p>
Bug fixes:
</p>
<ul>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2478">
#2478
</a>
Potential crash with concurrent connections due to missing lock
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/issues/2370">
#2370
</a>
Potential crash / wrong results / warning messages when using edge indexes
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/issues/2473">
#2473
</a>
Crash on invalid
<code>
distance()
</code>
query with index
</li>
</ul>
</li>
</ul>
<h2 id="v2815-june-2022">
v2.8.15 (June 2022)
</h2>
<p>
This is a maintenance release for RedisGraph 2.8.
</p>
<p>
Update urgency:
<code>
HIGH
</code>
: There is a critical bug that may affect a subset of users. Upgrade!
</p>
<p>
Details:
</p>
<ul>
<li>
<p>
Bug fixes:
</p>
<ul>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/issues/2241">
#2241
</a>
Possible crash on queries with
<code>
MERGE
</code>
operation in a Cartesian product (MOD-3500)
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/issues/2394">
#2394
</a>
Possible crash when freeing an index immediately after its creation
</li>
</ul>
</li>
</ul>
<h2 id="v2814-june-2022">
v2.8.14 (June 2022)
</h2>
<p>
This is a maintenance release for RedisGraph 2.8.
</p>
<p>
Update urgency:
<code>
HIGH
</code>
: There is a critical bug that may affect a subset of users. Upgrade!
</p>
<p>
Details:
</p>
<ul>
<li>
<p>
Features:
</p>
<ul>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2403">
#2403
</a>
Introduce
<code>
toFloat
</code>
function
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/issues/2365">
#2365
</a>
Commands that don't execute on the main thread now also appear in
<a href="/docs/latest/commands/slowlog/">
SLOWLOG
</a>
</li>
</ul>
</li>
<li>
<p>
Bug fixes:
</p>
<ul>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2381">
#2381
</a>
Rare data corruption on data encoding
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/issues/2393">
#2393
</a>
,
<a href="https://github.com/RedisGraph/RedisGraph/issues/2395">
#2395
</a>
Crash when searching an index for a runtime-determined value
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/issues/2377">
#2377
</a>
Crash on
<code>
INT_MIN % -1
</code>
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/issues/2390">
#2390
</a>
Crash on distance filter
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/issues/2407">
#2407
</a>
Crash on double to string
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2422">
#2422
</a>
<code>
toJSON
</code>
returned floating points cropped to 6 decimals
</li>
</ul>
</li>
</ul>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Note:
</div>
New RDB version (v12). RDB files created with v2.8.14 or later are not backward compatible.
</div>
</div>
<h2 id="v2813-may-2022">
v2.8.13 (May 2022)
</h2>
<p>
This is a maintenance release for RedisGraph 2.8.
</p>
<p>
Update urgency:
<code>
HIGH
</code>
: There is a critical bug that may affect a subset of users. Upgrade!
</p>
<p>
Details:
</p>
<ul>
<li>
<p>
Bug fixes:
</p>
<ul>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2351">
#2351
</a>
Potential memory leak on query timeout
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/issues/2348">
#2348
</a>
Crash when converting certain Cypher queries to RediSearch queries
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2331">
#2331
</a>
Two memory leaks (one on failed RDB loading, one on certain invalid queries)
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2328">
#2328
</a>
,
<a href="https://github.com/RedisGraph/RedisGraph/issues/2306">
#2306
</a>
,
<a href="https://github.com/RedisGraph/RedisGraph/issues/2307">
#2307
</a>
,
<a href="https://github.com/RedisGraph/RedisGraph/issues/2326">
#2326
</a>
Disallow redeclaration of variables; fixed false redeclaration errors
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2363">
#2363
</a>
Nodes were sometimes created with more labels than those specified
</li>
</ul>
</li>
</ul>
<h2 id="v2812-may-2022">
v2.8.12 (May 2022)
</h2>
<p>
This is a maintenance release for RedisGraph 2.8.
</p>
<p>
Update urgency:
<code>
HIGH
</code>
: There is a critical bug that may affect a subset of users. Upgrade!
</p>
<p>
Details:
</p>
<ul>
<li>
<p>
Bug fixes:
</p>
<ul>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/issues/2278">
#2278
</a>
,
<a href="https://github.com/RedisGraph/RedisGraph/pull/2301">
#2301
</a>
Potential crash on bulk update
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/issues/2262">
#2262
</a>
,
<a href="https://github.com/RedisGraph/RedisGraph/issues/2271">
#2271
</a>
,
<a href="https://github.com/RedisGraph/RedisGraph/issues/2272">
#2272
</a>
,
<a href="https://github.com/RedisGraph/RedisGraph/issues/2273">
#2273
</a>
,
<a href="https://github.com/RedisGraph/RedisGraph/issues/2282">
#2282
</a>
,
<a href="https://github.com/RedisGraph/RedisGraph/issues/2288">
#2288
</a>
,
<a href="https://github.com/RedisGraph/RedisGraph/issues/2299">
#2299
</a>
,
<a href="https://github.com/RedisGraph/RedisGraph/issues/2312">
#2312
</a>
,
<a href="https://github.com/RedisGraph/RedisGraph/issues/2321">
#2321
</a>
,
<a href="https://github.com/RedisGraph/RedisGraph/issues/2325">
#2325
</a>
,
<a href="https://github.com/RedisGraph/RedisGraph/issues/2323">
#2323
</a>
Potential crash on certain queries
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/issues/1441">
#1441
</a>
Query returns wrong result: projection before Cartesian product causes only one result to be returned
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/issues/2298">
#2298
</a>
Query returns wrong result: wrong value when fetching a string property from a map
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2318">
#2318
</a>
Memory leak
</li>
</ul>
</li>
</ul>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Note:
</div>
Duplicate column names in a query are no longer valid. For example, the query
<code>
GRAPH.QUERY g "MATCH (e) RETURN e, e"
</code>
is not valid. If you need to return the same column twice, you can rewrite the query as
<code>
GRAPH.QUERY g "MATCH (e) RETURN e, e as e2"
</code>
.
</div>
</div>
<h2 id="v2811-march-2022">
v2.8.11 (March 2022)
</h2>
<p>
This is a maintenance release for RedisGraph 2.8.
</p>
<p>
Update urgency:
<code>
HIGH
</code>
: There is a critical bug that may affect a subset of users. Upgrade!
</p>
<p>
Details:
</p>
<ul>
<li>
<p>
Bug fixes:
</p>
<ul>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/issues/2259">
#2259
</a>
,
<a href="https://github.com/RedisGraph/RedisGraph/pull/2258">
#2258
</a>
Fix memory leak and potential crash on
<a href="/docs/latest/operate/oss_and_stack/management/persistence/">
RDB
</a>
saving
</li>
</ul>
</li>
</ul>
<h2 id="v2810-march-2022">
v2.8.10 (March 2022)
</h2>
<p>
This is a maintenance release for RedisGraph 2.8.
</p>
<p>
Update urgency:
<code>
HIGH
</code>
: There is a critical bug that may affect a subset of users. Upgrade!
</p>
<p>
Details:
</p>
<ul>
<li>
<p>
Features:
</p>
<ul>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2245">
#2245
</a>
Support graphs
<a href="/docs/latest/develop/reference/eviction/">
eviction
</a>
</li>
</ul>
</li>
<li>
<p>
Bug fixes:
</p>
<ul>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/issues/1493">
#1493
</a>
,
<a href="https://github.com/RedisGraph/RedisGraph/pull/2240">
#2240
</a>
Fixed crash on certain queries
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/issues/2229">
#2229
</a>
,
<a href="https://github.com/RedisGraph/RedisGraph/pull/2222">
#2222
</a>
Fixed crash on certain queries
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/issues/2209">
#2209
</a>
,
<a href="https://github.com/RedisGraph/RedisGraph/pull/2228">
#2228
</a>
Fixed crash on certain invalid
<code>
DELETE
</code>
queries
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/issues/2237">
#2237
</a>
,
<a href="https://github.com/RedisGraph/RedisGraph/pull/2242">
#2242
</a>
Fixed crash on certain
<code>
PROFILE
</code>
queries
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/issues/2230">
#2230
</a>
,
<a href="https://github.com/RedisGraph/RedisGraph/pull/2232">
#2232
</a>
Fixed wrong number of reported deleted relationships on certain queries
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2233">
#2233
</a>
Certain valid queries were reported invalid
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/issues/2246">
#2246
</a>
Fixed memory leaks
</li>
</ul>
</li>
<li>
<p>
Improvements:
</p>
<ul>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2235">
#2235
</a>
Improved
<a href="/docs/latest/operate/oss_and_stack/management/persistence/">
RDB
</a>
loading performance
</li>
</ul>
</li>
</ul>
<h2 id="v289-march-2022">
v2.8.9 (March 2022)
</h2>
<p>
This is a maintenance release for RedisGraph 2.8.
</p>
<p>
Update urgency:
<code>
MODERATE
</code>
: Program an upgrade of the server, but it's not urgent.
</p>
<p>
Details:
</p>
<ul>
<li>
<p>
Features:
</p>
<ul>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2181">
#2181
</a>
,
<a href="https://github.com/RedisGraph/RedisGraph/pull/2182">
#2182
</a>
Full support for ARM builds
</li>
</ul>
</li>
<li>
<p>
Bug fixes:
</p>
<ul>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2167">
#2167
</a>
Fixed a potential crash: filter placement in
<code>
OPTIONAL
</code>
subtrees
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2176">
#2176
</a>
Fixed a potential crash: invalid memory access in nested
<code>
DISTINCT
</code>
functions
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2217">
#2217
</a>
Fixed a potential crash: memory access after free on
<code>
FLUSHALL
</code>
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2207">
#2207
</a>
Fixed memory leak when
<code>
MAX_QUEUED_QUERIES
</code>
is used
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2220">
#2220
</a>
<code>
WITH * WHERE
</code>
- the
<code>
WHERE
</code>
filters were ignored
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2151">
#2151
</a>
Return correct results for aggregations with no inputs
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2163">
#2163
</a>
Emit error correctly on multi-query inputs
</li>
</ul>
</li>
<li>
<p>
Improvements:
</p>
<ul>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2173">
#2173
</a>
Improve performance of breadth-first search
</li>
</ul>
</li>
</ul>
<h2 id="v28-ga-v288-february-2022">
v2.8 GA (v2.8.8) (February 2022)
</h2>
<p>
This is the General Availability release of RedisGraph 2.8.
</p>
<h3 id="highlights">
Highlights
</h3>
<p>
RedisGraph 2.8 introduces multi-labeled nodes, indexes over relationship properties, additional expressivity (construct, functions, and operators), major performance enhancements, and many bug fixes.
</p>
<h4 id="whats-new-in-28">
What's new in 2.8
</h4>
<ul>
<li>
<p>
Multi-labeled nodes
</p>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Note:
</div>
The
<code>
labels
</code>
function's signature has changed. The function now returns a list of labels instead of a single label.
<br/>
<br/>
If you are using this function and upgrading to RedisGraph 2.8, a simple fix is to replace any call to
<code>
labels(x)
</code>
with
<code>
labels(x)[0]
</code>
. This returns the first label associated with node
<code>
x
</code>
. For uni-labeled nodes, the result in RedisGraph 2.8 is similar to the results of
<code>
labels(x)
</code>
in RedisGraph 2.4.
</div>
</div>
</li>
<li>
<p>
Indexes over relationship properties
</p>
</li>
<li>
<p>
Enhanced full-text search
</p>
</li>
<li>
<p>
Delta matrices: node and relationships additions and deletions are much faster, as they are first updated in small delta matrices. The main matrices are then bulk-updated.
</p>
</li>
<li>
<p>
Additional Cypher construct, functions, and operators
</p>
</li>
<li>
<p>
RediSearch 2.2.7
</p>
</li>
<li>
<p>
<a href="https://github.com/DrTimothyAldenDavis/GraphBLAS">
SuiteSparse
</a>
(GraphBLAS) 6.0.0
</p>
</li>
</ul>
<h3 id="details">
Details
</h3>
<ul>
<li>
<p>
Features (since 2.8-M02):
</p>
<ul>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2109">
#2109
</a>
Introduce
<code>
allShortestPaths
</code>
BFS function
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2099">
#2099
</a>
Introduce
<code>
keys
</code>
function
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2047">
#2047
</a>
Introduce
<code>
reduce
</code>
function
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2076">
#2076
</a>
Introduce XOR operation in filter trees
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2088">
#2088
</a>
Introduce pattern comprehensions
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2051">
#2051
</a>
Allow copying of entity attribute sets in
<code>
SET
</code>
clauses
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2067">
#2067
</a>
Allow modification of virtual key entity count (
<code>
VKEY_MAX_ENTITY_COUNT
</code>
) at runtime
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2102">
#2102
</a>
New load time configuration option
<code>
NODE_CREATION_BUFFER
</code>
- see
<a href="https://github.com/RedisGraph/RedisGraph/blob/master/docs/docs/configuration.md#node_creation_buffer">
documentation
</a>
(MOD-2348)
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2049">
#2049
</a>
RediSearch supports field definitions
</li>
</ul>
</li>
<li>
<p>
Performance improvements (since 2.8-M02):
</p>
<ul>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2097">
#2097
</a>
Locks favor writers to prevent write exhaustion
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/1945">
#1945
</a>
Track node count per label in graph statistics
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/1872">
#1872
</a>
Delta matrices are always
<a href="https://fossies.org/linux/SuiteSparse/GraphBLAS/docs/graphblas_demo.html#40">
hypersparse
</a>
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/1871">
#1871
</a>
Matrix sync policies reduce the number of syncs required
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/1869">
#1869
</a>
Transposed matrices are always boolean
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2101">
#2101
</a>
Entity annotation has been replaced with an AST
<code>
toString
</code>
function
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/1878">
#1878
</a>
Slowlog queries no longer create graphs
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2067">
#2067
</a>
Index graph entities incrementally on restore
</li>
<li>
Faster AOF recovery (PM-1252)
</li>
</ul>
</li>
<li>
<p>
Bug fixes (since 2.8-M02):
</p>
<ul>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2016">
#2016
</a>
Implement new BFS algorithm
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2105">
#2105
</a>
Creating a node with multiple properties using the same key only accepts the last value
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2055">
#2055
</a>
Avoid arithmetic overflow in
<code>
avg
</code>
function
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2048">
#2048
</a>
Modulo by zero emits division by zero error
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2020">
#2020
</a>
Fix evaluation of variable-length edges in expression ordering
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2028">
#2028
</a>
Fix utilization of record offset in procedure calls, refactor outputs
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2014">
#2014
</a>
Update label for every node in the AST
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2002">
#2002
</a>
Fix crash in index utilization using wrong query_graph
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/1976">
#1976
</a>
Use operand matrix when available
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/1973">
#1973
</a>
Emit error on a query that only contains parameters
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/1950">
#1950
</a>
Print ExecutionPlan in
<code>
GRAPH.EXPLAIN
</code>
only if no errors are encountered in the construction
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/1933">
#1933
</a>
Free thread-local data on graph deletion
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/1942">
#1942
</a>
Fix dimensions of transposed delta matrices
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/1940">
#1940
</a>
Do not use block client if deny blocking is specified
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/1898">
#1898
</a>
Error when setting a property to an array containing an invalid type
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/1931">
#1931
</a>
Sync matrices on parent process before serialization fork
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/1897">
#1897
</a>
Aliases in
<code>
WITH
</code>
...
<code>
ORDER BY
</code>
must be valid references
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/1913">
#1913
</a>
Update thread-local AST for every cloned operation
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/1915">
#1915
</a>
Validate function references in parameters
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/1911">
#1911
</a>
Refactor
<code>
cron
</code>
task for managing query timeouts
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/1902">
#1902
</a>
Fix incorrect behavior on
<code>
NULL
</code>
values in
<code>
CASE
</code>
...
<code>
WHEN
</code>
expressions
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/1904">
#1904
</a>
Allow reconfiguring query timeout to 0
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/1888">
#1888
</a>
Synchronize matrices on creation in RDB load
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/1892">
#1892
</a>
Validate values specified in
<code>
SET
</code>
clauses
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/1889">
#1889
</a>
Tuple iterator now updates properly when changing matrix to serialize
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/1870">
#1870
</a>
Fix crash in
<code>
range
</code>
function
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/issues/2125">
#2125
</a>
Fix crash on
<code>
UNION
</code>
...
<code>
RETURN
</code>
* queries (MOD-2524)
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2043">
#2043
</a>
Avoid serialization of duplicate graph keys
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2067">
#2067
</a>
Numeric indices no longer lose precision on very large values
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/issues/2072">
#2072
</a>
,
<a href="https://github.com/RedisGraph/RedisGraph/pull/2081">
#2081
</a>
CRLF sequences embedded in strings no longer trigger a protocol error when being emitted
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2139">
#2139
</a>
Fix crash when trying to retrieve an out-of-bounds item
</li>
<li>
<a href="https://github.com/RedisGraph/RedisGraph/pull/2149">
#2149
</a>
Fix crash when matching a node engages an index to search for a value that is a RediSearch stop word
</li>
</ul>
</li>
</ul>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisgraph/redisgraph-2.8-release-notes/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/installing-upgrading/install/prepare-install/download-install-package/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Download a Redis Enterprise Software installation package
</h1>
<p class="text-lg -mt-5 mb-10">
Download a Redis Enterprise Software installation package.
</p>
<p>
To download the installation package for any of the supported platforms:
</p>
<ol>
<li>
Go to the
<a href="https://cloud.redis.io/#/rlec-downloads">
Redis download page
</a>
.
</li>
<li>
Sign in with your Redis credentials or create a new account.
</li>
<li>
In the
<strong>
Downloads
</strong>
section for Redis Enterprise Software, select the installation package for your platform then select
<strong>
Go
</strong>
.
</li>
</ol>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Note:
</div>
Before you install the Linux package or AWS AMI on an AWS EC2 instance,
review the
<a href="/docs/latest/operate/rs/installing-upgrading/install/plan-deployment/configuring-aws-instances/">
configuration requirements for AWS EC2 instances
</a>
.
</div>
</div>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/installing-upgrading/install/prepare-install/download-install-package/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/integrate/redis-data-integration/release-notes/rdi-1-2/.html | <section class="prose w-full py-12">
<h1>
Redis Data Integration release notes 1.2 (June 2024)
</h1>
<p class="text-lg -mt-5 mb-10">
API server with a set of APIs to support Redis Insight with creating, testing, deploying & monitoring RDI pipelines. RDI Installer verifies all components are running at the end of installation.
</p>
<blockquote>
<p>
This minor release replaces the 1.0 release.
</p>
</blockquote>
<p>
RDIβs mission is to help Redis customers sync Redis Enterprise with live data from their slow disk-based databases to:
</p>
<ul>
<li>
Meet the required speed and scale of read queries and provide an excellent and predictable user experience.
</li>
<li>
Save resources and time when building pipelines and coding data transformations.
</li>
<li>
Reduce the total cost of ownership by saving money on expensive database read replicas.
</li>
</ul>
<p>
RDI keeps the Redis cache up to date with changes in the primary database, using a
<a href="https://en.wikipedia.org/wiki/Change_data_capture">
<em>
Change Data Capture (CDC)
</em>
</a>
mechanism.
It also lets you
<em>
transform
</em>
the data from relational tables into convenient
and fast data structures that match your app's requirements. You specify the
transformations using a configuration system, so no coding is required.
</p>
<h2 id="headlines">
Headlines
</h2>
<ul>
<li>
API server with a set of APIs to support Redis Insight with creating, testing, deploying & monitoring RDI pipelines.
</li>
<li>
RDI Installer verifies all components are running at the end of installation.
</li>
</ul>
<h2 id="fixed-bugs">
Fixed Bugs
</h2>
<ul>
<li>
Support for source database TLS & mTLS was fixed. Certificate and file names used with the redis-di set-secret command can have any file names
</li>
<li>
Mismatch between Reloader version provided and the one required.
</li>
</ul>
<h2 id="limitations">
Limitations
</h2>
<ul>
<li>
RDI can write data to a Redis Active-Active database. However, it doesn't support writing data to two or more Active-Active replicas. Writing data from RDI to several Active-Active replicas could easily harm data integrity as RDI is not synchronous with the source database commits.
</li>
<li>
RDI write-behind (which is currently in preview) should not be used on the same data set that RDI ingest is writing to Redis. This would either cause an infinite loop or would harm the data integrity, since both ingest and write-behind are asynchronous, eventually-consistent processes.
</li>
</ul>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/integrate/redis-data-integration/release-notes/rdi-1-2/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/7.4/references/rest-api/requests/modules/upgrade/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Upgrade module requests
</h1>
<p class="text-lg -mt-5 mb-10">
Upgrade module requests
</p>
<table>
<thead>
<tr>
<th>
Method
</th>
<th>
Path
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="#post-modules-upgrade-bdb">
POST
</a>
</td>
<td>
<code>
/v1/modules/upgrade/bdb/{uid}
</code>
</td>
<td>
Upgrade module
</td>
</tr>
</tbody>
</table>
<h2 id="post-modules-upgrade-bdb">
Upgrade module
</h2>
<pre><code>POST /v1/modules/upgrade/bdb/{string: uid}
</code></pre>
<p>
Upgrades the module version on a specific database.
</p>
<h4 id="required-permissions">
Required permissions
</h4>
<table>
<thead>
<tr>
<th>
Permission name
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="/docs/latest/operate/rs/7.4/references/rest-api/permissions/#edit_bdb_module">
edit_bdb_module
</a>
</td>
</tr>
</tbody>
</table>
<h3 id="post-request">
Request
</h3>
<h4 id="example-http-request">
Example HTTP request
</h4>
<pre><code>POST /modules/upgrade/bdb/1
</code></pre>
<h4 id="example-json-body">
Example JSON body
</h4>
<div class="highlight">
<pre class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"modules"</span><span class="p">:</span> <span class="p">[</span>
</span></span><span class="line"><span class="cl"> <span class="p">{</span><span class="nt">"module_name"</span><span class="p">:</span> <span class="s2">"ReJson"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"current_semantic_version"</span><span class="p">:</span> <span class="s2">"2.2.1"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"new_module"</span><span class="p">:</span> <span class="s2">"aa3648d79bd4082d414587c42ea0b234"</span><span class="p">}</span>
</span></span><span class="line"><span class="cl"> <span class="p">],</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"// Optional fields to fine-tune restart and failover behavior:"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"preserve_roles"</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"may_discard_data"</span><span class="p">:</span> <span class="kc">false</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span></code></pre>
</div>
<h4 id="request-headers">
Request headers
</h4>
<table>
<thead>
<tr>
<th>
Key
</th>
<th>
Value
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
Host
</td>
<td>
cnm.cluster.fqdn
</td>
<td>
Domain name
</td>
</tr>
<tr>
<td>
Accept
</td>
<td>
application/json
</td>
<td>
Accepted media type
</td>
</tr>
</tbody>
</table>
<h4 id="request-body">
Request body
</h4>
<table>
<thead>
<tr>
<th>
Field
</th>
<th>
Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
modules
</td>
<td>
list
</td>
<td>
List of dicts representing the modules that will be upgraded. Each dict must include:
<br/>
<br/>
β’
<strong>
current_module
</strong>
: UID of a module to upgrade
<br/>
<br/>
β’
<strong>
new_module
</strong>
: UID of the module we want to upgrade to
<br/>
<br/>
β’
<strong>
new_module_args
</strong>
: args list for the new module
</td>
</tr>
<tr>
<td>
preserve_roles
</td>
<td>
boolean
</td>
<td>
Preserve shardsβ master/replica roles (optional)
</td>
</tr>
<tr>
<td>
may_discard_data
</td>
<td>
boolean
</td>
<td>
Discard data in a non-replicated non-persistent database (optional)
</td>
</tr>
</tbody>
</table>
<h3 id="post-response">
Response
</h3>
<p>
Returns the upgraded
<a href="/docs/latest/operate/rs/7.4/references/rest-api/objects/module/">
module object
</a>
.
</p>
<h4 id="example-json-body-1">
Example JSON body
</h4>
<div class="highlight">
<pre class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"uid"</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"name"</span><span class="p">:</span> <span class="s2">"name of database #1"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"module_id"</span><span class="p">:</span> <span class="s2">"aa3648d79bd4082d414587c42ea0b234"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"module_name"</span><span class="p">:</span> <span class="s2">"ReJson"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"semantic_version"</span><span class="p">:</span> <span class="s2">"2.2.2"</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"// additional fields..."</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span></code></pre>
</div>
<h3 id="post-error-codes">
Error codes
</h3>
<p>
When errors are reported, the server may return a JSON object with
<code>
error_code
</code>
and
<code>
message
</code>
field that provide additional information. The following are possible
<code>
error_code
</code>
values:
</p>
<table>
<thead>
<tr>
<th>
Code
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
missing_module
</td>
<td>
Module is not present in cluster.
</td>
</tr>
<tr>
<td>
module_downgrade_unsupported
</td>
<td>
Module downgrade is not allowed.
</td>
</tr>
<tr>
<td>
redis_incompatible_version
</td>
<td>
Module min_redis_version is bigger than the current Redis version.
</td>
</tr>
<tr>
<td>
redis_pack_incompatible_version
</td>
<td>
Module min_redis_pack_version is bigger than the current Redis Enterprise version.
</td>
</tr>
<tr>
<td>
unsupported_module_capabilities
</td>
<td>
New version of module does support all the capabilities needed for the database configuration
</td>
</tr>
</tbody>
</table>
<h3 id="post-status-codes">
Status codes
</h3>
<table>
<thead>
<tr>
<th>
Code
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1">
200 OK
</a>
</td>
<td>
Success, module updated on bdb.
</td>
</tr>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5">
404 Not Found
</a>
</td>
<td>
bdb or node not found.
</td>
</tr>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1">
400 Bad Request
</a>
</td>
<td>
Bad or missing configuration parameters.
</td>
</tr>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.7">
406 Not Acceptable
</a>
</td>
<td>
The requested configuration is invalid.
</td>
</tr>
</tbody>
</table>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/references/rest-api/requests/modules/upgrade/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/commands/zcard/.html | <section class="prose w-full py-12">
<h1 class="command-name">
ZCARD
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">ZCARD key</pre>
<dl class="grid grid-cols-[auto,1fr] gap-2 mb-12">
<dt class="font-semibold text-redis-ink-900 m-0">
Available since:
</dt>
<dd class="m-0">
1.2.0
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
Time complexity:
</dt>
<dd class="m-0">
O(1)
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
ACL categories:
</dt>
<dd class="m-0">
<code>
@read
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@sortedset
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@fast
</code>
<span class="mr-1 last:hidden">
,
</span>
</dd>
</dl>
<p>
Returns the sorted set cardinality (number of elements) of the sorted set stored
at
<code>
key
</code>
.
</p>
<h2 id="examples">
Examples
</h2>
<div class="bg-slate-900 border-b border-slate-700 rounded-t-xl px-4 py-3 w-full flex">
<svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20">
<path d="M2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10Z">
</path>
</svg>
<svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20">
<path d="M10 2.5L18.6603 17.5L1.33975 17.5L10 2.5Z">
</path>
</svg>
<svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20">
<path d="M10 2.5L12.0776 7.9322L17.886 8.22949L13.3617 11.8841L14.8738 17.5L10 14.3264L5.1262 17.5L6.63834 11.8841L2.11403 8.22949L7.92238 7.9322L10 2.5Z">
</path>
</svg>
</div>
<form class="redis-cli overflow-y-auto max-h-80">
<pre tabindex="0">redis> ZADD myzset 1 "one"
(integer) 1
redis> ZADD myzset 2 "two"
(integer) 1
redis> ZCARD myzset
(integer) 2
</pre>
<div class="prompt" style="">
<span>
redis>
</span>
<input autocomplete="off" name="prompt" spellcheck="false" type="text"/>
</div>
</form>
<h2 id="resp2resp3-reply">
RESP2/RESP3 Reply
</h2>
<a href="../../develop/reference/protocol-spec#integers">
Integer reply
</a>
: the cardinality (number of members) of the sorted set, or 0 if the key doesn't exist.
<br/>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/zcard/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/7.4/references/rest-api/requests/bdbs/actions/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Database actions requests
</h1>
<p class="text-lg -mt-5 mb-10">
Database action requests
</p>
<h2 id="backup">
Backup
</h2>
<table>
<thead>
<tr>
<th>
Method
</th>
<th>
Path
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="/docs/latest/operate/rs/7.4/references/rest-api/requests/bdbs/actions/backup_reset_status/#put-bdbs-actions-backup-reset-status">
PUT
</a>
</td>
<td>
<code>
/v1/bdbs/{uid}/actions/backup_reset_status
</code>
</td>
<td>
Reset database backup status
</td>
</tr>
</tbody>
</table>
<h2 id="export">
Export
</h2>
<table>
<thead>
<tr>
<th>
Method
</th>
<th>
Path
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="/docs/latest/operate/rs/7.4/references/rest-api/requests/bdbs/actions/export_reset_status/#put-bdbs-actions-export-reset-status">
PUT
</a>
</td>
<td>
<code>
/v1/bdbs/{uid}/actions/export_reset_status
</code>
</td>
<td>
Reset database export status
</td>
</tr>
<tr>
<td>
<a href="/docs/latest/operate/rs/7.4/references/rest-api/requests/bdbs/actions/export/#post-bdbs-actions-export">
POST
</a>
</td>
<td>
<code>
/v1/bdbs/{uid}/actions/export
</code>
</td>
<td>
Initiate database export
</td>
</tr>
</tbody>
</table>
<h2 id="import">
Import
</h2>
<table>
<thead>
<tr>
<th>
Method
</th>
<th>
Path
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="/docs/latest/operate/rs/7.4/references/rest-api/requests/bdbs/actions/import_reset_status/#put-bdbs-actions-import-reset-status">
PUT
</a>
</td>
<td>
<code>
/v1/bdbs/{uid}/actions/import_reset_status
</code>
</td>
<td>
Reset database import status
</td>
</tr>
<tr>
<td>
<a href="/docs/latest/operate/rs/7.4/references/rest-api/requests/bdbs/actions/import/#post-bdbs-actions-import">
POST
</a>
</td>
<td>
<code>
/v1/bdbs/{uid}/actions/import
</code>
</td>
<td>
Initiate manual dataset import
</td>
</tr>
</tbody>
</table>
<h2 id="optimize-shards-placement">
Optimize shards placement
</h2>
<table>
<thead>
<tr>
<th>
Method
</th>
<th>
Path
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="/docs/latest/operate/rs/7.4/references/rest-api/requests/bdbs/actions/optimize_shards_placement/#get-bdbs-actions-optimize-shards-placement">
GET
</a>
</td>
<td>
<code>
/v1/bdbs/{uid}/actions/optimize_shards_placement
</code>
</td>
<td>
Get optimized shards placement for a database
</td>
</tr>
</tbody>
</table>
<h2 id="recover">
Recover
</h2>
<table>
<thead>
<tr>
<th>
Method
</th>
<th>
Path
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="/docs/latest/operate/rs/7.4/references/rest-api/requests/bdbs/actions/recover/#get-bdbs-actions-recover">
GET
</a>
</td>
<td>
<code>
/v1/bdbs/{uid}/actions/recover
</code>
</td>
<td>
Get database recovery plan
</td>
</tr>
<tr>
<td>
<a href="/docs/latest/operate/rs/7.4/references/rest-api/requests/bdbs/actions/recover/#post-bdbs-actions-recover">
POST
</a>
</td>
<td>
<code>
/v1/bdbs/{uid}/actions/recover
</code>
</td>
<td>
Recover database
</td>
</tr>
</tbody>
</table>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/references/rest-api/requests/bdbs/actions/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/commands/geosearchstore/.html | <section class="prose w-full py-12">
<h1 class="command-name">
GEOSEARCHSTORE
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">GEOSEARCHSTORE destination source <FROMMEMBERΒ member |
FROMLONLATΒ longitude latitude> <BYRADIUSΒ radius <m | km | ft | mi>
| BYBOXΒ width height <m | km | ft | mi>> [ASC | DESC] [COUNTΒ count
[ANY]] [STOREDIST]</pre>
<dl class="grid grid-cols-[auto,1fr] gap-2 mb-12">
<dt class="font-semibold text-redis-ink-900 m-0">
Available since:
</dt>
<dd class="m-0">
6.2.0
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
Time complexity:
</dt>
<dd class="m-0">
O(N+log(M)) where N is the number of elements in the grid-aligned bounding box area around the shape provided as the filter and M is the number of items inside the shape
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
ACL categories:
</dt>
<dd class="m-0">
<code>
@write
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@geo
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@slow
</code>
<span class="mr-1 last:hidden">
,
</span>
</dd>
</dl>
<p>
This command is like
<a href="/docs/latest/commands/geosearch/">
<code>
GEOSEARCH
</code>
</a>
, but stores the result in destination key.
</p>
<p>
This command replaces the now deprecated
<a href="/docs/latest/commands/georadius/">
<code>
GEORADIUS
</code>
</a>
and
<a href="/docs/latest/commands/georadiusbymember/">
<code>
GEORADIUSBYMEMBER
</code>
</a>
.
</p>
<p>
By default, it stores the results in the
<code>
destination
</code>
sorted set with their geospatial information.
</p>
<p>
When using the
<code>
STOREDIST
</code>
option, the command stores the items in a sorted set populated with their distance from the center of the circle or box, as a floating-point number, in the same unit specified for that shape.
</p>
<h2 id="examples">
Examples
</h2>
<div class="bg-slate-900 border-b border-slate-700 rounded-t-xl px-4 py-3 w-full flex">
<svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20">
<path d="M2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10Z">
</path>
</svg>
<svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20">
<path d="M10 2.5L18.6603 17.5L1.33975 17.5L10 2.5Z">
</path>
</svg>
<svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20">
<path d="M10 2.5L12.0776 7.9322L17.886 8.22949L13.3617 11.8841L14.8738 17.5L10 14.3264L5.1262 17.5L6.63834 11.8841L2.11403 8.22949L7.92238 7.9322L10 2.5Z">
</path>
</svg>
</div>
<form class="redis-cli overflow-y-auto max-h-80">
<pre tabindex="0">redis> GEOADD Sicily 13.361389 38.115556 "Palermo" 15.087269 37.502669 "Catania"
(integer) 2
redis> GEOADD Sicily 12.758489 38.788135 "edge1" 17.241510 38.788135 "edge2"
(integer) 2
redis> GEOSEARCHSTORE key1 Sicily FROMLONLAT 15 37 BYBOX 400 400 km ASC COUNT 3
(integer) 3
redis> GEOSEARCH key1 FROMLONLAT 15 37 BYBOX 400 400 km ASC WITHCOORD WITHDIST WITHHASH
1) 1) "Catania"
2) "56.4413"
3) (integer) 3479447370796909
4) 1) "15.08726745843887329"
2) "37.50266842333162032"
2) 1) "Palermo"
2) "190.4424"
3) (integer) 3479099956230698
4) 1) "13.36138933897018433"
2) "38.11555639549629859"
3) 1) "edge2"
2) "279.7403"
3) (integer) 3481342659049484
4) 1) "17.24151045083999634"
2) "38.78813451624225195"
redis> GEOSEARCHSTORE key2 Sicily FROMLONLAT 15 37 BYBOX 400 400 km ASC COUNT 3 STOREDIST
(integer) 3
redis> ZRANGE key2 0 -1 WITHSCORES
1) "Catania"
2) "56.4412578701582"
3) "Palermo"
4) "190.44242984775784"
5) "edge2"
6) "279.7403417843143"
</pre>
<div class="prompt" style="">
<span>
redis>
</span>
<input autocomplete="off" name="prompt" spellcheck="false" type="text"/>
</div>
</form>
<h2 id="resp2resp3-reply">
RESP2/RESP3 Reply
</h2>
<a href="../../develop/reference/protocol-spec#integers">
Integer reply
</a>
: the number of elements in the resulting set
<br/>
<h2>
History
</h2>
<ul>
<li>
Starting with Redis version 7.0.0: Added support for uppercase unit names.
</li>
</ul>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/geosearchstore/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/7.4/installing-upgrading/install/install-script/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Installation script command-line options
</h1>
<p class="text-lg -mt-5 mb-10">
Command-line options for the install.sh script.
</p>
<p>
Run
<code>
./install.sh --help
</code>
to view command-line options supported by the installation script.
</p>
<p>
The following options are supported:
</p>
<table>
<thead>
<tr>
<th>
Option
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>
-y
</code>
</td>
<td>
Automatically answers
<code>
yes
</code>
to all install prompts, accepting all default values
<br/>
See
<a href="/docs/latest/operate/rs/7.4/installing-upgrading/install/manage-installation-questions/">
Manage install questions
</a>
</td>
</tr>
<tr>
<td>
<nobr>
<code>
-c <answer file>
</code>
</nobr>
</td>
<td>
Specify answer file used to respond to install prompts
<br/>
See
<a href="/docs/latest/operate/rs/7.4/installing-upgrading/install/manage-installation-questions/">
Manage install questions
</a>
</td>
</tr>
<tr>
<td>
<nobr>
<code>
-s <socket dir>
</code>
</nobr>
</td>
<td>
Specify directory for redislabs unix sockets
<em>
(new installs only)
</em>
</td>
</tr>
<tr>
<td>
<nobr>
<code>
--install-dir <dir>
</code>
</nobr>
</td>
<td>
Specifies installation directory
<em>
(new installs only)
</em>
<br/>
See
<a href="/docs/latest/operate/rs/7.4/installing-upgrading/install/customize-install-directories/">
Customize install locations
</a>
</td>
</tr>
<tr>
<td>
<nobr>
<code>
--config-dir <dir>
</code>
</nobr>
</td>
<td>
Configuration file directory
<em>
(new installs only)
</em>
<br/>
See
<a href="/docs/latest/operate/rs/7.4/installing-upgrading/install/customize-install-directories/">
Customize install locations
</a>
</td>
</tr>
<tr>
<td>
<nobr>
<code>
--var-dir <dir>
</code>
</nobr>
</td>
<td>
Var directory used for installation
<em>
(new installs only)
</em>
<br/>
See
<a href="/docs/latest/operate/rs/7.4/installing-upgrading/install/customize-install-directories/">
Customize install locations
</a>
</td>
</tr>
<tr>
<td>
<nobr>
<code>
--os-user <user>
</code>
</nobr>
</td>
<td>
Operating system user account associated with install; default:
<code>
redislabs
</code>
<br/>
See
<a href="/docs/latest/operate/rs/7.4/installing-upgrading/install/customize-user-and-group/">
Customize user and group
</a>
<em>
(new installs only)
</em>
</td>
</tr>
<tr>
<td>
<nobr>
<code>
--os-group <group>
</code>
</nobr>
</td>
<td>
Operating system group associated with install; default:
<code>
redislabs
</code>
<br/>
See
<a href="/docs/latest/operate/rs/7.4/installing-upgrading/install/customize-user-and-group/">
Customize user and group
</a>
<em>
(new installs only)
</em>
</td>
</tr>
</tbody>
</table>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/installing-upgrading/install/install-script/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/integrate/redis-data-integration/quick-start-guide.html | <section class="prose w-full py-12">
<h1>
Quickstart
</h1>
<p class="text-lg -mt-5 mb-10">
Get started with a simple pipeline example
</p>
<p>
In this tutorial you will learn how to install RDI and set up a pipeline to ingest live data from a
<a href="https://www.postgresql.org/">
PostgreSQL
</a>
database into a Redis database.
</p>
<h2 id="prerequisites">
Prerequisites
</h2>
<ul>
<li>
A Redis Enterprise database that will serve as the pipeline target. The dataset that will be ingested is
quite small in size, so a single shard database should be enough. RDI also needs to maintain its
own database on the cluster to store state information.
<em>
This requires Redis Enterprise v6.4 or greater
</em>
.
</li>
<li>
<a href="/docs/latest/develop/tools/insight/">
Redis Insight
</a>
to edit your pipeline
</li>
<li>
A virtual machine (VM) with one of the following operating systems:
<ul>
<li>
Ubuntu 20.04 or 22.04
</li>
<li>
RHEL 8 or 9
</li>
</ul>
</li>
</ul>
<h2 id="overview">
Overview
</h2>
<p>
The following diagram shows the structure of the pipeline we will create (see
the
<a href="/docs/latest/integrate/redis-data-integration/architecture/#overview">
architecture overview
</a>
to learn how the pipeline works):
</p>
<a href="/docs/latest/images/rdi/ingest/ingest-qsg.png" sdata-lightbox="/images/rdi/ingest/ingest-qsg.png">
<img src="/docs/latest/images/rdi/ingest/ingest-qsg.png"/>
</a>
<p>
Here, the RDI
<em>
collector
</em>
tracks changes in PostgreSQL and writes them to streams in the
RDI database in Redis. The
<em>
stream processor
</em>
then reads data records from the RDI
database streams, processes them, and writes them to the target.
</p>
<h3 id="install-postgresql">
Install PostgreSQL
</h3>
<p>
We provide a
<a href="https://www.docker.com/">
Docker
</a>
image for an example PostgreSQL
database that we will use for the tutorial. Follow the
<a href="https://github.com/Redislabs-Solution-Architects/rdi-quickstart-postgres/tree/main">
instructions on our Github page
</a>
to download the image and start serving the database. The database, which is
called
<code>
chinook
</code>
, has the
<a href="https://www.kaggle.com/datasets/samaxtech/chinook-music-store-data?select=schema_diagram.png">
schema and data
</a>
for an imaginary online music store
and is already set up for the RDI collector to use.
</p>
<h3 id="install-rdi">
Install RDI
</h3>
<p>
Install RDI using the instructions in the
<a href="/docs/latest/integrate/redis-data-integration/installation/install-vm/">
VM installation guide
</a>
.
</p>
<p>
RDI will create the pipeline template for your chosen source database type at
<code>
/opt/rdi/config
</code>
. You will need this pathname later when you prepare the pipeline for deployment
(see
<a href="#prepare-the-pipeline">
Prepare the pipeline
</a>
below).
</p>
<p>
At the end of the installation, RDI CLI will prompt you to set the access secrets
for both the source PostgreSQL database and the Redis RDI database. RDI needs these to
run the pipeline. If you provide admin credentials for your Redis Enterprise cluster here then RDI CLI will
create the RDI database for you automatically. Otherwise, you should create this
database yourself with the Redis Enterprise management console. A single-shard
database with 125MB of RAM will work fine for this tutorial but you can also add a
replica if you want (this will double the RAM requirements to 250MB).
</p>
<h3 id="prepare-the-pipeline">
Prepare the pipeline
</h3>
<p>
During the installation, RDI placed the pipeline templates at
<code>
/opt/rdi/config
</code>
.
If you go to that folder and run the
<code>
ll
</code>
command, you will see the pipeline
configuration file,
<code>
config.yaml
</code>
, and the
<code>
jobs
</code>
folder (see the page about
<a href="/docs/latest/integrate/redis-data-integration/data-pipelines/data-pipelines/">
Pipelines
</a>
for more information). Use Redis Insight to open
the
<code>
config.yaml
</code>
file and then edit the following settings:
</p>
<ul>
<li>
Set the
<code>
host
</code>
to
<code>
localhost
</code>
and the
<code>
port
</code>
to 5432.
</li>
<li>
Under
<code>
tables
</code>
, specify the
<code>
Track
</code>
table from the source database.
</li>
<li>
Add the details of your target database to the
<code>
target
</code>
section.
</li>
</ul>
<p>
At this point, the pipeline is ready to deploy.
</p>
<h3 id="create-context">
Create a context (optional)
</h3>
<p>
To manage and inspect RDI, you can use the
<a href="/docs/latest/integrate/redis-data-integration/reference/cli/">
<code>
redis-di
</code>
</a>
CLI command, which has several subcommands for different purposes. Most of these commands require you
to pass at least two options,
<code>
--rdi-host
</code>
and
<code>
--rdi-port
</code>
, to specify the host and port of your
RDI installation. You can avoid typing these options repeatedly by saving the
information in a
<em>
context
</em>
.
</p>
<p>
When you activate a context, the saved values of
<code>
--rdi-host
</code>
,
<code>
--rdi-port
</code>
, and a few other options are passed automatically whenever
you use
<code>
redis-di
</code>
. If you have more than one RDI installation, you can create a context
for each of them and select the one you want to be active using its unique name.
</p>
<p>
To create a context, use the
<a href="/docs/latest/integrate/redis-data-integration/reference/cli/redis-di-add-context/">
<code>
redis-di add-context
</code>
</a>
command:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis-di add-context --rdi-host <host> --rdi-port <port> --cluster-host <Redis DB host> --cluster-api-port <Redis DB API port> --cluster-user <Redis DB username> <unique-context-name>
</span></span></code></pre>
</div>
<p>
These options are required but there are also a few others you can save, such as TLS credentials, if
you are using them (see the
<a href="/docs/latest/integrate/redis-data-integration/reference/cli/redis-di-add-context/">
reference page
</a>
for details). When you have created a context, use
<a href="/docs/latest/integrate/redis-data-integration/reference/cli/redis-di-set-context/">
<code>
redis-di set-context
</code>
</a>
to activate it:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis-di set-context <context name>
</span></span></code></pre>
</div>
<p>
There are also subcommands to
<a href="/docs/latest/integrate/redis-data-integration/reference/cli/redis-di-list-contexts/">
list
</a>
and
<a href="/docs/latest/integrate/redis-data-integration/reference/cli/redis-di-delete-context/">
delete
</a>
contexts.
</p>
<h3 id="deploy-the-pipeline">
Deploy the pipeline
</h3>
<p>
You can use
<a href="/docs/latest/develop/tools/insight/rdi-connector/">
Redis Insight
</a>
to deploy the pipeline by adding a connection to the RDI API
endpoint (which has the same IP address as your RDI VM and uses port 8083) and then clicking the
<strong>
Deploy
</strong>
button. You can also deploy it with the following command:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis-di deploy --dir <path to pipeline folder>
</span></span></code></pre>
</div>
<p>
where the path is the one you supplied earlier during the installation. (You may also need
to supply
<code>
--rdi-host
</code>
and
<code>
--rdi-port
</code>
options if you are not using a
<a href="#create-context">
context
</a>
as described above.) RDI first
validates your pipeline and then deploys it if the configuration is correct.
</p>
<p>
Once the pipeline is running, you can use Redis Insight to view the data flow using the
pipeline metrics. You can also connect to your target database to see the keys that RDI has written there.
</p>
<p>
See
<a href="/docs/latest/integrate/redis-data-integration/data-pipelines/deploy/">
Deploy a pipeline
</a>
for more information about deployment settings.
</p>
<h3 id="view-rdis-response-to-data-changes">
View RDI's response to data changes
</h3>
<p>
Once the pipeline has loaded a
<em>
snapshot
</em>
of all the existing data from the source,
it enters
<em>
change data capture (CDC)
</em>
mode (see the
<a href="/docs/latest/integrate/redis-data-integration/architecture/#overview">
architecture overview
</a>
and the
<a href="/docs/latest/integrate/redis-data-integration/data-pipelines/data-pipelines/#ingest-pipeline-lifecycle">
ingest pipeline lifecycle
</a>
for more information
).
</p>
<p>
To see the RDI pipeline working in CDC mode:
</p>
<ul>
<li>
Create a simulated load on the source database
(see
<a href="https://github.com/Redislabs-Solution-Architects/rdi-quickstart-postgres?tab=readme-ov-file#generating-load-on-the-database">
Generating load on the database
</a>
to learn how to do this).
</li>
<li>
Run
<a href="/docs/latest/integrate/redis-data-integration/reference/cli/redis-di-status/">
<code>
redis-di status --live
</code>
</a>
to see the flow of records.
</li>
<li>
User
<a href="/docs/latest/develop/tools/insight/">
Redis Insight
</a>
to look at the data in the target database.
</li>
</ul>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/integrate/redis-data-integration/quick-start-guide/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/commands/memory-usage/.html | <section class="prose w-full py-12">
<h1 class="command-name">
MEMORY USAGE
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">MEMORY USAGE key [SAMPLESΒ count]</pre>
<dl class="grid grid-cols-[auto,1fr] gap-2 mb-12">
<dt class="font-semibold text-redis-ink-900 m-0">
Available since:
</dt>
<dd class="m-0">
4.0.0
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
Time complexity:
</dt>
<dd class="m-0">
O(N) where N is the number of samples.
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
ACL categories:
</dt>
<dd class="m-0">
<code>
@read
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@slow
</code>
<span class="mr-1 last:hidden">
,
</span>
</dd>
</dl>
<p>
The
<code>
MEMORY USAGE
</code>
command reports the number of bytes that a key and its value
require to be stored in RAM.
</p>
<p>
The reported usage is the total of memory allocations for data and
administrative overheads that a key and its value require.
</p>
<p>
For nested data types, the optional
<code>
SAMPLES
</code>
option can be provided, where
<code>
count
</code>
is the number of sampled nested values. The samples are averaged to estimate the total size.
By default, this option is set to
<code>
5
</code>
. To sample the all of the nested values, use
<code>
SAMPLES 0
</code>
.
</p>
<h2 id="examples">
Examples
</h2>
<p>
With Redis v7.2.0 64-bit and
<strong>
jemalloc
</strong>
, the empty string measures as follows:
</p>
<pre tabindex="0"><code>> SET "" ""
OK
> MEMORY USAGE ""
(integer) 56
</code></pre>
<p>
These bytes are pure overhead at the moment as no actual data is stored, and are
used for maintaining the internal data structures of the server (include internal allocator fragmentation). Longer keys and
values show asymptotically linear usage.
</p>
<pre tabindex="0"><code>> SET foo bar
OK
> MEMORY USAGE foo
(integer) 56
> SET foo2 mybar
OK
> MEMORY USAGE foo2
(integer) 64
> SET foo3 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
OK
> MEMORY USAGE foo3
(integer) 160
</code></pre>
<h2 id="redis-software-and-redis-cloud-compatibility">
Redis Software and Redis Cloud compatibility
</h2>
<table>
<thead>
<tr>
<th style="text-align:left">
Redis
<br/>
Enterprise
</th>
<th style="text-align:left">
Redis
<br/>
Cloud
</th>
<th style="text-align:left">
<span style="min-width: 9em; display: table-cell">
Notes
</span>
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
Not supported for
<a href="/docs/latest/develop/interact/programmability/">
scripts
</a>
in Redis versions earlier than 7.
</td>
</tr>
</tbody>
</table>
<p>
Note: key memory usage is different on Redis Software or Redis Cloud active-active databases than on non-active-active databases. This is because memory usage includes some amount of CRDB overhead.
</p>
<h2 id="resp2-reply">
RESP2 Reply
</h2>
<p>
One of the following:
</p>
<ul>
<li>
<a href="../../develop/reference/protocol-spec#integers">
Integer reply
</a>
: the memory usage in bytes.
</li>
<li>
<a href="../../develop/reference/protocol-spec#bulk-strings">
Nil reply
</a>
: if the key does not exist.
</li>
</ul>
<h2 id="resp3-reply">
RESP3 Reply
</h2>
<p>
One of the following:
</p>
<ul>
<li>
<a href="../../develop/reference/protocol-spec#integers">
Integer reply
</a>
: the memory usage in bytes.
</li>
<li>
<a href="../../develop/reference/protocol-spec#nulls">
Null reply
</a>
: if the key does not exist.
</li>
</ul>
<br/>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/memory-usage/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/commands/unwatch/.html | <section class="prose w-full py-12">
<h1 class="command-name">
UNWATCH
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">UNWATCH</pre>
<dl class="grid grid-cols-[auto,1fr] gap-2 mb-12">
<dt class="font-semibold text-redis-ink-900 m-0">
Available since:
</dt>
<dd class="m-0">
2.2.0
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
Time complexity:
</dt>
<dd class="m-0">
O(1)
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
ACL categories:
</dt>
<dd class="m-0">
<code>
@fast
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@transaction
</code>
<span class="mr-1 last:hidden">
,
</span>
</dd>
</dl>
<p>
Flushes all the previously watched keys for a
<a href="/develop/interact/transactions">
transaction
</a>
.
</p>
<p>
If you call
<a href="/docs/latest/commands/exec/">
<code>
EXEC
</code>
</a>
or
<a href="/docs/latest/commands/discard/">
<code>
DISCARD
</code>
</a>
, there's no need to manually call
<code>
UNWATCH
</code>
.
</p>
<h2 id="resp2resp3-reply">
RESP2/RESP3 Reply
</h2>
<a href="../../develop/reference/protocol-spec#simple-strings">
Simple string reply
</a>
:
<code>
OK
</code>
.
<br/>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/unwatch/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/develop/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Develop with Redis
</h1>
<p class="text-lg -mt-5 mb-10">
Learn how to develop with Redis
</p>
<nav>
<a href="/docs/latest/develop/get-started/">
Quick starts
</a>
<p>
Redis quick start guides
</p>
<a href="/docs/latest/develop/tools/">
Client tools
</a>
<p>
Tools to interact with a Redis server
</p>
<a href="/docs/latest/develop/clients/">
Connect with Redis client API libraries
</a>
<p>
Connect your application to a Redis database and try an example
</p>
<a href="/docs/latest/develop/data-types/">
Understand Redis data types
</a>
<p>
Overview of data types supported by Redis
</p>
<a href="/docs/latest/develop/interact/">
Interact with data in Redis
</a>
<p>
How to interact with data in Redis, including queries, triggered functions, transactions, and pub/sub
</p>
<a href="/docs/latest/develop/use/">
Use Redis
</a>
<p>
A developer's guide to Redis
</p>
<a href="/docs/latest/develop/reference/">
Redis reference
</a>
<p>
Specifications and protocols
</p>
</nav>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/develop/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/commands/xinfo-help/.html | <section class="prose w-full py-12">
<h1 class="command-name">
XINFO HELP
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">XINFO HELP</pre>
<dl class="grid grid-cols-[auto,1fr] gap-2 mb-12">
<dt class="font-semibold text-redis-ink-900 m-0">
Available since:
</dt>
<dd class="m-0">
5.0.0
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
Time complexity:
</dt>
<dd class="m-0">
O(1)
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
ACL categories:
</dt>
<dd class="m-0">
<code>
@stream
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@slow
</code>
<span class="mr-1 last:hidden">
,
</span>
</dd>
</dl>
<p>
The
<code>
XINFO HELP
</code>
command returns a helpful text describing the different subcommands.
</p>
<h2 id="resp2resp3-reply">
RESP2/RESP3 Reply
</h2>
<a href="../../develop/reference/protocol-spec#arrays">
Array reply
</a>
: a list of sub-commands and their descriptions.
<br/>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/xinfo-help/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/commands/object-help/.html | <section class="prose w-full py-12">
<h1 class="command-name">
OBJECT HELP
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">OBJECT HELP</pre>
<dl class="grid grid-cols-[auto,1fr] gap-2 mb-12">
<dt class="font-semibold text-redis-ink-900 m-0">
Available since:
</dt>
<dd class="m-0">
6.2.0
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
Time complexity:
</dt>
<dd class="m-0">
O(1)
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
ACL categories:
</dt>
<dd class="m-0">
<code>
@keyspace
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@slow
</code>
<span class="mr-1 last:hidden">
,
</span>
</dd>
</dl>
<p>
The
<code>
OBJECT HELP
</code>
command returns a helpful text describing the different subcommands.
</p>
<h2 id="resp2-reply">
RESP2 Reply
</h2>
<a href="../../develop/reference/protocol-spec#arrays">
Array reply
</a>
: a list of sub-commands and their descriptions
<h2 id="resp3-reply">
RESP3 Reply
</h2>
<a href="../../develop/reference/protocol-spec#arrays">
Array reply
</a>
: a list of sub-commands and their descriptions.
<br/>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/object-help/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/gears-v1/jvm/classes/gearsfuture/.html | <section class="prose w-full py-12 max-w-none">
<h1>
GearsFuture
</h1>
<p class="text-lg -mt-5 mb-10">
Allows asynchronous processing of records.
</p>
<p>
The
<code>
GearsFuture
</code>
class allows asynchronous processing of records in another thread.
</p>
<p>
You can use a
<code>
GearsFuture
</code>
object with the following
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/gears-v1/jvm/classes/gearsbuilder/">
<code>
GearsBuilder
</code>
</a>
functions:
</p>
<ul>
<li>
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/gears-v1/jvm/classes/gearsbuilder/asyncfilter/">
<code>
asyncFilter
</code>
</a>
</li>
<li>
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/gears-v1/jvm/classes/gearsbuilder/asyncforeach/">
<code>
asyncForeach
</code>
</a>
</li>
<li>
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/gears-v1/jvm/classes/gearsbuilder/asyncmap/">
<code>
asyncMap
</code>
</a>
</li>
</ul>
<h2 id="functions">
Functions
</h2>
<table>
<thead>
<tr>
<th style="text-align:left">
Function
</th>
<th style="text-align:left">
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/gears-v1/jvm/classes/gearsfuture/seterror/">
setError
</a>
</td>
<td style="text-align:left">
Sets an error message.
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/gears-v1/jvm/classes/gearsfuture/setresult/">
setResult
</a>
</td>
<td style="text-align:left">
Sets a computation to run asynchronously.
</td>
</tr>
</tbody>
</table>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/gears-v1/jvm/classes/gearsfuture/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/commands/cluster-keyslot/.html | <section class="prose w-full py-12">
<h1 class="command-name">
CLUSTER KEYSLOT
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">CLUSTER KEYSLOT key</pre>
<dl class="grid grid-cols-[auto,1fr] gap-2 mb-12">
<dt class="font-semibold text-redis-ink-900 m-0">
Available since:
</dt>
<dd class="m-0">
3.0.0
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
Time complexity:
</dt>
<dd class="m-0">
O(N) where N is the number of bytes in the key
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
ACL categories:
</dt>
<dd class="m-0">
<code>
@slow
</code>
<span class="mr-1 last:hidden">
,
</span>
</dd>
</dl>
<p>
Returns an integer identifying the hash slot the specified key hashes to.
This command is mainly useful for debugging and testing, since it exposes
via an API the underlying Redis implementation of the hashing algorithm.
Example use cases for this command:
</p>
<ol>
<li>
Client libraries may use Redis in order to test their own hashing algorithm, generating random keys and hashing them with both their local implementation and using Redis
<code>
CLUSTER KEYSLOT
</code>
command, then checking if the result is the same.
</li>
<li>
Humans may use this command in order to check what is the hash slot, and then the associated Redis Cluster node, responsible for a given key.
</li>
</ol>
<h2 id="example">
Example
</h2>
<pre tabindex="0"><code>> CLUSTER KEYSLOT somekey
(integer) 11058
> CLUSTER KEYSLOT foo{hash_tag}
(integer) 2515
> CLUSTER KEYSLOT bar{hash_tag}
(integer) 2515
</code></pre>
<p>
Note that the command implements the full hashing algorithm, including support for
<strong>
hash tags
</strong>
, that is the special property of Redis Cluster key hashing algorithm, of hashing just what is between
<code>
{
</code>
and
<code>
}
</code>
if such a pattern is found inside the key name, in order to force multiple keys to be handled by the same node.
</p>
<h2 id="resp2resp3-reply">
RESP2/RESP3 Reply
</h2>
<a href="../../develop/reference/protocol-spec#integers">
Integer reply
</a>
: The hash slot number for the specified key
<br/>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/cluster-keyslot/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/references/cli-utilities/rladmin/node/external-addr/.html | <section class="prose w-full py-12 max-w-none">
<h1>
rladmin node external_addr
</h1>
<p class="text-lg -mt-5 mb-10">
Configures a node's external IP addresses.
</p>
<p>
Configures a node's external IP addresses.
</p>
<h2 id="node-external_addr-add">
<code>
node external_addr add
</code>
</h2>
<p>
Adds an external IP address that accepts inbound user connections for the node.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin node <ID> external_addr
</span></span><span class="line"><span class="cl"> add <IP address>
</span></span></code></pre>
</div>
<h3 id="parameters">
Parameters
</h3>
<table>
<thead>
<tr>
<th>
Parameter
</th>
<th>
Type/Value
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
node
</td>
<td>
integer
</td>
<td>
Adds an external IP address for the specified node
</td>
</tr>
<tr>
<td>
IP address
</td>
<td>
IP address
</td>
<td>
External IP address of the node
</td>
</tr>
</tbody>
</table>
<h3 id="returns">
Returns
</h3>
<p>
Returns
<code>
Updated successfully
</code>
if the IP address was added. Otherwise, it returns an error.
</p>
<p>
Use
<a href="/docs/latest/operate/rs/references/cli-utilities/rladmin/status/#status-nodes">
<code>
rladmin status nodes
</code>
</a>
to verify the external IP address was added.
</p>
<h3 id="example">
Example
</h3>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ rladmin node <span class="m">1</span> external_addr add 198.51.100.1
</span></span><span class="line"><span class="cl">Updated successfully.
</span></span><span class="line"><span class="cl">$ rladmin status nodes
</span></span><span class="line"><span class="cl">CLUSTER NODES:
</span></span><span class="line"><span class="cl">NODE:ID ROLE ADDRESS EXTERNAL_ADDRESS HOSTNAME SHARDS CORES FREE_RAM PROVISIONAL_RAM VERSION STATUS
</span></span><span class="line"><span class="cl">*node:1 master 192.0.2.2 198.51.100.1 3d99db1fdf4b 5/100 <span class="m">6</span> 14.75GB/19.54GB 11.15GB/16.02GB 6.2.12-37 OK
</span></span><span class="line"><span class="cl">node:2 slave 192.0.2.3 fc7a3d332458 0/100 <span class="m">6</span> 14.75GB/19.54GB 11.24GB/16.02GB 6.2.12-37 OK
</span></span><span class="line"><span class="cl">node:3 slave 192.0.2.4 b87cc06c830f 5/120 <span class="m">6</span> 14.75GB/19.54GB 11.15GB/16.02GB 6.2.12-37 OK
</span></span></code></pre>
</div>
<h2 id="node-external_addr-set">
<code>
node external_addr set
</code>
</h2>
<p>
Sets one or more external IP addresses that accepts inbound user connections for the node.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin node <ID> external_addr
</span></span><span class="line"><span class="cl"> <span class="nb">set</span> <IP address 1> ... <IP address N>
</span></span></code></pre>
</div>
<h3 id="parameters-1">
Parameters
</h3>
<table>
<thead>
<tr>
<th>
Parameter
</th>
<th>
Type/Value
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
node
</td>
<td>
integer
</td>
<td>
Sets external IP addresses for the specified node
</td>
</tr>
<tr>
<td>
IP address
</td>
<td>
list of IP addresses
</td>
<td>
Sets specified IP addresses as external addresses
</td>
</tr>
</tbody>
</table>
<h3 id="returns-1">
Returns
</h3>
<p>
Returns
<code>
Updated successfully
</code>
if the IP addresses were set. Otherwise, it returns an error.
</p>
<p>
Use
<a href="/docs/latest/operate/rs/references/cli-utilities/rladmin/status/#status-nodes">
<code>
rladmin status nodes
</code>
</a>
to verify the external IP address was set.
</p>
<h3 id="example-1">
Example
</h3>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ rladmin node <span class="m">2</span> external_addr <span class="nb">set</span> 198.51.100.2 198.51.100.3
</span></span><span class="line"><span class="cl">Updated successfully.
</span></span><span class="line"><span class="cl">$ rladmin status nodes
</span></span><span class="line"><span class="cl">CLUSTER NODES:
</span></span><span class="line"><span class="cl">NODE:ID ROLE ADDRESS EXTERNAL_ADDRESS HOSTNAME SHARDS CORES FREE_RAM PROVISIONAL_RAM VERSION STATUS
</span></span><span class="line"><span class="cl">*node:1 master 192.0.2.2 198.51.100.1 3d99db1fdf4b 5/100 <span class="m">6</span> 14.75GB/19.54GB 11.15GB/16.02GB 6.2.12-37 OK
</span></span><span class="line"><span class="cl">node:2 slave 192.0.2.3 198.51.100.2,198.51.100.3 fc7a3d332458 0/100 <span class="m">6</span> 14.75GB/19.54GB 11.23GB/16.02GB 6.2.12-37 OK
</span></span><span class="line"><span class="cl">node:3 slave 192.0.2.4 b87cc06c830f 5/120 <span class="m">6</span> 14.75GB/19.54GB 11.15GB/16.02GB 6.2.12-37 OK
</span></span></code></pre>
</div>
<h2 id="node-external_addr-remove">
<code>
node external_addr remove
</code>
</h2>
<p>
Removes the specified external IP address from the node.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin node <ID> external_addr
</span></span><span class="line"><span class="cl"> remove <IP address>
</span></span></code></pre>
</div>
<h3 id="parameters-2">
Parameters
</h3>
<table>
<thead>
<tr>
<th>
Parameter
</th>
<th>
Type/Value
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
node
</td>
<td>
integer
</td>
<td>
Removes an external IP address for the specified node
</td>
</tr>
<tr>
<td>
IP address
</td>
<td>
IP address
</td>
<td>
Removes the specified IP address of the node
</td>
</tr>
</tbody>
</table>
<h3 id="returns-2">
Returns
</h3>
<p>
Returns
<code>
Updated successfully
</code>
if the IP address was removed. Otherwise, it returns an error.
</p>
<p>
Use
<a href="/docs/latest/operate/rs/references/cli-utilities/rladmin/status/#status-nodes">
<code>
rladmin status nodes
</code>
</a>
to verify the external IP address was removed.
</p>
<h3 id="example-2">
Example
</h3>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ rladmin status nodes
</span></span><span class="line"><span class="cl">CLUSTER NODES:
</span></span><span class="line"><span class="cl">NODE:ID ROLE ADDRESS EXTERNAL_ADDRESS HOSTNAME SHARDS CORES FREE_RAM PROVISIONAL_RAM VERSION STATUS
</span></span><span class="line"><span class="cl">*node:1 master 192.0.2.2 198.51.100.1 3d99db1fdf4b 5/100 <span class="m">6</span> 14.75GB/19.54GB 11.15GB/16.02GB 6.2.12-37 OK
</span></span><span class="line"><span class="cl">node:2 slave 192.0.2.3 198.51.100.2,198.51.100.3 fc7a3d332458 0/100 <span class="m">6</span> 14.75GB/19.54GB 11.23GB/16.02GB 6.2.12-37 OK
</span></span><span class="line"><span class="cl">node:3 slave 192.0.2.4 b87cc06c830f 5/120 <span class="m">6</span> 14.75GB/19.54GB 11.15GB/16.02GB 6.2.12-37 OK
</span></span><span class="line"><span class="cl">$ rladmin node <span class="m">2</span> external_addr remove 198.51.100.3
</span></span><span class="line"><span class="cl">Updated successfully.
</span></span><span class="line"><span class="cl">$ rladmin status nodes
</span></span><span class="line"><span class="cl">CLUSTER NODES:
</span></span><span class="line"><span class="cl">NODE:ID ROLE ADDRESS EXTERNAL_ADDRESS HOSTNAME SHARDS CORES FREE_RAM PROVISIONAL_RAM VERSION STATUS
</span></span><span class="line"><span class="cl">*node:1 master 192.0.2.2 198.51.100.1 3d99db1fdf4b 5/100 <span class="m">6</span> 14.74GB/19.54GB 11.14GB/16.02GB 6.2.12-37 OK
</span></span><span class="line"><span class="cl">node:2 slave 192.0.2.3 198.51.100.2 fc7a3d332458 0/100 <span class="m">6</span> 14.74GB/19.54GB 11.22GB/16.02GB 6.2.12-37 OK
</span></span><span class="line"><span class="cl">node:3 slave 192.0.2.4 b87cc06c830f 5/120 <span class="m">6</span> 14.74GB/19.54GB 11.14GB/16.02GB 6.2.12-37 OK
</span></span></code></pre>
</div>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/references/cli-utilities/rladmin/node/external-addr/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/references/rest-api/objects/services_configuration/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Services configuration object
</h1>
<p class="text-lg -mt-5 mb-10">
An object for optional cluster services settings
</p>
<p>
Optional cluster services settings
</p>
<table>
<thead>
<tr>
<th>
Name
</th>
<th>
Type/Value
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
cm_server
</td>
<td>
<a href="/docs/latest/operate/rs/references/rest-api/objects/services_configuration/cm_server/">
cm_server
</a>
object
</td>
<td>
Whether to enable/disable the CM server
</td>
</tr>
<tr>
<td>
crdb_coordinator
</td>
<td>
<a href="/docs/latest/operate/rs/references/rest-api/objects/services_configuration/crdb_coordinator/">
crdb_coordinator
</a>
object
</td>
<td>
Whether to enable/disable the CRDB coordinator process
</td>
</tr>
<tr>
<td>
crdb_worker
</td>
<td>
<a href="/docs/latest/operate/rs/references/rest-api/objects/services_configuration/crdb_worker/">
crdb_worker
</a>
object
</td>
<td>
Whether to enable/disable the CRDB worker processes
</td>
</tr>
<tr>
<td>
mdns_server
</td>
<td>
<a href="/docs/latest/operate/rs/references/rest-api/objects/services_configuration/mdns_server/">
mdns_server
</a>
object
</td>
<td>
Whether to enable/disable the multicast DNS server
</td>
</tr>
<tr>
<td>
pdns_server
</td>
<td>
<a href="/docs/latest/operate/rs/references/rest-api/objects/services_configuration/pdns_server/">
pdns_server
</a>
object
</td>
<td>
Whether to enable/disable the PDNS server
</td>
</tr>
<tr>
<td>
stats_archiver
</td>
<td>
<a href="/docs/latest/operate/rs/references/rest-api/objects/services_configuration/stats_archiver/">
stats_archiver
</a>
object
</td>
<td>
Whether to enable/disable the stats archiver service
</td>
</tr>
</tbody>
</table>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/references/rest-api/objects/services_configuration/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/7.4/databases/import-export/replica-of/replicaof-repeatedly-fails/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Replica Of Repeatedly Fails
</h1>
<p class="text-lg -mt-5 mb-10">
Troubleshoot when the Replica Of process repeatedly fails and restarts.
</p>
<p>
<strong>
Problem
</strong>
: The Replica Of process repeatedly fails and restarts
</p>
<p>
<strong>
Diagnostic
</strong>
: A log entry in the Redis log of the source database shows repeated failures and restarts.
</p>
<p>
<strong>
Cause
</strong>
: The Redis "client-output-buffer-limit" setting on the source database
is configured to a relatively small value, which causes the connection drop.
</p>
<p>
<strong>
Resolution
</strong>
: Reconfigure the buffer on the source database to a bigger value:
</p>
<ul>
<li>
<p>
If the source is a Redis database on a Redis Enterprise Software cluster,
increase the replica buffer size of the
<strong>
source database
</strong>
with:
</p>
<p>
<code>
rladmin tune db < db:id | name > slave_buffer < value >
</code>
</p>
</li>
<li>
<p>
If the source is a Redis database not on a Redis Enterprise Software cluster,
use the
<a href="http://redis.io/commands/config-set">
config set
</a>
command through
<code>
redis-cli
</code>
to increase the client output buffer size of the
<strong>
source database
</strong>
with:
</p>
<p>
<code>
config set client-output-buffer-limit "slave <hard_limit> <soft_limit> <soft_seconds>"
</code>
</p>
</li>
</ul>
<p>
<strong>
Additional information
</strong>
:
<a href="https://redislabs.com/blog/top-redis-headaches-for-devops-replication-buffer">
Top Redis Headaches for DevOps - Replication Buffer
</a>
</p>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/databases/import-export/replica-of/replicaof-repeatedly-fails/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/integrate/write-behind/reference/data-transformation-block-types/key/.html | <section class="prose w-full py-12 max-w-none">
<h1>
key
</h1>
<p class="text-lg -mt-5 mb-10">
Set the Redis key for this data entry
</p>
<p>
Set the Redis key for this data entry
</p>
<p>
<strong>
Properties
</strong>
</p>
<table>
<thead>
<tr>
<th>
Name
</th>
<th>
Type
</th>
<th>
Description
</th>
<th>
Required
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<strong>
expression
</strong>
</td>
<td>
<code>
string
</code>
</td>
<td>
Expression
<br/>
</td>
<td>
yes
</td>
</tr>
<tr>
<td>
<strong>
language
</strong>
</td>
<td>
<code>
string
</code>
</td>
<td>
Language
<br/>
Enum:
<code>
"jmespath"
</code>
,
<code>
"sql"
</code>
<br/>
</td>
<td>
yes
</td>
</tr>
</tbody>
</table>
<p>
<strong>
Additional Properties:
</strong>
not allowed
</p>
<p>
<strong>
Example
</strong>
</p>
<div class="highlight">
<pre class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">source</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">server_name</span><span class="p">:</span><span class="w"> </span><span class="l">redislabs</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">schema</span><span class="p">:</span><span class="w"> </span><span class="l">dbo</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">table</span><span class="p">:</span><span class="w"> </span><span class="l">emp</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">key</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">expression</span><span class="p">:</span><span class="w"> </span><span class="l">concat([InvoiceId, '.', CustomerId])</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">language</span><span class="p">:</span><span class="w"> </span><span class="l">jmespath</span><span class="w">
</span></span></span></code></pre>
</div>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/integrate/write-behind/reference/data-transformation-block-types/key/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/commands/hmget/.html | <section class="prose w-full py-12">
<h1 class="command-name">
HMGET
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">HMGET key field [field ...]</pre>
<dl class="grid grid-cols-[auto,1fr] gap-2 mb-12">
<dt class="font-semibold text-redis-ink-900 m-0">
Available since:
</dt>
<dd class="m-0">
2.0.0
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
Time complexity:
</dt>
<dd class="m-0">
O(N) where N is the number of fields being requested.
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
ACL categories:
</dt>
<dd class="m-0">
<code>
@read
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@hash
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@fast
</code>
<span class="mr-1 last:hidden">
,
</span>
</dd>
</dl>
<p>
Returns the values associated with the specified
<code>
fields
</code>
in the hash stored at
<code>
key
</code>
.
</p>
<p>
For every
<code>
field
</code>
that does not exist in the hash, a
<code>
nil
</code>
value is returned.
Because non-existing keys are treated as empty hashes, running
<code>
HMGET
</code>
against
a non-existing
<code>
key
</code>
will return a list of
<code>
nil
</code>
values.
</p>
<div class="bg-slate-900 border-b border-slate-700 rounded-t-xl px-4 py-3 w-full flex">
<svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20">
<path d="M2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10Z">
</path>
</svg>
<svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20">
<path d="M10 2.5L18.6603 17.5L1.33975 17.5L10 2.5Z">
</path>
</svg>
<svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20">
<path d="M10 2.5L12.0776 7.9322L17.886 8.22949L13.3617 11.8841L14.8738 17.5L10 14.3264L5.1262 17.5L6.63834 11.8841L2.11403 8.22949L7.92238 7.9322L10 2.5Z">
</path>
</svg>
</div>
<form class="redis-cli overflow-y-auto max-h-80">
<pre tabindex="0">redis> HSET myhash field1 "Hello"
(integer) 1
redis> HSET myhash field2 "World"
(integer) 1
redis> HMGET myhash field1 field2 nofield
1) "Hello"
2) "World"
3) (nil)
</pre>
<div class="prompt" style="">
<span>
redis>
</span>
<input autocomplete="off" name="prompt" spellcheck="false" type="text"/>
</div>
</form>
<h2 id="resp2resp3-reply">
RESP2/RESP3 Reply
</h2>
<a href="../../develop/reference/protocol-spec#arrays">
Array reply
</a>
: a list of values associated with the given fields, in the same order as they are requested.
<br/>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/hmget/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/commands/setrange/.html | <section class="prose w-full py-12">
<h1 class="command-name">
SETRANGE
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">SETRANGE key offset value</pre>
<dl class="grid grid-cols-[auto,1fr] gap-2 mb-12">
<dt class="font-semibold text-redis-ink-900 m-0">
Available since:
</dt>
<dd class="m-0">
2.2.0
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
Time complexity:
</dt>
<dd class="m-0">
O(1), not counting the time taken to copy the new string in place. Usually, this string is very small so the amortized complexity is O(1). Otherwise, complexity is O(M) with M being the length of the value argument.
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
ACL categories:
</dt>
<dd class="m-0">
<code>
@write
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@string
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@slow
</code>
<span class="mr-1 last:hidden">
,
</span>
</dd>
</dl>
<p>
Overwrites part of the string stored at
<em>
key
</em>
, starting at the specified offset,
for the entire length of
<em>
value
</em>
.
If the offset is larger than the current length of the string at
<em>
key
</em>
, the
string is padded with zero-bytes to make
<em>
offset
</em>
fit.
Non-existing keys are considered as empty strings, so this command will make
sure it holds a string large enough to be able to set
<em>
value
</em>
at
<em>
offset
</em>
.
</p>
<p>
Note that the maximum offset that you can set is 2^29 -1 (536870911), as Redis
Strings are limited to 512 megabytes.
If you need to grow beyond this size, you can use multiple keys.
</p>
<p>
<strong>
Warning
</strong>
: When setting the last possible byte and the string value stored at
<em>
key
</em>
does not yet hold a string value, or holds a small string value, Redis
needs to allocate all intermediate memory which can block the server for some
time.
On a 2010 MacBook Pro, setting byte number 536870911 (512MB allocation) takes
~300ms, setting byte number 134217728 (128MB allocation) takes ~80ms, setting
bit number 33554432 (32MB allocation) takes ~30ms and setting bit number 8388608
(8MB allocation) takes ~8ms.
Note that once this first allocation is done, subsequent calls to
<code>
SETRANGE
</code>
for
the same
<em>
key
</em>
will not have the allocation overhead.
</p>
<h2 id="patterns">
Patterns
</h2>
<p>
Thanks to
<code>
SETRANGE
</code>
and the analogous
<a href="/docs/latest/commands/getrange/">
<code>
GETRANGE
</code>
</a>
commands, you can use Redis
strings as a linear array with O(1) random access.
This is a very fast and efficient storage in many real world use cases.
</p>
<h2 id="examples">
Examples
</h2>
<p>
Basic usage:
</p>
<div class="bg-slate-900 border-b border-slate-700 rounded-t-xl px-4 py-3 w-full flex">
<svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20">
<path d="M2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10Z">
</path>
</svg>
<svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20">
<path d="M10 2.5L18.6603 17.5L1.33975 17.5L10 2.5Z">
</path>
</svg>
<svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20">
<path d="M10 2.5L12.0776 7.9322L17.886 8.22949L13.3617 11.8841L14.8738 17.5L10 14.3264L5.1262 17.5L6.63834 11.8841L2.11403 8.22949L7.92238 7.9322L10 2.5Z">
</path>
</svg>
</div>
<form class="redis-cli overflow-y-auto max-h-80">
<pre tabindex="0">redis> SET key1 "Hello World"
"OK"
redis> SETRANGE key1 6 "Redis"
(integer) 11
redis> GET key1
"Hello Redis"
</pre>
<div class="prompt" style="">
<span>
redis>
</span>
<input autocomplete="off" name="prompt" spellcheck="false" type="text"/>
</div>
</form>
<p>
Example of zero padding:
</p>
<div class="bg-slate-900 border-b border-slate-700 rounded-t-xl px-4 py-3 w-full flex">
<svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20">
<path d="M2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10Z">
</path>
</svg>
<svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20">
<path d="M10 2.5L18.6603 17.5L1.33975 17.5L10 2.5Z">
</path>
</svg>
<svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20">
<path d="M10 2.5L12.0776 7.9322L17.886 8.22949L13.3617 11.8841L14.8738 17.5L10 14.3264L5.1262 17.5L6.63834 11.8841L2.11403 8.22949L7.92238 7.9322L10 2.5Z">
</path>
</svg>
</div>
<form class="redis-cli overflow-y-auto max-h-80">
<pre tabindex="0">redis> SETRANGE key2 6 "Redis"
(integer) 11
redis> GET key2
" Redis"
</pre>
<div class="prompt" style="">
<span>
redis>
</span>
<input autocomplete="off" name="prompt" spellcheck="false" type="text"/>
</div>
</form>
<h2 id="resp2resp3-reply">
RESP2/RESP3 Reply
</h2>
<a href="../../develop/reference/protocol-spec#integers">
Integer reply
</a>
: the length of the string after it was modified by the command.
<br/>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/setrange/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/references/rest-api/requests/crdbs/purge/.html | <section class="prose w-full py-12 max-w-none">
<h1>
CRDB purge requests
</h1>
<p class="text-lg -mt-5 mb-10">
Purge removed Active-Active database requests
</p>
<table>
<thead>
<tr>
<th>
Method
</th>
<th>
Path
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="#put-crdbs-purge">
PUT
</a>
</td>
<td>
<code>
/v1/crdbs/{crdb_guid}/purge
</code>
</td>
<td>
Purge data from an instance that was forcibly removed from the Active-Active database
</td>
</tr>
</tbody>
</table>
<h2 id="put-crdbs-purge">
Purge data from removed instance
</h2>
<pre><code>PUT /v1/crdbs/{crdb_guid}/purge
</code></pre>
<p>
Purge the data from an instance that was removed from the
Active-Active database by force.
</p>
<p>
When you force the removal of an instance from an Active-Active
database, the removed instance keeps the data and configuration
according to the last successful synchronization.
</p>
<p>
To delete the data and configuration from the forcefully removed
instance you must use this API (Must be executed locally on the
removed instance).
</p>
<h3 id="put-request">
Request
</h3>
<h4 id="example-http-request">
Example HTTP request
</h4>
<pre><code>PUT /crdbs/1/purge
</code></pre>
<h4 id="url-parameters">
URL parameters
</h4>
<table>
<thead>
<tr>
<th>
Field
</th>
<th>
Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
crdb_guid
</td>
<td>
string
</td>
<td>
Globally unique Active-Active database ID (GUID)
</td>
</tr>
</tbody>
</table>
<h4 id="request-body">
Request body
</h4>
<table>
<thead>
<tr>
<th>
Field
</th>
<th>
Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
instances
</td>
<td>
array of integers
</td>
<td>
Array of unique instance IDs
</td>
</tr>
</tbody>
</table>
<h3 id="put-response">
Response
</h3>
<p>
Returns a
<a href="/docs/latest/operate/rs/references/rest-api/objects/crdb_task/">
CRDB task object
</a>
.
</p>
<h3 id="put-status-codes">
Status codes
</h3>
<table>
<thead>
<tr>
<th>
Code
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1">
200 OK
</a>
</td>
<td>
Action was successful.
</td>
</tr>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1">
400 Bad Request
</a>
</td>
<td>
The request is invalid or malformed.
</td>
</tr>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.2">
401 Unauthorized
</a>
</td>
<td>
Unauthorized request. Invalid credentials
</td>
</tr>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5">
404 Not Found
</a>
</td>
<td>
Configuration, instance, or Active-Active database not found.
</td>
</tr>
</tbody>
</table>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/references/rest-api/requests/crdbs/purge/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.