url
stringlengths 38
157
| content
stringlengths 72
15.1M
|
---|---|
https://redis.io/docs/latest/integrate/write-behind/installation/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Installation
</h1>
<p class="text-lg -mt-5 mb-10">
Learn how to install Write-behind
</p>
<nav>
<a href="/docs/latest/integrate/write-behind/installation/install-rdi-cli/">
Install Write-behind CLI
</a>
<p>
Install Write-behind CLI
</p>
<a href="/docs/latest/integrate/write-behind/installation/install-redis-gears/">
Install RedisGears for Redis Data Integration
</a>
<p>
Install and set up RedisGears for a Write-behind deployment
</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/write-behind/installation/"/>
<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/users/refresh_jwt/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Refresh JWT requests
</h1>
<p class="text-lg -mt-5 mb-10">
Refresh JW token requests
</p>
<table>
<thead>
<tr>
<th>
Method
</th>
<th>
Path
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="#post-refresh_jwt">
POST
</a>
</td>
<td>
<code>
/v1/users/refresh_jwt
</code>
</td>
<td>
Get a new authentication token
</td>
</tr>
</tbody>
</table>
<h2 id="post-refresh_jwt">
Get a new authentication token
</h2>
<pre><code>POST /v1/users/refresh_jwt
</code></pre>
<p>
Generate a new JSON Web Token (JWT) for authentication.
</p>
<p>
Takes a valid token and returns the new token generated by the request.
</p>
<h3 id="post-request">
Request
</h3>
<h4 id="example-http-request">
Example HTTP request
</h4>
<pre><code>POST /users/refresh_jwt
</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>
Authorization
</td>
<td>
JWT eyJ5bGciOiKIUzI1NiIsInR5cCI6IkpXVCJ9.
<br/>
<br/>
eyJpYXViOjE0NjU0NzU0ODYsInVpZFI1IjEiLCJ
<br/>
<br/>
leHAiOjE0NjU0Nz30OTZ9.2xYXumd1rDoE0e
<br/>
<br/>
dFzcLElMOHsshaqQk2HUNgdsUKxMU
</td>
<td>
Valid JSON Web Token (JWT)
</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>
ttl
</td>
<td>
integer
</td>
<td>
Time to live - The amount of time in seconds the token will be valid (optional)
</td>
</tr>
</tbody>
</table>
<h3 id="post-response">
Response
</h3>
<p>
Returns a JSON object that contains the generated access token.
</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">"access_token"</span><span class="p">:</span> <span class="s2">"eyJ5bGciOiKIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXViOjE0NjU0NzU0ODYsInVpZFI1IjEiLCJleHAiOjE0NjU0Nz30OTZ9.2xYXumd1rDoE0edFzcLElMOHsshaqQk2HUNgdsUKxMU"</span>
</span></span><span class="line"><span class="cl"> <span class="p">}</span>
</span></span></code></pre>
</div>
<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>
A new token is given.
</td>
</tr>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.2">
401 Unauthorized
</a>
</td>
<td>
The token is invalid or password has expired.
</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/users/refresh_jwt/"/>
<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/certificates/create-certificates/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Create certificates
</h1>
<p class="text-lg -mt-5 mb-10">
Create self-signed certificates to install on a Redis Enterprise cluster.
</p>
<p>
When you first install Redis Enterprise Software, self-signed certificates are created to enable encryption for Redis Enterprise endpoints. These certificates expire after a year (365 days) and must be renewed.
</p>
<p>
You can renew these certificates by replacing them with new self-signed certificates or by replacing them with certificates signed by a
<a href="https://en.wikipedia.org/wiki/Certificate_authority">
certificate authority
</a>
(CA).
</p>
<h2 id="renew-self-signed-certificates">
Renew self-signed certificates
</h2>
<p>
As of
<a href="/docs/latest/operate/rs/release-notes/rs-6-2-18-releases/rs-6-2-18-70/">
v6.2.18-70
</a>
, Redis Enterprise Software includes a script to generate self-signed certificates.
</p>
<p>
By default, the
<code>
generate_self_signed_certs.sh
</code>
script is located in
<code>
/opt/redislabs/utils/
</code>
.
</p>
<p>
Here, you learn how to use this script to generate new certificates and how to install them.
</p>
<h3 id="step-1-generate-new-certificates">
Step 1: Generate new certificates
</h3>
<p>
Sign in to the machine hosting the cluster's master node and then run the following command:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">% sudo -u redislabs /opt/redislabs/utils/generate_self_signed_certs.sh <span class="se">\
</span></span></span><span class="line"><span class="cl"><span class="se"></span> -f <span class="s2">"<DomainName1 DomainName2>"</span> -d <Days> -t <Type>
</span></span></code></pre>
</div>
<p>
where:
</p>
<ul>
<li>
<p>
<em>
<DomainName1>
</em>
is the fully qualified domain name (FQDN) of the cluster. (This is the name given to the cluster when first created.)
</p>
</li>
<li>
<p>
<em>
<DomainName2>
</em>
is an optional FQDN for the cluster. Multiple domain names are allowed, separated by whitespace. Quotation marks (
<code>
""
</code>
) should enclose the full set of names.
</p>
</li>
<li>
<p>
<em>
<Days>
</em>
is an integer specifying the number of days the certificate should be valid. We recommend against setting this longer than a year (365 days).
</p>
<p>
<em>
<Days>
</em>
is optional and defaults to
<code>
365
</code>
.
</p>
</li>
<li>
<p>
<em>
<Type>
</em>
is a string identifying the name of the certificate to generate.
</p>
<p>
The following values are supported:
</p>
<table>
<thead>
<tr>
<th>
Value
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>
api
</code>
</td>
<td>
The REST API
</td>
</tr>
<tr>
<td>
<code>
cm
</code>
</td>
<td>
The Cluster Manager UI
</td>
</tr>
<tr>
<td>
<code>
metrics
</code>
</td>
<td>
The metrics exporter
</td>
</tr>
<tr>
<td>
<code>
proxy
</code>
</td>
<td>
The database endpoint
</td>
</tr>
<tr>
<td>
<code>
syncer
</code>
</td>
<td>
The synchronization process
</td>
</tr>
<tr>
<td>
<code>
all
</code>
</td>
<td>
Generates all certificates in a single operation
</td>
</tr>
</tbody>
</table>
<p>
<em>
Type
</em>
is optional and defaults to
<code>
all
</code>
.
</p>
</li>
</ul>
<p>
When you run the script, it either reports success (
<code>
"Self signed cert generated successfully"
</code>
) or an error message. Use the error message to troubleshoot any issues.
</p>
<p>
The following example generates all self signed certificates for
<code>
mycluster.example.com
</code>
; these certificates expire one year after the command is run:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ sudo -u redislabs /opt/redislabs/utils/generate_self_signed_certs.sh <span class="se">\
</span></span></span><span class="line"><span class="cl"><span class="se"></span> -f <span class="s2">"mycluster.example.com"</span><span class="sb">`</span>
</span></span></code></pre>
</div>
<p>
Suppose you want to create a Cluster Manager UI certificate to support two clusters for a period of two years. The following example shows how:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ sudo -u redislabs /opt/redislabs/utils/generate_self_signed_certs.sh <span class="se">\
</span></span></span><span class="line"><span class="cl"><span class="se"></span> -f <span class="s2">"mycluster.example.com anothercluster.example.com"</span> -d <span class="m">730</span> -t cm
</span></span></code></pre>
</div>
<p>
Here, a certificate file and certificate key are generated to support the following domains:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">mycluster.example.com
</span></span><span class="line"><span class="cl">*.mycluster.example.com
</span></span><span class="line"><span class="cl">anothercluster.example.com
</span></span><span class="line"><span class="cl">*.anothercluster.example.com
</span></span></code></pre>
</div>
<h3 id="step-2-locate-the-new-certificate-files">
Step 2: Locate the new certificate files
</h3>
<p>
When successful, the script generates two .PEM files for each generated certificate: a certificate file and a certificate key, each named after the type of certificate generated (see earlier table for individual certificate names.)
</p>
<p>
These files can be found in the
<code>
/tmp
</code>
directory.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ ls -la /tmp/*.pem
</span></span></code></pre>
</div>
<h3 id="step-3-set-permissions">
Step 3: Set permissions
</h3>
<p>
We recommend setting the permissions of your new certificate files to limit read and write access to the file owner and to set group and other user permissions to read access.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ sudo chmod <span class="m">644</span> /tmp/*.pem
</span></span></code></pre>
</div>
<h3 id="replace-self-signed">
Step 4: Replace existing certificates
</h3>
<p>
You can use
<code>
rladmin
</code>
to replace the existing certificates with new certificates:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-console" data-lang="console"><span class="line"><span class="cl"><span class="gp">$</span> rladmin cluster certificate <span class="nb">set</span> <CertName> certificate_file <span class="se">\
</span></span></span><span class="line"><span class="cl"><span class="se"></span><span class="go"> <CertFilename>.pem key_file <KeyFilename>.pem
</span></span></span></code></pre>
</div>
<p>
The following values are supported for the
<em>
<CertName>
</em>
parameter:
</p>
<table>
<thead>
<tr>
<th>
Value
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>
api
</code>
</td>
<td>
The REST API
</td>
</tr>
<tr>
<td>
<code>
cm
</code>
</td>
<td>
The Cluster Manager UI
</td>
</tr>
<tr>
<td>
<code>
metrics_exporter
</code>
</td>
<td>
The metrics exporter
</td>
</tr>
<tr>
<td>
<code>
proxy
</code>
</td>
<td>
The database endpoint
</td>
</tr>
<tr>
<td>
<code>
syncer
</code>
</td>
<td>
The synchronization process
</td>
</tr>
</tbody>
</table>
<p>
You can also use the REST API. To learn more, see
<a href="/docs/latest/operate/rs/security/certificates/updating-certificates/#how-to-update-certificates">
Update certificates
</a>
.
</p>
<h2 id="create-ca-signed-certificates">
Create CA-signed certificates
</h2>
<p>
You can use certificates signed by a
<a href="https://en.wikipedia.org/wiki/Certificate_authority">
certificate authority
</a>
(CA).
</p>
<p>
For best results, use the following guidelines to create the certificates.
</p>
<h3 id="tls-certificate-guidelines">
TLS certificate guidelines
</h3>
<p>
When you create certificates signed by a certificate authority, you need to create server certificates and client certificates. The following provide guidelines that apply to both certificates and guidance for each certificate type.
</p>
<h4 id="guidelines-for-server-and-client-certificates">
Guidelines for server and client certificates
</h4>
<ol>
<li>
<p>
Include the full
<a href="https://en.wikipedia.org/wiki/X.509#Certificate_chains_and_cross-certification">
certificate chain
</a>
when creating certificate .PEM files for either server or client certificates.
</p>
</li>
<li>
<p>
List (
<em>
chain
</em>
) certificates in the .PEM file in the following order:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">-----BEGIN CERTIFICATE-----
</span></span><span class="line"><span class="cl">Domain (leaf) certificate
</span></span><span class="line"><span class="cl">-----END CERTIFICATE-----
</span></span><span class="line"><span class="cl">-----BEGIN CERTIFICATE-----
</span></span><span class="line"><span class="cl">Intermediate CA certificate
</span></span><span class="line"><span class="cl">-----END CERTIFICATE----
</span></span><span class="line"><span class="cl">-----BEGIN CERTIFICATE-----
</span></span><span class="line"><span class="cl">Trusted Root CA certificate
</span></span><span class="line"><span class="cl">-----END CERTIFICATE-----
</span></span></code></pre>
</div>
</li>
</ol>
<h4 id="server-certificate-guidelines">
Server certificate guidelines
</h4>
<p>
Server certificates support clusters.
</p>
<p>
In addition to the general guidelines described earlier, the following guidelines apply to server certificates:
</p>
<ol>
<li>
<p>
Use the cluster's fully qualified domain name (FQDN) as the certificate Common Name (CN).
</p>
</li>
<li>
<p>
Set the following values according to the values specified by your security team or certificate authority:
</p>
<ul>
<li>
Country Name (C)
</li>
<li>
State or Province Name (ST)
</li>
<li>
Locality Name (L)
</li>
<li>
Organization Name (O)
</li>
<li>
Organization Unit (OU)
</li>
</ul>
</li>
<li>
<p>
The
<a href="https://en.wikipedia.org/wiki/Subject_Alternative_Name">
Subject Alternative Name
</a>
(SAN) should include the following values based on the FQDN:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">dns=<cluster-fqdn>
</span></span><span class="line"><span class="cl">dns=*.<cluster-fqdn>
</span></span><span class="line"><span class="cl">dns=internal.<cluster-fqdn>
</span></span><span class="line"><span class="cl">dns=*.internal.<cluster-fqdn>
</span></span></code></pre>
</div>
</li>
<li>
<p>
The Extended Key Usage attribute should be set to
<code>
TLS Web Client Authentication
</code>
and
<code>
TLS Web Server Authentication
</code>
.
</p>
</li>
<li>
<p>
We strongly recommend using a strong hash algorithm, such as
<nobr>
SHA-256
</nobr>
or
<nobr>
SHA-512
</nobr>
.
</p>
<p>
Individual operating systems might limit access to specific algorithms. For example, Ubuntu 20.04
<a href="https://manpages.ubuntu.com/manpages/focal/man7/crypto-policies.7.html">
limits access
</a>
to
<nobr>
SHA-1
</nobr>
. In such cases, Redis Enterprise Software is limited to the features supported by the underlying operating system.
</p>
</li>
</ol>
<h4 id="client-certificate-guidelines">
Client certificate guidelines
</h4>
<p>
Client certificates support database connections.
</p>
<p>
In addition to the general guidelines described earlier, the following guidelines apply to client certificates:
</p>
<ol>
<li>
<p>
The Extended Key Usage attribute should be set to
<code>
TLS Web Client Authentication
</code>
.
</p>
</li>
<li>
<p>
We strongly recommend using a strong hash algorithm, such as
<nobr>
SHA-256
</nobr>
or
<nobr>
SHA-512
</nobr>
.
</p>
<p>
Individual operating systems might limit access to specific algorithms. For example, Ubuntu 20.04
<a href="https://manpages.ubuntu.com/manpages/focal/man7/crypto-policies.7.html">
limits access
</a>
to
<nobr>
SHA-1
</nobr>
. In such cases, Redis Enterprise Software is limited to the features supported by the underlying operating system.
</p>
</li>
</ol>
<h3 id="create-certificates">
Create certificates
</h3>
<p>
The actual process of creating CA-signed certificates varies according to the CA. In addition, your security team may have custom instructions that you need to follow.
</p>
<p>
Here, we demonstrate the general process using OpenSSL. If your CA provides alternate tools, you should use those according to their instructions.
</p>
<p>
However you choose to create the certificates, be sure to incorporate the guidelines described earlier.
</p>
<ol>
<li>
<p>
Create a private key.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ openssl genrsa -out <key-file-name>.pem <span class="m">2048</span>
</span></span></code></pre>
</div>
</li>
<li>
<p>
Create a certificate signing request.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ openssl req -new -key <key-file-name>.pem -out <span class="se">\
</span></span></span><span class="line"><span class="cl"><span class="se"></span> <key-file-name>.csr -config <csr-config-file>.cnf
</span></span></code></pre>
</div>
<p>
<em>
Important:
</em>
The .CNF file is a configuration file. Check with your security team or certificate authority for help creating a valid configuration file for your environment.
</p>
</li>
<li>
<p>
Sign the private key using your certificate authority.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ openssl x509 -req -in <key-file-name>.csr -signkey <key-file-name>.pem -out <cert-name>.pem
</span></span></code></pre>
</div>
<p>
The signing process varies for each organization and CA vendor. Consult your security team and certificate authority for specific instructions describing how to sign a certificate.
</p>
</li>
<li>
<p>
Upload the certificate to your cluster.
</p>
<p>
You can use
<a href="/docs/latest/operate/rs/references/cli-utilities/rladmin/cluster/certificate/">
<code>
rladmin
</code>
</a>
to replace the existing certificates with new certificates:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-console" data-lang="console"><span class="line"><span class="cl"><span class="gp">$</span> rladmin cluster certificate <span class="nb">set</span> <cert-name> certificate_file <span class="se">\
</span></span></span><span class="line"><span class="cl"><span class="se"></span><span class="go"> <cert-name>.pem key_file <key-file-name>.pem
</span></span></span></code></pre>
</div>
<p>
For a list of values supported by the
<code>
<cert-name>
</code>
parameter, see the
<a href="#replace-self-signed">
earlier table
</a>
.
</p>
<p>
You can also use the REST API. To learn more, see
<a href="/docs/latest/operate/rs/security/certificates/updating-certificates/#how-to-update-certificates">
Update certificates
</a>
.
</p>
</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/security/certificates/create-certificates/"/>
<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/integrate/write-behind/reference/data-transformation-block-types/add_field/.html | <section class="prose w-full py-12 max-w-none">
<h1>
add_field
</h1>
<p class="text-lg -mt-5 mb-10">
Add fields to a record
</p>
<p>
Add fields to a record
</p>
<p>
<strong>
Option 1 (alternative):
</strong>
Add multiple fields
</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>
<a href="#option1fields">
<strong>
fields
</strong>
</a>
</td>
<td>
<code>
object[]
</code>
</td>
<td>
Fields
<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">add_field</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">fields</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span>- <span class="nt">field</span><span class="p">:</span><span class="w"> </span><span class="l">name.full_name</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><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([name.fname, ' ', name.lname])</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span>- <span class="nt">field</span><span class="p">:</span><span class="w"> </span><span class="l">name.fname_upper</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><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">upper(name.fname)</span><span class="w">
</span></span></span></code></pre>
</div>
<p>
<strong>
Option 2 (alternative):
</strong>
Add one field
</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>
field
</strong>
</td>
<td>
<code>
string
</code>
</td>
<td>
Field
<br/>
</td>
<td>
yes
</td>
</tr>
<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">add_field</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">field</span><span class="p">:</span><span class="w"> </span><span class="l">country</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">country_code || ' - ' || UPPER(country_name)</span><span class="w">
</span></span></span></code></pre>
</div>
<p>
<a name="option1fields">
</a>
</p>
<h2 id="option-1-fields-array">
Option 1: fields[]: array
</h2>
<p>
Fields
</p>
<p>
<strong>
Items
</strong>
</p>
<p>
<strong>
Item Properties
</strong>
</p>
<table>
<thead>
<tr>
<th>
Name
</th>
<th>
Type
</th>
<th>
Description
</th>
<th>
Required
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<strong>
field
</strong>
</td>
<td>
<code>
string
</code>
</td>
<td>
Field
<br/>
</td>
<td>
yes
</td>
</tr>
<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>
Item 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="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/add_field/"/>
<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.aliasadd/.html | <section class="prose w-full py-12">
<h1 class="command-name">
FT.ALIASADD
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">FT.ALIASADD alias index
</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(1)
</dd>
</dl>
<p>
Add an alias to an index
</p>
<p>
<a href="#examples">
Examples
</a>
</p>
<h2 id="required-arguments">
Required arguments
</h2>
<details open="">
<summary>
<code>
alias index
</code>
</summary>
<p>
is alias to be added to an index.
</p>
</details>
<p>
Indexes can have more than one alias, but an alias cannot refer to another
alias.
</p>
<p>
FT.ALIASADD allows administrators to transparently redirect application queries to alternative indexes.
</p>
<h2 id="return">
Return
</h2>
<p>
FT.ALIASADD 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>
Add an alias to an index
</b>
</summary>
<p>
Add an alias to an 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.ALIASADD <span class="nb">alias</span> idx
</span></span><span class="line"><span class="cl">OK</span></span></code></pre>
</div>
<p>
Attempting to add the same alias returns a message that the alias already exists.
</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.ALIASADD <span class="nb">alias</span> idx
</span></span><span class="line"><span class="cl"><span class="o">(</span>error<span class="o">)</span> Alias already exists</span></span></code></pre>
</div>
</details>
<h2 id="see-also">
See also
</h2>
<p>
<a href="/docs/latest/commands/ft.aliasdel/">
<code>
FT.ALIASDEL
</code>
</a>
|
<a href="/docs/latest/commands/ft.aliasupdate/">
<code>
FT.ALIASUPDATE
</code>
</a>
</p>
<h2 id="related-topics">
Related topics
</h2>
<p>
<a href="/docs/latest/develop/interact/search-and-query/">
RediSearch
</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/ft.aliasadd/"/>
<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/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Redis Insight release notes
</h1>
<p>
Here are the most recent changes for Redis Insight:
</p>
<table>
<thead>
<tr>
<th style="text-align:left">
Version (Date)
</th>
<th style="text-align:left">
Release notes
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">
v2.60.0 (October 2024)
</td>
<td style="text-align:left">
<a href="/docs/latest/develop/tools/insight/release-notes/v.2.60.0/">
Redis Insight v2.60.0, October 2024
</a>
</td>
</tr>
<tr>
<td style="text-align:left">
v2.58.0 (October 2024)
</td>
<td style="text-align:left">
<a href="/docs/latest/develop/tools/insight/release-notes/v.2.58.0/">
Redis Insight v2.58.0, October 2024
</a>
</td>
</tr>
<tr>
<td style="text-align:left">
v2.56.0 (September 2024)
</td>
<td style="text-align:left">
<a href="/docs/latest/develop/tools/insight/release-notes/v.2.56.0/">
Redis Insight v2.56.0, September 2024
</a>
</td>
</tr>
<tr>
<td style="text-align:left">
v2.54.0 (August 2024)
</td>
<td style="text-align:left">
<a href="/docs/latest/develop/tools/insight/release-notes/v.2.54.0/">
Redis Insight v2.54.0, August 2024
</a>
</td>
</tr>
<tr>
<td style="text-align:left">
v2.52.0 (June 2024)
</td>
<td style="text-align:left">
<a href="/docs/latest/develop/tools/insight/release-notes/v.2.52.0/">
Redis Insight v2.52.0, June 2024
</a>
</td>
</tr>
<tr>
<td style="text-align:left">
v2.50.0 (May 2024)
</td>
<td style="text-align:left">
<a href="/docs/latest/develop/tools/insight/release-notes/v.2.50.0/">
Redis Insight v2.50.0, May 2024
</a>
</td>
</tr>
<tr>
<td style="text-align:left">
v2.48.0 (April 2024)
</td>
<td style="text-align:left">
<a href="/docs/latest/develop/tools/insight/release-notes/v.2.48.0/">
Redis Insight v2.48.0, April 2024
</a>
</td>
</tr>
<tr>
<td style="text-align:left">
v2.46.0 (March 2024)
</td>
<td style="text-align:left">
<a href="/docs/latest/develop/tools/insight/release-notes/v.2.46.0/">
RedisInsight v2.46.0, March 2024
</a>
</td>
</tr>
<tr>
<td style="text-align:left">
v2.44.0 (February 2024)
</td>
<td style="text-align:left">
<a href="/docs/latest/develop/tools/insight/release-notes/v.2.44.0/">
RedisInsight v2.44.0, February 2024
</a>
</td>
</tr>
<tr>
<td style="text-align:left">
v2.42.0 (January 2024)
</td>
<td style="text-align:left">
<a href="/docs/latest/develop/tools/insight/release-notes/v.2.42.0/">
RedisInsight v2.42.0, January 2024
</a>
</td>
</tr>
<tr>
<td style="text-align:left">
v2.40.0 (December 2023)
</td>
<td style="text-align:left">
<a href="/docs/latest/develop/tools/insight/release-notes/v.2.40.0/">
RedisInsight v2.40.0, December 2023
</a>
</td>
</tr>
<tr>
<td style="text-align:left">
v2.38.0 (November 2023)
</td>
<td style="text-align:left">
<a href="/docs/latest/develop/tools/insight/release-notes/v.2.38.0/">
RedisInsight v2.38.0, November 2023
</a>
</td>
</tr>
<tr>
<td style="text-align:left">
v2.36.0 (October 2023)
</td>
<td style="text-align:left">
<a href="/docs/latest/develop/tools/insight/release-notes/v.2.36.0/">
RedisInsight v2.36.0, October 2023
</a>
</td>
</tr>
<tr>
<td style="text-align:left">
v2.34.0 (September 2023)
</td>
<td style="text-align:left">
<a href="/docs/latest/develop/tools/insight/release-notes/v.2.34.0/">
RedisInsight v2.34.0, September 2023
</a>
</td>
</tr>
<tr>
<td style="text-align:left">
v2.32.0 (August 2023)
</td>
<td style="text-align:left">
<a href="/docs/latest/develop/tools/insight/release-notes/v.2.32.0/">
RedisInsight v2.32.0, August 2023
</a>
</td>
</tr>
<tr>
<td style="text-align:left">
v2.30.0 (July 2023)
</td>
<td style="text-align:left">
<a href="/docs/latest/develop/tools/insight/release-notes/v.2.30.0/">
RedisInsight v2.30.0, July 2023
</a>
</td>
</tr>
<tr>
<td style="text-align:left">
v2.28.0 (June 2023)
</td>
<td style="text-align:left">
<a href="/docs/latest/develop/tools/insight/release-notes/v2.28.0/">
RedisInsight v2.28.0, June 2023
</a>
</td>
</tr>
<tr>
<td style="text-align:left">
v2.26.0 (May 2023)
</td>
<td style="text-align:left">
<a href="/docs/latest/develop/tools/insight/release-notes/v.2.26.0/">
RedisInsight v2.26.0, May 2023
</a>
</td>
</tr>
<tr>
<td style="text-align:left">
v2.24.0 (Apr 2023)
</td>
<td style="text-align:left">
<a href="/docs/latest/develop/tools/insight/release-notes/v.2.24.0/">
RedisInsight v2.24.0, April 2023
</a>
</td>
</tr>
<tr>
<td style="text-align:left">
v2.22.1 (Mar 2023)
</td>
<td style="text-align:left">
<a href="/docs/latest/develop/tools/insight/release-notes/v.2.22.1/">
RedisInsight v2.22.1, March 2023
</a>
</td>
</tr>
<tr>
<td style="text-align:left">
v2.20.0 (Feb 2023)
</td>
<td style="text-align:left">
<a href="/docs/latest/develop/tools/insight/release-notes/v.2.20.0/">
RedisInsight v2.20.0, February 2023
</a>
</td>
</tr>
<tr>
<td style="text-align:left">
v2.18.0 (Jan 2023)
</td>
<td style="text-align:left">
<a href="/docs/latest/develop/tools/insight/release-notes/v.2.18.0/">
RedisInsight v2.18.0, January 2023
</a>
</td>
</tr>
<tr>
<td style="text-align:left">
v2.16.0 (Dec 2022)
</td>
<td style="text-align:left">
<a href="/docs/latest/develop/tools/insight/release-notes/v.2.16.0/">
RedisInsight v2.16.0, December 2022
</a>
</td>
</tr>
<tr>
<td style="text-align:left">
v2.14.0 (Nov 2022)
</td>
<td style="text-align:left">
<a href="/docs/latest/develop/tools/insight/release-notes/v.2.14.0/">
RedisInsight v2.14.0, November 2022
</a>
</td>
</tr>
<tr>
<td style="text-align:left">
v2.12.0 (Oct 2022)
</td>
<td style="text-align:left">
<a href="/docs/latest/develop/tools/insight/release-notes/v2.12.0/">
RedisInsight v2.12.0, October 2022
</a>
</td>
</tr>
<tr>
<td style="text-align:left">
v1.14 (May 2023)
</td>
<td style="text-align:left">
<a href="/docs/latest/develop/tools/insight/release-notes/v1.14.0/">
RedisInsight v1.14, may 2023
</a>
</td>
</tr>
<tr>
<td style="text-align:left">
v2.10.0 (Sept 2022)
</td>
<td style="text-align:left">
<a href="/docs/latest/develop/tools/insight/release-notes/v2.10.0/">
RedisInsight v2.10.0, September 2022
</a>
</td>
</tr>
<tr>
<td style="text-align:left">
v2.8.0 (Aug 2022)
</td>
<td style="text-align:left">
<a href="/docs/latest/develop/tools/insight/release-notes/v2.8.0/">
RedisInsight v2.8.0, August 2022
</a>
</td>
</tr>
<tr>
<td style="text-align:left">
v1.13 (Aug 2022)
</td>
<td style="text-align:left">
<a href="/docs/latest/develop/tools/insight/release-notes/v1.13.0/">
RedisInsight v1.13, Aug 2022
</a>
</td>
</tr>
<tr>
<td style="text-align:left">
v2.6.0 (July 2022)
</td>
<td style="text-align:left">
<a href="/docs/latest/develop/tools/insight/release-notes/v.2.6.0/">
RedisInsight v2.6.0, July 2022
</a>
</td>
</tr>
<tr>
<td style="text-align:left">
v2.4.0 (June 2022)
</td>
<td style="text-align:left">
<a href="/docs/latest/develop/tools/insight/release-notes/v.2.4.0/">
RedisInsight v2.4.0, June 2022
</a>
</td>
</tr>
<tr>
<td style="text-align:left">
v2.2.0 (May 2022)
</td>
<td style="text-align:left">
<a href="/docs/latest/develop/tools/insight/release-notes/v2.2.0/">
RedisInsight v2.2.0, May 2022
</a>
</td>
</tr>
<tr>
<td style="text-align:left">
v1.12 (May 2022)
</td>
<td style="text-align:left">
<a href="/docs/latest/develop/tools/insight/release-notes/v1.12.0/">
RedisInsight v1.12, May 2022
</a>
</td>
</tr>
<tr>
<td style="text-align:left">
v2.0 (Nov 2021)
</td>
<td style="text-align:left">
<a href="/docs/latest/develop/tools/insight/release-notes/v2.0/">
RedisInsight v2.0, Nov 2021
</a>
</td>
</tr>
<tr>
<td style="text-align:left">
v1.11 (Oct 2021)
</td>
<td style="text-align:left">
<a href="/docs/latest/develop/tools/insight/release-notes/v1.11.0/">
RedisInsight v1.11, Oct 2021
</a>
</td>
</tr>
<tr>
<td style="text-align:left">
v1.10 (Mar 2021)
</td>
<td style="text-align:left">
<a href="/docs/latest/develop/tools/insight/release-notes/v1.10.0/">
RedisInsight v1.10, March 2021
</a>
</td>
</tr>
<tr>
<td style="text-align:left">
v1.9 (Jan 2021)
</td>
<td style="text-align:left">
<a href="/docs/latest/develop/tools/insight/release-notes/v1.9.0/">
RedisInsight v1.9, January 2021
</a>
</td>
</tr>
<tr>
<td style="text-align:left">
v1.8 (Nov 2020)
</td>
<td style="text-align:left">
<a href="/docs/latest/develop/tools/insight/release-notes/v1.8.0/">
RedisInsight v1.8, November 2020
</a>
</td>
</tr>
<tr>
<td style="text-align:left">
v1.7 (Sep 2020)
</td>
<td style="text-align:left">
<a href="/docs/latest/develop/tools/insight/release-notes/v1.7.0/">
RedisInsight v1.7, September 2020
</a>
</td>
</tr>
<tr>
<td style="text-align:left">
v1.6 (June 2020)
</td>
<td style="text-align:left">
<a href="/docs/latest/develop/tools/insight/release-notes/v1.6.0/">
RedisInsight v1.6, June 2020
</a>
</td>
</tr>
<tr>
<td style="text-align:left">
v1.5 (May 2020)
</td>
<td style="text-align:left">
<a href="/docs/latest/develop/tools/insight/release-notes/v1.5.0/">
RedisInsight v1.5, May 2020
</a>
</td>
</tr>
<tr>
<td style="text-align:left">
v1.4 (Apr 2020)
</td>
<td style="text-align:left">
<a href="/docs/latest/develop/tools/insight/release-notes/v1.4.0/">
RedisInsight v1.4, April 2020
</a>
</td>
</tr>
<tr>
<td style="text-align:left">
v1.3 (Mar 2020)
</td>
<td style="text-align:left">
<a href="/docs/latest/develop/tools/insight/release-notes/v1.3.0/">
RedisInsight v1.3, March 2020
</a>
</td>
</tr>
<tr>
<td style="text-align:left">
v1.2 (Jan 2020)
</td>
<td style="text-align:left">
<a href="/docs/latest/develop/tools/insight/release-notes/v1.2.0/">
RedisInsight v1.2, January 2020
</a>
</td>
</tr>
<tr>
<td style="text-align:left">
v1.1 (Dec 2019)
</td>
<td style="text-align:left">
<a href="/docs/latest/develop/tools/insight/release-notes/v1.1.0/">
RedisInsight v1.1, December 2019
</a>
</td>
</tr>
<tr>
<td style="text-align:left">
v1.0 (Nov 2019)
</td>
<td style="text-align:left">
<a href="/docs/latest/develop/tools/insight/release-notes/v1.0.0/">
RedisInsight v1.0, November 2019
</a>
</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/develop/tools/insight/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/references/cli-utilities/crdb-cli/task/.html | <section class="prose w-full py-12 max-w-none">
<h1>
crdb-cli task commands
</h1>
<p class="text-lg -mt-5 mb-10">
Manage Active-Active tasks.
</p>
<p>
The
<code>
crdb-cli task
</code>
commands help investigate Active-Active database performance issues. They should not be used except as directed by Support.
</p>
<h2 id="crdb-cli-task-commands">
<code>
crdb-cli task
</code>
commands
</h2>
<table>
<thead>
<tr>
<th style="text-align:left">
Command
</th>
<th style="text-align:left">
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/rs/references/cli-utilities/crdb-cli/task/cancel/">
cancel
</a>
</td>
<td style="text-align:left">
Attempts to cancel a specified Active-Active database task.
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/rs/references/cli-utilities/crdb-cli/task/list/">
list
</a>
</td>
<td style="text-align:left">
Lists active and recent Active-Active database tasks.
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/rs/references/cli-utilities/crdb-cli/task/status/">
status
</a>
</td>
<td style="text-align:left">
Shows the status of a specified Active-Active database task.
</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/cli-utilities/crdb-cli/task/"/>
<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/redis-enterprise-5/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Redis Enterprise Pack 5.0 Release Notes (November 2017)
</h1>
<p>
Redis Enterprise Software 5.0 is now available. Key features include
Geo-Distributed Active-Active Conflict-free Replicated Databases (CRDB),
LDAP integration, Redis Module integration, and support for theΒ Redis
Cluster API.
</p>
<h2 id="overview">
Overview
</h2>
<p>
If you are upgrading from a previous version, make sure to review the
upgrade instructions before beginning the upgrade process.
</p>
<p>
You can upgrade to RS 5.0 from RS 4.4.2 and above. If you have a version
older than this, you must first upgrade to at least 4.4.2.
</p>
<h2 id="new-features">
New features
</h2>
<h3 id="support-for-redis-cluster-api">
Support for Redis Cluster API
</h3>
<p>
The Redis Cluster API support in Redis Enterprise Software (RS) provides
a simple mechanism for Cluster enabled Redis clients to learn and know
the cluster topology. This enables clients to connect directly to an RS
proxy on the node hosting the master shard for the data being operated
on. The result is that for all but the initial call to get the cluster
topology or reacquire the location of the master shard, the client will
connect to the RS endpoint proxy where the master shard is located.
<a href="/docs/latest/operate/rs/clusters/optimize/oss-cluster-api/">
Learn more about the Cluster API
implementation
</a>
.
</p>
<h3 id="geodistributed-activeactive-conflictfree-replicated-databases-crdb">
Geo-distributed Active-Active conflict-free replicated databases (CRDB)
</h3>
<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. CRDBs
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 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 type's
intent.
</p>
<p>
For more information, go here. For information, go to
<a href="/docs/latest/operate/rs/databases/active-active/develop/develop-for-aa/">
Developing with
CRDBs
</a>
.
</p>
<h3 id="redis-modules">
Redis modules
</h3>
<p>
Redis Modules enable you to extend the functionality of Redis Enterprise
Pack. One can add new data types, capabilities, etc. to tailor the
cluster to a specific use case or need. Once installed, modules benefit
from the high performance, scalability, and high availability that Redis
Enterprise is known for.
</p>
<h4 id="redis-modules-1">
Redis modules
</h4>
<p>
Redis has developed and certified the following modules for use with
Redis Enterprise Pack:
</p>
<ul>
<li>
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/search/">
RediSearch
</a>
<ul>
<li>
This module turns RS into a supercharged distributed in-memory
full-text indexing and search beast.
</li>
</ul>
</li>
<li>
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/json/">
ReJSON
</a>
<ul>
<li>
Now you have the convenience JSON as a built-in data type and
easily able to address nested data via a path.
</li>
</ul>
</li>
<li>
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/bloom/">
RedisBloom
</a>
<ul>
<li>
Enables RS to have a scalable bloom filter as a data type. Bloom
filters are probabilistic data structures that
quickly determine if values are in a set.
</li>
</ul>
</li>
</ul>
<h4 id="custom-modules">
Custom modules
</h4>
<p>
In addition, Redis Enterprise Pack provides the ability to load and use
custom
<a href="https://redislabs.com/community/redis-modules-hub/">
Redis modules
</a>
or of
your own creation.
</p>
<h2 id="support-for-docker">
Support for Docker
</h2>
<p>
Deploying and running your Redis Enterprise Software cluster on Docker
containers is supported in development systems and
available to pull from Docker hub. With the official image, you can
easily and quickly test several containers to build the scalable
and highly available cluster Redis Enterprise Software is famous for.
</p>
<p>
For more information, go to
<a href="/docs/latest/operate/rs/installing-upgrading/quickstarts/docker-quickstart/">
quick start with Redis Enterprise on
Docker
</a>
.
</p>
<h2 id="ldap-integration">
LDAP Integration
</h2>
<p>
As part of our continued emphasis on security, administrative user
accounts in Redis Enterprise Pack can now use either built-in
authentication or authenticate externally via LDAP with saslauthd. The
accounts can be used for administering resources on the cluster via
command line, Rest API, or admin console.
</p>
<p>
For more information see
<a href="/docs/latest/operate/rs/security/access-control/ldap/">
LDAP
Integration
</a>
.
</p>
<h2 id="additionalcapabilities">
AdditionalΒ capabilities
</h2>
<p>
Support for additional Redis commands and features:
</p>
<ul>
<li>
Support for Redis version 4.0.2
</li>
<li>
Support added for RHEL/CentOS 6.9 and 7.4
</li>
</ul>
<h2 id="information">
Information
</h2>
<ul>
<li>
In the node bootstrap API, the structure of the JSON has changed for
adding an external IP duringΒ the bootstrap process.
</li>
<li>
End-of-Life for RHEL/CentOS 6.5 and 6.6 have been reached, so those
versions are no longer supported.
</li>
<li>
Modules are not supported in Redis Enterprise Pack 5.0 for
RHEL/CentOS 6.x
</li>
</ul>
<h2 id="important-fixes">
Important fixes
</h2>
<h3 id="5-0-031">
5.0.0-31
</h3>
<ul>
<li>
RP9299 - Issue with reliability of metric ingress
</li>
<li>
RP9680 - Redis Enterprise Pack starting before /etc/rc.local script
executed
</li>
<li>
RP12363 - In some cases, flash drives do not mount following a
stop/start of the node
</li>
<li>
RP12493 - Allow change to debug package creation location
</li>
<li>
RP13079 - DNS doesn't change after having removed the external IP
address in some cases
</li>
<li>
RP13933 - rladmin balance sometimes shows incorrect information
</li>
<li>
RP14060 - pubsub stats aren't reflected correctly by the stats
archiver
</li>
<li>
RP14939 - Add license checks to all needed entry points in the
cluster
</li>
<li>
RP15090 - Problem in log rotate script causes other logs to not
rotate
</li>
<li>
RP15104 - rlutil check fix doesn't work sometimes
</li>
<li>
RP15130 - Fixed permission on two logs with incorrect ownership
</li>
<li>
RP15160 - Allow option to change ports for API and CM in NGINX
</li>
<li>
RP15164 - Allow unix socket folder to be configurable at build time
</li>
<li>
RP15499 - rladmin command not responding on a cluster with large
number of shards
</li>
<li>
RP15853 - When trying to add a new db the 'activate' button was
changed to 'update' and was grayed out.
</li>
<li>
RP15861 - Allow unix socket folder to be configurable at install
time
</li>
<li>
RP16115 - TTL bug with Replica Of and import
</li>
<li>
RP16447 - DMC client connection reports incorrect number of
connections to monitoring applications.
</li>
<li>
RP16481 - In some cases, resource_mgr uses incorrect directories
to compute persistent and ephemeral storage
</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/legacy-release-notes/redis-enterprise-5/"/>
<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/job_scheduler/backup_job_settings/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Backup job settings object
</h1>
<p class="text-lg -mt-5 mb-10">
Documents the backup_job_settings 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>
cron_expression
</td>
<td>
string
</td>
<td>
<a href="https://en.wikipedia.org/wiki/Cron#CRON_expression">
CRON expression
</a>
that defines the backup schedule
</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/job_scheduler/backup_job_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/kubernetes/deployment/openshift/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Deploy Redis Enterprise for Kubernetes with OpenShift
</h1>
<p class="text-lg -mt-5 mb-10">
A quick introduction to the steps necessary to get a Redis Enterprise cluster installed in your OpenShift Kubernetes cluster
</p>
<p>
The deployment of Redis Enterprise clusters is managed with the Redis Enterprise operator that you deploy in the namespace for your project.
To create a database that your application
workloads can use:
</p>
<ol>
<li>
<p>
Install the Redis Enterprise operator.
</p>
</li>
<li>
<p>
Create a Redis Enterprise CRD to describe your desired cluster.
</p>
</li>
<li>
<p>
The operator reads this cluster description and deploys the various components on your K8s cluster.
</p>
</li>
<li>
<p>
Once running, use the Redis Enterprise cluster to create a database.
</p>
</li>
<li>
<p>
The operator automatically exposes the new database as a K8s service.
</p>
</li>
</ol>
<h2 id="for-openshift-via-the-operatorhub">
For OpenShift via the OperatorHub
</h2>
<p>
To
<a href="/docs/latest/operate/kubernetes/deployment/openshift/openshift-operatorhub/">
create a database on an OpenShift 4.x cluster via the OperatorHub
</a>
you only need to have the
<a href="https://docs.openshift.com/container-platform/4.3/welcome/index.html">
OpenShift 4.x cluster installed
</a>
with at least three nodes that each meet the
<a href="/docs/latest/operate/rs/installing-upgrading/install/plan-deployment/hardware-requirements/">
minimum requirements for a development installation
</a>
.
</p>
<h2 id="for-openshift-via-the-cli">
For OpenShift via the CLI
</h2>
<p>
To
<a href="/docs/latest/operate/kubernetes/deployment/openshift/openshift-cli/">
create a database on an OpenShift cluster via the CLI
</a>
, you need:
</p>
<ol>
<li>
An
<a href="https://docs.openshift.com/container-platform/4.3/welcome/index.html">
OpenShift cluster installed
</a>
with at least three nodes that each meet the
<a href="/docs/latest/operate/rs/installing-upgrading/install/plan-deployment/hardware-requirements/">
minimum requirements for a development installation
</a>
.
</li>
<li>
The
<a href="https://kubernetes.io/docs/tasks/tools/install-kubectl/">
kubectl package installed
</a>
at version 1.9 or higher
</li>
<li>
The
<a href="https://docs.openshift.com/container-platform/4.2/cli_reference/openshift_cli/getting-started-cli.html">
OpenShift cli installed
</a>
</li>
</ol>
<h2 id="version-compatibility">
Version compatibility
</h2>
<p>
To see which version of Redis Enterprise for Kubernetes supports your OpenShift version, see
<a href="/docs/latest/operate/kubernetes/reference/supported_k8s_distributions/">
Supported Kubernetes distributions
</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/kubernetes/deployment/openshift/"/>
<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-help/.html | <section class="prose w-full py-12">
<h1 class="command-name">
CLIENT HELP
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">CLIENT 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>
@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 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 subcommands 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/client-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/gearsbuilder/execute/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Execute
</h1>
<p class="text-lg -mt-5 mb-10">
Runs a Redis command. A more flexible version of executeArray.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-java" data-lang="java"><span class="line"><span class="cl"><span class="kd">public</span> <span class="kd">static</span> <span class="n">java</span><span class="o">.</span><span class="na">lang</span><span class="o">.</span><span class="na">Object</span> <span class="n">execute</span><span class="err">β</span><span class="o">(</span><span class="n">java</span><span class="o">.</span><span class="na">lang</span><span class="o">.</span><span class="na">String</span><span class="o">...</span> <span class="n">command</span><span class="o">)</span>
</span></span></code></pre>
</div>
<p>
Runs a Redis command, similar to
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/gears-v1/jvm/classes/gearsbuilder/executearray/">
<code>
executeArray
</code>
</a>
. However, the
<code>
execute
</code>
function is more flexible. Unlike
<code>
executeArray
</code>
, the list of string arguments does not have to be an explicit
<code>
String[]
</code>
object. It allows function calls like this:
<nobr>
<code>
execute("SET", "key", "value")
</code>
.
</nobr>
</p>
<h2 id="parameters">
Parameters
</h2>
<table>
<thead>
<tr>
<th>
Name
</th>
<th>
Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
command
</td>
<td>
string
</td>
<td>
A Redis command
</td>
</tr>
</tbody>
</table>
<h2 id="returns">
Returns
</h2>
<p>
Returns the command result. It could be a string or an array of strings, depending on the command.
</p>
<h2 id="examples">
Examples
</h2>
<p>
Without
<code>
String[]
</code>
:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-java" data-lang="java"><span class="line"><span class="cl"><span class="n">GearsBuilder</span><span class="o">.</span><span class="na">execute</span><span class="o">(</span><span class="s">"SET"</span><span class="o">,</span> <span class="s">"age:maximum"</span><span class="o">,</span> <span class="s">"100"</span><span class="o">);</span>
</span></span></code></pre>
</div>
<p>
With
<code>
String[]
</code>
:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-java" data-lang="java"><span class="line"><span class="cl"><span class="n">GearsBuilder</span><span class="o">.</span><span class="na">execute</span><span class="o">(</span><span class="k">new</span> <span class="n">String</span><span class="o">[]{</span><span class="s">"SET"</span><span class="o">,</span> <span class="s">"age:maximum"</span><span class="o">,</span> <span class="s">"100"</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/oss_and_stack/stack-with-enterprise/gears-v1/jvm/classes/gearsbuilder/execute/"/>
<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.sugdel/.html | <section class="prose w-full py-12">
<h1 class="command-name">
FT.SUGDEL
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">FT.SUGDEL key string
</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(1)
</dd>
</dl>
<p>
Delete a string from a suggestion index
</p>
<p>
<a href="#examples">
Examples
</a>
</p>
<h2 id="required-arguments">
Required arguments
</h2>
<details open="">
<summary>
<code>
key
</code>
</summary>
<p>
is suggestion dictionary key.
</p>
</details>
<details open="">
<summary>
<code>
string
</code>
</summary>
<p>
is suggestion string to index.
</p>
</details>
<h2 id="return">
Return
</h2>
<p>
FT.SUGDEL returns an integer reply, 1 if the string was found and deleted, 0 otherwise.
</p>
<h2 id="examples">
Examples
</h2>
<details open="">
<summary>
<b>
Delete a string from a suggestion index
</b>
</summary>
<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.SUGDEL sug <span class="s2">"hello"</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> FT.SUGDEL sug <span class="s2">"hello"</span>
</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>
</details>
<h2 id="see-also">
See also
</h2>
<p>
<a href="/docs/latest/commands/ft.sugget/">
<code>
FT.SUGGET
</code>
</a>
|
<a href="/docs/latest/commands/ft.sugadd/">
<code>
FT.SUGADD
</code>
</a>
|
<a href="/docs/latest/commands/ft.suglen/">
<code>
FT.SUGLEN
</code>
</a>
</p>
<h2 id="related-topics">
Related topics
</h2>
<p>
<a href="/docs/latest/develop/interact/search-and-query/">
RediSearch
</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/ft.sugdel/"/>
<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/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Redis Data Integration
</h1>
<p>
This is the first General Availability version of Redis Data Integration (RDI).
</p>
<p>
RDI's purpose is to help Redis customers sync Redis Enterprise with live data from their slow disk based databases in order 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>
If you use a relational database as the system of record for your app,
you may eventually find
that its performance doesn't scale well as your userbase grows. It may be
acceptable for a few thousand users but for a few million, it can become a
major problem. If you don't have the option of abandoning the relational
database, you should consider using a fast
database, such as Redis, to cache data from read queries. Since read queries
are typically many times more common than writes, the cache will greatly
improve performance and let your app scale without a major redesign.
</p>
<p>
RDI keeps a 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 necessary.
</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>
RDI is supported with Redis database or
<a href="https://redis.com/redis-enterprise/technology/active-active-geo-distribution/">
CRDB
</a>
(Active Active Replication) targets.
</div>
</div>
<h2 id="features">
Features
</h2>
<p>
RDI provides enterprise-grade streaming data pipelines with the following features:
</p>
<ul>
<li>
<strong>
Near realtime pipeline
</strong>
- The CDC system captures changes in very short time intervals,
then ships and processes them in
<em>
micro-batches
</em>
to provide near real time updates to Redis.
</li>
<li>
<strong>
At least once guarantee
</strong>
- RDI will deliver any change to the selected data set at least
once to the target Redis database.
</li>
<li>
<strong>
Data integrity
</strong>
- RDI keeps the data change order per source table or unique key.
</li>
<li>
<strong>
High availability
</strong>
- All stateless components have hot failover or quick automatic recovery.
RDI state is always highly available using Redis Enterprise replication.
</li>
<li>
<strong>
Easy to install and operate
</strong>
- Use a self-documenting command line interface (CLI)
for all installation and day-two operations.
</li>
<li>
<strong>
No coding needed
</strong>
- Create and test your pipelines using Redis Insight.
</li>
<li>
<strong>
Data-in-transit encryption
</strong>
- RDI never persists data to disk. All data in-flight is
protected using TLS or mTLS connections.
</li>
<li>
<strong>
Observability - Metrics
</strong>
- RDI collects data processing counters at source table granularity
along with data processing performance metrics. These are available via GUI, CLI and
<a href="https://prometheus.io/">
Prometheus
</a>
endpoints.
</li>
<li>
<strong>
Observability - logs
</strong>
- RDI saves rotating logs to a single folder. They are in a JSON format,
so you can collect and process them with your favorite observability tool.
</li>
<li>
<strong>
Backpressure mechanism
</strong>
- RDI is designed to backoff writing data when the cache gets
disconnected, which prevents cascading failure. Since the change data is persisted in the source
database and Redis is very fast, RDI can easily catch up with missed changes after a short period of
disconnection. See
<a href="/docs/latest/integrate/redis-data-integration/architecture/#backpressure-mechanism">
Backpressure mechanism
</a>
for more information.
</li>
<li>
<strong>
Recovering from full failure
</strong>
- If the cache fails or gets disconnected for a long time,
RDI can reconstruct the cache data in Redis using a full snapshot of the defined dataset.
</li>
<li>
<strong>
High throughput
</strong>
- Because RDI uses Redis for staging and writes to Redis as a target,
it has very high throughput. With a single processor core and records of about 1KB in size,
RDI processes around 10,000 records per second. While taking the initial full
<em>
snapshot
</em>
of
the source database, RDI automatically scales to a configurable number of processing units,
to fill the cache as fast as possible.
</li>
</ul>
<h2 id="when-to-use-rdi">
When to use RDI
</h2>
<p>
RDI is designed to support apps that must use a disk based database as the system of record
but must also be fast and scalable. This is a common requirement for mobile and web
apps with a rapidly-growing number of users; the performance of the main database is fine at first
but it will soon struggle to handle the increasing demand without a cache.
</p>
<p>
You should use RDI when:
</p>
<ul>
<li>
You must use a slow database as the system of record for the app .
</li>
<li>
The app must always
<em>
write
</em>
its data to the slow database.
</li>
<li>
You already intend to use Redis for the app cache.
</li>
<li>
The data changes frequently in small increments.
</li>
<li>
Your app can tolerate
<em>
eventual
</em>
consistency of data in the Redis cache.
</li>
</ul>
<p>
You should
<em>
not
</em>
use RDI when:
</p>
<ul>
<li>
You are migrating an existing data set into Redis only once.
</li>
<li>
The data is updated infrequently and in big batches.
</li>
<li>
Your app needs
<em>
immediate
</em>
cache consistency rather than
<em>
eventual
</em>
consistency.
</li>
<li>
The data is ingested from two replicas of Active-Active at the same time.
</li>
<li>
The app must
<em>
write
</em>
data to the Redis cache, which then updates the source database.
</li>
<li>
Your data set will only ever be small.
</li>
</ul>
<h2 id="supported-source-databases">
Supported source databases
</h2>
<p>
RDI can capture data from any of the following sources:
</p>
<table>
<thead>
<tr>
<th style="text-align:left">
Database
</th>
<th style="text-align:left">
Versions
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">
Oracle
</td>
<td style="text-align:left">
12c, 19c, 21c
</td>
</tr>
<tr>
<td style="text-align:left">
MariaDB
</td>
<td style="text-align:left">
>= 10.5
</td>
</tr>
<tr>
<td style="text-align:left">
MySQL
</td>
<td style="text-align:left">
5.7, 8.0.x
</td>
</tr>
<tr>
<td style="text-align:left">
Postgres
</td>
<td style="text-align:left">
10, 11, 12, 13, 14, 15
</td>
</tr>
<tr>
<td style="text-align:left">
SQL Server
</td>
<td style="text-align:left">
2017, 2019
</td>
</tr>
<tr>
<td style="text-align:left">
Google Cloud SQL MySQL
</td>
<td style="text-align:left">
8.0
</td>
</tr>
<tr>
<td style="text-align:left">
Google Cloud SQL Postgres
</td>
<td style="text-align:left">
15
</td>
</tr>
<tr>
<td style="text-align:left">
Google Cloud SQL SQL Server
</td>
<td style="text-align:left">
2019
</td>
</tr>
<tr>
<td style="text-align:left">
Google Cloud AlloyDB for PostgreSQL
</td>
<td style="text-align:left">
</td>
</tr>
</tbody>
</table>
<h2 id="documentation">
Documentation
</h2>
<p>
Learn more about RDI from the other pages in this section:
</p>
<nav>
<a href="/docs/latest/integrate/redis-data-integration/quick-start-guide/">
Quickstart
</a>
<p>
Get started with a simple pipeline example
</p>
<a href="/docs/latest/integrate/redis-data-integration/installation/">
Installation
</a>
<p>
Learn how to install RDI
</p>
<a href="/docs/latest/integrate/redis-data-integration/architecture/">
Architecture
</a>
<p>
Discover the main components of RDI
</p>
<a href="/docs/latest/integrate/redis-data-integration/data-pipelines/">
Data pipelines
</a>
<p>
Learn how an RDI pipeline can transform source data before writing
</p>
<a href="/docs/latest/integrate/redis-data-integration/observability/">
Observability
</a>
<p>
Learn how to monitor RDI
</p>
<a href="/docs/latest/integrate/redis-data-integration/faq/">
FAQ
</a>
<p>
Find answers to common questions about RDI
</p>
<a href="/docs/latest/integrate/redis-data-integration/troubleshooting/">
Troubleshooting
</a>
<p>
Solve and report simple problems with RDI
</p>
<a href="/docs/latest/integrate/redis-data-integration/reference/">
Reference
</a>
<p>
View reference material for Redis Data Integration
</p>
<a href="/docs/latest/integrate/redis-data-integration/release-notes/">
Release notes
</a>
<br/>
<br/>
<a href="/docs/latest/integrate/redis-data-integration/rdi-archive/">
Preview version
</a>
<p>
Describes where to view the preview version for RDI products
</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/redis-data-integration/"/>
<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-4-0/.html | <section class="prose w-full py-12">
<h1>
Redis Data Integration release notes 1.4.0 (October 2024)
</h1>
<p class="text-lg -mt-5 mb-10">
Installation on Kubernetes with a Helm chart. Improvements for installation on VMs.
</p>
<blockquote>
<p>
This is a GA version of Redis Data Integration (RDI) that improves the installation of RDI.
</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>
<p>
Installation on
<a href="/docs/latest/integrate/redis-data-integration/installation/install-k8s/">
Kubernetes
</a>
using a
<a href="https://helm.sh/docs/">
Helm chart
</a>
. You can install on
<a href="https://docs.openshift.com/">
OpenShift
</a>
or other flavours of K8s using Helm.
</p>
</li>
<li>
<p>
Improvements for installation on VMs:
</p>
<ul>
<li>
Installer checks if the OS firewall is enabled on Ubuntu and RHEL.
</li>
<li>
Installer verifies DNS resolution from RDI components.
</li>
<li>
Installer provides log lines from components that failed during RDI deployment if a problem occurs.
</li>
<li>
Improved verification of RDI installation.
</li>
<li>
Installer verifies if the RDI database is in use by another instance of RDI.
</li>
<li>
Installer checks and warns if any
<a href="https://www.netfilter.org/projects/iptables/index.html">
<code>
iptables
</code>
</a>
rules are set.
</li>
<li>
Improved message when RDI tries to connect to its Redis database with invalid TLS keys.
</li>
</ul>
</li>
</ul>
<h2 id="limitations">
Limitations
</h2>
<p>
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.
</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/release-notes/rdi-1-4-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/rs/7.4/references/cli-utilities/rlcheck/.html | <section class="prose w-full py-12 max-w-none">
<h1>
rlcheck
</h1>
<p class="text-lg -mt-5 mb-10">
Verify nodes.
</p>
<p>
The
<code>
rlcheck
</code>
utility runs various
<a href="#tests">
tests
</a>
to check the health of a Redis Enterprise Software node and reports any discovered issues.
You can use this utility to confirm a successful installation or to verify that the node is functioning properly.
</p>
<p>
To resolve issues reported by
<code>
rlcheck
</code>
,
<a href="https://redis.com/company/support/">
contact Redis support
</a>
.
</p>
<h2 id="run-rlcheck">
Run rlcheck
</h2>
<p>
You can run
<code>
rlcheck
</code>
from the node host's command line.
The output of
<code>
rlcheck
</code>
shows information specific to the host you run it on.
</p>
<p>
To run
<code>
rlcheck
</code>
tests:
</p>
<ol>
<li>
<p>
Sign in to the Redis Enterprise Software host with an account that is a member of the
<strong>
redislabs
</strong>
operating system group.
</p>
</li>
<li>
<p>
Run:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rlcheck
</span></span></code></pre>
</div>
</li>
</ol>
<h2 id="options">
Options
</h2>
<p>
You can run
<code>
rlcheck
</code>
with the following options:
</p>
<table>
<thead>
<tr>
<th>
Option
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<nobr>
<code>
--suppress-tests TEXT
</code>
</nobr>
</td>
<td>
Skip the specified, comma-delimited list of tests. See
<a href="#tests">
Tests
</a>
for the list of tests and descriptions.
</td>
</tr>
<tr>
<td>
<nobr>
<code>
--retry-delay INTEGER
</code>
</nobr>
</td>
<td>
Delay between retries, in seconds.
</td>
</tr>
<tr>
<td>
<nobr>
<code>
--retry INTEGER
</code>
</nobr>
</td>
<td>
Number of retries after a failure.
</td>
</tr>
<tr>
<td>
<nobr>
<code>
--file-path TEXT
</code>
</nobr>
</td>
<td>
Custom path to
<code>
rlcheck.log
</code>
.
</td>
</tr>
<tr>
<td>
<nobr>
<code>
--continue-on-error
</code>
</nobr>
</td>
<td>
Continue to run all tests even if a test fails, then show all errors when complete.
</td>
</tr>
<tr>
<td>
<code>
--help
</code>
</td>
<td>
Return the list of
<code>
rlcheck
</code>
options.
</td>
</tr>
</tbody>
</table>
<h2 id="tests">
Tests
</h2>
<p>
<code>
rlcheck
</code>
runs the following tests by default:
</p>
<table>
<thead>
<tr>
<th>
Test name
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
verify_owner_and_group
</td>
<td>
Verifies the owner and group for Redis Enterprise Software files are correct.
</td>
</tr>
<tr>
<td>
verify_bootstrap_status
</td>
<td>
Verifies the local node's bootstrap process completed without errors.
</td>
</tr>
<tr>
<td>
verify_services
</td>
<td>
Verifies all Redis Enterprise Software services are running.
</td>
</tr>
<tr>
<td>
verify_port_range
</td>
<td>
Verifies the
<a href="https://www.kernel.org/doc/html/latest/networking/ip-sysctl.html">
<code>
ip_local_port_range
</code>
</a>
doesn't conflict with the ports Redis Enterprise might assign to shards.
</td>
</tr>
<tr>
<td>
verify_pidfiles
</td>
<td>
Verifies all active local shards have PID files.
</td>
</tr>
<tr>
<td>
verify_capabilities
</td>
<td>
Verifies all binaries have the proper capability bits.
</td>
</tr>
<tr>
<td>
verify_existing_sockets
</td>
<td>
Verifies sockets exist for all processes that require them.
</td>
</tr>
<tr>
<td>
verify_host_settings
</td>
<td>
Verifies the following:
<br/>
β’ Linux
<code>
overcommit_memory
</code>
setting is 1.
<br/>
β’
<code>
transparent_hugepage
</code>
is disabled.
<br/>
β’ Socket maximum connections setting
<code>
somaxconn
</code>
is 1024.
</td>
</tr>
<tr>
<td>
verify_tcp_connectivity
</td>
<td>
Verifies this node can connect to all other alive nodes.
</td>
</tr>
<tr>
<td>
verify_encrypted_gossip
</td>
<td>
Verifies gossip communication is encrypted.
</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/cli-utilities/rlcheck/"/>
<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.aliasadd.html | <section class="prose w-full py-12">
<h1 class="command-name">
FT.ALIASADD
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">FT.ALIASADD alias index
</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(1)
</dd>
</dl>
<p>
Add an alias to an index
</p>
<p>
<a href="#examples">
Examples
</a>
</p>
<h2 id="required-arguments">
Required arguments
</h2>
<details open="">
<summary>
<code>
alias index
</code>
</summary>
<p>
is alias to be added to an index.
</p>
</details>
<p>
Indexes can have more than one alias, but an alias cannot refer to another
alias.
</p>
<p>
FT.ALIASADD allows administrators to transparently redirect application queries to alternative indexes.
</p>
<h2 id="return">
Return
</h2>
<p>
FT.ALIASADD 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>
Add an alias to an index
</b>
</summary>
<p>
Add an alias to an 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.ALIASADD <span class="nb">alias</span> idx
</span></span><span class="line"><span class="cl">OK</span></span></code></pre>
</div>
<p>
Attempting to add the same alias returns a message that the alias already exists.
</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.ALIASADD <span class="nb">alias</span> idx
</span></span><span class="line"><span class="cl"><span class="o">(</span>error<span class="o">)</span> Alias already exists</span></span></code></pre>
</div>
</details>
<h2 id="see-also">
See also
</h2>
<p>
<a href="/docs/latest/commands/ft.aliasdel/">
<code>
FT.ALIASDEL
</code>
</a>
|
<a href="/docs/latest/commands/ft.aliasupdate/">
<code>
FT.ALIASUPDATE
</code>
</a>
</p>
<h2 id="related-topics">
Related topics
</h2>
<p>
<a href="/docs/latest/develop/interact/search-and-query/">
RediSearch
</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/ft.aliasadd/"/>
<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-saveconfig/.html | <section class="prose w-full py-12">
<h1 class="command-name">
CLUSTER SAVECONFIG
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">CLUSTER SAVECONFIG</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>
Forces a node to save the
<code>
nodes.conf
</code>
configuration on disk. Before to return
the command calls
<code>
fsync(2)
</code>
in order to make sure the configuration is
flushed on the computer disk.
</p>
<p>
This command is mainly used in the event a
<code>
nodes.conf
</code>
node state file
gets lost / deleted for some reason, and we want to generate it again from
scratch. It can also be useful in case of mundane alterations of a node cluster
configuration via the
<a href="/docs/latest/commands/cluster/">
<code>
CLUSTER
</code>
</a>
command in order to ensure the new configuration
is persisted on disk, however all the commands should normally be able to
auto schedule to persist the configuration on disk when it is important
to do so for the correctness of the system in the event of a restart.
</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 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-saveconfig/"/>
<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/lua-debugging/.html | <section class="prose w-full py-12">
<h1>
Debugging Lua scripts in Redis
</h1>
<p class="text-lg -mt-5 mb-10">
How to use the built-in Lua debugger
</p>
<p>
Starting with version 3.2 Redis includes a complete Lua debugger, that can be
used in order to make the task of writing complex Redis scripts much simpler.
</p>
<p>
The Redis Lua debugger, codenamed LDB, has the following important features:
</p>
<ul>
<li>
It uses a server-client model, so it's a remote debugger.
The Redis server acts as the debugging server, while the default client is
<code>
redis-cli
</code>
.
However other clients can be developed by following the simple protocol implemented by the server.
</li>
<li>
By default every new debugging session is a forked session.
It means that while the Redis Lua script is being debugged, the server does not block and is usable for development or in order to execute multiple debugging sessions in parallel.
This also means that changes are
<strong>
rolled back
</strong>
after the script debugging session finished, so that's possible to restart a new debugging session again, using exactly the same Redis data set as the previous debugging session.
</li>
<li>
An alternative synchronous (non forked) debugging model is available on demand, so that changes to the dataset can be retained.
In this mode the server blocks for the time the debugging session is active.
</li>
<li>
Support for step by step execution.
</li>
<li>
Support for static and dynamic breakpoints.
</li>
<li>
Support from logging the debugged script into the debugger console.
</li>
<li>
Inspection of Lua variables.
</li>
<li>
Tracing of Redis commands executed by the script.
</li>
<li>
Pretty printing of Redis and Lua values.
</li>
<li>
Infinite loops and long execution detection, which simulates a breakpoint.
</li>
</ul>
<h2 id="quick-start">
Quick start
</h2>
<p>
A simple way to get started with the Lua debugger is to watch this video
introduction:
</p>
<iframe allowfullscreen="" data-gtm-yt-inspected-8394893_290="true" frameborder="0" height="315" id="346791836" src="https://www.youtube.com/embed/IMvRfStaoyM?enablejsapi=1&origin=https%3A%2F%2Fredis.io" title="New Redis Lua scripts debugger: a short intro" width="560">
</iframe>
<blockquote>
<p>
Important Note: please make sure to avoid debugging Lua scripts using your Redis production server.
Use a development server instead.
Also note that using the synchronous debugging mode (which is NOT the default) results in the Redis server blocking for all the time the debugging session lasts.
</p>
</blockquote>
<p>
To start a new debugging session using
<code>
redis-cli
</code>
do the following:
</p>
<ol>
<li>
<p>
Create your script in some file with your preferred editor. Let's assume you are editing your Redis Lua script located at
<code>
/tmp/script.lua
</code>
.
</p>
</li>
<li>
<p>
Start a debugging session with:
</p>
<p>
./redis-cli --ldb --eval /tmp/script.lua
</p>
</li>
</ol>
<p>
Note that with the
<code>
--eval
</code>
option of
<code>
redis-cli
</code>
you can pass key names and arguments to the script, separated by a comma, like in the following example:
</p>
<pre tabindex="0"><code>./redis-cli --ldb --eval /tmp/script.lua mykey somekey , arg1 arg2
</code></pre>
<p>
You'll enter a special mode where
<code>
redis-cli
</code>
no longer accepts its normal
commands, but instead prints a help screen and passes the unmodified debugging
commands directly to Redis.
</p>
<p>
The only commands which are not passed to the Redis debugger are:
</p>
<ul>
<li>
<code>
quit
</code>
-- this will terminate the debugging session.
It's like removing all the breakpoints and using the
<code>
continue
</code>
debugging command.
Moreover the command will exit from
<code>
redis-cli
</code>
.
</li>
<li>
<code>
restart
</code>
-- the debugging session will restart from scratch,
<strong>
reloading the new version of the script from the file
</strong>
.
So a normal debugging cycle involves modifying the script after some debugging, and calling
<code>
restart
</code>
in order to start debugging again with the new script changes.
</li>
<li>
<code>
help
</code>
-- this command is passed to the Redis Lua debugger, that will print a list of commands like the following:
</li>
</ul>
<pre tabindex="0"><code>lua debugger> help
Redis Lua debugger help:
[h]elp Show this help.
[s]tep Run current line and stop again.
[n]ext Alias for step.
[c]ontinue Run till next breakpoint.
[l]ist List source code around current line.
[l]ist [line] List source code around [line].
line = 0 means: current position.
[l]ist [line] [ctx] In this form [ctx] specifies how many lines
to show before/after [line].
[w]hole List all source code. Alias for 'list 1 1000000'.
[p]rint Show all the local variables.
[p]rint <var> Show the value of the specified variable.
Can also show global vars KEYS and ARGV.
[b]reak Show all breakpoints.
[b]reak <line> Add a breakpoint to the specified line.
[b]reak -<line> Remove breakpoint from the specified line.
[b]reak 0 Remove all breakpoints.
[t]race Show a backtrace.
[e]val <code> Execute some Lua code (in a different callframe).
[r]edis <cmd> Execute a Redis command.
[m]axlen [len] Trim logged Redis replies and Lua var dumps to len.
Specifying zero as <len> means unlimited.
[a]bort Stop the execution of the script. In sync
mode dataset changes will be retained.
Debugger functions you can call from Lua scripts:
redis.debug() Produce logs in the debugger console.
redis.breakpoint() Stop execution as if there was a breakpoint in the
next line of code.
</code></pre>
<p>
Note that when you start the debugger it will start in
<strong>
stepping mode
</strong>
.
It will stop at the first line of the script that actually does something before executing it.
</p>
<p>
From this point you usually call
<code>
step
</code>
in order to execute the line and go to the next line.
While you step Redis will show all the commands executed by the server like in the following example:
</p>
<pre tabindex="0"><code>* Stopped at 1, stop reason = step over
-> 1 redis.call('ping')
lua debugger> step
<redis> ping
<reply> "+PONG"
* Stopped at 2, stop reason = step over
</code></pre>
<p>
The
<code>
<redis>
</code>
and
<code>
<reply>
</code>
lines show the command executed by the line just
executed, and the reply from the server. Note that this happens only in stepping mode.
If you use
<code>
continue
</code>
in order to execute the script till the next breakpoint, commands will not be dumped on the screen to prevent too much output.
</p>
<h2 id="termination-of-the-debugging-session">
Termination of the debugging session
</h2>
<p>
When the scripts terminates naturally, the debugging session ends and
<code>
redis-cli
</code>
returns in its normal non-debugging mode. You can restart the
session using the
<code>
restart
</code>
command as usual.
</p>
<p>
Another way to stop a debugging session is just interrupting
<code>
redis-cli
</code>
manually by pressing
<code>
Ctrl+C
</code>
. Note that also any event breaking the
connection between
<code>
redis-cli
</code>
and the
<code>
redis-server
</code>
will interrupt the
debugging session.
</p>
<p>
All the forked debugging sessions are terminated when the server is shut
down.
</p>
<h2 id="abbreviating-debugging-commands">
Abbreviating debugging commands
</h2>
<p>
Debugging can be a very repetitive task. For this reason every Redis
debugger command starts with a different character, and you can use the single
initial character in order to refer to the command.
</p>
<p>
So for example instead of typing
<code>
step
</code>
you can just type
<code>
s
</code>
.
</p>
<h2 id="breakpoints">
Breakpoints
</h2>
<p>
Adding and removing breakpoints is trivial as described in the online help.
Just use
<code>
b 1 2 3 4
</code>
to add a breakpoint in line 1, 2, 3, 4.
The command
<code>
b 0
</code>
removes all the breakpoints. Selected breakpoints can be
removed using as argument the line where the breakpoint we want to remove is, but prefixed by a minus sign.
So for example
<code>
b -3
</code>
removes the breakpoint from line 3.
</p>
<p>
Note that adding breakpoints to lines that Lua never executes, like declaration of local variables or comments, will not work.
The breakpoint will be added but since this part of the script will never be executed, the program will never stop.
</p>
<h2 id="dynamic-breakpoints">
Dynamic breakpoints
</h2>
<p>
Using the
<code>
breakpoint
</code>
command it is possible to add breakpoints into specific
lines. However sometimes we want to stop the execution of the program only
when something special happens. In order to do so, you can use the
<code>
redis.breakpoint()
</code>
function inside your Lua script. When called it simulates
a breakpoint in the next line that will be executed.
</p>
<pre tabindex="0"><code>if counter > 10 then redis.breakpoint() end
</code></pre>
<p>
This feature is extremely useful when debugging, so that we can avoid
continuing the script execution manually multiple times until a given condition
is encountered.
</p>
<h2 id="synchronous-mode">
Synchronous mode
</h2>
<p>
As explained previously, but default LDB uses forked sessions with rollback
of all the data changes operated by the script while it has being debugged.
Determinism is usually a good thing to have during debugging, so that successive
debugging sessions can be started without having to reset the database content
to its original state.
</p>
<p>
However for tracking certain bugs, you may want to retain the changes performed
to the key space by each debugging session. When this is a good idea you
should start the debugger using a special option,
<code>
ldb-sync-mode
</code>
, in
<code>
redis-cli
</code>
.
</p>
<pre tabindex="0"><code>./redis-cli --ldb-sync-mode --eval /tmp/script.lua
</code></pre>
<blockquote>
<p>
Note: Redis server will be unreachable during the debugging session in this mode, so use with care.
</p>
</blockquote>
<p>
In this special mode, the
<code>
abort
</code>
command can stop the script half-way taking the changes operated to the dataset.
Note that this is different compared to ending the debugging session normally.
If you just interrupt
<code>
redis-cli
</code>
the script will be fully executed and then the session terminated.
Instead with
<code>
abort
</code>
you can interrupt the script execution in the middle and start a new debugging session if needed.
</p>
<h2 id="logging-from-scripts">
Logging from scripts
</h2>
<p>
The
<code>
redis.debug()
</code>
command is a powerful debugging facility that can be
called inside the Redis Lua script in order to log things into the debug
console:
</p>
<pre tabindex="0"><code>lua debugger> list
-> 1 local a = {1,2,3}
2 local b = false
3 redis.debug(a,b)
lua debugger> continue
<debug> line 3: {1; 2; 3}, false
</code></pre>
<p>
If the script is executed outside of a debugging session,
<code>
redis.debug()
</code>
has no effects at all.
Note that the function accepts multiple arguments, that are separated by a comma and a space in the output.
</p>
<p>
Tables and nested tables are displayed correctly in order to make values simple to observe for the programmer debugging the script.
</p>
<h2 id="inspecting-the-program-state-with-print-and-eval">
Inspecting the program state with
<code>
print
</code>
and
<code>
eval
</code>
</h2>
<p>
While the
<code>
redis.debug()
</code>
function can be used in order to print values
directly from within the Lua script, often it is useful to observe the local
variables of a program while stepping or when stopped into a breakpoint.
</p>
<p>
The
<code>
print
</code>
command does just that, and performs lookup in the call frames
starting from the current one back to the previous ones, up to top-level.
This means that even if we are into a nested function inside a Lua script,
we can still use
<code>
print foo
</code>
to look at the value of
<code>
foo
</code>
in the context
of the calling function. When called without a variable name,
<code>
print
</code>
will
print all variables and their respective values.
</p>
<p>
The
<code>
eval
</code>
command executes small pieces of Lua scripts
<strong>
outside the context of the current call frame
</strong>
(evaluating inside the context of the current call frame is not possible with the current Lua internals).
However you can use this command in order to test Lua functions.
</p>
<pre tabindex="0"><code>lua debugger> e redis.sha1hex('foo')
<retval> "0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33"
</code></pre>
<h2 id="debugging-clients">
Debugging clients
</h2>
<p>
LDB uses the client-server model where the Redis server acts as a debugging server that communicates using
<a href="/docs/latest/develop/reference/protocol-spec/">
RESP
</a>
. While
<code>
redis-cli
</code>
is the default debug client, any client can be used for debugging as long as it meets one of the following conditions:
</p>
<ol>
<li>
The client provides a native interface for setting the debug mode and controlling the debug session.
</li>
<li>
The client provides an interface for sending arbitrary commands over RESP.
</li>
<li>
The client allows sending raw messages to the Redis server.
</li>
</ol>
<p>
For example, the
<a href="https://redis.com/blog/zerobrane-studio-plugin-for-redis-lua-scripts">
Redis plugin
</a>
for
<a href="http://studio.zerobrane.com/">
ZeroBrane Studio
</a>
integrates with LDB using
<a href="https://github.com/nrk/redis-lua">
redis-lua
</a>
. The following Lua code is a simplified example of how the plugin achieves that:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-Lua" data-lang="Lua"><span class="line"><span class="cl"><span class="kd">local</span> <span class="n">redis</span> <span class="o">=</span> <span class="n">require</span> <span class="s1">'redis'</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1">-- add LDB's Continue command</span>
</span></span><span class="line"><span class="cl"><span class="n">redis.commands</span><span class="p">[</span><span class="s1">'ldbcontinue'</span><span class="p">]</span> <span class="o">=</span> <span class="n">redis.command</span><span class="p">(</span><span class="s1">'C'</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1">-- script to be debugged</span>
</span></span><span class="line"><span class="cl"><span class="kd">local</span> <span class="n">script</span> <span class="o">=</span> <span class="s">[[
</span></span></span><span class="line"><span class="cl"><span class="s"> local x, y = tonumber(ARGV[1]), tonumber(ARGV[2])
</span></span></span><span class="line"><span class="cl"><span class="s"> local result = x * y
</span></span></span><span class="line"><span class="cl"><span class="s"> return result
</span></span></span><span class="line"><span class="cl"><span class="s">]]</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="kd">local</span> <span class="n">client</span> <span class="o">=</span> <span class="n">redis.connect</span><span class="p">(</span><span class="s1">'127.0.0.1'</span><span class="p">,</span> <span class="mi">6379</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="n">client</span><span class="p">:</span><span class="n">script</span><span class="p">(</span><span class="s2">"DEBUG"</span><span class="p">,</span> <span class="s2">"YES"</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="n">print</span><span class="p">(</span><span class="n">unpack</span><span class="p">(</span><span class="n">client</span><span class="p">:</span><span class="n">eval</span><span class="p">(</span><span class="n">script</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">6</span><span class="p">,</span> <span class="mi">9</span><span class="p">)))</span>
</span></span><span class="line"><span class="cl"><span class="n">client</span><span class="p">:</span><span class="n">ldbcontinue</span><span class="p">()</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/develop/interact/programmability/lua-debugging/"/>
<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/signals/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Redis signal handling
</h1>
<p class="text-lg -mt-5 mb-10">
How Redis handles common Unix signals
</p>
<p>
This document provides information about how Redis reacts to different POSIX signals such as
<code>
SIGTERM
</code>
and
<code>
SIGSEGV
</code>
.
</p>
<p>
The information in this document
<strong>
only applies to Redis version 2.6 or greater
</strong>
.
</p>
<h2 id="sigterm-and-sigint">
SIGTERM and SIGINT
</h2>
<p>
The
<code>
SIGTERM
</code>
and
<code>
SIGINT
</code>
signals tell Redis to shut down gracefully. When the server receives this signal,
it does not immediately exit. Instead, it schedules
a shutdown similar to the one performed by the
<a href="/commands/shutdown">
<code>
SHUTDOWN
</code>
</a>
command. The scheduled shutdown starts as soon as possible, specifically as long as the
current command in execution terminates (if any), with a possible additional
delay of 0.1 seconds or less.
</p>
<p>
If the server is blocked by a long-running Lua script,
kill the script with
<a href="/commands/script-kill">
<code>
SCRIPT KILL
</code>
</a>
if possible. The scheduled shutdown will
run just after the script is killed or terminates spontaneously.
</p>
<p>
This shutdown process includes the following actions:
</p>
<ul>
<li>
If there are any replicas lagging behind in replication:
<ul>
<li>
Pause clients attempting to write with
<a href="/commands/client-pause">
<code>
CLIENT PAUSE
</code>
</a>
and the
<code>
WRITE
</code>
option.
</li>
<li>
Wait up to the configured
<code>
shutdown-timeout
</code>
(default 10 seconds) for replicas to catch up with the master's replication offset.
</li>
</ul>
</li>
<li>
If a background child is saving the RDB file or performing an AOF rewrite, the child process is killed.
</li>
<li>
If the AOF is active, Redis calls the
<code>
fsync
</code>
system call on the AOF file descriptor to flush the buffers on disk.
</li>
<li>
If Redis is configured to persist on disk using RDB files, a synchronous (blocking) save is performed. Since the save is synchronous, it doesn't use any additional memory.
</li>
<li>
If the server is daemonized, the PID file is removed.
</li>
<li>
If the Unix domain socket is enabled, it gets removed.
</li>
<li>
The server exits with an exit code of zero.
</li>
</ul>
<p>
IF the RDB file can't be saved, the shutdown fails, and the server continues to run in order to ensure no data loss.
Likewise, if the user just turned on AOF, and the server triggered the first AOF rewrite in order to create the initial AOF file but this file can't be saved, the shutdown fails and the server continues to run.
Since Redis 2.6.11, no further attempt to shut down will be made unless a new
<code>
SIGTERM
</code>
is received or the
<a href="/commands/shutdown">
<code>
SHUTDOWN
</code>
</a>
command is issued.
</p>
<p>
Since Redis 7.0, the server waits for lagging replicas up to a configurable
<code>
shutdown-timeout
</code>
, 10 seconds by default, before shutting down.
This provides a best effort to minimize the risk of data loss in a situation where no save points are configured and AOF is deactivated.
Before version 7.0, shutting down a heavily loaded master node in a diskless setup was more likely to result in data loss.
To minimize the risk of data loss in such setups, trigger a manual
<a href="/commands/failover">
<code>
FAILOVER
</code>
</a>
(or
<a href="/commands/cluster-failover">
<code>
CLUSTER FAILOVER
</code>
</a>
) to demote the master to a replica and promote one of the replicas to a new master before shutting down a master node.
</p>
<h2 id="sigsegv-sigbus-sigfpe-and-sigill">
SIGSEGV, SIGBUS, SIGFPE and SIGILL
</h2>
<p>
The following signals are handled as a Redis crash:
</p>
<ul>
<li>
SIGSEGV
</li>
<li>
SIGBUS
</li>
<li>
SIGFPE
</li>
<li>
SIGILL
</li>
</ul>
<p>
Once one of these signals is trapped, Redis stops any current operation and performs the following actions:
</p>
<ul>
<li>
Adds a bug report to the log file. This includes a stack trace, dump of registers, and information about the state of clients.
</li>
<li>
Since Redis 2.8, a fast memory test is performed as a first check of the reliability of the crashing system.
</li>
<li>
If the server was daemonized, the PID file is removed.
</li>
<li>
Finally the server unregisters its own signal handler for the received signal and resends the same signal to itself to make sure that the default action is performed, such as dumping the core on the file system.
</li>
</ul>
<h2 id="what-happens-when-a-child-process-gets-killed">
What happens when a child process gets killed
</h2>
<p>
When the child performing the Append Only File rewrite gets killed by a signal,
Redis handles this as an error and discards the (probably partial or corrupted)
AOF file. It will attempt the rewrite again later.
</p>
<p>
When the child performing an RDB save is killed, Redis handles the
condition as a more severe error. While the failure of an
AOF file rewrite can cause AOF file enlargement, failed RDB file
creation reduces durability.
</p>
<p>
As a result of the child producing the RDB file being killed by a signal,
or when the child exits with an error (non zero exit code), Redis enters
a special error condition where no further write command is accepted.
</p>
<ul>
<li>
Redis will continue to reply to read commands.
</li>
<li>
Redis will reply to all write commands with a
<code>
MISCONFIG
</code>
error.
</li>
</ul>
<p>
This error condition will persist until it becomes possible to create an RDB file successfully.
</p>
<h2 id="kill-the-rdb-file-without-errors">
Kill the RDB file without errors
</h2>
<p>
Sometimes the user may want to kill the RDB-saving child process without
generating an error. Since Redis version 2.6.10, this can be done using the signal
<code>
SIGUSR1
</code>
. This signal is handled in a special way:
it kills the child process like any other signal, but the parent process will
not detect this as a critical error and will continue to serve write
requests.
</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/signals/"/>
<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/data-pipelines/prepare-dbs/my-sql-mariadb/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Prepare MySQL/MariaDB for RDI
</h1>
<p class="text-lg -mt-5 mb-10">
Prepare MySQL and MariaDB databases to work with RDI
</p>
<p>
Follow the steps in the sections below to set up a MySQL or MariaDB
database for CDC with Debezium.
</p>
<h2 id="1-create-a-cdc-user">
1. Create a CDC user
</h2>
<p>
The Debezium connector needs a user account to connect to MySQL/MariaDB. This
user must have appropriate permissions on all databases where you want Debezium
to capture changes.
</p>
<p>
Run the
<a href="https://dev.mysql.com/doc/refman/8.3/en/mysql.html">
MySQL CLI client
</a>
and then run the following commands:
</p>
<ol>
<li>
<p>
Create the CDC user:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sql" data-lang="sql"><span class="line"><span class="cl"><span class="n">mysql</span><span class="o">></span><span class="w"> </span><span class="k">CREATE</span><span class="w"> </span><span class="k">USER</span><span class="w"> </span><span class="s1">'user'</span><span class="o">@</span><span class="s1">'localhost'</span><span class="w"> </span><span class="n">IDENTIFIED</span><span class="w"> </span><span class="k">BY</span><span class="w"> </span><span class="s1">'password'</span><span class="p">;</span><span class="w">
</span></span></span></code></pre>
</div>
</li>
<li>
<p>
Grant the required permissions to the user:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sql" data-lang="sql"><span class="line"><span class="cl"><span class="o">#</span><span class="w"> </span><span class="n">MySQL</span><span class="w"> </span><span class="o"><</span><span class="n">v8</span><span class="p">.</span><span class="mi">0</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="n">mysql</span><span class="o">></span><span class="w"> </span><span class="k">GRANT</span><span class="w"> </span><span class="k">SELECT</span><span class="p">,</span><span class="w"> </span><span class="n">RELOAD</span><span class="p">,</span><span class="w"> </span><span class="k">SHOW</span><span class="w"> </span><span class="n">DATABASES</span><span class="p">,</span><span class="w"> </span><span class="n">REPLICATION</span><span class="w"> </span><span class="n">SLAVE</span><span class="p">,</span><span class="w"> </span><span class="n">REPLICATION</span><span class="w"> </span><span class="n">CLIENT</span><span class="w"> </span><span class="k">ON</span><span class="w"> </span><span class="o">*</span><span class="p">.</span><span class="o">*</span><span class="w"> </span><span class="k">TO</span><span class="w"> </span><span class="s1">'user'</span><span class="w"> </span><span class="n">IDENTIFIED</span><span class="w"> </span><span class="k">BY</span><span class="w"> </span><span class="s1">'password'</span><span class="p">;</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="o">#</span><span class="w"> </span><span class="n">MySQL</span><span class="w"> </span><span class="n">v8</span><span class="p">.</span><span class="mi">0</span><span class="w"> </span><span class="k">and</span><span class="w"> </span><span class="n">above</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="n">mysql</span><span class="o">></span><span class="w"> </span><span class="k">GRANT</span><span class="w"> </span><span class="k">SELECT</span><span class="p">,</span><span class="w"> </span><span class="n">RELOAD</span><span class="p">,</span><span class="w"> </span><span class="k">SHOW</span><span class="w"> </span><span class="n">DATABASES</span><span class="p">,</span><span class="w"> </span><span class="n">REPLICATION</span><span class="w"> </span><span class="n">SLAVE</span><span class="p">,</span><span class="w"> </span><span class="n">REPLICATION</span><span class="w"> </span><span class="n">CLIENT</span><span class="w"> </span><span class="k">ON</span><span class="w"> </span><span class="o">*</span><span class="p">.</span><span class="o">*</span><span class="w"> </span><span class="k">TO</span><span class="w"> </span><span class="s1">'user'</span><span class="o">@</span><span class="s1">'localhost'</span><span class="p">;</span><span class="w">
</span></span></span></code></pre>
</div>
</li>
<li>
<p>
Finalize the user's permissions:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sql" data-lang="sql"><span class="line"><span class="cl"><span class="n">mysql</span><span class="o">></span><span class="w"> </span><span class="n">FLUSH</span><span class="w"> </span><span class="k">PRIVILEGES</span><span class="p">;</span><span class="w">
</span></span></span></code></pre>
</div>
</li>
</ol>
<h2 id="2-enable-the-binlog">
2. Enable the binlog
</h2>
<p>
You must enable binary logging for MySQL replication. The binary logs record transaction
updates so that replication tools can propagate changes. You will need administrator
privileges to do this.
</p>
<p>
First, you should check whether the
<code>
log-bin
</code>
option is already set to
<code>
ON
</code>
, using
the following query:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sql" data-lang="sql"><span class="line"><span class="cl"><span class="o">//</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">MySql</span><span class="w"> </span><span class="mi">5</span><span class="p">.</span><span class="n">x</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="n">mysql</span><span class="o">></span><span class="w"> </span><span class="k">SELECT</span><span class="w"> </span><span class="n">variable_value</span><span class="w"> </span><span class="k">as</span><span class="w"> </span><span class="s2">"BINARY LOGGING STATUS (log-bin) ::"</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="k">FROM</span><span class="w"> </span><span class="n">information_schema</span><span class="p">.</span><span class="n">global_variables</span><span class="w"> </span><span class="k">WHERE</span><span class="w"> </span><span class="n">variable_name</span><span class="o">=</span><span class="s1">'log_bin'</span><span class="p">;</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="o">//</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">MySql</span><span class="w"> </span><span class="mi">8</span><span class="p">.</span><span class="n">x</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="n">mysql</span><span class="o">></span><span class="w"> </span><span class="k">SELECT</span><span class="w"> </span><span class="n">variable_value</span><span class="w"> </span><span class="k">as</span><span class="w"> </span><span class="s2">"BINARY LOGGING STATUS (log-bin) ::"</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="k">FROM</span><span class="w"> </span><span class="n">performance_schema</span><span class="p">.</span><span class="n">global_variables</span><span class="w"> </span><span class="k">WHERE</span><span class="w"> </span><span class="n">variable_name</span><span class="o">=</span><span class="s1">'log_bin'</span><span class="p">;</span><span class="w">
</span></span></span></code></pre>
</div>
<p>
If
<code>
log-bin
</code>
is
<code>
OFF
</code>
then add the following properties to your
server configuration file:
</p>
<pre tabindex="0"><code>server-id = 223344 # Querying variable is called server_id, e.g. SELECT variable_value FROM information_schema.global_variables WHERE variable_name='server_id';
log_bin = mysql-bin
binlog_format = ROW
binlog_row_image = FULL
binlog_expire_logs_seconds = 864000
</code></pre>
<p>
You can run the query above again to check that
<code>
log-bin
</code>
is now
<code>
ON
</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">
Note:
</div>
If you are using
<a href="https://aws.amazon.com/rds/mysql/">
Amazon RDS for MySQL
</a>
then
you must enable automated backups for your database before it can use binary logging.
If you don't enable automated backups first then the settings above will have no
effect.
</div>
</div>
<h2 id="3-enable-gtids">
3. Enable GTIDs
</h2>
<p>
<em>
Global transaction identifiers (GTIDs)
</em>
uniquely identify the transactions that occur
on a server within a cluster. You don't strictly need to use them with a Debezium MySQL
connector, but you might find it helpful to enable them.
Use GTIDs to simplify replication and to confirm that the primary and replica servers are
consistent.
</p>
<p>
GTIDs are available in MySQL 5.6.5 and later. See the
<a href="https://dev.mysql.com/doc/refman/8.0/en/replication-options-gtids.html#option_mysqld_gtid-mode">
MySQL documentation about GTIDs
</a>
for more information.
</p>
<p>
Follow the steps below to enable GTIDs. You will need access to the MySQL configuration file
to do this.
</p>
<ol>
<li>
<p>
Enable
<code>
gtid_mode
</code>
:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sql" data-lang="sql"><span class="line"><span class="cl"><span class="n">mysql</span><span class="o">></span><span class="w"> </span><span class="n">gtid_mode</span><span class="o">=</span><span class="k">ON</span><span class="w">
</span></span></span></code></pre>
</div>
</li>
<li>
<p>
Enable
<code>
enforce_gtid_consistency
</code>
:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sql" data-lang="sql"><span class="line"><span class="cl"><span class="n">mysql</span><span class="o">></span><span class="w"> </span><span class="n">enforce_gtid_consistency</span><span class="o">=</span><span class="k">ON</span><span class="w">
</span></span></span></code></pre>
</div>
</li>
<li>
<p>
Confirm the changes:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sql" data-lang="sql"><span class="line"><span class="cl"><span class="n">mysql</span><span class="o">></span><span class="w"> </span><span class="k">show</span><span class="w"> </span><span class="k">global</span><span class="w"> </span><span class="n">variables</span><span class="w"> </span><span class="k">like</span><span class="w"> </span><span class="s1">'%GTID%'</span><span class="p">;</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="o">>>></span><span class="w"> </span><span class="k">Result</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="o">+</span><span class="c1">--------------------------+-------+
</span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="o">|</span><span class="w"> </span><span class="n">Variable_name</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">Value</span><span class="w"> </span><span class="o">|</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="o">+</span><span class="c1">--------------------------+-------+
</span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="o">|</span><span class="w"> </span><span class="n">enforce_gtid_consistency</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="k">ON</span><span class="w"> </span><span class="o">|</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="o">|</span><span class="w"> </span><span class="n">gtid_mode</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="k">ON</span><span class="w"> </span><span class="o">|</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="o">+</span><span class="c1">--------------------------+-------+
</span></span></span></code></pre>
</div>
</li>
</ol>
<h2 id="4-configure-session-timeouts">
4. Configure session timeouts
</h2>
<p>
RDI captures an initial
<em>
snapshot
</em>
of the source database when it begins
the CDC process (see the
<a href="/docs/latest/integrate/redis-data-integration/architecture/#overview">
architecture overview
</a>
for more information). If your database is large then the connection could time out
while RDI is reading the data for the snapshot. You can prevent this using the
<code>
interactive_timeout
</code>
and
<code>
wait_timeout
</code>
settings in your MySQL configuration file:
</p>
<pre tabindex="0"><code>mysql> interactive_timeout=<duration-in-seconds>
mysql> wait_timeout=<duration-in-seconds>
</code></pre>
<h2 id="5-enable-query-log-events">
5. Enable query log events
</h2>
<p>
If you want to see the original SQL statement for each binlog event then you should
enable
<code>
binlog_rows_query_log_events
</code>
(MySQL configuration) or
<code>
binlog_annotate_row_events
</code>
(MariaDB configuration):
</p>
<pre tabindex="0"><code>mysql> binlog_rows_query_log_events=ON
mariadb> binlog_annotate_row_events=ON
</code></pre>
<p>
This option is available in MySQL 5.6 and later.
</p>
<h2 id="6-check-binlog_row_value_options">
6. Check
<code>
binlog_row_value_options
</code>
</h2>
<p>
You should check the value of the
<code>
binlog_row_value_options
</code>
variable
to ensure it is not set to
<code>
PARTIAL_JSON
</code>
. If it
<em>
is
</em>
set to
<code>
PARTIAL_JSON
</code>
then Debezium might not be able to see
<code>
UPDATE
</code>
events.
</p>
<p>
Check the current value of the variable with the following command:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sql" data-lang="sql"><span class="line"><span class="cl"><span class="n">mysql</span><span class="o">></span><span class="w"> </span><span class="k">show</span><span class="w"> </span><span class="k">global</span><span class="w"> </span><span class="n">variables</span><span class="w"> </span><span class="k">where</span><span class="w"> </span><span class="n">variable_name</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s1">'binlog_row_value_options'</span><span class="p">;</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="o">>>></span><span class="w"> </span><span class="k">Result</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="o">+</span><span class="c1">--------------------------+-------+
</span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="o">|</span><span class="w"> </span><span class="n">Variable_name</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">Value</span><span class="w"> </span><span class="o">|</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="o">+</span><span class="c1">--------------------------+-------+
</span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="o">|</span><span class="w"> </span><span class="n">binlog_row_value_options</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="o">|</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="o">+</span><span class="c1">--------------------------+-------+
</span></span></span></code></pre>
</div>
<p>
If the value is
<code>
PARTIAL_JSON
</code>
then you should unset the variable:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sql" data-lang="sql"><span class="line"><span class="cl"><span class="n">mysql</span><span class="o">></span><span class="w"> </span><span class="k">set</span><span class="w"> </span><span class="o">@@</span><span class="k">global</span><span class="p">.</span><span class="n">binlog_row_value_options</span><span class="o">=</span><span class="s2">""</span><span class="w"> </span><span class="p">;</span><span class="w">
</span></span></span></code></pre>
</div>
<h2 id="7-configuration-is-complete">
7. Configuration is complete
</h2>
<p>
After following the steps above, your MySQL/MariaDB database is ready
for Debezium to use.
</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/data-pipelines/prepare-dbs/my-sql-mariadb/"/>
<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/readers/keysonlyreader/.html | <section class="prose w-full py-12 max-w-none">
<h1>
KeysOnlyReader
</h1>
<p class="text-lg -mt-5 mb-10">
Gets key names from a database.
</p>
<p>
The
<code>
KeysOnlyReader
</code>
only extracts the key names from a database.
</p>
<h2 id="constructors">
Constructors
</h2>
<p>
You can use one of these constructors to create a new
<code>
KeysOnlyReader
</code>
object:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-java" data-lang="java"><span class="line"><span class="cl"><span class="kd">public</span> <span class="nf">KeysOnlyReader</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="nf">KeysOnlyReader</span><span class="o">(</span><span class="kt">int</span> <span class="n">scanSize</span><span class="o">,</span> <span class="n">String</span> <span class="n">pattern</span><span class="o">)</span>
</span></span></code></pre>
</div>
<h2 id="parameters">
Parameters
</h2>
<table>
<thead>
<tr>
<th>
Name
</th>
<th>
Type
</th>
<th>
Default value
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
pattern
</td>
<td>
string
</td>
<td>
"*" (match all keys)
</td>
<td>
Get all keys that match this pattern
</td>
</tr>
<tr>
<td>
scanSize
</td>
<td>
integer
</td>
<td>
10000
</td>
<td>
The scan command's size limit
</td>
</tr>
</tbody>
</table>
<h2 id="output-records">
Output records
</h2>
<p>
Each output record is a string that represents the key's name.
</p>
<h2 id="examples">
Examples
</h2>
<p>
Get all keys in the database:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-java" data-lang="java"><span class="line"><span class="cl"><span class="n">KeysOnlyReader</span> <span class="n">reader</span> <span class="o">=</span> <span class="k">new</span> <span class="n">KeysOnlyReader</span><span class="o">();</span>
</span></span></code></pre>
</div>
<p>
Only get keys that start with "user:":
</p>
<div class="highlight">
<pre class="chroma"><code class="language-java" data-lang="java"><span class="line"><span class="cl"><span class="n">KeysOnlyReader</span> <span class="n">reader</span> <span class="o">=</span> <span class="k">new</span> <span class="n">KeysOnlyReader</span><span class="o">(</span><span class="mi">1000</span><span class="o">,</span> <span class="s">"user:*"</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/oss_and_stack/stack-with-enterprise/gears-v1/jvm/classes/readers/keysonlyreader/"/>
<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.nummultby/.html | <section class="prose w-full py-12">
<h1 class="command-name">
JSON.NUMMULTBY
<span class="text-base">
(deprecated)
</span>
</h1>
<div class="border-l-8 pl-4">
<p>
As of JSON version 2.0, this command is regarded as deprecated.
</p>
</div>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">JSON.NUMMULTBY 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>
Multiply 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>
value
</code>
</summary>
<p>
is number value to multiply.
</p>
</details>
<h2 id="optional-arguments">
Optional arguments
</h2>
<details open="">
<summary>
<code>
path
</code>
</summary>
<p>
is JSONPath to specify. Default is root
<code>
$
</code>
.
</p>
</details>
<h2 id="return">
Return
</h2>
<p>
JSON.NUMMULTBY returns a bulk string reply specified as a stringified new values for each path, or
<code>
nil
</code>
element 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>
<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><span class="line"><span class="cl">redis> JSON.NUMMULTBY doc $.a <span class="m">2</span>
</span></span><span class="line"><span class="cl"><span class="s2">"[null]"</span>
</span></span><span class="line"><span class="cl">redis> JSON.NUMMULTBY doc $..a <span class="m">2</span>
</span></span><span class="line"><span class="cl"><span class="s2">"[null,4,10,null]"</span></span></span></code></pre>
</div>
<h2 id="see-also">
See also
</h2>
<p>
<a href="/docs/latest/commands/json.numincrby/">
<code>
JSON.NUMINCRBY
</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.nummultby/"/>
<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/query/vector-search/.html | <section class="prose w-full py-12">
<h1>
Vector search
</h1>
<p class="text-lg -mt-5 mb-10">
Query for data based on vector embeddings
</p>
<p>
This article gives you a good overview of how to perform vector search queries with Redis Stack. See the
<a href="/docs/latest/develop/get-started/vector-database/">
Redis as a vector database quick start guide
</a>
for more information about Redis as a vector database. You can also find more detailed information about all the parameters in the
<a href="/docs/latest/develop/interact/search-and-query/advanced-concepts/vectors/">
vector reference documentation
</a>
.
</p>
<p>
A vector search query on a vector field allows you to find all vectors in a vector space that are close to a given vector. You can query for the k-nearest neighbors or vectors within a given radius.
</p>
<p>
The examples in this article use a schema with the following fields:
</p>
<table>
<thead>
<tr>
<th>
JSON field
</th>
<th>
Field alias
</th>
<th>
Field type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>
$.description
</code>
</td>
<td>
<code>
description
</code>
</td>
<td>
<code>
TEXT
</code>
</td>
<td>
The description of a bicycle as unstructured text
</td>
</tr>
<tr>
<td>
<code>
$.description_embeddings
</code>
</td>
<td>
<code>
vector
</code>
</td>
<td>
<code>
VECTOR
</code>
</td>
<td>
The vector that a machine learning model derived from the description text
</td>
</tr>
</tbody>
</table>
<h2 id="k-neareast-neighbours-knn">
K-neareast neighbours (KNN)
</h2>
<p>
The Redis command
<a href="/docs/latest/commands/ft.search">
FT.SEARCH
</a>
takes the index name, the query string, and additional query parameters as arguments. You need to pass the number of nearest neighbors, the vector field name, and the vector's binary representation in the following way:
</p>
<pre tabindex="0"><code>FT.SEARCH index "(*)=>[KNN num_neighbours @field $vector]" PARAMS 2 vector "binary_data" DIALECT 2
</code></pre>
<p>
Here is a more detailed explanation of this query:
</p>
<ol>
<li>
<strong>
Pre-filter
</strong>
: The first expression within the round brackets is a filter. It allows you to decide which vectors should be taken into account before the vector search is performed. The expression
<code>
(*)
</code>
means that all vectors are considered.
</li>
<li>
<strong>
Next step
</strong>
: The
<code>
=>
</code>
arrow indicates that the pre-filtering happens before the vector search.
</li>
<li>
<strong>
KNN query
</strong>
: The expression
<code>
[KNN num_neighbours @field $vector]
</code>
is a parameterized query expression. A parameter name is indicated by the
<code>
$
</code>
prefix within the query string.
</li>
<li>
<strong>
Vector binary data
</strong>
: You need to use the
<code>
PARAMS
</code>
argument to substitute
<code>
$vector
</code>
with the binary representation of the vector. The value
<code>
2
</code>
indicates that
<code>
PARAMS
</code>
is followed by two arguments, the parameter name
<code>
vector
</code>
and the parameter value.
</li>
<li>
<strong>
Dialect
</strong>
: The vector search feature has been available since version two of the query dialect.
</li>
</ol>
<p>
You can read more about the
<code>
PARAMS
</code>
argument in the
<a href="/docs/latest/commands/ft.search">
FT.SEARCH
</a>
command reference.
</p>
<p>
The following example shows you how to query for three bikes based on their description embeddings, and by using the field alias
<code>
vector
</code>
. The result is returned in ascending order based on the distance. You can see that the query only returns the fields
<code>
__vector_score
</code>
and
<code>
description
</code>
. The field
<code>
__vector_score
</code>
is present by default. Because you can have multiple vector fields in your schema, the vector score field name depends on the name of the vector field. If you change the field name
<code>
@vector
</code>
to
<code>
@foo
</code>
, the score field name changes to
<code>
__foo_score
</code>
.
</p>
<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="query_vector-stepvector1">
<input checked="" class="radiotab w-0 h-0" data-lang="redis-cli" id="redis-cli_query_vector-stepvector1" name="query_vector-stepvector1" 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_query_vector-stepvector1" title="Open example">
>_ Redis CLI
</label>
<div aria-labelledby="tab-query_vector-stepvector1" class="panel order-last hidden w-full mt-0 relative" id="panel_redis-cli_query_vector-stepvector1" role="tabpanel" tabindex="0">
<div class="highlight">
<pre class="chroma"><code class="language-plaintext" data-lang="plaintext"><span class="line hl"><span class="cl">FT.SEARCH idx:bikes_vss "(*)=>[KNN 3 @vector $query_vector]" PARAMS 2 "query_vector" "Z\xf8\x15:\xf23\xa1\xbfZ\x1dI>\r\xca9..." SORTBY "__vector_score" ASC RETURN 2 "__vector_score" "description" DIALECT 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_query_vector-stepvector1')" 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="javascript" id="Nodejs_query_vector-stepvector1" name="query_vector-stepvector1" 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_query_vector-stepvector1" title="Open example">
Node.js
</label>
<div aria-labelledby="tab-query_vector-stepvector1" class="panel order-last hidden w-full mt-0 relative" id="panel_Nodejs_query_vector-stepvector1" role="tabpanel" tabindex="0">
<div class="highlight">
<pre class="chroma"><code class="language-javascript" data-lang="javascript"><span class="line"><span class="cl"><span class="kr">import</span> <span class="nx">assert</span> <span class="nx">from</span> <span class="s1">'node:assert'</span><span class="p">;</span>
</span></span><span class="line"><span class="cl"><span class="kr">import</span> <span class="nx">fs</span> <span class="nx">from</span> <span class="s1">'node:fs'</span><span class="p">;</span>
</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 class="kr">import</span> <span class="p">{</span> <span class="nx">SchemaFieldTypes</span><span class="p">,</span> <span class="nx">VectorAlgorithms</span> <span class="p">}</span> <span class="nx">from</span> <span class="s1">'@redis/search'</span><span class="p">;</span>
</span></span><span class="line"><span class="cl"><span class="kr">import</span> <span class="p">{</span> <span class="nx">pipeline</span> <span class="p">}</span> <span class="nx">from</span> <span class="s1">'@xenova/transformers'</span><span class="p">;</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="kd">function</span> <span class="nx">float32Buffer</span><span class="p">(</span><span class="nx">arr</span><span class="p">)</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="kr">const</span> <span class="nx">floatArray</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Float32Array</span><span class="p">(</span><span class="nx">arr</span><span class="p">);</span>
</span></span><span class="line"><span class="cl"> <span class="kr">const</span> <span class="nx">float32Buffer</span> <span class="o">=</span> <span class="nx">Buffer</span><span class="p">.</span><span class="nx">from</span><span class="p">(</span><span class="nx">floatArray</span><span class="p">.</span><span class="nx">buffer</span><span class="p">);</span>
</span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="nx">float32Buffer</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="kr">async</span> <span class="kd">function</span> <span class="nx">embedText</span><span class="p">(</span><span class="nx">sentence</span><span class="p">)</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="kd">let</span> <span class="nx">modelName</span> <span class="o">=</span> <span class="s1">'Xenova/all-MiniLM-L6-v2'</span><span class="p">;</span>
</span></span><span class="line"><span class="cl"> <span class="kd">let</span> <span class="nx">pipe</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">pipeline</span><span class="p">(</span><span class="s1">'feature-extraction'</span><span class="p">,</span> <span class="nx">modelName</span><span class="p">);</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="kd">let</span> <span class="nx">vectorOutput</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">pipe</span><span class="p">(</span><span class="nx">sentence</span><span class="p">,</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nx">pooling</span><span class="o">:</span> <span class="s1">'mean'</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nx">normalize</span><span class="o">:</span> <span class="kc">true</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="kr">const</span> <span class="nx">embedding</span> <span class="o">=</span> <span class="nb">Object</span><span class="p">.</span><span class="nx">values</span><span class="p">(</span><span class="nx">vectorOutput</span><span class="o">?</span><span class="p">.</span><span class="nx">data</span><span class="p">);</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="nx">embedding</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="kd">let</span> <span class="nx">query</span> <span class="o">=</span> <span class="s1">'Bike for small kids'</span><span class="p">;</span>
</span></span><span class="line"><span class="cl"><span class="kd">let</span> <span class="nx">vector_query</span> <span class="o">=</span> <span class="nx">float32Buffer</span><span class="p">(</span><span class="kr">await</span> <span class="nx">embedText</span><span class="p">(</span><span class="s1">'That is a very happy person'</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"><span class="cl"><span class="c1">// create index
</span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">ft</span><span class="p">.</span><span class="nx">create</span><span class="p">(</span><span class="s1">'idx:bicycle'</span><span class="p">,</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="s1">'$.description'</span><span class="o">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nx">type</span><span class="o">:</span> <span class="nx">SchemaFieldTypes</span><span class="p">.</span><span class="nx">TEXT</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nx">AS</span><span class="o">:</span> <span class="s1">'description'</span>
</span></span><span class="line"><span class="cl"> <span class="p">},</span>
</span></span><span class="line"><span class="cl"> <span class="s1">'$.description_embeddings'</span><span class="o">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nx">type</span><span class="o">:</span> <span class="nx">SchemaFieldTypes</span><span class="p">.</span><span class="nx">VECTOR</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nx">TYPE</span><span class="o">:</span> <span class="s1">'FLOAT32'</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nx">ALGORITHM</span><span class="o">:</span> <span class="nx">VectorAlgorithms</span><span class="p">.</span><span class="nx">FLAT</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nx">DIM</span><span class="o">:</span> <span class="mi">384</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nx">DISTANCE_METRIC</span><span class="o">:</span> <span class="s1">'COSINE'</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nx">AS</span><span class="o">:</span> <span class="s1">'vector'</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 class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nx">ON</span><span class="o">:</span> <span class="s1">'JSON'</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nx">PREFIX</span><span class="o">:</span> <span class="s1">'bicycle:'</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="c1">// load data
</span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="kr">const</span> <span class="nx">bicycles</span> <span class="o">=</span> <span class="nx">JSON</span><span class="p">.</span><span class="nx">parse</span><span class="p">(</span><span class="nx">fs</span><span class="p">.</span><span class="nx">readFileSync</span><span class="p">(</span><span class="s1">'data/query_vector.json'</span><span class="p">,</span> <span class="s1">'utf8'</span><span class="p">));</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="kr">await</span> <span class="nb">Promise</span><span class="p">.</span><span class="nx">all</span><span class="p">(</span>
</span></span><span class="line"><span class="cl"> <span class="nx">bicycles</span><span class="p">.</span><span class="nx">map</span><span class="p">((</span><span class="nx">bicycle</span><span class="p">,</span> <span class="nx">bid</span><span class="p">)</span> <span class="p">=></span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="nx">client</span><span class="p">.</span><span class="nx">json</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="sb">`bicycle:</span><span class="si">${</span><span class="nx">bid</span><span class="si">}</span><span class="sb">`</span><span class="p">,</span> <span class="s1">'$'</span><span class="p">,</span> <span class="nx">bicycle</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></span><span class="line hl"><span class="cl"><span class="kr">const</span> <span class="nx">res1</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">ft</span><span class="p">.</span><span class="nx">search</span><span class="p">(</span><span class="s1">'idx:bicycle'</span><span class="p">,</span>
</span></span><span class="line hl"><span class="cl"> <span class="s1">'*=>[KNN 3 @vector $query_vector AS score]'</span><span class="p">,</span> <span class="p">{</span>
</span></span><span class="line hl"><span class="cl"> <span class="nx">PARAMS</span><span class="o">:</span> <span class="p">{</span> <span class="nx">query_vector</span><span class="o">:</span> <span class="nx">vector_query</span> <span class="p">},</span>
</span></span><span class="line hl"><span class="cl"> <span class="nx">RETURN</span><span class="o">:</span> <span class="p">[</span><span class="s1">'description'</span><span class="p">],</span>
</span></span><span class="line hl"><span class="cl"> <span class="nx">DIALECT</span><span class="o">:</span> <span class="mi">2</span>
</span></span><span class="line hl"><span class="cl"> <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 class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res1</span><span class="p">.</span><span class="nx">total</span><span class="p">);</span> <span class="c1">// >>> 3
</span></span></span><span class="line hl"><span class="cl"><span class="c1"></span><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res1</span><span class="p">);</span> <span class="c1">// >>>
</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="c1">// total: 3,
</span></span></span><span class="line hl"><span class="cl"><span class="c1">// documents: [
</span></span></span><span class="line hl"><span class="cl"><span class="c1">// { id: 'bicycle:0', value: [Object: null prototype] {} },
</span></span></span><span class="line hl"><span class="cl"><span class="c1">// { id: 'bicycle:2', value: [Object: null prototype] {} },
</span></span></span><span class="line hl"><span class="cl"><span class="c1">// { id: 'bicycle:9', value: [Object: null prototype] {} }
</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="c1">//}
</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">res2</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">ft</span><span class="p">.</span><span class="nx">search</span><span class="p">(</span><span class="s1">'idx:bicycle'</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s1">'@vector:[VECTOR_RANGE 0.9 $query_vector]=>{$YIELD_DISTANCE_AS: vector_dist}'</span><span class="p">,</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nx">PARAMS</span><span class="o">:</span> <span class="p">{</span> <span class="nx">query_vector</span><span class="o">:</span> <span class="nx">vector_query</span> <span class="p">},</span>
</span></span><span class="line"><span class="cl"> <span class="nx">SORTBY</span><span class="o">:</span> <span class="s1">'vector_dist'</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nx">RETURN</span><span class="o">:</span> <span class="p">[</span><span class="s1">'vector_dist'</span><span class="p">,</span> <span class="s1">'description'</span><span class="p">],</span>
</span></span><span class="line"><span class="cl"> <span class="nx">DIALECT</span><span class="o">:</span> <span class="mi">2</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">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res2</span><span class="p">.</span><span class="nx">total</span><span class="p">);</span> <span class="c1">// >>> 1
</span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res2</span><span class="p">);</span> <span class="c1">// >>>
</span></span></span><span class="line"><span class="cl"><span class="c1">//{
</span></span></span><span class="line"><span class="cl"><span class="c1">// total: 1,
</span></span></span><span class="line"><span class="cl"><span class="c1">// documents: [ { id: 'bicycle:0', value: [Object: null prototype] } ]
</span></span></span><span class="line"><span class="cl"><span class="c1">//}
</span></span></span><span class="line"><span class="cl"><span class="c1"></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_query_vector-stepvector1')" 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_query_vector-stepvector1" 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/query-vector.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="python" id="RedisVL_query_vector-stepvector1" name="query_vector-stepvector1" 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="RedisVL_query_vector-stepvector1" title="Open example">
RedisVL
</label>
<div aria-labelledby="tab-query_vector-stepvector1" class="panel order-last hidden w-full mt-0 relative" id="panel_RedisVL_query_vector-stepvector1" 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">json</span>
</span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">warnings</span>
</span></span><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 class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
</span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redisvl.index</span> <span class="kn">import</span> <span class="n">SearchIndex</span>
</span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redisvl.query</span> <span class="kn">import</span> <span class="n">RangeQuery</span><span class="p">,</span> <span class="n">VectorQuery</span>
</span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redisvl.schema</span> <span class="kn">import</span> <span class="n">IndexSchema</span>
</span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">sentence_transformers</span> <span class="kn">import</span> <span class="n">SentenceTransformer</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="k">def</span> <span class="nf">embed_text</span><span class="p">(</span><span class="n">model</span><span class="p">,</span> <span class="n">text</span><span class="p">):</span>
</span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">model</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="n">text</span><span class="p">))</span><span class="o">.</span><span class="n">astype</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">float32</span><span class="p">)</span><span class="o">.</span><span class="n">tobytes</span><span class="p">()</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"><span class="cl"><span class="n">warnings</span><span class="o">.</span><span class="n">filterwarnings</span><span class="p">(</span><span class="s2">"ignore"</span><span class="p">,</span> <span class="n">category</span><span class="o">=</span><span class="ne">FutureWarning</span><span class="p">,</span> <span class="n">message</span><span class="o">=</span><span class="sa">r</span><span class="s2">".*clean_up_tokenization_spaces.*"</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="n">model</span> <span class="o">=</span> <span class="n">SentenceTransformer</span><span class="p">(</span><span class="s1">'sentence-transformers/all-MiniLM-L6-v2'</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># create index</span>
</span></span><span class="line"><span class="cl"><span class="n">schema</span> <span class="o">=</span> <span class="n">IndexSchema</span><span class="o">.</span><span class="n">from_yaml</span><span class="p">(</span><span class="s1">'data/query_vector_idx.yaml'</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="n">index</span> <span class="o">=</span> <span class="n">SearchIndex</span><span class="p">(</span><span class="n">schema</span><span class="p">,</span> <span class="n">r</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="n">index</span><span class="o">.</span><span class="n">create</span><span class="p">(</span><span class="n">overwrite</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">drop</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"><span class="cl"><span class="c1"># load data</span>
</span></span><span class="line"><span class="cl"><span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="s2">"data/query_vector.json"</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span>
</span></span><span class="line"><span class="cl"> <span class="n">bicycles</span> <span class="o">=</span> <span class="n">json</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">f</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="n">index</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">bicycles</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">query</span> <span class="o">=</span> <span class="s2">"Bike for small kids"</span>
</span></span><span class="line hl"><span class="cl"><span class="n">query_vector</span> <span class="o">=</span> <span class="n">embed_text</span><span class="p">(</span><span class="n">model</span><span class="p">,</span> <span class="n">query</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">query_vector</span><span class="p">[:</span><span class="mi">10</span><span class="p">])</span> <span class="c1"># >>> b'\x02=c=\x93\x0e\xe0=aC'</span>
</span></span><span class="line hl"><span class="cl">
</span></span><span class="line hl"><span class="cl"><span class="n">vquery</span> <span class="o">=</span> <span class="n">VectorQuery</span><span class="p">(</span>
</span></span><span class="line hl"><span class="cl"> <span class="n">vector</span><span class="o">=</span><span class="n">query_vector</span><span class="p">,</span>
</span></span><span class="line hl"><span class="cl"> <span class="n">vector_field_name</span><span class="o">=</span><span class="s2">"description_embeddings"</span><span class="p">,</span>
</span></span><span class="line hl"><span class="cl"> <span class="n">num_results</span><span class="o">=</span><span class="mi">3</span><span class="p">,</span>
</span></span><span class="line hl"><span class="cl"> <span class="n">return_score</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
</span></span><span class="line hl"><span class="cl"> <span class="n">return_fields</span><span class="o">=</span><span class="p">[</span><span class="s2">"description"</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 class="n">res</span> <span class="o">=</span> <span class="n">index</span><span class="o">.</span><span class="n">query</span><span class="p">(</span><span class="n">vquery</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 class="c1"># >>> [{'id': 'bicycle:6b702e8b...', 'vector_distance': '0.399111807346', 'description': 'Kids want...</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">vquery</span> <span class="o">=</span> <span class="n">RangeQuery</span><span class="p">(</span>
</span></span><span class="line"><span class="cl"> <span class="n">vector</span><span class="o">=</span><span class="n">query_vector</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="n">vector_field_name</span><span class="o">=</span><span class="s2">"description_embeddings"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="n">distance_threshold</span><span class="o">=</span><span class="mf">0.5</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="n">return_score</span><span class="o">=</span><span class="kc">True</span>
</span></span><span class="line"><span class="cl"><span class="p">)</span><span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"description"</span><span class="p">)</span><span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">index</span><span class="o">.</span><span class="n">query</span><span class="p">(</span><span class="n">vquery</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 class="c1"># >>> [{'id': 'bicycle:6bcb1bb4...', 'vector_distance': '0.399111807346', 'description': 'Kids want...</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_RedisVL_query_vector-stepvector1')" 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_RedisVL_query_vector-stepvector1" 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-vl/" tabindex="1" title="Quick-Start">
RedisVL 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-vl-python/tree/main/doctests/query_vector.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>
</div>
<!-- Python query>
query = (
Query('(*)=>[KNN 3 @vector $query_vector]')
.sort_by('__vector_score')
.return_fields('__vector_score', 'description')
.dialect(2)
)
</!-->
<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 binary value of the query vector is significantly shortened in the CLI example above.
</div>
</div>
<h2 id="radius">
Radius
</h2>
<p>
Instead of the number of nearest neighbors, you need to pass the radius along with the index name, the vector field name, and the vector's binary value:
</p>
<pre tabindex="0"><code>FT.SEARCH index "@field:[VECTOR_RANGE radius $vector]" PARAMS 2 vector "binary_data" DIALECT 2
</code></pre>
<p>
If you want to sort by distance, then you must yield the distance via the range query parameter
<code>
$YIELD_DISTANCE_AS
</code>
:
</p>
<pre tabindex="0"><code>FT.SEARCH index "@field:[VECTOR_RANGE radius $vector]=>{$YIELD_DISTANCE_AS: dist_field}" PARAMS 2 vector "binary_data" SORTBY dist_field DIALECT 2
</code></pre>
<p>
Here is a more detailed explanation of this query:
</p>
<ol>
<li>
<strong>
Range query
</strong>
: the syntax of a radius query is very similar to the regular range query, except for the keyword
<code>
VECTOR_RANGE
</code>
. You can also combine a vector radius query with other queries in the same way as regular range queries. See
<a href="/docs/latest/develop/interact/search-and-query/query/combined/">
combined queries article
</a>
for more details.
</li>
<li>
<strong>
Additional step
</strong>
: the
<code>
=>
</code>
arrow means that the range query is followed by evaluating additional parameters.
</li>
<li>
<strong>
Range query parameters
</strong>
: parameters such as
<code>
$YIELD_DISTANCE_AS
</code>
can be found in the
<a href="/docs/latest/develop/interact/search-and-query/advanced-concepts/vectors/">
vectors reference documentation
</a>
.
</li>
<li>
<strong>
Vector binary data
</strong>
: you need to use
<code>
PARAMS
</code>
to pass the binary representation of the vector.
</li>
<li>
<strong>
Dialect
</strong>
: vector search has been available since version two of the query dialect.
</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>
By default,
<a href="/docs/latest/commands/ft.search/">
<code>
FT.SEARCH
</code>
</a>
returns only the first ten results. The
<a href="/docs/latest/develop/interact/search-and-query/query/range/">
range query article
</a>
explains to you how to scroll through the result set.
</div>
</div>
<p>
The example below shows a radius query that returns the description and the distance within a radius of
<code>
0.5
</code>
. The result is sorted by the distance.
</p>
<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="query_vector-stepvector2">
<input checked="" class="radiotab w-0 h-0" data-lang="redis-cli" id="redis-cli_query_vector-stepvector2" name="query_vector-stepvector2" 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_query_vector-stepvector2" title="Open example">
>_ Redis CLI
</label>
<div aria-labelledby="tab-query_vector-stepvector2" class="panel order-last hidden w-full mt-0 relative" id="panel_redis-cli_query_vector-stepvector2" role="tabpanel" tabindex="0">
<div class="highlight">
<pre class="chroma"><code class="language-plaintext" data-lang="plaintext"><span class="line hl"><span class="cl">FT.SEARCH idx:bikes_vss "@vector:[VECTOR_RANGE 0.5 $query_vector]=>{$YIELD_DISTANCE_AS: vector_dist}" PARAMS 2 "query_vector" "Z\xf8\x15:\xf23\xa1\xbfZ\x1dI>\r\xca9..." SORTBY vector_dist ASC RETURN 2 vector_dist description DIALECT 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_query_vector-stepvector2')" 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="javascript" id="Nodejs_query_vector-stepvector2" name="query_vector-stepvector2" 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_query_vector-stepvector2" title="Open example">
Node.js
</label>
<div aria-labelledby="tab-query_vector-stepvector2" class="panel order-last hidden w-full mt-0 relative" id="panel_Nodejs_query_vector-stepvector2" role="tabpanel" tabindex="0">
<div class="highlight">
<pre class="chroma"><code class="language-javascript" data-lang="javascript"><span class="line"><span class="cl"><span class="kr">import</span> <span class="nx">assert</span> <span class="nx">from</span> <span class="s1">'node:assert'</span><span class="p">;</span>
</span></span><span class="line"><span class="cl"><span class="kr">import</span> <span class="nx">fs</span> <span class="nx">from</span> <span class="s1">'node:fs'</span><span class="p">;</span>
</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 class="kr">import</span> <span class="p">{</span> <span class="nx">SchemaFieldTypes</span><span class="p">,</span> <span class="nx">VectorAlgorithms</span> <span class="p">}</span> <span class="nx">from</span> <span class="s1">'@redis/search'</span><span class="p">;</span>
</span></span><span class="line"><span class="cl"><span class="kr">import</span> <span class="p">{</span> <span class="nx">pipeline</span> <span class="p">}</span> <span class="nx">from</span> <span class="s1">'@xenova/transformers'</span><span class="p">;</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="kd">function</span> <span class="nx">float32Buffer</span><span class="p">(</span><span class="nx">arr</span><span class="p">)</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="kr">const</span> <span class="nx">floatArray</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Float32Array</span><span class="p">(</span><span class="nx">arr</span><span class="p">);</span>
</span></span><span class="line"><span class="cl"> <span class="kr">const</span> <span class="nx">float32Buffer</span> <span class="o">=</span> <span class="nx">Buffer</span><span class="p">.</span><span class="nx">from</span><span class="p">(</span><span class="nx">floatArray</span><span class="p">.</span><span class="nx">buffer</span><span class="p">);</span>
</span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="nx">float32Buffer</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="kr">async</span> <span class="kd">function</span> <span class="nx">embedText</span><span class="p">(</span><span class="nx">sentence</span><span class="p">)</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="kd">let</span> <span class="nx">modelName</span> <span class="o">=</span> <span class="s1">'Xenova/all-MiniLM-L6-v2'</span><span class="p">;</span>
</span></span><span class="line"><span class="cl"> <span class="kd">let</span> <span class="nx">pipe</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">pipeline</span><span class="p">(</span><span class="s1">'feature-extraction'</span><span class="p">,</span> <span class="nx">modelName</span><span class="p">);</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="kd">let</span> <span class="nx">vectorOutput</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">pipe</span><span class="p">(</span><span class="nx">sentence</span><span class="p">,</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nx">pooling</span><span class="o">:</span> <span class="s1">'mean'</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nx">normalize</span><span class="o">:</span> <span class="kc">true</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="kr">const</span> <span class="nx">embedding</span> <span class="o">=</span> <span class="nb">Object</span><span class="p">.</span><span class="nx">values</span><span class="p">(</span><span class="nx">vectorOutput</span><span class="o">?</span><span class="p">.</span><span class="nx">data</span><span class="p">);</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="nx">embedding</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="kd">let</span> <span class="nx">query</span> <span class="o">=</span> <span class="s1">'Bike for small kids'</span><span class="p">;</span>
</span></span><span class="line"><span class="cl"><span class="kd">let</span> <span class="nx">vector_query</span> <span class="o">=</span> <span class="nx">float32Buffer</span><span class="p">(</span><span class="kr">await</span> <span class="nx">embedText</span><span class="p">(</span><span class="s1">'That is a very happy person'</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"><span class="cl"><span class="c1">// create index
</span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">ft</span><span class="p">.</span><span class="nx">create</span><span class="p">(</span><span class="s1">'idx:bicycle'</span><span class="p">,</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="s1">'$.description'</span><span class="o">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nx">type</span><span class="o">:</span> <span class="nx">SchemaFieldTypes</span><span class="p">.</span><span class="nx">TEXT</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nx">AS</span><span class="o">:</span> <span class="s1">'description'</span>
</span></span><span class="line"><span class="cl"> <span class="p">},</span>
</span></span><span class="line"><span class="cl"> <span class="s1">'$.description_embeddings'</span><span class="o">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nx">type</span><span class="o">:</span> <span class="nx">SchemaFieldTypes</span><span class="p">.</span><span class="nx">VECTOR</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nx">TYPE</span><span class="o">:</span> <span class="s1">'FLOAT32'</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nx">ALGORITHM</span><span class="o">:</span> <span class="nx">VectorAlgorithms</span><span class="p">.</span><span class="nx">FLAT</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nx">DIM</span><span class="o">:</span> <span class="mi">384</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nx">DISTANCE_METRIC</span><span class="o">:</span> <span class="s1">'COSINE'</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nx">AS</span><span class="o">:</span> <span class="s1">'vector'</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 class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nx">ON</span><span class="o">:</span> <span class="s1">'JSON'</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nx">PREFIX</span><span class="o">:</span> <span class="s1">'bicycle:'</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="c1">// load data
</span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="kr">const</span> <span class="nx">bicycles</span> <span class="o">=</span> <span class="nx">JSON</span><span class="p">.</span><span class="nx">parse</span><span class="p">(</span><span class="nx">fs</span><span class="p">.</span><span class="nx">readFileSync</span><span class="p">(</span><span class="s1">'data/query_vector.json'</span><span class="p">,</span> <span class="s1">'utf8'</span><span class="p">));</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="kr">await</span> <span class="nb">Promise</span><span class="p">.</span><span class="nx">all</span><span class="p">(</span>
</span></span><span class="line"><span class="cl"> <span class="nx">bicycles</span><span class="p">.</span><span class="nx">map</span><span class="p">((</span><span class="nx">bicycle</span><span class="p">,</span> <span class="nx">bid</span><span class="p">)</span> <span class="p">=></span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="nx">client</span><span class="p">.</span><span class="nx">json</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="sb">`bicycle:</span><span class="si">${</span><span class="nx">bid</span><span class="si">}</span><span class="sb">`</span><span class="p">,</span> <span class="s1">'$'</span><span class="p">,</span> <span class="nx">bicycle</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></span><span class="line"><span class="cl"><span class="kr">const</span> <span class="nx">res1</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">ft</span><span class="p">.</span><span class="nx">search</span><span class="p">(</span><span class="s1">'idx:bicycle'</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s1">'*=>[KNN 3 @vector $query_vector AS score]'</span><span class="p">,</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nx">PARAMS</span><span class="o">:</span> <span class="p">{</span> <span class="nx">query_vector</span><span class="o">:</span> <span class="nx">vector_query</span> <span class="p">},</span>
</span></span><span class="line"><span class="cl"> <span class="nx">RETURN</span><span class="o">:</span> <span class="p">[</span><span class="s1">'description'</span><span class="p">],</span>
</span></span><span class="line"><span class="cl"> <span class="nx">DIALECT</span><span class="o">:</span> <span class="mi">2</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">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res1</span><span class="p">.</span><span class="nx">total</span><span class="p">);</span> <span class="c1">// >>> 3
</span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res1</span><span class="p">);</span> <span class="c1">// >>>
</span></span></span><span class="line"><span class="cl"><span class="c1">//{
</span></span></span><span class="line"><span class="cl"><span class="c1">// total: 3,
</span></span></span><span class="line"><span class="cl"><span class="c1">// documents: [
</span></span></span><span class="line"><span class="cl"><span class="c1">// { id: 'bicycle:0', value: [Object: null prototype] {} },
</span></span></span><span class="line"><span class="cl"><span class="c1">// { id: 'bicycle:2', value: [Object: null prototype] {} },
</span></span></span><span class="line"><span class="cl"><span class="c1">// { id: 'bicycle:9', value: [Object: null prototype] {} }
</span></span></span><span class="line"><span class="cl"><span class="c1">// ]
</span></span></span><span class="line"><span class="cl"><span class="c1">//}
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line hl"><span class="cl"><span class="kr">const</span> <span class="nx">res2</span> <span class="o">=</span> <span class="kr">await</span> <span class="nx">client</span><span class="p">.</span><span class="nx">ft</span><span class="p">.</span><span class="nx">search</span><span class="p">(</span><span class="s1">'idx:bicycle'</span><span class="p">,</span>
</span></span><span class="line hl"><span class="cl"> <span class="s1">'@vector:[VECTOR_RANGE 0.9 $query_vector]=>{$YIELD_DISTANCE_AS: vector_dist}'</span><span class="p">,</span> <span class="p">{</span>
</span></span><span class="line hl"><span class="cl"> <span class="nx">PARAMS</span><span class="o">:</span> <span class="p">{</span> <span class="nx">query_vector</span><span class="o">:</span> <span class="nx">vector_query</span> <span class="p">},</span>
</span></span><span class="line hl"><span class="cl"> <span class="nx">SORTBY</span><span class="o">:</span> <span class="s1">'vector_dist'</span><span class="p">,</span>
</span></span><span class="line hl"><span class="cl"> <span class="nx">RETURN</span><span class="o">:</span> <span class="p">[</span><span class="s1">'vector_dist'</span><span class="p">,</span> <span class="s1">'description'</span><span class="p">],</span>
</span></span><span class="line hl"><span class="cl"> <span class="nx">DIALECT</span><span class="o">:</span> <span class="mi">2</span>
</span></span><span class="line hl"><span class="cl"> <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 class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res2</span><span class="p">.</span><span class="nx">total</span><span class="p">);</span> <span class="c1">// >>> 1
</span></span></span><span class="line hl"><span class="cl"><span class="c1"></span><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">res2</span><span class="p">);</span> <span class="c1">// >>>
</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="c1">// total: 1,
</span></span></span><span class="line hl"><span class="cl"><span class="c1">// documents: [ { id: 'bicycle:0', value: [Object: null prototype] } ]
</span></span></span><span class="line hl"><span class="cl"><span class="c1">//}
</span></span></span><span class="line"><span class="cl"><span class="c1"></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_query_vector-stepvector2')" 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_query_vector-stepvector2" 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/query-vector.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="python" id="RedisVL_query_vector-stepvector2" name="query_vector-stepvector2" 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="RedisVL_query_vector-stepvector2" title="Open example">
RedisVL
</label>
<div aria-labelledby="tab-query_vector-stepvector2" class="panel order-last hidden w-full mt-0 relative" id="panel_RedisVL_query_vector-stepvector2" 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">json</span>
</span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">warnings</span>
</span></span><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 class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
</span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redisvl.index</span> <span class="kn">import</span> <span class="n">SearchIndex</span>
</span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redisvl.query</span> <span class="kn">import</span> <span class="n">RangeQuery</span><span class="p">,</span> <span class="n">VectorQuery</span>
</span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redisvl.schema</span> <span class="kn">import</span> <span class="n">IndexSchema</span>
</span></span><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">sentence_transformers</span> <span class="kn">import</span> <span class="n">SentenceTransformer</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="k">def</span> <span class="nf">embed_text</span><span class="p">(</span><span class="n">model</span><span class="p">,</span> <span class="n">text</span><span class="p">):</span>
</span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">model</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="n">text</span><span class="p">))</span><span class="o">.</span><span class="n">astype</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">float32</span><span class="p">)</span><span class="o">.</span><span class="n">tobytes</span><span class="p">()</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"><span class="cl"><span class="n">warnings</span><span class="o">.</span><span class="n">filterwarnings</span><span class="p">(</span><span class="s2">"ignore"</span><span class="p">,</span> <span class="n">category</span><span class="o">=</span><span class="ne">FutureWarning</span><span class="p">,</span> <span class="n">message</span><span class="o">=</span><span class="sa">r</span><span class="s2">".*clean_up_tokenization_spaces.*"</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="n">model</span> <span class="o">=</span> <span class="n">SentenceTransformer</span><span class="p">(</span><span class="s1">'sentence-transformers/all-MiniLM-L6-v2'</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># create index</span>
</span></span><span class="line"><span class="cl"><span class="n">schema</span> <span class="o">=</span> <span class="n">IndexSchema</span><span class="o">.</span><span class="n">from_yaml</span><span class="p">(</span><span class="s1">'data/query_vector_idx.yaml'</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="n">index</span> <span class="o">=</span> <span class="n">SearchIndex</span><span class="p">(</span><span class="n">schema</span><span class="p">,</span> <span class="n">r</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="n">index</span><span class="o">.</span><span class="n">create</span><span class="p">(</span><span class="n">overwrite</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">drop</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"><span class="cl"><span class="c1"># load data</span>
</span></span><span class="line"><span class="cl"><span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="s2">"data/query_vector.json"</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span>
</span></span><span class="line"><span class="cl"> <span class="n">bicycles</span> <span class="o">=</span> <span class="n">json</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">f</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="n">index</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">bicycles</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">query</span> <span class="o">=</span> <span class="s2">"Bike for small kids"</span>
</span></span><span class="line"><span class="cl"><span class="n">query_vector</span> <span class="o">=</span> <span class="n">embed_text</span><span class="p">(</span><span class="n">model</span><span class="p">,</span> <span class="n">query</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">query_vector</span><span class="p">[:</span><span class="mi">10</span><span class="p">])</span> <span class="c1"># >>> b'\x02=c=\x93\x0e\xe0=aC'</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">vquery</span> <span class="o">=</span> <span class="n">VectorQuery</span><span class="p">(</span>
</span></span><span class="line"><span class="cl"> <span class="n">vector</span><span class="o">=</span><span class="n">query_vector</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="n">vector_field_name</span><span class="o">=</span><span class="s2">"description_embeddings"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="n">num_results</span><span class="o">=</span><span class="mi">3</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="n">return_score</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="n">return_fields</span><span class="o">=</span><span class="p">[</span><span class="s2">"description"</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="n">res</span> <span class="o">=</span> <span class="n">index</span><span class="o">.</span><span class="n">query</span><span class="p">(</span><span class="n">vquery</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 class="c1"># >>> [{'id': 'bicycle:6b702e8b...', 'vector_distance': '0.399111807346', 'description': 'Kids want...</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line hl"><span class="cl"><span class="n">vquery</span> <span class="o">=</span> <span class="n">RangeQuery</span><span class="p">(</span>
</span></span><span class="line hl"><span class="cl"> <span class="n">vector</span><span class="o">=</span><span class="n">query_vector</span><span class="p">,</span>
</span></span><span class="line hl"><span class="cl"> <span class="n">vector_field_name</span><span class="o">=</span><span class="s2">"description_embeddings"</span><span class="p">,</span>
</span></span><span class="line hl"><span class="cl"> <span class="n">distance_threshold</span><span class="o">=</span><span class="mf">0.5</span><span class="p">,</span>
</span></span><span class="line hl"><span class="cl"> <span class="n">return_score</span><span class="o">=</span><span class="kc">True</span>
</span></span><span class="line hl"><span class="cl"><span class="p">)</span><span class="o">.</span><span class="n">return_fields</span><span class="p">(</span><span class="s2">"description"</span><span class="p">)</span><span class="o">.</span><span class="n">dialect</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
</span></span><span class="line hl"><span class="cl"><span class="n">res</span> <span class="o">=</span> <span class="n">index</span><span class="o">.</span><span class="n">query</span><span class="p">(</span><span class="n">vquery</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 class="c1"># >>> [{'id': 'bicycle:6bcb1bb4...', 'vector_distance': '0.399111807346', 'description': 'Kids want...</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_RedisVL_query_vector-stepvector2')" 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_RedisVL_query_vector-stepvector2" 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-vl/" tabindex="1" title="Quick-Start">
RedisVL 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-vl-python/tree/main/doctests/query_vector.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>
</div>
<!-- Python query>
query = (
Query('@vector:[VECTOR_RANGE 0.5 $query_vector]=>{$YIELD_DISTANCE_AS: vector_dist}')
.sort_by('vector_dist')
.return_fields('vector_dist', 'description')
.dialect(2)
)
</!-->
<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/query/vector-search/"/>
<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-unload/.html | <section class="prose w-full py-12">
<h1 class="command-name">
MODULE UNLOAD
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">MODULE UNLOAD name</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(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>
Unloads a module.
</p>
<p>
This command unloads the module specified by
<code>
name
</code>
. Note that the module's name
is reported by the
<a href="/docs/latest/commands/module-list/">
<code>
MODULE LIST
</code>
</a>
command, and may differ from the dynamic
library's filename.
</p>
<p>
Known limitations:
</p>
<ul>
<li>
Modules that register custom data types can not be unloaded.
</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 module was unloaded.
<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-unload/"/>
<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/manage-passwords/active-active-admin-credentials/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Update admin credentials for Active-Active databases
</h1>
<p class="text-lg -mt-5 mb-10">
Update admin credentials for Active-Active databases.
</p>
<p>
Active-Active databases use administrator credentials to manage operations.
</p>
<p>
To update the administrator user password on a cluster with Active-Active databases:
</p>
<ol>
<li>
<p>
From the user management page, update the administrator user password on the clusters you want to update.
</p>
</li>
<li>
<p>
For each participating cluster
<em>
and
</em>
each Active-Active database, update the admin user credentials to match the changes in step 1.
</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">
Warning:
</div>
Do not perform any management operations on the databases until these steps are complete.
</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/security/access-control/manage-passwords/active-active-admin-credentials/"/>
<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/syncer/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Syncer process
</h1>
<p class="text-lg -mt-5 mb-10">
Detailed information about the syncer process and its role in distributed databases.
</p>
<h2 id="syncer-process">
Syncer process
</h2>
<p>
Each node in a cluster containing an instance of an Active-Active database hosts a process called the syncer.
The syncer process:
</p>
<ol>
<li>
Connects to the proxy on another participating cluster
</li>
<li>
Reads data from that database instance
</li>
<li>
Writes the data to the local cluster's primary(master) shard
</li>
</ol>
<p>
Some replication capabilities are also included in
<a href="/docs/latest/operate/oss_and_stack/management/replication/">
Redis Community Edition
</a>
.
</p>
<p>
The primary (also known as master) shard at the top of the primary-replica tree creates a replication ID.
This replication ID is identical for all replicas in that tree.
When a new primary is appointed, the replication ID changes, but a partial sync from the previous ID is still possible.
</p>
<p>
In a partial sync, the backlog of operations since the offset are transferred as raw operations.
In a full sync, the data from the primary is transferred to the replica as an RDB file which is followed by a partial sync.
</p>
<p>
Partial synchronization requires a backlog large enough to store the data operations until connection is restored. See
<a href="/docs/latest/operate/rs/databases/active-active/manage/#replication-backlog">
replication backlog
</a>
for more info on changing the replication backlog size.
</p>
<h3 id="syncer-in-active-active-replication">
Syncer in Active-Active replication
</h3>
<p>
In the case of an Active-Active database:
</p>
<ul>
<li>
Multiple past replication IDs and offsets are stored to allow for multiple syncs
</li>
<li>
The
<a href="/docs/latest/operate/rs/databases/active-active/manage/#replication-backlog">
Active-Active replication backlog
</a>
is also sent to the replica during a full sync.
</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">
Warning:
</div>
Full sync triggers heavy data transfers between geo-replicated instances of an Active-Active database.
</div>
</div>
<p>
An Active-Active database uses partial synchronization in the following situations:
</p>
<ul>
<li>
Failover of primary shard to replica shard
</li>
<li>
Restart or crash of replica shard that requires sync from primary
</li>
<li>
Migrate replica shard to another node
</li>
<li>
Migrate primary shard to another node as a replica using failover and replica migration
</li>
<li>
Migrate primary shard and preserve roles using failover, replica migration, and second failover to return shard to primary
</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>
Synchronization of data from the primary shard to the replica shard is always a full synchronization.
</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/databases/active-active/syncer/"/>
<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/changelog/february-2024/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Redis Cloud changelog (February 2024)
</h1>
<p class="text-lg -mt-5 mb-10">
New features, enhancements, and other changes added to Redis Cloud during February 2024.
</p>
<h2 id="enhancements">
Enhancements
</h2>
<h3 id="dataset-size-alert-set-by-default">
Dataset size alert set by default
</h3>
<p>
The
<strong>
Dataset size has reached
</strong>
<a href="/docs/latest/operate/rc/databases/create-database/#alerts-section">
alert
</a>
is now set by default when you create your first database in a Flexible subscription.
</p>
<h3 id="separated-capability-selection">
Separated capability selection
</h3>
<p>
When you select
<a href="/docs/latest/operate/rc/databases/create-database/#modules">
advanced capabilities
</a>
during database creation, selecting
<strong>
Search and query
</strong>
will no longer automatically select
<strong>
JSON
</strong>
. You can still combine the
<strong>
Search and query
</strong>
and
<strong>
JSON
</strong>
advanced capabilities.
</p>
<h3 id="new-backup-location-errors">
New backup location errors
</h3>
<p>
The Redis Cloud console will now notify you through email and on the application if the backup location you specify does not exist or has the wrong permissions. See
<a href="/docs/latest/operate/rc/databases/back-up-data/">
Back up databases
</a>
to learn how to set the correct permissions for your backup locations.
</p>
<h3 id="cidr-overlap-detection">
CIDR overlap detection
</h3>
<p>
When you
<a href="/docs/latest/operate/rc/databases/create-database/create-pro-database-new/">
create a new Flexible subscription
</a>
, the Redis Cloud console will now detect if the Classless Inter-Domain Routing (CIDR) subnet range you specify is in use by another Flexible subscription on the same account. This will allow you to address and resolve CIDR conflicts in your Redis deployment.
</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/changelog/february-2024/"/>
<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/schedule-backups/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Schedule periodic backups
</h1>
<p class="text-lg -mt-5 mb-10">
Schedule backups of your databases to make sure you always have valid backups.
</p>
<p>
Periodic backups provide a way to restore data with minimal data loss. With Redis Enterprise Software, you can schedule periodic backups to occur once a day (every 24 hours), twice a day (every twelve hours), every four hours, or every hour.
</p>
<p>
As of v6.2.8, you can specify the start time for 24-hour or 12-hour backups.
</p>
<p>
To make an on-demand backup,
<a href="/docs/latest/operate/rs/7.4/databases/import-export/export-data/">
export your data
</a>
.
</p>
<p>
You can schedule backups to a variety of locations, including:
</p>
<ul>
<li>
FTP server
</li>
<li>
SFTP server
</li>
<li>
Local mount point
</li>
<li>
Amazon Simple Storage Service (S3)
</li>
<li>
Azure Blob Storage
</li>
<li>
Google Cloud Storage
</li>
</ul>
<p>
The backup process creates compressed (.gz) RDB files that you can
<a href="/docs/latest/operate/rs/7.4/databases/import-export/import-data/">
import into a database
</a>
.
</p>
<p>
When you back up a database configured for database clustering,
Redis Enterprise Software creates a backup file for each shard in the configuration. All backup files are copied to the storage location.
</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>
Make sure that you have enough space available in your storage location.
If there is not enough space in the backup location, the backup fails.
</li>
<li>
The backup configuration only applies to the database it is configured on.
</li>
<li>
To limit the parallel backup for shards, set both
<a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/tune/#tune-cluster">
<code>
tune cluster max_simultaneous_backups
</code>
</a>
and
<a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/tune/#tune-node">
<code>
tune node max_redis_forks
</code>
</a>
.
<code>
max_simultaneous_backups
</code>
is set to 4 by default.
</li>
</ul>
</div>
</div>
<h2 id="schedule-periodic-backups">
Schedule periodic backups
</h2>
<p>
Before scheduling periodic backups, verify that your storage location exists and is available to the user running Redis Enterprise Software (
<code>
redislabs
</code>
by default). You should verify that:
</p>
<ul>
<li>
Permissions are set correctly.
</li>
<li>
The user running Redis Enterprise Software is authorized to access the storage location.
</li>
<li>
The authorization credentials work.
</li>
</ul>
<p>
Storage location access is verified before periodic backups are scheduled.
</p>
<p>
To schedule periodic backups for a database:
</p>
<ol>
<li>
<p>
Sign in to the Redis Enterprise Software Cluster Manager UI using admin credentials.
</p>
</li>
<li>
<p>
From the
<strong>
Databases
</strong>
list, select the database, then select
<strong>
Configuration
</strong>
.
</p>
</li>
<li>
<p>
Select the
<strong>
Edit
</strong>
button.
</p>
</li>
<li>
<p>
Expand the
<strong>
Scheduled backup
</strong>
section.
</p>
</li>
<li>
<p>
Select
<strong>
Add backup path
</strong>
to open the
<strong>
Path configuration
</strong>
dialog.
</p>
</li>
<li>
<p>
Select the tab that corresponds to your storage location type, enter the location details, and select
<strong>
Done
</strong>
.
</p>
<p>
See
<a href="#supported-storage-locations">
Supported storage locations
</a>
for more information about each storage location type.
</p>
</li>
<li>
<p>
Set the backup
<strong>
Interval
</strong>
and
<strong>
Starting time
</strong>
.
</p>
<table>
<thead>
<tr>
<th>
Setting
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<strong>
Interval
</strong>
</td>
<td>
Specifies the frequency of the backup; that is, the time between each backup snapshot.
<br/>
<br/>
Supported values include
<em>
Every 24 hours
</em>
,
<em>
Every 12 hours
</em>
,
<em>
Every 4 hours
</em>
, and
<em>
Every hour
</em>
.
</td>
</tr>
<tr>
<td>
<strong>
Starting time
</strong>
</td>
<td>
<em>
v6.2.8 or later:
</em>
Specifies the start time for the backup; available when
<strong>
Interval
</strong>
is set to
<em>
Every 24 hours
</em>
or
<em>
Every 12 hours
</em>
.
<br/>
<br/>
If not specified, defaults to a time selected by Redis Enterprise Software.
</td>
</tr>
</tbody>
</table>
</li>
<li>
<p>
Select
<strong>
Save
</strong>
.
</p>
</li>
</ol>
<p>
Access to the storage location is verified when you apply your updates. This means the location, credentials, and other details must exist and function before you can enable periodic backups.
</p>
<h2 id="default-backup-start-time">
Default backup start time
</h2>
<p>
If you do
<em>
not
</em>
specify a start time for twenty-four or twelve hour backups, Redis Enterprise Software chooses a random starting time for you.
</p>
<p>
This choice assumes that your database is deployed to a multi-tenant cluster containing multiple databases. This means that default start times are staggered (offset) to ensure availability. This is done by calculating a random offset which specifies a number of seconds added to the start time.
</p>
<p>
Here's how it works:
</p>
<ul>
<li>
Assume you're enabling the backup at 4:00 pm (1600 hours).
</li>
<li>
You choose to back up your database every 12 hours.
</li>
<li>
Because you didn't set a start time, the cluster randomly chooses an offset of 4,320 seconds (or 72 minutes).
</li>
</ul>
<p>
This means your first periodic backup occurs 72 minutes after the time you enabled periodic backups (4:00Β pmΒ +Β 72Β minutes). Backups repeat every twelve hours at roughly same time.
</p>
<p>
The backup time is imprecise because they're started by a trigger process that runs every five minutes. When the process wakes, it compares the current time to the scheduled backup time. If that time has passed, it triggers a backup.
</p>
<p>
If the previous backup fails, the trigger process retries the backup until it succeeds.
</p>
<p>
In addition, throttling and resource limits also affect backup times.
</p>
<p>
For help with specific backup issues,
<a href="https://redis.com/company/support/">
contact support
</a>
.
</p>
<h2 id="supported-storage-locations">
Supported storage locations
</h2>
<p>
Database backups can be saved to a local mount point, transferred to
<a href="https://en.wikipedia.org/wiki/Uniform_Resource_Identifier">
a URI
</a>
using FTP/SFTP, or stored on cloud provider storage.
</p>
<p>
When saved to a local mount point or a cloud provider, backup locations need to be available to
<a href="/docs/latest/operate/rs/7.4/installing-upgrading/install/customize-user-and-group/">
the group and user
</a>
running Redis Enterprise Software,
<code>
redislabs:redislabs
</code>
by default.
</p>
<p>
Redis Enterprise Software needs the ability to view permissions and update objects in the storage location. Implementation details vary according to the provider and your configuration. To learn more, consult the provider's documentation.
</p>
<p>
The following sections provide general guidelines. Because provider features change frequently, use your provider's documentation for the latest info.
</p>
<h3 id="ftp-server">
FTP server
</h3>
<p>
Before enabling backups to an FTP server, verify that:
</p>
<ul>
<li>
Your Redis Enterprise cluster can connect and authenticate to the FTP server.
</li>
<li>
The user specified in the FTP server location has read and write privileges.
</li>
</ul>
<p>
To store your backups on an FTP server, set its
<strong>
Backup Path
</strong>
using the following syntax:
</p>
<p>
<code>
ftp://[username]:[password]@[host]:[port]/[path]/
</code>
</p>
<p>
Where:
</p>
<ul>
<li>
<em>
protocol
</em>
: the server's protocol, can be either
<code>
ftp
</code>
or
<code>
ftps
</code>
.
</li>
<li>
<em>
username
</em>
: your username, if needed.
</li>
<li>
<em>
password
</em>
: your password, if needed.
</li>
<li>
<em>
hostname
</em>
: the hostname or IP address of the server.
</li>
<li>
<em>
port
</em>
: the port number of the server, if needed.
</li>
<li>
<em>
path
</em>
: the backup path, if needed.
</li>
</ul>
<p>
Example:
<code>
ftp://username:[email protected]/home/backups/
</code>
</p>
<p>
The user account needs permission to write files to the server.
</p>
<h3 id="sftp-server">
SFTP server
</h3>
<p>
Before enabling backups to an SFTP server, make sure that:
</p>
<ul>
<li>
<p>
Your Redis Enterprise cluster can connect and authenticate to the SFTP server.
</p>
</li>
<li>
<p>
The user specified in the SFTP server location has read and write privileges.
</p>
</li>
<li>
<p>
The SSH private keys are specified correctly. You can use the key generated by the cluster or specify a custom key.
</p>
<p>
To use the cluster auto generated key:
</p>
<ol>
<li>
<p>
Go to
<strong>
Cluster > Security > Certificates
</strong>
.
</p>
</li>
<li>
<p>
Expand
<strong>
Cluster SSH Public Key
</strong>
.
</p>
</li>
<li>
<p>
Download or copy the cluster SSH public key to the appropriate location on the SFTP server.
</p>
<p>
Use the server documentation to determine the appropriate location for the SSH public key.
</p>
</li>
</ol>
</li>
</ul>
<p>
To backup to an SFTP server, enter the SFTP server location in the format:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">sftp://user:password@host<:custom_port>/path/
</span></span></code></pre>
</div>
<p>
For example:
<code>
sftp://username:[email protected]/home/backups/
</code>
</p>
<h3 id="local-mount-point">
Local mount point
</h3>
<p>
Before enabling periodic backups to a local mount point, verify that:
</p>
<ul>
<li>
The node can connect to the destination server, the one hosting the mount point.
</li>
<li>
The
<code>
redislabs:redislabs
</code>
user has read and write privileges on the local mount point
and on the destination server.
</li>
<li>
The backup location has enough disk space for your backup files. Backup files
are saved with filenames that include the timestamp, which means that earlier backups are not overwritten.
</li>
</ul>
<p>
To back up to a local mount point:
</p>
<ol>
<li>
<p>
On each node in the cluster, create the mount point:
</p>
<ol>
<li>
<p>
Connect to a shell running on Redis Enterprise Software server hosting the node.
</p>
</li>
<li>
<p>
Mount the remote storage to a local mount point.
</p>
<p>
For example:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">sudo mount -t nfs 192.168.10.204:/DataVolume/Public /mnt/Public
</span></span></code></pre>
</div>
</li>
</ol>
</li>
<li>
<p>
In the path for the backup location, enter the mount point.
</p>
<p>
For example:
<code>
/mnt/Public
</code>
</p>
</li>
<li>
<p>
Verify that the user running Redis Enterprise Software has permissions to access and update files in the mount location.
</p>
</li>
</ol>
<h3 id="aws-simple-storage-service">
AWS Simple Storage Service
</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>
Sign in to the
<a href="https://console.aws.amazon.com/">
AWS Management Console
</a>
.
</p>
</li>
<li>
<p>
<a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/creating-buckets-s3.html">
Create an S3 bucket
</a>
if you do not already have one.
</p>
</li>
<li>
<p>
<a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_create.html#id_users_create_console">
Create an IAM User
</a>
with permission to add objects to the bucket.
</p>
</li>
<li>
<p>
<a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html#Using_CreateAccessKey">
Create an access key
</a>
for that user if you do not already have one.
</p>
</li>
<li>
<p>
In the Redis Enterprise Software Cluster Manager UI, when you enter the backup location details:
</p>
<ul>
<li>
<p>
Select the
<strong>
AWS S3
</strong>
tab on the
<strong>
Path configuration
</strong>
dialog.
</p>
</li>
<li>
<p>
In the
<strong>
Path
</strong>
field, enter the path of your bucket.
</p>
</li>
<li>
<p>
In the
<strong>
Access Key ID
</strong>
field, enter the access key ID.
</p>
</li>
<li>
<p>
In the
<strong>
Secret Access Key
</strong>
field, enter the secret access key.
</p>
</li>
</ul>
</li>
</ol>
<p>
You can also connect to a storage service that uses the S3 protocol but is not hosted by Amazon AWS. The storage service must have a valid SSL certificate. To connect to an S3-compatible storage location, run
<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 s3_url <URL>
</span></span></code></pre>
</div>
<p>
Replace
<code>
<URL>
</code>
with the hostname or IP address of the S3-compatible storage location.
</p>
<h3 id="google-cloud-storage">
Google Cloud Storage
</h3>
<p>
For
<a href="https://developers.google.com/console/">
Google Cloud
</a>
subscriptions, store your backups in a Google Cloud Storage bucket:
</p>
<ol>
<li>
<p>
Sign in to the Google Cloud Platform console.
</p>
</li>
<li>
<p>
<a href="https://cloud.google.com/iam/docs/creating-managing-service-account-keys#creating">
Create a JSON service account key
</a>
if you do not already have one.
</p>
</li>
<li>
<p>
<a href="https://cloud.google.com/storage/docs/creating-buckets#create_a_new_bucket">
Create a bucket
</a>
if you do not already have one.
</p>
</li>
<li>
<p>
<a href="https://cloud.google.com/storage/docs/access-control/using-iam-permissions#bucket-add">
Add a principal
</a>
to your bucket:
</p>
<ul>
<li>
<p>
In the
<strong>
New principals
</strong>
field, add the
<code>
client_email
</code>
from the service account key.
</p>
</li>
<li>
<p>
Select "Storage Legacy Bucket Writer" from the
<strong>
Role
</strong>
list.
</p>
</li>
</ul>
</li>
<li>
<p>
In the Redis Enterprise Software Cluster Manager UI, when you enter the backup location details:
</p>
<ul>
<li>
<p>
Select the
<strong>
Google Cloud Storage
</strong>
tab on the
<strong>
Path configuration
</strong>
dialog.
</p>
</li>
<li>
<p>
In the
<strong>
Path
</strong>
field, enter the path of your bucket.
</p>
</li>
<li>
<p>
In the
<strong>
Client ID
</strong>
field, enter the
<code>
client_id
</code>
from the service account key.
</p>
</li>
<li>
<p>
In the
<strong>
Client Email
</strong>
field, enter the
<code>
client_email
</code>
from the service account key.
</p>
</li>
<li>
<p>
In the
<strong>
Private Key ID
</strong>
field, enter the
<code>
private_key_id
</code>
from the service account key.
</p>
</li>
<li>
<p>
In the
<strong>
Private Key
</strong>
field, enter the
<code>
private_key
</code>
from the service account key.
Replace
<code>
\n
</code>
with new lines.
</p>
</li>
</ul>
</li>
</ol>
<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>
<p>
To export to 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>
<a href="https://docs.microsoft.com/en-us/azure/storage/common/storage-account-keys-manage">
Manage storage account access keys
</a>
to find the storage account name and account keys.
</p>
</li>
<li>
<p>
In the Redis Enterprise Software Cluster Manager UI, when you enter the backup location details:
</p>
<ul>
<li>
<p>
Select the
<strong>
Azure Blob Storage
</strong>
tab on the
<strong>
Path configuration
</strong>
dialog.
</p>
</li>
<li>
<p>
In the
<strong>
Path
</strong>
field, enter the path of your bucket.
</p>
</li>
<li>
<p>
In the
<strong>
Azure Account Name
</strong>
field, enter your storage account name.
</p>
</li>
<li>
<p>
In the
<strong>
Azure Account Key
</strong>
field, enter the storage account key.
</p>
</li>
</ul>
</li>
</ol>
<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>
<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/schedule-backups/"/>
<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/clients/lettuce/produsage/.html | <section class="prose w-full py-12">
<h1>
Production usage
</h1>
<p class="text-lg -mt-5 mb-10">
Get your Lettuce app ready for production
</p>
<p>
The following sections explain how to handle situations that may occur
in your production environment.
</p>
<h2 id="timeouts">
Timeouts
</h2>
<p>
Lettuce provides timeouts for many operations, such as command execution, SSL handshake, and Sentinel discovery. By default, Lettuce uses a global timeout value of 60 seconds for these operations, but you can override the global timeout value with individual timeout values for each operation.
</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>
Choosing suitable timeout values is crucial for your application's performance and stability and is specific to each environment.
Configuring timeouts is only necessary if you have issues with the default values.
In some cases, the defaults are based on environment-specific settings (e.g., operating system settings), while in other cases, they are built into the Lettuce driver.
For more details on setting specific timeouts, see the
<a href="https://redis.github.io/lettuce/">
Lettuce reference guide
</a>
.
</div>
</div>
<p>
Below is an example of setting socket-level timeouts. The
<code>
TCP_USER_TIMEOUT
</code>
setting is useful for scenarios where the server stops responding without acknowledging the last request, while the
<code>
KEEPALIVE
</code>
setting is good for detecting dead connections where there is no traffic between the client and the server.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-java" data-lang="java"><span class="line"><span class="cl"><span class="n">RedisURI</span> <span class="n">redisURI</span> <span class="o">=</span> <span class="n">RedisURI</span><span class="o">.</span><span class="na">Builder</span>
</span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">redis</span><span class="o">(</span><span class="s">"localhost"</span><span class="o">)</span>
</span></span><span class="line"><span class="cl"> <span class="c1">// set the global default from the default 60 seconds to 30 seconds
</span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="o">.</span><span class="na">withTimeout</span><span class="o">(</span><span class="n">Duration</span><span class="o">.</span><span class="na">ofSeconds</span><span class="o">(</span><span class="mi">30</span><span class="o">))</span>
</span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">build</span><span class="o">();</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="k">try</span> <span class="o">(</span><span class="n">RedisClient</span> <span class="n">client</span> <span class="o">=</span> <span class="n">RedisClient</span><span class="o">.</span><span class="na">create</span><span class="o">(</span><span class="n">redisURI</span><span class="o">))</span> <span class="o">{</span>
</span></span><span class="line"><span class="cl"> <span class="c1">// or set specific timeouts for things such as the TCP_USER_TIMEOUT and TCP_KEEPALIVE
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl"> <span class="c1">// A good general rule of thumb is to follow the rule
</span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">// TCP_USER_TIMEOUT = TCP_KEEP_IDLE+TCP_KEEPINTVL * TCP_KEEPCNT
</span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="c1">// in this case, 20 = 5 + 5 * 3
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl"> <span class="n">SocketOptions</span><span class="o">.</span><span class="na">TcpUserTimeoutOptions</span> <span class="n">tcpUserTimeout</span> <span class="o">=</span> <span class="n">SocketOptions</span><span class="o">.</span><span class="na">TcpUserTimeoutOptions</span><span class="o">.</span><span class="na">builder</span><span class="o">()</span>
</span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">tcpUserTimeout</span><span class="o">(</span><span class="n">Duration</span><span class="o">.</span><span class="na">ofSeconds</span><span class="o">(</span><span class="mi">20</span><span class="o">))</span>
</span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">enable</span><span class="o">().</span><span class="na">build</span><span class="o">();</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="n">SocketOptions</span><span class="o">.</span><span class="na">KeepAliveOptions</span> <span class="n">keepAliveOptions</span> <span class="o">=</span> <span class="n">SocketOptions</span><span class="o">.</span><span class="na">KeepAliveOptions</span><span class="o">.</span><span class="na">builder</span><span class="o">()</span>
</span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">interval</span><span class="o">(</span><span class="n">Duration</span><span class="o">.</span><span class="na">ofSeconds</span><span class="o">(</span><span class="mi">5</span><span class="o">))</span>
</span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">idle</span><span class="o">(</span><span class="n">Duration</span><span class="o">.</span><span class="na">ofSeconds</span><span class="o">(</span><span class="mi">5</span><span class="o">))</span>
</span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">count</span><span class="o">(</span><span class="mi">3</span><span class="o">).</span><span class="na">enable</span><span class="o">().</span><span class="na">build</span><span class="o">();</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="n">SocketOptions</span> <span class="n">socketOptions</span> <span class="o">=</span> <span class="n">SocketOptions</span><span class="o">.</span><span class="na">builder</span><span class="o">()</span>
</span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">tcpUserTimeout</span><span class="o">(</span><span class="n">tcpUserTimeout</span><span class="o">)</span>
</span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">keepAlive</span><span class="o">(</span><span class="n">keepAliveOptions</span><span class="o">)</span>
</span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">build</span><span class="o">();</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="n">client</span><span class="o">.</span><span class="na">setOptions</span><span class="o">(</span><span class="n">ClientOptions</span><span class="o">.</span><span class="na">builder</span><span class="o">()</span>
</span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">socketOptions</span><span class="o">(</span><span class="n">socketOptions</span><span class="o">)</span>
</span></span><span class="line"><span class="cl"> <span class="o">.</span><span class="na">build</span><span class="o">());</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="n">StatefulRedisConnection</span><span class="o"><</span><span class="n">String</span><span class="o">,</span> <span class="n">String</span><span class="o">></span> <span class="n">connection</span> <span class="o">=</span> <span class="n">client</span><span class="o">.</span><span class="na">connect</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">connection</span><span class="o">.</span><span class="na">sync</span><span class="o">().</span><span class="na">ping</span><span class="o">());</span>
</span></span><span class="line"><span class="cl"><span class="o">}</span>
</span></span></code></pre>
</div>
<h2 id="dns-cache-and-redis">
DNS cache and Redis
</h2>
<p>
When you connect to a Redis server with multiple endpoints, such as
<a href="https://redis.com/redis-enterprise/technology/active-active-geo-distribution/">
Redis Enterprise Active-Active
</a>
, you
<em>
must
</em>
disable the JVM's DNS cache. If a server node or proxy fails, the IP address for any database
affected by the failure will change. When this happens, your app will keep
trying to use the stale IP address if DNS caching is enabled.
</p>
<p>
Use the following code to disable the DNS cache:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-java" data-lang="java"><span class="line"><span class="cl"><span class="n">java</span><span class="o">.</span><span class="na">security</span><span class="o">.</span><span class="na">Security</span><span class="o">.</span><span class="na">setProperty</span><span class="o">(</span><span class="s">"networkaddress.cache.ttl"</span><span class="o">,</span><span class="s">"0"</span><span class="o">);</span>
</span></span><span class="line"><span class="cl"><span class="n">java</span><span class="o">.</span><span class="na">security</span><span class="o">.</span><span class="na">Security</span><span class="o">.</span><span class="na">setProperty</span><span class="o">(</span><span class="s">"networkaddress.cache.negative.ttl"</span><span class="o">,</span> <span class="s">"0"</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/develop/clients/lettuce/produsage/"/>
<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/release-notes/6-4-2-releases/k8s-6-4-2-4/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Redis Enterprise for Kubernetes release notes 6.4.2-4 (March 2023)
</h1>
<p class="text-lg -mt-5 mb-10">
The Redis Enterprise K8s 6.4.2-4 release supports Redis Enterprise Software 6.4.2 and contains new features and feature improvements.
</p>
<h2 id="overview">
Overview
</h2>
<p>
The Redis Enterprise K8s 6.4.2-4 release supports Redis Enterprise Software 6.4.2 and contains new features and feature improvements.
</p>
<p>
The key features, bug fixes, and known limitations are described below.
</p>
<h2 id="images">
Images
</h2>
<ul>
<li>
<strong>
Redis Enterprise
</strong>
:
<code>
redislabs/redis:6.4.2-43
</code>
</li>
<li>
<strong>
Operator
</strong>
:
<code>
redislabs/operator:6.4.2-4
</code>
</li>
<li>
<strong>
Services Rigger
</strong>
:
<code>
redislabs/k8s-controller:6.4.2-4
</code>
</li>
</ul>
<h3 id="openshift-images">
OpenShift images
</h3>
<ul>
<li>
<strong>
Redis Enterprise
</strong>
:
<code>
registry.connect.redhat.com/redislabs/redis-enterprise:6.4.2-43.rhel8-openshift
</code>
(or
<code>
redislabs/redis-enterprise:6.4.2-43.rhel7-openshift
</code>
if upgrading from RHEL 7)
</li>
<li>
<strong>
Operator
</strong>
:
<code>
registry.connect.redhat.com/redislabs/redis-enterprise-operator:6.4.2-4
</code>
s
</li>
<li>
<strong>
Services Rigger
</strong>
:
<code>
registry.connect.redhat.com/redislabs/services-manager:6.4.2-4
</code>
</li>
</ul>
<h3 id="openshift-olm-bundles">
OpenShift OLM bundles
</h3>
<ul>
<li>
Redis Enterprise operator bundle version:
<code>
v6.4.2-4.0
</code>
</li>
</ul>
<h2 id="new-features">
New features
</h2>
<ul>
<li>
Cluster-level LDAP configuration support in REC (RED-83533)
</li>
<li>
Public preview support for declarative Active-Active configuration (RED-86470)(RED-86470)
</li>
</ul>
<h2 id="feature-improvements">
Feature improvements
</h2>
<ul>
<li>
New labeling method for multi-namespace REDB (RED-83102)
</li>
<li>
Operator deployment uses built-in SCC in OpenShift (RED-90524)
</li>
<li>
Support for Redis Enterprise 6.4.2-43
</li>
<li>
Support added for K8s 1.26, EKS 1.24, AKS 1.25, Rancher 2.7/1.23-24
</li>
<li>
Improved log collector display and error handling
</li>
</ul>
<h2 id="bug-fixes">
Bug fixes
</h2>
<ul>
<li>
Deployment manifests referenced non-existent redis-enterprise-admission ServiceAccount (RED-90469)
</li>
<li>
CVE-2022-1996 (RED-93026)
</li>
<li>
CVE-2022-28948 (RED-93027)
</li>
<li>
CVE-2021-44716 & CVE-2022-27664 (RED-93028)
</li>
<li>
CVE-2018-20225
</li>
</ul>
<h2 id="api-changes">
API changes
</h2>
<p>
The following fields were changed in the
<a href="/docs/latest/operate/kubernetes/reference/redis_enterprise_cluster_api/">
Redis Enterprise cluster (REC) API
</a>
:
</p>
<ul>
<li>
<p>
Added
<code>
.spec.ldap
</code>
for configuring cluster-level LDAP settings
</p>
</li>
<li>
<p>
Added
<code>
.spec.certificates.ldapClientCertificateSecretName
</code>
for configuring LDAP client certificate
</p>
</li>
<li>
<p>
Added
<code>
.status.managedAPIs
</code>
to track APIs managed by the operator
</p>
</li>
<li>
<p>
The following custom resources definitions were added:
</p>
<ul>
<li>
<code>
RedisEnterpriseRemoteCluster
</code>
(RERC)
</li>
<li>
<code>
RedisEnterpriseActiveActiveDatabase
</code>
(REAADB)
</li>
</ul>
</li>
</ul>
<h2 id="compatibility-notes">
Compatibility notes
</h2>
<h3 id="deprecated-features">
Deprecated features
</h3>
<ul>
<li>
Support for Gesher, the advanced admission control configuration, is deprecated.
</li>
<li>
The
<code>
app.redislabs.com/v1alpha1
</code>
API version of the RedisEnterpriseCluster (REC) custom resource is deprecated and will be removed in a subsequent release. Customers should switch to use the
<code>
app.redislabs.com/v1
</code>
API version instead.
</li>
</ul>
<h3 id="supported-distributions">
Supported distributions
</h3>
<p>
The following table shows supported distributions at the time of this release. You can also find this list in
<a href="/docs/latest/operate/kubernetes/reference/supported_k8s_distributions/">
Supported Kubernetes distributions
</a>
.
</p>
<table>
<thead>
<tr>
<th style="text-align:left">
<strong>
Kubernetes version
</strong>
</th>
<th style="text-align:center">
1.21
</th>
<th style="text-align:center">
1.22
</th>
<th style="text-align:center">
1.23
</th>
<th style="text-align:center">
1.24
</th>
<th style="text-align:center">
1.25
</th>
<th style="text-align:center">
1.26
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">
Community Kubernetes
</td>
<td style="text-align:center">
</td>
<td style="text-align:center">
deprecated
</td>
<td style="text-align:center">
supported
</td>
<td style="text-align:center">
supported
</td>
<td style="text-align:center">
supported
</td>
<td style="text-align:center">
supported*
</td>
</tr>
<tr>
<td style="text-align:left">
Amazon EKS
</td>
<td style="text-align:center">
</td>
<td style="text-align:center">
supported
</td>
<td style="text-align:center">
supported
</td>
<td style="text-align:center">
supported*
</td>
<td style="text-align:center">
</td>
<td style="text-align:center">
</td>
</tr>
<tr>
<td style="text-align:left">
Azure AKS
</td>
<td style="text-align:center">
</td>
<td style="text-align:center">
</td>
<td style="text-align:center">
deprecated
</td>
<td style="text-align:center">
supported
</td>
<td style="text-align:center">
supported*
</td>
<td style="text-align:center">
</td>
</tr>
<tr>
<td style="text-align:left">
Google GKE
</td>
<td style="text-align:center">
</td>
<td style="text-align:center">
supported
</td>
<td style="text-align:center">
supported
</td>
<td style="text-align:center">
supported
</td>
<td style="text-align:center">
supported
</td>
<td style="text-align:center">
</td>
</tr>
<tr>
<td style="text-align:left">
Rancher 2.6
</td>
<td style="text-align:center">
deprecated
</td>
<td style="text-align:center">
supported
</td>
<td style="text-align:center">
supported
</td>
<td style="text-align:center">
supported
</td>
<td style="text-align:center">
</td>
<td style="text-align:center">
</td>
</tr>
<tr>
<td style="text-align:left">
Rancher 2.7
</td>
<td style="text-align:center">
</td>
<td style="text-align:center">
</td>
<td style="text-align:center">
supported*
</td>
<td style="text-align:center">
supported*
</td>
<td style="text-align:center">
</td>
<td style="text-align:center">
</td>
</tr>
<tr>
<td style="text-align:left">
VMware TKG 1.6
</td>
<td style="text-align:center">
</td>
<td style="text-align:center">
supported
</td>
<td style="text-align:center">
supported
</td>
<td style="text-align:center">
</td>
<td style="text-align:center">
</td>
<td style="text-align:center">
</td>
</tr>
<tr>
<td style="text-align:left">
<strong>
OpenShift version
</strong>
</td>
<td style="text-align:center">
<strong>
4.8
</strong>
</td>
<td style="text-align:center">
<strong>
4.9
</strong>
</td>
<td style="text-align:center">
<strong>
4.10
</strong>
</td>
<td style="text-align:center">
<strong>
4.11
</strong>
</td>
<td style="text-align:center">
<strong>
4.12
</strong>
</td>
<td style="text-align:center">
</td>
</tr>
<tr>
<td style="text-align:left">
</td>
<td style="text-align:center">
deprecated
</td>
<td style="text-align:center">
deprecated
</td>
<td style="text-align:center">
supported
</td>
<td style="text-align:center">
supported
</td>
<td style="text-align:center">
supported*
</td>
<td style="text-align:center">
</td>
</tr>
<tr>
<td style="text-align:left">
<strong>
VMware TKGI version
</strong>
</td>
<td style="text-align:center">
<strong>
1.12
</strong>
</td>
<td style="text-align:center">
<strong>
1.13
</strong>
</td>
<td style="text-align:center">
<strong>
1.14
</strong>
</td>
<td style="text-align:center">
<strong>
1.15
</strong>
</td>
<td style="text-align:center">
</td>
<td style="text-align:center">
</td>
</tr>
<tr>
<td style="text-align:left">
</td>
<td style="text-align:center">
</td>
<td style="text-align:center">
deprecated
</td>
<td style="text-align:center">
supported
</td>
<td style="text-align:center">
supported
</td>
<td style="text-align:center">
</td>
<td style="text-align:center">
</td>
</tr>
</tbody>
</table>
<p>
* Support added in this release
</p>
<h2 id="before-upgrading">
Before upgrading
</h2>
<p>
Be aware the following changes included in this release affect the upgrade process. Please read carefully before upgrading.
</p>
<ul>
<li>
<p>
<strong>
Supported upgrade paths
</strong>
</p>
<p>
If you are using a version earlier than 6.2.10-45, you cannot upgrade directly to this release. You must upgrade to 6.2.10-45 before you can upgrade to versions 6.2.18 or later.
</p>
</li>
<li>
<p>
<strong>
ValidatingWebhookConfiguration
</strong>
</p>
<p>
This release uses a new
<code>
ValidatingWebhookConfiguration
</code>
resource to replace the
<code>
redb-admission
</code>
webhook resource. To use releases 6.4.2-4 or later, delete the old webhook resource and apply the new file. See
<a href="/docs/latest/operate/kubernetes/upgrade/upgrade-redis-cluster/#reapply-webhook">
upgrade Redis cluster
</a>
for instructions.
</p>
</li>
</ul>
<h2 id="active-active-preview-known-limitations">
Active-Active preview known limitations
</h2>
<ul>
<li>
<p>
No support for Hashicorp Vault for storing secrets (RED-95805)
</p>
</li>
<li>
<p>
No module support (RED-95153)
</p>
</li>
<li>
<p>
No support for client certificates in secrets (RED-95724)
</p>
</li>
<li>
<p>
No support for backup configuration (RED-95724)
</p>
</li>
<li>
<p>
No support for upgrading the database Redis version
</p>
</li>
<li>
<p>
REAADB secret status isn't updated in source cluster (RED-96296)
</p>
<p>
The workaround is to view the secret status in one of the remote clusters.
</p>
</li>
<li>
<p>
Invalid REAADB is not rejected by admission might get deleted after apply. (RED-96300)
</p>
<p>
Fix the problems with the REAADB and reapply. Contact support if you aren't sure why the REAADB is invalid.
</p>
</li>
<li>
<p>
Admission is not blocking REAADB with
<code>
shardCount
</code>
which exceeds license quota. (RED-96301)
</p>
<p>
Fix the problems with the REAADB and reapply.
</p>
</li>
<li>
<p>
RERC resources must have a unique name (
<code>
<rec-name>/<rec-namespace>
</code>
). (RED-96302)
</p>
</li>
<li>
<p>
Only global database options are supported, not support for specifying configuration per location.
</p>
</li>
<li>
<p>
Can't automatically update the cluster secret via the operator (can be updated manually).
</p>
</li>
<li>
<p>
No support for migration from old (manual) Active-Active database method to new Active-Active controller.
</p>
</li>
</ul>
<h2 id="known-limitations">
Known limitations
</h2>
<ul>
<li>
<p>
REC creation might fail using form view on OpenShift. (RED-100517)
</p>
<p>
To avoid this, use the YAML view. This will be fixed in the next release.
</p>
</li>
</ul>
<h3 id="large-clusters">
Large clusters
</h3>
<p>
On clusters with more than 9 REC nodes, a Kubernetes upgrade can render the Redis cluster unresponsive in some cases. A fix is available in the 6.4.2-5 release. Upgrade your operator version to 6.4.2-5 or later before upgrading your Kubernetes cluster. (RED-93025)
</p>
<ul>
<li>
<p>
Resharding fails for rack-aware databases with no replication (RED-97971)
</p>
<p>
When a database is configured as
<a href="/docs/latest/operate/rs/clusters/configure/rack-zone-awareness/">
rack-aware
</a>
and replication is turned off, the resharding operation fails.
</p>
<p>
Workaround:
Before resharding your database,
<a href="/docs/latest/operate/kubernetes/reference/redis_enterprise_database_api/">
turn off rack awareness
</a>
. Set the
<code>
spec.rackAware
</code>
field in your REDB custom resource to
<code>
false
</code>
.
After the resharding process is complete, you can
<a href="/docs/latest/operate/kubernetes/reference/redis_enterprise_database_api/">
re-enable rack awareness
</a>
.
</p>
</li>
<li>
<p>
Long cluster names cause routes to be rejected (RED-25871)
</p>
<p>
A cluster name longer than 20 characters will result in a rejected route configuration because the host part of the domain name exceeds 63 characters. The workaround is to limit the cluster name to 20 characters or fewer.
</p>
</li>
<li>
<p>
Cluster CR (REC) errors are not reported after invalid updates (RED-25542)
</p>
<p>
A cluster CR specification error is not reported if two or more invalid CR resources are updated in sequence.
</p>
</li>
<li>
<p>
An unreachable cluster has status running (RED-32805)
</p>
<p>
When a cluster is in unreachable state, the state remains
<code>
running
</code>
instead of triggering an error.
</p>
</li>
<li>
<p>
Readiness probe incorrect on failures (RED-39300)
</p>
<p>
STS Readiness probe does not mark a node as "not ready" when running
<code>
rladmin status
</code>
on node failure.
</p>
</li>
<li>
<p>
Internal DNS and Kubernetes DNS may have conflicts (RED-37462)
</p>
<p>
DNS conflicts are possible between the cluster
<code>
mdns_server
</code>
and the K8s DNS. This only impacts DNS resolution from within cluster nodes for Kubernetes DNS names.
</p>
</li>
<li>
<p>
5.4.10 negatively impacts 5.4.6 (RED-37233)
</p>
<p>
Kubernetes-based 5.4.10 deployments seem to negatively impact existing 5.4.6 deployments that share a Kubernetes cluster.
</p>
</li>
<li>
<p>
Node CPU usage is reported instead of pod CPU usage (RED-36884)
</p>
<p>
In Kubernetes, the reported node CPU usage is the usage of the Kubernetes worker node hosting the REC pod.
</p>
</li>
<li>
<p>
Clusters must be named "rec" in OLM-based deployments (RED-39825)
</p>
<p>
In OLM-deployed operators, the deployment of the cluster will fail if the name is not "rec". When the operator is deployed via the OLM, the security context constraints (scc) are bound to a specific service account name (namely, "rec"). The workaround is to name the cluster "rec".
</p>
</li>
<li>
<p>
REC clusters fail to start on Kubernetes clusters with unsynchronized clocks (RED-47254)
</p>
<p>
When REC clusters are deployed on Kubernetes clusters with unsynchronized clocks, the REC cluster does not start correctly. The fix is to use NTP to synchronize the underlying K8s nodes.
</p>
</li>
<li>
<p>
Deleting an OpenShift project with an REC deployed may hang (RED-47192)
</p>
<p>
When an REC cluster is deployed in a project (namespace) and has REDB resources, the REDB resources must be deleted first before the REC can be deleted. Therefore, until the REDB resources are deleted, the project deletion will hang. The fix is to delete the REDB resources first and the REC second. Then, you can delete the project.
</p>
</li>
<li>
<p>
Hashicorp Vault integration - no support for Gesher (RED-55080)
</p>
<p>
There is no workaround at this time.
</p>
</li>
<li>
<p>
REC might report error states on initial startup (RED-61707)
</p>
<p>
There is no workaround at this time except to ignore the errors.
</p>
</li>
<li>
<p>
PVC size issues when using decimal value in spec (RED-62132)
</p>
<p>
The workaround for this issue is to make sure you use integer values for the PVC size.
</p>
</li>
<li>
<p>
Following the previous quick start guide version causes issues with creating an REDB due to unrecognized memory field name (RED-69515)
</p>
<p>
The workaround is to use the newer (current) revision of the
<a href="/docs/latest/operate/kubernetes/deployment/quick-start/">
quick start
</a>
.
</p>
</li>
<li>
<p>
<code>
autoUpgrade
</code>
set to
<code>
true
</code>
can cause unexpected bdb upgrades when
<code>
redisUpgradePolicy
</code>
is set to
<code>
true
</code>
(RED-72351)
</p>
<p>
Contact support if your deployment is impacted.
</p>
<h2 id="security">
Security
</h2>
</li>
</ul>
<p>
For a list of fixes related to CVEs, see the
<a href="/docs/latest/operate/rs/release-notes/rs-6-4-2-releases/rs-6-4-2-43/">
Redis Enterprise 6.4.2-43 release notes
</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/kubernetes/release-notes/6-4-2-releases/k8s-6-4-2-4/"/>
<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-2-12/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Redis Enterprise Software release notes 6.2.12 (August 2022)
</h1>
<p class="text-lg -mt-5 mb-10">
OCSP Support. Password & session configuration changes. RHEL 8.6 support.
</p>
<p>
<a href="https://redislabs.com/redis-enterprise-software/download-center/software/">
Redis Enterprise Software version 6.2.12
</a>
is now available!
</p>
<p>
This version of Redis Enterprise Software offers:
</p>
<ul>
<li>
OCSP stapling of the server proxy certificate
</li>
<li>
Password and session configuration settings via the admin console
</li>
<li>
Compatibility with open source Redis v6.2.6
</li>
<li>
Support for Red Hat Enterprise Linux (RHEL) v8.6
</li>
<li>
Additional enhancements and fixes
</li>
</ul>
<p>
The following table shows the MD5 checksums for the available packages.
</p>
<table>
<thead>
<tr>
<th style="text-align:left">
Package
</th>
<th style="text-align:left">
MD5 Checksum
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">
Ubuntu 16
</td>
<td style="text-align:left">
<code>
e702c906f200940e06ef031e6b8006d9
</code>
</td>
</tr>
<tr>
<td style="text-align:left">
Ubuntu 18
</td>
<td style="text-align:left">
<code>
7ea70067e8828b59336380df087fe03d
</code>
</td>
</tr>
<tr>
<td style="text-align:left">
RedHat Enterprise Linux (RHEL) 7
<br/>
Oracle Enterprise Linux (OL) 7
</td>
<td style="text-align:left">
<code>
8ffda6186f70354b9d10c1ce43938c3c
</code>
</td>
</tr>
<tr>
<td style="text-align:left">
RedHat Enterprise Linux (RHEL) 8
<br/>
Oracle Enterprise Linux (OL) 8
</td>
<td style="text-align:left">
<code>
334fe7979a7376b28fcf48913403bfb7
</code>
</td>
</tr>
</tbody>
</table>
<h2 id="features-and-enhancements">
Features and enhancements
</h2>
<ul>
<li>
<p>
Server side OCSP Stapling
</p>
<p>
<a href="https://en.wikipedia.org/wiki/Online_Certificate_Status_Protocol">
Online Certificate Status Protocol
</a>
(OCSP) helps verify the status of certificates managed by a third-party
<a href="https://en.wikipedia.org/wiki/Certificate_authority">
certificate authority
</a>
(CA). It tells you whether certificates are valid, revoked, or unknown.
</p>
<p>
Redis Enterprise Software v6.2.12 implements OCSP stapling, which allows clients to validate the status of a server proxy certificate. When OCSP is enabled, the Redis Enterprise server regularly polls the CA OCSP responder to determine a certificate's status. The response is cached until the next polling attempt; the cached value is served to clients during the
<a href="https://en.wikipedia.org/wiki/Transport_Layer_Security#TLS_handshake">
TLS handshake
</a>
.
</p>
<p>
To learn more, see
<a href="/docs/latest/operate/rs/security/certificates/ocsp-stapling/">
Enable OCSP stapling
</a>
.
</p>
</li>
<li>
<p>
Session and security attributes in the admin console
</p>
<p>
You can now use the admin console to configure
<a href="/docs/latest/operate/rs/security/access-control/manage-passwords/#password-complexity-rules">
password complexity rules
</a>
,
<a href="/docs/latest/operate/rs/security/access-control/manage-users/login-lockout/#user-login-lockout">
user login lockout
</a>
, and
<a href="/docs/latest/operate/rs/security/access-control/manage-users/login-lockout/#session-timeout">
session timeout
</a>
.
</p>
</li>
<li>
<p>
Mount point import enhancement
</p>
<p>
When importing data, Redis Enterprise copies files to a temporary directory on the node. For mount point import sources only, Redis Enterprise now reads files directly from the mount point. Because this import method does not copy files to a temporary directory, nodes do not require extra disk space. This new behavior is enabled by default and does not require configuration.
</p>
</li>
</ul>
<h2 id="version-changes">
Version changes
</h2>
<h3 id="prerequisites-and-notes">
Prerequisites and notes
</h3>
<ul>
<li>
<p>
You can
<a href="/docs/latest/operate/rs/installing-upgrading/upgrading/">
upgrade to v6.2.12
</a>
from Redis Enterprise Software v6.0 and later.
</p>
</li>
<li>
<p>
Refer to
<a href="/docs/latest/operate/rs/release-notes/rs-6-2-4-august-2021/">
v6.2.4 release notes
</a>
for important notes regarding changes made to the upgrade policy and how those changes might impct your experience.
</p>
</li>
<li>
<p>
Upgrades from versions earlier than v6.0 are not supported.
</p>
</li>
<li>
<p>
If you are using the earlier cluster-based LDAP mechanism, you
<em>
must
</em>
migrate to the role-based mechanism
<em>
before
</em>
upgrading to v6.2.12. For details, see
<a href="/docs/latest/operate/rs/security/access-control/ldap/migrate-to-role-based-ldap/">
Migrate to role-based LDAP
</a>
.
</p>
</li>
<li>
<p>
If you plan to upgrade your cluster to RHEL 8, see the
<a href="/docs/latest/operate/rs/release-notes/rs-6-2-8-october-2021/">
v6.2.8 release notes
</a>
for known limitations.
</p>
</li>
</ul>
<h3 id="future-deprecation-notice">
Future deprecation notice
</h3>
<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.
</p>
<p>
Please verify that all clients, apps, and connections support TLS 1.2. Support for the earlier protocols will be removed in a future release.
</p>
<p>
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>
<h3 id="product-lifecycle-updates">
Product lifecycle updates
</h3>
<p>
Redis Enterprise Software v6.0.x will reach end of life (EOL) on May 31, 2022.
</p>
<p>
To learn more, see the Redis Enterprise Software
<a href="/docs/latest/operate/rs/installing-upgrading/product-lifecycle/">
product lifecycle
</a>
, which details the release number and the end-of-life schedule for Redis Enterprise Software.
</p>
<p>
For Redis modules information and lifecycle, see
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/modules-lifecycle/">
Module lifecycle
</a>
.
</p>
<h2 id="redis-modules">
Redis modules
</h2>
<p>
Redis Enterprise Software v6.2.12 includes the following Redis modules:
</p>
<ul>
<li>
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisearch/">
RediSearch v2.4.9
</a>
</li>
<li>
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisjson/">
RedisJSON v2.0.11
</a>
</li>
<li>
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/bloom/release-notes/">
RedisBloom v2.2.17
</a>
</li>
<li>
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisgraph/">
RedisGraph v2.8.15
</a>
</li>
<li>
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redistimeseries/">
RedisTimeSeries v1.6.16
</a>
</li>
</ul>
<p>
For help upgrading a module, see
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/install/add-module-to-cluster/#upgrading-the-module-for-the-database">
Add a module to a cluster
</a>
.
</p>
<h2 id="interface-enhancements">
Interface enhancements
</h2>
<ul>
<li>
Allow creation and editing of sharded databases with a single shard. This lets you prepare for future scaling by ensuring your apps work in clustering mode, regardless of the actual number of configured shards
</li>
<li>
Enhanced the slowlog in the UI to display unprintable characters in RESTORE commands
</li>
<li>
Added support for custom paths when bootstrapping the cluster via the UI
</li>
<li>
Improve readability of geo-distributed log entries in the UI
</li>
</ul>
<h2 id="additional-enhancements">
Additional enhancements
</h2>
<ul>
<li>
Added support for the MODULE LIST command on Active-Active databases
</li>
<li>
Enhanced validity checks of the input parameters of the CRDB-CLI tool
</li>
</ul>
<h2 id="resolved-issues">
Resolved issues
</h2>
<ul>
<li>
RS38320 A failed task leaves the nodes list outdated in the UI
</li>
<li>
RS73768, RS72082 Increased certificate rotation timeout to allow it to finish
</li>
<li>
RS72466, RS68668 Fix false positive alerts for certification expiration
</li>
<li>
RS69256 Change pre-bootstrap default TLS version to 1.2
</li>
<li>
RS67133 Fixed replication for command RESTOREMODAUX
</li>
<li>
RS66468 Fixed βTest regex keysβ in the UI
</li>
<li>
RS58156 Fixed the installation to abort and alert when encountering issues in NTP
</li>
<li>
RS67935 Fixed releasing 30MB of memory when deleting an Active-Active database
</li>
<li>
RS64276 Fixed high memory consumption of the DMC output buffers when running CLIENT LIST
</li>
</ul>
<h2 id="known-limitations">
Known limitations
</h2>
<ul>
<li>
<p>
RS81463 A shard may crash when resharding an Active-Active database with Auto Tiering . Specifically, the shard will crash when volatile keys or Active-Active tombstone keys reside in Flash memory.
</p>
</li>
<li>
<p>
RS54131 Returning +OK reply from the QUIT command on a TLS enabled database
</p>
</li>
<li>
<p>
RS40641 - API requests are redirected to an internal IP in case the request arrives from a node which is not the master. To avoid this issue, use
<a href="/docs/latest/operate/rs/references/cli-utilities/rladmin/cluster/config/">
<code>
rladmin cluster config
</code>
</a>
to configure
<code>
handle_redirects
</code>
or
<code>
handle_metrics_redirects
</code>
.
</p>
</li>
</ul>
<h3 id="installation-limitations">
Installation limitations
</h3>
<p>
Several Redis Enterprise Software installation reference files are installed to the directory
<code>
/etc/opt/redislabs/
</code>
even if you use
<a href="/docs/latest/operate/rs/installing-upgrading/install/customize-install-directories/">
custom installation directories
</a>
.
</p>
<p>
As a workaround to install Redis Enterprise Software without using any root directories, do the following before installing Redis Enterprise Software:
</p>
<ol>
<li>
<p>
Create all custom, non-root directories you want to use with Redis Enterprise Software.
</p>
</li>
<li>
<p>
Mount
<code>
/etc/opt/redislabs
</code>
to one of the custom, non-root directories.
</p>
</li>
</ol>
<h2 id="security">
Security
</h2>
<h3 id="open-source-redis-security-fixes-compatibility">
Open Source Redis Security fixes compatibility
</h3>
<p>
As part of Redis commitment to security, Redis Enterprise Software implements the latest
<a href="https://github.com/redis/redis/releases">
security fixes
</a>
available with open source Redis. The following
<a href="https://github.com/redis/redis">
Open Source Redis
</a>
<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-2022-24834">
CVE-2022-24834
</a>
- Redis Enterprise versions 6.2.12 and later are not impacted by the CVE that was found and fixed in open source Redis. A fix to prevent Lua scripts from causing heap overflow was implemented in Redis Enterprise version 6.2.12. Additional information about the open source Redis fix is on
<a href="https://github.com/redis/redis/releases">
the Redis GitHub page
</a>
(Redis 7.0.12, Redis 6.2.13, Redis 6.0.20)
</p>
</li>
<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
<a href="https://github.com/redis/redis/releases">
the 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
<a href="https://github.com/redis/redis/releases">
the 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
<a href="https://github.com/redis/redis/releases">
the 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
<a href="https://github.com/redis/redis/releases">
the 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 proto-max-bulk-len CONFIG is blocked in Redis Enterprise. Additional information about the open source Redis fix is on
<a href="https://github.com/redis/redis/releases">
the Redis GitHub page
</a>
(Redis 6.2.6, Redis 6.0.16) security fixes for
<a href="https://github.com/redis/redis/security/advisories">
recent CVEs
</a>
.
</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-2-12/"/>
<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/certificates/ocsp-stapling/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Enable OCSP stapling
</h1>
<p class="text-lg -mt-5 mb-10">
Use OCSP stapling to verify certificates maintained by a third-party CA and authenticate connection attempts between clients and servers.
</p>
<p>
OCSP (
<a href="https://en.wikipedia.org/wiki/Online_Certificate_Status_Protocol">
Online Certificate Status Protocol
</a>
) lets a client or server verify the status (
<code>
GOOD
</code>
,
<code>
REVOKED
</code>
, or
<code>
UNKNOWN
</code>
) of a certificate maintained by a third-party
<a href="https://en.wikipedia.org/wiki/Certificate_authority">
certificate authority (CA)
</a>
.
</p>
<p>
To check whether a certificate is still valid or has been revoked, a client or server can send a request to the CA's OCSP server (also called an OCSP responder). The OCSP responder checks the certificate's status in the CA's
<a href="https://en.wikipedia.org/wiki/Certificate_revocation_list">
certificate revocation list
</a>
and sends the status back as a signed and timestamped response.
</p>
<h2 id="ocsp-stapling-overview">
OCSP stapling overview
</h2>
<p>
With OCSP enabled, the Redis Enterprise server regularly polls the CA's OCSP responder for the certificate's status. After it receives the response, the server caches this status until its next polling attempt.
</p>
<p>
When a client tries to connect to the Redis Enterprise server, they perform a
<a href="https://en.wikipedia.org/wiki/Transport_Layer_Security#TLS_handshake">
TLS handshake
</a>
to authenticate the server and create a secure, encrypted connection. During the TLS handshake,
<a href="https://en.wikipedia.org/wiki/OCSP_stapling">
OCSP stapling
</a>
lets the Redis Enterprise server send (or "staple") the cached certificate status to the client.
</p>
<p>
If the stapled OCSP response confirms the certificate is still valid, the TLS handshake succeeds and the client connects to the server.
</p>
<p>
The TLS handshake fails and the client blocks the connection to the server if the stapled OCSP response indicates either:
</p>
<ul>
<li>
<p>
The certificate has been revoked.
</p>
</li>
<li>
<p>
The certificate's status is unknown. This can happen if the OCSP responder fails to send a response.
</p>
</li>
</ul>
<h2 id="set-up-ocsp-stapling">
Set up OCSP stapling
</h2>
<p>
You can configure and enable OCSP stapling for your Redis Enterprise cluster with the
<a href="#cluster-manager-ui-method">
Cluster Manager UI
</a>
, the
<a href="#rest-api-method">
REST API
</a>
, or
<a href="#rladmin-method">
<code>
rladmin
</code>
</a>
.
</p>
<p>
While OCSP is enabled, the server always staples the cached OCSP status when a client tries to connect. It is the client's responsibility to use the stapled OCSP status. Some Redis clients, such as
<a href="https://github.com/redis/jedis">
Jedis
</a>
and
<a href="https://github.com/redis/redis-py">
redis-py
</a>
, already support OCSP stapling, but others might require additional configuration.
</p>
<h3 id="cluster-manager-ui-method">
Cluster Manager UI method
</h3>
<p>
To set up OCSP stapling with the Redis Enterprise Cluster Manager UI:
</p>
<ol>
<li>
<p>
Go to
<strong>
Cluster > Security > OCSP
</strong>
.
</p>
</li>
<li>
<p>
In the
<strong>
Responder URI
</strong>
section, select
<strong>
Replace Certificate
</strong>
to update the proxy certificate.
</p>
</li>
<li>
<p>
Provide the key and certificate signed by your third-party CA, then select
<strong>
Save
</strong>
.
</p>
</li>
<li>
<p>
Configure query settings if you don't want to use their default values:
</p>
<table>
<thead>
<tr>
<th>
Name
</th>
<th>
Default value
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<strong>
Query frequency
</strong>
</td>
<td>
1 hour
</td>
<td>
The time interval between OCSP queries to the responder URI.
</td>
</tr>
<tr>
<td>
<strong>
Response timeout
</strong>
</td>
<td>
1 second
</td>
<td>
The time interval in seconds to wait for a response before timing out.
</td>
</tr>
<tr>
<td>
<strong>
Recovery frequency
</strong>
</td>
<td>
1 minute
</td>
<td>
The time interval between retries after a failed query.
</td>
</tr>
<tr>
<td>
<strong>
Recovery maximum tries
</strong>
</td>
<td>
5
</td>
<td>
The number of retries before the validation query fails and invalidates the certificate.
</td>
</tr>
</tbody>
</table>
</li>
<li>
<p>
Select
<strong>
Enable
</strong>
to turn on OCSP stapling.
</p>
</li>
</ol>
<h3 id="rest-api-method">
REST API method
</h3>
<p>
To set up OCSP stapling with the
<a href="/docs/latest/operate/rs/references/rest-api/">
REST API
</a>
:
</p>
<ol>
<li>
<p>
Use the REST API to
<a href="/docs/latest/operate/rs/security/certificates/updating-certificates/#use-the-rest-api">
replace the proxy certificate
</a>
with a certificate signed by your third-party CA.
</p>
</li>
<li>
<p>
To configure and enable OCSP, send a
<a href="/docs/latest/operate/rs/references/rest-api/requests/ocsp/#put-ocsp">
<code>
PUT
</code>
request to the
<code>
/v1/ocsp
</code>
</a>
endpoint and include an
<a href="/docs/latest/operate/rs/references/rest-api/objects/ocsp/">
OCSP JSON object
</a>
in the request body:
</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">"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">3600</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">1</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">60</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">5</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span></code></pre>
</div>
</li>
</ol>
<h3 id="rladmin-method">
<code>
rladmin
</code>
method
</h3>
<p>
To set up OCSP stapling with the
<a href="/docs/latest/operate/rs/references/cli-utilities/rladmin/">
<code>
rladmin
</code>
</a>
command-line utility:
</p>
<ol>
<li>
<p>
Use
<a href="/docs/latest/operate/rs/references/cli-utilities/rladmin/cluster/certificate/">
<code>
rladmin
</code>
</a>
to
<a href="/docs/latest/operate/rs/security/certificates/updating-certificates/#use-the-cli">
replace the proxy certificate
</a>
with a certificate signed by your third-party CA.
</p>
</li>
<li>
<p>
Update the cluster's OCSP settings with the
<a href="/docs/latest/operate/rs/references/cli-utilities/rladmin/cluster/ocsp/#ocsp-config">
<code>
rladmin cluster ocsp config
</code>
</a>
command if you don't want to use their default values.
</p>
<p>
For example:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin cluster ocsp config recovery_frequency <span class="nb">set</span> <span class="m">30</span>
</span></span></code></pre>
</div>
</li>
<li>
<p>
Enable OCSP:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin cluster ocsp config ocsp_functionality <span class="nb">set</span> enabled
</span></span></code></pre>
</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/security/certificates/ocsp-stapling/"/>
<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/redisearch/redisearch-1.2-release-notes/.html | <section class="prose w-full py-12 max-w-none">
<h1>
RediSearch 1.2 release notes
</h1>
<p class="text-lg -mt-5 mb-10">
Aggregation filters. Query attributes. Fuzzy matching. Conditional updates. Backslash escaping. Synonyms support.
</p>
<h2 id="requirements">
Requirements
</h2>
<p>
RediSearch v1.2.0 requires:
</p>
<ul>
<li>
Minimum Redis compatibility version (database): 4.0.0
</li>
<li>
Minimum Redis Enterprise Software version (cluster): 5.0.0
</li>
</ul>
<h2 id="redisearch-120-june-2018">
RediSearch 1.2.0 (June 2018)
</h2>
<p>
This version is the last version that I (@dvirsky) will be releasing, and it includes a lot of new cool features, and actually NO bug-fixes over 1.1.0! So long and thanks for all the fish!
</p>
<h3 id="new-features">
New features
</h3>
<h4 id="aggregation-filters">
Aggregation filters
</h4>
<p>
As an addition to the aggregation API in
<code>
FT.AGGREGATE
</code>
, it is possible to do post-index filtering of the pipeline, using the
<code>
FILTER
</code>
keyword. e.g.:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">FT.AGGREGATE idx <span class="s2">"*"</span>
</span></span><span class="line"><span class="cl"> GROUPBY <span class="m">1</span> @foo
</span></span><span class="line"><span class="cl"> REDUCE count <span class="m">0</span> AS num
</span></span><span class="line"><span class="cl"> FILTER <span class="s2">"@num < 100"</span>
</span></span></code></pre>
</div>
<p>
See
<a href="http://redisearch.io/Aggregations/">
http://redisearch.io/Aggregations/
</a>
for more details.
</p>
<h4 id="query-attributes">
Query attributes
</h4>
<p>
It is now possible to apply specific query modifying attributes to specific clauses of the query (see #
<a href="https://github.com/RediSearch/RediSearch/issues/212">
212
</a>
).
</p>
<p>
The syntax is
<code>
(foo bar) => { $attribute: value; $attribute:value; ...}
</code>
, e.g:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl"><span class="o">(</span>foo bar<span class="o">)</span> <span class="o">=</span>> <span class="o">{</span> <span class="nv">$weight</span>: 2.0<span class="p">;</span> <span class="nv">$slop</span>: <span class="m">1</span> <span class="o">}</span>
</span></span><span class="line"><span class="cl">~<span class="o">(</span>bar baz<span class="o">)</span> <span class="o">=</span>> <span class="o">{</span> <span class="nv">$weight</span>: 0.5<span class="p">;</span> <span class="o">}</span>
</span></span></code></pre>
</div>
<p>
The supported attributes are:
</p>
<ol>
<li>
$weight: determines the weight of the sub-query or token in the overall ranking on the result.
</li>
<li>
$slop: determines the maximum allowed "slop" (space between terms) in the query clause.
</li>
<li>
$inorder: whether or not the terms in a query clause must appear in the same order as in the query.
</li>
</ol>
<h4 id="fuzzy-matching">
Fuzzy matching
</h4>
<p>
Wrapping a search term with
<code>
%
</code>
will cause the index to expand the query to terms that are within an Edit Distance of 1 from the original term. For example, querying for
<code>
%redis%
</code>
will expand it to query for
<code>
redis, jedis, credis, predis
</code>
, etc (provided the terms appear in documents in the index).
</p>
<p>
Notice that each query term needs to be wrapped independently, and that we limit the maximum amount of expansions to 200 per term, as this hurts performance significantly.
</p>
<h4 id="conditional-updates">
Conditional updates
</h4>
<p>
It is now possible to update documents (
<code>
FT.ADD ... REPLACE [PARTIAL]
</code>
) only if a certain condition is met regarding the document's state
<strong>
before
</strong>
the updates. So for example, if our document has a timestamp field, and we would like to update its title only if the timestamp is below a certain value, we can do the following:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">FT.ADD myIndex myDoc 1.0
</span></span><span class="line"><span class="cl"> REPLACE PARTIAL
</span></span><span class="line"><span class="cl"> IF <span class="s2">"@timestamp < 12313134523"</span>
</span></span><span class="line"><span class="cl"> FIELDS
</span></span><span class="line"><span class="cl"> title <span class="s2">"new title"</span>
</span></span></code></pre>
</div>
<h4 id="backslash-escaping">
Backslash escaping
</h4>
<p>
Following several user requests, it is now possible to escape separator characters in documents (it is already done in the query itself), and avoid tokenization when needed.
</p>
<p>
For example, indexing the text
<code>
hello\-world hello world
</code>
will create the tokenization
<code>
["hello-world", "hello", "world"]
</code>
. Notice that in most languages and in redis-cli, you will need to escape the backslash itself, so instead of
<code>
hello\-world
</code>
you will need to send the string
<code>
hello\\-world
</code>
.
</p>
<p>
The same goes to the query string: If the document contains the token
<code>
hello-world
</code>
, it can be found by running in redis-cli: `FT.SEARCH idx "hello\-world", which will cause the query not to be separated.
</p>
<h4 id="synonyms-support">
Synonyms support
</h4>
<p>
It is now possible to provide the index with synonym groups (.e.g boy, child, kid), and have it automatically index synonymous terms so that searching for one will return documents containing another.
</p>
<p>
See
<a href="http://redisearch.io/Synonyms/">
http://redisearch.io/Synonyms/
</a>
for more details and examples.
</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/release-notes/redisearch/redisearch-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/oss_and_stack/stack-with-enterprise/gears-v1/jvm/classes/readers/keysreader/.html | <section class="prose w-full py-12 max-w-none">
<h1>
KeysReader
</h1>
<p class="text-lg -mt-5 mb-10">
Gets keys and their values from a database.
</p>
<p>
Creates records from the keys and values stored in a Redis database.
</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>
Currently only supports string and hash data types. For other data types, it will only extract the key name.
</div>
</div>
<h2 id="constructors">
Constructors
</h2>
<p>
You can use one of these constructors to create a new
<code>
KeysReader
</code>
object:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-java" data-lang="java"><span class="line"><span class="cl"><span class="kd">public</span> <span class="nf">KeysReader</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="nf">KeysReader</span><span class="o">(</span><span class="n">String</span> <span class="n">pattern</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="nf">KeysReader</span><span class="o">(</span><span class="n">String</span> <span class="n">prefix</span><span class="o">,</span> <span class="kt">boolean</span> <span class="n">readValues</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="nf">KeysReader</span><span class="o">(</span><span class="n">String</span> <span class="n">pattern</span><span class="o">,</span> <span class="kt">boolean</span> <span class="n">noScan</span><span class="o">,</span> <span class="kt">boolean</span> <span class="n">readValues</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="nf">KeysReader</span><span class="o">(</span><span class="n">String</span> <span class="n">prefix</span><span class="o">,</span>
</span></span><span class="line"><span class="cl"> <span class="kt">boolean</span> <span class="n">readValues</span><span class="o">,</span>
</span></span><span class="line"><span class="cl"> <span class="n">String</span><span class="o">[]</span> <span class="n">eventTypes</span><span class="o">,</span>
</span></span><span class="line"><span class="cl"> <span class="n">String</span><span class="o">[]</span> <span class="n">keyTypes</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="nf">KeysReader</span><span class="o">(</span><span class="n">String</span> <span class="n">pattern</span><span class="o">,</span>
</span></span><span class="line"><span class="cl"> <span class="kt">boolean</span> <span class="n">noScan</span><span class="o">,</span>
</span></span><span class="line"><span class="cl"> <span class="kt">boolean</span> <span class="n">readValues</span><span class="o">,</span>
</span></span><span class="line"><span class="cl"> <span class="n">String</span><span class="o">[]</span> <span class="n">eventTypes</span><span class="o">,</span>
</span></span><span class="line"><span class="cl"> <span class="n">String</span><span class="o">[]</span> <span class="n">keyTypes</span><span class="o">)</span>
</span></span></code></pre>
</div>
<h2 id="parameters">
Parameters
</h2>
<table>
<thead>
<tr>
<th>
Name
</th>
<th>
Type
</th>
<th>
Default value
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
commands
</td>
<td>
array of strings
</td>
<td>
null
</td>
<td>
The commands that this reader is registered on
</td>
</tr>
<tr>
<td>
eventTypes
</td>
<td>
array of strings
</td>
<td>
null
</td>
<td>
The
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/gears-v1/register-events/#event-types">
event types
</a>
to register on (usually the command name)
</td>
</tr>
<tr>
<td>
keyTypes
</td>
<td>
array of strings
</td>
<td>
null
</td>
<td>
The key types to register on
</td>
</tr>
<tr>
<td>
noScan
</td>
<td>
boolean
</td>
<td>
false
</td>
<td>
Whether or not to scan the key space or just read the pattern as is
</td>
</tr>
<tr>
<td>
pattern/prefix
</td>
<td>
string
</td>
<td>
"*" (match all keys)
</td>
<td>
The reader will get all keys that match this pattern
</td>
</tr>
<tr>
<td>
readValues
</td>
<td>
boolean
</td>
<td>
true
</td>
<td>
Whether or not to read the keys' values
</td>
</tr>
</tbody>
</table>
<h2 id="output-records">
Output records
</h2>
<p>
Creates a
<code>
KeysReaderRecord
</code>
for each matching key in the database.
</p>
<table>
<thead>
<tr>
<th>
Name
</th>
<th>
Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
key
</td>
<td>
string
</td>
<td>
The name of the key
</td>
</tr>
<tr>
<td>
type
</td>
<td>
long
</td>
<td>
The core Redis type: 'string', 'hash', 'list', 'set', 'zset', or 'stream'
</td>
</tr>
<tr>
<td>
event
</td>
<td>
string
</td>
<td>
The event that triggered the execution (null if using the run function)
</td>
</tr>
<tr>
<td>
stringVal
</td>
<td>
string
</td>
<td>
The key's value for string data types
</td>
</tr>
<tr>
<td>
hashVal
</td>
<td>
Map<String,String>
</td>
<td>
The key's value for hash data types
</td>
</tr>
<tr>
<td>
listVal
</td>
<td>
List
<string>
</string>
</td>
<td>
The key's value for list data types
</td>
</tr>
<tr>
<td>
setVal
</td>
<td>
Set
<string>
</string>
</td>
<td>
The key's value for set data types
</td>
</tr>
</tbody>
</table>
<h2 id="examples">
Examples
</h2>
<p>
Here's a basic example of a
<code>
KeysReader
</code>
that creates records for all keys in the database:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-java" data-lang="java"><span class="line"><span class="cl"><span class="n">KeysReader</span> <span class="n">reader</span> <span class="o">=</span> <span class="k">new</span> <span class="n">KeysReader</span><span class="o">();</span>
</span></span></code></pre>
</div>
<p>
In the following example, the
<code>
KeysReader
</code>
creates records for all keys in the database that start with "person:". When registered, it only runs for hashes after
<code>
HSET
</code>
and
<code>
DEL
</code>
events occur.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-java" data-lang="java"><span class="line"><span class="cl"><span class="n">String</span><span class="o">[]</span> <span class="n">eventTypes</span> <span class="o">=</span> <span class="o">{</span><span class="s">"HSET"</span><span class="o">,</span> <span class="s">"DEL"</span><span class="o">};</span>
</span></span><span class="line"><span class="cl"><span class="n">String</span><span class="o">[]</span> <span class="n">keyTypes</span> <span class="o">=</span> <span class="o">{</span><span class="s">"HASH"</span><span class="o">};</span>
</span></span><span class="line"><span class="cl"><span class="n">KeysReader</span> <span class="n">reader</span> <span class="o">=</span> <span class="k">new</span> <span class="n">KeysReader</span><span class="o">(</span><span class="s">"person:*"</span><span class="o">,</span> <span class="kc">false</span><span class="o">,</span> <span class="kc">true</span><span class="o">,</span> <span class="n">eventTypes</span><span class="o">,</span> <span class="n">keyTypes</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/oss_and_stack/stack-with-enterprise/gears-v1/jvm/classes/readers/keysreader/"/>
<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/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Redis reference
</h1>
<p class="text-lg -mt-5 mb-10">
Specifications and protocols
</p>
<nav>
<a href="/docs/latest/develop/reference/command-tips/">
Redis command tips
</a>
<p>
Get additional information about a command
</p>
<a href="/docs/latest/develop/reference/client-side-caching/">
Client-side caching reference
</a>
<p>
Server-assisted, client-side caching in Redis
</p>
<a href="/docs/latest/develop/reference/modules/">
Redis modules API
</a>
<p>
Introduction to writing Redis modules
</p>
<a href="/docs/latest/develop/reference/sentinel-clients/">
Sentinel client spec
</a>
<p>
How to build clients for Redis Sentinel
</p>
<a href="/docs/latest/develop/reference/key-specs/">
Command key specifications
</a>
<p>
What are command key specification and how to use them in your client
</p>
<a href="/docs/latest/develop/reference/protocol-spec/">
Redis serialization protocol specification
</a>
<p>
Redis serialization protocol (RESP) is the wire protocol that clients implement
</p>
<a href="/docs/latest/develop/reference/clients/">
Redis client handling
</a>
<p>
How the Redis server manages client connections
</p>
<a href="/docs/latest/develop/reference/eviction/">
Key eviction
</a>
<p>
Overview of Redis key eviction policies (LRU, LFU, etc.)
</p>
<a href="/docs/latest/develop/reference/command-arguments/">
Redis command arguments
</a>
<p>
How Redis commands expose their documentation programmatically
</p>
<a href="/docs/latest/develop/reference/gopher/">
Redis and the Gopher protocol
</a>
<p>
The Redis Gopher protocol implementation
</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/reference/"/>
<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-2-18-releases/rs-6-2-18-65/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Redis Enterprise Software release notes 6.2.18-65 (December 2022)
</h1>
<p class="text-lg -mt-5 mb-10">
Added To field to test email server alerts. New flag to skip cluster resource validation during imports. Improved error messages.
</p>
<p>
This is a maintenance release for β
<a href="https://redis.com/redis-enterprise-software/download-center/software/">
βRedis Enterprise Software version 6.2.18
</a>
.
</p>
<p>
The following table shows the MD5 checksums for the available packages:
</p>
<table>
<thead>
<tr>
<th style="text-align:left">
Package
</th>
<th style="text-align:left">
MD5 checksum (6.2.18-65 December release)
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">
Ubuntu 16
</td>
<td style="text-align:left">
<code>
515c7bbc97eaf1939757c8894eda9523
</code>
</td>
</tr>
<tr>
<td style="text-align:left">
Ubuntu 18
</td>
<td style="text-align:left">
<code>
830e8704c0f6902a04df9ff53cc5e41f
</code>
</td>
</tr>
<tr>
<td style="text-align:left">
RedHat Enterprise Linux (RHEL) 7
<br/>
Oracle Enterprise Linux (OL) 7
</td>
<td style="text-align:left">
<code>
b51d13e30f4a7e1a134982342b8865b0
</code>
</td>
</tr>
<tr>
<td style="text-align:left">
RedHat Enterprise Linux (RHEL) 8
<br/>
Oracle Enterprise Linux (OL) 8
</td>
<td style="text-align:left">
<code>
762f907c1f0e6e0e88e4ae5bf967e143
</code>
</td>
</tr>
</tbody>
</table>
<h2 id="new-features-and-enhancements">
New features and enhancements
</h2>
<ul>
<li>
When setting up an alert email server in the UI: added a
<code>
To
</code>
field to the
<code>
test email server
</code>
function (RS86119)
</li>
<li>
Added a new flag to skip cluster resource validation when performing import (RS88086)
</li>
<li>
Enhanced error message information for connection handling
</li>
<li>
Added logging details to
<code>
insufficient_resources
</code>
planner error
</li>
</ul>
<h4 id="redis-modules">
Redis modules
</h4>
<p>
Redis Enterprise Software v6.2.18-65 (December release) includes newer versions of the following Redis modules:
</p>
<ul>
<li>
<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>
</li>
<li>
<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>
</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>
<h2 id="resolved-issues">
Resolved issues
</h2>
<ul>
<li>
RS87191 - Fixes syncer stop due to cross slot violation error in Auto Tiering
</li>
</ul>
<h2 id="known-upgrade-limitations">
Known upgrade limitations
</h2>
<p>
Before you upgrade a cluster that hosts Active-Active databases with modules to v6.2.18, 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>
<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-2-18-releases/rs-6-2-18-65/"/>
<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-reply/.html | <section class="prose w-full py-12">
<h1 class="command-name">
CLIENT REPLY
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">CLIENT REPLY <ON | OFF | SKIP></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.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>
Sometimes it can be useful for clients to completely disable replies from the Redis server. For example when the client sends fire and forget commands or performs a mass loading of data, or in caching contexts where new data is streamed constantly. In such contexts to use server time and bandwidth in order to send back replies to clients, which are going to be ignored, is considered wasteful.
</p>
<p>
The
<code>
CLIENT REPLY
</code>
command controls whether the server will reply the client's commands. The following modes are available:
</p>
<ul>
<li>
<code>
ON
</code>
. This is the default mode in which the server returns a reply to every command.
</li>
<li>
<code>
OFF
</code>
. In this mode the server will not reply to client commands.
</li>
<li>
<code>
SKIP
</code>
. This mode skips the reply of command immediately after it.
</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>
when called with
<code>
ON
</code>
. When called with either
<code>
OFF
</code>
or
<code>
SKIP
</code>
sub-commands, no reply is made.
<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-reply/"/>
<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/nodes/alerts/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Node alerts requests
</h1>
<p class="text-lg -mt-5 mb-10">
Node alert requests
</p>
<table>
<thead>
<tr>
<th>
Method
</th>
<th>
Path
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="#get-all-nodes-alerts">
GET
</a>
</td>
<td>
<code>
/v1/nodes/alerts
</code>
</td>
<td>
Get all alert states for all nodes
</td>
</tr>
<tr>
<td>
<a href="#get-node-alerts">
GET
</a>
</td>
<td>
<code>
/v1/nodes/alerts/{uid}
</code>
</td>
<td>
Get all alert states for a node
</td>
</tr>
<tr>
<td>
<a href="#get-node-alert">
GET
</a>
</td>
<td>
<code>
/v1/nodes/alerts/{uid}/{alert}
</code>
</td>
<td>
Get node alert state
</td>
</tr>
</tbody>
</table>
<h2 id="get-all-nodes-alerts">
Get all alert states
</h2>
<pre><code>GET /v1/nodes/alerts
</code></pre>
<p>
Get all alert states for all nodes.
</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_all_nodes_alerts">
view_all_nodes_alerts
</a>
</td>
</tr>
</tbody>
</table>
<h3 id="get-all-request">
Request
</h3>
<h4 id="example-http-request">
Example HTTP request
</h4>
<pre><code>GET /nodes/alerts
</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="query-parameters">
Query parameters
</h4>
<table>
<thead>
<tr>
<th>
Field
</th>
<th>
Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
ignore_settings
</td>
<td>
boolean
</td>
<td>
Retrieve updated alert state regardless of the cluster's alert_settings. When not present, a disabled alert will always be retrieved as disabled with a false state. (optional)
</td>
</tr>
</tbody>
</table>
<h3 id="get-all-response">
Response
</h3>
<p>
Returns a hash of node UIDs and the
<a href="/docs/latest/operate/rs/7.4/references/rest-api/objects/alert/">
alert states
</a>
for each node.
</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">"1"</span><span class="p">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"node_cpu_utilization"</span><span class="p">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"change_time"</span><span class="p">:</span> <span class="s2">"2014-12-22T10:42:00Z"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"change_value"</span><span class="p">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"cpu_util"</span><span class="p">:</span> <span class="mf">2.500000000145519</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"global_threshold"</span><span class="p">:</span> <span class="s2">"1"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"state"</span><span class="p">:</span> <span class="kc">true</span>
</span></span><span class="line"><span class="cl"> <span class="p">},</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"enabled"</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">"state"</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">"severity"</span><span class="p">:</span> <span class="s2">"WARNING"</span>
</span></span><span class="line"><span class="cl"> <span class="p">},</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"..."</span>
</span></span><span class="line"><span class="cl"> <span class="p">},</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"..."</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span></code></pre>
</div>
<h3 id="get-all-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>
</tbody>
</table>
<h2 id="get-node-alerts">
Get node alert states
</h2>
<pre><code>GET /v1/nodes/alerts/{int: uid}
</code></pre>
<p>
Get all alert states for a node.
</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/#view_node_alerts">
view_node_alerts
</a>
</td>
</tr>
</tbody>
</table>
<h3 id="get-request-all-alerts">
Request
</h3>
<h4 id="example-http-request-1">
Example HTTP request
</h4>
<pre><code>GET /nodes/alerts/1
</code></pre>
<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="query-parameters-1">
Query parameters
</h4>
<table>
<thead>
<tr>
<th>
Field
</th>
<th>
Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
ignore_settings
</td>
<td>
boolean
</td>
<td>
Retrieve updated alert state regardless of the cluster's alert_settings. When not present, a disabled alert will always be retrieved as disabled with a false state. (optional)
</td>
</tr>
</tbody>
</table>
<h3 id="get-response-all-alerts">
Response
</h3>
<p>
Returns a hash of
<a href="/docs/latest/operate/rs/7.4/references/rest-api/objects/alert/">
alert objects
</a>
and their states for a specific node.
</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">"node_cpu_utilization"</span><span class="p">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"change_time"</span><span class="p">:</span> <span class="s2">"2014-12-22T10:42:00Z"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"change_value"</span><span class="p">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"cpu_util"</span><span class="p">:</span> <span class="mf">2.500000000145519</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"global_threshold"</span><span class="p">:</span> <span class="s2">"1"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"state"</span><span class="p">:</span> <span class="kc">true</span>
</span></span><span class="line"><span class="cl"> <span class="p">},</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"enabled"</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">"state"</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">"severity"</span><span class="p">:</span> <span class="s2">"WARNING"</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">"..."</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span></code></pre>
</div>
<h3 id="get-status-codes-all-alerts">
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>
Specified node does not exist
</td>
</tr>
</tbody>
</table>
<h2 id="get-node-alert">
Get node alert state
</h2>
<pre><code>GET /v1/nodes/alerts/{int: uid}/{alert}
</code></pre>
<p>
Get a node alert state.
</p>
<h4 id="required-permissions-2">
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_node_alerts">
view_node_alerts
</a>
</td>
</tr>
</tbody>
</table>
<h3 id="get-request">
Request
</h3>
<h4 id="example-http-request-2">
Example HTTP request
</h4>
<pre><code>GET /nodes/alerts/1/node_cpu_utilization
</code></pre>
<h4 id="request-headers-2">
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="query-parameters-2">
Query parameters
</h4>
<table>
<thead>
<tr>
<th>
Field
</th>
<th>
Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
ignore_settings
</td>
<td>
boolean
</td>
<td>
Retrieve updated alert state regardless of the cluster's alert_settings. When not present, a disabled alert will always be retrieved as disabled with a false state. (optional)
</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/alert/">
alert object
</a>
.
</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">"change_time"</span><span class="p">:</span> <span class="s2">"2014-12-22T10:42:00Z"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"change_value"</span><span class="p">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"cpu_util"</span><span class="p">:</span> <span class="mf">2.500000000145519</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"global_threshold"</span><span class="p">:</span> <span class="s2">"1"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"state"</span><span class="p">:</span> <span class="kc">true</span>
</span></span><span class="line"><span class="cl"> <span class="p">},</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"enabled"</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">"state"</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">"severity"</span><span class="p">:</span> <span class="s2">"WARNING"</span><span class="p">,</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>
Specified alert or node 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/nodes/alerts/"/>
<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/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/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/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/oss_and_stack/stack-with-enterprise/release-notes/redisstack/redisstack-7.2-release-notes/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Redis Stack 7.2 release notes
</h1>
<p class="text-lg -mt-5 mb-10">
Redis Stack 7.2 release notes.
</p>
<h2 id="redis-stack-720-v13-october-2024">
Redis Stack 7.2.0-v13 (October 2024)
</h2>
<p>
This is a maintenance release for Redis Stack Server 7.2.0.
</p>
<p>
Update urgency:
<code>
SECURITY
</code>
: there are security fixes in the release.
</p>
<p>
<a href="https://hub.docker.com/r/redis/redis-stack">
Docker
</a>
|
<a href="https://redis.io/downloads/#stack">
Download
</a>
</p>
<h3 id="headlines">
Headlines:
</h3>
<p>
This version includes security fixes for the
<strong>
Redis
</strong>
server, addressing potential vulnerabilities such as an RCE when using Lua library components, and a denial-of-service (DoS) risk due to malformed ACL selectors or unbounded pattern matching.
Additionally, this maintenance release contains a bug fix to prevent crashes in cluster mode and includes the latest version of
<strong>
Redis Insight
</strong>
.
</p>
<h3 id="details">
Details:
</h3>
<p>
<strong>
Security and privacy
</strong>
</p>
<ul>
<li>
<strong>
Redis
</strong>
:
<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>
</li>
</ul>
<p>
<strong>
Bug Fixes
</strong>
</p>
<ul>
<li>
<p>
<strong>
Redis
</strong>
:
</p>
<ul>
<li>
[
<a href="https://github.com/redis/redis/pull/13315">
#13315
</a>
](
<a href="https://github.com/redis/redis/pull/13315">
https://github.com/redis/redis/pull/13315
</a>
) Fixed crashes in cluster mode
</li>
</ul>
</li>
<li>
<p>
<strong>
Redis version
</strong>
:
</p>
<ul>
<li>
<strong>
<a href="https://github.com/redis/redis/releases/tag/7.2.6">
Redis 7.2.6
</a>
</strong>
</li>
</ul>
</li>
</ul>
<p>
<strong>
Module versions
</strong>
</p>
<ul>
<li>
<strong>
<a href="https://github.com/RediSearch/RediSearch/releases/tag/v2.8.15">
RediSearch 2.8.15
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisJSON/RedisJSON/releases/tag/v2.6.11">
RedisJSON 2.6.11
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/releases/tag/v1.10.12">
RedisTimeSeries 1.10.13
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisBloom/RedisBloom/releases/tag/v2.6.12">
RedisBloom 2.6.12
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisGears/RedisGears/releases">
RedisGears 2.0.23
</a>
</strong>
</li>
</ul>
<p>
<strong>
Recommended Client Libraries
</strong>
</p>
<ul>
<li>
Java
<ul>
<li>
<a href="https://github.com/redis/jedis/releases/tag/v5.2.0">
Jedis 5.2.0 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/redis-om-spring/releases/tag/v0.9.5">
redis-om-spring 0.9.5 or greater
</a>
</li>
</ul>
</li>
<li>
Python
<ul>
<li>
<a href="https://github.com/redis/redis-py/releases/tag/v5.1.0">
redis-py 5.1.0 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/redis-om-python/releases/tag/v0.3.2">
redis-om-python 0.3.2 or greater
</a>
</li>
</ul>
</li>
<li>
NodeJS
<ul>
<li>
<a href="https://github.com/redis/node-redis/releases/tag/redis%404.7.0">
node-redis 4.7.0 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/redis-om-node/releases/tag/v0.2.0">
redis-om-node 0.2.0 or greater
</a>
</li>
</ul>
</li>
<li>
.NET
<ul>
<li>
<a href="https://github.com/redis/redis-om-dotnet/releases/tag/v0.7.4">
redis-om-dotnet 0.7.4 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/NRedisStack/releases/tag/v0.13.0">
NRedisStack 0.13.0 or greater
</a>
</li>
</ul>
</li>
<li>
Go
<ul>
<li>
<a href="https://github.com/redis/go-redis/releases/tag/v9.6.1">
go-redis 9.6.1 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/rueidis/releases/tag/v1.0.47">
rueidis 1.0.47 or greater
</a>
</li>
</ul>
</li>
</ul>
<p>
Compatible with
<a href="https://redis.io/download">
Redis Insight
</a>
. The docker image redis/redis-stack for this version is bundled with
<a href="https://github.com/RedisInsight/RedisInsight/releases/tag/2.58.0">
Redis Insight 2.58
</a>
.
</p>
<p>
Note: version numbers follow the pattern:
</p>
<p>
<code>
x.y.z-b
</code>
</p>
<ul>
<li>
<code>
x.y
</code>
Redis major version
</li>
<li>
<code>
z
</code>
increases with even numbers as a module x.y version increases.
</li>
<li>
<code>
b
</code>
denotes a patch to Redis or a module (any
<code>
z
</code>
of Redis modules).
<code>
b
</code>
will consist of a
<code>
v
</code>
+ numeric value.
</li>
</ul>
<h2 id="redis-stack-720-v12-august-2024">
Redis Stack 7.2.0-v12 (August 2024)
</h2>
<p>
This is a maintenance release for Redis Stack Server 7.2.0.
</p>
<p>
Update urgency:
<code>
HIGH
</code>
: There is a critical bug that may affect a subset of users. Upgrade!
</p>
<h3 id="headlines-1">
Headlines:
</h3>
<p>
The updated
<strong>
search and query
</strong>
version introduces several new features and important bug fixes, including a critical one. This new release of Redis Stack 7.2.0 also includes updated versions of
<strong>
JSON
</strong>
and
<strong>
time series
</strong>
data structures, each incorporating several bug fixes.
</p>
<p>
This maintenance release also contains the latest version of
<strong>
RedisInsight
</strong>
.
</p>
<h3 id="details-1">
Details:
</h3>
<p>
<strong>
Improvements
</strong>
</p>
<ul>
<li>
<strong>
Search and query
</strong>
:
<ul>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/4792">
#4792
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/4792">
https://github.com/RediSearch/RediSearch/pull/4792
</a>
) - Add character validations to simple string replies and escape it when required (MOD-7258)
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/4768">
#4768
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/4768">
https://github.com/RediSearch/RediSearch/pull/4768
</a>
) - Indicate which value is missing on the error message at the aggregation pipeline (MOD-7201)
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/4745">
#4745
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/4745">
https://github.com/RediSearch/RediSearch/pull/4745
</a>
) -
<code>
GROUPBY
</code>
recursion cleanup (MOD-7245)
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/4823">
#4823
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/4823">
https://github.com/RediSearch/RediSearch/pull/4823
</a>
) - Mechanism of keys expiration during the query execution clearing intermediate results
</li>
</ul>
</li>
</ul>
<p>
<strong>
Bug Fixes
</strong>
</p>
<ul>
<li>
<p>
<strong>
Search and query
</strong>
:
</p>
<ul>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/4754">
#4754
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/4754">
https://github.com/RediSearch/RediSearch/pull/4754
</a>
) - Correct return the maximum value for negative values when using
<code>
MAX
</code>
reducer (MOD-7252)
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/4737">
#4737
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/4737">
https://github.com/RediSearch/RediSearch/pull/4737
</a>
) - Separators ignored when escaping backslash
<code>
\
</code>
after the escaped character such as in
<code>
hello\\,world
</code>
ignoring
<code>
,
</code>
(MOD-7240)
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/4717">
#4717
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/4717">
https://github.com/RediSearch/RediSearch/pull/4717
</a>
) - Sorting by multiple fields
<code>
SORTBY 2 @field1 @field2
</code>
was ignoring the subsequent field(MOD-7206)
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/4803">
#4803
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/4803">
https://github.com/RediSearch/RediSearch/pull/4803
</a>
) - Keys expiring during query returning empty array (MOD-7010)
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/4794">
#4794
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/4794">
https://github.com/RediSearch/RediSearch/pull/4794
</a>
) - Index sanitiser (GC) trying to clean deleted numeric index could cause a crash (MOD-7303)
</li>
</ul>
</li>
<li>
<p>
<strong>
JSON
</strong>
:
</p>
<ul>
<li>
[
<a href="https://github.com/RedisJSON/RedisJSON/pull/1212">
#1212
</a>
](
<a href="https://github.com/RedisJSON/RedisJSON/pull/1212">
https://github.com/RedisJSON/RedisJSON/pull/1212
</a>
)
<code>
JSON.MSET
</code>
- AOF commands are duplicated multiple times (MOD-7293)
</li>
</ul>
</li>
<li>
<p>
<strong>
Time series
</strong>
:
</p>
<ul>
<li>
[
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/1607">
#1607
</a>
](
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/1607">
https://github.com/RedisTimeSeries/RedisTimeSeries/pull/1607
</a>
) Potential crash after deleting and recreating a source key of a compaction rule (MOD-7338)
</li>
<li>
[
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/1610">
#1610
</a>
](
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/1610">
https://github.com/RedisTimeSeries/RedisTimeSeries/pull/1610
</a>
)
<code>
COUNT
</code>
argument accepts non-positive values (MOD-5413)
</li>
</ul>
</li>
<li>
<p>
<strong>
Redis version
</strong>
:
</p>
<ul>
<li>
<strong>
<a href="https://github.com/redis/redis/releases/tag/7.2.5">
Redis 7.2.5
</a>
</strong>
</li>
</ul>
</li>
</ul>
<p>
<strong>
Module versions
</strong>
</p>
<ul>
<li>
<strong>
<a href="https://github.com/RediSearch/RediSearch/releases/tag/v2.8.15">
RediSearch 2.8.15
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisJSON/RedisJSON/releases/tag/v2.6.11">
RedisJSON 2.6.11
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/releases/tag/v1.10.12">
RedisTimeSeries 1.10.13
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisBloom/RedisBloom/releases/tag/v2.6.12">
RedisBloom 2.6.12
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisGears/RedisGears/releases">
RedisGears 2.0.23
</a>
</strong>
</li>
</ul>
<p>
<strong>
Recommended Client Libraries
</strong>
</p>
<ul>
<li>
Java
<ul>
<li>
<a href="https://github.com/redis/jedis/releases/tag/v5.1.4">
Jedis 5.1.4 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/redis-om-spring/releases/tag/v0.9.4">
redis-om-spring 0.9.4 or greater
</a>
</li>
</ul>
</li>
<li>
Python
<ul>
<li>
<a href="https://github.com/redis/redis-py/releases/tag/v5.0.9">
redis-py 5.0.9 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/redis-om-python/releases/tag/v0.3.1">
redis-om-python 0.3.1 or greater
</a>
</li>
</ul>
</li>
<li>
NodeJS
<ul>
<li>
<a href="https://github.com/redis/node-redis/releases/tag/redis%404.7.0">
node-redis 4.7.0 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/redis-om-node/releases/tag/v0.2.0">
redis-om-node 0.2.0 or greater
</a>
</li>
</ul>
</li>
<li>
.NET
<ul>
<li>
<a href="https://github.com/redis/redis-om-dotnet/releases/tag/v0.7.4">
redis-om-dotnet 0.7.4 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/NRedisStack/releases/tag/v0.12.0">
NRedisStack 0.12.0 or greater
</a>
</li>
</ul>
</li>
<li>
Go
<ul>
<li>
<a href="https://github.com/redis/go-redis/releases/tag/v9.6.1">
go-redis 9.6.1 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/rueidis/releases/tag/v1.0.43">
rueidis 1.0.43 or greater
</a>
</li>
</ul>
</li>
</ul>
<p>
Compatible with
<a href="https://redis.io/download">
Redis Insight
</a>
. The docker image redis/redis-stack for this version is bundled with
<a href="https://github.com/RedisInsight/RedisInsight/releases/tag/2.54.0">
Redis Insight 2.54
</a>
.
</p>
<p>
Note: version numbers follow the pattern:
</p>
<p>
<code>
x.y.z-b
</code>
</p>
<ul>
<li>
<code>
x.y
</code>
Redis major version
</li>
<li>
<code>
z
</code>
increases with even numbers as a module x.y version increases.
</li>
<li>
<code>
b
</code>
denotes a patch to Redis or a module (any
<code>
z
</code>
of Redis or modules).
<code>
b
</code>
will consist of a
<code>
v
</code>
+ numeric value.
</li>
</ul>
<h2 id="redis-stack-720-v11-june-2024">
Redis Stack 7.2.0-v11 (June 2024)
</h2>
<p>
This is a maintenance release for Redis Stack Server 7.2.0.
</p>
<p>
Update urgency:
<code>
MODERATE
</code>
: Program an upgrade of the server, but it's not urgent.
</p>
<p>
<a href="https://hub.docker.com/r/redis/redis-stack">
Docker
</a>
|
<a href="https://redis.io/downloads/#stack">
Download
</a>
</p>
<h3 id="headlines-2">
Headlines:
</h3>
<p>
Redis Stack 7.2.0-v11 introduces a new version of the
<strong>
Redis
</strong>
server with several bug fixes, and an updated
<strong>
search and query
</strong>
capability with numerous enhancements and bug fixes.
</p>
<p>
The updated
<strong>
search and query
</strong>
version features improved memory reporting that accounts for additional memory consumed by
<code>
TAG
</code>
and
<code>
TEXT
</code>
tries, as well as enhanced memory counting for inverted indexes. Also, it includes additional fields in the
<code>
FT.INFO
</code>
command when used within a cluster.
</p>
<p>
This maintenance release also contains the latest version of
<strong>
RedisInsight
</strong>
.
</p>
<h3 id="details-2">
Details:
</h3>
<p>
<strong>
Improvements
</strong>
</p>
<ul>
<li>
<strong>
Search and query
</strong>
:
<ul>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/4595">
#4595
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/4595">
https://github.com/RediSearch/RediSearch/pull/4595
</a>
) - Report memory of the
<code>
TAG
</code>
and
<code>
TEXT
</code>
tries (MOD-5902)
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/4669">
#4669
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/4669">
https://github.com/RediSearch/RediSearch/pull/4669
</a>
) - Inverted index memory counting (MOD-5977,MOD-5866)
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/4687">
#4687
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/4687">
https://github.com/RediSearch/RediSearch/pull/4687
</a>
) - Add missing
<code>
FT.INFO
</code>
fields when used within a cluster (MOD-6920)
</li>
</ul>
</li>
</ul>
<p>
<strong>
Bug Fixes
</strong>
</p>
<ul>
<li>
<p>
<strong>
Redis
</strong>
:
</p>
<ul>
<li>
[
<a href="https://github.com/redis/redis/pull/12824">
#12824
</a>
](
<a href="https://github.com/redis/redis/pull/12824">
https://github.com/redis/redis/pull/12824
</a>
) A single shard cluster leaves failed replicas in CLUSTER SLOTS instead of removing them
</li>
<li>
[
<a href="https://github.com/redis/redis/pull/12955">
#12955
</a>
](
<a href="https://github.com/redis/redis/pull/12955">
https://github.com/redis/redis/pull/12955
</a>
) Crash in LSET command when replacing small items and exceeding 4GB
</li>
<li>
[
<a href="https://github.com/redis/redis/pull/13004">
#13004
</a>
](
<a href="https://github.com/redis/redis/pull/13004">
https://github.com/redis/redis/pull/13004
</a>
) Blocking commands timeout is reset due to re-processing command
</li>
<li>
[
<a href="https://github.com/redis/redis/pull/13115">
#13115
</a>
](
<a href="https://github.com/redis/redis/pull/13115">
https://github.com/redis/redis/pull/13115
</a>
) Conversion of numbers in Lua args to redis args can fail. Bug introduced in 7.2.0
</li>
</ul>
</li>
<li>
<p>
<strong>
CLI tools
</strong>
:
</p>
<ul>
<li>
[
<a href="https://github.com/redis/redis/pull/13092">
#13092
</a>
](
<a href="https://github.com/redis/redis/pull/13092">
https://github.com/redis/redis/pull/13092
</a>
) redis-cli: --count (for --scan, --bigkeys, etc) was ignored unless --pattern was also used
</li>
<li>
[
<a href="https://github.com/redis/redis/pull/12958">
#12958
</a>
](
<a href="https://github.com/redis/redis/pull/12958">
https://github.com/redis/redis/pull/12958
</a>
) redis-check-aof: incorrectly considering data in manifest format as MP-AOF
</li>
</ul>
</li>
<li>
<p>
<strong>
Search and query
</strong>
:
</p>
<ul>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/4614">
#4614
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/4614">
https://github.com/RediSearch/RediSearch/pull/4614
</a>
) - Shards become unresponsive when using
<code>
FT.AGGREGATE
</code>
with
<code>
APPLY 'split(...)'
</code>
(MOD-6759)
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/4556">
#4556
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/4556">
https://github.com/RediSearch/RediSearch/pull/4556
</a>
) -
<code>
FT.EXPLAIN
</code>
returns additional } when querying using wildcards (MOD-6768)
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/4646">
#4646
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/4646">
https://github.com/RediSearch/RediSearch/pull/4646
</a>
) -
<code>
FT.DROPINDEX
</code>
with
<code>
DD
</code>
flag deleted keys in one AA cluster but not the others (MOD-1855)
</li>
</ul>
</li>
<li>
<p>
<strong>
Redis version
</strong>
:
</p>
<ul>
<li>
<strong>
<a href="https://github.com/redis/redis/releases/tag/7.2.5">
Redis 7.2.5
</a>
</strong>
</li>
</ul>
</li>
</ul>
<p>
<strong>
Module versions
</strong>
</p>
<ul>
<li>
<strong>
<a href="https://github.com/RediSearch/RediSearch/releases/tag/v2.8.14">
RediSearch 2.8.14
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisJSON/RedisJSON/releases/tag/v2.6.10">
RedisJSON 2.6.10
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/releases/tag/v1.10.12">
RedisTimeSeries 1.10.12
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisBloom/RedisBloom/releases/tag/v2.6.12">
RedisBloom 2.6.12
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisGears/RedisGears/releases">
RedisGears 2.0.23
</a>
</strong>
</li>
</ul>
<p>
<strong>
Recommended Client Libraries
</strong>
</p>
<ul>
<li>
Java
<ul>
<li>
<a href="https://github.com/redis/jedis/releases/tag/v5.1.3">
Jedis 5.1.3 or later
</a>
</li>
<li>
<a href="https://github.com/redis/redis-om-spring/releases/tag/v0.9.1">
redis-om-spring 0.9.1 or later
</a>
</li>
</ul>
</li>
<li>
Python
<ul>
<li>
<a href="https://github.com/redis/redis-py/releases/tag/v5.0.5">
redis-py 5.0.5 or later
</a>
</li>
<li>
<a href="https://github.com/redis/redis-om-python/releases/tag/v0.3.1">
redis-om-python 0.3.1 or later
</a>
</li>
</ul>
</li>
<li>
NodeJS
<ul>
<li>
<a href="https://github.com/redis/node-redis/releases/tag/redis%404.6.14">
node-redis 4.6.14 or later
</a>
</li>
<li>
<a href="https://github.com/redis/redis-om-node/releases/tag/v0.2.0">
redis-om-node 0.2.0 or later
</a>
</li>
</ul>
</li>
<li>
.NET
<ul>
<li>
<a href="https://github.com/redis/redis-om-dotnet/releases/tag/v0.7.1">
redis-om-dotnet 0.7.1 or later
</a>
</li>
<li>
<a href="https://github.com/redis/NRedisStack/releases/tag/v0.12.0">
NRedisStack 0.12.0 or later
</a>
</li>
</ul>
</li>
<li>
Go
<ul>
<li>
<a href="https://github.com/redis/go-redis/releases/tag/v9.5.2">
go-redis 9.5.2 or later
</a>
</li>
<li>
<a href="https://github.com/redis/rueidis/releases/tag/v1.0.38">
rueidis 1.0.38 or later
</a>
</li>
</ul>
</li>
</ul>
<p>
Compatible with
<a href="https://redis.io/download">
Redis Insight
</a>
. The docker image redis/redis-stack for this version is bundled with
<a href="https://github.com/RedisInsight/RedisInsight/releases/tag/2.50.0">
Redis Insight 2.50
</a>
.
</p>
<p>
Note: version numbers follow the pattern:
</p>
<p>
<code>
x.y.z-b
</code>
</p>
<ul>
<li>
<code>
x.y
</code>
Redis major version
</li>
<li>
<code>
z
</code>
increases with even numbers as a module x.y version increases.
</li>
<li>
<code>
b
</code>
denotes a patch to Redis or a module (any
<code>
z
</code>
of Redis or modules).
<code>
b
</code>
will consist of a
<code>
v
</code>
+ numeric value.
</li>
</ul>
<h2 id="redis-stack-720-v10-april-2024">
Redis Stack 7.2.0-v10 (April 2024)
</h2>
<p>
This is a maintenance release for Redis Stack Server 7.2.0.
</p>
<p>
Update urgency:
<code>
HIGH
</code>
: There is a critical bug that may affect a subset of users. Upgrade!
</p>
<h3 id="headlines-3">
Headlines:
</h3>
<p>
This version contains the latest
<strong>
search and query
</strong>
capability with several improvements and bug fixes, including critical bug fixes. This release also includes the latest
<strong>
JSON
</strong>
data structure with a fix for a potential crash, the
<strong>
time series
</strong>
data structure with more detailed LibMR error messages, and the latest version of
<strong>
triggers and functions
</strong>
with updated v8 version and a bug fix. It also contains the latest version of
<strong>
RedisInsight
</strong>
.
</p>
<h3 id="details-3">
Details:
</h3>
<p>
<strong>
Improvements
</strong>
</p>
<ul>
<li>
<p>
<strong>
Search and query
</strong>
:
</p>
<ul>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/4502">
#4502
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/4502">
https://github.com/RediSearch/RediSearch/pull/4502
</a>
) Handle error properly when trying to execute Search commands on cluster setup as part of
<code>
MULTI
</code>
/
<code>
EXEC
</code>
or LUA script (MOD-6541)
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/4526">
#4526
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/4526">
https://github.com/RediSearch/RediSearch/pull/4526
</a>
) Adding detailed geometry info on error messages (MOD-6701)
</li>
</ul>
</li>
<li>
<p>
<strong>
Time series
</strong>
:
</p>
<ul>
<li>
[
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/1593">
#1593
</a>
](
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/1593">
https://github.com/RedisTimeSeries/RedisTimeSeries/pull/1593
</a>
) More detailed LibMR error messages
</li>
</ul>
</li>
<li>
<p>
<strong>
Triggers and Functions
</strong>
:
</p>
<ul>
<li>
[
<a href="https://github.com/RedisGears/RedisGears/pull/1100">
#1100
</a>
](
<a href="https://github.com/RedisGears/RedisGears/pull/1100">
https://github.com/RedisGears/RedisGears/pull/1100
</a>
) Update v8 version to 12.3.219.15
</li>
</ul>
</li>
</ul>
<p>
<strong>
Bug Fixes
</strong>
</p>
<ul>
<li>
<p>
<strong>
Search and query
</strong>
:
</p>
<ul>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/4481">
#4481
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/4481">
https://github.com/RediSearch/RediSearch/pull/4481
</a>
) Query syntax on
<code>
GEOSHAPE
</code>
accepting just prefix instead of complete predicate (MOD-6663)
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/4513">
#4513
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/4513">
https://github.com/RediSearch/RediSearch/pull/4513
</a>
)
<code>
FT.CURSOR READ
</code>
in a numeric query causing a crash (MOD-6597) [
<strong>
critical bug
</strong>
]
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/4534">
#4534
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/4534">
https://github.com/RediSearch/RediSearch/pull/4534
</a>
)
<code>
FT.PROFILE
</code>
with incorrect arguments could cause a crash on cluster setup (MOD-6791) [
<strong>
critical bug
</strong>
]
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/4530">
#4530
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/4530">
https://github.com/RediSearch/RediSearch/pull/4530
</a>
) Some parameter settings using just prefixes instead of full values were working (MOD-6709)
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/4539">
#4539
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/4539">
https://github.com/RediSearch/RediSearch/pull/4539
</a>
) Unfree memory while re-indexing loading a new RDB could cause a crash (MOD-6831, 6810) [
<strong>
critical bug
</strong>
]
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/4498">
#4498
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/4498">
https://github.com/RediSearch/RediSearch/pull/4498
</a>
) Vector pre-filtered query (hybrid query) that timeout causing a crash due to deadlock when trying to write a new document(MOD-6510, MOD-6244) [
<strong>
critical bug
</strong>
]
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/4495">
#4495
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/4495">
https://github.com/RediSearch/RediSearch/pull/4495
</a>
)
<code>
FT.SEARCH
</code>
accessing an inexistent memory address causes a crash if using the deprecated
<code>
FT.ADD
</code>
command (MOD-6599) [
<strong>
critical bug
</strong>
]
</li>
</ul>
</li>
<li>
<p>
<strong>
JSON
</strong>
:
</p>
<ul>
<li>
[
<a href="https://github.com/RedisJSON/RedisJSON/pull/1192">
#1192
</a>
](
<a href="https://github.com/RedisJSON/RedisJSON/pull/1192">
https://github.com/RedisJSON/RedisJSON/pull/1192
</a>
) Crashes with numeric values greater than i64::MAX (MOD-6501, MOD-4551, MOD-4856, MOD-5714)
</li>
</ul>
</li>
<li>
<p>
<strong>
Triggers and Functions
</strong>
:
</p>
<ul>
<li>
[
<a href="https://github.com/RedisGears/RedisGears/pull/1093">
#1093
</a>
](
<a href="https://github.com/RedisGears/RedisGears/pull/1093">
https://github.com/RedisGears/RedisGears/pull/1093
</a>
) Crash when logging NULL characters
</li>
</ul>
</li>
</ul>
<p>
<strong>
Redis version
</strong>
:
</p>
<ul>
<li>
<strong>
<a href="https://github.com/redis/redis/releases/tag/7.2.4">
Redis 7.2.4
</a>
</strong>
</li>
</ul>
<p>
<strong>
Module versions
</strong>
</p>
<ul>
<li>
<strong>
<a href="https://github.com/RediSearch/RediSearch/releases/tag/v2.8.13">
RediSearch 2.8.13
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisJSON/RedisJSON/releases/tag/v2.6.10">
RedisJSON 2.6.10
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/releases/tag/v1.10.12">
RedisTimeSeries 1.10.12
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisBloom/RedisBloom/releases/tag/v2.6.12">
RedisBloom 2.6.12
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisGears/RedisGears/releases/tag/v2.0.20-m21">
RedisGears 2.0.20
</a>
</strong>
</li>
</ul>
<p>
<strong>
Recommended Client Libraries
</strong>
</p>
<ul>
<li>
Java
<ul>
<li>
<a href="https://github.com/redis/jedis/releases/tag/v5.1.2">
Jedis 5.1.2 or later
</a>
</li>
<li>
<a href="https://github.com/redis/redis-om-spring/releases/tag/v0.8.9">
redis-om-spring 0.8.9 or later
</a>
</li>
</ul>
</li>
<li>
Python
<ul>
<li>
<a href="https://github.com/redis/redis-py/releases/tag/v5.0.3">
redis-py 5.0.3 or later
</a>
</li>
<li>
<a href="https://github.com/redis/redis-om-python/releases/tag/v0.2.2">
redis-om-python 0.2.2 or later
</a>
</li>
</ul>
</li>
<li>
NodeJS
<ul>
<li>
<a href="https://github.com/redis/node-redis/releases/tag/redis%404.6.13">
node-redis 4.6.13 or later
</a>
</li>
<li>
<a href="https://github.com/redis/redis-om-node/releases/tag/v0.2.0">
redis-om-node 0.2.0 or later
</a>
</li>
</ul>
</li>
<li>
.NET
<ul>
<li>
<a href="https://github.com/redis/redis-om-dotnet/releases/tag/v0.6.1">
redis-om-dotnet 0.6.1 or later
</a>
</li>
<li>
<a href="https://github.com/redis/NRedisStack/releases/tag/v0.12.0">
NRedisStack 0.12.0 or later
</a>
</li>
</ul>
</li>
<li>
Go
<ul>
<li>
<a href="https://github.com/redis/go-redis/releases/tag/v9.5.1">
go-redis 9.5.1 or later
</a>
</li>
<li>
<a href="https://github.com/redis/rueidis/releases/tag/v1.0.33">
rueidis 1.0.33 or later
</a>
</li>
</ul>
</li>
</ul>
<p>
Compatible with
<a href="https://redis.io/download">
RedisInsight
</a>
. The docker image redis/redis-stack for this version is bundled with
<a href="https://github.com/RedisInsight/RedisInsight/releases/tag/2.46.0">
RedisInsight 2.46
</a>
.
</p>
<p>
Note: version numbers follow the pattern:
</p>
<p>
<code>
x.y.z-b
</code>
</p>
<ul>
<li>
<code>
x.y
</code>
Redis major version
</li>
<li>
<code>
z
</code>
increases with even numbers as a module x.y version increases.
</li>
<li>
<code>
b
</code>
denotes a patch to Redis or a module (any
<code>
z
</code>
of Redis or modules).
<code>
b
</code>
will consist of a
<code>
v
</code>
+ numeric value.
</li>
</ul>
<h2 id="downloads">
Downloads
</h2>
<ul>
<li>
macOS:
<a href="https://packages.redis.io/redis-stack/redis-stack-server-7.2.0-v10.catalina.x86_64.zip">
x86_64
</a>
,
<a href="https://packages.redis.io/redis-stack/redis-stack-server-7.2.0-v10.monterey.arm64.zip">
arm64
</a>
</li>
<li>
AppImage:
<a href="https://packages.redis.io/redis-stack/redis-stack-server-7.2.0-v10-x86_64.AppImage">
x86_64
</a>
</li>
<li>
Ubuntu:
<a href="https://packages.redis.io/redis-stack/redis-stack-server-7.2.0-v10.bionic.x86_64.tar.gz">
Bionic x86_64
</a>
,
<a href="https://packages.redis.io/redis-stack/redis-stack-server-7.2.0-v10.bionic.arm64.tar.gz">
Bionic arm64
</a>
,
<a href="https://packages.redis.io/redis-stack/redis-stack-server-7.2.0-v10.focal.x86_64.tar.gz">
Focal x86_64
</a>
,
<a href="https://packages.redis.io/redis-stack/redis-stack-server-7.2.0-v10.focal.arm64.tar.gz">
Focal arm64
</a>
,
<a href="https://packages.redis.io/redis-stack/redis-stack-server-7.2.0-v10.x86_64.snap">
Snap x86_64
</a>
,
<a href="https://packages.redis.io/redis-stack/redis-stack-server-7.2.0-v10.arm64.snap">
Snap arm64
</a>
,
<a href="https://packages.redis.io/redis-stack/redis-stack-server-7.2.0-v10.jammy.x86_64.tar.gz">
Jammy x86_64
</a>
,
<a href="https://packages.redis.io/redis-stack/redis-stack-server-7.2.0-v10.jammy.arm64.tar.gz">
Jammy arm64
</a>
</li>
<li>
Debian:
<a href="https://packages.redis.io/redis-stack/redis-stack-server-7.2.0-v10.bullseye.x86_64.tar.gz">
Bullseye x86_64
</a>
</li>
<li>
RHEL 7/CentOS Linux 7:
<a href="https://packages.redis.io/redis-stack/redis-stack-server-7.2.0-v10.rhel7.x86_64.tar.gz">
x86_64
</a>
</li>
<li>
RHEL 8/CentOS Linux 8:
<a href="https://packages.redis.io/redis-stack/redis-stack-server-7.2.0-v10.rhel8.x86_64.tar.gz">
x86_64
</a>
</li>
<li>
RHEL 9/Rocky Linux 9/CentOS Linux 9:
<a href="https://packages.redis.io/redis-stack/redis-stack-server-7.2.0-v10.rhel9.x86_64.tar.gz">
x86_64
</a>
</li>
<li>
Redis Stack on
<a href="https://hub.docker.com/u/redis">
Dockerhub
</a>
:
<a href="https://hub.docker.com/r/redis/redis-stack">
x86_64 and arm64
</a>
</li>
<li>
Redis Stack server on
<a href="https://hub.docker.com/u/redis">
Dockerhub
</a>
:
<a href="https://hub.docker.com/r/redis/redis-stack-server">
x86_64 and arm64
</a>
</li>
</ul>
<h2 id="redis-stack-720-v9-march-2024">
Redis Stack 7.2.0-v9 (March 2024)
</h2>
<p>
This is a maintenance release for Redis Stack Server 7.2.0.
</p>
<p>
Update urgency:
<code>
MODERATE
</code>
: Program an upgrade of the server, but it's not urgent.
</p>
<h3 id="headlines-4">
Headlines:
</h3>
<p>
This version contains the latest
<strong>
search and query
</strong>
capability with an improvement for memory allocation patterns on the memory used to query
<code>
GEOSHAPE
</code>
types, and several bug fixes. This release also includes the latest
<strong>
probabilistic
</strong>
data structures with a fix for a potential crash, and
<strong>
triggers and functions
</strong>
capability with an updated v8 version. It also contains the latest version of
<strong>
RedisInsight
</strong>
.
</p>
<h3 id="details-4">
Details:
</h3>
<p>
<strong>
Improvements
</strong>
</p>
<ul>
<li>
<strong>
Search and query
</strong>
:
<ul>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/4313">
#4313
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/4313">
https://github.com/RediSearch/RediSearch/pull/4313
</a>
) Memory allocation patterns on the memory used to query
<code>
GEOSHAPE
</code>
types (MOD 6431)
</li>
</ul>
</li>
</ul>
<p>
<strong>
Bug Fixes
</strong>
</p>
<ul>
<li>
<p>
<strong>
Search and query
</strong>
:
</p>
<ul>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/4476">
#4476
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/4476">
https://github.com/RediSearch/RediSearch/pull/4476
</a>
) Split
<code>
INFIX
</code>
and
<code>
SUFFIX
</code>
report on
<code>
FT.EXPLAIN
</code>
and
<code>
FT.EXPLAINCLI
</code>
(MOD-6186)
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/4467">
#4467
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/4467">
https://github.com/RediSearch/RediSearch/pull/4467
</a>
) Memory leak upon suffix query for a
<code>
TAG
</code>
indexed with
<code>
WITHSUFFIXTRIE
</code>
(MOD-6644)
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/4403">
#4403
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/4403">
https://github.com/RediSearch/RediSearch/pull/4403
</a>
) Clustered
<code>
FT.SEARCH
</code>
hangs forever without replying when an invalid topology is found (MOD-6557)
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/4355">
#4355
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/4355">
https://github.com/RediSearch/RediSearch/pull/4355
</a>
) Searching for a synonym will iterate in the same group multiple times, causing a performance hit (MOD-6490)
</li>
</ul>
</li>
<li>
<p>
<strong>
Probabilistic data structures
</strong>
:
</p>
<ul>
<li>
[
<a href="https://github.com/RedisBloom/RedisBloom/pull/753">
#753
</a>
](
<a href="https://github.com/RedisBloom/RedisBloom/issues/753">
https://github.com/RedisBloom/RedisBloom/issues/753
</a>
) Potential crash on
<code>
CMS.MERGE
</code>
when using invalid arguments
</li>
</ul>
</li>
<li>
<p>
<strong>
Triggers and Functions
</strong>
:
</p>
<ul>
<li>
[
<a href="https://github.com/RedisGears/RedisGears/pull/1089">
#1089
</a>
](
<a href="https://github.com/RedisGears/RedisGears/pull/1089">
https://github.com/RedisGears/RedisGears/pull/1089
</a>
) Update v8 version to 12.2.281.21
</li>
</ul>
</li>
<li>
<p>
<strong>
Redis version
</strong>
:
</p>
<ul>
<li>
<strong>
<a href="https://github.com/redis/redis/releases/tag/7.2.4">
Redis 7.2.4
</a>
</strong>
</li>
</ul>
</li>
</ul>
<p>
<strong>
Module versions
</strong>
</p>
<ul>
<li>
<strong>
<a href="https://github.com/RediSearch/RediSearch/releases/tag/v2.8.12">
RediSearch 2.8.12
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisJSON/RedisJSON/releases/tag/v2.6.9">
RedisJSON 2.6.9
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/releases/tag/v1.10.11">
RedisTimeSeries 1.10.11
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisBloom/RedisBloom/releases/tag/v2.6.12">
RedisBloom 2.6.12
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisGears/RedisGears/releases/tag/v2.0.19-m20">
RedisGears 2.0.19
</a>
</strong>
</li>
</ul>
<p>
<strong>
Recommended Client Libraries
</strong>
</p>
<ul>
<li>
Java
<ul>
<li>
<a href="https://github.com/redis/jedis/releases/tag/v5.1.1">
Jedis 5.1.1 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/redis-om-spring/releases/tag/v0.8.8">
redis-om-spring 0.8.8 or greater
</a>
</li>
</ul>
</li>
<li>
Python
<ul>
<li>
<a href="https://github.com/redis/redis-py/releases/tag/v5.0.2">
redis-py 5.0.2 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/redis-om-python/releases/tag/v0.2.1">
redis-om-python 0.2.1 or greater
</a>
</li>
</ul>
</li>
<li>
NodeJS
<ul>
<li>
<a href="https://github.com/redis/node-redis/releases/tag/redis%404.6.13">
node-redis 4.6.13 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/redis-om-node/releases/tag/v0.2.0">
redis-om-node 0.2.0 or greater
</a>
</li>
</ul>
</li>
<li>
.NET
<ul>
<li>
<a href="https://github.com/redis/redis-om-dotnet/releases/tag/v0.6.1">
redis-om-dotnet 0.6.1 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/NRedisStack/releases/tag/v0.11.0">
NRedisStack 0.11.0 or greater
</a>
</li>
</ul>
</li>
<li>
Go
<ul>
<li>
<a href="https://github.com/redis/go-redis/releases/tag/v9.5.1">
go-redis 9.5.1 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/rueidis/releases/tag/v1.0.31">
rueidis 1.0.31 or greater
</a>
</li>
</ul>
</li>
</ul>
<p>
Compatible with
<a href="https://redis.io/download">
RedisInsight
</a>
. The docker image redis/redis-stack for this version is bundled with
<a href="https://github.com/RedisInsight/RedisInsight/releases/tag/2.44.0">
RedisInsight 2.44
</a>
.
</p>
<p>
Note: version numbers follow the pattern:
</p>
<p>
<code>
x.y.z-b
</code>
</p>
<ul>
<li>
<code>
x.y
</code>
Redis major version
</li>
<li>
<code>
z
</code>
increases with even numbers as a module x.y version increases.
</li>
<li>
<code>
b
</code>
denotes a patch to Redis or a module (any
<code>
z
</code>
of Redis or modules).
<code>
b
</code>
will consist of a
<code>
v
</code>
+ numeric value.
</li>
</ul>
<h2 id="redis-stack-720-v8-january-2024">
Redis Stack 7.2.0-v8 (January 2024)
</h2>
<p>
This is a maintenance release for Redis Stack Server 7.2.0.
</p>
<p>
Update urgency:
<code>
HIGH
</code>
: There is a critical bug fixed in the probabilistic data structures that may affect a subset of users. Upgrade!
</p>
<h3 id="headlines-5">
Headlines:
</h3>
<p>
This version contains the latest
<strong>
probabilistic
</strong>
data structures with a critical bug fix, as well as the latest
<strong>
JSON
</strong>
data structure with a breaking change to revert JSONPath default path value from
<code>
$
</code>
to
<code>
.
</code>
under RESP3, and a fix for RediSearch deadlock. This version contains the latest version of
<strong>
RedisInsight
</strong>
.
</p>
<h3 id="details-5">
Details:
</h3>
<p>
<strong>
Improvements
</strong>
</p>
<ul>
<li>
<strong>
JSON
</strong>
:
<ul>
<li>
[
<a href="https://github.com/RedisJSON/RedisJSON/pull/1131">
#1131
</a>
](
<a href="https://github.com/RedisJSON/RedisJSON/issues/1131)">
https://github.com/RedisJSON/RedisJSON/issues/1131)
</a>
, [
<a href="https://github.com/RedisJSON/RedisJSON/pull/1143">
#1143
</a>
](
<a href="https://github.com/RedisJSON/RedisJSON/pull/1143">
https://github.com/RedisJSON/RedisJSON/pull/1143
</a>
) BREAKING - Revert JSONPath default path value from
<code>
$
</code>
to
<code>
.
</code>
under RESP3 (MOD-6156)
</li>
</ul>
</li>
</ul>
<p>
<strong>
Bug Fixes
</strong>
</p>
<ul>
<li>
<p>
<strong>
JSON
</strong>
:
</p>
<ul>
<li>
[
<a href="https://github.com/RedisJSON/RedisJSON/pull/1095">
#1095
</a>
](
<a href="https://github.com/RedisJSON/RedisJSON/pull/1095">
https://github.com/RedisJSON/RedisJSON/pull/1095
</a>
) Fix for RediSearch deadlock. See RediSearch 2.8.10 release notes (MOD-5895)
</li>
</ul>
</li>
<li>
<p>
<strong>
Probabilistic data structures
</strong>
:
</p>
<ul>
<li>
[
<a href="https://github.com/RedisBloom/RedisBloom/pull/727">
#727
</a>
](
<a href="https://github.com/RedisBloom/RedisBloom/pull/727">
https://github.com/RedisBloom/RedisBloom/pull/727
</a>
) Potential crash on CF.LOADCHUNK (MOD-6344) - Additional fixes
</li>
</ul>
</li>
<li>
<p>
<strong>
Redis version
</strong>
:
</p>
<ul>
<li>
<strong>
<a href="https://github.com/redis/redis/releases/tag/7.2.4">
Redis 7.2.4
</a>
</strong>
</li>
</ul>
</li>
</ul>
<p>
<strong>
Module versions
</strong>
</p>
<ul>
<li>
<strong>
<a href="https://github.com/RediSearch/RediSearch/releases/tag/v2.8.11">
RediSearch 2.8.11
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisJSON/RedisJSON/releases/tag/v2.6.9">
RedisJSON 2.6.9
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/releases/tag/v1.10.11">
RedisTimeSeries 1.10.11
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisBloom/RedisBloom/releases/tag/v2.6.11">
RedisBloom 2.6.11
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisGears/RedisGears/releases/tag/v2.0.16-m17">
RedisGears 2.0.16
</a>
</strong>
</li>
</ul>
<p>
<strong>
Recommended Client Libraries
</strong>
</p>
<ul>
<li>
Java
<ul>
<li>
<a href="https://github.com/redis/jedis/releases/tag/v5.1.0">
Jedis 5.1.0 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/redis-om-spring/releases/tag/v0.8.8">
redis-om-spring 0.8.8 or greater
</a>
</li>
</ul>
</li>
<li>
Python
<ul>
<li>
<a href="https://github.com/redis/redis-py/releases/tag/v5.0.1">
redis-py 5.0.1 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/redis-om-python/releases/tag/v0.2.1">
redis-om-python 0.2.1 or greater
</a>
</li>
</ul>
</li>
<li>
NodeJS
<ul>
<li>
<a href="https://github.com/redis/node-redis/releases/tag/redis%404.6.12">
node-redis 4.6.12 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/redis-om-node/releases/tag/v0.2.0">
redis-om-node 0.2.0 or greater
</a>
</li>
</ul>
</li>
<li>
.NET
<ul>
<li>
<a href="https://github.com/redis/redis-om-dotnet/releases/tag/v0.6.1">
redis-om-dotnet 0.6.1 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/NRedisStack/releases/tag/v0.11.0">
NRedisStack 0.11.0 or greater
</a>
</li>
</ul>
</li>
<li>
Go
<ul>
<li>
<a href="https://github.com/redis/go-redis/releases/tag/v9.4.0">
go-redis 9.4.0 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/rueidis/releases/tag/v1.0.27">
rueidis 1.0.27 or greater
</a>
</li>
</ul>
</li>
</ul>
<p>
Compatible with
<a href="https://redis.io/download">
RedisInsight
</a>
. The docker image redis/redis-stack for this version is bundled with
<a href="https://github.com/RedisInsight/RedisInsight/releases/tag/2.40.0">
RedisInsight 2.40
</a>
.
</p>
<p>
Note: version numbers follow the pattern:
</p>
<p>
<code>
x.y.z-b
</code>
</p>
<ul>
<li>
<code>
x.y
</code>
Redis major version
</li>
<li>
<code>
z
</code>
increases with even numbers as a module x.y version increases.
</li>
<li>
<code>
b
</code>
denotes a patch to Redis or a module (any
<code>
z
</code>
of Redis or modules).
<code>
b
</code>
will consist of a
<code>
v
</code>
+ numeric value.
</li>
</ul>
<h2 id="redis-stack-720-v7-january-2024">
Redis Stack 7.2.0-v7 (January 2024)
</h2>
<p>
This is a maintenance release for Redis Stack Server 7.2.0.
</p>
<p>
Update urgency:
<code>
SECURITY
</code>
: there are security fixes in the release.
</p>
<h3 id="headlines-6">
Headlines:
</h3>
<p>
This version contains security fixes for the
<strong>
Redis
</strong>
server to properly handle the resizing of memory buffers, as well as security fixes for
<strong>
probabilistic data structures
</strong>
to avoid potential crashes. The new Redis Stack version also contains several improvements and bug fixes for the
<strong>
Search and query
</strong>
capability, including fixes of critical bugs. It also offers the latest
<strong>
time series data structure
</strong>
, the latest
<strong>
Triggers and Functions
</strong>
capability with various improvements and bug fixes, and it contains the latest version of
<strong>
RedisInsight
</strong>
.
</p>
<h3 id="details-6">
Details:
</h3>
<p>
<strong>
Security and privacy
</strong>
</p>
<ul>
<li>
<p>
<strong>
Redis
</strong>
:
</p>
<ul>
<li>
(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
</li>
</ul>
</li>
<li>
<p>
<strong>
Probabilistic data structures
</strong>
:
</p>
<ul>
<li>
[
<a href="https://github.com/RedisBloom/RedisBloom/pull/721">
#721
</a>
](
<a href="https://github.com/RedisBloom/RedisBloom/issues/721">
https://github.com/RedisBloom/RedisBloom/issues/721
</a>
) Potential crash on
<code>
CF.RESERVE
</code>
(MOD-6343)
</li>
<li>
[
<a href="https://github.com/RedisBloom/RedisBloom/pull/722">
#722
</a>
](
<a href="https://github.com/RedisBloom/RedisBloom/issues/722">
https://github.com/RedisBloom/RedisBloom/issues/722
</a>
) Potential crash on
<code>
CF.LOADCHUNK
</code>
(MOD-6344)
</li>
</ul>
</li>
</ul>
<p>
<strong>
Improvements
</strong>
</p>
<ul>
<li>
<p>
<strong>
Search and query
</strong>
:
</p>
<ul>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/3682">
#3682
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/3682">
https://github.com/RediSearch/RediSearch/pull/3682
</a>
) Report last key error and field type indexing failures on
<code>
FT.INFO
</code>
(MOD-5364)
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/4236">
#4236
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/4236">
https://github.com/RediSearch/RediSearch/pull/4236
</a>
) Adding Vector index parameters at the
<code>
FT.INFO
</code>
report (MOD-6198)
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/4196">
#4196
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/4196">
https://github.com/RediSearch/RediSearch/pull/4196
</a>
) Check for timeout after results processing in
<code>
FT.SEARCH
</code>
on cluster setup (MOD-6278)
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/4164">
#4164
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/4164">
https://github.com/RediSearch/RediSearch/pull/4164
</a>
) Report
<code>
TIMEOUT
</code>
,
<code>
MAXPREFIXEXPANSION
</code>
warnings in RESP3 replies (MOD-6234)
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/4165">
#4165
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/4165">
https://github.com/RediSearch/RediSearch/pull/4165
</a>
) Indicate timeout on
<code>
FT.PROFILE
</code>
report (MOD-6184)
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/4149">
#4149
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/4149">
https://github.com/RediSearch/RediSearch/pull/4149
</a>
) Indicate timeout from Cursor on
<code>
FAIL
</code>
timeout policy (MOD-5990)
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/4147">
#4147
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/4147">
https://github.com/RediSearch/RediSearch/pull/4147
</a>
) Initialization of the maximum numeric value range leading to a better balance of the index leaf splitting (MOD-6232)
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/3940">
#3940
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/3940">
https://github.com/RediSearch/RediSearch/pull/3940
</a>
) Query optimisation when predicate contains multiple
<code>
INTERSECTION
</code>
(AND) of
<code>
UNION
</code>
(OR) (MOD-5910)
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/4059">
#4059
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/4059">
https://github.com/RediSearch/RediSearch/pull/4059
</a>
) Return cursor id when experiencing a timeout, when the policy is
<code>
ON_TIMEOUT RETURN
</code>
(MOD-5966)
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/4006">
#4006
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/4006">
https://github.com/RediSearch/RediSearch/pull/4006
</a>
) Possibly problematic index name alias validation (MOD-5945)
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/4264">
#4264
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/4264">
https://github.com/RediSearch/RediSearch/pull/4264
</a>
) Granularity of the time reporting counters on
<code>
FT.PROFILE
</code>
(MOD-6002)
</li>
</ul>
</li>
<li>
<p>
<strong>
Triggers and Functions
</strong>
:
</p>
<ul>
<li>
Update v8 version to 12.0/267.13
</li>
</ul>
</li>
</ul>
<p>
<strong>
Bug Fixes
</strong>
</p>
<ul>
<li>
<p>
<strong>
Redis
</strong>
:
</p>
<ul>
<li>
[
<a href="https://github.com/redis/redis/pull/12805">
#12805
</a>
](
<a href="https://github.com/redis/redis/pull/12805)">
https://github.com/redis/redis/pull/12805)
</a>
, [
<a href="https://github.com/redis/redis/pull/12832">
#12832
</a>
](
<a href="https://github.com/redis/redis/pull/12832">
https://github.com/redis/redis/pull/12832
</a>
) Fix crashes of cluster commands clusters with mixed versions of 7.0 and 7.2
</li>
<li>
[
<a href="https://github.com/redis/redis/pull/12564">
#12564
</a>
](
<a href="https://github.com/redis/redis/pull/12564">
https://github.com/redis/redis/pull/12564
</a>
) Fix slot ownership not being properly handled when deleting a slot from a node
</li>
<li>
[
<a href="https://github.com/redis/redis/pull/12733">
#12733
</a>
](
<a href="https://github.com/redis/redis/pull/12733">
https://github.com/redis/redis/pull/12733
</a>
) Fix atomicity issues with the RedisModuleEvent_Key module API event
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/4324">
#4324
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/4324">
https://github.com/RediSearch/RediSearch/pull/4324
</a>
) Internal cluster mechanism not waiting until all replies from shards causing a crash (MOD-6287)
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/4297">
#4297
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/4297">
https://github.com/RediSearch/RediSearch/pull/4297
</a>
) Execution loader when using
<code>
FT.AGGREGATE
</code>
with
<code>
LOAD
</code>
stage failing to buffer the right results potentially causing a crash (MOD-6385)
</li>
</ul>
</li>
<li>
<p>
<strong>
Search and query
</strong>
:
</p>
<ul>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/4287">
#4287
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/4287">
https://github.com/RediSearch/RediSearch/pull/4287
</a>
) Re-index process while syncing from the replica causes a crash due to internal index variable initialisation
(MOD-6337, MOD-6336)
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/4249">
#4249
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/4249">
https://github.com/RediSearch/RediSearch/pull/4249
</a>
) Memory tracking on cluster setups causing high memory usage and potentially Out-of-Memory (MOD-6123, MOD-5639)
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/4244">
#4244
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/4244">
https://github.com/RediSearch/RediSearch/pull/4244
</a>
) Profiling
<code>
FT.AGGREGATE
</code>
using the
<code>
WITHCURSOR
</code>
flag with - clause causes a crash due to timeout (MOD-5512)
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/3916">
#3916
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/3916">
https://github.com/RediSearch/RediSearch/pull/3916
</a>
) Expiring
<code>
JSON
</code>
documents while querying it causing a crash due to deadlock (MOD-5769, MOD-5895, MOD-6189, MOD-5895)
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/4235">
#4235
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/4235">
https://github.com/RediSearch/RediSearch/pull/4235
</a>
) Memory excessively growing on databases caused by unbalanced nodes on inverted index trie (MOD-5880, MOD-5952, MOD-6003)
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/4190">
#4190
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/4190">
https://github.com/RediSearch/RediSearch/pull/4190
</a>
) Profiling
<code>
FT.AGGREGATE
</code>
causes a crash on RESP3 replies (MOD-6250, MOD-6295)
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/4148">
#4148
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/4148)">
https://github.com/RediSearch/RediSearch/pull/4148)
</a>
, [
<a href="https://github.com/RediSearch/RediSearch/pull/4038">
#4038
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/4038">
https://github.com/RediSearch/RediSearch/pull/4038
</a>
)
<code>
ON_TIMEOUT FAIL\RETURN
</code>
policies in the cluster setup not being respected (MOD-6035, MOD-5948, MOD-6090)
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/4110">
#4110
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/4110">
https://github.com/RediSearch/RediSearch/pull/4110
</a>
) Format of error response contains inconsistencies when timing out(MOD-6011, MOD-5965)
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/4104">
#4104
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/4104">
https://github.com/RediSearch/RediSearch/pull/4104
</a>
)
<code>
FT.SEARCH
</code>
not responding when using TLS encryption on Amazon Linux 2 (MOD-6012)
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/4009">
#4009
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/4009">
https://github.com/RediSearch/RediSearch/pull/4009
</a>
) In cluster setup does not return a timeout error for
<code>
FT.SEARCH
</code>
(MOD-5911)
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/3920">
#3920
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/3920">
https://github.com/RediSearch/RediSearch/pull/3920
</a>
) In cluster setup does not return a timeout error for
<code>
FT.AGGREGATE
</code>
(MOD-5209)
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/3914">
#3914
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/3914">
https://github.com/RediSearch/RediSearch/pull/3914
</a>
)
<code>
FT.CURSOR READ
</code>
with geo queries causing a crash when data is updated between the cursor reads (MOD-5646)
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/4220">
#4220
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/4220">
https://github.com/RediSearch/RediSearch/pull/4220
</a>
) Server crash when attempting to run the ForkGC (Garbage Collection routine) after dropping the index (MOD-6276)
</li>
</ul>
</li>
<li>
<p>
<strong>
Time series
</strong>
:
</p>
<ul>
<li>
[LibMR
<a href="https://github.com/RedisGears/libMR/pull/51">
#51
</a>
](
<a href="https://github.com/RedisGears/LibMR/pull/51">
https://github.com/RedisGears/LibMR/pull/51
</a>
) Crash on SSL initialization failure (MOD-5647)
</li>
<li>
[
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/1538">
#1538
</a>
](
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/1538">
https://github.com/RedisTimeSeries/RedisTimeSeries/pull/1538
</a>
) Amazon Linux 2: crash on SSL initialization. We now use openssl11-devel instead of openssl-devel (MOD-6015)
</li>
</ul>
</li>
<li>
<p>
<strong>
Probabilistic data structures
</strong>
:
</p>
<ul>
<li>
[
<a href="https://github.com/RedisBloom/RedisBloom/pull/707">
#707
</a>
](
<a href="https://github.com/RedisBloom/RedisBloom/pull/707">
https://github.com/RedisBloom/RedisBloom/pull/707
</a>
) Top-K:
<code>
TOPK.ADD
</code>
and
<code>
TOPK.QUERY
</code>
crash when an item name is an empty string (RED-114676)
</li>
</ul>
</li>
<li>
<p>
<strong>
Triggers and Functions
</strong>
:
</p>
<ul>
<li>
[
<a href="https://github.com/RedisGears/RedisGears/pull/1069">
#1069
</a>
](
<a href="https://github.com/RedisGears/RedisGears/pull/1069">
https://github.com/RedisGears/RedisGears/pull/1069
</a>
) Fixed an issue where a keyspace notification could be lost
</li>
</ul>
</li>
<li>
<p>
<strong>
Redis version
</strong>
:
</p>
<ul>
<li>
<strong>
<a href="https://github.com/redis/redis/releases/tag/7.2.4">
Redis 7.2.4
</a>
</strong>
</li>
</ul>
</li>
</ul>
<p>
<strong>
Module versions
</strong>
</p>
<ul>
<li>
<strong>
<a href="https://github.com/RediSearch/RediSearch/releases/tag/v2.8.11">
RediSearch 2.8.11
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisJSON/RedisJSON/releases/tag/v2.6.7">
RedisJSON 2.6.7
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/releases/tag/v1.10.11">
RedisTimeSeries 1.10.11
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisBloom/RedisBloom/releases/tag/v2.6.10">
RedisBloom 2.6.10
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisGears/RedisGears/releases/tag/v2.0.16-m17">
RedisGears 2.0.16
</a>
</strong>
</li>
</ul>
<p>
<strong>
Recommended Client Libraries
</strong>
</p>
<ul>
<li>
Java
<ul>
<li>
<a href="https://github.com/redis/jedis/releases/tag/v5.1.0">
Jedis 5.1.0 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/redis-om-spring/releases/tag/v0.8.7">
redis-om-spring 0.8.7 or greater
</a>
</li>
</ul>
</li>
<li>
Python
<ul>
<li>
<a href="https://github.com/redis/redis-py/releases/tag/v5.0.1">
redis-py 5.0.1 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/redis-om-python/releases/tag/v0.2.1">
redis-om-python 0.2.1 or greater
</a>
</li>
</ul>
</li>
<li>
NodeJS
<ul>
<li>
<a href="https://github.com/redis/node-redis/releases/tag/redis%404.6.12">
node-redis 4.6.12 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/redis-om-node/releases/tag/v0.2.0">
redis-om-node 0.2.0 or greater
</a>
</li>
</ul>
</li>
<li>
.NET
<ul>
<li>
<a href="https://github.com/redis/redis-om-dotnet/releases/tag/v0.6.1">
redis-om-dotnet 0.6.1 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/NRedisStack/releases/tag/v0.11.0">
NRedisStack 0.11.0 or greater
</a>
</li>
</ul>
</li>
<li>
Go
<ul>
<li>
<a href="https://github.com/redis/go-redis/releases/tag/v9.4.0">
go-redis 9.4.0 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/rueidis/releases/tag/v1.0.26">
rueidis 1.0.26 or greater
</a>
</li>
</ul>
</li>
</ul>
<p>
Compatible with
<a href="https://redis.io/download">
RedisInsight
</a>
. The docker image redis/redis-stack for this version is bundled with
<a href="https://github.com/RedisInsight/RedisInsight/releases/tag/2.40.0">
RedisInsight 2.40
</a>
.
</p>
<p>
Note: version numbers follow the pattern:
</p>
<p>
<code>
x.y.z-b
</code>
</p>
<ul>
<li>
<code>
x.y
</code>
Redis major version
</li>
<li>
<code>
z
</code>
increases with even numbers as a module x.y version increases.
</li>
<li>
<code>
b
</code>
denotes a patch to Redis or a module (any
<code>
z
</code>
of Redis or modules).
<code>
b
</code>
will consist of a
<code>
v
</code>
+ numeric value.
</li>
</ul>
<h2 id="redis-stack-720-v5-october-2023">
Redis Stack 7.2.0-v5 (October 2023)
</h2>
<p>
This is a maintenance release for Redis Stack Server 7.2.0.
</p>
<p>
Update urgency:
<code>
HIGH
</code>
: There is a critical bug that may affect a subset of users. Upgrade!
</p>
<h3 id="headlines-7">
Headlines:
</h3>
<p>
This version contains the latest Search and Query with various improvements and fixes for critical bugs, triggers and functions with an updated v8 version, as well as new JSON, time series, and probabilistic data structures with several improvements. The new version introduces support for RHEL 9 and Rocky Linux 9. It also includes the latest version of RedisInsight.
</p>
<h3 id="details-7">
Details:
</h3>
<p>
<strong>
Improvements
</strong>
</p>
<ul>
<li>
<p>
<strong>
Search and Query
</strong>
:
</p>
<ul>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/3938">
#3938
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/3938">
https://github.com/RediSearch/RediSearch/pull/3938
</a>
) Propagating error messages in a multi-shard database, instead of failing silently (MOD-5211)
</li>
</ul>
</li>
<li>
<p>
<strong>
JSON
</strong>
:
</p>
<ul>
<li>
[
<a href="https://github.com/RedisJSON/RedisJSON/pull/1102">
#1102
</a>
](
<a href="https://github.com/RedisJSON/RedisJSON/pull/1102">
https://github.com/RedisJSON/RedisJSON/pull/1102
</a>
) Added support for CBL-Mariner 2
</li>
</ul>
</li>
<li>
<p>
<strong>
Time series
</strong>
:
</p>
<ul>
<li>
[
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/1516">
#1516
</a>
](
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/1516">
https://github.com/RedisTimeSeries/RedisTimeSeries/pull/1516
</a>
) Added support for CBL-Mariner 2
</li>
</ul>
</li>
<li>
<p>
<strong>
Probabilistic data structures
</strong>
:
</p>
<ul>
<li>
[
<a href="https://github.com/RedisBloom/RedisBloom/pull/684">
#684
</a>
](
<a href="https://github.com/RedisBloom/RedisBloom/pull/684)">
https://github.com/RedisBloom/RedisBloom/pull/684)
</a>
, [
<a href="https://github.com/RedisBloom/RedisBloom/pull/685">
#685
</a>
](
<a href="https://github.com/RedisBloom/RedisBloom/pull/685">
https://github.com/RedisBloom/RedisBloom/pull/685
</a>
) Added support for CBL-Mariner 2
</li>
</ul>
</li>
</ul>
<p>
<strong>
Bug Fixes
</strong>
</p>
<ul>
<li>
<p>
<strong>
Redis
</strong>
:
</p>
<ul>
<li>
Fix for the "The RDB file contains AUX module data I can't load: no matching module 'graphdata'"
<a href="https://github.com/redis/redis/issues/12490">
error message
</a>
when upgrading Redis Stack
</li>
</ul>
</li>
<li>
<p>
<strong>
Search and Query
</strong>
:
</p>
<ul>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/3874">
#3874
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/3874">
https://github.com/RediSearch/RediSearch/pull/3874
</a>
) Heavy document updates cause memory growth once memory blocks aren't properly released (MOD-5181)
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/3967">
#3967
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/3967">
https://github.com/RediSearch/RediSearch/pull/3967
</a>
) Resharding optimizations cause the process to get stuck (MOD-5874, MOD-5864)
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/3892">
#3892
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/3892">
https://github.com/RediSearch/RediSearch/pull/3892
</a>
) After cleaning the index the GC could cause corruption on unique values (MOD-5815)
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/3853">
#3853
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/3853">
https://github.com/RediSearch/RediSearch/pull/3853
</a>
) Queries with
<code>
WITHCURSOR
</code>
making memory growth since
<code>
CURSOR
</code>
wasn't invalidated in the shards (MOD-5580)
</li>
</ul>
</li>
<li>
<p>
<strong>
Triggers and Functions
</strong>
:
</p>
<ul>
<li>
Update v8 version to 11.8.172.15
</li>
</ul>
</li>
</ul>
<p>
<strong>
Redis version
</strong>
</p>
<ul>
<li>
<strong>
<a href="https://github.com/redis/redis/releases/tag/7.2.2">
Redis 7.2.2
</a>
</strong>
</li>
</ul>
<p>
<strong>
Module versions
</strong>
</p>
<ul>
<li>
<strong>
<a href="https://github.com/RediSearch/RediSearch/releases/tag/v2.8.9">
RediSearch 2.8.9
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisJSON/RedisJSON/releases/tag/v2.6.7">
RedisJSON 2.6.7
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/releases/tag/v1.10.9">
RedisTimeSeries 1.10.9
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisBloom/RedisBloom/releases/tag/v2.6.8">
RedisBloom 2.6.8
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisGears/RedisGears/releases/tag/v2.0.14-m15">
RedisGears 2.0.14
</a>
</strong>
</li>
</ul>
<p>
<strong>
Recommended Client Libraries
</strong>
</p>
<ul>
<li>
Java
<ul>
<li>
<a href="https://github.com/redis/jedis/releases/tag/v5.0.2">
Jedis 5.0.2 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/redis-om-spring/releases/tag/v0.8.7">
redis-om-spring 0.8.7 or greater
</a>
</li>
</ul>
</li>
<li>
Python
<ul>
<li>
<a href="https://github.com/redis/redis-py/releases/tag/v5.0.1">
redis-py 5.0.1 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/redis-om-python/releases/tag/v0.2.1">
redis-om-python 0.2.1 or greater
</a>
</li>
</ul>
</li>
<li>
NodeJS
<ul>
<li>
<a href="https://github.com/redis/node-redis/releases/tag/redis%404.6.10">
node-redis 4.6.10 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/redis-om-node/releases/tag/v0.2.0">
redis-om-node 0.2.0 or greater
</a>
</li>
</ul>
</li>
<li>
.NET
<ul>
<li>
<a href="https://github.com/redis/redis-om-dotnet/releases/tag/v0.5.3">
redis-om-dotnet 0.5.3 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/NRedisStack/releases/tag/v0.10.1">
NRedisStack 0.10.1 or greater
</a>
</li>
</ul>
</li>
<li>
Go
<ul>
<li>
<a href="https://github.com/redis/go-redis/releases/tag/v9.2.1">
go-redis 9.2.1 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/rueidis/releases/tag/v1.0.20">
rueidis 1.0.20 or greater
</a>
</li>
</ul>
</li>
</ul>
<p>
Compatible with
<a href="https://redis.io/download">
RedisInsight
</a>
. The docker image redis/redis-stack for this version is bundled with
<a href="https://github.com/RedisInsight/RedisInsight/releases/tag/2.36.0">
RedisInsight 2.36
</a>
.
</p>
<p>
Note: version numbers follow the pattern:
</p>
<p>
<code>
x.y.z-b
</code>
</p>
<ul>
<li>
<code>
x.y
</code>
Redis major version
</li>
<li>
<code>
z
</code>
increases with even numbers as a module x.y version increases.
</li>
<li>
<code>
b
</code>
denotes a patch to Redis or a module (any
<code>
z
</code>
of Redis or modules).
<code>
b
</code>
will consist of a
<code>
v
</code>
+ numeric value.
</li>
</ul>
<h2 id="redis-stack-720-v4-october-2023">
Redis Stack 7.2.0-v4 (October 2023)
</h2>
<p>
This is a maintenance release for Redis Stack Server 7.2.0.
</p>
<p>
Update urgency:
<code>
SECURITY
</code>
: There are security fixes in the release.
</p>
<h3 id="headlines-8">
Headlines:
</h3>
<p>
This version contains a security fix for the Redis server to avoid bypassing desired Unix socket permissions on startup, as well as several improvements and bug fixes.
</p>
<h3 id="details-8">
Details:
</h3>
<p>
<strong>
Security and privacy
</strong>
</p>
<ul>
<li>
<strong>
Redis
</strong>
:
<ul>
<li>
(CVE-2023-45145) The wrong order of
<code>
listen(2)
</code>
and
<code>
chmod(2)
</code>
calls creates a
race condition that can be used by another process to bypass desired Unix
socket permissions on startup.
</li>
</ul>
</li>
</ul>
<p>
<strong>
Improvements
</strong>
</p>
<ul>
<li>
<strong>
Redis
</strong>
:
<ul>
<li>
[
<a href="https://github.com/redis/redis/pull/12611">
#12611
</a>
](
<a href="https://github.com/redis/redis/pull/12611">
https://github.com/redis/redis/pull/12611
</a>
) Fix compilation error on MacOS 13
</li>
<li>
[
<a href="https://github.com/redis/redis/pull/12604">
#12604
</a>
](
<a href="https://github.com/redis/redis/pull/12604">
https://github.com/redis/redis/pull/12604
</a>
) Fix crash when running rebalance command in a mixed cluster of 7.0 and 7.2
Nodes
</li>
<li>
[
<a href="https://github.com/redis/redis/pull/12561">
#12561
</a>
](
<a href="https://github.com/redis/redis/pull/12561">
https://github.com/redis/redis/pull/12561
</a>
) Fix the return type of the slot number in cluster shards to integer, which
makes it consistent with past behavior
</li>
<li>
[
<a href="https://github.com/redis/redis/pull/12569">
#12569
</a>
](
<a href="https://github.com/redis/redis/pull/12569">
https://github.com/redis/redis/pull/12569
</a>
) Fix CLUSTER commands are called from modules or scripts to return TLS info
appropriately
</li>
</ul>
</li>
<li>
[
<a href="https://github.com/redis/redis/pull/12571">
#12571
</a>
](
<a href="https://github.com/redis/redis/pull/12571">
https://github.com/redis/redis/pull/12571
</a>
) redis-cli, fix crash on reconnect when in SUBSCRIBE mode
</li>
<li>
[
<a href="https://github.com/redis/redis/pull/12474">
#12474
</a>
](
<a href="https://github.com/redis/redis/pull/12474">
https://github.com/redis/redis/pull/12474
</a>
) Fix overflow calculation for next timer event
</li>
</ul>
<p>
<strong>
Bug Fixes
</strong>
</p>
<ul>
<li>
<strong>
Redis
</strong>
:
</li>
<li>
[
<a href="https://github.com/redis/redis/pull/12620">
#12620
</a>
](
<a href="https://github.com/redis/redis/pull/12620">
https://github.com/redis/redis/pull/12620
</a>
) WAITAOF could timeout in the absence of write traffic in case a new AOF is
created and an AOF rewrite can't immediately start
</li>
</ul>
<p>
<strong>
Redis version
</strong>
</p>
<ul>
<li>
<strong>
<a href="https://github.com/redis/redis/releases/tag/7.2.2">
Redis 7.2.2
</a>
</strong>
</li>
</ul>
<p>
<strong>
Module versions
</strong>
</p>
<ul>
<li>
<strong>
<a href="https://github.com/RediSearch/RediSearch/releases/tag/v2.8.8">
RediSearch 2.8.8
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisJSON/RedisJSON/releases/tag/v2.6.6">
RedisJSON 2.6.6
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/releases/tag/v1.10.6">
RedisTimeSeries 1.10.6
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisBloom/RedisBloom/releases/tag/v2.6.3">
RedisBloom 2.6.3
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisGears/RedisGears/releases/tag/v2.0.13-m14">
RedisGears 2.0.13
</a>
</strong>
</li>
</ul>
<p>
<strong>
Recommended Client Libraries
</strong>
</p>
<ul>
<li>
Java
<ul>
<li>
<a href="https://github.com/redis/jedis/releases/tag/v5.0.1">
Jedis 5.0.1 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/redis-om-spring/releases/tag/v0.8.7">
redis-om-spring 0.8.7 or greater
</a>
</li>
</ul>
</li>
<li>
Python
<ul>
<li>
<a href="https://github.com/redis/redis-py/releases/tag/v5.0.1">
redis-py 5.0.1 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/redis-om-python/releases/tag/v0.2.1">
redis-om-python 0.2.1 or greater
</a>
</li>
</ul>
</li>
<li>
NodeJS
<ul>
<li>
<a href="https://github.com/redis/node-redis/releases/tag/redis%404.6.10">
node-redis 4.6.10 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/redis-om-node/releases/tag/v0.2.0">
redis-om-node 0.2.0 or greater
</a>
</li>
</ul>
</li>
<li>
.NET
<ul>
<li>
<a href="https://github.com/redis/redis-om-dotnet/releases/tag/v0.5.3">
redis-om-dotnet 0.5.3 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/NRedisStack/releases/tag/v0.9.0">
NRedisStack 0.9.0 or greater
</a>
</li>
</ul>
</li>
<li>
Go
<ul>
<li>
<a href="https://github.com/redis/go-redis/releases/tag/v9.2.1">
go-redis 9.2.1 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/rueidis/releases/tag/v1.0.20">
rueidis 1.0.20 or greater
</a>
</li>
</ul>
</li>
</ul>
<p>
Compatible with
<a href="https://redis.io/download">
RedisInsight
</a>
. The docker image redis/redis-stack for this version is bundled with
<a href="https://github.com/RedisInsight/RedisInsight/releases/tag/2.34.0">
RedisInsight 2.34
</a>
.
</p>
<p>
Note: version numbers follow the pattern:
</p>
<p>
<code>
x.y.z-b
</code>
</p>
<ul>
<li>
<code>
x.y
</code>
Redis major version
</li>
<li>
<code>
z
</code>
increases with even numbers as a module x.y version increases.
</li>
<li>
<code>
b
</code>
denotes a patch to Redis or a module (any
<code>
z
</code>
of Redis or modules).
<code>
b
</code>
will consist of a
<code>
v
</code>
+ numeric value.
</li>
</ul>
<h2 id="redis-stack-720-v3-october-2023">
Redis Stack 7.2.0-v3 (October 2023)
</h2>
<p>
This is a maintenance release for Redis Stack Server 7.2.0.
</p>
<p>
Update urgency:
<code>
SECURITY
</code>
: There are security fixes in the release.
</p>
<h3 id="headlines-9">
Headlines:
</h3>
<p>
This version contains the latest Search and Query capability v. 2.8.8, and triggers and functions v. 2.0.13 with various improvements, security fixes for Search and Query, and several bug fixes. It also includes the latest version of RedisInsight.
</p>
<h3 id="details-9">
Details:
</h3>
<p>
<strong>
Security and privacy
</strong>
</p>
<ul>
<li>
<strong>
Search and Query
</strong>
:
<ul>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/3788">
#3788
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/3788">
https://github.com/RediSearch/RediSearch/pull/3788
</a>
) Donβt expose internal cluster commands
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/3844">
#3844
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/3844">
https://github.com/RediSearch/RediSearch/pull/3844
</a>
) Limits maximum phonetic length avoiding to be exploited
</li>
</ul>
</li>
</ul>
<p>
<strong>
Improvements
</strong>
</p>
<ul>
<li>
<strong>
Search and Query
</strong>
:
<ul>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/3534">
#3534
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/3534">
https://github.com/RediSearch/RediSearch/pull/3534
</a>
) - Vector Similarity
<a href="https://github.com/RedisAI/VectorSimilarity/releases/tag/v0.7.1">
0.7.1
</a>
</li>
</ul>
</li>
</ul>
<p>
<strong>
Bug Fixes
</strong>
</p>
<ul>
<li>
<p>
<strong>
Search and Query
</strong>
:
</p>
<ul>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/3771">
#3771
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/3771">
https://github.com/RediSearch/RediSearch/pull/3771
</a>
) Broken
<code>
lower()
</code>
and
<code>
upper()
</code>
functions on
<code>
APPLY
</code>
stage in
<code>
FT.AGGREGATE
</code>
in
<code>
DIALECT 3
</code>
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/3752">
#3752
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/3752">
https://github.com/RediSearch/RediSearch/pull/3752
</a>
) Setting a low
<code>
MAXIDLE
</code>
parameter value in
<code>
FT.AGGREGATE
</code>
causes a crash
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/3780">
#3780
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/3780">
https://github.com/RediSearch/RediSearch/pull/3780
</a>
) Wrong document length calculation causing incorrect score values
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/3808">
#3808
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/3808">
https://github.com/RediSearch/RediSearch/pull/3808
</a>
)
<code>
LOAD
</code>
step after a
<code>
FILTER
</code>
step could cause a crash on
<code>
FT.AGGREGATE
</code>
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/3823">
#3823
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/3823">
https://github.com/RediSearch/RediSearch/pull/3823
</a>
)
<code>
APPLY
</code>
or
<code>
FILTER
</code>
parser leak
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/3837">
#3837
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/3837">
https://github.com/RediSearch/RediSearch/pull/3837
</a>
) Connection using TLS fails on Redis 7.2
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/3856">
#3856
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/3856">
https://github.com/RediSearch/RediSearch/pull/3856
</a>
) Adding new nodes to OSS cluster causing a crash
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/3854">
#3854
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/3854">
https://github.com/RediSearch/RediSearch/pull/3854
</a>
) Vector range query could cause Out-of-Memory due a memory corruption
</li>
</ul>
</li>
<li>
<p>
<strong>
Triggers and Functions
</strong>
:
</p>
<ul>
<li>
Update v8 version to 11.7.439.17.
</li>
</ul>
</li>
</ul>
<p>
<strong>
Redis version
</strong>
</p>
<ul>
<li>
<strong>
<a href="https://github.com/redis/redis/releases/tag/7.2.1">
Redis 7.2.1
</a>
</strong>
</li>
</ul>
<p>
<strong>
Module versions
</strong>
</p>
<ul>
<li>
<strong>
<a href="https://github.com/RediSearch/RediSearch/releases/tag/v2.8.8">
RediSearch 2.8.8
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisJSON/RedisJSON/releases/tag/v2.6.6">
RedisJSON 2.6.6
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/releases/tag/v1.10.6">
RedisTimeSeries 1.10.6
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisBloom/RedisBloom/releases/tag/v2.6.3">
RedisBloom 2.6.3
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisGears/RedisGears/releases/tag/v2.0.13-m14">
RedisGears 2.0.13
</a>
</strong>
</li>
</ul>
<p>
<strong>
Recommended Client Libraries
</strong>
</p>
<ul>
<li>
Java
<ul>
<li>
<a href="https://github.com/redis/jedis/releases/tag/v5.0.1">
Jedis 5.0.1 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/redis-om-spring/releases/tag/v0.8.7">
redis-om-spring 0.8.7 or greater
</a>
</li>
</ul>
</li>
<li>
Python
<ul>
<li>
<a href="https://github.com/redis/redis-py/releases/tag/v5.0.1">
redis-py 5.0.1 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/redis-om-python/releases/tag/v0.2.1">
redis-om-python 0.2.1 or greater
</a>
</li>
</ul>
</li>
<li>
NodeJS
<ul>
<li>
<a href="https://github.com/redis/node-redis/releases/tag/redis%404.6.10">
node-redis 4.6.10 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/redis-om-node/releases/tag/v0.2.0">
redis-om-node 0.2.0 or greater
</a>
</li>
</ul>
</li>
<li>
.NET
<ul>
<li>
<a href="https://github.com/redis/redis-om-dotnet/releases/tag/v0.5.3">
redis-om-dotnet 0.5.3 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/NRedisStack/releases/tag/v0.9.0">
NRedisStack 0.9.0 or greater
</a>
</li>
</ul>
</li>
<li>
Go
<ul>
<li>
<a href="https://github.com/redis/go-redis/releases/tag/v9.2.1">
go-redis 9.2.1 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/rueidis/releases/tag/v1.0.19">
rueidis 1.0.19 or greater
</a>
</li>
</ul>
</li>
</ul>
<p>
Compatible with
<a href="https://redis.io/download">
RedisInsight
</a>
. The docker image redis/redis-stack for this version is bundled with
<a href="https://github.com/RedisInsight/RedisInsight/releases/tag/2.34.0">
RedisInsight 2.34
</a>
.
</p>
<p>
Note: version numbers follow the pattern:
</p>
<p>
<code>
x.y.z-b
</code>
</p>
<ul>
<li>
<code>
x.y
</code>
Redis major version
</li>
<li>
<code>
z
</code>
increases with even numbers as a module x.y version increases.
</li>
<li>
<code>
b
</code>
denotes a patch to Redis or a module (any
<code>
z
</code>
of Redis or modules).
<code>
b
</code>
will consist of a
<code>
v
</code>
+ numeric value.
</li>
</ul>
<h2 id="redis-stack-720-v2-september-2023">
Redis Stack 7.2.0-v2 (September 2023)
</h2>
<p>
This is a maintenance release for Redis Stack Server 7.2.0.
</p>
<p>
Update urgency:
<code>
SECURITY
</code>
: There are security fixes in the release.
</p>
<h3 id="headlines-10">
Headlines:
</h3>
<p>
This version contains security improvements for time series to not expose internal commands and several bug fixes for triggers and functions.
</p>
<h3 id="details-10">
Details:
</h3>
<p>
<strong>
Security and privacy
</strong>
</p>
<ul>
<li>
<strong>
Time series
</strong>
:
<ul>
<li>
[
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/1506">
#1506
</a>
](
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/1506">
https://github.com/RedisTimeSeries/RedisTimeSeries/pull/1506
</a>
) Donβt expose internal commands
</li>
</ul>
</li>
</ul>
<p>
<strong>
Bug Fixes
</strong>
</p>
<ul>
<li>
<strong>
Triggers and Functions
</strong>
:
<ul>
<li>
[
<a href="https://github.com/RedisGears/RedisGears/pull/1023">
#1023
</a>
](
<a href="https://github.com/RedisGears/RedisGears/pull/1023">
https://github.com/RedisGears/RedisGears/pull/1023
</a>
) Add TCONFIG_GET and redisgears_2.FORCESHARDSCONNECTION to exclude commands.
</li>
<li>
[
<a href="https://github.com/RedisGears/RedisGears/pull/1008">
#1008
</a>
](
<a href="https://github.com/RedisGears/RedisGears/pull/1008">
https://github.com/RedisGears/RedisGears/pull/1008
</a>
) and [
<a href="https://github.com/RedisGears/RedisGears/pull/1020">
#1020
</a>
](
<a href="https://github.com/RedisGears/RedisGears/pull/1020">
https://github.com/RedisGears/RedisGears/pull/1020
</a>
) Fix when the data is read when a StreamTrigger is fired.
</li>
<li>
[
<a href="https://github.com/RedisGears/RedisGears/pull/1010">
#1010
</a>
](
<a href="https://github.com/RedisGears/RedisGears/pull/1010">
https://github.com/RedisGears/RedisGears/pull/1010
</a>
) Apply loading timeout on AOF and replication stream.
</li>
<li>
Minor patch update for the V8 JavaScript engine.
</li>
</ul>
</li>
</ul>
<p>
<strong>
Redis version
</strong>
</p>
<ul>
<li>
<strong>
<a href="https://github.com/redis/redis/releases/tag/7.2.1">
Redis 7.2.1
</a>
</strong>
</li>
</ul>
<p>
<strong>
Module versions
</strong>
</p>
<ul>
<li>
<strong>
<a href="https://github.com/RediSearch/RediSearch/releases/tag/v2.8.4">
RediSearch 2.8.4
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisJSON/RedisJSON/releases/tag/v2.6.6">
RedisJSON 2.6.6
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/releases/tag/v1.10.6">
RedisTimeSeries 1.10.6
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisBloom/RedisBloom/releases/tag/v2.6.3">
RedisBloom 2.6.3
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisGears/RedisGears/releases/tag/v2.0.12-m13">
RedisGears 2.0.12
</a>
</strong>
</li>
</ul>
<p>
<strong>
Recommended Client Libraries
</strong>
</p>
<ul>
<li>
Java
<ul>
<li>
<a href="https://github.com/redis/jedis/releases/tag/v5.0.0">
Jedis 5.0.0 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/redis-om-spring/releases/tag/v0.8.7">
redis-om-spring 0.8.7 or greater
</a>
</li>
</ul>
</li>
<li>
Python
<ul>
<li>
<a href="https://github.com/redis/redis-py/releases/tag/v5.0.0">
redis-py 5.0.0 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/redis-om-python/releases/tag/v0.2.1">
redis-om-python 0.2.1 or greater
</a>
</li>
</ul>
</li>
<li>
NodeJS
<ul>
<li>
<a href="https://github.com/redis/node-redis/releases/tag/redis%404.6.8">
node-redis 4.6.8 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/redis-om-node/releases/tag/v0.2.0">
redis-om-node 0.2.0 or greater
</a>
</li>
</ul>
</li>
<li>
.NET
<ul>
<li>
<a href="https://github.com/redis/redis-om-dotnet/releases/tag/v0.5.3">
redis-om-dotnet 0.5.3 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/NRedisStack/releases/tag/v0.9.0">
NRedisStack 0.9.0 or greater
</a>
</li>
</ul>
</li>
<li>
Go
<ul>
<li>
<a href="https://github.com/redis/go-redis/releases/tag/v9.1.0">
go-redis 9.1.0 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/rueidis/releases/tag/v1.0.17">
rueidis 1.0.17 or greater
</a>
</li>
</ul>
</li>
</ul>
<p>
Compatible with
<a href="https://redis.io/download">
RedisInsight
</a>
. The docker image redis/redis-stack for this version is bundled with
<a href="https://github.com/RedisInsight/RedisInsight/releases/tag/2.32">
RedisInsight 2.32
</a>
.
</p>
<p>
Note: version numbers follow the pattern:
</p>
<p>
<code>
x.y.z-b
</code>
</p>
<ul>
<li>
<code>
x.y
</code>
Redis major version
</li>
<li>
<code>
z
</code>
increases with even numbers as a module x.y version increases.
</li>
<li>
<code>
b
</code>
denotes a patch to Redis or a module (any
<code>
z
</code>
of Redis or modules).
<code>
b
</code>
will consist of a
<code>
v
</code>
+ numeric value.
</li>
</ul>
<h2 id="redis-stack-720-v1-september-2023">
Redis Stack 7.2.0-v1 (September 2023)
</h2>
<p>
This is a maintenance release for Redis Stack Server 7.2.0
</p>
<p>
Update urgency:
<code>
SECURITY
</code>
: There are security fixes in the release.
</p>
<h3 id="headlines-11">
Headlines:
</h3>
<p>
This version contains security fixes for the Redis server for cases when users may access keys that are not explicitly authorized by the ACL configuration using the
<a href="https://redis.io/commands/sort_ro/">
SORT_RO
</a>
command.
</p>
<h3 id="details-11">
Details:
</h3>
<p>
<strong>
Security Fixes
</strong>
</p>
<ul>
<li>
<strong>
Redis
</strong>
:
<ul>
<li>
(CVE-2023-41053) Redis does not correctly identify keys accessed by SORT_RO and,
as a result, may grant users executing this command access to keys that are not
explicitly authorized by the ACL configuration.
</li>
</ul>
</li>
</ul>
<p>
<strong>
Bug Fixes
</strong>
</p>
<ul>
<li>
<strong>
Redis
</strong>
:
<ul>
<li>
[
<a href="https://github.com/redis/redis/pull/12538">
#12538
</a>
](
<a href="https://github.com/redis/redis/pull/12538">
https://github.com/redis/redis/pull/12538
</a>
) Fix crashes when joining a node to an existing 7.0 Redis Cluster
</li>
<li>
[
<a href="https://github.com/redis/redis/pull/12545">
#12545
</a>
](
<a href="https://github.com/redis/redis/pull/12545)">
https://github.com/redis/redis/pull/12545)
</a>
, [
<a href="https://github.com/redis/redis/pull/12530">
#12530
</a>
](
<a href="https://github.com/redis/redis/pull/12530">
https://github.com/redis/redis/pull/12530
</a>
) Correct request_policy and response_policy command tips on for some admin /
configuration commands
</li>
</ul>
</li>
</ul>
<p>
<strong>
Redis version
</strong>
</p>
<ul>
<li>
<strong>
<a href="https://github.com/redis/redis/releases/tag/7.2.1">
Redis 7.2.1
</a>
</strong>
</li>
</ul>
<p>
<strong>
Module versions
</strong>
</p>
<ul>
<li>
<strong>
<a href="https://github.com/RediSearch/RediSearch/releases/tag/v2.8.4">
RediSearch 2.8.4
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisJSON/RedisJSON/releases/tag/v2.6.6">
RedisJSON 2.6.6
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/releases/tag/v1.10.4">
RedisTimeSeries 1.10.4
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisBloom/RedisBloom/releases/tag/v2.6.3">
RedisBloom 2.6.3
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisGears/RedisGears/releases/tag/v2.0.11-m12">
RedisGears 2.0.11
</a>
</strong>
</li>
</ul>
<p>
<strong>
Recommended Client Libraries
</strong>
</p>
<ul>
<li>
Java
<ul>
<li>
<a href="https://github.com/redis/jedis/releases/tag/v5.0.0">
Jedis 5.0.0 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/redis-om-spring/releases/tag/v0.8.7">
redis-om-spring 0.8.7 or greater
</a>
</li>
</ul>
</li>
<li>
Python
<ul>
<li>
<a href="https://github.com/redis/redis-py/releases/tag/v5.0.0">
redis-py 5.0.0 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/redis-om-python/releases/tag/v0.2.1">
redis-om-python 0.2.1 or greater
</a>
</li>
</ul>
</li>
<li>
NodeJS
<ul>
<li>
<a href="https://github.com/redis/node-redis/releases/tag/redis%404.6.8">
node-redis 4.6.8 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/redis-om-node/releases/tag/v0.2.0">
redis-om-node 0.2.0 or greater
</a>
</li>
</ul>
</li>
<li>
.NET
<ul>
<li>
<a href="https://github.com/redis/redis-om-dotnet/releases/tag/v0.5.3">
redis-om-dotnet 0.5.3 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/NRedisStack/releases/tag/v0.9.0">
NRedisStack 0.9.0 or greater
</a>
</li>
</ul>
</li>
<li>
Go
<ul>
<li>
<a href="https://github.com/redis/go-redis/releases/tag/v9.1.0">
go-redis 9.1.0 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/rueidis/releases/tag/v1.0.17">
rueidis 1.0.17 or greater
</a>
</li>
</ul>
</li>
</ul>
<p>
Compatible with
<a href="https://redis.io/download">
RedisInsight
</a>
. The docker image redis/redis-stack for this version is bundled with
<a href="https://github.com/RedisInsight/RedisInsight/releases/tag/2.32">
RedisInsight 2.32
</a>
.
</p>
<p>
Note: version numbers follow the following pattern:
</p>
<p>
<code>
x.y.z-b
</code>
</p>
<ul>
<li>
<code>
x.y
</code>
Redis major version
</li>
<li>
<code>
z
</code>
increases with even numbers as a module x.y version increases.
</li>
<li>
<code>
b
</code>
denotes a patch to Redis or a module (any
<code>
z
</code>
of Redis or modules).
<code>
b
</code>
will consist of a
<code>
v
</code>
+ numeric value.
</li>
</ul>
<h2 id="redis-stack-720-v0-august-2023">
Redis Stack 7.2.0-v0 (August 2023)
</h2>
<p>
This is a GA release of Redis Stack version 7.2.
</p>
<h3 id="headlines-12">
Headlines:
</h3>
<p>
Redis server 7.2 introduces significant memory and speed optimizations for lists, sets, and sorted sets, several improvements, including encoding improvements for sets and lists, stream consumer group improvements, and improved durability.
Search and Query brings the frequently asked Geo polygons queries for basic shapes and improved query performance on sorting in different scenarios.
JSON introduces two new commands:
<a href="https://redis.io/commands/json.merge/">
JSON.MERGE
</a>
and
<a href="https://redis.io/commands/json.mset/">
JSON.MSET
</a>
for more efficient data manipulation.
Preview of triggers and functions that allows developers to run JavaScript functions inside the Redis process.
Lastly, 7.2 adds the option to use the new protocol
<a href="https://github.com/redis/redis-specifications/blob/master/protocol/RESP3.md">
RESP3
</a>
improving the response format for all commands.
</p>
<p>
<strong>
Redis server
</strong>
:
Redis server 7.2 brings performance and resource utilization improvements, including significant memory and speed optimizations for lists, sets, and sorted sets. This new version adds a new
<code>
WITHSCORE
</code>
command argument for
<a href="https://redis.io/commands/zrank/">
ZRANK
</a>
and
<a href="https://redis.io/commands/zrevrank/">
ZREVRANK
</a>
, new commands, such as
<a href="https://redis.io/commands/client-no-touch/">
CLIENT NO-TOUCH
</a>
for clients to run commands without affecting LRU/LFU of keys, and more. Redis 7.2 brings behavior changes by introducing a new format (version 11) for RDB files, which is incompatible with older versions, changing module API, and other changes.
</p>
<p>
<strong>
Search and Query
</strong>
:
This new major version introduces the frequently asked
<a href="https://redis.io/commands/ft.search/#examples">
Geo Polygon
</a>
Search. Adding the
<a href="https://redis.io/commands/ft.create/">
GEOSHAPE
</a>
field type that supports polygon shapes using the
<a href="https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry">
WKT notation
</a>
. In addition to the existing
<code>
GEO
</code>
for geo range queries, now an alias for
<code>
GEOPOINT
</code>
, we add
<code>
GEOSHAPE
</code>
with the support for
<code>
POLYGON
</code>
and
<code>
POINT
</code>
as new shapes formats and polygons operations.
</p>
<p>
In addition, 7.2 brings improvements in performance for
<code>
SORT BY
</code>
operations using
<a href="https://redis.io/commands/ft.search/#optional-arguments">
<code>
FT.SEARCH
</code>
</a>
and
<a href="https://redis.io/commands/ft.aggregate/#optional-arguments">
<code>
FT.AGGREGATE
</code>
</a>
, and the new
<code>
FORMAT
</code>
for better readability and future support for better error handling responses on
<code>
FT.SEARCH
</code>
and
<code>
FT.AGGREGATE
</code>
in RESP3 only.
</p>
<p>
<strong>
JSON
</strong>
:
JSON introduces two new commands:
</p>
<ul>
<li>
<a href="https://redis.io/commands/json.merge/">
JSON.MERGE
</a>
merges a given JSON value into matching paths so that the JSON values at the matching paths are updated, deleted, or expanded.
</li>
<li>
<a href="https://redis.io/commands/json.mset/">
JSON.MSET
</a>
sets or updates one or more JSON values according to specified key-path-value triplets.
</li>
</ul>
<p>
<strong>
Graph
</strong>
:
</p>
<p>
Graph capabilities are no longer included in Redis Stack. See the
<a href="https://redis.com/blog/redisgraph-eol/">
RedisGraph End-of-Life Announcement
</a>
.
</p>
<blockquote>
<p>
[!WARNING]
<br/>
If you are using graph capabilities with an older version of Redis Stack - please don't upgrade.
</p>
</blockquote>
<p>
<strong>
Triggers and functions preview
</strong>
:
Triggers and functions is part of Redis Stack 7.2 as public preview, any feedback is highly appreciated.
</p>
<p>
Triggers and functions provides support for running JavaScript functions inside the Redis process. These functions can be executed on-demand, by an event-driven trigger, or by a stream processing trigger. Triggers and functions empowers developers to build and maintain real-time applications by moving logic closer to the data, ensuring a lower latency whilst delivering the best developer experience.
</p>
<p>
Try it out with the
<a href="https://redis.io/docs/interact/programmability/triggers-and-functions/quick_start/">
triggers and functions quick start
</a>
.
</p>
<h3 id="details-12">
Details:
</h3>
<p>
Find more details about features and optimizations introduced with Redis Stack 7.2 here:
</p>
<ul>
<li>
<a href="https://github.com/redis/redis/blob/7.2/00-RELEASENOTES">
Redis server
</a>
</li>
<li>
<a href="https://github.com/RediSearch/RediSearch/releases/">
Search and Query
</a>
</li>
<li>
<a href="https://github.com/RedisJSON/RedisJSON/releases">
JSON
</a>
</li>
<li>
<a href="https://github.com/RedisGears/RedisGears/releases">
Triggers and functions
</a>
</li>
</ul>
<p>
<strong>
Redis version
</strong>
</p>
<ul>
<li>
<strong>
<a href="https://github.com/redis/redis/blob/7.2/00-RELEASENOTES">
Redis 7.2
</a>
</strong>
</li>
</ul>
<p>
<strong>
Module versions
</strong>
</p>
<ul>
<li>
<strong>
<a href="https://github.com/RediSearch/RediSearch/releases/tag/v2.8.4">
RediSearch 2.8.4
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisJSON/RedisJSON/releases/tag/v2.6.6">
RedisJSON 2.6.6
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/releases/tag/v1.10.4">
RedisTimeSeries 1.10.4
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisBloom/RedisBloom/releases/tag/v2.6.3">
RedisBloom 2.6.3
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisGears/RedisGears/releases/tag/v2.0.11-m12">
RedisGears 2.0.11
</a>
</strong>
</li>
</ul>
<p>
<strong>
Recommended Client Libraries
</strong>
</p>
<ul>
<li>
Java
<ul>
<li>
<a href="https://github.com/redis/jedis/releases/tag/v4.4.3">
Jedis 4.4.3 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/redis-om-spring/releases/tag/v0.8.6">
redis-om-spring 0.8.6 or greater
</a>
</li>
</ul>
</li>
<li>
Python
<ul>
<li>
<a href="https://github.com/redis/redis-py/releases/tag/v5.0.0">
redis-py 5.0.0 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/redis-om-python/releases/tag/v0.2.1">
redis-om-python 0.2.1 or greater
</a>
</li>
</ul>
</li>
<li>
NodeJS
<ul>
<li>
<a href="https://github.com/redis/node-redis/releases/tag/redis%404.6.7">
node-redis 4.6.7 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/redis-om-node/releases/tag/v0.2.0">
redis-om-node 0.2.0 or greater
</a>
</li>
</ul>
</li>
<li>
.NET
<ul>
<li>
<a href="https://github.com/redis/redis-om-dotnet/releases/tag/v0.5.2">
redis-om-dotnet 0.5.2 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/NRedisStack/releases/tag/v0.8.0">
NRedisStack 0.8.0 or greater
</a>
</li>
</ul>
</li>
<li>
Go
<ul>
<li>
<a href="https://github.com/redis/go-redis/releases/tag/v9.0.5">
go-redis 9.0.5 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/rueidis/releases/tag/v1.0.15">
rueidis 1.0.15 or greater
</a>
</li>
</ul>
</li>
</ul>
<p>
Compatible with the latest
<a href="https://redis.io/download">
RedisInsight
</a>
. The docker image redis/redis-stack for this version is bundled with
<a href="https://github.com/RedisInsight/RedisInsight/releases/tag/2.30.0">
RedisInsight 2.30
</a>
.
</p>
<p>
Note: version numbers follow the pattern:
</p>
<p>
<code>
x.y.z-b
</code>
</p>
<ul>
<li>
<code>
x.y
</code>
Redis major version
</li>
<li>
<code>
z
</code>
increases with even numbers as a module x.y version increases.
</li>
<li>
<code>
b
</code>
denotes a patch to Redis or a module (any
<code>
z
</code>
of Redis or modules).
<code>
b
</code>
will consist of a
<code>
v
</code>
+ numeric value.
</li>
</ul>
<h2 id="redis-stack-720-rc2-july-2023">
Redis Stack 7.2.0-rc2 (July 2023)
</h2>
<p>
This is the third release of Redis Stack version 7.2.0.
</p>
<p>
Update urgency:
<code>
SECURITY
</code>
: there are security fixes in the release.
</p>
<h3 id="headlines-13">
Headlines:
</h3>
<p>
This version contains security improvements for the Redis server.
</p>
<h3 id="details-13">
Details:
</h3>
<p>
<strong>
Features
</strong>
</p>
<ul>
<li>
<strong>
Redis
</strong>
:
<ul>
<li>
[
<a href="https://github.com/redis/redis/pull/10362">
#10362
</a>
](
<a href="https://github.com/redis/redis/pull/10362">
https://github.com/redis/redis/pull/10362
</a>
) Make SENTINEL CONFIG [SET|GET] variadic
</li>
<li>
[
<a href="https://github.com/redis/redis/pull/12133">
#12133
</a>
](
<a href="https://github.com/redis/redis/pull/12133">
https://github.com/redis/redis/pull/12133
</a>
) Add a new loglevel "nothing" to disable logging
</li>
<li>
[
<a href="https://github.com/redis/redis/pull/9564">
#9564
</a>
](
<a href="https://github.com/redis/redis/pull/9564">
https://github.com/redis/redis/pull/9564
</a>
) Add cluster-announce-human-nodename - a unique identifier for a node that is
be used in logs for debugging
</li>
</ul>
</li>
</ul>
<p>
<strong>
Improvements
</strong>
</p>
<ul>
<li>
<strong>
Redis
</strong>
:
<ul>
<li>
(
<a href="https://github.com/redis/redis/security/advisories/GHSA-p8x2-9v9q-c838">
CVE-2022-24834
</a>
) 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.
</li>
<li>
(
<a href="https://github.com/redis/redis/security/advisories/GHSA-4cfx-h9gq-xpx3">
CVE-2023-36824
</a>
) 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 COMMAND GETKEYS* and validation of key names in ACL rules.
</li>
<li>
[
<a href="https://github.com/redis/redis/pull/12269">
#12269
</a>
](
<a href="https://github.com/redis/redis/pull/12269">
https://github.com/redis/redis/pull/12269
</a>
) Allow CLUSTER SLOTS / SHARDS commands during loading
</li>
<li>
[
<a href="https://github.com/redis/redis/pull/12233">
#12233
</a>
](
<a href="https://github.com/redis/redis/pull/12233">
https://github.com/redis/redis/pull/12233
</a>
) Support TLS service when "tls-cluster" is not enabled and persist both plain
and TLS port in nodes.conf
</li>
<li>
[
<a href="https://github.com/redis/redis/pull/12320">
#12320
</a>
](
<a href="https://github.com/redis/redis/pull/12320">
https://github.com/redis/redis/pull/12320
</a>
) Update SPOP and RESTORE commands to replicate unlink commands to replicas
when the server is configured to use async server deletes
</li>
<li>
[
<a href="https://github.com/redis/redis/pull/12229">
#12229
</a>
](
<a href="https://github.com/redis/redis/pull/12229">
https://github.com/redis/redis/pull/12229
</a>
) Try lazyfree the temporary zset in ZUNION / ZINTER / ZDIFF
</li>
<li>
[
<a href="https://github.com/redis/redis/pull/12298">
#12298
</a>
](
<a href="https://github.com/redis/redis/pull/12298">
https://github.com/redis/redis/pull/12298
</a>
) Optimize PSUBSCRIBE and PUNSUBSCRIBE from O(N*M) to O(N)
</li>
<li>
[
<a href="https://github.com/redis/redis/pull/12209">
#12209
</a>
](
<a href="https://github.com/redis/redis/pull/12209">
https://github.com/redis/redis/pull/12209
</a>
) Optimize SCAN, SSCAN, HSCAN, ZSCAN commands
</li>
<li>
[
<a href="https://github.com/redis/redis/pull/12315">
#12315
</a>
](
<a href="https://github.com/redis/redis/pull/12315">
https://github.com/redis/redis/pull/12315
</a>
) Set Jemalloc --disable-cache-oblivious to reduce memory overhead
</li>
<li>
[
<a href="https://github.com/redis/redis/pull/12229">
#12229
</a>
](
<a href="https://github.com/redis/redis/pull/12229">
https://github.com/redis/redis/pull/12229
</a>
) Optimize ZINTERCARD to avoid create a temporary zset
</li>
<li>
[
<a href="https://github.com/redis/redis/pull/12205">
#12205
</a>
](
<a href="https://github.com/redis/redis/pull/12205">
https://github.com/redis/redis/pull/12205
</a>
) Optimize HRANDFIELD and ZRANDMEMBER listpack encoded ()
</li>
<li>
[
<a href="https://github.com/redis/redis/pull/12155">
#12155
</a>
](
<a href="https://github.com/redis/redis/pull/12155)">
https://github.com/redis/redis/pull/12155)
</a>
, [
<a href="https://github.com/redis/redis/pull/12082">
#12082
</a>
](
<a href="https://github.com/redis/redis/pull/12082)">
https://github.com/redis/redis/pull/12082)
</a>
, [
<a href="https://github.com/redis/redis/pull/11626">
#11626
</a>
](
<a href="https://github.com/redis/redis/pull/11626)">
https://github.com/redis/redis/pull/11626)
</a>
, [
<a href="https://github.com/redis/redis/pull/11944">
#11944
</a>
](
<a href="https://github.com/redis/redis/pull/11944)">
https://github.com/redis/redis/pull/11944)
</a>
, [
<a href="https://github.com/redis/redis/pull/12316">
#12316
</a>
](
<a href="https://github.com/redis/redis/pull/12316)">
https://github.com/redis/redis/pull/12316)
</a>
, [
<a href="https://github.com/redis/redis/pull/12250">
#12250
</a>
](
<a href="https://github.com/redis/redis/pull/12250)">
https://github.com/redis/redis/pull/12250)
</a>
,
[
<a href="https://github.com/redis/redis/pull/12177">
#12177
</a>
](
<a href="https://github.com/redis/redis/pull/12177)">
https://github.com/redis/redis/pull/12177)
</a>
, [
<a href="https://github.com/redis/redis/pull/12185">
#12185
</a>
](
<a href="https://github.com/redis/redis/pull/12185">
https://github.com/redis/redis/pull/12185
</a>
) Numerous other optimizations
</li>
<li>
[
<a href="https://github.com/redis/redis/pull/12254">
#12254
</a>
](
<a href="https://github.com/redis/redis/pull/12254">
https://github.com/redis/redis/pull/12254
</a>
) redis-cli: Handle RESP3 double responses that contain a NaN
</li>
<li>
[
<a href="https://github.com/redis/redis/pull/11834">
#11834
</a>
](
<a href="https://github.com/redis/redis/pull/11834">
https://github.com/redis/redis/pull/11834
</a>
) redis-cli: Support URIs with IPv6
</li>
</ul>
</li>
</ul>
<p>
<strong>
Changed Behavior
</strong>
</p>
<ul>
<li>
<strong>
Redis
</strong>
:
<ul>
<li>
[
<a href="https://github.com/redis/redis/pull/10536">
#10536
</a>
](
<a href="https://github.com/redis/redis/pull/10536)">
https://github.com/redis/redis/pull/10536)
</a>
, [
<a href="https://github.com/redis/redis/pull/12166">
#12166
</a>
](
<a href="https://github.com/redis/redis/pull/12166">
https://github.com/redis/redis/pull/12166
</a>
) Cluster SHARD IDs are no longer visible in the cluster nodes output
</li>
<li>
[
<a href="https://github.com/redis/redis/pull/12326">
#12326
</a>
](
<a href="https://github.com/redis/redis/pull/12326">
https://github.com/redis/redis/pull/12326
</a>
) When calling PUBLISH with a RESP3 client that's also subscribed to the same channel, the order is changed and the reply is sent before the published message
</li>
<li>
[
<a href="https://github.com/redis/redis/pull/12321">
#12321
</a>
](
<a href="https://github.com/redis/redis/pull/12321">
https://github.com/redis/redis/pull/12321
</a>
) Align semantics of the new (v7.2 RC2) RM_ReplyWithErrorFormat with RM_ReplyWithError.
This is a breaking change that affects the generated error code
</li>
<li>
[
<a href="https://github.com/redis/redis/pull/12304">
#12304
</a>
](
<a href="https://github.com/redis/redis/pull/12304">
https://github.com/redis/redis/pull/12304
</a>
) Forbid RM_AddPostNotificationJob on loading and on read-only replicas
</li>
<li>
[
<a href="https://github.com/redis/redis/pull/12219">
#12219
</a>
](
<a href="https://github.com/redis/redis/pull/12219">
https://github.com/redis/redis/pull/12219
</a>
) Add ability for module command filter to know which client is being handled
</li>
</ul>
</li>
</ul>
<p>
<strong>
Bug Fixes
</strong>
</p>
<ul>
<li>
<strong>
Redis
</strong>
:
<ul>
<li>
[
<a href="https://github.com/redis/redis/pull/12326">
#12326
</a>
](
<a href="https://github.com/redis/redis/pull/12326">
https://github.com/redis/redis/pull/12326
</a>
) Fix broken protocol when PUBLISH is used inside MULTI when the RESP3
publishing client is also subscribed for the channel
</li>
<li>
[
<a href="https://github.com/redis/redis/pull/12220">
#12220
</a>
](
<a href="https://github.com/redis/redis/pull/12220">
https://github.com/redis/redis/pull/12220
</a>
) Fix WAIT to be effective after a blocked module command being unblocked
</li>
<li>
[
<a href="https://github.com/redis/redis/pull/12276">
#12276
</a>
](
<a href="https://github.com/redis/redis/pull/12276">
https://github.com/redis/redis/pull/12276
</a>
) Re-enable downscale rehashing while there is a fork child
</li>
<li>
[
<a href="https://github.com/redis/redis/pull/12276">
#12276
</a>
](
<a href="https://github.com/redis/redis/pull/12276">
https://github.com/redis/redis/pull/12276
</a>
) Fix possible hang in HRANDFIELD, SRANDMEMBER, ZRANDMEMBER when used with
<code>
<count>
</code>
</li>
<li>
[
<a href="https://github.com/redis/redis/pull/12276">
#12276
</a>
](
<a href="https://github.com/redis/redis/pull/12276">
https://github.com/redis/redis/pull/12276
</a>
) Improve fairness issue in RANDOMKEY, HRANDFIELD, SRANDMEMBER, ZRANDMEMBER, SPOP, and eviction
</li>
<li>
[
<a href="https://github.com/redis/redis/pull/12344">
#12344
</a>
](
<a href="https://github.com/redis/redis/pull/12344">
https://github.com/redis/redis/pull/12344
</a>
) Cluster: fix a race condition where a slot migration may revert on a subsequent failover or node joining
</li>
<li>
[
<a href="https://github.com/redis/redis/pull/12301">
#12301
</a>
](
<a href="https://github.com/redis/redis/pull/12301)Fix">
https://github.com/redis/redis/pull/12301)Fix
</a>
XREADGROUP BLOCK with ">" from hanging
</li>
<li>
[
<a href="https://github.com/redis/redis/pull/12247">
#12247
</a>
](
<a href="https://github.com/redis/redis/pull/12247)Fix">
https://github.com/redis/redis/pull/12247)Fix
</a>
assertion when a blocked command is rejected when re-processed
</li>
<li>
[
<a href="https://github.com/redis/redis/pull/12342">
#12342
</a>
](
<a href="https://github.com/redis/redis/pull/12342)Fix">
https://github.com/redis/redis/pull/12342)Fix
</a>
use after free on a blocking RM_Call
</li>
</ul>
</li>
</ul>
<p>
<strong>
Redis version
</strong>
</p>
<ul>
<li>
<strong>
<a href="https://github.com/redis/redis/blob/7.2/00-RELEASENOTES">
Redis 7.2 RC3
</a>
</strong>
</li>
</ul>
<p>
<strong>
Module versions
</strong>
</p>
<ul>
<li>
<strong>
<a href="https://github.com/RediSearch/RediSearch/releases/tag/v2.8.3">
RediSearch 2.8.3
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisJSON/RedisJSON/releases/tag/v2.6.2">
RedisJSON 2.6.2
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/releases/tag/v1.10.1">
RedisTimeSeries 1.10.1
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisBloom/RedisBloom/releases/tag/v2.6.1">
RedisBloom 2.6.1
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisGears/RedisGears/releases/tag/v2.0.6-m07">
RedisGears 2.0.6
</a>
</strong>
</li>
</ul>
<p>
<strong>
Recommended Client Libraries
</strong>
</p>
<ul>
<li>
Java
<ul>
<li>
<a href="https://github.com/redis/jedis/releases/tag/v4.4.3">
Jedis 4.4.3 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/redis-om-spring/releases/tag/v0.8.1">
redis-om-spring 0.8.1 or greater
</a>
</li>
</ul>
</li>
<li>
Python
<ul>
<li>
<a href="https://github.com/redis/redis-py/releases/tag/v4.5.5">
redis-py 4.5.5 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/redis-om-python/releases/tag/v0.1.2">
redis-om-python 0.1.2 or greater
</a>
</li>
</ul>
</li>
<li>
NodeJS
<ul>
<li>
<a href="https://github.com/redis/node-redis/releases/tag/redis%404.6.7">
node-redis 4.6.7 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/redis-om-node/releases/tag/v0.2.0">
redis-om-node 0.2.0 or greater
</a>
</li>
</ul>
</li>
<li>
.NET
<ul>
<li>
<a href="https://github.com/redis/redis-om-dotnet/releases/tag/v0.5.1">
redis-om-dotnet 0.5.1 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/NRedisStack/releases/tag/v0.7.0">
NRedisStack 0.7.0 or greater
</a>
</li>
</ul>
</li>
<li>
Go
<ul>
<li>
<a href="https://github.com/redis/go-redis/releases/tag/v9.0.4">
go-redis 9.0.4 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/rueidis/releases/tag/v1.0.3">
rueidis 1.0.3 or greater
</a>
</li>
</ul>
</li>
</ul>
<p>
Compatible with
<a href="https://redis.io/download">
RedisInsight
</a>
. The docker image redis/redis-stack for this version is bundled with
<a href="https://github.com/RedisInsight/RedisInsight/releases/tag/2.26.0">
RedisInsight 2.26
</a>
.
</p>
<p>
Note: version numbers follow the pattern:
</p>
<p>
<code>
x.y.z-b
</code>
</p>
<ul>
<li>
<code>
x.y
</code>
Redis major version
</li>
<li>
<code>
z
</code>
increases with even numbers as a module x.y version increases.
</li>
<li>
<code>
b
</code>
denotes a patch to Redis or a module (any
<code>
z
</code>
of Redis or modules).
<code>
b
</code>
will consist of a
<code>
v
</code>
+ numeric value.
</li>
</ul>
<h2 id="redis-stack-720-rc2-june-2023">
Redis Stack 7.2.0-rc2 (June 2023)
</h2>
<p>
This is the second release of Redis Stack version 7.2.0.
</p>
<h3 id="headlines-14">
Headlines:
</h3>
<p>
This version contains a new capability -
<strong>
Triggers and Functions
</strong>
, improvements to the
<strong>
Search and Query
</strong>
capability, and improvements to the
<strong>
JSON
</strong>
,
<strong>
time series
</strong>
and
<strong>
probabilistic data structures
</strong>
. It also includes the latest version of
<strong>
RedisInsight
</strong>
.
</p>
<p>
The new
<strong>
Search and Query
</strong>
version introduces new and frequently asked
<strong>
Geo Polygon Search
</strong>
. Adding the
<code>
GEOSHAPE
</code>
field type that supports polygon shapes using
<a href="https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry">
WKT notation
</a>
. Besides the current
<code>
GEO
</code>
(alias for
<code>
GEOPOINT
</code>
) used already geo range queries, we add the support for
<code>
POLYGON
</code>
as new shapes. In addition, it brings improvements in performance for
<code>
SORT BY
</code>
operations using
<code>
FT.SEARCH
</code>
and
<code>
FT.AGGREGATE
</code>
.
</p>
<p>
This release includes a new capability -
<a href="https://github.com/RedisGears/RedisGears/tree/master">
Triggers and Functions
</a>
that brings the ability to execute and trigger business logic inside Redis using JavaScript (JS). Detailed documentation and examples can be found in this
<a href="https://github.com/RedisGears/RedisGears#redisgears-20">
GitHub repository
</a>
. The Triggers and Functions commands are aligned with the Redis Functions command. The API is not yet final and might change based on feedback.
<strong>
Any
<a href="https://github.com/RedisGears/RedisGears">
feedback
</a>
is highly appreciated.
</strong>
</p>
<h3 id="details-14">
Details:
</h3>
<p>
<strong>
Features
</strong>
</p>
<ul>
<li>
<p>
<strong>
Search and Query
</strong>
:
</p>
<ul>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/3553">
#3553
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/3553">
https://github.com/RediSearch/RediSearch/pull/3553
</a>
) Introduce support for Geo-polygon shapes and queries
<ul>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/3476">
#3476
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/3476)">
https://github.com/RediSearch/RediSearch/pull/3476)
</a>
, [
<a href="https://github.com/RediSearch/RediSearch/pull/3660">
#3660
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/3660">
https://github.com/RediSearch/RediSearch/pull/3660
</a>
) Adding
<code>
GEOSHAPE
</code>
<a href="https://redis.io/commands/ft.create/">
field type
</a>
to map polygons in the
<code>
SCHEMA
</code>
on
<code>
FT.CREATE
</code>
.
</li>
<li>
Support for polygons
<code>
POLYGON
</code>
using
<a href="https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry">
WKT notation
</a>
, for example
<code>
POLYGON((x1 y1, x2 y2, ...))
</code>
.
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/3556">
#3556
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/3556">
https://github.com/RediSearch/RediSearch/pull/3556
</a>
) Adjust the
<a href="https://redis.io/commands/ft.search/#examples">
query syntax
</a>
on
<code>
FT.SEARCH
</code>
for Polygons using the predicate
<code>
@geom:[OPERATOR $poly]
</code>
and defining polygon in WKT format as
<code>
PARAMS 2 poly "POLYGON((10 20, ...))"
</code>
using
<code>
DIALECT 3
</code>
.
</li>
<li>
Initially
<code>
WITHIN
</code>
and
<code>
CONTAINS
</code>
operators with
<code>
GEOSHAPES
</code>
for now.
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/3645">
#3645
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/3645">
https://github.com/RediSearch/RediSearch/pull/3645
</a>
) Support multiple coordinate systems cartesian (X,Y) and geographic (lon, lat). Geographic coordinate system using spherical indexing as default (
<code>
SPHERICAL
</code>
).
</li>
</ul>
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/3046">
#3046
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/3046">
https://github.com/RediSearch/RediSearch/pull/3046
</a>
) Introduce performance optimization for sorting operations on
<code>
FT.SEARCH
</code>
and
<code>
FT.AGGREGATE
</code>
as default on
<code>
DIALECT 4
</code>
. It will improve performance in 4 different scenarios, listed below:
<ul>
<li>
Skip Sorter - applied when there is no sort of any kind. The query can return once it reaches the
<code>
LIMIT
</code>
requested results.
</li>
<li>
Partial Range - applied when there is a
<code>
SORTBY
</code>
a numeric field, with no filter or filter by the same numeric field, the query iterate on a range large enough to satisfy the
<code>
LIMIT
</code>
requested results.
</li>
<li>
Hybrid - applied when there is a
<code>
SORTBY
</code>
a numeric field in addition to another non-numeric filter. Some results will get filtered, and the initial range may not be large enough. The iterator then is rewinded with the following ranges, and an additional iteration takes place to collect
<code>
LIMIT
</code>
requested results.
</li>
<li>
No optimization - If there is a sort by score or by non-numeric field, there is no other option but to retrieve all results and compare their values.
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/3651">
#3651
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/3651">
https://github.com/RediSearch/RediSearch/pull/3651
</a>
) Add
<code>
WITHCOUNT
</code>
argument that allow return accurate counts for the query results with sorting. This operation processes all results in order to get accurate count, being less performant than the optimised option (default behaviour on
<code>
DIALECT 4
</code>
).
</li>
</ul>
</li>
</ul>
</li>
<li>
<p>
<strong>
JSON
</strong>
:
</p>
<ul>
<li>
[
<a href="https://github.com/RedisJSON/RedisJSON/pull/916">
#916
</a>
](
<a href="https://github.com/RedisJSON/RedisJSON/pull/916">
https://github.com/RedisJSON/RedisJSON/pull/916
</a>
) Introduce the new
<code>
JSON.MERGE
</code>
in compliance with
<a href="https://datatracker.ietf.org/doc/html/rfc7396">
RFC 7396
</a>
, supporting:
<ul>
<li>
Creating new attributes on an existing JSON document
</li>
<li>
Updating and replacing values in parent and child attributes
</li>
<li>
Deleting existing attributes (giving
<code>
null
</code>
as value)
</li>
<li>
Array update - replacing an entire array with the new value.
</li>
</ul>
</li>
<li>
[
<a href="https://github.com/RedisJSON/RedisJSON/pull/944">
#944
</a>
](
<a href="https://github.com/RedisJSON/RedisJSON/pull/944">
https://github.com/RedisJSON/RedisJSON/pull/944
</a>
) Introduce
<code>
JSON.MSET
</code>
, supporting atomic multiple sets for keys in the same hash slot.
</li>
</ul>
</li>
<li>
<p>
<strong>
Triggers and Functions
</strong>
:
</p>
<ul>
<li>
[
<a href="https://github.com/RedisGears/RedisGears/pull/875">
#875
</a>
](
<a href="https://github.com/RedisGears/RedisGears/pull/875">
https://github.com/RedisGears/RedisGears/pull/875
</a>
) The api_version was added to the library prologue indicating the minimum required API version. Indicating the library works on the specified API version and later minor versions.
[
<a href="https://github.com/RedisGears/RedisGears/pull/896">
#896
</a>
](
<a href="https://github.com/RedisGears/RedisGears/pull/896">
https://github.com/RedisGears/RedisGears/pull/896
</a>
) Additional optional callback on a KeySpace trigger that can perform read operations exactly when the notification happens.
</li>
<li>
[
<a href="https://github.com/RedisGears/RedisGears/pull/910">
#910
</a>
](
<a href="https://github.com/RedisGears/RedisGears/pull/910">
https://github.com/RedisGears/RedisGears/pull/910
</a>
) The JavaScript API is updated to be inline with JavaScript best practices. Registrations of functions and triggers is done with mandatory arguments and a single optional object.
</li>
<li>
[
<a href="https://github.com/RedisGears/RedisGears/pull/935">
#935
</a>
](
<a href="https://github.com/RedisGears/RedisGears/pull/935">
https://github.com/RedisGears/RedisGears/pull/935
</a>
) Ability to load an RDB from a Redis Server with the RedisGears module loaded but NOT used into a Redis Server without the RedisGears module.
</li>
<li>
Updated commands:
<ul>
<li>
[
<a href="https://github.com/RedisGears/RedisGears/pull/910">
#910
</a>
](
<a href="https://github.com/RedisGears/RedisGears/pull/910">
https://github.com/RedisGears/RedisGears/pull/910
</a>
)
<code>
TFUNCTION
</code>
and
<code>
TFCALL
</code>
is used instead of
<code>
RG.FUNCTION
</code>
and
<code>
RG.FCALL
</code>
.
</li>
<li>
[
<a href="https://github.com/RedisGears/RedisGears/pull/939">
#939
</a>
](
<a href="https://github.com/RedisGears/RedisGears/pull/939">
https://github.com/RedisGears/RedisGears/pull/939
</a>
) The commands are updated to match the Redis Functions commands.
<code>
TFCALL
</code>
combines the library and function in a single argument with '.' separated. Example:
<code>
TFCALL <library_name>.<function_name>
</code>
.
</li>
<li>
[
<a href="https://github.com/RedisGears/RedisGears/pull/900">
#900
</a>
](
<a href="https://github.com/RedisGears/RedisGears/pull/900">
https://github.com/RedisGears/RedisGears/pull/900
</a>
) rated the ability to run functions as a coroutine in
<code>
TFCALLASYNC
</code>
. Clients rely on
<code>
TFCALL
</code>
to never block shared connections so other commands are not delayed on such connections.
</li>
</ul>
</li>
</ul>
</li>
</ul>
<p>
<strong>
Improvements
</strong>
</p>
<ul>
<li>
<p>
<strong>
Search and Query
</strong>
:
</p>
<ul>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/3641">
#3641
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/3641">
https://github.com/RediSearch/RediSearch/pull/3641
</a>
) Indexing sanitizing trigger in heavily data updates scenario.
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/3614">
#3614
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/3614">
https://github.com/RediSearch/RediSearch/pull/3614
</a>
) Several improvements in the aggregations execution pipeline.
</li>
</ul>
</li>
<li>
<p>
<strong>
Triggers and Functions
</strong>
:
</p>
<ul>
<li>
[
<a href="https://github.com/RedisGears/RedisGears/pull/906">
#906
</a>
](
<a href="https://github.com/RedisGears/RedisGears/pull/906">
https://github.com/RedisGears/RedisGears/pull/906
</a>
) Limit the total memory usage of all combined libraries, the values can be configured during module load.
</li>
<li>
[
<a href="https://github.com/RedisGears/RedisGears/pull/940">
#940
</a>
](
<a href="https://github.com/RedisGears/RedisGears/pull/940">
https://github.com/RedisGears/RedisGears/pull/940
</a>
) Validate the current memory usage when uploading a new library to not exceed the max memory limit.
</li>
</ul>
</li>
</ul>
<p>
<strong>
Changed Behavior
</strong>
</p>
<ul>
<li>
<strong>
Search and Query
</strong>
:
<ul>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/3355">
#3355
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/3355)">
https://github.com/RediSearch/RediSearch/pull/3355)
</a>
, [
<a href="https://github.com/RediSearch/RediSearch/pull/3635">
#3635
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/3635">
https://github.com/RediSearch/RediSearch/pull/3635
</a>
) Expired keys deleted from slave's index, returning an empty array instead of
<code>
nil
</code>
.
</li>
</ul>
</li>
</ul>
<p>
<strong>
Bug Fixes
</strong>
</p>
<ul>
<li>
<p>
<strong>
Search and Query
</strong>
:
</p>
<ul>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/3597">
#3597
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/3597">
https://github.com/RediSearch/RediSearch/pull/3597
</a>
) Duplicating alias as output name on
<code>
FT.AGGREGATE
</code>
reducer (
<code>
REDUCE
</code>
argument) isn't return results.
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/3654">
#3654
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/3654">
https://github.com/RediSearch/RediSearch/pull/3654
</a>
) Added check for
<code>
@
</code>
prefix on
<code>
GROUPBY
</code>
fields returnig an error instead of wrong results.
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/3501">
#3501
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/3501">
https://github.com/RediSearch/RediSearch/pull/3501
</a>
) Sorting by 2 or more fields follow the order not ignoring the second argument.
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/3582">
#3582
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/3582">
https://github.com/RediSearch/RediSearch/pull/3582
</a>
) Sorter will set lower rank in documents expired during query time, preventing clients to freeze.
</li>
</ul>
</li>
<li>
<p>
<strong>
JSON
</strong>
:
</p>
<ul>
<li>
[
<a href="https://github.com/RedisJSON/RedisJSON/pull/1025">
#1025
</a>
](
<a href="https://github.com/RedisJSON/RedisJSON/pull/1025">
https://github.com/RedisJSON/RedisJSON/pull/1025
</a>
)
<code>
JSON.TOGGLE
</code>
key space notification fix.
</li>
</ul>
</li>
<li>
<p>
<strong>
Time series
</strong>
:
</p>
<ul>
<li>
[
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/1471">
#1471
</a>
](
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/1471">
https://github.com/RedisTimeSeries/RedisTimeSeries/pull/1471
</a>
) Potential crash on
<code>
MRANGE
</code>
when aggregating millions of time series.
</li>
<li>
[
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/1469">
#1469
</a>
](
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/1469">
https://github.com/RedisTimeSeries/RedisTimeSeries/pull/1469
</a>
) Potential memory leak in
<code>
MRANGE
</code>
after eviction.
</li>
</ul>
</li>
<li>
<p>
<strong>
Triggers and Functions
</strong>
:
</p>
<ul>
<li>
[
<a href="https://github.com/RedisGears/RedisGears/pull/913">
#913
</a>
](
<a href="https://github.com/RedisGears/RedisGears/pull/913">
https://github.com/RedisGears/RedisGears/pull/913
</a>
) Do not trigger notifications when Redis is loading from a persistence file.
</li>
</ul>
</li>
</ul>
<p>
<strong>
Redis version
</strong>
</p>
<ul>
<li>
<strong>
<a href="https://github.com/redis/redis/blob/7.2/00-RELEASENOTES">
Redis 7.2 RC2
</a>
</strong>
</li>
</ul>
<p>
<strong>
Module versions
</strong>
</p>
<ul>
<li>
<strong>
<a href="https://github.com/RediSearch/RediSearch/releases/tag/v2.8.3">
RediSearch 2.8.3
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisJSON/RedisJSON/releases/tag/v2.6.2">
RedisJSON 2.6.2
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/releases/tag/v1.10.1">
RedisTimeSeries 1.10.1
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisBloom/RedisBloom/releases/tag/v2.6.1">
RedisBloom 2.6.1
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisGears/RedisGears/releases/tag/v2.0.6-m07">
RedisGears 2.0.6
</a>
</strong>
</li>
</ul>
<p>
<strong>
Recommended Client Libraries
</strong>
</p>
<ul>
<li>
Java
<ul>
<li>
<a href="https://github.com/redis/jedis/releases/tag/v4.4.3">
Jedis 4.4.3 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/redis-om-spring/releases/tag/v0.8.1">
redis-om-spring 0.8.1 or greater
</a>
</li>
</ul>
</li>
<li>
Python
<ul>
<li>
<a href="https://github.com/redis/redis-py/releases/tag/v4.5.5">
redis-py 4.5.5 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/redis-om-python/releases/tag/v0.1.2">
redis-om-python 0.1.2 or greater
</a>
</li>
</ul>
</li>
<li>
NodeJS
<ul>
<li>
<a href="https://github.com/redis/node-redis/releases/tag/redis%404.6.7">
node-redis 4.6.7 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/redis-om-node/releases/tag/v0.2.0">
redis-om-node 0.2.0 or greater
</a>
</li>
</ul>
</li>
<li>
.NET
<ul>
<li>
<a href="https://github.com/redis/redis-om-dotnet/releases/tag/v0.5.1">
redis-om-dotnet 0.5.1 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/NRedisStack/releases/tag/v0.7.0">
NRedisStack 0.7.0 or greater
</a>
</li>
</ul>
</li>
<li>
Go
<ul>
<li>
<a href="https://github.com/redis/go-redis/releases/tag/v9.0.4">
go-redis 9.0.4 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/rueidis/releases/tag/v1.0.3">
rueidis 1.0.3 or greater
</a>
</li>
</ul>
</li>
</ul>
<p>
Compatible with the latest
<a href="https://redis.io/download">
RedisInsight
</a>
. The docker image redis/redis-stack for this version is bundled with
<a href="https://github.com/RedisInsight/RedisInsight/releases/tag/2.26.0">
RedisInsight 2.26
</a>
.
</p>
<p>
Note: version numbers follow the pattern:
</p>
<p>
<code>
x.y.z-b
</code>
</p>
<ul>
<li>
<code>
x.y
</code>
Redis major version
</li>
<li>
<code>
z
</code>
increases with even numbers as a module x.y version increases.
</li>
<li>
<code>
b
</code>
denotes a patch to Redis or a module (any
<code>
z
</code>
of Redis or modules).
<code>
b
</code>
will consist of a
<code>
v
</code>
+ numeric value.
</li>
</ul>
<h2 id="redis-stack-720-rc1-june-2023">
Redis Stack 7.2.0-rc1 (June 2023)
</h2>
<p>
This is the first release of Redis Stack version 7.2.0.
</p>
<h3 id="headlines-15">
Headlines:
</h3>
<p>
This version contains the latest
<strong>
Search and Query
</strong>
capability,
<strong>
JSON
</strong>
capability, and a new version of RedisInsight.
The latest
<strong>
Search and Query
</strong>
capability introduces new and frequently asked Geo Polygon Search. Adding the
<code>
GEOMETRY
</code>
field type that supports polygon shapes using
<a href="https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry">
WKT
</a>
notation. In addition, it brings improvements in performance for
<code>
SORT BY
</code>
operations using
<code>
FT.SEARCH
</code>
and
<code>
FT.AGGREGATE
</code>
.
The latest
<strong>
JSON
</strong>
capability introduces the new
<code>
JSON.MERGE
</code>
in compliance with
<a href="https://datatracker.ietf.org/doc/html/rfc7396">
RFC 7396
</a>
, and
<code>
JSON.MSET
</code>
, which supports atomic multiple sets for keys in the same hash slot.
</p>
<h3 id="details-15">
Details:
</h3>
<p>
<strong>
Features
</strong>
</p>
<ul>
<li>
<p>
<strong>
Search and Query
</strong>
:
</p>
<ul>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/3553">
#3553
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/3553">
https://github.com/RediSearch/RediSearch/pull/3553
</a>
) Introduce support for Geo-polygon shapes and queries
<ul>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/3476">
#3476
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/3476">
https://github.com/RediSearch/RediSearch/pull/3476
</a>
) Adding
<code>
GEOMETRY
</code>
<a href="https://redis.io/commands/ft.create/">
field type
</a>
to map polygons in the
<code>
SCHEMA
</code>
on
<code>
FT.CREATE
</code>
</li>
<li>
Adding polygons using
<a href="https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry">
WKT notation
</a>
, for example
<code>
POLYGON((x1 y1, x2 y2, ...))
</code>
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/3556">
#3556
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/3556">
https://github.com/RediSearch/RediSearch/pull/3556
</a>
) Adjust the
<a href="https://redis.io/commands/ft.search/#examples">
query syntax
</a>
on
<code>
FT.SEARCH
</code>
for Polygons using the predicate
<code>
@geom:[OPERATOR $poly]
</code>
and defining polygon in WKT format as
<code>
PARAMS 2 poly "POLYGON((10 20, ...))"
</code>
using
<code>
DIALECT 3
</code>
</li>
<li>
Initially
<code>
WITHIN
</code>
and
<code>
CONTAINS
</code>
operators with Geometries only
</li>
</ul>
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/3046">
#3046
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/3046">
https://github.com/RediSearch/RediSearch/pull/3046
</a>
) Introduce the
<code>
OPTIMIZE
</code>
keyword to
<code>
SORTBY
</code>
queries using
<code>
FT.SEARCH
</code>
and
<code>
FT.AGGREGATE
</code>
that improve performance in 4 different scenarios:
<ul>
<li>
<strong>
Skip Sorter
</strong>
- applied when there is no sort of any kind. The query can return once it reaches the
<code>
LIMIT
</code>
requested results.
</li>
<li>
<strong>
Partial Range
</strong>
- applied when there is a
<code>
SORTBY
</code>
numeric field, with no filter or filter by the same numeric field, the query iterate on a range large enough to satisfy the
<code>
LIMIT
</code>
requested results.
</li>
<li>
<strong>
Hybrid
</strong>
- applied when there is a
<code>
SORTBY
</code>
numeric field in addition to another non-numeric filter. Some results will get filtered, and the initial range may not be large enough. The iterator then is rewinded with the following ranges, and an additional iteration takes place to collect the
<code>
LIMIT
</code>
requested results.
</li>
<li>
<strong>
No optimization
</strong>
- If there is a sort by score or non-numeric field, there is no other option but to retrieve all results and compare their values.
</li>
</ul>
</li>
</ul>
</li>
<li>
<p>
<strong>
JSON
</strong>
:
</p>
<ul>
<li>
[
<a href="https://github.com/RedisJSON/RedisJSON/pull/916">
#916
</a>
](
<a href="https://github.com/RedisJSON/RedisJSON/pull/916">
https://github.com/RedisJSON/RedisJSON/pull/916
</a>
) Introduce the new
<code>
JSON.MERGE
</code>
in compliance with
<a href="https://datatracker.ietf.org/doc/html/rfc7396">
RFC 7396
</a>
, supporting:
<ul>
<li>
Creating new attributes on an existing JSON document
</li>
<li>
Updating and replacing values in parent and child attributes
</li>
<li>
Deleting existing attributes (giving
<code>
null
</code>
as value)
</li>
<li>
Array update - replacing an entire array with the new value
</li>
</ul>
</li>
<li>
[
<a href="https://github.com/RedisJSON/RedisJSON/pull/944">
#944
</a>
](
<a href="https://github.com/RedisJSON/RedisJSON/pull/944">
https://github.com/RedisJSON/RedisJSON/pull/944
</a>
) Introduce
<code>
JSON.MSET
</code>
, supporting atomic multiple sets for keys in the same hash slot
</li>
</ul>
</li>
</ul>
<p>
<strong>
Improvements
</strong>
</p>
<ul>
<li>
<strong>
Search and Query
</strong>
:
<ul>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/3628">
#3628
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/3628">
https://github.com/RediSearch/RediSearch/pull/3628
</a>
) Background indexing scanning performance
</li>
</ul>
</li>
</ul>
<p>
<strong>
Changed Behavior
</strong>
</p>
<ul>
<li>
<strong>
Search and Query
</strong>
:
<ul>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/3355">
#3355
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/3355">
https://github.com/RediSearch/RediSearch/pull/3355
</a>
) Expired keys deleted from the slave's index, returning an empty array instead of
<code>
nil
</code>
</li>
</ul>
</li>
</ul>
<p>
<strong>
Bug Fixes
</strong>
</p>
<ul>
<li>
<strong>
Search and Query
</strong>
:
<ul>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/3562">
#3562
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/3562">
https://github.com/RediSearch/RediSearch/pull/3562
</a>
) Index definition may load several times when using
<code>
REPLICAOF
</code>
causing a failure
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/3557">
#3557
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/3557">
https://github.com/RediSearch/RediSearch/pull/3557
</a>
)
<code>
TIMEOUT
</code>
configuration on
<code>
FT.AGGREGATE
</code>
query being ignored
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/3606">
#3606
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/3606">
https://github.com/RediSearch/RediSearch/pull/3606
</a>
) Update numeric inverted index
<code>
numEntries
</code>
avoiding excessive memory consumption
</li>
<li>
[
<a href="https://github.com/RediSearch/RediSearch/pull/3552">
#3552
</a>
](
<a href="https://github.com/RediSearch/RediSearch/pull/3552">
https://github.com/RediSearch/RediSearch/pull/3552
</a>
)
<code>
FT.CURSOR READ
</code>
on
<code>
JSON
</code>
numeric queries not returning results
</li>
</ul>
</li>
</ul>
<p>
<strong>
Redis version
</strong>
</p>
<ul>
<li>
<strong>
<a href="https://github.com/redis/redis/blob/7.2/00-RELEASENOTES">
Redis 7.2 RC2
</a>
</strong>
</li>
</ul>
<p>
<strong>
Module versions
</strong>
</p>
<ul>
<li>
<strong>
<a href="https://github.com/RediSearch/RediSearch/releases/tag/v2.8.2">
RediSearch 2.8.2
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisJSON/RedisJSON/releases/tag/v2.6.1">
RedisJSON 2.6.1
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/releases/tag/v1.10.0">
RedisTimeSeries 1.10.0
</a>
</strong>
</li>
<li>
<strong>
<a href="https://github.com/RedisBloom/RedisBloom/releases/tag/v2.6.0">
RedisBloom 2.6.0
</a>
</strong>
</li>
</ul>
<p>
<strong>
Recommended Client Libraries
</strong>
</p>
<ul>
<li>
Java
<ul>
<li>
<a href="https://github.com/redis/jedis/releases/">
Jedis 4.4.0 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/redis-om-spring/releases">
redis-om-spring 0.8.1 or greater
</a>
</li>
</ul>
</li>
<li>
Python
<ul>
<li>
<a href="https://github.com/redis/redis-py/releases">
redis-py 4.5.5 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/redis-om-python/releases">
redis-om-python 0.1.2 or greater
</a>
</li>
</ul>
</li>
<li>
NodeJS
<ul>
<li>
<a href="https://github.com/redis/node-redis/releases">
node-redis 4.6.6 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/redis-om-node/tags">
redis-om-node 0.2.0 or greater
</a>
</li>
</ul>
</li>
<li>
.NET
<ul>
<li>
<a href="https://github.com/redis/redis-om-dotnet/releases">
redis-om-dotnet 0.5.1 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/NRedisStack/releases">
NRedisStack 0.6.1 or greater
</a>
</li>
</ul>
</li>
<li>
Go
<ul>
<li>
<a href="https://github.com/redis/go-redis/releases">
go-redis 9.0.4 or greater
</a>
</li>
<li>
<a href="https://github.com/redis/rueidis/releases">
rueidis 1.0.3 or greater
</a>
</li>
</ul>
</li>
</ul>
<p>
Compatible with the latest
<a href="https://redis.io/download">
RedisInsight
</a>
. The docker image redis/redis-stack for this version is bundled with
<a href="https://github.com/RedisInsight/RedisInsight/releases/tag/2.26.0">
RedisInsight 2.26
</a>
.
</p>
<p>
Note: version numbers follow the pattern:
</p>
<p>
<code>
x.y.z-b
</code>
</p>
<ul>
<li>
<code>
x.y
</code>
Redis major version
</li>
<li>
<code>
z
</code>
increases with even numbers as a module x.y version increases.
</li>
<li>
<code>
b
</code>
denotes a patch to Redis or a module (any
<code>
z
</code>
of Redis or modules).
<code>
b
</code>
will consist of a
<code>
v
</code>
+ numeric value.
</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/redisstack/redisstack-7.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/integrate.html | <section class="prose w-full py-12 max-w-none">
<h1>
Libraries and tools
</h1>
</section>
|
https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisearch/.html | <section class="prose w-full py-12 max-w-none">
<h1>
RediSearch release notes
</h1>
<p class="text-lg -mt-5 mb-10">
RediSearch release notes for version 2.10 and earlier
</p>
<table>
<thead>
<tr>
<th style="text-align:left">
VersionΒ (ReleaseΒ date)
</th>
<th style="text-align:left">
MajorΒ changes
</th>
<th style="text-align:left">
MinΒ Redis
<br/>
version
</th>
<th style="text-align:left">
MinΒ cluster
<br/>
version
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisearch/redisearch-2.10-release-notes/">
v2.10 (July 2024)
</a>
</td>
<td style="text-align:left">
New vector data types. Enhanced indexing capabilities. Simplified query syntax. Expanded geospatial search.
</td>
<td style="text-align:left">
7.4
</td>
<td style="text-align:left">
7.6 (TBD)
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisearch/redisearch-2.8-release-notes/">
v2.8 (July 2023)
</a>
</td>
<td style="text-align:left">
RESP3 support. Geo Polygon Search. Performance improvements.
</td>
<td style="text-align:left">
7.2
</td>
<td style="text-align:left">
7.2.4
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisearch/redisearch-2.6-release-notes/">
v2.6 (November 2022)
</a>
</td>
<td style="text-align:left">
Search using wildcard queries for TEXT and TAG fields, multi-value indexing and querying of attributes for any attribute type, and indexing double-precision floating-point vectors and range queries from a given vector.
</td>
<td style="text-align:left">
6.0.16
</td>
<td style="text-align:left">
6.2.8
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisearch/redisearch-2.4-release-notes/">
v2.4 (March 2022)
</a>
</td>
<td style="text-align:left">
Vector Similarity Search (VSS). New query syntax Dialect version 2. Choose between Dialect 1 and Dialect 2 for query parser behavior. Hybrid queries.
</td>
<td style="text-align:left">
6.0.0
</td>
<td style="text-align:left">
6.0.0
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisearch/redisearch-2.2-release-notes/">
v2.2 (November 2021)
</a>
</td>
<td style="text-align:left">
Search and index JSON documents. Profiling queries. Field aliasing.
</td>
<td style="text-align:left">
6.0.0
</td>
<td style="text-align:left">
6.0.0
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisearch/redisearch-2.0-release-notes/">
v2.0 (September 2020)
</a>
</td>
<td style="text-align:left">
Automatically indexes data based on a key pattern. Scale a single index over multiple Redis shards. Improved query performance.
</td>
<td style="text-align:left">
6.0.0
</td>
<td style="text-align:left">
6.0.0
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisearch/redisearch-1.6-release-notes/">
v1.6 (January 2020)
</a>
</td>
<td style="text-align:left">
Improved performance of full-text search and aggregation queries. Support for aliasing of indices. Added a C API to embed RediSearch in other modules. Forked process garbage collection.
</td>
<td style="text-align:left">
4.0.0
</td>
<td style="text-align:left">
5.0.0
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisearch/redisearch-1.4-release-notes/">
v1.4 (August 2018)
</a>
</td>
<td style="text-align:left">
Conditional updates. Schema modification. Query spelling correction. Phonetic matching. More fuzziness in search. Retrieve and change runtime configuration. Unlimited autocomplete results.
</td>
<td style="text-align:left">
4.0.0
</td>
<td style="text-align:left">
5.0.0
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisearch/redisearch-1.2-release-notes/">
v1.2 (June 2018)
</a>
</td>
<td style="text-align:left">
Aggregation filters. Query attributes. Fuzzy matching. Conditional updates. Backslash escaping. Synonyms support.
</td>
<td style="text-align:left">
4.0.0
</td>
<td style="text-align:left">
5.0.0
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisearch/redisearch-1.1-release-notes/">
v1.1 (April 2018)
</a>
</td>
<td style="text-align:left">
Aggregations engine.
</td>
<td style="text-align:left">
4.0.0
</td>
<td style="text-align:left">
5.0.0
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/release-notes/redisearch/redisearch-1.0-release-notes/">
v1.0 (April 2018)
</a>
</td>
<td style="text-align:left">
Hamming distance scoring. Wildcard queries. Optional deletion of documents in FT.DEL. Optionally keep document hashes in FT.DROP. Delete geo-sets when dropping an index. Tag prefix completion support.
</td>
<td style="text-align:left">
4.0.0
</td>
<td style="text-align:left">
5.0.0
</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/release-notes/redisearch/"/>
<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.html | <section class="prose w-full py-12 max-w-none">
<h1>
Reference
</h1>
<p class="text-lg -mt-5 mb-10">
View reference material for Redis Data Integration
</p>
<nav>
<a href="/docs/latest/integrate/redis-data-integration/reference/config-yaml-reference/">
Redis Data Integration configuration file
</a>
<p>
Redis Data Integration configuration file reference
</p>
<a href="/docs/latest/integrate/redis-data-integration/reference/jmespath-custom-functions/">
JMESPath custom functions
</a>
<p>
JMESPath custom function reference
</p>
<a href="/docs/latest/integrate/redis-data-integration/reference/ports/">
RDI ports and protocols
</a>
<p>
Network ports and protocols used by RDI
</p>
<a href="/docs/latest/integrate/redis-data-integration/reference/cli/">
CLI reference
</a>
<p>
Reference for the RDI CLI commands
</p>
<a href="/docs/latest/integrate/redis-data-integration/reference/data-transformation/">
Data transformation reference
</a>
<p>
View reference material for RDI data transformations
</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/redis-data-integration/reference/"/>
<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/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/7.4/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/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 acl_pubsub_default resetchannels
</span></span></code></pre>
</div>
</li>
<li>
<p>
<a href="/docs/latest/operate/rs/7.4/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/7.4/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/7.4/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/7.4/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/operate/rs/7.4/references/rest-api/requests/shards/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Shard requests
</h1>
<p class="text-lg -mt-5 mb-10">
REST API requests for database shards
</p>
<table>
<thead>
<tr>
<th>
Method
</th>
<th>
Path
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="#get-all-shards">
GET
</a>
</td>
<td>
<code>
/v1/shards
</code>
</td>
<td>
Get all shards
</td>
</tr>
<tr>
<td>
<a href="#get-shard">
GET
</a>
</td>
<td>
<code>
/v1/shards/{uid}
</code>
</td>
<td>
Get a specific shard
</td>
</tr>
</tbody>
</table>
<h2 id="get-all-shards">
Get all shards
</h2>
<pre><code>GET /v1/shards
</code></pre>
<p>
Get information about all shards in the cluster.
</p>
<h3 id="get-all-request">
Request
</h3>
<h4 id="example-http-request">
Example HTTP request
</h4>
<pre><code>GET /shards?extra_info_keys=used_memory_rss&extra_info_keys=connected_clients
</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="query-parameters">
Query parameters
</h4>
<table>
<thead>
<tr>
<th>
Field
</th>
<th>
Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
extra_info_keys
</td>
<td>
list of strings
</td>
<td>
A list of extra keys to be fetched (optional)
</td>
</tr>
</tbody>
</table>
<h3 id="get-all-response">
Response
</h3>
<p>
Returns a JSON array of
<a href="/docs/latest/operate/rs/7.4/references/rest-api/objects/shard/">
shard objects
</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="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"uid"</span><span class="p">:</span> <span class="s2">"1"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"role"</span><span class="p">:</span> <span class="s2">"master"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"assigned_slots"</span><span class="p">:</span> <span class="s2">"0-16383"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"bdb_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">"detailed_status"</span><span class="p">:</span> <span class="s2">"ok"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"loading"</span><span class="p">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"status"</span><span class="p">:</span> <span class="s2">"idle"</span>
</span></span><span class="line"><span class="cl"> <span class="p">},</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"node_uid"</span><span class="p">:</span> <span class="s2">"1"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"redis_info"</span><span class="p">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"connected_clients"</span><span class="p">:</span> <span class="mi">14</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"used_memory_rss"</span><span class="p">:</span> <span class="mi">12263424</span>
</span></span><span class="line"><span class="cl"> <span class="p">},</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"report_timestamp"</span><span class="p">:</span> <span class="s2">"2024-06-28T18:44:01Z"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"status"</span><span class="p">:</span> <span class="s2">"active"</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="nt">"uid"</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">"role"</span><span class="p">:</span> <span class="s2">"slave"</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><span class="line"><span class="cl"><span class="p">]</span>
</span></span></code></pre>
</div>
<h3 id="get-all-status-codes">
Status codes
</h3>
<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="get-shard">
Get shard
</h2>
<pre><code>GET /v1/shards/{int: uid}
</code></pre>
<p>
Gets information about a single shard.
</p>
<h3 id="get-request">
Request
</h3>
<h4 id="example-http-request-1">
Example HTTP request
</h4>
<pre><code>GET /shards/1?extra_info_keys=used_memory_rss&extra_info_keys=connected_clients
</code></pre>
<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="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 requested shard.
</td>
</tr>
</tbody>
</table>
<h4 id="query-parameters-1">
Query parameters
</h4>
<table>
<thead>
<tr>
<th>
Field
</th>
<th>
Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
extra_info_keys
</td>
<td>
list of strings
</td>
<td>
A list of extra keys to be fetched (optional)
</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/shard/">
shard 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">"assigned_slots"</span><span class="p">:</span> <span class="s2">"0-16383"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"bdb_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">"detailed_status"</span><span class="p">:</span> <span class="s2">"ok"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"loading"</span><span class="p">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"status"</span><span class="p">:</span> <span class="s2">"idle"</span>
</span></span><span class="line"><span class="cl"> <span class="p">},</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"node_uid"</span><span class="p">:</span> <span class="s2">"1"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"redis_info"</span><span class="p">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"connected_clients"</span><span class="p">:</span> <span class="mi">14</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"used_memory_rss"</span><span class="p">:</span> <span class="mi">12263424</span>
</span></span><span class="line"><span class="cl"> <span class="p">},</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"role"</span><span class="p">:</span> <span class="s2">"master"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"report_timestamp"</span><span class="p">:</span> <span class="s2">"2024-06-28T18:44:01Z"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"status"</span><span class="p">:</span> <span class="s2">"active"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"uid"</span><span class="p">:</span> <span class="s2">"1"</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="https://www.rfc-editor.org/rfc/rfc9110.html#name-200-ok">
200 OK
</a>
</td>
<td>
No error.
</td>
</tr>
<tr>
<td>
<a href="https://www.rfc-editor.org/rfc/rfc9110.html#name-404-not-found">
404 Not Found
</a>
</td>
<td>
Shard UID 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/shards/"/>
<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/bdbs/actions/optimize_shards_placement/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Optimize shards placement database action requests
</h1>
<p class="text-lg -mt-5 mb-10">
Optimize shard placement requests
</p>
<table>
<thead>
<tr>
<th>
Method
</th>
<th>
Path
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="#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="get-bdbs-actions-optimize-shards-placement">
Get optimized shards placement
</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>/actions/optimize_shards_placement
</span></span></code></pre>
</div>
<p>
Get optimized shards placement for the given database.
</p>
<h4 id="required-permissions">
Required permissions
</h4>
<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_bdb_info">
view_bdb_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 /bdbs/1/actions/optimize_shards_placement
</span></span></code></pre>
</div>
<h4 id="query-parameters">
Query parameters
</h4>
<p>
Include query parameters in a
<code>
GET
</code>
request to generate an optimized shard placement blueprint for a database, using settings that are different from the database's current configuration.
</p>
<table>
<thead>
<tr>
<th>
Field
</th>
<th>
Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
avoid_nodes
</td>
<td>
list of integers
</td>
<td>
Comma-separated list of cluster node IDs to avoid when placing the databaseβs shards and binding its endpoints (for example,
<code>
avoid_nodes=1,2
</code>
)
</td>
</tr>
<tr>
<td>
memory_size
</td>
<td>
integer (default:Β 0)
</td>
<td>
Database memory limit (0 is unlimited), expressed in bytes
</td>
</tr>
<tr>
<td>
shards_count
</td>
<td>
integer,
<nobr>
(range: 1-512)
</nobr>
(default:Β 1)
</td>
<td>
Number of database server-side shards
</td>
</tr>
<tr>
<td>
shards_placement
</td>
<td>
<code>
dense
</code>
<br/>
<code>
sparse
</code>
</td>
<td>
Control the density of shards
<br/>
<code>
dense
</code>
: Shards reside on as few nodes as possible
<br/>
<code>
sparse
</code>
: Shards reside on as many nodes as possible
</td>
</tr>
<tr>
<td>
bigstore_ram_size
</td>
<td>
integer (default:Β 0)
</td>
<td>
Memory size of bigstore RAM part, expressed in bytes
</td>
</tr>
<tr>
<td>
replication
</td>
<td>
<code>
enabled
</code>
<br/>
<code>
disabled
</code>
</td>
<td>
In-memory database replication mode
</td>
</tr>
</tbody>
</table>
<p>
The following example request includes
<code>
shards_count
</code>
and
<code>
memory_size
</code>
as query parameters:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">GET /bdbs/1/actions/optimize_shards_placement?shards_count<span class="o">=</span>10<span class="p">&</span><span class="nv">memory_size</span><span class="o">=</span><span class="m">10000</span>
</span></span></code></pre>
</div>
<h3 id="get-response">
Response
</h3>
<p>
To rearrange the database shards, you can submit the blueprint returned in this response body as the
<code>
shards_blueprint
</code>
field in the
<a href="#put-bdbs-rearrange-shards">
<code>
PUT
</code>
<code>
/bdbs/{uid}
</code>
</a>
request.
</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="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"nodes"</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">"node_uid"</span><span class="p">:</span> <span class="s2">"3"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"role"</span><span class="p">:</span> <span class="s2">"master"</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="nt">"node_uid"</span><span class="p">:</span> <span class="s2">"1"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"role"</span><span class="p">:</span> <span class="s2">"slave"</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="nt">"slot_range"</span><span class="p">:</span> <span class="s2">"5461-10922"</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="nt">"nodes"</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">"node_uid"</span><span class="p">:</span> <span class="s2">"3"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"role"</span><span class="p">:</span> <span class="s2">"master"</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="nt">"node_uid"</span><span class="p">:</span> <span class="s2">"1"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"role"</span><span class="p">:</span> <span class="s2">"slave"</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="nt">"slot_range"</span><span class="p">:</span> <span class="s2">"10923-16383"</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="nt">"nodes"</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">"node_uid"</span><span class="p">:</span> <span class="s2">"3"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"role"</span><span class="p">:</span> <span class="s2">"master"</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="nt">"node_uid"</span><span class="p">:</span> <span class="s2">"1"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"role"</span><span class="p">:</span> <span class="s2">"slave"</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="nt">"slot_range"</span><span class="p">:</span> <span class="s2">"0-5460"</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>
<h4 id="headers">
Headers
</h4>
<table>
<thead>
<tr>
<th>
Key
</th>
<th>
Value
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
Content-Length
</td>
<td>
352
</td>
<td>
Length of the request body in octets
</td>
</tr>
<tr>
<td>
cluster-state-id
</td>
<td>
30
</td>
<td>
Cluster state ID
</td>
</tr>
</tbody>
</table>
<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>
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>
Database UID does not exist
</td>
</tr>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.7">
406 Not Acceptable
</a>
</td>
<td>
Not enough resources in the cluster to host the database
</td>
</tr>
</tbody>
</table>
<h2 id="put-bdbs-rearrange-shards">
Rearrange database shards
</h2>
<p>
Use the blueprint returned by the
<a href="/docs/latest/operate/rs/references/rest-api/requests/bdbs/actions/optimize_shards_placement/#get-bdbs-actions-optimize-shards-placement">
<code>
GET
</code>
<code>
/bdbs/{uid}/actions/optimize_shards_placement
</code>
</a>
request as the value of the
<code>
shards_blueprint
</code>
field to rearrange the database shards.
</p>
<p>
To ensure that the optimized shard placement is relevant for the current cluster state, pass the
<code>
cluster-state-id
</code>
, taken from the response header of the
<code>
GET
</code>
request, in the
<a href="/docs/latest/operate/rs/references/rest-api/requests/bdbs/#put-bdbs">
<code>
PUT
</code>
<code>
/bdbs/{uid}
</code>
</a>
request headers.
</p>
<p>
The cluster will reject the update if its state was changed since the optimal shards placement was obtained.
</p>
<h3 id="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 /bdbs/1
</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>
<tr>
<td>
cluster-state-id
</td>
<td>
30
</td>
<td>
Cluster state ID
</td>
</tr>
</tbody>
</table>
<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">"shards_blueprint"</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">"nodes"</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">"node_uid"</span><span class="p">:</span> <span class="s2">"2"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"role"</span><span class="p">:</span> <span class="s2">"master"</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="nt">"slot_range"</span><span class="p">:</span> <span class="s2">"0-8191"</span>
</span></span><span class="line"><span class="cl"> <span class="p">},</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"..."</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>
<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>
If you submit such an optimized blueprint, it may cause strain on the cluster and its resources. Use with caution.
</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/references/rest-api/requests/bdbs/actions/optimize_shards_placement/"/>
<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/bf.madd/.html | <section class="prose w-full py-12">
<h1 class="command-name">
BF.MADD
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">BF.MADD key item [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 * n), where k is the number of hash functions and n is the number of items
</dd>
</dl>
<p>
Adds one or more items to a Bloom filter.
</p>
<p>
This command is similar to
<a href="/docs/latest/commands/bf.add/">
<code>
BF.ADD
</code>
</a>
, except that you can add more than one item.
</p>
<p>
This command is similar to
<a href="/docs/latest/commands/bf.insert/">
<code>
BF.INSERT
</code>
</a>
, except that the error rate, capacity, and expansion cannot be specified.
</p>
<h2 id="required-arguments">
Required arguments
</h2>
<details open="">
<summary>
<code>
key
</code>
</summary>
<p>
is key name for a Bloom filter to add the items to.
</p>
<p>
If
<code>
key
</code>
does not exist - a new Bloom filter is created with default error rate, capacity, and expansion (see
<a href="/docs/latest/commands/bf.reserve/">
<code>
BF.RESERVE
</code>
</a>
).
</p>
</details>
<details open="">
<summary>
<code>
item...
</code>
</summary>
<p>
One or more items 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/#arrays">
Array reply
</a>
where each element is either
<ul>
<li>
<a href="/docs/latest/develop/reference/protocol-spec/#integers">
Integer reply
</a>
- where "1" means that the item has been added successfully, and "0" means that such item was already added to the filter (which could be wrong)
</li>
<li>
[] when the item cannot be added because the filter is full
</li>
</ul>
</li>
<li>
[] on error (invalid arguments, wrong key type, etc.)
</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> BF.MADD bf item1 item2 item2
</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">1</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">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/bf.madd/"/>
<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/quickstarts/redis-enterprise-software-quickstart/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Redis Enterprise Software quickstart
</h1>
<p class="text-lg -mt-5 mb-10">
Set up a test deployment of Redis Enterprise Software for Linux.
</p>
<p>
This guide helps you install Redis Enterprise Software on a Linux host to test its capabilities.
</p>
<p>
When finished, you'll have a simple cluster with a single node:
</p>
<ol>
<li>
<p>
<a href="#ensure-port-availability">
Ensure port availability
</a>
</p>
</li>
<li>
<p>
<a href="#install-redis-enterprise-software">
Install Redis Enterprise Software
</a>
</p>
</li>
<li>
<p>
<a href="#set-up-a-cluster">
Set up a Redis Enterprise Software cluster
</a>
</p>
</li>
<li>
<p>
<a href="#create-a-database">
Create a new Redis database
</a>
</p>
</li>
<li>
<p>
<a href="#connect-to-your-database">
Connect to your Redis database
</a>
</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>
<strong>
This quickstart is designed for local testing only.
</strong>
For production environments, see the
<a href="/docs/latest/operate/rs/installing-upgrading/#install-redis-enterprise-software">
install and setup
</a>
guide for deployment options and instructions.
</div>
</div>
<h2 id="ensure-port-availability">
Ensure port availability
</h2>
<p>
If ports that Redis assigns to the database are being used by the operating system or other processes, the installation fails.
</p>
<p>
Follow the relevant sections to configure required ports.
</p>
<p>
For recommended and optional port configuration, see
<a href="/docs/latest/operate/rs/networking/port-configurations/">
Network port configurations
</a>
.
</p>
<h3 id="update-sysctlconf-to-avoid-port-collisions">
Update
<code>
sysctl.conf
</code>
to avoid port collisions
</h3>
<p>
To avoid port collision, update
<code>
/etc/sysctl.conf
</code>
to include:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">net.ipv4.ip_local_port_range <span class="o">=</span> <span class="m">30000</span> <span class="m">65535</span>
</span></span></code></pre>
</div>
<h3 id="ubuntu-conflicts-with-port-53">
Ubuntu conflicts with port 53
</h3>
<p>
If port 53 is in use, the installation fails. This can occur in
default installations of Ubuntu 18.04 and 20.04 in which
<code>
systemd-resolved
</code>
(DNS server) is running.
</p>
<p>
To prevent this issue, change the system configuration to make this port available
before installation.
</p>
<ol>
<li>
<p>
Edit
<code>
/etc/systemd/resolved.conf
</code>
:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">sudo vi /etc/systemd/resolved.conf
</span></span></code></pre>
</div>
</li>
<li>
<p>
Add
<code>
DNSStubListener=no
</code>
as the last line in the file and save the file.
</p>
</li>
<li>
<p>
Rename the current
<code>
/etc/resolv.conf
</code>
file:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">sudo mv /etc/resolv.conf /etc/resolv.conf.orig
</span></span></code></pre>
</div>
</li>
<li>
<p>
Create a symbolic link for
<code>
/etc/resolv.conf
</code>
:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf
</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 might encounter a temporary name resolution error (
<code>
sudo: unable to resolve host {hostname}: Temporary failure in name resolution
</code>
), which should be fixed when you restart
<code>
systemd-resolved
</code>
in the next step.
</div>
</div>
</li>
<li>
<p>
Restart the DNS service:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">sudo service systemd-resolved restart
</span></span></code></pre>
</div>
</li>
</ol>
<h3 id="configuration-for-aws-and-gcp">
Configuration for AWS and GCP
</h3>
<p>
For detailed configuration instructions, see your cloud provider's documentation.
</p>
<ol>
<li>
<p>
Create a VPC that you can use with regional subnets.
</p>
</li>
<li>
<p>
Within this VPC, create firewall rules that allow external and internal access for Redis Enterprise Software.
</p>
</li>
</ol>
<table>
<thead>
<tr>
<th>
Ingress/Egress
</th>
<th>
Source
</th>
<th>
Protocol
</th>
<th>
Ports
</th>
<th>
Other protocols
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
Ingress
</td>
<td>
0.0.0.0/0
</td>
<td>
TCP
</td>
<td>
21, 22, 53, 8001, 8443, 9443, 8070,
<nobr>
10000-19999
</nobr>
</td>
<td>
ICMP
</td>
</tr>
<tr>
<td>
Ingress
</td>
<td>
0.0.0.0/0
</td>
<td>
UDP
</td>
<td>
53, 5353
</td>
<td>
</td>
</tr>
<tr>
<td>
Ingress
</td>
<td>
10.0.0.0/8 (if subnets use 10. ranges)
</td>
<td>
all
</td>
<td>
all
</td>
<td>
</td>
</tr>
</tbody>
</table>
<h2 id="install-redis-enterprise-software">
Install Redis Enterprise Software
</h2>
<p>
To install Redis Enterprise Software:
</p>
<ol>
<li>
<p>
Download the installation files from the
<a href="https://redis.com/redis-enterprise-software/download-center/software/">
Redis Enterprise Download Center
</a>
and copy the download package to a machine with a Linux-based OS.
</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 are required to create a free account to access the download center.
</div>
</div>
</li>
<li>
<p>
Extract the installation files:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">tar vxf <downloaded tar file name>
</span></span></code></pre>
</div>
</li>
<li>
<p>
Run the
<code>
install.sh
</code>
script in the current directory:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">sudo ./install.sh -y
</span></span></code></pre>
</div>
</li>
</ol>
<h2 id="set-up-a-cluster">
Set up a cluster
</h2>
<p>
To set up your machine as a Redis Enterprise Software cluster:
</p>
<ol>
<li>
<p>
In the web browser on the host machine, go to
<a href="https://localhost:8443">
https://localhost:8443
</a>
to see
the new Redis Enterprise Software Cluster Manager UI. The cluster generates self-signed TLS certificates to secure the connection. These self-signed certificates are unknown to the browser and must be accepted before you proceed.
</p>
<p>
To use the legacy UI for this quickstart instead, see the
<a href="https://docs.redis.com/6.4/rs/installing-upgrading/quickstarts/">
6.4 version of the quickstarts
</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>
<ul>
<li>
If the server does not show the login screen, try again after a few minutes.
</li>
</ul>
</div>
</div>
</li>
<li>
<p>
Select
<strong>
Create new cluster
</strong>
.
</p>
<a href="/docs/latest/images/rs/screenshots/cluster/setup/create-cluster.png" sdata-lightbox="/images/rs/screenshots/cluster/setup/create-cluster.png">
<img alt="When you first install Redis Enterprise Software, you need to set up a cluster." src="/docs/latest/images/rs/screenshots/cluster/setup/create-cluster.png"/>
</a>
</li>
<li>
<p>
Enter an email and password for the administrator account, then select
<strong>
Next
</strong>
to proceed to cluster setup.
</p>
<a href="/docs/latest/images/rs/screenshots/cluster/setup/admin-credentials.png" sdata-lightbox="/images/rs/screenshots/cluster/setup/admin-credentials.png">
<img alt="Set the credentials for your admin user." src="/docs/latest/images/rs/screenshots/cluster/setup/admin-credentials.png"/>
</a>
<p>
You can also use these credentials to connect to the
<a href="/docs/latest/operate/rs/references/rest-api/">
REST API
</a>
.
</p>
</li>
<li>
<p>
Enter your cluster license key if you have one. Otherwise, a trial version is installed.
</p>
<a href="/docs/latest/images/rs/screenshots/cluster/setup/cluster-license-key.png" sdata-lightbox="/images/rs/screenshots/cluster/setup/cluster-license-key.png">
<img alt="Enter your cluster license key if you have one." src="/docs/latest/images/rs/screenshots/cluster/setup/cluster-license-key.png"/>
</a>
</li>
<li>
<p>
In the
<strong>
Configuration
</strong>
section, enter a cluster FQDN such as
<code>
cluster.local
</code>
, then select
<strong>
Next
</strong>
.
</p>
<a href="/docs/latest/images/rs/screenshots/cluster/setup/config-cluster.png" sdata-lightbox="/images/rs/screenshots/cluster/setup/config-cluster.png">
<img alt="Configure the cluster FQDN." src="/docs/latest/images/rs/screenshots/cluster/setup/config-cluster.png"/>
</a>
<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>
If the FQDN is
<code>
cluster.local
</code>
, you cannot configure DNS. You cannot change the FQDN after cluster creation.
</div>
</div>
</li>
<li>
<p>
On the node setup screen, select
<strong>
Create cluster
</strong>
to accept the defaults.
</p>
<a href="/docs/latest/images/rs/screenshots/cluster/setup/node-settings.png" sdata-lightbox="/images/rs/screenshots/cluster/setup/node-settings.png">
<img alt="Configure the node specific settings." src="/docs/latest/images/rs/screenshots/cluster/setup/node-settings.png"/>
</a>
</li>
<li>
<p>
Select
<strong>
OK
</strong>
to acknowledge the replacement of the HTTPS TLS certificate on the node. If you receive a browser warning, you can proceed safely.
</p>
<a href="/docs/latest/images/rs/screenshots/cluster/setup/https-page-refresh-modal.png" sdata-lightbox="/images/rs/screenshots/cluster/setup/https-page-refresh-modal.png">
<img alt="Modal shown when a page refresh is needed because the certificates have been updated." src="/docs/latest/images/rs/screenshots/cluster/setup/https-page-refresh-modal.png"/>
</a>
</li>
</ol>
<h2 id="create-a-database">
Create a database
</h2>
<ol>
<li>
<p>
On the
<strong>
Databases
</strong>
screen, select
<strong>
Quick database
</strong>
.
</p>
<a href="/docs/latest/images/rs/screenshots/databases/db-screen.png" sdata-lightbox="/images/rs/screenshots/databases/db-screen.png">
<img alt="Select Quick database on the Databases screen." src="/docs/latest/images/rs/screenshots/databases/db-screen.png"/>
</a>
</li>
<li>
<p>
Enter 12000 for the
<strong>
Port
</strong>
.
</p>
<p>
If port 12000 is not available, enter any available port number between 10000 to 19999 or leave it blank to let the cluster assign a port number for you. You will use this port number to connect to the database.
</p>
<a href="/docs/latest/images/rs/screenshots/databases/quick-db-7-8-2.png" sdata-lightbox="/images/rs/screenshots/databases/quick-db-7-8-2.png">
<img alt="Create a quick database." src="/docs/latest/images/rs/screenshots/databases/quick-db-7-8-2.png"/>
</a>
</li>
<li>
<p>
Select
<strong>
Create
</strong>
to create your database.
</p>
</li>
</ol>
<p>
When you see
<strong>
Database active
</strong>
appear on the database configuration screen, the database is activated and ready for you to use.
</p>
<a href="/docs/latest/images/rs/icons/db-active-icon.png" sdata-lightbox="/images/rs/icons/db-active-icon.png">
<img alt="Database active icon." src="/docs/latest/images/rs/icons/db-active-icon.png" width="150px"/>
</a>
<p>
You now have a Redis database!
</p>
<h2 id="connect-to-your-database">
Connect to your database
</h2>
<p>
After you create the Redis database, you can connect to it and store data.
See
<a href="/docs/latest/operate/rs/databases/connect/test-client-connectivity/">
Test client connection
</a>
for connection options and examples.
</p>
<h2 id="supported-web-browsers">
Supported web browsers
</h2>
<p>
To use the Redis Enterprise Software Cluster Manager UI, you need a modern browser with JavaScript enabled.
</p>
<p>
The Cluster Manager UI is officially supported for the latest version of
<a href="https://www.google.com/chrome/">
Google Chrome
</a>
, as well as the three previous and three subsequent versions.
</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/installing-upgrading/quickstarts/redis-enterprise-software-quickstart/"/>
<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/randomkey/.html | <section class="prose w-full py-12">
<h1 class="command-name">
RANDOMKEY
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">RANDOMKEY</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(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>
@read
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@slow
</code>
<span class="mr-1 last:hidden">
,
</span>
</dd>
</dl>
<p>
Return a random key from the currently selected database.
</p>
<h2 id="resp2-reply">
RESP2 Reply
</h2>
<p>
One of the following:
</p>
<ul>
<li>
<a href="../../develop/reference/protocol-spec#bulk-strings">
Nil reply
</a>
: when the database is empty.
</li>
<li>
<a href="../../develop/reference/protocol-spec#bulk-strings">
Bulk string reply
</a>
: a random key in database.
</li>
</ul>
<h2 id="resp3-reply">
RESP3 Reply
</h2>
<p>
One of the following:
</p>
<ul>
<li>
<a href="../../develop/reference/protocol-spec#nulls">
Null reply
</a>
: when the database is empty.
</li>
<li>
<a href="../../develop/reference/protocol-spec#bulk-strings">
Bulk string reply
</a>
: a random key in the database.
</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/randomkey/"/>
<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/certificates/updating-certificates/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Update certificates
</h1>
<p class="text-lg -mt-5 mb-10">
Update certificates in a Redis Enterprise 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>
When you update the certificates, the new certificate replaces the same certificates on all nodes in the cluster.
</div>
</div>
<h2 id="how-to-update-certificates">
How to update certificates
</h2>
<p>
You can use the
<a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/">
<code>
rladmin
</code>
</a>
command-line interface (CLI) or the
<a href="/docs/latest/operate/rs/7.4/references/rest-api/">
REST API
</a>
to update certificates. The Cluster Manager UI lets you update proxy and syncer certificates on the
<strong>
Cluster > Security > Certificates
</strong>
screen.
</p>
<p>
The new certificates are used the next time the clients connect to the database.
</p>
<p>
When you upgrade Redis Enterprise Software, the upgrade process copies the certificates that are on the first upgraded node to all of the nodes in the 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">
Note:
</div>
Don't manually overwrite the files located in
<code>
/etc/opt/redislabs
</code>
. Instead, upload new certificates to a temporary location on one of the cluster nodes, such as the
<code>
/tmp
</code>
directory.
</div>
</div>
<h3 id="use-the-cluster-manager-ui">
Use the Cluster Manager UI
</h3>
<p>
To replace proxy or syncer certificates using the Cluster Manager UI:
</p>
<ol>
<li>
<p>
Go to
<strong>
Cluster > Security > Certificates
</strong>
.
</p>
</li>
<li>
<p>
Expand the section for the certificate you want to update:
</p>
<ul>
<li>
For the proxy certificate, expand
<strong>
Server authentication
</strong>
.
</li>
<li>
For the syncer certificate, expand
<strong>
Replica Of and Active-Active authentication
</strong>
.
</li>
</ul>
<a href="/docs/latest/images/rs/screenshots/cluster/security-expand-proxy-cert.png" sdata-lightbox="/images/rs/screenshots/cluster/security-expand-proxy-cert.png">
<img alt="Expanded proxy certificate for server authentication." src="/docs/latest/images/rs/screenshots/cluster/security-expand-proxy-cert.png"/>
</a>
</li>
<li>
<p>
Click
<strong>
Replace Certificate
</strong>
to open the dialog.
</p>
<a href="/docs/latest/images/rs/screenshots/cluster/security-replace-proxy-cert.png" sdata-lightbox="/images/rs/screenshots/cluster/security-replace-proxy-cert.png">
<img alt="Replace proxy certificate dialog." src="/docs/latest/images/rs/screenshots/cluster/security-replace-proxy-cert.png"/>
</a>
</li>
<li>
<p>
Upload the key file.
</p>
</li>
<li>
<p>
Upload the new certificate.
</p>
</li>
<li>
<p>
Click
<strong>
Save
</strong>
.
</p>
</li>
</ol>
<h3 id="use-the-cli">
Use the CLI
</h3>
<p>
To replace certificates with the
<code>
rladmin
</code>
CLI, run the
<a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/cluster/certificate/">
<code>
cluster certificate set
</code>
</a>
command:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl"> rladmin cluster certificate <span class="nb">set</span> <cert-name> certificate_file <cert-file-name>.pem key_file <key-file-name>.pem
</span></span></code></pre>
</div>
<p>
Replace the following variables with your own values:
</p>
<ul>
<li>
<code>
<cert-name>
</code>
- The name of the certificate you want to replace. See the
<a href="/docs/latest/operate/rs/7.4/security/certificates/">
certificates table
</a>
for the list of valid certificate names.
</li>
<li>
<code>
<cert-file-name>
</code>
- The name of your certificate file
</li>
<li>
<code>
<key-file-name>
</code>
- The name of your key file
</li>
</ul>
<p>
For example, to replace the Cluster Manager UI (
<code>
cm
</code>
) certificate with the private key
<code>
key.pem
</code>
and the certificate file
<code>
cluster.pem
</code>
:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin cluster certificate <span class="nb">set</span> cm certificate_file cluster.pem key_file key.pem
</span></span></code></pre>
</div>
<h3 id="use-the-rest-api">
Use the REST API
</h3>
<p>
To replace a certificate using the REST API, use
<a href="/docs/latest/operate/rs/7.4/references/rest-api/requests/cluster/certificates/#put-cluster-update_cert">
<code>
PUT /v1/cluster/update_cert
</code>
</a>
:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">PUT https://<span class="o">[</span>host<span class="o">][</span>:port<span class="o">]</span>/v1/cluster/update_cert
</span></span><span class="line"><span class="cl"> <span class="s1">'{ "name": "<cert_name>", "key": "<key>", "certificate": "<cert>" }'</span>
</span></span></code></pre>
</div>
<p>
Replace the following variables with your own values:
</p>
<ul>
<li>
<p>
<code>
<cert_name>
</code>
- The name of the certificate to replace. See the
<a href="/docs/latest/operate/rs/7.4/security/certificates/">
certificates table
</a>
for the list of valid certificate names.
</p>
</li>
<li>
<p>
<code>
<key>
</code>
- The contents of the *_key.pem file
</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 key file contains
<code>
\n
</code>
end of line characters (EOL) that you cannot paste into the API call.
You can use
<code>
sed -z 's/\n/\\\n/g'
</code>
to escape the EOL characters.
</div>
</div>
</li>
<li>
<p>
<code>
<cert>
</code>
- The contents of the *_cert.pem file
</p>
</li>
</ul>
<h2 id="replica-of-database-certificates">
Replica Of database certificates
</h2>
<p>
This section describes how to update certificates for Replica Of databases.
</p>
<h3 id="update-ap-proxy-certs">
Update proxy certificates
</h3>
<p>
To update the proxy certificate on clusters running Replica Of databases:
</p>
<ol>
<li>
<p>
Use the Cluster Manager UI,
<code>
rladmin
</code>
, or the REST API to update the proxy certificate on the source database cluster.
</p>
</li>
<li>
<p>
From the Cluster Manager UI, update the destination database (
<em>
replica
</em>
) configuration with the
<a href="/docs/latest/operate/rs/7.4/databases/import-export/replica-of/create/#encrypt-replica-database-traffic">
new certificate
</a>
.
</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>
<ul>
<li>
Perform step 2 as quickly as possible after performing step 1. Connections using the previous certificate are rejected after applying the new certificate. Until both steps are performed, recovery of the database sync cannot be established.
</li>
</ul>
</div>
</div>
<h2 id="active-active-database-certificates">
Active-Active database certificates
</h2>
<h3 id="update-aa-proxy-certs">
Update proxy certificates
</h3>
<p>
To update proxy certificate on clusters running Active-Active databases:
</p>
<ol>
<li>
<p>
Use the Cluster Manager UI,
<code>
rladmin
</code>
, or the REST API to update proxy certificates on a single cluster, multiple clusters, or all participating clusters.
</p>
</li>
<li>
<p>
Use the
<a href="/docs/latest/operate/rs/7.4/references/cli-utilities/crdb-cli/">
<code>
crdb-cli
</code>
</a>
utility to update Active-Active database configuration from the command line. Run the following command once for each Active-Active database residing on the modified clusters:
</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> --force
</span></span></code></pre>
</div>
</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>
<ul>
<li>
Perform step 2 as quickly as possible after performing step 1. Connections using the previous certificate are rejected after applying the new certificate. Until both steps are performed, recovery of the database sync cannot be established.
<br/>
</li>
<li>
Do not run any other
<code>
crdb-cli crdb update
</code>
operations between the two steps.
</li>
</ul>
</div>
</div>
<h3 id="update-aa-syncer-certs">
Update syncer certificates
</h3>
<p>
To update your syncer certificate on clusters running Active-Active databases, follow these steps:
</p>
<ol>
<li>
<p>
Update your syncer certificate on one or more of the participating clusters using the Cluster Manager UI,
<code>
rladmin
</code>
, or the REST API. You can update a single cluster, multiple clusters, or all participating clusters.
</p>
</li>
<li>
<p>
Update the Active-Active database configuration from the command line with the
<a href="/docs/latest/operate/rs/7.4/references/cli-utilities/crdb-cli/">
<code>
crdb-cli
</code>
</a>
utility. Run this command once for each Active-Active database that resides on the modified clusters:
</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> --force
</span></span></code></pre>
</div>
</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>
<ul>
<li>
Run step 2 as quickly as possible after step 1. Between the two steps, new syncer connections that use the βoldβ certificate will get rejected by the cluster that has been updated with the new certificate (in step 1).
<br/>
</li>
<li>
Do not run any other
<code>
crdb-cli crdb update
</code>
operations between the two steps.
<br/>
</li>
<li>
<strong>
Known limitation
</strong>
: Updating syncer certificate on versions prior to 6.0.20-81 will restart the proxy and syncer connections. In these cases, we recommend scheduling certificate replacement carefully to minimize customer impact.
</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/rs/7.4/security/certificates/updating-certificates/"/>
<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/reference/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Reference
</h1>
<p class="text-lg -mt-5 mb-10">
Reference material for the operator, cluster, and database deployment options.
</p>
<p>
This section contains the API reference for Redis custom resources and supported distributions.
</p>
<nav>
<a href="/docs/latest/operate/kubernetes/reference/redis_enterprise_active_active_database_api/">
RedisEnterpriseActiveActiveDatabase API Reference
</a>
<br/>
<br/>
<a href="/docs/latest/operate/kubernetes/reference/redis_enterprise_cluster_api/">
RedisEnterpriseCluster API Reference
</a>
<br/>
<br/>
<a href="/docs/latest/operate/kubernetes/reference/redis_enterprise_database_api/">
RedisEnterpriseDatabase API Reference
</a>
<br/>
<br/>
<a href="/docs/latest/operate/kubernetes/reference/redis_enterprise_remote_cluster_api/">
RedisEnterpriseRemoteCluster API Reference
</a>
<br/>
<br/>
<a href="/docs/latest/operate/kubernetes/reference/supported_k8s_distributions/">
Supported Kubernetes distributions
</a>
<p>
Support matrix for the current Redis Enterprise K8s operator
</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/reference/"/>
<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.merge/.html | <section class="prose w-full py-12">
<h1 class="command-name">
JSON.MERGE
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">JSON.MERGE 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 2.6.0
</a>
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
Time complexity:
</dt>
<dd class="m-0">
O(M+N) when path is evaluated to a single value where M is the size of the original value (if it exists) and N is the size of the new value, O(M+N) when path is evaluated to multiple values where M is the size of the key and N is the size of the new value * the number of original values in the key
</dd>
</dl>
<p>
Merge a given JSON value into matching paths. Consequently, JSON values at matching paths are updated, deleted, or expanded with new children.
</p>
<p>
This command complies with
<a href="https://datatracker.ietf.org/doc/html/rfc7396">
RFC7396
</a>
Json Merge Patch
</p>
<p>
<a href="#examples">
Examples
</a>
</p>
<h2 id="required-arguments">
Required arguments
</h2>
<details open="">
<summary>
<code>
key
</code>
</summary>
<p>
is the key to merge into.
</p>
</details>
<details open="">
<summary>
<code>
path
</code>
</summary>
<p>
specifies the JSONPath. For non-existing keys the
<code>
path
</code>
must be
<code>
$
</code>
. For existing keys, for each matched
<code>
path
</code>
, the value that matches the
<code>
path
</code>
is merged with the JSON
<code>
value
</code>
. For existing keys, when the path exists, except for the last element, a new child is added with the JSON
<code>
value
</code>
.
</p>
</details>
<details open="">
<summary>
<code>
value
</code>
</summary>
<p>
is the JSON value to merge with at the specified path. Merging is done according to the following rules per JSON value in the
<code>
value
</code>
argument while considering the corresponding original value if it exists:
</p>
<ul>
<li>
merging an existing object key with a
<code>
null
</code>
value deletes the key
</li>
<li>
merging an existing object key with non-null value updates the value
</li>
<li>
merging a non-existing object key adds the key and value
</li>
<li>
merging an existing array with any merged value, replaces the entire array with the value
</li>
</ul>
</details>
<h2 id="return-value">
Return value
</h2>
<p>
JSON.MERGE returns a simple string reply:
<code>
OK
</code>
if executed correctly or
<code>
error
</code>
if fails to set the new values
</p>
<p>
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>
<p>
JSON.MERGE provides four different behaviors to merge changes on a given key: create a non-existent path, update an existing path with a new value, delete an existing path, or replace an array with a new array
</p>
<details open="">
<summary>
<b>
Create a non-existent path-value
</b>
</summary>
<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":2}'</span>
</span></span><span class="line"><span class="cl">OK
</span></span><span class="line"><span class="cl">redis> JSON.MERGE doc $.b <span class="s1">'8'</span>
</span></span><span class="line"><span class="cl">OK
</span></span><span class="line"><span class="cl">redis> JSON.GET doc $
</span></span><span class="line"><span class="cl"><span class="s2">"[{\"a\":2,\"b\":8}]"</span></span></span></code></pre>
</div>
</details>
<details open="">
<summary>
<b>
Replace an existing value
</b>
</summary>
<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":2}'</span>
</span></span><span class="line"><span class="cl">OK
</span></span><span class="line"><span class="cl">redis> JSON.MERGE doc $.a <span class="s1">'3'</span>
</span></span><span class="line"><span class="cl">OK
</span></span><span class="line"><span class="cl">redis> JSON.GET doc $
</span></span><span class="line"><span class="cl"><span class="s2">"[{\"a\":3}]"</span></span></span></code></pre>
</div>
</details>
<details open="">
<summary>
<b>
Delete an existing value
</b>
</summary>
<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":2}'</span>
</span></span><span class="line"><span class="cl">OK
</span></span><span class="line"><span class="cl">redis> JSON.MERGE doc $ <span class="s1">'{"a":null}'</span>
</span></span><span class="line"><span class="cl">OK
</span></span><span class="line"><span class="cl">redis> JSON.GET doc $
</span></span><span class="line"><span class="cl"><span class="s2">"[{}]"</span></span></span></code></pre>
</div>
</details>
<details open="">
<summary>
<b>
Replace an Array
</b>
</summary>
<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":[2,4,6,8]}'</span>
</span></span><span class="line"><span class="cl">OK
</span></span><span class="line"><span class="cl">redis> JSON.MERGE doc $.a <span class="s1">'[10,12]'</span>
</span></span><span class="line"><span class="cl">OK
</span></span><span class="line"><span class="cl">redis> JSON.GET doc $
</span></span><span class="line"><span class="cl"><span class="s2">"[{\"a\":[10,12]}]"</span></span></span></code></pre>
</div>
</details>
<details open="">
<summary>
<b>
Merge changes in multi-paths
</b>
</summary>
<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">'{"f1": {"a":1}, "f2":{"a":2}}'</span>
</span></span><span class="line"><span class="cl">OK
</span></span><span class="line"><span class="cl">redis> JSON.GET doc
</span></span><span class="line"><span class="cl"><span class="s2">"{\"f1\":{\"a\":1},\"f2\":{\"a\":2}}"</span>
</span></span><span class="line"><span class="cl">redis> JSON.MERGE doc $ <span class="s1">'{"f1": null, "f2":{"a":3, "b":4}, "f3":[2,4,6]}'</span>
</span></span><span class="line"><span class="cl">OK
</span></span><span class="line"><span class="cl">redis> JSON.GET doc
</span></span><span class="line"><span class="cl"><span class="s2">"{\"f2\":{\"a\":3,\"b\":4},\"f3\":[2,4,6]}"</span></span></span></code></pre>
</div>
</details>
<h2 id="see-also">
See also
</h2>
<p>
<a href="/docs/latest/commands/json.get/">
<code>
JSON.GET
</code>
</a>
|
<a href="/docs/latest/commands/json.mget/">
<code>
JSON.MGET
</code>
</a>
|
<a href="/docs/latest/commands/json.set/">
<code>
JSON.SET
</code>
</a>
|
<a href="/docs/latest/commands/json.mset/">
<code>
JSON.MSET
</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.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/json.arrtrim.html | <section class="prose w-full py-12">
<h1 class="command-name">
JSON.ARRTRIM
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">JSON.ARRTRIM key path start stop</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(N) when path is evaluated to a single value where N is the size of the array, O(N) when path is evaluated to multiple values, where N is the size of the key
</dd>
</dl>
<p>
Trim an array so that it contains only the specified inclusive range of elements
</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>
<h2 id="optional-arguments">
Optional arguments
</h2>
<details open="">
<summary>
<code>
path
</code>
</summary>
<p>
is JSONPath to specify. Default is root
<code>
$
</code>
.
</p>
</details>
<details open="">
<summary>
<code>
start
</code>
</summary>
<p>
is index of the first element to keep (previous elements are trimmed). Default is 0.
</p>
</details>
<details open="">
<summary>
<code>
stop
</code>
</summary>
<p>
is the index of the last element to keep (following elements are trimmed), including the last element. Default is 0. Negative values are interpreted as starting from the end.
</p>
</details>
<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">
About out-of-range indexes:
</div>
<p>
JSON.ARRTRIM is extremely forgiving, and using it with out-of-range indexes does not produce an error. Note a few differences between how RedisJSON v2.0 and legacy versions handle out-of-range indexes.
</p>
<p>
Behavior as of RedisJSON v2.0:
</p>
<ul>
<li>
If
<code>
start
</code>
is larger than the array's size or
<code>
start
</code>
>
<code>
stop
</code>
, returns 0 and an empty array.
</li>
<li>
If
<code>
start
</code>
is < 0, then start from the end of the array.
</li>
<li>
If
<code>
stop
</code>
is larger than the end of the array, it is treated like the last element.
</li>
</ul>
</div>
</div>
<h2 id="return">
Return
</h2>
<p>
JSON.ARRTRIM returns an array of integer replies for each path, the array's new size, or
<code>
nil
</code>
, if the matching JSON value is not an array.
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>
Trim an array to a specific set of values
</b>
</summary>
<p>
Create two headphone products with maximum sound levels.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis> JSON.SET key $
</span></span><span class="line"><span class="cl"><span class="s2">"[[{\"name\":\"Healthy headphones\",\"description\":\"Wireless Bluetooth headphones with noise-cancelling technology\",\"connection\":{\"wireless\":true,\"type\":\"Bluetooth\"},\"price\":99.98,\"stock\":25,\"colors\":[\"black\",\"silver\"],\"max_level\":[60,70,80]},{\"name\":\"Noisy headphones\",\"description\":\"Wireless Bluetooth headphones with noise-cancelling technology\",\"connection\":{\"wireless\":true,\"type\":\"Bluetooth\"},\"price\":99.98,\"stock\":25,\"colors\":[\"black\",\"silver\"],\"max_level\":[85,90,100,120]}]]"</span>
</span></span><span class="line"><span class="cl">OK</span></span></code></pre>
</div>
<p>
Add new sound level values to the second product.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis> JSON.ARRAPPEND key $.<span class="o">[</span>1<span class="o">]</span>.max_level <span class="m">140</span> <span class="m">160</span> <span class="m">180</span> <span class="m">200</span> <span class="m">220</span> <span class="m">240</span> <span class="m">260</span> <span class="m">280</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">12</span></span></span></code></pre>
</div>
<p>
Get the updated array.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis> JSON.GET key $.<span class="o">[</span>1<span class="o">]</span>.max_level
</span></span><span class="line"><span class="cl"><span class="s2">"[[85,90,100,120,140,160,180,200,220,240,260,280]]"</span></span></span></code></pre>
</div>
<p>
Keep only the values between the fifth and the ninth element, inclusive of that last element.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis> JSON.ARRTRIM key $.<span class="o">[</span>1<span class="o">]</span>.max_level <span class="m">4</span> <span class="m">8</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">5</span></span></span></code></pre>
</div>
<p>
Get the updated array.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis> JSON.GET key $.<span class="o">[</span>1<span class="o">]</span>.max_level
</span></span><span class="line"><span class="cl"><span class="s2">"[[140,160,180,200,220]]"</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.arrtrim/"/>
<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/connect/clients/python/redis-py/.html | <section class="prose w-full py-12 max-w-none">
<h1>
redis-py guide (Python)
</h1>
<p class="text-lg -mt-5 mb-10">
Connect your Python application to a Redis database
</p>
<p>
<a href="https://github.com/redis/redis-py">
redis-py
</a>
is the Python client for Redis.
The sections below explain how to install
<code>
redis-py
</code>
and connect your application
to a Redis database.
</p>
<p>
<code>
redis-py
</code>
requires a running Redis or
<a href="/docs/latest/operate/oss_and_stack/install/install-stack/">
Redis Stack
</a>
server. See
<a href="/docs/latest/operate/oss_and_stack/install/">
Getting started
</a>
for Redis installation instructions.
</p>
<p>
You can also access Redis with an object-mapping client interface. See
<a href="/docs/latest/integrate/redisom-for-python/">
RedisOM for Python
</a>
for more information.
</p>
<h2 id="install">
Install
</h2>
<p>
To install
<code>
redis-py
</code>
, enter:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">pip install redis
</span></span></code></pre>
</div>
<p>
For faster performance, install Redis with
<a href="https://github.com/redis/hiredis">
<code>
hiredis
</code>
</a>
support. This provides a compiled response parser, and for most cases requires zero code changes. By default, if
<code>
hiredis
</code>
>= 1.0 is available,
<code>
redis-py
</code>
attempts to use it for response parsing.
</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 Python
<code>
distutils
</code>
packaging scheme is no longer part of Python 3.12 and greater. If you're having difficulties getting
<code>
redis-py
</code>
installed in a Python 3.12 environment, consider updating to a recent release of
<code>
redis-py
</code>
.
</div>
</div>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">pip install redis<span class="o">[</span>hiredis<span class="o">]</span>
</span></span></code></pre>
</div>
<h2 id="connect-and-test">
Connect and test
</h2>
<p>
Connect to localhost on port 6379, set a value in Redis, and retrieve it. All responses are returned as bytes in Python. To receive decoded strings, set
<code>
decode_responses=True
</code>
. For more connection options, see
<a href="https://redis.readthedocs.io/en/stable/examples.html">
these examples
</a>
.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-python" data-lang="python"><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">host</span><span class="o">=</span><span class="s1">'localhost'</span><span class="p">,</span> <span class="n">port</span><span class="o">=</span><span class="mi">6379</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></code></pre>
</div>
<p>
Store and retrieve a simple string.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="n">r</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s1">'foo'</span><span class="p">,</span> <span class="s1">'bar'</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 class="n">r</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'foo'</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="c1"># bar</span>
</span></span></code></pre>
</div>
<p>
Store and retrieve a dict.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="n">r</span><span class="o">.</span><span class="n">hset</span><span class="p">(</span><span class="s1">'user-session:123'</span><span class="p">,</span> <span class="n">mapping</span><span class="o">=</span><span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="s1">'name'</span><span class="p">:</span> <span class="s1">'John'</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"surname"</span><span class="p">:</span> <span class="s1">'Smith'</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"company"</span><span class="p">:</span> <span class="s1">'Redis'</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"age"</span><span class="p">:</span> <span class="mi">29</span>
</span></span><span class="line"><span class="cl"><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">r</span><span class="o">.</span><span class="n">hgetall</span><span class="p">(</span><span class="s1">'user-session:123'</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="c1"># {'surname': 'Smith', 'name': 'John', 'company': 'Redis', 'age': '29'}</span>
</span></span></code></pre>
</div>
<h2 id="more-information">
More information
</h2>
<p>
The
<a href="https://redis-py.readthedocs.io/en/stable/index.html">
<code>
redis-py
</code>
</a>
website
has a
<a href="https://redis-py.readthedocs.io/en/stable/commands.html">
command reference
</a>
and some
<a href="https://redis.readthedocs.io/en/stable/examples.html">
tutorials
</a>
for
various tasks. There are also some examples in the
<a href="https://github.com/redis/redis-py">
GitHub repository
</a>
for
<code>
redis-py
</code>
.
</p>
<p>
See also the other pages in this section for more information and examples:
</p>
<nav>
<a href="/docs/latest/develop/clients/redis-py/connect/">
Connect to the server
</a>
<p>
Connect your Python application to a Redis database
</p>
<a href="/docs/latest/develop/clients/redis-py/queryjson/">
Example - Index and query JSON documents
</a>
<p>
Learn how to use the Redis query engine with JSON
</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/clients/redis-py/"/>
<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/data-pipelines/transform-examples/redis-json-example/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Write to a Redis JSON document
</h1>
<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 enable the
<a href="/docs/latest/develop/data-types/json/">
RedisJSON
</a>
module in the target Redis
database to use this feature.
</div>
</div>
<p>
In the example below, the data is captured from the source table named
<code>
invoice
</code>
and is written to the Redis database as a JSON document. The
<code>
connection
</code>
is an optional parameter that refers to the corresponding connection name defined in
<code>
config.yaml
</code>
. When you specify the
<code>
data_type
</code>
parameter for the job, it overrides the system-wide setting
<code>
target_data_type
</code>
defined in
<code>
config.yaml
</code>
.
</p>
<p>
Another optional parameter,
<code>
on_update
</code>
, specifies the writing strategy. You can set this to either
<code>
replace
</code>
(the default) or
<code>
merge
</code>
. This affects the way the document is written to the target. Replacing the document will overwrite it completely, while merging will update it with the fields captured in the source, keeping the rest of the document intact. The
<code>
replace
</code>
option is usually more performant, while
<code>
merge
</code>
allows other jobs and applications to set extra fields in the same JSON documents.
</p>
<p>
In this case, the result will be Redis JSON documents with key names based on the key expression (for example,
<code>
invoice_id:1
</code>
) and with an expiration of 100 seconds. If you don't supply an
<code>
expire
</code>
parameter, the keys will never expire.
</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">chinook</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">public</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">invoice</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">output</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">redis.write</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">connection</span><span class="p">:</span><span class="w"> </span><span class="l">target</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">data_type</span><span class="p">:</span><span class="w"> </span><span class="l">json</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(['invoice_id:', InvoiceId])</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><span class="line"><span class="cl"><span class="w"> </span><span class="nt">on_update</span><span class="p">:</span><span class="w"> </span><span class="l">replace </span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">expire</span><span class="p">:</span><span class="w"> </span><span class="m">100</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/data-pipelines/transform-examples/redis-json-example/"/>
<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/bootstrap/validate/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Bootstrap validation requests
</h1>
<p class="text-lg -mt-5 mb-10">
Boostrap validation requests
</p>
<table>
<thead>
<tr>
<th>
Method
</th>
<th>
Path
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="#post-bootstrap-validate">
POST
</a>
</td>
<td>
<code>
/v1/bootstrap/validate/{action}
</code>
</td>
<td>
Perform bootstrap validation
</td>
</tr>
</tbody>
</table>
<h2 id="post-bootstrap-validate">
Bootstrap validation
</h2>
<pre><code>POST /v1/bootstrap/validate/{action}
</code></pre>
<p>
Perform bootstrap validation.
</p>
<p>
Unlike actual bootstrapping, this request blocks and immediately
returns with a response.
</p>
<h3 id="post-request">
Request
</h3>
<h4 id="example-http-request">
Example HTTP request
</h4>
<pre><code>POST /bootstrap/validate/join_cluster
</code></pre>
<h4 id="request-body">
Request body
</h4>
<p>
The request must contain a
<a href="/docs/latest/operate/rs/references/rest-api/objects/bootstrap/">
bootstrap configuration object
</a>
, similar to the one used for actual bootstrapping.
</p>
<h3 id="post-response">
Response
</h3>
<p>
If an error occurs, the call returns a
<code>
bootstrap_status
</code>
JSON object that contains the following fields:
</p>
<table>
<thead>
<tr>
<th>
Field
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
state
</td>
<td>
Current bootstrap state.
<br/>
<br/>
<code>
idle
</code>
: No bootstrapping started.
<br/>
<br/>
<code>
initiated
</code>
: Bootstrap request received.
<br/>
<br/>
<code>
creating_cluster
</code>
: In the process of creating a new cluster.
<br/>
<br/>
<code>
joining_cluster
</code>
: In the process of joining an existing cluster.
<br/>
<br/>
<code>
error
</code>
: The last bootstrap action failed.
<br/>
<br/>
<code>
completed
</code>
: The last bootstrap action completed successfully.
</td>
</tr>
<tr>
<td>
start_time
</td>
<td>
Bootstrap process start time
</td>
</tr>
<tr>
<td>
end_time
</td>
<td>
Bootstrap process end time
</td>
</tr>
<tr>
<td>
error_code
</td>
<td>
If state is
<code>
error
</code>
, this error code describes the type of error encountered.
</td>
</tr>
<tr>
<td>
error_details
</td>
<td>
An error-specific object that may contain additional information about the error. A common field in use is
<code>
message
</code>
which provides a more verbose error message.
</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>
No error, validation was successful.
</td>
</tr>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.7">
406 Not Acceptable
</a>
</td>
<td>
Validation failed, bootstrap status is returned as body.
</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/bootstrap/validate/"/>
<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/terminology/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Terminology in Redis Enterprise Software
</h1>
<p class="text-lg -mt-5 mb-10">
Explains terms used in Redis Enterprise Software and its docs.
</p>
<p>
Here are explanations of some of the terms used in Redis Enterprise Software.
</p>
<h2 id="node">
Node
</h2>
<p>
A
<em>
node
</em>
is a physical machine, virtual machine, container or cloud
instance on which the RS installation package was installed and the
setup process was run in order to make the machine part of the cluster.
</p>
<p>
Each node is a container for running multiple Redis
instances, referred to as "shards".
</p>
<p>
The recommended configuration for a production cluster is an uneven
number of nodes, with a minimum of three. Note that in some
configurations, certain functionalities might be blocked. For example,
if a cluster has only one node you cannot enable database replication,
which helps to achieve high availability.
</p>
<p>
A node is made up of several components, as detailed below, and works
together with the other cluster nodes.
</p>
<h2 id="redis-instance-shard">
Redis instance (shard)
</h2>
<p>
As indicated above, each node serves as a container for hosting multiple
database instances, referred to as "shards".
</p>
<p>
Redis Enterprise SoftwareΒ supports various database configurations:
</p>
<ul>
<li>
<strong>
Standard Redis database
</strong>
- A single Redis shard with no
replication or clustering.
</li>
<li>
<strong>
Highly available Redis database
</strong>
- Every database master shard
has a replica shard, so that if the master shard fails the
cluster can automatically fail over to the replica with minimal impact. Master and replica shards are always placed on separate
nodes to ensure high availability.
</li>
<li>
<strong>
Clustered Redis database
</strong>
- The data stored in the database is
split across several shards. The number of shards can be defined by
the user. Various performance optimization algorithms define where
shards are placed within the cluster. During the lifetime of the
cluster, these algorithms might migrate a shard between nodes.
</li>
<li>
<strong>
Clustered and highly available Redis database
</strong>
- Each master shard
in the clustered database has a replica shard, enabling failover if
the master shard fails.
</li>
</ul>
<h2 id="proxy">
Proxy
</h2>
<p>
Each node includes one zero-latency, multi-threaded proxy
(written in low-level C) that masks the underlying system complexity. The
proxy overseesΒ forwarding Redis operations to the database shardsΒ on
behalf of a Redis client.
</p>
<p>
The proxy simplifies the cluster operation, from the application or
Redis client point of view, by enabling the use of a standard Redis
client. The zero-latency proxy is built over a cut-through architecture
and employs various optimization methods. For example, to help ensure
high-throughput and low-latency performance, the proxy might use
instruction pipelining even if not instructed to do so by the client.
</p>
<h2 id="database-endpoint">
Database endpoint
</h2>
<p>
Each database is served by a database endpoint that is part of and
managed by the proxies. The endpoint overseesΒ forwarding Redis
operations to specific database shards.
</p>
<p>
If the master shard fails and the replica shard is promoted to master, the
master endpoint is updated to point to the new master shard.
</p>
<p>
If the master endpoint fails, the replica endpoint is promoted to be the
new master endpoint and is updated to point to the master shard.
</p>
<p>
Similarly, if both the master shard and the master endpoint fail, then
both the replica shard and the replica endpoint are promoted to be the new
master shard and master endpoint.
</p>
<p>
Shards and their endpoints do not
have to reside within the same node in the cluster.
</p>
<p>
In the case of a clustered database with multiple database shards, only
one master endpoint acts as the master endpoint for all master shards,
forwarding Redis operations to all shards as needed.
</p>
<h2 id="cluster-manager">
Cluster manager
</h2>
<p>
The cluster manager overseesΒ all node management-related tasks, and the
cluster manager in the master node looks after all the cluster related
tasks.
</p>
<p>
The cluster manager is designed in a way that is totally decoupled from
the Redis operation. This enables RSΒ to react in a much faster and
accurate manner to failure events, so that, for example, a node failure
event triggers mass failover operations of all the master endpoints
and master shards that are hosted on the failed node.
</p>
<p>
In addition, this architecture guarantees that each Redis shard is only
dealing with processing Redis commands in a shared-nothing architecture,
thus maintaining the inherent high-throughput and low-latency of each
Redis process. Lastly, this architecture guarantees that any change in
the cluster manager itself does not affect the Redis operation.
</p>
<p>
Some of the primaryΒ functionalities of the cluster manager include:
</p>
<ul>
<li>
Deciding where shards are created
</li>
<li>
Deciding when shards are migrated and to where
</li>
<li>
Monitoring database size
</li>
<li>
Monitoring databases and endpoints across all nodes
</li>
<li>
Running the database resharding process
</li>
<li>
Running the database provisioning and de-provisioning processes
</li>
<li>
Gathering operational statistics
</li>
<li>
Enforcing license and subscription limitations
</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/references/terminology/"/>
<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/ts.info/.html | <section class="prose w-full py-12">
<h1 class="command-name">
TS.INFO
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">TS.INFO key
[DEBUG]
</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/timeseries">
TimeSeries 1.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>
Return information and statistics for a time series.
</p>
<p>
<a href="#examples">
Examples
</a>
</p>
<h2 id="required-arguments">
Required arguments
</h2>
<details open="">
<summary>
<code>
key
</code>
</summary>
is key name of the time series.
</details>
<h2 id="optional-arguments">
Optional arguments
</h2>
<details open="">
<summary>
<code>
[DEBUG]
</code>
</summary>
<p>
is an optional flag to get a more detailed information about the chunks.
</p>
</details>
<h2 id="return-value">
Return value
</h2>
<p>
<a href="/docs/latest/develop/reference/protocol-spec/#arrays">
Array reply
</a>
with information about the time series (name-value pairs):
</p>
<table>
<thead>
<tr>
<th>
Name
<br/>
<a href="/docs/latest/develop/reference/protocol-spec/#simple-strings">
Simple string reply
</a>
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>
totalSamples
</code>
</td>
<td>
<a href="/docs/latest/develop/reference/protocol-spec/#integers">
Integer reply
</a>
<br/>
Total number of samples in this time series
</td>
</tr>
<tr>
<td>
<code>
memoryUsage
</code>
</td>
<td>
<a href="/docs/latest/develop/reference/protocol-spec/#integers">
Integer reply
</a>
<br/>
Total number of bytes allocated for this time series, which is the sum of
<br/>
- The memory used for storing the series' configuration parameters (retention period, duplication policy, etc.)
<br/>
- The memory used for storing the series' compaction rules
<br/>
- The memory used for storing the series' labels (key-value pairs)
<br/>
- The memory used for storing the chunks (chunk header + compressed/uncompressed data)
</td>
</tr>
<tr>
<td>
<code>
firstTimestamp
</code>
</td>
<td>
<a href="/docs/latest/develop/reference/protocol-spec/#integers">
Integer reply
</a>
<br/>
First timestamp present in this time series (Unix timestamp in milliseconds)
</td>
</tr>
<tr>
<td>
<code>
lastTimestamp
</code>
</td>
<td>
<a href="/docs/latest/develop/reference/protocol-spec/#integers">
Integer reply
</a>
<br/>
Last timestamp present in this time series (Unix timestamp in milliseconds)
</td>
</tr>
<tr>
<td>
<code>
retentionTime
</code>
</td>
<td>
<a href="/docs/latest/develop/reference/protocol-spec/#integers">
Integer reply
</a>
<br/>
The retention period, in milliseconds, for this time series
</td>
</tr>
<tr>
<td>
<code>
chunkCount
</code>
</td>
<td>
<a href="/docs/latest/develop/reference/protocol-spec/#integers">
Integer reply
</a>
<br/>
Number of chunks used for this time series
</td>
</tr>
<tr>
<td>
<code>
chunkSize
</code>
</td>
<td>
<a href="/docs/latest/develop/reference/protocol-spec/#integers">
Integer reply
</a>
<br/>
The initial allocation size, in bytes, for the data part of each new chunk.
<br/>
Actual chunks may consume more memory. Changing the chunk size (using
<a href="/docs/latest/commands/ts.alter/">
<code>
TS.ALTER
</code>
</a>
) does not affect existing chunks.
</td>
</tr>
<tr>
<td>
<code>
chunkType
</code>
</td>
<td>
<a href="/docs/latest/develop/reference/protocol-spec/#simple-strings">
Simple string reply
</a>
<br/>
The chunks type:
<code>
compressed
</code>
or
<code>
uncompressed
</code>
</td>
</tr>
<tr>
<td>
<code>
duplicatePolicy
</code>
</td>
<td>
<a href="/docs/latest/develop/reference/protocol-spec/#simple-strings">
Simple string reply
</a>
or
<a href="/docs/latest/develop/reference/protocol-spec/#bulk-strings">
Nil reply
</a>
<br/>
The
<a href="/docs/latest/develop/data-types/timeseries/configuration#duplicate_policy">
duplicate policy
</a>
of this time series
</td>
</tr>
<tr>
<td>
<code>
labels
</code>
</td>
<td>
<a href="/docs/latest/develop/reference/protocol-spec/#arrays">
Array reply
</a>
or
<a href="/docs/latest/develop/reference/protocol-spec/#bulk-strings">
Nil reply
</a>
<br/>
Metadata labels of this time series
<br/>
Each element is a 2-elements
<a href="/docs/latest/develop/reference/protocol-spec/#arrays">
Array reply
</a>
of (
<a href="/docs/latest/develop/reference/protocol-spec/#bulk-strings">
Bulk string reply
</a>
,
<a href="/docs/latest/develop/reference/protocol-spec/#bulk-strings">
Bulk string reply
</a>
) representing (label, value)
</td>
</tr>
<tr>
<td>
<code>
sourceKey
</code>
</td>
<td>
<a href="/docs/latest/develop/reference/protocol-spec/#bulk-strings">
Bulk string reply
</a>
or
<a href="/docs/latest/develop/reference/protocol-spec/#bulk-strings">
Nil reply
</a>
<br/>
Key name for source time series in case the current series is a target of a
<a href="/docs/latest/commands/ts.createrule">
compaction rule
</a>
</td>
</tr>
<tr>
<td>
<code>
rules
</code>
</td>
<td>
<a href="/docs/latest/develop/reference/protocol-spec/#arrays">
Array reply
</a>
<br/>
<a href="/docs/latest/commands/ts.createrule">
Compaction rules
</a>
defined in this time series
<br/>
Each rule is an
<a href="/docs/latest/develop/reference/protocol-spec/#arrays">
Array reply
</a>
with 4 elements:
<br/>
-
<a href="/docs/latest/develop/reference/protocol-spec/#bulk-strings">
Bulk string reply
</a>
: The compaction key
<br/>
-
<a href="/docs/latest/develop/reference/protocol-spec/#integers">
Integer reply
</a>
: The bucket duration
<br/>
-
<a href="/docs/latest/develop/reference/protocol-spec/#simple-strings">
Simple string reply
</a>
: The aggregator
<br/>
-
<a href="/docs/latest/develop/reference/protocol-spec/#integers">
Integer reply
</a>
: The alignment (since RedisTimeSeries v1.8)
</td>
</tr>
</tbody>
</table>
<p>
When
<a href="/docs/latest/commands/debug/">
<code>
DEBUG
</code>
</a>
is specified, the response also contains:
</p>
<table>
<thead>
<tr>
<th>
Name
<br/>
<a href="/docs/latest/develop/reference/protocol-spec/#simple-strings">
Simple string reply
</a>
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>
keySelfName
</code>
</td>
<td>
<a href="/docs/latest/develop/reference/protocol-spec/#bulk-strings">
Bulk string reply
</a>
<br/>
Name of the key
</td>
</tr>
<tr>
<td>
<code>
Chunks
</code>
</td>
<td>
<a href="/docs/latest/develop/reference/protocol-spec/#arrays">
Array reply
</a>
with information about the chunks
<br/>
Each element is an
<a href="/docs/latest/develop/reference/protocol-spec/#arrays">
Array reply
</a>
of information about a single chunk in a name(
<a href="/docs/latest/develop/reference/protocol-spec/#simple-strings">
Simple string reply
</a>
)-value pairs:
<br/>
-
<code>
startTimestamp
</code>
-
<a href="/docs/latest/develop/reference/protocol-spec/#integers">
Integer reply
</a>
- First timestamp present in the chunk
<br/>
-
<code>
endTimestamp
</code>
-
<a href="/docs/latest/develop/reference/protocol-spec/#integers">
Integer reply
</a>
- Last timestamp present in the chunk
<br/>
-
<code>
samples
</code>
-
<a href="/docs/latest/develop/reference/protocol-spec/#integers">
Integer reply
</a>
- Total number of samples in the chunk
<br/>
-
<code>
size
</code>
-
<a href="/docs/latest/develop/reference/protocol-spec/#integers">
Integer reply
</a>
- the chunk's internal data size (without overheads) in bytes
<br/>
-
<code>
bytesPerSample
</code>
-
<a href="/docs/latest/develop/reference/protocol-spec/#bulk-strings">
Bulk string reply
</a>
(double) - Ratio of
<code>
size
</code>
and
<code>
samples
</code>
</td>
</tr>
</tbody>
</table>
<h2 id="examples">
Examples
</h2>
<details open="">
<summary>
<b>
Find information about a temperature/humidity time series by location and sensor type
</b>
</summary>
<p>
Create a set of sensors to measure temperature and humidity in your study and kitchen.
</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> TS.CREATE telemetry:study:temperature LABELS room study <span class="nb">type</span> temperature
</span></span><span class="line"><span class="cl">OK
</span></span><span class="line"><span class="cl">127.0.0.1:6379> TS.CREATE telemetry:study:humidity LABELS room study <span class="nb">type</span> humidity
</span></span><span class="line"><span class="cl">OK
</span></span><span class="line"><span class="cl">127.0.0.1:6379> TS.CREATE telemetry:kitchen:temperature LABELS room kitchen <span class="nb">type</span> temperature
</span></span><span class="line"><span class="cl">OK
</span></span><span class="line"><span class="cl">127.0.0.1:6379> TS.CREATE telemetry:kitchen:humidity LABELS room kitchen <span class="nb">type</span> humidity
</span></span><span class="line"><span class="cl">OK</span></span></code></pre>
</div>
<p>
Find information about the time series for temperature in the kitchen.
</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> TS.INFO telemetry:kitchen:temperature
</span></span><span class="line"><span class="cl"> 1<span class="o">)</span> totalSamples
</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> memoryUsage
</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">4246</span>
</span></span><span class="line"><span class="cl"> 5<span class="o">)</span> firstTimestamp
</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">0</span>
</span></span><span class="line"><span class="cl"> 7<span class="o">)</span> lastTimestamp
</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> retentionTime
</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">0</span>
</span></span><span class="line"><span class="cl">11<span class="o">)</span> chunkCount
</span></span><span class="line"><span class="cl">12<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">13<span class="o">)</span> chunkSize
</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">4096</span>
</span></span><span class="line"><span class="cl">15<span class="o">)</span> chunkType
</span></span><span class="line"><span class="cl">16<span class="o">)</span> compressed
</span></span><span class="line"><span class="cl">17<span class="o">)</span> duplicatePolicy
</span></span><span class="line"><span class="cl">18<span class="o">)</span> <span class="o">(</span>nil<span class="o">)</span>
</span></span><span class="line"><span class="cl">19<span class="o">)</span> labels
</span></span><span class="line"><span class="cl">20<span class="o">)</span> 1<span class="o">)</span> 1<span class="o">)</span> <span class="s2">"room"</span>
</span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="s2">"kitchen"</span>
</span></span><span class="line"><span class="cl"> 2<span class="o">)</span> 1<span class="o">)</span> <span class="s2">"type"</span>
</span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="s2">"temperature"</span>
</span></span><span class="line"><span class="cl">21<span class="o">)</span> sourceKey
</span></span><span class="line"><span class="cl">22<span class="o">)</span> <span class="o">(</span>nil<span class="o">)</span>
</span></span><span class="line"><span class="cl">23<span class="o">)</span> rules
</span></span><span class="line"><span class="cl">24<span class="o">)</span> <span class="o">(</span>empty array<span class="o">)</span></span></span></code></pre>
</div>
<p>
Query the time series using DEBUG to get more information about the chunks.
</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> TS.INFO telemetry:kitchen:temperature DEBUG
</span></span><span class="line"><span class="cl"> 1<span class="o">)</span> totalSamples
</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> memoryUsage
</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">4246</span>
</span></span><span class="line"><span class="cl"> 5<span class="o">)</span> firstTimestamp
</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">0</span>
</span></span><span class="line"><span class="cl"> 7<span class="o">)</span> lastTimestamp
</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> retentionTime
</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">0</span>
</span></span><span class="line"><span class="cl">11<span class="o">)</span> chunkCount
</span></span><span class="line"><span class="cl">12<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">13<span class="o">)</span> chunkSize
</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">4096</span>
</span></span><span class="line"><span class="cl">15<span class="o">)</span> chunkType
</span></span><span class="line"><span class="cl">16<span class="o">)</span> compressed
</span></span><span class="line"><span class="cl">17<span class="o">)</span> duplicatePolicy
</span></span><span class="line"><span class="cl">18<span class="o">)</span> <span class="o">(</span>nil<span class="o">)</span>
</span></span><span class="line"><span class="cl">19<span class="o">)</span> labels
</span></span><span class="line"><span class="cl">20<span class="o">)</span> 1<span class="o">)</span> 1<span class="o">)</span> <span class="s2">"room"</span>
</span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="s2">"kitchen"</span>
</span></span><span class="line"><span class="cl"> 2<span class="o">)</span> 1<span class="o">)</span> <span class="s2">"type"</span>
</span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="s2">"temperature"</span>
</span></span><span class="line"><span class="cl">21<span class="o">)</span> sourceKey
</span></span><span class="line"><span class="cl">22<span class="o">)</span> <span class="o">(</span>nil<span class="o">)</span>
</span></span><span class="line"><span class="cl">23<span class="o">)</span> rules
</span></span><span class="line"><span class="cl">24<span class="o">)</span> <span class="o">(</span>empty array<span class="o">)</span>
</span></span><span class="line"><span class="cl">25<span class="o">)</span> keySelfName
</span></span><span class="line"><span class="cl">26<span class="o">)</span> <span class="s2">"telemetry:kitchen:temperature"</span>
</span></span><span class="line"><span class="cl">27<span class="o">)</span> Chunks
</span></span><span class="line"><span class="cl">28<span class="o">)</span> 1<span class="o">)</span> 1<span class="o">)</span> startTimestamp
</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> endTimestamp
</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">0</span>
</span></span><span class="line"><span class="cl"> 5<span class="o">)</span> samples
</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">0</span>
</span></span><span class="line"><span class="cl"> 7<span class="o">)</span> size
</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">4096</span>
</span></span><span class="line"><span class="cl"> 9<span class="o">)</span> bytesPerSample
</span></span><span class="line"><span class="cl"> 10<span class="o">)</span> <span class="s2">"inf"</span></span></span></code></pre>
</div>
</details>
<h2 id="see-also">
See also
</h2>
<p>
<a href="/docs/latest/commands/ts.range/">
<code>
TS.RANGE
</code>
</a>
|
<a href="/docs/latest/commands/ts.queryindex/">
<code>
TS.QUERYINDEX
</code>
</a>
|
<a href="/docs/latest/commands/ts.get/">
<code>
TS.GET
</code>
</a>
</p>
<h2 id="related-topics">
Related topics
</h2>
<p>
<a href="/docs/latest/develop/data-types/timeseries/">
RedisTimeSeries
</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/ts.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/rs/7.4/references/cli-utilities/rladmin/.html | <section class="prose w-full py-12 max-w-none">
<h1>
rladmin
</h1>
<p class="text-lg -mt-5 mb-10">
Manage Redis Enterprise clusters and databases.
</p>
<p>
<code>
rladmin
</code>
is a command-line utility that lets you perform administrative tasks such as failover, migration, and endpoint binding on a Redis Enterprise Software cluster. You can also use
<code>
rladmin
</code>
to edit cluster and database configurations.
</p>
<p>
Although you can use the Cluster Manager UI for some of these tasks, others are unique to the
<code>
rladmin
</code>
command-line tool.
</p>
<h2 id="rladmin-commands">
<code>
rladmin
</code>
commands
</h2>
<table>
<thead>
<tr>
<th style="text-align:left">
Command
</th>
<th style="text-align:left">
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/bind/">
bind
</a>
</td>
<td style="text-align:left">
Manages the proxy policy for a specified database endpoint.
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/cluster/">
cluster
</a>
</td>
<td style="text-align:left">
Manage cluster.
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/failover/">
failover
</a>
</td>
<td style="text-align:left">
Fail over primary shards of a database to their replicas.
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/help/">
help
</a>
</td>
<td style="text-align:left">
Shows available commands or specific command usage.
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/info/">
info
</a>
</td>
<td style="text-align:left">
Shows the current configuration of a cluster, database, node, or proxy.
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/migrate/">
migrate
</a>
</td>
<td style="text-align:left">
Moves Redis Enterprise Software shards or endpoints to a new node in the same cluster.
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/node/">
node
</a>
</td>
<td style="text-align:left">
Manage nodes.
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/placement/">
placement
</a>
</td>
<td style="text-align:left">
Configures the shard placement policy for a database.
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/recover/">
recover
</a>
</td>
<td style="text-align:left">
Recovers databases in recovery mode.
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/restart/">
restart
</a>
</td>
<td style="text-align:left">
Restarts Redis Enterprise Software processes for a specific database.
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/status/">
status
</a>
</td>
<td style="text-align:left">
Displays the current cluster status and topology information.
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/suffix/">
suffix
</a>
</td>
<td style="text-align:left">
Manages the DNS suffixes in the cluster.
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/tune/">
tune
</a>
</td>
<td style="text-align:left">
Configures parameters for databases, proxies, nodes, and clusters.
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/upgrade/">
upgrade
</a>
</td>
<td style="text-align:left">
Upgrades the version of a module or Redis Enterprise Software for a database.
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/verify/">
verify
</a>
</td>
<td style="text-align:left">
Prints verification reports for the cluster.
</td>
</tr>
</tbody>
</table>
<h2 id="use-the-rladmin-shell">
Use the
<code>
rladmin
</code>
shell
</h2>
<p>
To open the
<code>
rladmin
</code>
shell:
</p>
<ol>
<li>
<p>
Sign in to a Redis Enterprise Software node with an account that is a member of the
<strong>
redislabs
</strong>
group.
</p>
<p>
The
<code>
rladmin
</code>
binary is located in
<code>
/opt/redislabs/bin
</code>
. If you don't have this directory in your
<code>
PATH
</code>
, you may want to add it. Otherwise, you can use
<code>
bash -l <username>
</code>
to sign in as a user with permissions for that directory.
</p>
</li>
<li>
<p>
Run:
<code>
rladmin
</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">
Note:
</div>
If the CLI does not recognize the
<code>
rladmin
</code>
command,
run this command to load the necessary configuration first:
<nobr>
<code>
bash -l
</code>
</nobr>
</div>
</div>
</li>
</ol>
<p>
In the
<code>
rladmin
</code>
shell, you can:
</p>
<ul>
<li>
Run any
<code>
rladmin
</code>
command without prefacing it with
<code>
rladmin
</code>
.
</li>
<li>
Enter
<code>
?
</code>
to view the full list of available commands.
</li>
<li>
Enter
<a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/help/">
<code>
help
</code>
</a>
followed by the name of a command for a detailed explanation of the command and its usage.
</li>
<li>
Press the
<code>
Tab
</code>
key for command completion.
</li>
<li>
Enter
<code>
exit
</code>
or press
<code>
Control+D
</code>
to exit the
<code>
rladmin
</code>
shell and return to the terminal prompt.
</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/references/cli-utilities/rladmin/"/>
<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/lua-api.html | <section class="prose w-full py-12">
<h1>
Redis Lua API reference
</h1>
<p class="text-lg -mt-5 mb-10">
Executing Lua in Redis
</p>
<p>
Redis includes an embedded
<a href="https://www.lua.org/">
Lua 5.1
</a>
interpreter.
The interpreter runs user-defined
<a href="/docs/latest/develop/interact/programmability/eval-intro/">
ephemeral scripts
</a>
and
<a href="/docs/latest/develop/interact/programmability/functions-intro/">
functions
</a>
. Scripts run in a sandboxed context and can only access specific Lua packages. This page describes the packages and APIs available inside the execution's context.
</p>
<h2 id="sandbox-context">
Sandbox context
</h2>
<p>
The sandboxed Lua context 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.
That includes the file system, network, and any other attempt to perform a 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>
<h3 id="global-variables-and-functions">
Global variables and functions
</h3>
<p>
The sandboxed Lua execution context blocks the declaration of global variables and functions.
The blocking of global variables is in place to ensure that scripts and functions don't attempt to maintain any runtime context other than the data stored in Redis.
In the (somewhat uncommon) use case that a context needs to be maintain between executions,
you should store the context in Redis' keyspace.
</p>
<p>
Redis will return a "Script attempted to create global variable 'my_global_variable" error when trying to execute the following snippet:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-lua" data-lang="lua"><span class="line"><span class="cl"><span class="n">my_global_variable</span> <span class="o">=</span> <span class="s1">'some value'</span>
</span></span></code></pre>
</div>
<p>
And similarly for the following global function declaration:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-lua" data-lang="lua"><span class="line"><span class="cl"><span class="kr">function</span> <span class="nf">my_global_function</span><span class="p">()</span>
</span></span><span class="line"><span class="cl"> <span class="c1">-- Do something amazing</span>
</span></span><span class="line"><span class="cl"><span class="kr">end</span>
</span></span></code></pre>
</div>
<p>
You'll also get a similar error when your script attempts to access any global variables that are undefined in the runtime's context:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-lua" data-lang="lua"><span class="line"><span class="cl"><span class="c1">-- The following will surely raise an error</span>
</span></span><span class="line"><span class="cl"><span class="kr">return</span> <span class="n">an_undefined_global_variable</span>
</span></span></code></pre>
</div>
<p>
Instead, all variable and function definitions are required to be declared as local.
To do so, you'll need to prepend the
<a href="https://www.lua.org/manual/5.1/manual.html#2.4.7">
<em>
local
</em>
</a>
keyword to your declarations.
For example, the following snippet will be considered perfectly valid by Redis:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-lua" data-lang="lua"><span class="line"><span class="cl"><span class="kd">local</span> <span class="n">my_local_variable</span> <span class="o">=</span> <span class="s1">'some value'</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="kd">local</span> <span class="kr">function</span> <span class="nf">my_local_function</span><span class="p">()</span>
</span></span><span class="line"><span class="cl"> <span class="c1">-- Do something else, but equally amazing</span>
</span></span><span class="line"><span class="cl"><span class="kr">end</span>
</span></span></code></pre>
</div>
<p>
<strong>
Note:
</strong>
the sandbox attempts to prevent the use of globals.
Using Lua's debugging functionality or other approaches such as altering the meta table used for implementing the globals' protection to circumvent the sandbox isn't hard.
However, it is difficult to circumvent the protection by accident.
If the user messes with the Lua global state, the consistency of AOF and replication can't be guaranteed.
In other words, just don't do it.
</p>
<h3 id="imported-lua-modules">
Imported Lua modules
</h3>
<p>
Using imported Lua modules is not supported inside the sandboxed execution context.
The sandboxed execution context prevents the loading modules by disabling Lua's
<a href="https://www.lua.org/pil/8.1.html">
<code>
require
</code>
function
</a>
.
</p>
<p>
The only libraries that Redis ships with and that you can use in scripts are listed under the
<a href="#runtime-libraries">
Runtime libraries
</a>
section.
</p>
<h2 id="runtime-globals">
Runtime globals
</h2>
<p>
While the sandbox prevents users from declaring globals, the execution context is pre-populated with several of these.
</p>
<h3 id="the-_redis_-singleton">
The
<em>
redis
</em>
singleton
</h3>
<p>
The
<em>
redis
</em>
singleton is an object instance that's accessible from all scripts.
It provides the API to interact with Redis from scripts.
Its description follows
<a href="#redis_object">
below
</a>
.
</p>
<h3 id="the-keys-global-variable">
The
<em>
KEYS
</em>
global variable
</h3>
<ul>
<li>
Since version: 2.6.0
</li>
<li>
Available in scripts: yes
</li>
<li>
Available in functions: no
</li>
</ul>
<p>
<strong>
Important:
</strong>
to ensure the correct execution of scripts, both in standalone and clustered deployments, all names of keys that a function accesses must be explicitly provided as input key arguments.
The script
<strong>
should only
</strong>
access keys whose names are given as input arguments.
Scripts
<strong>
should never
</strong>
access keys with programmatically-generated names or based on the contents of data structures stored in the database.
</p>
<p>
The
<em>
KEYS
</em>
global variable is available only for
<a href="/docs/latest/develop/interact/programmability/eval-intro/">
ephemeral scripts
</a>
.
It is pre-populated with all key name input arguments.
</p>
<h3 id="the-argv-global-variable">
The
<em>
ARGV
</em>
global variable
</h3>
<ul>
<li>
Since version: 2.6.0
</li>
<li>
Available in scripts: yes
</li>
<li>
Available in functions: no
</li>
</ul>
<p>
The
<em>
ARGV
</em>
global variable is available only in
<a href="/docs/latest/develop/interact/programmability/eval-intro/">
ephemeral scripts
</a>
.
It is pre-populated with all regular input arguments.
</p>
<h2 id="redis_object">
<em>
redis
</em>
object
</h2>
<ul>
<li>
Since version: 2.6.0
</li>
<li>
Available in scripts: yes
</li>
<li>
Available in functions: yes
</li>
</ul>
<p>
The Redis Lua execution context always provides a singleton instance of an object named
<em>
redis
</em>
.
The
<em>
redis
</em>
instance enables the script to interact with the Redis server that's running it.
Following is the API provided by the
<em>
redis
</em>
object instance.
</p>
<h3 id="redis.call">
<code>
redis.call(command [,arg...])
</code>
</h3>
<ul>
<li>
Since version: 2.6.0
</li>
<li>
Available in scripts: yes
</li>
<li>
Available in functions: yes
</li>
</ul>
<p>
The
<code>
redis.call()
</code>
function calls a given Redis command and returns its reply.
Its inputs are the command and arguments, and once called, it executes the command in Redis and returns the reply.
</p>
<p>
For example, we can call the
<a href="/docs/latest/commands/echo/">
<code>
ECHO
</code>
</a>
command from a script and return its reply like so:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-lua" data-lang="lua"><span class="line"><span class="cl"><span class="kr">return</span> <span class="n">redis.call</span><span class="p">(</span><span class="s1">'ECHO'</span><span class="p">,</span> <span class="s1">'Echo, echo... eco... o...'</span><span class="p">)</span>
</span></span></code></pre>
</div>
<p>
If and when
<code>
redis.call()
</code>
triggers a runtime exception, the raw exception is raised back to the user as an error, automatically.
Therefore, attempting to execute the following ephemeral script will fail and generate a runtime exception because
<a href="/docs/latest/commands/echo/">
<code>
ECHO
</code>
</a>
accepts exactly one argument:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-lua" data-lang="lua"><span class="line"><span class="cl"><span class="n">redis</span><span class="o">></span> <span class="n">EVAL</span> <span class="s2">"return redis.call('ECHO', 'Echo,', 'echo... ', 'eco... ', 'o...')"</span> <span class="mi">0</span>
</span></span><span class="line"><span class="cl"><span class="p">(</span><span class="n">error</span><span class="p">)</span> <span class="n">ERR</span> <span class="n">Wrong</span> <span class="n">number</span> <span class="n">of</span> <span class="n">args</span> <span class="n">calling</span> <span class="n">Redis</span> <span class="n">command</span> <span class="n">from</span> <span class="n">script</span> <span class="n">script</span><span class="p">:</span> <span class="n">b0345693f4b77517a711221050e76d24ae60b7f7</span><span class="p">,</span> <span class="n">on</span> <span class="err">@</span><span class="n">user_script</span><span class="p">:</span><span class="mf">1.</span>
</span></span></code></pre>
</div>
<p>
Note that the call can fail due to various reasons, see
<a href="/docs/latest/develop/interact/programmability/eval-intro/#execution-under-low-memory-conditions">
Execution under low memory conditions
</a>
and
<a href="#script_flags">
Script flags
</a>
</p>
<p>
To handle Redis runtime errors use
<code>
redis.pcall()
</code>
instead.
</p>
<h3 id="redis.pcall">
<code>
redis.pcall(command [,arg...])
</code>
</h3>
<ul>
<li>
Since version: 2.6.0
</li>
<li>
Available in scripts: yes
</li>
<li>
Available in functions: yes
</li>
</ul>
<p>
This function enables handling runtime errors raised by the Redis server.
The
<code>
redis.pcall()
</code>
function behaves exactly like
<a href="#redis.call">
<code>
redis.call()
</code>
</a>
, except that it:
</p>
<ul>
<li>
Always returns a reply.
</li>
<li>
Never throws a runtime exception, and returns in its stead a
<a href="#redis.error_reply">
<code>
redis.error_reply
</code>
</a>
in case that a runtime exception is thrown by the server.
</li>
</ul>
<p>
The following demonstrates how to use
<code>
redis.pcall()
</code>
to intercept and handle runtime exceptions from within the context of an ephemeral script.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-lua" data-lang="lua"><span class="line"><span class="cl"><span class="kd">local</span> <span class="n">reply</span> <span class="o">=</span> <span class="n">redis.pcall</span><span class="p">(</span><span class="s1">'ECHO'</span><span class="p">,</span> <span class="n">unpack</span><span class="p">(</span><span class="n">ARGV</span><span class="p">))</span>
</span></span><span class="line"><span class="cl"><span class="kr">if</span> <span class="n">reply</span><span class="p">[</span><span class="s1">'err'</span><span class="p">]</span> <span class="o">~=</span> <span class="kc">nil</span> <span class="kr">then</span>
</span></span><span class="line"><span class="cl"> <span class="c1">-- Handle the error sometime, but for now just log it</span>
</span></span><span class="line"><span class="cl"> <span class="n">redis.log</span><span class="p">(</span><span class="n">redis.LOG_WARNING</span><span class="p">,</span> <span class="n">reply</span><span class="p">[</span><span class="s1">'err'</span><span class="p">])</span>
</span></span><span class="line"><span class="cl"> <span class="n">reply</span><span class="p">[</span><span class="s1">'err'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'ERR Something is wrong, but no worries, everything is under control'</span>
</span></span><span class="line"><span class="cl"><span class="kr">end</span>
</span></span><span class="line"><span class="cl"><span class="kr">return</span> <span class="n">reply</span>
</span></span></code></pre>
</div>
<p>
Evaluating this script with more than one argument will return:
</p>
<pre tabindex="0"><code>redis> EVAL "..." 0 hello world
(error) ERR Something is wrong, but no worries, everything is under control
</code></pre>
<h3 id="redis.error_reply">
<code>
redis.error_reply(x)
</code>
</h3>
<ul>
<li>
Since version: 2.6.0
</li>
<li>
Available in scripts: yes
</li>
<li>
Available in functions: yes
</li>
</ul>
<p>
This is a helper function that returns an
<a href="/docs/latest/develop/reference/protocol-spec/#simple-errors">
error reply
</a>
.
The helper accepts a single string argument and returns a Lua table with the
<em>
err
</em>
field set to that string.
</p>
<p>
The outcome of the following code is that
<em>
error1
</em>
and
<em>
error2
</em>
are identical for all intents and purposes:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-lua" data-lang="lua"><span class="line"><span class="cl"><span class="kd">local</span> <span class="n">text</span> <span class="o">=</span> <span class="s1">'ERR My very special error'</span>
</span></span><span class="line"><span class="cl"><span class="kd">local</span> <span class="n">reply1</span> <span class="o">=</span> <span class="p">{</span> <span class="n">err</span> <span class="o">=</span> <span class="n">text</span> <span class="p">}</span>
</span></span><span class="line"><span class="cl"><span class="kd">local</span> <span class="n">reply2</span> <span class="o">=</span> <span class="n">redis.error_reply</span><span class="p">(</span><span class="n">text</span><span class="p">)</span>
</span></span></code></pre>
</div>
<p>
Therefore, both forms are valid as means for returning an error reply from scripts:
</p>
<pre tabindex="0"><code>redis> EVAL "return { err = 'ERR My very special table error' }" 0
(error) ERR My very special table error
redis> EVAL "return redis.error_reply('ERR My very special reply error')" 0
(error) ERR My very special reply error
</code></pre>
<p>
For returning Redis status replies refer to
<a href="#redis.status_reply">
<code>
redis.status_reply()
</code>
</a>
.
Refer to the
<a href="#data-type-conversion">
Data type conversion
</a>
for returning other response types.
</p>
<p>
<strong>
Note:
</strong>
By convention, Redis uses the first word of an error string as a unique error code for specific errors or
<code>
ERR
</code>
for general-purpose errors.
Scripts are advised to follow this convention, as shown in the example above, but this is not mandatory.
</p>
<h3 id="redis.status_reply">
<code>
redis.status_reply(x)
</code>
</h3>
<ul>
<li>
Since version: 2.6.0
</li>
<li>
Available in scripts: yes
</li>
<li>
Available in functions: yes
</li>
</ul>
<p>
This is a helper function that returns a
<a href="/docs/latest/develop/reference/protocol-spec#simple-strings">
simple string reply
</a>
.
"OK" is an example of a standard Redis status reply.
The Lua API represents status replies as tables with a single field,
<em>
ok
</em>
, set with a simple status string.
</p>
<p>
The outcome of the following code is that
<em>
status1
</em>
and
<em>
status2
</em>
are identical for all intents and purposes:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-lua" data-lang="lua"><span class="line"><span class="cl"><span class="kd">local</span> <span class="n">text</span> <span class="o">=</span> <span class="s1">'Frosty'</span>
</span></span><span class="line"><span class="cl"><span class="kd">local</span> <span class="n">status1</span> <span class="o">=</span> <span class="p">{</span> <span class="n">ok</span> <span class="o">=</span> <span class="n">text</span> <span class="p">}</span>
</span></span><span class="line"><span class="cl"><span class="kd">local</span> <span class="n">status2</span> <span class="o">=</span> <span class="n">redis.status_reply</span><span class="p">(</span><span class="n">text</span><span class="p">)</span>
</span></span></code></pre>
</div>
<p>
Therefore, both forms are valid as means for returning status replies from scripts:
</p>
<pre tabindex="0"><code>redis> EVAL "return { ok = 'TICK' }" 0
TICK
redis> EVAL "return redis.status_reply('TOCK')" 0
TOCK
</code></pre>
<p>
For returning Redis error replies refer to
<a href="#redis.error_reply">
<code>
redis.error_reply()
</code>
</a>
.
Refer to the
<a href="#data-type-conversion">
Data type conversion
</a>
for returning other response types.
</p>
<h3 id="redis.sha1hex">
<code>
redis.sha1hex(x)
</code>
</h3>
<ul>
<li>
Since version: 2.6.0
</li>
<li>
Available in scripts: yes
</li>
<li>
Available in functions: yes
</li>
</ul>
<p>
This function returns the SHA1 hexadecimal digest of its single string argument.
</p>
<p>
You can, for example, obtain the empty string's SHA1 digest:
</p>
<pre tabindex="0"><code>redis> EVAL "return redis.sha1hex('')" 0
"da39a3ee5e6b4b0d3255bfef95601890afd80709"
</code></pre>
<h3 id="redis.log">
<code>
redis.log(level, message)
</code>
</h3>
<ul>
<li>
Since version: 2.6.0
</li>
<li>
Available in scripts: yes
</li>
<li>
Available in functions: yes
</li>
</ul>
<p>
This function writes to the Redis server log.
</p>
<p>
It expects two input arguments: the log level and a message.
The message is a string to write to the log file.
Log level can be on of these:
</p>
<ul>
<li>
<code>
redis.LOG_DEBUG
</code>
</li>
<li>
<code>
redis.LOG_VERBOSE
</code>
</li>
<li>
<code>
redis.LOG_NOTICE
</code>
</li>
<li>
<code>
redis.LOG_WARNING
</code>
</li>
</ul>
<p>
These levels map to the server's log levels.
The log only records messages equal or greater in level than the server's
<code>
loglevel
</code>
configuration directive.
</p>
<p>
The following snippet:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-lua" data-lang="lua"><span class="line"><span class="cl"><span class="n">redis.log</span><span class="p">(</span><span class="n">redis.LOG_WARNING</span><span class="p">,</span> <span class="s1">'Something is terribly wrong'</span><span class="p">)</span>
</span></span></code></pre>
</div>
<p>
will produce a line similar to the following in your server's log:
</p>
<pre tabindex="0"><code>[32343] 22 Mar 15:21:39 # Something is terribly wrong
</code></pre>
<h3 id="redis.setresp">
<code>
redis.setresp(x)
</code>
</h3>
<ul>
<li>
Since version: 6.0.0
</li>
<li>
Available in scripts: yes
</li>
<li>
Available in functions: yes
</li>
</ul>
<p>
This function allows the executing script to switch between
<a href="/docs/latest/develop/reference/protocol-spec/">
Redis Serialization Protocol (RESP)
</a>
versions for the replies returned by
<a href="#redis.call">
<code>
redis.call()
</code>
</a>
and
<a href="#redis.pcall">
<code>
redis.pcall()
</code>
</a>
.
It expects a single numerical argument as the protocol's version.
The default protocol version is
<em>
2
</em>
, but it can be switched to version
<em>
3
</em>
.
</p>
<p>
Here's an example of switching to RESP3 replies:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-lua" data-lang="lua"><span class="line"><span class="cl"><span class="n">redis.setresp</span><span class="p">(</span><span class="mi">3</span><span class="p">)</span>
</span></span></code></pre>
</div>
<p>
Please refer to the
<a href="#data-type-conversion">
Data type conversion
</a>
for more information about type conversions.
</p>
<h3 id="redis.set_repl">
<code>
redis.set_repl(x)
</code>
</h3>
<ul>
<li>
Since version: 3.2.0
</li>
<li>
Available in scripts: yes
</li>
<li>
Available in functions: no
</li>
</ul>
<p>
<strong>
Note:
</strong>
this feature is only available when script effects replication is employed.
Calling it when using verbatim script replication will result in an error.
As of Redis version 2.6.0, scripts were replicated verbatim, meaning that the scripts' source code was sent for execution by replicas and stored in the AOF.
An alternative replication mode added in version 3.2.0 allows replicating only the scripts' effects.
As of Redis version 7.0, script replication is no longer supported, and the only replication mode available is script effects replication.
</p>
<p>
<strong>
Warning:
</strong>
this is an advanced feature. Misuse can cause damage by violating the contract that binds the Redis master, its replicas, and AOF contents to hold the same logical content.
</p>
<p>
This function allows a script to assert control over how its effects are propagated to replicas and the AOF afterward.
A script's effects are the Redis write commands that it calls.
</p>
<p>
By default, all write commands that a script executes are replicated.
Sometimes, however, better control over this behavior can be helpful.
This can be the case, for example, when storing intermediate values in the master alone.
</p>
<p>
Consider a script that intersects two sets and stores the result in a temporary key with
<a href="/docs/latest/commands/sunionstore/">
<code>
SUNIONSTORE
</code>
</a>
.
It then picks five random elements (
<a href="/docs/latest/commands/srandmember/">
<code>
SRANDMEMBER
</code>
</a>
) from the intersection and stores (
<a href="/docs/latest/commands/sadd/">
<code>
SADD
</code>
</a>
) them in another set.
Finally, before returning, it deletes the temporary key that stores the intersection of the two source sets.
</p>
<p>
In this case, only the new set with its five randomly-chosen elements needs to be replicated.
Replicating the
<a href="/docs/latest/commands/sunionstore/">
<code>
SUNIONSTORE
</code>
</a>
command and the
<a href="/docs/latest/commands/del/">
<code>
DEL
</code>
</a>
ition of the temporary key is unnecessary and wasteful.
</p>
<p>
The
<code>
redis.set_repl()
</code>
function instructs the server how to treat subsequent write commands in terms of replication.
It accepts a single input argument that only be one of the following:
</p>
<ul>
<li>
<code>
redis.REPL_ALL
</code>
: replicates the effects to the AOF and replicas.
</li>
<li>
<code>
redis.REPL_AOF
</code>
: replicates the effects to the AOF alone.
</li>
<li>
<code>
redis.REPL_REPLICA
</code>
: replicates the effects to the replicas alone.
</li>
<li>
<code>
redis.REPL_SLAVE
</code>
: same as
<code>
REPL_REPLICA
</code>
, maintained for backward compatibility.
</li>
<li>
<code>
redis.REPL_NONE
</code>
: disables effect replication entirely.
</li>
</ul>
<p>
By default, the scripting engine is initialized to the
<code>
redis.REPL_ALL
</code>
setting when a script begins its execution.
You can call the
<code>
redis.set_repl()
</code>
function at any time during the script's execution to switch between the different replication modes.
</p>
<p>
A simple example follows:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-lua" data-lang="lua"><span class="line"><span class="cl"><span class="n">redis.replicate_commands</span><span class="p">()</span> <span class="c1">-- Enable effects replication in versions lower than Redis v7.0</span>
</span></span><span class="line"><span class="cl"><span class="n">redis.call</span><span class="p">(</span><span class="s1">'SET'</span><span class="p">,</span> <span class="n">KEYS</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="n">ARGV</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span>
</span></span><span class="line"><span class="cl"><span class="n">redis.set_repl</span><span class="p">(</span><span class="n">redis.REPL_NONE</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="n">redis.call</span><span class="p">(</span><span class="s1">'SET'</span><span class="p">,</span> <span class="n">KEYS</span><span class="p">[</span><span class="mi">2</span><span class="p">],</span> <span class="n">ARGV</span><span class="p">[</span><span class="mi">2</span><span class="p">])</span>
</span></span><span class="line"><span class="cl"><span class="n">redis.set_repl</span><span class="p">(</span><span class="n">redis.REPL_ALL</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="n">redis.call</span><span class="p">(</span><span class="s1">'SET'</span><span class="p">,</span> <span class="n">KEYS</span><span class="p">[</span><span class="mi">3</span><span class="p">],</span> <span class="n">ARGV</span><span class="p">[</span><span class="mi">3</span><span class="p">])</span>
</span></span></code></pre>
</div>
<p>
If you run this script by calling
<code>
EVAL "..." 3 A B C 1 2 3
</code>
, the result will be that only the keys
<em>
A
</em>
and
<em>
C
</em>
are created on the replicas and AOF.
</p>
<h3 id="redis.replicate_commands">
<code>
redis.replicate_commands()
</code>
</h3>
<ul>
<li>
Since version: 3.2.0
</li>
<li>
Until version: 7.0.0
</li>
<li>
Available in scripts: yes
</li>
<li>
Available in functions: no
</li>
</ul>
<p>
This function switches the script's replication mode from verbatim replication to effects replication.
You can use it to override the default verbatim script replication mode used by Redis until version 7.0.
</p>
<p>
<strong>
Note:
</strong>
as of Redis v7.0, verbatim script replication is no longer supported.
The default, and only script replication mode supported, is script effects' replication.
For more information, please refer to
<a href="/docs/latest/develop/interact/programmability/eval-intro/#replicating-commands-instead-of-scripts">
<code>
Replicating commands instead of scripts
</code>
</a>
</p>
<h3 id="redis.breakpoint">
<code>
redis.breakpoint()
</code>
</h3>
<ul>
<li>
Since version: 3.2.0
</li>
<li>
Available in scripts: yes
</li>
<li>
Available in functions: no
</li>
</ul>
<p>
This function triggers a breakpoint when using the
<a href="/docs/latest/develop/interact/programmability/lua-debugging/">
Redis Lua debugger
</a>
.
</p>
<h3 id="redis.debug">
<code>
redis.debug(x)
</code>
</h3>
<ul>
<li>
Since version: 3.2.0
</li>
<li>
Available in scripts: yes
</li>
<li>
Available in functions: no
</li>
</ul>
<p>
This function prints its argument in the
<a href="/docs/latest/develop/interact/programmability/lua-debugging/">
Redis Lua debugger
</a>
console.
</p>
<h3 id="redis.acl_check_cmd">
<code>
redis.acl_check_cmd(command [,arg...])
</code>
</h3>
<ul>
<li>
Since version: 7.0.0
</li>
<li>
Available in scripts: yes
</li>
<li>
Available in functions: yes
</li>
</ul>
<p>
This function is used for checking if the current user running the script has
<a href="/docs/latest/operate/oss_and_stack/management/security/acl/">
ACL
</a>
permissions to execute the given command with the given arguments.
</p>
<p>
The return value is a boolean
<code>
true
</code>
in case the current user has permissions to execute the command (via a call to
<a href="#redis.call">
redis.call
</a>
or
<a href="#redis.pcall">
redis.pcall
</a>
) or
<code>
false
</code>
in case they don't.
</p>
<p>
The function will raise an error if the passed command or its arguments are invalid.
</p>
<h3 id="redis.register_function">
<code>
redis.register_function
</code>
</h3>
<ul>
<li>
Since version: 7.0.0
</li>
<li>
Available in scripts: no
</li>
<li>
Available in functions: yes
</li>
</ul>
<p>
This function is only available from the context of the
<a href="/docs/latest/commands/function-load/">
<code>
FUNCTION LOAD
</code>
</a>
command.
When called, it registers a function to the loaded library.
The function can be called either with positional or named arguments.
</p>
<h4 id="redis.register_function_pos_args">
positional arguments:
<code>
redis.register_function(name, callback)
</code>
</h4>
<p>
The first argument to
<code>
redis.register_function
</code>
is a Lua string representing the function name.
The second argument to
<code>
redis.register_function
</code>
is a Lua function.
</p>
<p>
Usage example:
</p>
<pre tabindex="0"><code>redis> FUNCTION LOAD "#!lua name=mylib\n redis.register_function('noop', function() end)"
</code></pre>
<h4 id="redis.register_function_named_args">
Named arguments:
<code>
redis.register_function{function_name=name, callback=callback, flags={flag1, flag2, ..}, description=description}
</code>
</h4>
<p>
The named arguments variant accepts the following arguments:
</p>
<ul>
<li>
<em>
function_name
</em>
: the function's name.
</li>
<li>
<em>
callback
</em>
: the function's callback.
</li>
<li>
<em>
flags
</em>
: an array of strings, each a function flag (optional).
</li>
<li>
<em>
description
</em>
: function's description (optional).
</li>
</ul>
<p>
Both
<em>
function_name
</em>
and
<em>
callback
</em>
are mandatory.
</p>
<p>
Usage example:
</p>
<pre tabindex="0"><code>redis> FUNCTION LOAD "#!lua name=mylib\n redis.register_function{function_name='noop', callback=function() end, flags={ 'no-writes' }, description='Does nothing'}"
</code></pre>
<h4 id="script_flags">
Script flags
</h4>
<p>
<strong>
Important:
</strong>
Use script flags with care, which may negatively impact if misused.
Note that the default for Eval scripts are different than the default for functions that are mentioned below, see
<a href="/docs/latest/develop/interact/programmability/eval-intro#eval-flags">
Eval Flags
</a>
</p>
<p>
When you register a function or load an Eval script, the server does not know how it accesses the database.
By default, Redis assumes that all scripts read and write data.
This results in the following behavior:
</p>
<ol>
<li>
They can read and write data.
</li>
<li>
They can run in cluster mode, and are not able to run commands accessing keys of different hash slots.
</li>
<li>
Execution against a stale replica is denied to avoid inconsistent reads.
</li>
<li>
Execution under low memory is denied to avoid exceeding the configured threshold.
</li>
</ol>
<p>
You can use the following flags and instruct the server to treat the scripts' execution differently:
</p>
<ul>
<li>
<p>
<code>
no-writes
</code>
: this flag indicates that the script only reads data but never writes.
</p>
<p>
By default, Redis will deny the execution of flagged scripts (Functions and Eval scripts with
<a href="/docs/latest/develop/interact/programmability/eval-intro/#eval-flags">
shebang
</a>
) against read-only replicas, as they may attempt to perform writes.
Similarly, the server will not allow calling scripts with
<a href="/docs/latest/commands/fcall_ro/">
<code>
FCALL_RO
</code>
</a>
/
<a href="/docs/latest/commands/eval_ro/">
<code>
EVAL_RO
</code>
</a>
.
Lastly, when data persistence is at risk due to a disk error, execution is blocked as well.
</p>
<p>
Using this flag allows executing the script:
</p>
<ol>
<li>
With
<a href="/docs/latest/commands/fcall_ro/">
<code>
FCALL_RO
</code>
</a>
/
<a href="/docs/latest/commands/eval_ro/">
<code>
EVAL_RO
</code>
</a>
</li>
<li>
On read-only replicas.
</li>
<li>
Even if there's a disk error (Redis is unable to persist so it rejects writes).
</li>
<li>
When over the memory limit since it implies the script doesn't increase memory consumption (see
<code>
allow-oom
</code>
below)
</li>
</ol>
<p>
However, note that the server will return an error if the script attempts to call a write command.
Also note that 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.
</p>
<p>
For more information please refer to
<a href="/docs/latest/develop/interact/programmability/#read-only_scripts">
Read-only scripts
</a>
</p>
</li>
<li>
<p>
<code>
allow-oom
</code>
: use this flag to allow a script to execute when the server is out of memory (OOM).
</p>
<p>
Unless used, Redis will deny the execution of flagged scripts (Functions and Eval scripts with
<a href="/docs/latest/develop/interact/programmability/eval-intro/#eval-flags">
shebang
</a>
) when in an OOM state.
Furthermore, when you use this flag, the script can call any Redis command, including commands that aren't usually allowed in this state.
Specifying
<code>
no-writes
</code>
or using
<a href="/docs/latest/commands/fcall_ro/">
<code>
FCALL_RO
</code>
</a>
/
<a href="/docs/latest/commands/eval_ro/">
<code>
EVAL_RO
</code>
</a>
also implies the script can run in OOM state (without specifying
<code>
allow-oom
</code>
)
</p>
</li>
<li>
<p>
<code>
allow-stale
</code>
: a flag that enables running the flagged scripts (Functions and Eval scripts with
<a href="/docs/latest/develop/interact/programmability/eval-intro/#eval-flags">
shebang
</a>
) against a stale replica when the
<code>
replica-serve-stale-data
</code>
config is set to
<code>
no
</code>
.
</p>
<p>
Redis can be set to prevent data consistency problems from using old data by having stale replicas return a runtime error.
For scripts that do not access the data, this flag can be set to allow stale Redis replicas to run the script.
Note however that the script will still be unable to execute any command that accesses stale data.
</p>
</li>
<li>
<p>
<code>
no-cluster
</code>
: the flag causes the script to return an error in Redis cluster mode.
</p>
<p>
Redis allows scripts to be executed both in standalone and cluster modes.
Setting this flag prevents executing the script against nodes in the cluster.
</p>
</li>
<li>
<p>
<code>
allow-cross-slot-keys
</code>
: The flag that allows a script to access keys from multiple slots.
</p>
<p>
Redis typically prevents any single command from accessing keys that hash to multiple slots.
This flag allows scripts to break this rule and access keys within the script that access multiple slots.
Declared keys to the script are still always required to hash to a single slot.
Accessing keys from multiple slots is discouraged as applications should be designed to only access keys from a single slot at a time, allowing slots to move between Redis servers.
</p>
<p>
This flag has no effect when cluster mode is disabled.
</p>
</li>
</ul>
<p>
Please refer to
<a href="/docs/latest/develop/interact/programmability/functions-intro#function-flags">
Function Flags
</a>
and
<a href="/docs/latest/develop/interact/programmability/eval-intro#eval-flags">
Eval Flags
</a>
for a detailed example.
</p>
<h3 id="redis.redis_version">
<code>
redis.REDIS_VERSION
</code>
</h3>
<ul>
<li>
Since version: 7.0.0
</li>
<li>
Available in scripts: yes
</li>
<li>
Available in functions: yes
</li>
</ul>
<p>
Returns the current Redis server version as a Lua string.
The reply's format is
<code>
MM.mm.PP
</code>
, where:
</p>
<ul>
<li>
<strong>
MM:
</strong>
is the major version.
</li>
<li>
<strong>
mm:
</strong>
is the minor version.
</li>
<li>
<strong>
PP:
</strong>
is the patch level.
</li>
</ul>
<h3 id="redis.redis_version_num">
<code>
redis.REDIS_VERSION_NUM
</code>
</h3>
<ul>
<li>
Since version: 7.0.0
</li>
<li>
Available in scripts: yes
</li>
<li>
Available in functions: yes
</li>
</ul>
<p>
Returns the current Redis server version as a number.
The reply is a hexadecimal value structured as
<code>
0x00MMmmPP
</code>
, where:
</p>
<ul>
<li>
<strong>
MM:
</strong>
is the major version.
</li>
<li>
<strong>
mm:
</strong>
is the minor version.
</li>
<li>
<strong>
PP:
</strong>
is the patch level.
</li>
</ul>
<h2 id="data-type-conversion">
Data type conversion
</h2>
<p>
Unless a runtime exception is raised,
<code>
redis.call()
</code>
and
<code>
redis.pcall()
</code>
return the reply from the executed command to the Lua script.
Redis' replies from these functions are converted automatically into Lua's native data types.
</p>
<p>
Similarly, when a Lua script returns a reply with the
<code>
return
</code>
keyword,
that reply is automatically converted to Redis' protocol.
</p>
<p>
Put differently; there's a one-to-one mapping between Redis' replies and Lua's data types and a one-to-one mapping between Lua's data types and the
<a href="/docs/latest/develop/reference/protocol-spec/">
Redis Protocol
</a>
data types.
The underlying design is such that if a Redis type is converted into a Lua type and converted back into a Redis type, the result is the same as the initial value.
</p>
<p>
Type conversion from Redis protocol replies (i.e., the replies from
<code>
redis.call()
</code>
and
<code>
redis.pcall()
</code>
) to Lua data types depends on the Redis Serialization Protocol version used by the script.
The default protocol version during script executions is RESP2.
The script may switch the replies' protocol versions by calling the
<code>
redis.setresp()
</code>
function.
</p>
<p>
Type conversion from a script's returned Lua data type depends on the user's choice of protocol (see the
<a href="/docs/latest/commands/hello/">
<code>
HELLO
</code>
</a>
command).
</p>
<p>
The following sections describe the type conversion rules between Lua and Redis per the protocol's version.
</p>
<h3 id="resp2-to-lua-type-conversion">
RESP2 to Lua type conversion
</h3>
<p>
The following type conversion rules apply to the execution's context by default as well as after calling
<code>
redis.setresp(2)
</code>
:
</p>
<ul>
<li>
<a href="/docs/latest/develop/reference/protocol-spec#integers">
RESP2 integer reply
</a>
-> Lua number
</li>
<li>
<a href="/docs/latest/develop/reference/protocol-spec#bulk-strings">
RESP2 bulk string reply
</a>
-> Lua string
</li>
<li>
<a href="/docs/latest/develop/reference/protocol-spec#arrays">
RESP2 array reply
</a>
-> Lua table (may have other Redis data types nested)
</li>
<li>
<a href="/docs/latest/develop/reference/protocol-spec#simple-strings">
RESP2 status reply
</a>
-> Lua table with a single
<em>
ok
</em>
field containing the status string
</li>
<li>
<a href="/docs/latest/develop/reference/protocol-spec#simple-errors">
RESP2 error reply
</a>
-> Lua table with a single
<em>
err
</em>
field containing the error string
</li>
<li>
<a href="/docs/latest/develop/reference/protocol-spec#bulk-strings">
RESP2 null bulk reply
</a>
and
<a href="/docs/latest/develop/reference/protocol-spec#arrays">
RESP2 null multi-bulk reply
</a>
-> Lua false boolean type
</li>
</ul>
<h2 id="lua-to-resp2-type-conversion">
Lua to RESP2 type conversion
</h2>
<p>
The following type conversion rules apply by default as well as after the user had called
<code>
HELLO 2
</code>
:
</p>
<ul>
<li>
Lua number ->
<a href="/docs/latest/develop/reference/protocol-spec#integers">
RESP2 integer reply
</a>
(the number is converted into an integer)
</li>
<li>
Lua string ->
<a href="/docs/latest/develop/reference/protocol-spec#bulk-strings">
RESP2 bulk string reply
</a>
</li>
<li>
Lua table (indexed, non-associative array) ->
<a href="/docs/latest/develop/reference/protocol-spec#arrays">
RESP2 array reply
</a>
(truncated at the first Lua
<code>
nil
</code>
value encountered in the table, if any)
</li>
<li>
Lua table with a single
<em>
ok
</em>
field ->
<a href="/docs/latest/develop/reference/protocol-spec#simple-strings">
RESP2 status reply
</a>
</li>
<li>
Lua table with a single
<em>
err
</em>
field ->
<a href="/docs/latest/develop/reference/protocol-spec#simple-errors">
RESP2 error reply
</a>
</li>
<li>
Lua boolean false ->
<a href="/docs/latest/develop/reference/protocol-spec#bulk-strings">
RESP2 null bulk reply
</a>
</li>
</ul>
<p>
There is an additional Lua-to-Redis conversion rule that has no corresponding Redis-to-Lua conversion rule:
</p>
<ul>
<li>
Lua Boolean
<code>
true
</code>
->
<a href="/docs/latest/develop/reference/protocol-spec#integers">
RESP2 integer reply
</a>
with value of 1.
</li>
</ul>
<p>
There are three additional rules to note about converting Lua to Redis data types:
</p>
<ul>
<li>
Lua has a single numerical type, Lua numbers.
There is no distinction between integers and floats.
So we always convert Lua numbers into integer replies, removing the decimal part of the number, if any.
<strong>
If you want to return a Lua float, it should be returned as a string
</strong>
,
exactly like Redis itself does (see, for instance, the
<a href="/docs/latest/commands/zscore/">
<code>
ZSCORE
</code>
</a>
command).
</li>
<li>
There's
<a href="http://www.lua.org/pil/19.1.html">
no simple way to have nils inside Lua arrays
</a>
due
to Lua's table semantics.
Therefore, when Redis converts a Lua array to RESP, the conversion stops when it encounters a Lua
<code>
nil
</code>
value.
</li>
<li>
When a Lua table is an associative array that contains keys and their respective values, the converted Redis reply will
<strong>
not
</strong>
include them.
</li>
</ul>
<p>
Lua to RESP2 type conversion examples:
</p>
<pre tabindex="0"><code>redis> EVAL "return 10" 0
(integer) 10
redis> EVAL "return { 1, 2, { 3, 'Hello World!' } }" 0
1) (integer) 1
2) (integer) 2
3) 1) (integer) 3
1) "Hello World!"
redis> EVAL "return redis.call('get','foo')" 0
"bar"
</code></pre>
<p>
The last example demonstrates receiving and returning the exact return value of
<code>
redis.call()
</code>
(or
<code>
redis.pcall()
</code>
) in Lua as it would be returned if the command had been called directly.
</p>
<p>
The following example shows how floats and arrays that cont nils and keys are handled:
</p>
<pre tabindex="0"><code>redis> EVAL "return { 1, 2, 3.3333, somekey = 'somevalue', 'foo', nil , 'bar' }" 0
1) (integer) 1
2) (integer) 2
3) (integer) 3
4) "foo"
</code></pre>
<p>
As you can see, the float value of
<em>
3.333
</em>
gets converted to an integer
<em>
3
</em>
, the
<em>
somekey
</em>
key and its value are omitted, and the string "bar" isn't returned as there is a
<code>
nil
</code>
value that precedes it.
</p>
<h3 id="resp3-to-lua-type-conversion">
RESP3 to Lua type conversion
</h3>
<p>
<a href="https://github.com/redis/redis-specifications/blob/master/protocol/RESP3.md">
RESP3
</a>
is a newer version of the
<a href="/docs/latest/develop/reference/protocol-spec/">
Redis Serialization Protocol
</a>
.
It is available as an opt-in choice as of Redis v6.0.
</p>
<p>
An executing script may call the
<a href="#redis.setresp">
<code>
redis.setresp
</code>
</a>
function during its execution and switch the protocol version that's used for returning replies from Redis' commands (that can be invoked via
<a href="#redis.call">
<code>
redis.call()
</code>
</a>
or
<a href="#redis.pcall">
<code>
redis.pcall()
</code>
</a>
).
</p>
<p>
Once Redis' replies are in RESP3 protocol, all of the
<a href="#resp2-to-lua-type-conversion">
RESP2 to Lua conversion
</a>
rules apply, with the following additions:
</p>
<ul>
<li>
<a href="https://github.com/redis/redis-specifications/blob/master/protocol/RESP3.md#map-type">
RESP3 map reply
</a>
-> Lua table with a single
<em>
map
</em>
field containing a Lua table representing the fields and values of the map.
</li>
<li>
<a href="https://github.com/redis/redis-specifications/blob/master/protocol/RESP3.md#set-reply">
RESP set reply
</a>
-> Lua table with a single
<em>
set
</em>
field containing a Lua table representing the elements of the set as fields, each with the Lua Boolean value of
<code>
true
</code>
.
</li>
<li>
<a href="https://github.com/redis/redis-specifications/blob/master/protocol/RESP3.md#null-reply">
RESP3 null
</a>
-> Lua
<code>
nil
</code>
.
</li>
<li>
<a href="https://github.com/redis/redis-specifications/blob/master/protocol/RESP3.md#boolean-reply">
RESP3 true reply
</a>
-> Lua true boolean value.
</li>
<li>
<a href="https://github.com/redis/redis-specifications/blob/master/protocol/RESP3.md#boolean-reply">
RESP3 false reply
</a>
-> Lua false boolean value.
</li>
<li>
<a href="https://github.com/redis/redis-specifications/blob/master/protocol/RESP3.md#double-type">
RESP3 double reply
</a>
-> Lua table with a single
<em>
double
</em>
field containing a Lua number representing the double value.
</li>
<li>
<a href="https://github.com/redis/redis-specifications/blob/master/protocol/RESP3.md#big-number-type">
RESP3 big number reply
</a>
-> Lua table with a single
<em>
big_number
</em>
field containing a Lua string representing the big number value.
</li>
<li>
<a href="https://github.com/redis/redis-specifications/blob/master/protocol/RESP3.md#verbatim-string-type">
Redis verbatim string reply
</a>
-> Lua table with a single
<em>
verbatim_string
</em>
field containing a Lua table with two fields,
<em>
string
</em>
and
<em>
format
</em>
, representing the verbatim string and its format, respectively.
</li>
</ul>
<p>
<strong>
Note:
</strong>
the RESP3
<a href="https://github.com/redis/redis-specifications/blob/master/protocol/RESP3.md#big-number-type">
big number
</a>
and
<a href="https://github.com/redis/redis-specifications/blob/master/protocol/RESP3.md#verbatim-string-type">
verbatim strings
</a>
replies are only supported as of Redis v7.0 and greater.
Also, presently, RESP3's
<a href="https://github.com/redis/redis-specifications/blob/master/protocol/RESP3.md#attribute-type">
attributes
</a>
,
<a href="https://github.com/redis/redis-specifications/blob/master/protocol/RESP3.md#streamed-strings">
streamed strings
</a>
and
<a href="https://github.com/redis/redis-specifications/blob/master/protocol/RESP3.md#streamed-aggregate-data-types">
streamed aggregate data types
</a>
are not supported by the Redis Lua API.
</p>
<h3 id="lua-to-resp3-type-conversion">
Lua to RESP3 type conversion
</h3>
<p>
Regardless of the script's choice of protocol version set for replies with the [
<code>
redis.setresp()
</code>
function] when it calls
<code>
redis.call()
</code>
or
<code>
redis.pcall()
</code>
, the user may opt-in to using RESP3 (with the
<code>
HELLO 3
</code>
command) for the connection.
Although the default protocol for incoming client connections is RESP2, the script should honor the user's preference and return adequately-typed RESP3 replies, so the following rules apply on top of those specified in the
<a href="#lua-to-resp2-type-conversion">
Lua to RESP2 type conversion
</a>
section when that is the case.
</p>
<ul>
<li>
Lua Boolean ->
<a href="https://github.com/redis/redis-specifications/blob/master/protocol/RESP3.md#boolean-reply">
RESP3 Boolean reply
</a>
(note that this is a change compared to the RESP2, in which returning a Boolean Lua
<code>
true
</code>
returned the number 1 to the Redis client, and returning a
<code>
false
</code>
used to return a
<code>
null
</code>
.
</li>
<li>
Lua table with a single
<em>
map
</em>
field set to an associative Lua table ->
<a href="https://github.com/redis/redis-specifications/blob/master/protocol/RESP3.md#map-type">
RESP3 map reply
</a>
.
</li>
<li>
Lua table with a single
<em>
set
</em>
field set to an associative Lua table ->
<a href="https://github.com/redis/redis-specifications/blob/master/protocol/RESP3.md#set-type">
RESP3 set reply
</a>
. Values can be set to anything and are discarded anyway.
</li>
<li>
Lua table with a single
<em>
double
</em>
field to an associative Lua table ->
<a href="https://github.com/redis/redis-specifications/blob/master/protocol/RESP3.md#double-type">
RESP3 double reply
</a>
.
</li>
<li>
Lua nil ->
<a href="https://github.com/redis/redis-specifications/blob/master/protocol/RESP3.md#null-reply">
RESP3 null
</a>
.
</li>
</ul>
<p>
However, if the connection is set use the RESP2 protocol, and even if the script replies with RESP3-typed responses, Redis will automatically perform a RESP3 to RESP2 conversion of the reply as is the case for regular commands.
That means, for example, that returning the RESP3 map type to a RESP2 connection will result in the reply being converted to a flat RESP2 array that consists of alternating field names and their values, rather than a RESP3 map.
</p>
<h2 id="additional-notes-about-scripting">
Additional notes about scripting
</h2>
<h3 id="using-select-inside-scripts">
Using
<code>
SELECT
</code>
inside scripts
</h3>
<p>
You can call the
<a href="/docs/latest/commands/select/">
<code>
SELECT
</code>
</a>
command from your Lua scripts, like you can with any normal client connection.
However, one subtle aspect of the behavior changed between Redis versions 2.8.11 and 2.8.12.
Prior to Redis version 2.8.12, the database selected by the Lua script was
<em>
set as the current database
</em>
for the client connection that had called it.
As of Redis version 2.8.12, the database selected by the Lua script only affects the execution context of the script, and does not modify the database that's selected by the client calling the script.
This semantic change between patch level releases was required since the old behavior was inherently incompatible with Redis' replication and introduced bugs.
</p>
<h2 id="runtime-libraries">
Runtime libraries
</h2>
<p>
The Redis Lua runtime context always comes with several pre-imported libraries.
</p>
<p>
The following
<a href="https://www.lua.org/manual/5.1/manual.html#5">
standard Lua libraries
</a>
are available to use:
</p>
<ul>
<li>
The
<a href="https://www.lua.org/manual/5.1/manual.html#5.4">
<em>
String Manipulation (string)
</em>
library
</a>
</li>
<li>
The
<a href="https://www.lua.org/manual/5.1/manual.html#5.5">
<em>
Table Manipulation (table)
</em>
library
</a>
</li>
<li>
The
<a href="https://www.lua.org/manual/5.1/manual.html#5.6">
<em>
Mathematical Functions (math)
</em>
library
</a>
</li>
<li>
The
<a href="#os-library">
<em>
Operating System Facilities (os)
</em>
library
</a>
</li>
</ul>
<p>
In addition, the following external libraries are loaded and accessible to scripts:
</p>
<ul>
<li>
The
<a href="#struct-library">
<em>
struct
</em>
library
</a>
</li>
<li>
The
<a href="#cjson-library">
<em>
cjson
</em>
library
</a>
</li>
<li>
The
<a href="#cmsgpack-library">
<em>
cmsgpack
</em>
library
</a>
</li>
<li>
The
<a href="#bitop-library">
<em>
bitop
</em>
library
</a>
</li>
</ul>
<h3 id="os-library">
<em>
os
</em>
library
</h3>
<ul>
<li>
Since version: 7.4
</li>
<li>
Available in scripts: yes
</li>
<li>
Available in functions: yes
</li>
</ul>
<p>
<em>
os
</em>
provides a set of functions for dealing with date, time, and system commands.
More details can be found in the
<a href="https://www.lua.org/manual/5.1/manual.html#5.8">
Operating System Facilities
</a>
.
Note that for sandbox security, currently only the following os functions is exposed:
</p>
<ul>
<li>
<code>
os.clock()
</code>
</li>
</ul>
<h3 id="struct-library">
<em>
struct
</em>
library
</h3>
<ul>
<li>
Since version: 2.6.0
</li>
<li>
Available in scripts: yes
</li>
<li>
Available in functions: yes
</li>
</ul>
<p>
<em>
struct
</em>
is a library for packing and unpacking C-like structures in Lua.
It provides the following functions:
</p>
<ul>
<li>
<a href="#struct.pack">
<code>
struct.pack()
</code>
</a>
</li>
<li>
<a href="#struct.unpack">
<code>
struct.unpack()
</code>
</a>
</li>
<li>
<a href="#struct.size">
<code>
struct.size()
</code>
</a>
</li>
</ul>
<p>
All of
<em>
struct
</em>
's functions expect their first argument to be a
<a href="#struct-formats">
format string
</a>
.
</p>
<h4 id="struct-formats">
<em>
struct
</em>
formats
</h4>
<p>
The following are valid format strings for
<em>
struct
</em>
's functions:
</p>
<ul>
<li>
<code>
>
</code>
: big endian
</li>
<li>
<code>
<
</code>
: little endian
</li>
<li>
<code>
![num]
</code>
: alignment
</li>
<li>
<code>
x
</code>
: padding
</li>
<li>
<code>
b/B
</code>
: signed/unsigned byte
</li>
<li>
<code>
h/H
</code>
: signed/unsigned short
</li>
<li>
<code>
l/L
</code>
: signed/unsigned long
</li>
<li>
<code>
T
</code>
: size_t
</li>
<li>
<code>
i/In
</code>
: signed/unsigned integer with size
<em>
n
</em>
(defaults to the size of int)
</li>
<li>
<code>
cn
</code>
: sequence of
<em>
n
</em>
chars (from/to a string); when packing, n == 0 means the
whole string; when unpacking, n == 0 means use the previously read number as
the string's length.
</li>
<li>
<code>
s
</code>
: zero-terminated string
</li>
<li>
<code>
f
</code>
: float
</li>
<li>
<code>
d
</code>
: double
</li>
<li>
<code>
</code>
(space): ignored
</li>
</ul>
<h4 id="struct.pack">
<code>
struct.pack(x)
</code>
</h4>
<p>
This function returns a struct-encoded string from values.
It accepts a
<a href="#struct-formats">
<em>
struct
</em>
format string
</a>
as its first argument, followed by the values that are to be encoded.
</p>
<p>
Usage example:
</p>
<pre tabindex="0"><code>redis> EVAL "return struct.pack('HH', 1, 2)" 0
"\x01\x00\x02\x00"
</code></pre>
<h4 id="struct.unpack">
<code>
struct.unpack(x)
</code>
</h4>
<p>
This function returns the decoded values from a struct.
It accepts a
<a href="#struct-formats">
<em>
struct
</em>
format string
</a>
as its first argument, followed by encoded struct's string.
</p>
<p>
Usage example:
</p>
<pre tabindex="0"><code>redis> EVAL "return { struct.unpack('HH', ARGV[1]) }" 0 "\x01\x00\x02\x00"
1) (integer) 1
2) (integer) 2
3) (integer) 5
</code></pre>
<h4 id="struct.size">
<code>
struct.size(x)
</code>
</h4>
<p>
This function returns the size, in bytes, of a struct.
It accepts a
<a href="#struct-formats">
<em>
struct
</em>
format string
</a>
as its only argument.
</p>
<p>
Usage example:
</p>
<pre tabindex="0"><code>redis> EVAL "return struct.size('HH')" 0
(integer) 4
</code></pre>
<h3 id="cjson-library">
<em>
cjson
</em>
library
</h3>
<ul>
<li>
Since version: 2.6.0
</li>
<li>
Available in scripts: yes
</li>
<li>
Available in functions: yes
</li>
</ul>
<p>
The
<em>
cjson
</em>
library provides fast
<a href="https://json.org">
JSON
</a>
encoding and decoding from Lua.
It provides these functions.
</p>
<h4 id="cjson.encode">
<code>
cjson.encode(x)
</code>
</h4>
<p>
This function returns a JSON-encoded string for the Lua data type provided as its argument.
</p>
<p>
Usage example:
</p>
<pre tabindex="0"><code>redis> EVAL "return cjson.encode({ ['foo'] = 'bar' })" 0
"{\"foo\":\"bar\"}"
</code></pre>
<h4 id="cjsondecodex-cjsondecode">
<code>
cjson.decode(x)
</code>
{#cjson.decode()}
</h4>
<p>
This function returns a Lua data type from the JSON-encoded string provided as its argument.
</p>
<p>
Usage example:
</p>
<pre tabindex="0"><code>redis> EVAL "return cjson.decode(ARGV[1])['foo']" 0 '{"foo":"bar"}'
"bar"
</code></pre>
<h3 id="cmsgpack-library">
<em>
cmsgpack
</em>
library
</h3>
<ul>
<li>
Since version: 2.6.0
</li>
<li>
Available in scripts: yes
</li>
<li>
Available in functions: yes
</li>
</ul>
<p>
The
<em>
cmsgpack
</em>
library provides fast
<a href="https://msgpack.org/index.html">
MessagePack
</a>
encoding and decoding from Lua.
It provides these functions.
</p>
<h4 id="cmsgpackpackx-cmsgpackpack">
<code>
cmsgpack.pack(x)
</code>
{#cmsgpack.pack()}
</h4>
<p>
This function returns the packed string encoding of the Lua data type it is given as an argument.
</p>
<p>
Usage example:
</p>
<pre tabindex="0"><code>redis> EVAL "return cmsgpack.pack({'foo', 'bar', 'baz'})" 0
"\x93\xa3foo\xa3bar\xa3baz"
</code></pre>
<h4 id="cmsgpackunpackx-cmsgpackunpack">
<code>
cmsgpack.unpack(x)
</code>
{#cmsgpack.unpack()}
</h4>
<p>
This function returns the unpacked values from decoding its input string argument.
</p>
<p>
Usage example:
</p>
<pre tabindex="0"><code>redis> EVAL "return cmsgpack.unpack(ARGV[1])" 0 "\x93\xa3foo\xa3bar\xa3baz"
1) "foo"
2) "bar"
3) "baz"
</code></pre>
<h3 id="bitop-library">
<em>
bit
</em>
library
</h3>
<ul>
<li>
Since version: 2.8.18
</li>
<li>
Available in scripts: yes
</li>
<li>
Available in functions: yes
</li>
</ul>
<p>
The
<em>
bit
</em>
library provides bitwise operations on numbers.
Its documentation resides at
<a href="http://bitop.luajit.org/api.html">
Lua BitOp documentation
</a>
It provides the following functions.
</p>
<h4 id="bittobitx-bittobit">
<code>
bit.tobit(x)
</code>
{#bit.tobit()}
</h4>
<p>
Normalizes a number to the numeric range for bit operations and returns it.
</p>
<p>
Usage example:
</p>
<pre tabindex="0"><code>redis> EVAL 'return bit.tobit(1)' 0
(integer) 1
</code></pre>
<h4 id="bittohexx-n-bittohex">
<code>
bit.tohex(x [,n])
</code>
{#bit.tohex()}
</h4>
<p>
Converts its first argument to a hex string. The number of hex digits is given by the absolute value of the optional second argument.
</p>
<p>
Usage example:
</p>
<pre tabindex="0"><code>redis> EVAL 'return bit.tohex(422342)' 0
"000671c6"
</code></pre>
<h4 id="bitbnotx-bitbnot">
<code>
bit.bnot(x)
</code>
{#bit.bnot()}
</h4>
<p>
Returns the bitwise
<strong>
not
</strong>
of its argument.
</p>
<h4 id="bit.ops">
<code>
bit.bnot(x)
</code>
<code>
bit.bor(x1 [,x2...])
</code>
,
<code>
bit.band(x1 [,x2...])
</code>
and
<code>
bit.bxor(x1 [,x2...])
</code>
</h4>
<p>
Returns either the bitwise
<strong>
or
</strong>
, bitwise
<strong>
and
</strong>
, or bitwise
<strong>
xor
</strong>
of all of its arguments.
Note that more than two arguments are allowed.
</p>
<p>
Usage example:
</p>
<pre tabindex="0"><code>redis> EVAL 'return bit.bor(1,2,4,8,16,32,64,128)' 0
(integer) 255
</code></pre>
<h4 id="bit.shifts">
<code>
bit.lshift(x, n)
</code>
,
<code>
bit.rshift(x, n)
</code>
and
<code>
bit.arshift(x, n)
</code>
</h4>
<p>
Returns either the bitwise logical
<strong>
left-shift
</strong>
, bitwise logical
<strong>
right-shift
</strong>
, or bitwise
<strong>
arithmetic right-shift
</strong>
of its first argument by the number of bits given by the second argument.
</p>
<h4 id="bit.ro">
<code>
bit.rol(x, n)
</code>
and
<code>
bit.ror(x, n)
</code>
</h4>
<p>
Returns either the bitwise
<strong>
left rotation
</strong>
, or bitwise
<strong>
right rotation
</strong>
of its first argument by the number of bits given by the second argument.
Bits shifted out on one side are shifted back in on the other side.
</p>
<h4 id="bitbswapx-bitbswap">
<code>
bit.bswap(x)
</code>
{#bit.bswap()}
</h4>
<p>
Swaps the bytes of its argument and returns it.
This can be used to convert little-endian 32-bit numbers to big-endian 32-bit numbers and vice versa.
</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/interact/programmability/lua-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/kubernetes/release-notes/7-4-2-releases/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Redis Enterprise for Kubernetes 7.4.2-2 release notes
</h1>
<p class="text-lg -mt-5 mb-10">
Releases with support for Redis Enterprise Software 7.4.2.
</p>
<h2 id="detailed-release-notes">
Detailed release notes
</h2>
<table>
<thead>
<tr>
<th style="text-align:left">
VersionΒ (ReleaseΒ date)
</th>
<th style="text-align:left">
Major changes
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/kubernetes/release-notes/7-4-2-releases/7-4-2-12/">
7.4.2-12 (May 2024)
</a>
</td>
<td style="text-align:left">
This is a feature release with a new version of Redis Enterprise Software support for persistent volume expansion.
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/kubernetes/release-notes/7-4-2-releases/7-4-2-03-24/">
7.4.2-2 (March 2024)
</a>
</td>
<td style="text-align:left">
This is a maintenance release supporting Redis Enterprise Software 7.4.2.
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/kubernetes/release-notes/7-4-2-releases/7-4-2-2/">
7.4.2-2 (Feb 2024)
</a>
</td>
<td style="text-align:left">
The primary purpose of this release is to support Redis Enterprise 7.4.2
</td>
</tr>
</tbody>
</table>
<h2 id="version-changes">
Version changes
</h2>
<p>
For a list of fixes related to CVEs, see the
<a href="/docs/latest/operate/rs/release-notes/rs-7-4-2-releases/">
Redis Enterprise 7.4.6-22 release notes
</a>
.
</p>
<h3 id="breaking-changes">
Breaking changes
</h3>
<p>
The following changes included in this release affect the upgrade process. Please read carefully before upgrading.
</p>
<h4 id="upgrade-operating-system">
Upgrade operating system
</h4>
<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>
If your databases use modules, you need to update all nodes in the cluster to Redis Enterprise 7.2.4 or later before upgrading your operating system. See
<a href="/docs/latest/operate/rs/installing-upgrading/upgrading/upgrade-os/">
Upgrade a cluster's operating system
</a>
in the Redis Enterprise Software documentation for more details.
</div>
</div>
<h4 id="terminationgraceperiodseconds">
terminationGracePeriodSeconds
</h4>
<p>
The configurable
<code>
terminationGracePeriodSeconds
</code>
REC field was added in version 7.2.4-12 to replace the hard-coded timeout of 15 minutes for a node to be stopped or drained (RED-111471).
</p>
<h4 id="validatingwebhookconfiguration">
ValidatingWebhookConfiguration
</h4>
<p>
Versions 6.4.2-4 and later include a new
<code>
ValidatingWebhookConfiguration
</code>
resource to replace the
<code>
redb-admission
</code>
webhook resource. To use releases 6.4.2-4 or later, delete the old webhook resource and apply the new file. See
<a href="/docs/latest/operate/kubernetes/upgrade/upgrade-redis-cluster/#reapply-webhook">
upgrade Redis cluster
</a>
for instructions.
</p>
<h4 id="openshift-scc">
OpenShift SCC
</h4>
<p>
Versions 6.4.2-6 and later include a new SCC (
<code>
redis-enterprise-scc-v2
</code>
) that you need to bind to your service account before upgrading. OpenShift clusters running version 6.2.12 or earlier upgrading to version 6.2.18 or later might get stuck if you skip this step. See
<a href="/docs/latest/operate/kubernetes/upgrade/upgrade-redis-cluster/#before-upgrading">
upgrade a Redis Enterprise cluster (REC)
</a>
for instructions.
</p>
<h3 id="deprecations">
Deprecations
</h3>
<ul>
<li>
Redis Software for Kubernetes no longer supports the RHEL7 operating system. Migrate to RHEL8 to use this version.
</li>
</ul>
<h3 id="supported-distributions">
Supported distributions
</h3>
<p>
The following table shows supported distributions at the time of this release. You can also find this list in
<a href="/docs/latest/operate/kubernetes/reference/supported_k8s_distributions/">
Supported Kubernetes distributions
</a>
.
</p>
<p>
<span title="Check mark icon">
β
</span>
Supported β This distribution is supported for this version of Redis Enterprise Software for Kubernetes.
</p>
<p>
<span class="font-serif" title="Deprecation warning">
β οΈ
</span>
Deprecated β This distribution is still supported for this version of Redis Enterprise Software for Kubernetes, but support will be removed in a future release.
</p>
<p>
<span title="X icon">
β
</span>
End of life β Support for this distribution ended.
</p>
<p>
Any distribution not listed below is not supported for production workloads.
</p>
<table>
<thead>
<tr>
<th>
<strong>
Kubernetes version
</strong>
</th>
<th>
<strong>
1.24
</strong>
</th>
<th>
<strong>
1.25
</strong>
</th>
<th>
<strong>
1.26
</strong>
</th>
<th>
<strong>
1.27
</strong>
</th>
<th>
<strong>
1.28
</strong>
</th>
<th>
<strong>
1.29
</strong>
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<strong>
Community Kubernetes
</strong>
</td>
<td>
<span title="X icon">
β
</span>
</td>
<td>
<span title="X icon">
β
</span>
</td>
<td>
<span class="font-serif" title="Deprecation warning">
β οΈ
</span>
</td>
<td>
<span title="Supported">
β
</span>
</td>
<td>
<span title="Supported">
β
</span>
</td>
<td>
<span title="Supported">
β
</span>
</td>
</tr>
<tr>
<td>
<strong>
Amazon EKS
</strong>
</td>
<td>
<span class="font-serif" title="Deprecation warning">
β οΈ
</span>
</td>
<td>
<span class="font-serif" title="Deprecation warning">
β οΈ
</span>
</td>
<td>
<span title="Supported">
β
</span>
</td>
<td>
<span title="Supported">
β
</span>
</td>
<td>
<span title="Supported">
β
</span>
</td>
<td>
</td>
</tr>
<tr>
<td>
<strong>
Azure AKS
</strong>
</td>
<td>
<span title="X icon">
β
</span>
</td>
<td>
<span title="X icon">
β
</span>
</td>
<td>
<span class="font-serif" title="Deprecation warning">
β οΈ
</span>
</td>
<td>
<span title="Supported">
β
</span>
</td>
<td>
<span title="Supported">
β
</span>
</td>
<td>
</td>
</tr>
<tr>
<td>
<strong>
Google GKE
</strong>
</td>
<td>
<span title="X icon">
β
</span>
</td>
<td>
<span class="font-serif" title="Deprecation warning">
β οΈ
</span>
</td>
<td>
<span title="Supported">
β
</span>
</td>
<td>
<span title="Supported">
β
</span>
</td>
<td>
<span title="Supported">
β
</span>
</td>
<td>
</td>
</tr>
<tr>
<td>
<strong>
Rancher RKE2
</strong>
</td>
<td>
<span class="font-serif" title="Deprecation warning">
β οΈ
</span>
</td>
<td>
<span title="Supported">
β
</span>
</td>
<td>
<span title="Supported">
β
</span>
</td>
<td>
<span title="Supported">
β
</span>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
<strong>
VMware TKG 2.2
</strong>
</td>
<td>
<span class="font-serif" title="Deprecation warning">
β οΈ
</span>
</td>
<td>
<span class="font-serif" title="Deprecation warning">
β οΈ
</span>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
<strong>
VMware TKG 2.3
</strong>
</td>
<td>
<span title="Supported">
β
</span>
</td>
<td>
<span title="Supported">
β
</span>
</td>
<td>
<span title="Supported">
β
</span>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
<strong>
VMware TKG 2.4
</strong>
</td>
<td>
</td>
<td>
<span title="Supported">
β
</span>
</td>
<td>
<span title="Supported">
β
</span>
</td>
<td>
<span title="Supported">
β
</span>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
<strong>
OpenShift version
</strong>
</td>
<td>
<strong>
4.11
</strong>
</td>
<td>
<strong>
4.12
</strong>
</td>
<td>
<strong>
4.13
</strong>
</td>
<td>
<strong>
4.14
</strong>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
<span class="font-serif" title="Deprecation warning">
β οΈ
</span>
</td>
<td>
<span class="font-serif" title="Deprecation warning">
β οΈ
</span>
</td>
<td>
<span title="Supported">
β
</span>
</td>
<td>
<span title="Supported">
β
</span>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
<strong>
VMware TKGI version
</strong>
</td>
<td>
<strong>
1.15
</strong>
</td>
<td>
<strong>
1.16
</strong>
</td>
<td>
<strong>
1.17
</strong>
</td>
<td>
<strong>
1.18
</strong>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
<span title="Supported">
β
</span>
</td>
<td>
<span title="Supported">
β
</span>
</td>
<td>
<span title="Supported">
β
</span>
</td>
<td>
<span title="Supported">
β
</span>
</td>
<td>
</td>
<td>
</td>
</tr>
</tbody>
</table>
<h2 id="known-limitations">
Known limitations
</h2>
<p>
The limitations below are specific to the Redis Enterprise for Kubernetes product. To view limitations for the supported Redis Enterprise Software version, see the
<a href="/docs/latest/operate/rs/release-notes/rs-7-4-2-releases/#known-limitations">
7.4.2 release notes
</a>
.
</p>
<h3 id="new-limitations">
New limitations
</h3>
<ul>
<li>
<strong>
Missing endpoint for admission endpoint (rare) (RED-119469)
</strong>
Restart the operator pod.
</li>
<li>
<strong>
The REDB βredisVersionβ field canβt be used for memcached databases(RED-119152)
</strong>
</li>
</ul>
<h3 id="existing-limitations">
Existing limitations
</h3>
<ul>
<li>
<p>
<strong>
When modifying the database suffix for an Active-Active database, while the service-rigger is in a terminating state, the services-rigger will delete and create the ingress or route resources in a loop (RED-107687)
</strong>
Wait until the services- rigger pod has finished to terminate it.
</p>
</li>
<li>
<p>
<strong>
REAADB changes might fail with "gateway timeout" errors, mostly on OpenShift (RED-103048)
</strong>
Retry the operation.
</p>
</li>
<li>
<p>
<strong>
Creating two databases with the same name directly on Redis Enterprise software will cause the service to be deleted and the database will not be available (RED-99997)
</strong>
Avoid duplicating database names. Database creation via K8s has validation in place to prevent this.
</p>
</li>
<li>
<p>
<strong>
Installing the operator bundle produces warning:
<code>
Warning: would violate PodSecurity "restricted: v1.24"
</code>
(RED-97381)
</strong>
Ignore the warning. This issue is documented as benign on official Red Hat documentation.
</p>
</li>
<li>
<p>
<strong>
RERC resources must have a unique name (RED-96302)
</strong>
The string "rec-name"/"rec-namespace" must be different from all other participating clusters in the Active-Active database.
</p>
</li>
<li>
<p>
<strong>
Admission is not blocking REAADB with
<code>
shardCount
</code>
which exceeds license quota (RED-96301)
</strong>
Fix the problems with the REAADB and reapply.
</p>
</li>
<li>
<p>
<strong>
Active-Active controller only supports global database options. Configuration specific to location is not supported (RED-86490)
</strong>
</p>
</li>
<li>
<p>
<strong>
Active-Active setup removal might keep services or routes undeleted (RED-77752)
</strong>
Delete services or routes manually if you encounter this problem.
</p>
</li>
<li>
<p>
<strong>
<code>
autoUpgrade
</code>
set to
<code>
true
</code>
can cause unexpected bdb upgrades when
<code>
redisUpgradePolicy
</code>
is set to
<code>
true
</code>
(RED-72351)
</strong>
Contact support if your deployment is impacted.
</p>
</li>
<li>
<p>
<strong>
Following the previous quick start guide version causes issues with creating an REDB due to unrecognized memory field name (RED-69515)
</strong>
The workaround is to use the newer (current) revision of Deploy Redis Enterprise Software for Kubernetes.
</p>
</li>
<li>
<p>
<strong>
PVC size issues when using decimal value in spec (RED-62132)
</strong>
Make sure you use integer values for the PVC size.
</p>
</li>
<li>
<p>
<strong>
REC might report error states on initial startup (RED-61707)
</strong>
There is no workaround at this time except to ignore the errors.
</p>
</li>
<li>
<p>
<strong>
Hashicorp Vault integration - no support for Gesher (RED-55080)
</strong>
There is no workaround for this issue. Gesher support has been deprecated.
</p>
</li>
<li>
<p>
<strong>
REC clusters fail to start on Kubernetes clusters with unsynchronized clocks (RED-47254)
</strong>
When REC clusters are deployed on Kubernetes clusters without synchronized clocks, the REC cluster does not start correctly. The fix is to use NTP to synchronize the underlying K8s nodes.
</p>
</li>
<li>
<p>
<strong>
Deleting an OpenShift project with an REC deployed may hang (RED-47192)
</strong>
When an REC cluster is deployed in a project (namespace) and has REDB resources, the REDB resources must be deleted first before the REC can be deleted. Therefore, until the REDB resources are deleted, the project deletion will hang. The fix is to delete the REDB resources first and the REC second. Then, you can delete the project.
</p>
</li>
<li>
<p>
<strong>
Clusters must be named 'rec' in OLM-based deployments (RED-39825)
</strong>
In OLM-deployed operators, the deployment of the cluster will fail if the name is not "rec". When the operator is deployed via the OLM, the security context constraints (scc) are bound to a specific service account name (namely, "rec"). The workaround is to name the cluster "rec".
</p>
</li>
<li>
<p>
<strong>
Readiness probe incorrect on failures (RED-39300)
</strong>
STS Readiness probe does not mark a node as "not ready" when running
<code>
rladmin status
</code>
on node failure.
</p>
</li>
<li>
<p>
<strong>
Internal DNS and Kubernetes DNS may have conflicts (RED-37462)
</strong>
DNS conflicts are possible between the cluster
<code>
mdns_server
</code>
and the K8s DNS. This only impacts DNS resolution from within cluster nodes for Kubernetes DNS names.
</p>
</li>
<li>
<p>
<strong>
K8s-based 5.4.10 clusters seem to negatively affect existing 5.4.6 clusters (RED-37233)
</strong>
Upgrade clusters to latest version.
</p>
</li>
<li>
<p>
<strong>
Node CPU usage is reported instead of pod CPU usage (RED-36884)
</strong>
In Kubernetes, the reported node CPU usage is the usage of the Kubernetes worker node hosting the REC pod.
</p>
</li>
<li>
<p>
<strong>
An unreachable cluster has status running (RED-32805)
</strong>
When a cluster is in an unreachable state, the state remains
<code>
running
</code>
instead of triggering an error.
</p>
</li>
<li>
<p>
<strong>
Long cluster names cause routes to be rejected (RED-25871)
</strong>
A cluster name longer than 20 characters will result in a rejected route configuration because the host part of the domain name exceeds 63 characters. The workaround is to limit the cluster name to 20 characters or fewer.
</p>
</li>
<li>
<p>
<strong>
Cluster CR (REC) errors are not reported after invalid updates (RED-25542)
</strong>
A cluster CR specification error is not reported if two or more invalid CR resources are updated in sequence.
</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/kubernetes/release-notes/7-4-2-releases/"/>
<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/logs-reports/system-logs/.html | <section class="prose w-full py-12 max-w-none">
<h1>
System logs
</h1>
<p class="text-lg -mt-5 mb-10">
You can view and export system logs to track any activity associated with your subscriptions and databases.
</p>
<p>
The
<strong>
Logs
</strong>
page contains events, alerts, and logs from the activities, databases, and subscriptions associated with your account.
</p>
<a href="/docs/latest/images/rc/system-logs.png" sdata-lightbox="/images/rc/system-logs.png">
<img alt="Choose the Logs command from the Redis Cloud console menu to view your subscription system log." src="/docs/latest/images/rc/system-logs.png" width="100%"/>
</a>
<p>
You can:
</p>
<ul>
<li>
<p>
Sort the list by a specific field in descending or ascending order. Supported fields include
<em>
Time
</em>
,
<em>
Originator
</em>
,
<em>
Database name
</em>
,
<em>
API key name
</em>
, and
<em>
Activity
</em>
.
</p>
<p>
<a href="/docs/latest/images/rc/icon-database-list-sort-ascending.png#no-click" sdata-lightbox="/images/rc/icon-database-list-sort-ascending.png#no-click">
<img alt="Use the arrows in the list header to sort the list." class="inline" src="/docs/latest/images/rc/icon-database-list-sort-ascending.png#no-click" width="30px"/>
</a>
<a href="/docs/latest/images/rc/icon-database-list-sort-descending.png#no-click" sdata-lightbox="/images/rc/icon-database-list-sort-descending.png#no-click">
<img alt="The direction of the arrow corresponds to the direction of the sort." class="inline" src="/docs/latest/images/rc/icon-database-list-sort-descending.png#no-click" width="30px"/>
</a>
</p>
<p>
Select the arrow icon to change the sort order. You can only sort by one field at a time.
</p>
</li>
<li>
<p>
Use the
<strong>
Export all
</strong>
button to export all logs as a comma-separated values (CSV) file for use in other systems and programs.
</p>
<a href="/docs/latest/images/rc/system-logs-export.png" sdata-lightbox="/images/rc/system-logs-export.png">
<img alt="Use the export all button in the top right to export all logs to a CSV file" src="/docs/latest/images/rc/system-logs-export.png" width="130px"/>
</a>
</li>
<li>
<p>
Use the refresh button to refresh the system logs.
</p>
<a href="/docs/latest/images/rc/system-logs-refresh.png" sdata-lightbox="/images/rc/system-logs-refresh.png">
<img alt="Use the refresh button in the top right to refresh the system logs" src="/docs/latest/images/rc/system-logs-refresh.png" width="40px"/>
</a>
</li>
<li>
<p>
Use the search bar to search for specific entries. Supported fields include
<em>
Originator
</em>
,
<em>
Database name
</em>
,
<em>
API key name
</em>
,
<em>
Activity
</em>
, and
<em>
Description
</em>
.
</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/rc/logs-reports/system-logs/"/>
<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/auto-tiering/storage-engine/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Manage Auto Tiering storage engine
</h1>
<p class="text-lg -mt-5 mb-10">
Manage the storage engine used for your database with auto tiering enabled.
</p>
<h2 id="manage-the-storage-engine">
Manage the storage engine
</h2>
<p>
Redis Enterprise Auto Tiering supports two storage engines:
</p>
<ul>
<li>
<a href="https://www.speedb.io/">
Speedb
</a>
(default, recommended)
</li>
<li>
<a href="https://rocksdb.org/">
RocksDB
</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">
Warning:
</div>
Switching between storage engines requires guidance by Redis Support or your Account Manager.
</div>
</div>
<h3 id="change-the-storage-engine">
Change the storage engine
</h3>
<ol>
<li>
Change the cluster level configuration for default storage engine.
</li>
</ol>
<ul>
<li>
<p>
API:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">curl -k -u <username>:<password> -X PUT -H <span class="s2">"Content-Type: application/json"</span> -d <span class="s1">'{"bigstore_driver":"speedb"}'</span> https://localhost:9443/v1/cluster
</span></span></code></pre>
</div>
</li>
<li>
<p>
CLI:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin cluster config bigstore_driver <span class="o">{</span>speedb <span class="p">|</span> rocksdb<span class="o">}</span>
</span></span></code></pre>
</div>
</li>
</ul>
<ol start="2">
<li>
<p>
Restart the each database on the cluster one by one.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin restart db <span class="o">{</span> db:<id> <span class="p">|</span> <name> <span class="o">}</span>
</span></span></code></pre>
</div>
</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>
We recommend restarting your database at times with low usage and avoiding peak hours. For databases without persistence enabled, we also recommend using export to backup your database first.
</div>
</div>
<h2 id="monitor-the-storage-engine">
Monitor the storage engine
</h2>
<p>
To get the current cluster level default storage engine run:
</p>
<ul>
<li>
<p>
Use the
<code>
rladmin info cluster
</code>
command look for βbigstore_driverβ.
</p>
</li>
<li>
<p>
Use the REST API:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">curl -k -u <username>:<password> -X GET -H <span class="s2">"Content-Type: application/json"</span> https://localhost:9443/v1/cluster
</span></span></code></pre>
</div>
</li>
</ul>
<p>
Versions of Redis Enterprise 7.2 and later provide a metric called
<code>
bdb_bigstore_shard_count
</code>
to help track the shard count per database, filtered by
<code>
bdb_id
</code>
and by storage engine as shown below:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">bdb_bigstore_shard_count<span class="o">{</span><span class="nv">bdb</span><span class="o">=</span><span class="s2">"1"</span>,cluster<span class="o">=</span><span class="s2">"mycluster.local"</span>,driver<span class="o">=</span><span class="s2">"rocksdb"</span><span class="o">}</span> 1.0
</span></span><span class="line"><span class="cl">bdb_bigstore_shard_count<span class="o">{</span><span class="nv">bdb</span><span class="o">=</span><span class="s2">"1"</span>,cluster<span class="o">=</span><span class="s2">"mycluster.local"</span>,driver<span class="o">=</span><span class="s2">"speedb"</span><span class="o">}</span> 2.0
</span></span></code></pre>
</div>
<p>
For more about metrics for Redis Enterpriseβs integration with Prometheus, see
<a href="/docs/latest/integrate/prometheus-with-redis-enterprise/prometheus-metrics-definitions/">
Prometheus integration
</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/databases/auto-tiering/storage-engine/"/>
<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.rank.html | <section class="prose w-full py-12">
<h1 class="command-name">
TDIGEST.RANK
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">TDIGEST.RANK 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 rank of the value (the number of observations in the sketch that are smaller than the value + half the number of observations that are equal to the value).
</p>
<p>
Multiple 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 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 rank_1, rank_2, ..., rank_V:
</p>
<ul>
<li>
-1 - when
<code>
value
</code>
is smaller than the value of the smallest observation.
</li>
<li>
The number of observations - when
<code>
value
</code>
is larger than the value of the largest observation.
</li>
<li>
Otherwise: an estimation of the number of (observations smaller than
<code>
value
</code>
+ half the observations equal to
<code>
value
</code>
).
</li>
</ul>
<p>
0 is the rank of the value of the smallest observation.
</p>
<p>
<em>
n
</em>
-1 is the rank of the value of the largest 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.rank/"/>
<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/commands/replicaof/.html | <section class="prose w-full py-12">
<h1 class="command-name">
REPLICAOF
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">REPLICAOF <host port | NO ONE></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>
@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>
The
<code>
REPLICAOF
</code>
command can change the replication settings of a replica on the fly.
</p>
<p>
If a Redis server is already acting as replica, the command
<code>
REPLICAOF
</code>
NO ONE will turn off the replication, turning the Redis server into a MASTER. In the proper form
<code>
REPLICAOF
</code>
hostname port will make the server a replica of another server listening at the specified hostname and port.
</p>
<p>
If a server is already a replica of some master,
<code>
REPLICAOF
</code>
hostname port will stop the replication against the old server and start the synchronization against the new one, discarding the old dataset.
</p>
<p>
The form
<code>
REPLICAOF
</code>
NO ONE will stop replication, turning the server into a MASTER, but will not discard the already replicated data. So, if the old master stops working, it is possible to turn the replica into a master and set the application to use this new master in read/write. Later when the other Redis server is fixed, it can be reconfigured to work as a replica.
</p>
<h2 id="examples">
Examples
</h2>
<pre tabindex="0"><code>> REPLICAOF NO ONE
"OK"
> REPLICAOF 127.0.0.1 6799
"OK"
</code></pre>
<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/replicaof/"/>
<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/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/7.4/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/7.4/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/7.4/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/7.4/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/7.4/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/7.4/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/7.4/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/oss_and_stack/stack-with-enterprise/release-notes/redisgraph/redisgraph-2.0-release-notes/.html | <section class="prose w-full py-12 max-w-none">
<h1>
RedisGraph 2.0 release notes
</h1>
<p class="text-lg -mt-5 mb-10">
Enabled graph-aided search and graph visualisation. Cypher coverage. Performance improvements.
</p>
<h2 id="requirements">
Requirements
</h2>
<p>
RedisGraph v2.0.21 requires:
</p>
<ul>
<li>
Minimum Redis compatibility version (database): 5.0.7
</li>
<li>
Minimum Redis Enterprise Software version (cluster): 5.4.11
</li>
</ul>
<h2 id="v2021-october-2020">
v2.0.21 (October 2020)
</h2>
<p>
This is a maintenance release for version 2.0.
</p>
<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>
<p>
Minor enhancements:
</p>
<ul>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/pull/1326">
1326
</a>
, #
<a href="https://github.com/RedisGraph/RedisGraph/pull/1330">
1330
</a>
Enable comments in Cypher queries.
</li>
</ul>
</li>
<li>
<p>
Bug fixes:
</p>
</li>
<li>
<p>
#
<a href="https://github.com/RedisGraph/RedisGraph/pull/1338">
1338
</a>
Update parser to support negative values.
</p>
</li>
<li>
<p>
#
<a href="https://github.com/RedisGraph/RedisGraph/pull/1319">
1319
</a>
Replace assertion with runtime error - execution plan building process is unable locate an operation suitable for a filter.
</p>
</li>
<li>
<p>
#
<a href="https://github.com/RedisGraph/RedisGraph/pull/1184">
1184
</a>
EXPLAIN and PROFILE are invalid clauses. They have counterpart commands
<code>
GRAPH.EXPLAIN
</code>
and
<code>
GRAPH.PROFILE
</code>
</p>
</li>
<li>
<p>
#
<a href="https://github.com/RedisGraph/RedisGraph/pull/1212">
1212
</a>
Emit error on the creation of undirected edges.
</p>
</li>
</ul>
<h2 id="v2020-september-2020">
v2.0.20 (September 2020)
</h2>
<p>
This is a maintenance release for version 2.0.
</p>
<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>
<p>
Minor updates:
</p>
<ul>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/pull/1315">
1315
</a>
RediSearch 1.8.3
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/pull/1276">
1276
</a>
Graph info is added to Redis crash report.
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/pull/1265">
1265
</a>
Debug assertion functionality.
</li>
</ul>
</li>
</ul>
<h2 id="v2019-august-2020">
v2.0.19 (August 2020)
</h2>
<p>
This is a maintenance release for version 2.0.
</p>
<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>
Minor updates:
<ul>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/pull/1229">
1229
</a>
Upgrade RediSearch dependency to 1.8.2
</li>
</ul>
</li>
<li>
Performance enhancements:
<ul>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/pull/1218">
1218
</a>
Enable parameters support for ID-based entity retrieval
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/pull/1242">
1242
</a>
Improve update logic, update RediSearch indices only once per update
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/pull/1226">
1226
</a>
Let RediSearch perform document deletion when replacing a document
</li>
</ul>
</li>
<li>
Bug Fixes:
<ul>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/pull/1223">
1223
</a>
Resolve race condition in accessing/updating attribute maps.
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/pull/1196">
1196
</a>
Enable RediSearch
<a href="/docs/latest/develop/interact/search-and-query/administration/gc/">
Garbage Collection
</a>
</li>
</ul>
</li>
</ul>
<h2 id="v2015-25-june-2020">
v2.0.15 (25 June 2020)
</h2>
<p>
This is a maintenance release for version 2.0.
</p>
<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>
Bug Fixes:
<ul>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/pull/1159">
1159
</a>
<code>
IN
</code>
operator didn't result in an index array lookup with parameterised array (
<code>
IN $param
</code>
).
</li>
</ul>
</li>
</ul>
<h2 id="v2014-22-june-2020">
v2.0.14 (22 June 2020)
</h2>
<p>
This is a maintenance release for version 2.0.
</p>
<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>
Bug Fixes:
<ul>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/pull/1157">
1157
</a>
Index search not using query parameters.
</li>
</ul>
</li>
</ul>
<h2 id="v2013-15-june-2020">
v2.0.13 (15 June 2020)
</h2>
<p>
This is a maintenance release for version 2.0.
</p>
<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>
Enhancements:
<ul>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/pull/1118">
1118
</a>
Added module configuration parameters for the number of threads in OpenMP and concurrent queries.
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/pull/1121">
1121
</a>
<a href="https://github.com/RediSearch/RediSearch/">
RediSearch
</a>
v1.8.1
</li>
</ul>
</li>
</ul>
<h2 id="v2012-may-2020">
v2.0.12 (May 2020)
</h2>
<p>
This is a maintenance release for version 2.0.
</p>
<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>
Enhancements:
<ul>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/pull/1103">
1103
</a>
RediSearch 1.8. This upgrade will reduce the resources required for Garbage Collection of indices inside RedisGraph.
</li>
</ul>
</li>
</ul>
<h2 id="v2011-april-2020">
v2.0.11 (April 2020)
</h2>
<p>
This is a maintenance release for version 2.0.
</p>
<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>
Minor Enhancements:
<ul>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/pull/1056">
1056
</a>
Added
<code>
DISTINCT
</code>
support for paths and arrays.
</li>
</ul>
</li>
<li>
Minor Bugfixes:
<ul>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/pull/1056">
1056
</a>
Streamlined logic for uniquing entities.
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/pull/1056">
1056
</a>
Enabled comparison routine for paths.
</li>
</ul>
</li>
</ul>
<h2 id="v2010-29-march-2020">
v2.0.10 (29 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>
Minor Enhancements:
<ul>
<li>
#
<a href="https://github.com/redisgraph/redisgraph/issues/1035">
1035
</a>
- RediSearch version
<a href="https://github.com/RediSearch/RediSearch/releases/tag/v1.6.11">
1.6.11
</a>
.
</li>
</ul>
</li>
<li>
Bugfixes:
<ul>
<li>
#
<a href="https://github.com/redisgraph/redisgraph/issues/1017">
1017
</a>
, #
<a href="https://github.com/redisgraph/redisgraph/issues/1019">
1019
</a>
- Algebraic expressions correctness.
</li>
<li>
#
<a href="https://github.com/redisgraph/redisgraph/issues/1020">
1020
</a>
- Support parameterised SKIP and LIMIT.
</li>
</ul>
</li>
</ul>
<h2 id="v209-19-march-2020">
v2.0.9 (19 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/redisgraph/redisgraph/issues/1028">
1028
</a>
Ensure proper placement of Index Scans when partially replacing Filter ops.
</li>
</ul>
</li>
</ul>
<h2 id="v208-18-march-2020">
v2.0.8 (18 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/redisgraph/redisgraph/issues/1023">
1023
</a>
Fix regression in checking argument counts to GRAPH endpoints.
</li>
</ul>
</li>
</ul>
<h2 id="v206-15-march-2020">
v2.0.6 (15 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>
#
<a href="https://github.com/redisgraph/redisgraph/issues/897">
897
</a>
GRAPH.SLOWLOG
</li>
<li>
#
<a href="https://github.com/redisgraph/redisgraph/issues/1004">
1004
</a>
Re-enable GRAPH.PROFILE
</li>
<li>
#
<a href="https://github.com/redisgraph/redisgraph/issues/917">
917
</a>
, #
<a href="https://github.com/redisgraph/redisgraph/issues/991">
991
</a>
, #
<a href="https://github.com/redisgraph/redisgraph/issues/940">
940
</a>
, #
<a href="https://github.com/redisgraph/redisgraph/issues/984">
984
</a>
Memory leak fixes
</li>
<li>
#
<a href="https://github.com/redisgraph/redisgraph/issues/925">
925
</a>
Bug fix within RediSearch
</li>
<li>
#
<a href="https://github.com/redisgraph/redisgraph/issues/1001">
1001
</a>
Bug fix label scan invalid range
</li>
</ul>
<h2 id="v205-23-february-2020">
v2.0.5 (23 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>
Enhancement:
<ul>
<li>
#
<a href="https://github.com/redisgraph/redisgraph/issues/955">
955
</a>
Switch OR,AND boolean semiring to ANY,PAIR.
</li>
</ul>
</li>
</ul>
<h2 id="v204-23-february-2020">
v2.0.4 (23 February 2020)
</h2>
<p>
Details:
</p>
<ul>
<li>
Enhancement:
<ul>
<li>
Reduce GraphBLAS size
</li>
</ul>
</li>
</ul>
<h2 id="v202-23-february-2020">
v2.0.2 (23 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>
Improved error reporting:
<ul>
<li>
#
<a href="https://github.com/redisgraph/redisgraph/issues/925">
925
</a>
RediSearch query error reporting
</li>
<li>
#
<a href="https://github.com/redisgraph/redisgraph/issues/919">
919
</a>
Added non existing entity runtime error
</li>
</ul>
</li>
<li>
Enhancements:
<ul>
<li>
#
<a href="https://github.com/redisgraph/redisgraph/issues/942">
942
</a>
Update GraphBLAS version (3.2.0)
</li>
<li>
#
<a href="https://github.com/redisgraph/redisgraph/issues/922">
922
</a>
Filter tree compaction
</li>
<li>
#
<a href="https://github.com/redisgraph/redisgraph/issues/906">
906
</a>
Optimize cartesian product
</li>
<li>
#
<a href="https://github.com/redisgraph/redisgraph/issues/898">
898
</a>
Granular matrix locking
</li>
</ul>
</li>
<li>
Bug fixes:
<ul>
<li>
#
<a href="https://github.com/redisgraph/redisgraph/issues/917">
917
</a>
#
<a href="https://github.com/redisgraph/redisgraph/issues/940">
940
</a>
Resolve memory leaks
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/pull/938">
938
</a>
Label matrix should be fetch right before eval
</li>
</ul>
</li>
</ul>
<h2 id="v20-ga-201---january-2020">
v2.0 GA (2.0.1 - January 2020)
</h2>
<p>
This is the General Availability (GA) release of RedisGraph 2.0 (2.0.1)!
</p>
<p>
Headlines:
</p>
<ul>
<li>
Full Text Search (FTS) enabling Graph-aided Search.
</li>
<li>
Full graph response enabling visualisation.
</li>
<li>
Substantial amount of Cypher coverage.
</li>
<li>
Performance improvements of up to 4x compared to RedisGraph 1.2.
</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>
Major features
<ul>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/339">
339
</a>
Full Graph Response. RedisGraph now allows to return Graph entities such as Nodes and Relationships. This feature also enables graph visualisation.
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/558">
558
</a>
Indexing functionality replaced by
<a href="redisearch.io">
RediSearch
</a>
. This results in support for
<ul>
<li>
compound indices
</li>
<li>
full text search
</li>
<li>
graph-aided search
</li>
</ul>
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/691">
691
</a>
RediSearch index is used with
<code>
IN
</code>
operator on indexed properties.
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/488">
488
</a>
Replace flex/lemon parser with
<a href="https://github.com/cleishm/libcypher-parser">
libcypher-parser
</a>
.
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/574">
574
</a>
Introduction of the array data type. This introduces significant support of Cypher as well as properties can be arrays on both nodes and relationships.
</li>
<li>
Cypher
<ul>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/714">
714
</a>
<code>
MERGE
</code>
can be combined with any other clause.
<code>
MERGE
</code>
will take into account bounded entities.
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/786">
786
</a>
Support for passing all supported graph data types (Node, Relationship, Array,...) as arguments to procedure calls, rather than requiring all arguments to be Strings.
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/708">
708
</a>
Named path support.
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/717">
717
</a>
<code>
count(*)
</code>
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/730">
730
</a>
<code>
UNION
</code>
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/757">
757
</a>
<code>
coalesce
</code>
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/658">
658
</a>
Support for
<code>
COUNT DISTINCT
</code>
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/574">
574
</a>
with the array data support comes
<code>
IN
</code>
,
<code>
collect
</code>
,
<code>
head
</code>
,
<code>
range
</code>
,
<code>
reverse
</code>
,
<code>
size
</code>
,
<code>
tail
</code>
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/624">
624
</a>
<code>
randomUUID()
</code>
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/632">
632
</a>
<code>
IS NULL
</code>
and
<code>
IS NOT NULL
</code>
.
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/594">
594
</a>
Support dynamic inline properties for
<code>
CREATE
</code>
and
<code>
MERGE
</code>
patterns.
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/583">
583
</a>
<code>
NOT
</code>
Operator.
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/569">
569
</a>
<code>
timestamp()
</code>
function.
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/586">
586
</a>
<code>
CASE WHEN
</code>
(simple form).
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/582">
582
</a>
<code>
contains
</code>
function.
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/596">
596
</a>
<code>
indegree
</code>
and
<code>
outdegree
</code>
functions for nodes.
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/587">
587
</a>
improved boolean logic.
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/539">
539
</a>
Reusable entities in pattern matching.
</li>
</ul>
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/668">
668
</a>
PageRank support.
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/713">
713
</a>
Parameterised queries support. Most client drivers are updated. This enables future performance enhancements for query caching.
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/662">
662
</a>
Support for AOF.
</li>
</ul>
</li>
<li>
Enhancements
<ul>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/752">
752
</a>
Use GraphBLAS 3.1.1.
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/674">
674
</a>
<code>
GRAPH.QUERY
</code>
will not fail even if graph doesn't exist.
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/613">
613
</a>
Runtime arithmetic error handling.
</li>
</ul>
</li>
<li>
Performance Improvements
<ul>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/773">
773
</a>
Bulk deletion of relationships. Deletion of relationships within the same query will be efficiently handled by batch operations in GraphBLAS.
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/783">
783
</a>
Better replication support. Only write queries that mutate the graph or create indices will be replicated to AOF and slaves.
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/783">
783
</a>
Better commit flow. The Redis Global Lock and RedisGraphs's R/W lock are released once writes are done. Fixed duplicate replications in queries with multiple write segments.
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/640">
640
</a>
GraphBlas to support OpenMP.
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/532">
532
</a>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/535">
535
</a>
Counting edges of given type by reducing matrices.
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/534">
534
</a>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/571">
571
</a>
Query parsing and
<code>
GRAPH.EXPLAIN
</code>
in dedicated thread.
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/550">
550
</a>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/555">
555
</a>
Optimize cartesian product by reducing to join.
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/641">
641
</a>
Cartesian products with multiple incoming streams >2 can now be optimized with "HashJoin".
</li>
</ul>
</li>
<li>
Bugfixes
<ul>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/783">
783
</a>
Master-replica replication - slaves were dropping index mutations caused by procedure calls.
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/785">
785
</a>
Solved several major memory leaks.
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/795">
795
</a>
The underlying graph object's attributes were not updated on
<code>
RENAME
</code>
.
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/720">
720
</a>
Validation of function calls in
<code>
WITH
</code>
and
<code>
CREATE
</code>
clauses e.g.
<code>
CREATE (a {v: fake()})
</code>
.
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/732">
732
</a>
, #
<a href="https://github.com/RedisGraph/RedisGraph/issues/736">
736
</a>
, #
<a href="https://github.com/RedisGraph/RedisGraph/issues/747">
747
</a>
Detect cycles in graph and generate algebraic expression.
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/734">
734
</a>
Fix access of uninitialised GrB_Info.
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/735">
735
</a>
Index scans with
<code>
IN
</code>
filters did not compare with strings properly,
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/758">
758
</a>
Validate that during
<code>
UNION
</code>
all return clauses are annotated.
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/412">
412
</a>
Better handling for
<code>
GRAPH.DELETE
</code>
.
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/537">
537
</a>
Wrong row index within expand-into, enabled few TCK tests.
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/591">
591
</a>
Emit validation error when an alias refers to both nodes and edges.
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/606">
606
</a>
Fix Record ID of edges held in ExpandInto op.
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/607">
607
</a>
All ops NULL-set variables in their free routines (memory).
</li>
<li>
#
<a href="https://github.com/RedisGraph/RedisGraph/issues/893">
893
</a>
Preserve the children array order when replacing operations.
</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 20001 or 2.0.1 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/redisgraph/redisgraph-2.0-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/commands/eval/.html | <section class="prose w-full py-12">
<h1 class="command-name">
EVAL
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">EVAL script numkeys [key [key ...]] [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">
2.6.0
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
Time complexity:
</dt>
<dd class="m-0">
Depends on the script that is executed.
</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>
@scripting
</code>
<span class="mr-1 last:hidden">
,
</span>
</dd>
</dl>
<p>
Invoke the execution of a server-side Lua script.
</p>
<p>
The first argument is the script's source code.
Scripts are written in
<a href="https://lua.org">
Lua
</a>
and executed by the embedded
<a href="/docs/latest/develop/interact/programmability/lua-api">
Lua 5.1
</a>
interpreter in Redis.
</p>
<p>
The second argument is the number of input key name arguments, followed by all the keys accessed by the script.
These names of input keys are available to the script as the
<a href="/docs/latest/develop/interact/programmability/lua-api#the-keys-global-variable">
<em>
KEYS
</em>
global runtime variable
</a>
Any additional input arguments
<strong>
should not
</strong>
represent names of keys.
</p>
<p>
<strong>
Important:
</strong>
to ensure the correct execution of scripts, both in standalone and clustered deployments, all names of keys that a script accesses must be explicitly provided as input key arguments.
The script
<strong>
should only
</strong>
access keys whose names are given as input arguments.
Scripts
<strong>
should never
</strong>
access keys with programmatically-generated names or based on the contents of data structures stored in the database.
</p>
<p>
<strong>
Note:
</strong>
in some cases, users will abuse Lua EVAL by embedding values in the script instead of providing them as argument, and thus generating a different script on each call to EVAL.
These are added to the Lua interpreter and cached to redis-server, consuming a large amount of memory over time.
Starting from Redis 7.4, scripts loaded with
<code>
EVAL
</code>
or
<a href="/docs/latest/commands/eval_ro/">
<code>
EVAL_RO
</code>
</a>
will be deleted from redis after a certain number (least recently used order).
The number of evicted scripts can be viewed through
<a href="/docs/latest/commands/info/">
<code>
INFO
</code>
</a>
's
<code>
evicted_scripts
</code>
.
</p>
<p>
Please refer to the
<a href="/docs/latest/develop/interact/programmability/">
Redis Programmability
</a>
and
<a href="/docs/latest/develop/interact/programmability/eval-intro/">
Introduction to Eval Scripts
</a>
for more information about Lua scripts.
</p>
<h2 id="examples">
Examples
</h2>
<p>
The following example will run a script that returns the first argument that it gets.
</p>
<pre tabindex="0"><code>> EVAL "return ARGV[1]" 0 hello
"hello"
</code></pre>
<h2 id="resp2resp3-reply">
RESP2/RESP3 Reply
</h2>
The return value depends on the script that was executed.
<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/eval/"/>
<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-8/.html | <section class="prose w-full py-12">
<h1>
Redis Data Integration release notes 1.2.8 (August 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>
<h1 id="redis-data-integration-128-ga">
Redis Data Integration 1.2.8 GA
</h1>
<blockquote>
<p>
This maintenance release replaces the 1.2 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>
Fixed issue with
<a href="https://coredns.io/">
CoreDNS
</a>
configuration. Previously, it could only resolve from the host DNS.
</li>
<li>
Fixed incorrect validation schema for jobs in
<a href="https://redis.io/docs/latest/develop/connect/insight/">
Redis Insight
</a>
.
</li>
<li>
The pipeline advanced settings were missing when downloading the pipeline from RDI but this is now fixed.
</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-8/"/>
<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/ts.create.html | <section class="prose w-full py-12">
<h1 class="command-name">
TS.CREATE
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">TS.CREATE key
[RETENTION retentionPeriod]
[ENCODING <COMPRESSED|UNCOMPRESSED>]
[CHUNK_SIZE size]
[DUPLICATE_POLICY policy]
[IGNORE ignoreMaxTimediff ignoreMaxValDiff]
[LABELS [label 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/timeseries">
TimeSeries 1.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>
Create a new time series
</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 name for the time series.
</p>
</details>
<p>
<note>
<b>
Notes:
</b>
</note>
</p>
<ul>
<li>
If a key already exists, you get a Redis error reply,
<code>
TSDB: key already exists
</code>
. You can check for the existence of a key with the
<a href="/docs/latest/commands/exists/">
<code>
EXISTS
</code>
</a>
command.
</li>
<li>
Other commands that also create a new time series when called with a key that does not exist are
<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>
.
</li>
</ul>
<h2 id="optional-arguments">
Optional arguments
</h2>
<details open="">
<summary>
<code>
RETENTION retentionPeriod
</code>
</summary>
<p>
is maximum age for samples compared to the highest reported timestamp, in milliseconds. 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 with this key.
</p>
<p>
When set to 0, samples never expire. When not specified, the option is set to the global
<a href="/docs/latest/develop/data-types/timeseries/configuration#retention_policy">
RETENTION_POLICY
</a>
configuration of the database, which by default is 0.
</p>
</details>
<details open="">
<summary>
<code>
ENCODING enc
</code>
</summary>
<p>
specifies the series samples encoding format as one of the following values:
</p>
<ul>
<li>
<code>
COMPRESSED
</code>
, applies compression to the series samples.
</li>
<li>
<code>
UNCOMPRESSED
</code>
, keeps the raw samples in memory. Adding this flag keeps data in an uncompressed form.
</li>
</ul>
<p>
<code>
COMPRESSED
</code>
is almost always the right choice. Compression not only saves memory but usually improves performance due to a lower number of memory accesses. It can result in about 90% memory reduction. The exception are highly irregular timestamps or values, which occur rarely.
</p>
<p>
When not specified, the option is set to
<code>
COMPRESSED
</code>
.
</p>
</details>
<details open="">
<summary>
<code>
CHUNK_SIZE size
</code>
</summary>
<p>
is initial allocation size, in bytes, for the data part of each new chunk. Actual chunks may consume more memory. Changing chunkSize (using
<a href="/docs/latest/commands/ts.alter/">
<code>
TS.ALTER
</code>
</a>
) does not affect existing chunks.
</p>
<p>
Must be a multiple of 8 in the range [48 .. 1048576]. When not specified, it is set to the global
<a href="/docs/latest/develop/data-types/timeseries/configuration#chunk_size_bytes">
CHUNK_SIZE_BYTES
</a>
configuration of the database, which by default is 4096 (a single memory page).
</p>
<p>
Note: Before v1.6.10 no minimum was enforced. Between v1.6.10 and v1.6.17 and in v1.8.0 the minimum value was 128. Since v1.8.1 the minimum value is 48.
</p>
<p>
The data in each key is stored in chunks. Each chunk contains header and data for a given timeframe. An index contains all chunks. Iterations occur inside each chunk. Depending on your use case, consider these tradeoffs for having smaller or larger sizes of chunks:
</p>
<ul>
<li>
Insert performance: Smaller chunks result in slower inserts (more chunks need to be created).
</li>
<li>
Query performance: Queries for a small subset when the chunks are very large are slower, as we need to iterate over the chunk to find the data.
</li>
<li>
Larger chunks may take more memory when you have a very large number of keys and very few samples per key, or less memory when you have many samples per key.
</li>
</ul>
<p>
If you are unsure about your use case, select the default.
</p>
</details>
<details open="">
<summary>
<code>
DUPLICATE_POLICY policy
</code>
</summary>
<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>
<ul>
<li>
<code>
BLOCK
</code>
: ignore any newly reported value and reply with an error
</li>
<li>
<code>
FIRST
</code>
: ignore any newly reported value
</li>
<li>
<code>
LAST
</code>
: override with the newly reported value
</li>
<li>
<code>
MIN
</code>
: only override if the value is lower than the existing value
</li>
<li>
<code>
MAX
</code>
: only override if the value is higher than the existing value
</li>
<li>
<code>
SUM
</code>
: 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.
</li>
</ul>
<p>
When not specified: set to the global
<a href="/docs/latest/develop/data-types/timeseries/configuration#duplicate_policy">
DUPLICATE_POLICY
</a>
configuration of the database (which, by default, is
<code>
BLOCK
</code>
).
</p>
<p>
<code>
BLOCK
</code>
is often used to avoid accidental changes.
<code>
FIRST
</code>
can be used as an optimization when duplicate reports are possible.
<code>
LAST
</code>
can be used when updates are being reported.
<code>
SUM
</code>
is used for counters (e.g., the number of cars entering a parking lot per minute when there are multiple reporting counting devices).
<code>
MIN
</code>
and
<code>
MAX
</code>
can be used, for example, to store the minimal/maximal stock price per minute (instead of storing all the samples and defining a compaction rule).
</p>
</details>
<details open="">
<summary>
<code>
IGNORE ignoreMaxTimediff ignoreMaxValDiff
</code>
</summary>
<p>
is the policy for handling duplicate samples. A new sample is considered a duplicate and is ignored if the following conditions are met:
</p>
<ul>
<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>
</ul>
<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>
<p>
When not specified: set to the global
<a href="/docs/latest/develop/data-types/timeseries/configuration#ignore_max_time_diff-and-ignore_max_val_diff">
IGNORE_MAX_TIME_DIFF
</a>
and
<a href="/docs/latest/develop/data-types/timeseries/configuration#ignore_max_time_diff-and-ignore_max_val_diff">
IGNORE_MAX_VAL_DIFF
</a>
, which are, by default, both set to 0.
</p>
</details>
<details open="">
<summary>
<code>
LABELS {label value}...
</code>
</summary>
<p>
is set of label-value pairs that represent metadata labels of the key and serve as a secondary index.
</p>
<p>
The
<a href="/docs/latest/commands/ts.mget/">
<code>
TS.MGET
</code>
</a>
,
<a href="/docs/latest/commands/ts.mrange/">
<code>
TS.MRANGE
</code>
</a>
, and
<a href="/docs/latest/commands/ts.mrevrange/">
<code>
TS.MREVRANGE
</code>
</a>
commands operate on multiple time series based on their labels. The
<a href="/docs/latest/commands/ts.queryindex/">
<code>
TS.QUERYINDEX
</code>
</a>
command returns all time series keys matching a given filter based on their labels.
</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/#simple-strings">
Simple string reply
</a>
-
<code>
OK
</code>
if executed correctly
</li>
<li>
[] on error (invalid arguments, key already exists, etc.)
</li>
</ul>
<h2 id="examples">
Examples
</h2>
<details open="">
<summary>
<b>
Create a temperature time series
</b>
</summary>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">127.0.0.1:6379> TS.CREATE temperature:2:32 RETENTION <span class="m">60000</span> DUPLICATE_POLICY MAX LABELS sensor_id <span class="m">2</span> area_id <span class="m">32</span>
</span></span><span class="line"><span class="cl">OK</span></span></code></pre>
</div>
</details>
<h2 id="see-also">
See also
</h2>
<p>
<a href="/docs/latest/commands/ts.add/">
<code>
TS.ADD
</code>
</a>
|
<a href="/docs/latest/commands/ts.incrby/">
<code>
TS.INCRBY
</code>
</a>
|
<a href="/docs/latest/commands/ts.decrby/">
<code>
TS.DECRBY
</code>
</a>
|
<a href="/docs/latest/commands/ts.mget/">
<code>
TS.MGET
</code>
</a>
|
<a href="/docs/latest/commands/ts.mrange/">
<code>
TS.MRANGE
</code>
</a>
|
<a href="/docs/latest/commands/ts.mrevrange/">
<code>
TS.MREVRANGE
</code>
</a>
|
<a href="/docs/latest/commands/ts.queryindex/">
<code>
TS.QUERYINDEX
</code>
</a>
</p>
<h2 id="related-topics">
Related topics
</h2>
<ul>
<li>
<a href="/docs/latest/develop/data-types/timeseries/">
RedisTimeSeries
</a>
</li>
<li>
<a href="https://redis.com/blog/redistimeseries-version-1-2-is-here/">
RedisTimeSeries Version 1.2 Is Here!
</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/ts.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/integrate/pulumi-provider-for-redis-cloud/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Pulumi provider for Redis Cloud
</h1>
<p class="text-lg -mt-5 mb-10">
Explains how to use Pulumi to provision Redis Cloud infrastructure
</p>
<p>
<a href="https://www.pulumi.com/">
Pulumi
</a>
is an automation tool that allows you to easily provision infrastructure as code. Pulumi allows developers to write infrastructure code using programming languages rather than using domain-specific languages.
</p>
<p>
With the
<a href="https://www.pulumi.com/registry/packages/rediscloud/">
Redis Cloud Resource Provider
</a>
, you can create Redis Cloud resources in a programming language. The Pulumi Redis Cloud Provider supports the following programming languages:
</p>
<ul>
<li>
TypeScript
</li>
<li>
Python
</li>
<li>
C#
</li>
<li>
Java
</li>
<li>
Go
</li>
<li>
YAML
</li>
</ul>
<p>
The Redis Cloud Pulumi provider is based on the
<a href="/docs/latest/integrate/terraform-provider-for-redis-cloud/">
Redis Cloud Terraform provider
</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 Redis Cloud Pulumi Redis Cloud provider supports Redis Cloud Pro. It does not support Redis Cloud Essentials.
</div>
</div>
<p>
See
<a href="/docs/latest/integrate/pulumi-provider-for-redis-cloud/get-started/">
Get started with Pulumi
</a>
for an example of how to use the Pulumi provider with Python.
</p>
<h2 id="resources-and-functions">
Resources and functions
</h2>
<p>
Pulumi resources represent the fundamental units that make up cloud infrastructure. A provider can make functions available in its SDK and resource types. These functions are often used to acquire information that is not part of a resource.
</p>
<p>
The Redis Cloud Pulumi provider allows for the following resources:
</p>
<ul>
<li>
<p>
<a href="https://www.pulumi.com/registry/packages/rediscloud/api-docs/subscription/">
<code>
Subscription
</code>
</a>
: The basic building block of a Redis Cloud subscription.
</p>
</li>
<li>
<p>
<a href="https://www.pulumi.com/registry/packages/rediscloud/api-docs/subscriptiondatabase/">
<code>
SubscriptionDatabase
</code>
</a>
: Represents a Redis database which belongs to a specific Redis Cloud subscription.
</p>
</li>
<li>
<p>
<a href="https://www.pulumi.com/registry/packages/rediscloud/api-docs/subscriptionpeering/">
<code>
SubscriptionPeering
</code>
</a>
: A VPC peering connection (AWS or GCP) to a specific Redis Cloud subscription.
</p>
</li>
<li>
<p>
<a href="https://www.pulumi.com/registry/packages/rediscloud/api-docs/cloudaccount/">
<code>
CloudAccount
</code>
</a>
: Represents an AWS account in which you want to deploy Redis Cloud infrastructure components.
</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 "bring your own AWS account" option for Redis Cloud has been deprecated. The
<code>
CloudAccount
</code>
resource is only available for legacy Redis Cloud integrations.
</div>
</div>
</li>
<li>
<p>
<a href="https://www.pulumi.com/registry/packages/rediscloud/api-docs/activeactivesubscription/">
<code>
ActiveActiveSubscription
</code>
</a>
: The basic building block of an active-active Redis Cloud subscription.
</p>
</li>
<li>
<p>
<a href="https://www.pulumi.com/registry/packages/rediscloud/api-docs/activeactivesubscriptiondatabase/">
<code>
ActiveActiveSubscriptionDatabase
</code>
</a>
: Represents a Redis database which belongs to a specific Redis Cloud active-active subscription.
</p>
</li>
<li>
<p>
<a href="https://www.pulumi.com/registry/packages/rediscloud/api-docs/activeactivesubscriptionregions/">
<code>
ActiveActiveSubscriptionRegions
</code>
</a>
: The different regions where the active-active subscription will be deployed.
</p>
</li>
<li>
<p>
<a href="https://www.pulumi.com/registry/packages/rediscloud/api-docs/activeactivesubscriptionpeering/">
<code>
ActiveActiveSubscriptionPeering
</code>
</a>
: A VPC peering connection (AWS or GCP) to a specific Redis Cloud active-active subscription.
</p>
</li>
<li>
<p>
<a href="https://www.pulumi.com/registry/packages/rediscloud/api-docs/aclrule/">
<code>
AclRule
</code>
</a>
,
<a href="https://www.pulumi.com/registry/packages/rediscloud/api-docs/aclrole/">
<code>
AclRole
</code>
</a>
, and
<a href="https://www.pulumi.com/registry/packages/rediscloud/api-docs/acluser/">
<code>
AclUser
</code>
</a>
: Rules, Roles, and Users for
<a href="/docs/latest/operate/rc/security/access-control/data-access-control/role-based-access-control/">
Role-based access control
</a>
.
</p>
</li>
</ul>
<p>
It also allows for the following functions:
</p>
<ul>
<li>
<p>
<a href="https://www.pulumi.com/registry/packages/rediscloud/api-docs/getcloudaccount/">
<code>
GetCloudAccount
</code>
</a>
: Get the information related to the AWS account.
</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 "bring your own AWS account" option for Redis Cloud has been deprecated. The
<code>
CloudAccount
</code>
resource is only available for legacy Redis Cloud integrations.
</div>
</div>
</li>
<li>
<p>
<a href="https://www.pulumi.com/registry/packages/rediscloud/api-docs/getdatapersistence/">
<code>
GetDataPersistence
</code>
</a>
: Get the type of database persistence.
</p>
</li>
<li>
<p>
<a href="https://www.pulumi.com/registry/packages/rediscloud/api-docs/getdatabase/">
<code>
GetDatabase
</code>
</a>
: Get the information related to a specific database.
</p>
</li>
<li>
<p>
<a href="https://www.pulumi.com/registry/packages/rediscloud/api-docs/getdatabasemodules/">
<code>
GetDatabaseModules
</code>
</a>
: Get the capabilities for a specific database.
</p>
</li>
<li>
<p>
<a href="https://www.pulumi.com/registry/packages/rediscloud/api-docs/getpaymentmethod/">
<code>
GetPaymentMethod
</code>
</a>
: Get the payment method related to the Redis Cloud account.
</p>
</li>
<li>
<p>
<a href="https://www.pulumi.com/registry/packages/rediscloud/api-docs/getregions/">
<code>
GetRegions
</code>
</a>
: Get the regions related to an active-active subscription
</p>
</li>
<li>
<p>
<a href="https://www.pulumi.com/registry/packages/rediscloud/api-docs/getsubscription/">
<code>
GetSubscription
</code>
</a>
: Get the information related to a specific subscription.
</p>
</li>
<li>
<p>
<a href="https://www.pulumi.com/registry/packages/rediscloud/api-docs/getsubscriptionpeerings/">
<code>
GetSubscriptionPeerings
</code>
</a>
: Get the VPC peerings (AWS or GCP) related to a specific subscription.
</p>
</li>
<li>
<p>
<a href="https://www.pulumi.com/registry/packages/rediscloud/api-docs/getaclrule/">
<code>
GetAclRule
</code>
</a>
,
<a href="https://www.pulumi.com/registry/packages/rediscloud/api-docs/getaclrole/">
<code>
GetAclRole
</code>
</a>
, and
<a href="https://www.pulumi.com/registry/packages/rediscloud/api-docs/getacluser/">
<code>
GetAclUser
</code>
</a>
: Get the Rules, Roles, and Users for
<a href="/docs/latest/operate/rc/security/access-control/data-access-control/role-based-access-control/">
Role-based access control
</a>
.
</p>
</li>
</ul>
<h2 id="more-info">
More info
</h2>
<ul>
<li>
<a href="/docs/latest/integrate/pulumi-provider-for-redis-cloud/get-started/">
Get started with Pulumi
</a>
</li>
<li>
<a href="https://www.pulumi.com/registry/packages/rediscloud/">
Redis Cloud Pulumi registry
</a>
</li>
<li>
<a href="https://www.pulumi.com/docs/">
Pulumi documentation
</a>
</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/pulumi-provider-for-redis-cloud/"/>
<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.exists/.html | <section class="prose w-full py-12">
<h1 class="command-name">
CF.EXISTS
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">CF.EXISTS 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), where k is the number of sub-filters
</dd>
</dl>
<p>
Determines whether a given item was added to a cuckoo filter.
</p>
<p>
This command is similar to
<a href="/docs/latest/commands/cf.mexists/">
<code>
CF.MEXISTS
</code>
</a>
, except that only one item can be checked.
</p>
<h2 id="required-arguments">
Required arguments
</h2>
<details open="">
<summary>
<code>
key
</code>
</summary>
<p>
is key name for a cuckoo filter.
</p>
</details>
<details open="">
<summary>
<code>
item
</code>
</summary>
<p>
is an item to check.
</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>
1
</code>
means that, with high probability,
<code>
item
</code>
had already been added to the filter, and
<code>
0
</code>
means that
<code>
key
</code>
does not exist or that
<code>
item
</code>
had not been added to the filter. See note in
<a href="/docs/latest/commands/cf.del/">
<code>
CF.DEL
</code>
</a>
.
</li>
<li>
[] on error (invalid arguments, wrong key type, and so on)
</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.ADD cf item1
</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.EXISTS cf item1
</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.EXISTS cf item2
</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.exists/"/>
<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/crdb/health_report/.html | <section class="prose w-full py-12 max-w-none">
<h1>
CRDB health report object
</h1>
<p class="text-lg -mt-5 mb-10">
An object that represents an Active-Active database health report.
</p>
<p>
An object that represents an Active-Active database health report.
</p>
<table>
<thead>
<tr>
<th>
Name
</th>
<th>
Type/Value
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
active_config_version
</td>
<td>
integer
</td>
<td>
Active configuration version
</td>
</tr>
<tr>
<td>
cluster_name
</td>
<td>
string
</td>
<td>
Name of local Active-Active cluster
</td>
</tr>
<tr>
<td>
configurations
</td>
<td>
array of
<a href="/docs/latest/operate/rs/references/rest-api/objects/crdb/health_report/health_report_configuration/">
health_report_configuration
</a>
objects
</td>
<td>
Stored database configurations
</td>
</tr>
<tr>
<td>
connection_error
</td>
<td>
string
</td>
<td>
Error string if remote cluster is not available
</td>
</tr>
<tr>
<td>
connections
</td>
<td>
<pre><code>
[{
"name": string,
"replication_links": [
{
"link_uid": "bdb_uid:replica_uid",
"status": "up | down"
} ],
"status": string
}, ...] </code></pre>
</td>
<td>
Connections to other clusters and their statuses. A replication link's
<code>
bdb_uid
</code>
is the unique ID of a local database instance (
<a href="/docs/latest/operate/rs/references/rest-api/objects/bdb/">
bdb
</a>
) in the current cluster. The
<code>
replica_uid
</code>
is the unique ID of the database's remote replica, located in the connected cluster.
</td>
</tr>
<tr>
<td>
name
</td>
<td>
string
</td>
<td>
Name of the Active-Active 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/references/rest-api/objects/crdb/health_report/"/>
<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/sintercard/.html | <section class="prose w-full py-12">
<h1 class="command-name">
SINTERCARD
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">SINTERCARD 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*M) worst case where N is the cardinality of the smallest set and M is the number of 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>
@set
</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/sinter/">
<code>
SINTER
</code>
</a>
, but instead of returning the result set, it returns just the cardinality of the result.
Returns the cardinality of the set which would result from the intersection of all the given sets.
</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> SADD key1 "a"
(integer) 1
redis> SADD key1 "b"
(integer) 1
redis> SADD key1 "c"
(integer) 1
redis> SADD key1 "d"
(integer) 1
redis> SADD key2 "c"
(integer) 1
redis> SADD key2 "d"
(integer) 1
redis> SADD key2 "e"
(integer) 1
redis> SINTER key1 key2
1) "c"
2) "d"
redis> SINTERCARD 2 key1 key2
(integer) 2
redis> SINTERCARD 2 key1 key2 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 elements 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/sintercard/"/>
<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/job_scheduler/node_checks_job_settings/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Node checks job settings object
</h1>
<p class="text-lg -mt-5 mb-10">
Documents the node_checks_job_settings 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>
cron_expression
</td>
<td>
string
</td>
<td>
<a href="https://en.wikipedia.org/wiki/Cron#CRON_expression">
CRON expression
</a>
that defines the node checks schedule
</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/job_scheduler/node_checks_job_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/commands/hlen/.html | <section class="prose w-full py-12">
<h1 class="command-name">
HLEN
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">HLEN 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">
2.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>
@hash
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@fast
</code>
<span class="mr-1 last:hidden">
,
</span>
</dd>
</dl>
<p>
Returns the number of fields contained in the hash 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> HSET myhash field1 "Hello"
(integer) 1
redis> HSET myhash field2 "World"
(integer) 1
redis> HLEN myhash
(integer) 2
</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 fields in the hash, or 0 when the key does not exist.
<h2 id="resp3-reply">
RESP3 Reply
</h2>
<a href="../../develop/reference/protocol-spec#integers">
Integer reply
</a>
: the number of the fields in the hash, or 0 when the key does not 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/hlen/"/>
<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/administration/gc/.html | <section class="prose w-full py-12">
<h1>
Garbage collection
</h1>
<p class="text-lg -mt-5 mb-10">
Details about garbage collection
</p>
<h2 id="the-need-for-garbage-collection">
The need for garbage collection
</h2>
<ul>
<li>
When documents are deleted by the user, Redis only marks them as deleted in the global document table rather than deleting them outright. This is done for efficiency. Depending on the length of a document, deletion can be a long operation.
</li>
<li>
This means that it is no longer the case that an internal numeric id is assigned to a deleted document. When the index is traversed, a check is made for deletion.
</li>
<li>
All inverted index entries belonging to deleted document ids are garbage.
</li>
<li>
Updating a document is basically the same as deleting it and then adding it again with a new incremental internal ID. No diffing is performed, and the indexes are appended, so the IDs remain incremental, and the updates fast.
</li>
</ul>
<p>
All of the above means that if there are a lot of updates and deletes, a large portion of our inverted index will become garbage, both slowing things down and consuming unnecessary memory.
</p>
<p>
You want to optimize the index, but you also don't want to disturb normal operation. This means that optimization or garbage collection should be a background process that's non-intrusive. It only needs to be faster than the deletion rate over a sufficient period of time so that you don't create more garbage than you can collect.
</p>
<h2 id="garbage-collecting-a-single-term-index">
Garbage collecting a single-term index
</h2>
<p>
A single-term inverted index is an array of blocks, each of which containin an encoded list of records; e.g., a document id delta plus other data depending on the index encoding scheme. When some of these records refer to deleted documents this is called garbage.
</p>
<p>
The algorithm is simple:
</p>
<ol start="0">
<li>
Create a reader and writer for each block.
</li>
<li>
Read each block's records one by one.
</li>
<li>
If no record is invalid, do nothing.
</li>
<li>
When a garbage record is found, the reader is advanced, but not the writer.
</li>
<li>
When at least one garbage record is found, the next records are encoded to the writer, recalculating the deltas.
</li>
</ol>
<p>
Pseudo code:
</p>
<pre tabindex="0"><code>foreach index_block as block:
reader = new_reader(block)
writer = new_write(block)
garbage = 0
while not reader.end():
record = reader.decode_next()
if record.is_valid():
if garbage != 0:
# Write the record at the writer's tip with a newly calculated delta
writer.write_record(record)
else:
writer.advance(record.length)
else:
garbage += record.length
</code></pre>
<h3 id="gc-on-numeric-indexes">
GC on numeric indexes
</h3>
<p>
Numeric indexes are a tree of inverted indexes with a special encoding of (docId delta, value). This means the same algorithm can be applied to them, only traversing each inverted index object in the tree.
</p>
<h2 id="fork-gc">
FORK GC
</h2>
<p>
Information about FORK GC can be found in this
<a href="https://redislabs.com/blog/increased-garbage-collection-performance-redisearch-1-4-1/">
blog
</a>
.
</p>
<p>
Since v1.6, the FORK GC is the default GC policy and was proven very efficient both in cleaning the index and not reducing query and indexing performance, even for very write-internsive use cases.
</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/interact/search-and-query/administration/gc/"/>
<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/debezium/cassandra/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Write-behind configuration for cassandra
</h1>
<p class="text-lg -mt-5 mb-10">
Describes the
<code>
application.properties
</code>
settings that configure Debezium Server for cassandra
</p>
<h2 id="applicationproperties">
application.properties
</h2>
<div class="highlight">
<pre class="chroma"><code class="language-properties" data-lang="properties"><span class="line"><span class="cl"><span class="na">debezium.sink.type</span><span class="o">=</span><span class="s">redis</span>
</span></span><span class="line"><span class="cl"><span class="na">debezium.sink.redis.message.format</span><span class="o">=</span><span class="s">extended</span>
</span></span><span class="line"><span class="cl"><span class="na">debezium.sink.redis.address</span><span class="o">=</span><span class="s"><RDI_HOST>:<RDI_PORT></span>
</span></span><span class="line"><span class="cl"><span class="c1"># Comment the following line if not using a password for Write-behind.</span>
</span></span><span class="line"><span class="cl"><span class="na">debezium.sink.redis.password</span><span class="o">=</span><span class="s"><RDI_PASSWORD></span>
</span></span><span class="line"><span class="cl"><span class="na">debezium.sink.redis.memory.limit.mb</span><span class="o">=</span><span class="s">80</span>
</span></span><span class="line"><span class="cl"><span class="c1"># Redis SSL/TLS</span>
</span></span><span class="line"><span class="cl"><span class="c1">#debezium.sink.redis.ssl.enabled=true</span>
</span></span><span class="line"><span class="cl"><span class="c1"># When Redis is configured with a replica shard, these properties allow to verify that the data has been written to the replica.</span>
</span></span><span class="line"><span class="cl"><span class="c1">#debezium.sink.redis.wait.enabled=true</span>
</span></span><span class="line"><span class="cl"><span class="c1">#debezium.sink.redis.wait.timeout.ms=1000</span>
</span></span><span class="line"><span class="cl"><span class="c1">#debezium.sink.redis.wait.retry.enabled=true</span>
</span></span><span class="line"><span class="cl"><span class="c1">#debezium.sink.redis.wait.retry.delay.ms=1000</span>
</span></span><span class="line"><span class="cl"><span class="c1">#debezium.source.database.history.redis.ssl.enabled=true</span>
</span></span><span class="line"><span class="cl"><span class="c1"># Location of the Java keystore file containing an application process' own certificate and private key.</span>
</span></span><span class="line"><span class="cl"><span class="c1">#javax.net.ssl.keyStore=<KEY_STORE_FILE_PATH></span>
</span></span><span class="line"><span class="cl"><span class="c1"># Password to access the private key from the keystore file specified by javax.net.ssl.keyStore. This password is used twice: To unlock the keystore file (store password), and To decrypt the private key stored in the keystore (key password).</span>
</span></span><span class="line"><span class="cl"><span class="c1">#javax.net.ssl.keyStorePassword=<KEY_STORE_PASSWORD></span>
</span></span><span class="line"><span class="cl"><span class="c1"># Location of the Java keystore file containing the collection of CA certificates trusted by this application process (trust store).</span>
</span></span><span class="line"><span class="cl"><span class="c1">#javax.net.ssl.trustStore=<TRUSE_STORE_FILE_PATH></span>
</span></span><span class="line"><span class="cl"><span class="c1"># Password to unlock the keystore file (store password) specified by javax.net.ssl.trustStore.</span>
</span></span><span class="line"><span class="cl"><span class="c1">#javax.net.ssl.trustStorePassword=<TRUST_STORE_PASSWORD></span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="na">debezium.source.connector.class</span><span class="o">=</span><span class="s">io.debezium.connector.cassandra.Cassandra4Connector</span>
</span></span><span class="line"><span class="cl"><span class="na">debezium.source.snapshot.consistency</span><span class="o">=</span><span class="s">ONE</span>
</span></span><span class="line"><span class="cl"><span class="na">debezium.source.offset.storage</span><span class="o">=</span><span class="s">io.debezium.storage.redis.offset.RedisOffsetBackingStore</span>
</span></span><span class="line"><span class="cl"><span class="na">debezium.source.topic.prefix</span><span class="o">=</span><span class="s"><SOURCE_LOGICAL_SERVER_NAME></span>
</span></span><span class="line"><span class="cl"><span class="na">debezium.source.cassandra.node.id</span><span class="o">=</span><span class="s"><NAME_SOURCE_NODE></span>
</span></span><span class="line"><span class="cl"><span class="na">debezium.source.cassandra.hosts</span><span class="o">=</span><span class="s"><SOURCE_DB_HOST></span>
</span></span><span class="line"><span class="cl"><span class="na">debezium.source.cassandra.port</span><span class="o">=</span><span class="s"><SOURCE_DB_PORT></span>
</span></span><span class="line"><span class="cl"><span class="na">debezium.source.cassandra.config</span><span class="o">=</span><span class="s"><ABSOLUTE_PATH_CONFIG_FILE></span>
</span></span><span class="line"><span class="cl"><span class="na">debezium.source.commit.log.relocation.dir</span><span class="o">=</span><span class="s"><RELOCATION_DIR></span>
</span></span><span class="line"><span class="cl"><span class="na">debezium.source.commit.log.real.time.processing.enabled</span><span class="o">=</span><span class="s">true</span>
</span></span><span class="line"><span class="cl"><span class="na">debezium.source.commit.marked.complete.poll.interval.ms</span><span class="o">=</span><span class="s">1000</span>
</span></span><span class="line"><span class="cl"><span class="na">debezium.source.http.port</span><span class="o">=</span><span class="s">8040</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Whether to include the detailed schema information generated by Debezium in each record written to RDI.</span>
</span></span><span class="line"><span class="cl"><span class="c1"># Note: Including the schema reduces the initial sync throughput and is not recommended for large data sets.</span>
</span></span><span class="line"><span class="cl"><span class="na">debezium.source.key.converter.schemas.enable</span><span class="o">=</span><span class="s">false</span>
</span></span><span class="line"><span class="cl"><span class="na">debezium.source.value.converter.schemas.enable</span><span class="o">=</span><span class="s">false</span>
</span></span><span class="line"><span class="cl"><span class="c1"># When detailed schema information is excluded, handle decimal numeric types as strings.</span>
</span></span><span class="line"><span class="cl"><span class="na">debezium.source.decimal.handling.mode</span><span class="o">=</span><span class="s">string</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="na">debezium.transforms</span><span class="o">=</span><span class="s">AddPrefix</span>
</span></span><span class="line"><span class="cl"><span class="na">debezium.transforms.AddPrefix.type</span><span class="o">=</span><span class="s">org.apache.kafka.connect.transforms.RegexRouter</span>
</span></span><span class="line"><span class="cl"><span class="na">debezium.transforms.AddPrefix.regex</span><span class="o">=</span><span class="s">.*</span>
</span></span><span class="line"><span class="cl"><span class="na">debezium.transforms.AddPrefix.replacement</span><span class="o">=</span><span class="s">data:$0</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Logging</span>
</span></span><span class="line"><span class="cl"><span class="c1"># Uncomment the following lines if running Debezium Server as a Java standalone process (non-containerized).</span>
</span></span><span class="line"><span class="cl"><span class="c1">#quarkus.log.file.enable=true</span>
</span></span><span class="line"><span class="cl"><span class="c1">#quarkus.log.file.path=<LOG_FILE_PATH></span>
</span></span><span class="line"><span class="cl"><span class="c1">#quarkus.log.file.rotation.max-file-size=100M</span>
</span></span><span class="line"><span class="cl"><span class="c1">#quarkus.log.file.rotation.rotate-on-boot=true</span>
</span></span><span class="line"><span class="cl"><span class="c1">#quarkus.log.file.rotation.file-suffix=.yyyy-MM-dd.gz</span>
</span></span><span class="line"><span class="cl"><span class="c1">#quarkus.log.file.rotation.max-backup-index=3</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># The default minimum log level for every log category, change only quarkus.log.level when needed.</span>
</span></span><span class="line"><span class="cl"><span class="na">quarkus.log.min-level</span><span class="o">=</span><span class="s">TRACE</span>
</span></span><span class="line"><span class="cl"><span class="c1"># The default log level for every log category.</span>
</span></span><span class="line"><span class="cl"><span class="na">quarkus.log.level</span><span class="o">=</span><span class="s">INFO</span>
</span></span><span class="line"><span class="cl"><span class="c1"># Determine whether to enable the JSON console formatting extension, which disables "normal" console formatting.</span>
</span></span><span class="line"><span class="cl"><span class="na">quarkus.log.console.json</span><span class="o">=</span><span class="s">false</span>
</span></span><span class="line"><span class="cl"><span class="c1"># The port on which Debezium exposes Microprofile Health endpoint and other exposed status information.</span>
</span></span><span class="line"><span class="cl"><span class="na">quarkus.http.port</span><span class="o">=</span><span class="s">8088</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/debezium/cassandra/"/>
<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/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/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/integrate/redisom-for-python/.html | <section class="prose w-full py-12 max-w-none">
<h1>
RedisOM for Python
</h1>
<p class="text-lg -mt-5 mb-10">
Learn how to build with Redis Stack and Python
</p>
<p>
<a href="https://github.com/redis/redis-om-python">
Redis OM Python
</a>
is a Redis client that provides high-level abstractions for managing document data in Redis. This tutorial shows you how to get up and running with Redis OM Python, Redis Stack, and the
<a href="https://flask.palletsprojects.com/">
Flask
</a>
micro-framework.
</p>
<p>
We'd love to see what you build with Redis Stack and Redis OM.
<a href="https://discord.gg/redis">
Join the Redis community on Discord
</a>
to chat with us about all things Redis OM and Redis Stack. Read more about Redis OM Python
<a href="https://redis.com/blog/introducing-redis-om-for-python/">
our announcement blog post
</a>
.
</p>
<h2 id="overview">
Overview
</h2>
<p>
This application, an API built with Flask and a simple domain model, demonstrates common data manipulation patterns using Redis OM.
</p>
<p>
Our entity is a Person, with the following JSON representation:
</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">"first_name"</span><span class="p">:</span> <span class="s2">"A string, the person's first or given name"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"last_name"</span><span class="p">:</span> <span class="s2">"A string, the person's last or surname"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"age"</span><span class="p">:</span> <span class="mi">36</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"address"</span><span class="p">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"street_number"</span><span class="p">:</span> <span class="mi">56</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"unit"</span><span class="p">:</span> <span class="s2">"A string, optional unit number e.g. B or 1"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"street_name"</span><span class="p">:</span> <span class="s2">"A string, name of the street they live on"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"city"</span><span class="p">:</span> <span class="s2">"A string, name of the city they live in"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"state"</span><span class="p">:</span> <span class="s2">"A string, state, province or county that they live in"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"postal_code"</span><span class="p">:</span> <span class="s2">"A string, their zip or postal code"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"country"</span><span class="p">:</span> <span class="s2">"A string, country that they live in."</span>
</span></span><span class="line"><span class="cl"> <span class="p">},</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"personal_statement"</span><span class="p">:</span> <span class="s2">"A string, free text personal statement"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"skills"</span><span class="p">:</span> <span class="p">[</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"A string: a skill the person has"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"A string: another still that the person has"</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>
We'll let Redis OM handle generation of unique IDs, which it does using
<a href="https://github.com/ulid/spec">
ULIDs
</a>
. Redis OM will also handle creation of unique Redis key names for us, as well as saving and retrieving entities from JSON documents stored in a Redis Stack database.
</p>
<h2 id="getting-started">
Getting Started
</h2>
<h3 id="requirements">
Requirements
</h3>
<p>
To run this application you'll need:
</p>
<ul>
<li>
<a href="https://git-scm.com/download">
git
</a>
- to clone the repo to your machine.
</li>
<li>
<a href="https://www.python.org/downloads/">
Python 3.9 or higher
</a>
.
</li>
<li>
A
<a href="https://redis.io">
Redis Stack
</a>
database, or Redis with the
<a href="/docs/latest/develop/interact/search-and-query/">
Search and Query
</a>
and
<a href="/docs/latest/develop/data-types/json/">
JSON
</a>
features installed. We've provided a
<code>
docker-compose.yml
</code>
for this. You can also
<a href="https://redis.com/try-free/?utm_source=redisio&utm_medium=referral&utm_campaign=2023-09-try_free&utm_content=cu-redis_cloud_users">
sign up for a free 30Mb database with Redis Cloud
</a>
- be sure to check the Redis Stack option when creating your cloud database.
</li>
<li>
<a href="https://curl.se/">
curl
</a>
, or
<a href="https://www.postman.com/">
Postman
</a>
- to send HTTP requests to the application. We'll provide examples using curl in this document.
</li>
<li>
Optional:
<a href="https://redis.com/redis-enterprise/redis-insight/">
Redis Insight
</a>
, a free data visualization and database management tool for Redis. When downloading Redis Insight, be sure to select version 2.x or use the version that comes with Redis Stack.
</li>
</ul>
<h3 id="get-the-source-code">
Get the Source Code
</h3>
<p>
Clone the repository from GitHub:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ git clone https://github.com/redis-developer/redis-om-python-flask-skeleton-app.git
</span></span><span class="line"><span class="cl">$ <span class="nb">cd</span> redis-om-python-flask-skeleton-app
</span></span></code></pre>
</div>
<h3 id="start-a-redis-stack-database-or-configure-your-redis-cloud-credentials">
Start a Redis Stack Database, or Configure your Redis Cloud Credentials
</h3>
<p>
Next, we'll get a Redis Stack database up and running. If you're using Docker:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ docker-compose up -d
</span></span><span class="line"><span class="cl">Creating network <span class="s2">"redis-om-python-flask-skeleton-app_default"</span> with the default driver
</span></span><span class="line"><span class="cl">Creating redis_om_python_flask_starter ... <span class="k">done</span>
</span></span></code></pre>
</div>
<p>
If you're using Redis Cloud, you'll need the hostname, port number, and password for your database. Use these to set the
<code>
REDIS_OM_URL
</code>
environment variable like this:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ <span class="nb">export</span> <span class="nv">REDIS_OM_URL</span><span class="o">=</span>redis://default:<password>@<host>:<port>
</span></span></code></pre>
</div>
<p>
(This step is not required when working with Docker as the Docker container runs Redis on
<code>
localhost
</code>
port
<code>
6379
</code>
with no password, which is the default connection that Redis OM uses.)
</p>
<p>
For example if your Redis Cloud database is at port
<code>
9139
</code>
on host
<code>
enterprise.redis.com
</code>
and your password is
<code>
5uper53cret
</code>
then you'd set
<code>
REDIS_OM_URL
</code>
as follows:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ <span class="nb">export</span> <span class="nv">REDIS_OM_URL</span><span class="o">=</span>redis://default:[email protected]:9139
</span></span></code></pre>
</div>
<h3 id="create-a-python-virtual-environment-and-install-the-dependencies">
Create a Python Virtual Environment and Install the Dependencies
</h3>
<p>
Create a Python virtual environment, and install the project dependencies which are
<a href="https://pypi.org/project/Flask/">
Flask
</a>
,
<a href="https://pypi.org/project/requests/">
Requests
</a>
(used only in the data loader script) and
<a href="https://pypi.org/project/redis-om/">
Redis OM
</a>
:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ python3 -m venv venv
</span></span><span class="line"><span class="cl">$ . ./venv/bin/activate
</span></span><span class="line"><span class="cl">$ pip install -r requirements.txt
</span></span></code></pre>
</div>
<h3 id="start-the-flask-application">
Start the Flask Application
</h3>
<p>
Let's start the Flask application in development mode, so that Flask will restart the server for you each time you save code changes in
<code>
app.py
</code>
:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ <span class="nb">export</span> <span class="nv">FLASK_ENV</span><span class="o">=</span>development
</span></span><span class="line"><span class="cl">$ flask run
</span></span></code></pre>
</div>
<p>
If all goes well, you should see output similar to this:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ flask run
</span></span><span class="line"><span class="cl"> * Environment: development
</span></span><span class="line"><span class="cl"> * Debug mode: on
</span></span><span class="line"><span class="cl"> * Running on http://127.0.0.1:5000/ <span class="o">(</span>Press CTRL+C to quit<span class="o">)</span>
</span></span><span class="line"><span class="cl"> * Restarting with stat
</span></span><span class="line"><span class="cl"> * Debugger is active!
</span></span><span class="line"><span class="cl"> * Debugger PIN: XXX-XXX-XXX
</span></span></code></pre>
</div>
<p>
You're now up and running, and ready to perform CRUD operations on data with Redis, Search and Query, JSON and Redis OM for Python! To make sure the server's running, point your browser at
<code>
http://127.0.0.1:5000/
</code>
, where you can expect to see the application's basic home page:
</p>
<p>
<img alt="screenshot" src="./images/python_server_running.png"/>
</p>
<h3 id="load-the-sample-data">
Load the Sample Data
</h3>
<p>
We've provided a small amount of sample data (it's in
<code>
data/people.json
</code>
. The Python script
<code>
dataloader.py
</code>
loads each person into Redis by posting the data to the application's create a new person endpoint. Run it like this:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ python dataloader.py
</span></span><span class="line"><span class="cl">Created person Robert McDonald with ID 01FX8RMR7NRS45PBT3XP9KNAZH
</span></span><span class="line"><span class="cl">Created person Kareem Khan with ID 01FX8RMR7T60ANQTS4P9NKPKX8
</span></span><span class="line"><span class="cl">Created person Fernando Ortega with ID 01FX8RMR7YB283BPZ88HAG066P
</span></span><span class="line"><span class="cl">Created person Noor Vasan with ID 01FX8RMR82D091TC37B45RCWY3
</span></span><span class="line"><span class="cl">Created person Dan Harris with ID 01FX8RMR8545RWW4DYCE5MSZA1
</span></span></code></pre>
</div>
<p>
Make sure to take a copy of the output of the data loader, as your IDs will differ from those used in the tutorial. To follow along, substitute your IDs for the ones shown above. e.g. whenever we are working with Kareem Khan, change
<code>
01FX8RMR7T60ANQTS4P9NKPKX8
</code>
for the ID that your data loader assigned to Kareem in your Redis database.
</p>
<h3 id="problems">
Problems?
</h3>
<p>
If the Flask server fails to start, take a look at its output. If you see log entries similar to this:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-py" data-lang="py"><span class="line"><span class="cl"><span class="k">raise</span> <span class="ne">ConnectionError</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_error_message</span><span class="p">(</span><span class="n">e</span><span class="p">))</span>
</span></span><span class="line"><span class="cl"><span class="n">redis</span><span class="o">.</span><span class="n">exceptions</span><span class="o">.</span><span class="n">ConnectionError</span><span class="p">:</span> <span class="n">Error</span> <span class="mi">61</span> <span class="n">connecting</span> <span class="n">to</span> <span class="n">localhost</span><span class="p">:</span><span class="mf">6379.</span> <span class="n">Connection</span> <span class="n">refused</span><span class="o">.</span>
</span></span></code></pre>
</div>
<p>
then you need to start the Redis Docker container if using Docker, or set the
<code>
REDIS_OM_URL
</code>
environment variable if using Redis Cloud.
</p>
<p>
If you've set the
<code>
REDIS_OM_URL
</code>
environment variable, and the code errors with something like this on startup:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-py" data-lang="py"><span class="line"><span class="cl"><span class="k">raise</span> <span class="ne">ConnectionError</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_error_message</span><span class="p">(</span><span class="n">e</span><span class="p">))</span>
</span></span><span class="line"><span class="cl"><span class="n">redis</span><span class="o">.</span><span class="n">exceptions</span><span class="o">.</span><span class="n">ConnectionError</span><span class="p">:</span> <span class="n">Error</span> <span class="mi">8</span> <span class="n">connecting</span> <span class="n">to</span> <span class="n">enterprise</span><span class="o">.</span><span class="n">redis</span><span class="o">.</span><span class="n">com</span><span class="p">:</span><span class="mf">9139.</span> <span class="n">nodename</span> <span class="n">nor</span> <span class="n">servname</span> <span class="n">provided</span><span class="p">,</span> <span class="ow">or</span> <span class="ow">not</span> <span class="n">known</span><span class="o">.</span>
</span></span></code></pre>
</div>
<p>
then you'll need to check that you used the correct hostname, port, password and format when setting
<code>
REDIS_OM_URL
</code>
.
</p>
<p>
If the data loader fails to post the sample data into the application, make sure that the Flask application is running
<strong>
before
</strong>
running the data loader.
</p>
<h2 id="create-read-update-and-delete-data">
Create, Read, Update and Delete Data
</h2>
<p>
Let's create and manipulate some instances of our data model in Redis. Here we'll look at how to call the Flask API with curl (you could also use Postman), how the code works, and how the data's stored in Redis.
</p>
<h3 id="building-a-person-model-with-redis-om">
Building a Person Model with Redis OM
</h3>
<p>
Redis OM allows us to model entities using Python classes, and the
<a href="https://pypi.org/project/pydantic/">
Pydantic
</a>
framework. Our person model is contained in the file
<code>
person.py
</code>
. Here's some notes about how it works:
</p>
<ul>
<li>
We declare a class
<code>
Person
</code>
which extends a Redis OM class
<code>
JsonModel
</code>
. This tells Redis OM that we want to store these entities in Redis as JSON documents.
</li>
<li>
We then declare each field in our model, specifying the data type and whether or not we want to index on that field. For example, here's the
<code>
age
</code>
field, which we've declared as a positive integer that we want to index on:
</li>
</ul>
<div class="highlight">
<pre class="chroma"><code class="language-py" data-lang="py"><span class="line"><span class="cl"><span class="n">age</span><span class="p">:</span> <span class="n">PositiveInt</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">index</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
</span></span></code></pre>
</div>
<ul>
<li>
The
<code>
skills
</code>
field is a list of strings, declared thus:
</li>
</ul>
<div class="highlight">
<pre class="chroma"><code class="language-py" data-lang="py"><span class="line"><span class="cl"><span class="n">skills</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">index</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
</span></span></code></pre>
</div>
<ul>
<li>
For the
<code>
personal_statement
</code>
field, we don't want to index on the field's value, as it's a free text sentence rather than a single word or digit. For this, we'll tell Redis OM that we want to be able to perform full text searches on the values:
</li>
</ul>
<div class="highlight">
<pre class="chroma"><code class="language-py" data-lang="py"><span class="line"><span class="cl"><span class="n">personal_statement</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">index</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">full_text_search</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
</span></span></code></pre>
</div>
<ul>
<li>
<code>
address
</code>
works differently from the other fields. Note that in our JSON representation of the model, address is an object rather than a string or numerical field. With Redis OM, this is modeled as a second class, which extends the Redis OM
<code>
EmbeddedJsonModel
</code>
class:
</li>
</ul>
<div class="highlight">
<pre class="chroma"><code class="language-py" data-lang="py"><span class="line"><span class="cl"><span class="k">class</span> <span class="nc">Address</span><span class="p">(</span><span class="n">EmbeddedJsonModel</span><span class="p">):</span>
</span></span><span class="line"><span class="cl"> <span class="c1"># field definitions...</span>
</span></span></code></pre>
</div>
<ul>
<li>
<p>
Fields in an
<code>
EmbeddedJsonModel
</code>
are defined in the same way, so our class contains a field definition for each data item in the address.
</p>
</li>
<li>
<p>
Not every field in our JSON is present in every address, Redis OM allows us to declare a field as optional so long as we don't index it:
</p>
</li>
</ul>
<div class="highlight">
<pre class="chroma"><code class="language-py" data-lang="py"><span class="line"><span class="cl"><span class="n">unit</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">index</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
</span></span></code></pre>
</div>
<ul>
<li>
We can also set a default value for a field... let's say country should be "United Kingdom" unless otherwise specified:
</li>
</ul>
<div class="highlight">
<pre class="chroma"><code class="language-py" data-lang="py"><span class="line"><span class="cl"><span class="n">country</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="n">Field</span><span class="p">(</span><span class="n">index</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="s2">"United Kingdom"</span><span class="p">)</span>
</span></span></code></pre>
</div>
<ul>
<li>
Finally, to add the embedded address object to our Person model, we declare a field of type
<code>
Address
</code>
in the Person class:
</li>
</ul>
<div class="highlight">
<pre class="chroma"><code class="language-py" data-lang="py"><span class="line"><span class="cl"><span class="n">address</span><span class="p">:</span> <span class="n">Address</span>
</span></span></code></pre>
</div>
<h3 id="adding-new-people">
Adding New People
</h3>
<p>
The function
<code>
create_person
</code>
in
<code>
app.py
</code>
handles the creation of a new person in Redis. It expects a JSON object that adheres to our Person model's schema. The code to then create a new Person object with that data and save it in Redis is simple:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-py" data-lang="py"><span class="line"><span class="cl"> <span class="n">new_person</span> <span class="o">=</span> <span class="n">Person</span><span class="p">(</span><span class="o">**</span><span class="n">request</span><span class="o">.</span><span class="n">json</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"> <span class="n">new_person</span><span class="o">.</span><span class="n">save</span><span class="p">()</span>
</span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="n">new_person</span><span class="o">.</span><span class="n">pk</span>
</span></span></code></pre>
</div>
<p>
When a new Person instance is created, Redis OM assigns it a unique ULID primary key, which we can access as
<code>
.pk
</code>
. We return that to the caller, so that they know the ID of the object they just created.
</p>
<p>
Persisting the object to Redis is then simply a matter of calling
<code>
.save()
</code>
on it.
</p>
<p>
Try it out... with the server running, add a new person using curl:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">curl --location --request POST <span class="s1">'http://127.0.0.1:5000/person/new'</span> <span class="se">\
</span></span></span><span class="line"><span class="cl"><span class="se"></span>--header <span class="s1">'Content-Type: application/json'</span> <span class="se">\
</span></span></span><span class="line"><span class="cl"><span class="se"></span>--data-raw <span class="s1">'{
</span></span></span><span class="line"><span class="cl"><span class="s1"> "first_name": "Joanne",
</span></span></span><span class="line"><span class="cl"><span class="s1"> "last_name": "Peel",
</span></span></span><span class="line"><span class="cl"><span class="s1"> "age": 36,
</span></span></span><span class="line"><span class="cl"><span class="s1"> "personal_statement": "Music is my life, I love gigging and playing with my band.",
</span></span></span><span class="line"><span class="cl"><span class="s1"> "address": {
</span></span></span><span class="line"><span class="cl"><span class="s1"> "street_number": 56,
</span></span></span><span class="line"><span class="cl"><span class="s1"> "unit": "4A",
</span></span></span><span class="line"><span class="cl"><span class="s1"> "street_name": "The Rushes",
</span></span></span><span class="line"><span class="cl"><span class="s1"> "city": "Birmingham",
</span></span></span><span class="line"><span class="cl"><span class="s1"> "state": "West Midlands",
</span></span></span><span class="line"><span class="cl"><span class="s1"> "postal_code": "B91 6HG",
</span></span></span><span class="line"><span class="cl"><span class="s1"> "country": "United Kingdom"
</span></span></span><span class="line"><span class="cl"><span class="s1"> },
</span></span></span><span class="line"><span class="cl"><span class="s1"> "skills": [
</span></span></span><span class="line"><span class="cl"><span class="s1"> "synths",
</span></span></span><span class="line"><span class="cl"><span class="s1"> "vocals",
</span></span></span><span class="line"><span class="cl"><span class="s1"> "guitar"
</span></span></span><span class="line"><span class="cl"><span class="s1"> ]
</span></span></span><span class="line"><span class="cl"><span class="s1">}'</span>
</span></span></code></pre>
</div>
<p>
Running the above curl command will return the unique ULID ID assigned to the newly created person. For example
<code>
01FX8SSSDN7PT9T3N0JZZA758G
</code>
.
</p>
<h3 id="examining-the-data-in-redis">
Examining the data in Redis
</h3>
<p>
Let's take a look at what we just saved in Redis. Using Redis Insight or redis-cli, connect to the database and look at the value stored at key
<code>
:person.Person:01FX8SSSDN7PT9T3N0JZZA758G
</code>
. This is stored as a JSON document in Redis, so if using redis-cli you'll need the following command:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ redis-cli
</span></span><span class="line"><span class="cl">127.0.0.1:6379> json.get :person.Person:01FX8SSSDN7PT9T3N0JZZA758G
</span></span></code></pre>
</div>
<p>
If you're using Redis Insight, the browser will render the key value for you when you click on the key name:
</p>
<p>
<img alt="Data in Redis Insight" src="./images/python_insight_explore_person.png"/>
</p>
<p>
When storing data as JSON in Redis, we can update and retrieve the whole document, or just parts of it. For example, to retrieve only the person's address and first skill, use the following command (Redis Insight users should use the built in redis-cli for this):
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ redis-cli
</span></span><span class="line"><span class="cl">127.0.0.1:6379> json.get :person.Person:01FX8SSSDN7PT9T3N0JZZA758G $.address $.skills<span class="o">[</span>0<span class="o">]</span>
</span></span><span class="line"><span class="cl"><span class="s2">"{\"</span>$<span class="s2">.skills[0]\":[\"synths\"],\"</span>$<span class="s2">.address\":[{\"pk\":\"01FX8SSSDNRDSRB3HMVH00NQTT\",\"street_number\":56,\"unit\":\"4A\",\"street_name\":\"The Rushes\",\"city\":\"Birmingham\",\"state\":\"West Midlands\",\"postal_code\":\"B91 6HG\",\"country\":\"United Kingdom\"}]}"</span>
</span></span></code></pre>
</div>
<p>
For more information on the JSON Path syntax used to query JSON documents in Redis, see the
<a href="/docs/latest/develop/data-types/json/path/#jsonpath-syntax">
documentation
</a>
.
</p>
<h3 id="find-a-person-by-id">
Find a Person by ID
</h3>
<p>
If we know a person's ID, we can retrieve their data. The function
<code>
find_by_id
</code>
in
<code>
app.py
</code>
receives an ID as its parameter, and asks Redis OM to retrieve and populate a Person object using the ID and the Person
<code>
.get
</code>
class method:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-py" data-lang="py"><span class="line"><span class="cl"> <span class="k">try</span><span class="p">:</span>
</span></span><span class="line"><span class="cl"> <span class="n">person</span> <span class="o">=</span> <span class="n">Person</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="nb">id</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="n">person</span><span class="o">.</span><span class="n">dict</span><span class="p">()</span>
</span></span><span class="line"><span class="cl"> <span class="k">except</span> <span class="n">NotFoundError</span><span class="p">:</span>
</span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="p">{}</span>
</span></span></code></pre>
</div>
<p>
The
<code>
.dict()
</code>
method converts our Person object to a Python dictionary that Flask then returns to the caller.
</p>
<p>
Note that if there is no Person with the supplied ID in Redis,
<code>
get
</code>
will throw a
<code>
NotFoundError
</code>
.
</p>
<p>
Try this out with curl, substituting
<code>
01FX8SSSDN7PT9T3N0JZZA758G
</code>
for the ID of a person that you just created in your database:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">curl --location --request GET <span class="s1">'http://localhost:5000/person/byid/01FX8SSSDN7PT9T3N0JZZA758G'</span>
</span></span></code></pre>
</div>
<p>
The server responds with a JSON object containing the user's data:
</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">"address"</span><span class="p">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"city"</span><span class="p">:</span> <span class="s2">"Birmingham"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"country"</span><span class="p">:</span> <span class="s2">"United Kingdom"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"pk"</span><span class="p">:</span> <span class="s2">"01FX8SSSDNRDSRB3HMVH00NQTT"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"postal_code"</span><span class="p">:</span> <span class="s2">"B91 6HG"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"state"</span><span class="p">:</span> <span class="s2">"West Midlands"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"street_name"</span><span class="p">:</span> <span class="s2">"The Rushes"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"street_number"</span><span class="p">:</span> <span class="mi">56</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"unit"</span><span class="p">:</span> <span class="kc">null</span>
</span></span><span class="line"><span class="cl"> <span class="p">},</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"age"</span><span class="p">:</span> <span class="mi">36</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"first_name"</span><span class="p">:</span> <span class="s2">"Joanne"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"last_name"</span><span class="p">:</span> <span class="s2">"Peel"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"personal_statement"</span><span class="p">:</span> <span class="s2">"Music is my life, I love gigging and playing with my band."</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"pk"</span><span class="p">:</span> <span class="s2">"01FX8SSSDN7PT9T3N0JZZA758G"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"skills"</span><span class="p">:</span> <span class="p">[</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"synths"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"vocals"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"guitar"</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>
<h3 id="find-people-with-matching-first-and-last-name">
Find People with Matching First and Last Name
</h3>
<p>
Let's find all the people who have a given first and last name... This is handled by the function
<code>
find_by_name
</code>
in
<code>
app.py
</code>
.
</p>
<p>
Here, we're using Person's
<code>
find
</code>
class method that's provided by Redis OM. We pass it a search query, specifying that we want to find people whose
<code>
first_name
</code>
field contains the value of the
<code>
first_name
</code>
parameter passed to
<code>
find_by_name
</code>
AND whose
<code>
last_name
</code>
field contains the value of the
<code>
last_name
</code>
parameter:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-py" data-lang="py"><span class="line"><span class="cl"> <span class="n">people</span> <span class="o">=</span> <span class="n">Person</span><span class="o">.</span><span class="n">find</span><span class="p">(</span>
</span></span><span class="line"><span class="cl"> <span class="p">(</span><span class="n">Person</span><span class="o">.</span><span class="n">first_name</span> <span class="o">==</span> <span class="n">first_name</span><span class="p">)</span> <span class="o">&</span>
</span></span><span class="line"><span class="cl"> <span class="p">(</span><span class="n">Person</span><span class="o">.</span><span class="n">last_name</span> <span class="o">==</span> <span class="n">last_name</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"> <span class="p">)</span><span class="o">.</span><span class="n">all</span><span class="p">()</span>
</span></span></code></pre>
</div>
<p>
<code>
.all()
</code>
tells Redis OM that we want to retrieve all matching people.
</p>
<p>
Try this out with curl as follows:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">curl --location --request GET <span class="s1">'http://127.0.0.1:5000/people/byname/Kareem/Khan'</span>
</span></span></code></pre>
</div>
<p>
<strong>
Note:
</strong>
First and last name are case sensitive.
</p>
<p>
The server responds with an object containing
<code>
results
</code>
, an array of matches:
</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">"results"</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">"address"</span><span class="p">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"city"</span><span class="p">:</span> <span class="s2">"Sheffield"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"country"</span><span class="p">:</span> <span class="s2">"United Kingdom"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"pk"</span><span class="p">:</span> <span class="s2">"01FX8RMR7THMGA84RH8ZRQRRP9"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"postal_code"</span><span class="p">:</span> <span class="s2">"S1 5RE"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"state"</span><span class="p">:</span> <span class="s2">"South Yorkshire"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"street_name"</span><span class="p">:</span> <span class="s2">"The Beltway"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"street_number"</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">"unit"</span><span class="p">:</span> <span class="s2">"A"</span>
</span></span><span class="line"><span class="cl"> <span class="p">},</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"age"</span><span class="p">:</span> <span class="mi">27</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"first_name"</span><span class="p">:</span> <span class="s2">"Kareem"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"last_name"</span><span class="p">:</span> <span class="s2">"Khan"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"personal_statement"</span><span class="p">:</span><span class="s2">"I'm Kareem, a multi-instrumentalist and singer looking to join a new rock band."</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"pk"</span><span class="p">:</span><span class="s2">"01FX8RMR7T60ANQTS4P9NKPKX8"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"skills"</span><span class="p">:</span> <span class="p">[</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"drums"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"guitar"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"synths"</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><span class="line"><span class="cl"><span class="p">}</span>
</span></span></code></pre>
</div>
<h3 id="find-people-within-a-given-age-range">
Find People within a Given Age Range
</h3>
<p>
It's useful to be able to find people that fall into a given age range... the function
<code>
find_in_age_range
</code>
in
<code>
app.py
</code>
handles this as follows...
</p>
<p>
We'll again use Person's
<code>
find
</code>
class method, this time passing it a minimum and maximum age, specifying that we want results where the
<code>
age
</code>
field is between those values only:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-py" data-lang="py"><span class="line"><span class="cl"> <span class="n">people</span> <span class="o">=</span> <span class="n">Person</span><span class="o">.</span><span class="n">find</span><span class="p">(</span>
</span></span><span class="line"><span class="cl"> <span class="p">(</span><span class="n">Person</span><span class="o">.</span><span class="n">age</span> <span class="o">>=</span> <span class="n">min_age</span><span class="p">)</span> <span class="o">&</span>
</span></span><span class="line"><span class="cl"> <span class="p">(</span><span class="n">Person</span><span class="o">.</span><span class="n">age</span> <span class="o"><=</span> <span class="n">max_age</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"> <span class="p">)</span><span class="o">.</span><span class="n">sort_by</span><span class="p">(</span><span class="s2">"age"</span><span class="p">)</span><span class="o">.</span><span class="n">all</span><span class="p">()</span>
</span></span></code></pre>
</div>
<p>
Note that we can also use
<code>
.sort_by
</code>
to specify which field we want our results sorted by.
</p>
<p>
Let's find everyone between 30 and 47 years old, sorted by age:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">curl --location --request GET <span class="s1">'http://127.0.0.1:5000/people/byage/30/47'</span>
</span></span></code></pre>
</div>
<p>
This returns a
<code>
results
</code>
object containing an array of matches:
</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">"results"</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">"address"</span><span class="p">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"city"</span><span class="p">:</span> <span class="s2">"Sheffield"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"country"</span><span class="p">:</span> <span class="s2">"United Kingdom"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"pk"</span><span class="p">:</span> <span class="s2">"01FX8RMR7NW221STN6NVRDPEDT"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"postal_code"</span><span class="p">:</span> <span class="s2">"S12 2MX"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"state"</span><span class="p">:</span> <span class="s2">"South Yorkshire"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"street_name"</span><span class="p">:</span> <span class="s2">"Main Street"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"street_number"</span><span class="p">:</span> <span class="mi">9</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"unit"</span><span class="p">:</span> <span class="kc">null</span>
</span></span><span class="line"><span class="cl"> <span class="p">},</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"age"</span><span class="p">:</span> <span class="mi">35</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"first_name"</span><span class="p">:</span> <span class="s2">"Robert"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"last_name"</span><span class="p">:</span> <span class="s2">"McDonald"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"personal_statement"</span><span class="p">:</span> <span class="s2">"My name is Robert, I love meeting new people and enjoy music, coding and walking my dog."</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"pk"</span><span class="p">:</span> <span class="s2">"01FX8RMR7NRS45PBT3XP9KNAZH"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"skills"</span><span class="p">:</span> <span class="p">[</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"guitar"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"piano"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"trombone"</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><span class="line"><span class="cl"> <span class="nt">"address"</span><span class="p">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"city"</span><span class="p">:</span> <span class="s2">"Birmingham"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"country"</span><span class="p">:</span> <span class="s2">"United Kingdom"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"pk"</span><span class="p">:</span> <span class="s2">"01FX8SSSDNRDSRB3HMVH00NQTT"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"postal_code"</span><span class="p">:</span> <span class="s2">"B91 6HG"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"state"</span><span class="p">:</span> <span class="s2">"West Midlands"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"street_name"</span><span class="p">:</span> <span class="s2">"The Rushes"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"street_number"</span><span class="p">:</span> <span class="mi">56</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"unit"</span><span class="p">:</span> <span class="kc">null</span>
</span></span><span class="line"><span class="cl"> <span class="p">},</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"age"</span><span class="p">:</span> <span class="mi">36</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"first_name"</span><span class="p">:</span> <span class="s2">"Joanne"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"last_name"</span><span class="p">:</span> <span class="s2">"Peel"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"personal_statement"</span><span class="p">:</span> <span class="s2">"Music is my life, I love gigging and playing with my band."</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"pk"</span><span class="p">:</span> <span class="s2">"01FX8SSSDN7PT9T3N0JZZA758G"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"skills"</span><span class="p">:</span> <span class="p">[</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"synths"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"vocals"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"guitar"</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><span class="line"><span class="cl"> <span class="nt">"address"</span><span class="p">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"city"</span><span class="p">:</span> <span class="s2">"Nottingham"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"country"</span><span class="p">:</span> <span class="s2">"United Kingdom"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"pk"</span><span class="p">:</span> <span class="s2">"01FX8RMR82DDJ90CW8D1GM68YZ"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"postal_code"</span><span class="p">:</span> <span class="s2">"NG1 1AA"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"state"</span><span class="p">:</span> <span class="s2">"Nottinghamshire"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"street_name"</span><span class="p">:</span> <span class="s2">"Broadway"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"street_number"</span><span class="p">:</span> <span class="mi">12</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"unit"</span><span class="p">:</span> <span class="s2">"A-1"</span>
</span></span><span class="line"><span class="cl"> <span class="p">},</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"age"</span><span class="p">:</span> <span class="mi">37</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"first_name"</span><span class="p">:</span> <span class="s2">"Noor"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"last_name"</span><span class="p">:</span> <span class="s2">"Vasan"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"personal_statement"</span><span class="p">:</span> <span class="s2">"I sing and play the guitar, I enjoy touring and meeting new people on the road."</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"pk"</span><span class="p">:</span> <span class="s2">"01FX8RMR82D091TC37B45RCWY3"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"skills"</span><span class="p">:</span> <span class="p">[</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"vocals"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"guitar"</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><span class="line"><span class="cl"> <span class="nt">"address"</span><span class="p">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"city"</span><span class="p">:</span> <span class="s2">"San Diego"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"country"</span><span class="p">:</span> <span class="s2">"United States"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"pk"</span><span class="p">:</span> <span class="s2">"01FX8RMR7YCDAVSWBMWCH2B07G"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"postal_code"</span><span class="p">:</span> <span class="s2">"92102"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"state"</span><span class="p">:</span> <span class="s2">"California"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"street_name"</span><span class="p">:</span> <span class="s2">"C Street"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"street_number"</span><span class="p">:</span> <span class="mi">1299</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"unit"</span><span class="p">:</span> <span class="kc">null</span>
</span></span><span class="line"><span class="cl"> <span class="p">},</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"age"</span><span class="p">:</span> <span class="mi">43</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"first_name"</span><span class="p">:</span> <span class="s2">"Fernando"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"last_name"</span><span class="p">:</span> <span class="s2">"Ortega"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"personal_statement"</span><span class="p">:</span> <span class="s2">"I'm in a really cool band that plays a lot of cover songs. I'm the drummer!"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"pk"</span><span class="p">:</span> <span class="s2">"01FX8RMR7YB283BPZ88HAG066P"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"skills"</span><span class="p">:</span> <span class="p">[</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"clarinet"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"oboe"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"drums"</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><span class="line"><span class="cl"><span class="p">}</span>
</span></span></code></pre>
</div>
<h3 id="find-people-in-a-given-city-with-a-specific-skill">
Find People in a Given City with a Specific Skill
</h3>
<p>
Now, we'll try a slightly different sort of query. We want to find all of the people that live in a given city AND who also have a certain skill. This requires a search over both the
<code>
city
</code>
field which is a string, and the
<code>
skills
</code>
field, which is an array of strings.
</p>
<p>
Essentially we want to say "Find me all the people whose city is
<code>
city
</code>
AND whose skills array CONTAINS
<code>
desired_skill
</code>
", where
<code>
city
</code>
and
<code>
desired_skill
</code>
are the parameters to the
<code>
find_matching_skill
</code>
function in
<code>
app.py
</code>
. Here's the code for that:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-py" data-lang="py"><span class="line"><span class="cl"> <span class="n">people</span> <span class="o">=</span> <span class="n">Person</span><span class="o">.</span><span class="n">find</span><span class="p">(</span>
</span></span><span class="line"><span class="cl"> <span class="p">(</span><span class="n">Person</span><span class="o">.</span><span class="n">skills</span> <span class="o"><<</span> <span class="n">desired_skill</span><span class="p">)</span> <span class="o">&</span>
</span></span><span class="line"><span class="cl"> <span class="p">(</span><span class="n">Person</span><span class="o">.</span><span class="n">address</span><span class="o">.</span><span class="n">city</span> <span class="o">==</span> <span class="n">city</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"> <span class="p">)</span><span class="o">.</span><span class="n">all</span><span class="p">()</span>
</span></span></code></pre>
</div>
<p>
The
<code>
<<
</code>
operator here is used to indicate "in" or "contains".
</p>
<p>
Let's find all the guitar players in Sheffield:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">curl --location --request GET <span class="s1">'http://127.0.0.1:5000/people/byskill/guitar/Sheffield'</span>
</span></span></code></pre>
</div>
<p>
<strong>
Note:
</strong>
<code>
Sheffield
</code>
is case sensitive.
</p>
<p>
The server returns a
<code>
results
</code>
array containing matching people:
</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">"results"</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">"address"</span><span class="p">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"city"</span><span class="p">:</span> <span class="s2">"Sheffield"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"country"</span><span class="p">:</span> <span class="s2">"United Kingdom"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"pk"</span><span class="p">:</span> <span class="s2">"01FX8RMR7THMGA84RH8ZRQRRP9"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"postal_code"</span><span class="p">:</span> <span class="s2">"S1 5RE"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"state"</span><span class="p">:</span> <span class="s2">"South Yorkshire"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"street_name"</span><span class="p">:</span> <span class="s2">"The Beltway"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"street_number"</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">"unit"</span><span class="p">:</span> <span class="s2">"A"</span>
</span></span><span class="line"><span class="cl"> <span class="p">},</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"age"</span><span class="p">:</span> <span class="mi">28</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"first_name"</span><span class="p">:</span> <span class="s2">"Kareem"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"last_name"</span><span class="p">:</span> <span class="s2">"Khan"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"personal_statement"</span><span class="p">:</span> <span class="s2">"I'm Kareem, a multi-instrumentalist and singer looking to join a new rock band."</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"pk"</span><span class="p">:</span> <span class="s2">"01FX8RMR7T60ANQTS4P9NKPKX8"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"skills"</span><span class="p">:</span> <span class="p">[</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"drums"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"guitar"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"synths"</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><span class="line"><span class="cl"> <span class="nt">"address"</span><span class="p">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"city"</span><span class="p">:</span> <span class="s2">"Sheffield"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"country"</span><span class="p">:</span> <span class="s2">"United Kingdom"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"pk"</span><span class="p">:</span> <span class="s2">"01FX8RMR7NW221STN6NVRDPEDT"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"postal_code"</span><span class="p">:</span> <span class="s2">"S12 2MX"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"state"</span><span class="p">:</span> <span class="s2">"South Yorkshire"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"street_name"</span><span class="p">:</span> <span class="s2">"Main Street"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"street_number"</span><span class="p">:</span> <span class="mi">9</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"unit"</span><span class="p">:</span> <span class="kc">null</span>
</span></span><span class="line"><span class="cl"> <span class="p">},</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"age"</span><span class="p">:</span> <span class="mi">35</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"first_name"</span><span class="p">:</span> <span class="s2">"Robert"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"last_name"</span><span class="p">:</span> <span class="s2">"McDonald"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"personal_statement"</span><span class="p">:</span> <span class="s2">"My name is Robert, I love meeting new people and enjoy music, coding and walking my dog."</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"pk"</span><span class="p">:</span> <span class="s2">"01FX8RMR7NRS45PBT3XP9KNAZH"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"skills"</span><span class="p">:</span> <span class="p">[</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"guitar"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"piano"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"trombone"</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><span class="line"><span class="cl"><span class="p">}</span>
</span></span></code></pre>
</div>
<h3 id="find-people-using-full-text-search-on-their-personal-statements">
Find People using Full Text Search on their Personal Statements
</h3>
<p>
Each person has a
<code>
personal_statement
</code>
field, which is a free text string containing a couple of sentences about them. We chose to index this in a way that makes it full text searchable, so let's see how to use this now. The code for this is in the function
<code>
find_matching_statements
</code>
in
<code>
app.py
</code>
.
</p>
<p>
To search for people who have the value of the parameter
<code>
search_term
</code>
in their
<code>
personal_statement
</code>
field, we use the
<code>
%
</code>
operator:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-py" data-lang="py"><span class="line"><span class="cl"> <span class="n">Person</span><span class="o">.</span><span class="n">find</span><span class="p">(</span><span class="n">Person</span><span class="o">.</span><span class="n">personal_statement</span> <span class="o">%</span> <span class="n">search_term</span><span class="p">)</span><span class="o">.</span><span class="n">all</span><span class="p">()</span>
</span></span></code></pre>
</div>
<p>
Let's find everyone who talks about "play" in their personal statement.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">curl --location --request GET <span class="s1">'http://127.0.0.1:5000/people/bystatement/play'</span>
</span></span></code></pre>
</div>
<p>
The server responds with a
<code>
results
</code>
array of matching people:
</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">"results"</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">"address"</span><span class="p">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"city"</span><span class="p">:</span> <span class="s2">"San Diego"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"country"</span><span class="p">:</span> <span class="s2">"United States"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"pk"</span><span class="p">:</span> <span class="s2">"01FX8RMR7YCDAVSWBMWCH2B07G"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"postal_code"</span><span class="p">:</span> <span class="s2">"92102"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"state"</span><span class="p">:</span> <span class="s2">"California"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"street_name"</span><span class="p">:</span> <span class="s2">"C Street"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"street_number"</span><span class="p">:</span> <span class="mi">1299</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"unit"</span><span class="p">:</span> <span class="kc">null</span>
</span></span><span class="line"><span class="cl"> <span class="p">},</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"age"</span><span class="p">:</span> <span class="mi">43</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"first_name"</span><span class="p">:</span> <span class="s2">"Fernando"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"last_name"</span><span class="p">:</span> <span class="s2">"Ortega"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"personal_statement"</span><span class="p">:</span> <span class="s2">"I'm in a really cool band that plays a lot of cover songs. I'm the drummer!"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"pk"</span><span class="p">:</span> <span class="s2">"01FX8RMR7YB283BPZ88HAG066P"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"skills"</span><span class="p">:</span> <span class="p">[</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"clarinet"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"oboe"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"drums"</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 class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"address"</span><span class="p">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"city"</span><span class="p">:</span> <span class="s2">"Nottingham"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"country"</span><span class="p">:</span> <span class="s2">"United Kingdom"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"pk"</span><span class="p">:</span> <span class="s2">"01FX8RMR82DDJ90CW8D1GM68YZ"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"postal_code"</span><span class="p">:</span> <span class="s2">"NG1 1AA"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"state"</span><span class="p">:</span> <span class="s2">"Nottinghamshire"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"street_name"</span><span class="p">:</span> <span class="s2">"Broadway"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"street_number"</span><span class="p">:</span> <span class="mi">12</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"unit"</span><span class="p">:</span> <span class="s2">"A-1"</span>
</span></span><span class="line"><span class="cl"> <span class="p">},</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"age"</span><span class="p">:</span> <span class="mi">37</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"first_name"</span><span class="p">:</span> <span class="s2">"Noor"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"last_name"</span><span class="p">:</span> <span class="s2">"Vasan"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"personal_statement"</span><span class="p">:</span> <span class="s2">"I sing and play the guitar, I enjoy touring and meeting new people on the road."</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"pk"</span><span class="p">:</span> <span class="s2">"01FX8RMR82D091TC37B45RCWY3"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"skills"</span><span class="p">:</span> <span class="p">[</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"vocals"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"guitar"</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><span class="line"><span class="cl"> <span class="nt">"address"</span><span class="p">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"city"</span><span class="p">:</span> <span class="s2">"Birmingham"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"country"</span><span class="p">:</span> <span class="s2">"United Kingdom"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"pk"</span><span class="p">:</span> <span class="s2">"01FX8SSSDNRDSRB3HMVH00NQTT"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"postal_code"</span><span class="p">:</span> <span class="s2">"B91 6HG"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"state"</span><span class="p">:</span> <span class="s2">"West Midlands"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"street_name"</span><span class="p">:</span> <span class="s2">"The Rushes"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"street_number"</span><span class="p">:</span> <span class="mi">56</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"unit"</span><span class="p">:</span> <span class="kc">null</span>
</span></span><span class="line"><span class="cl"> <span class="p">},</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"age"</span><span class="p">:</span> <span class="mi">36</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"first_name"</span><span class="p">:</span> <span class="s2">"Joanne"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"last_name"</span><span class="p">:</span> <span class="s2">"Peel"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"personal_statement"</span><span class="p">:</span> <span class="s2">"Music is my life, I love gigging and playing with my band."</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"pk"</span><span class="p">:</span> <span class="s2">"01FX8SSSDN7PT9T3N0JZZA758G"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"skills"</span><span class="p">:</span> <span class="p">[</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"synths"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"vocals"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"guitar"</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><span class="line"><span class="cl"><span class="p">}</span>
</span></span></code></pre>
</div>
<p>
Note that we get results including matches for "play", "plays" and "playing".
</p>
<h3 id="update-a-persons-age">
Update a Person's Age
</h3>
<p>
As well as retrieving information from Redis, we'll also want to update a Person's data from time to time. Let's see how to do that with Redis OM for Python.
</p>
<p>
The function
<code>
update_age
</code>
in
<code>
app.py
</code>
accepts two parameters:
<code>
id
</code>
and
<code>
new_age
</code>
. Using these, we first retrieve the person's data from Redis and create a new object with it:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-py" data-lang="py"><span class="line"><span class="cl"> <span class="k">try</span><span class="p">:</span>
</span></span><span class="line"><span class="cl"> <span class="n">person</span> <span class="o">=</span> <span class="n">Person</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="nb">id</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="k">except</span> <span class="n">NotFoundError</span><span class="p">:</span>
</span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="s2">"Bad request"</span><span class="p">,</span> <span class="mi">400</span>
</span></span></code></pre>
</div>
<p>
Assuming we find the person, let's update their age and save the data back to Redis:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-py" data-lang="py"><span class="line"><span class="cl"> <span class="n">person</span><span class="o">.</span><span class="n">age</span> <span class="o">=</span> <span class="n">new_age</span>
</span></span><span class="line"><span class="cl"> <span class="n">person</span><span class="o">.</span><span class="n">save</span><span class="p">()</span>
</span></span></code></pre>
</div>
<p>
Let's change Kareem Khan's age from 27 to 28:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">curl --location --request POST <span class="s1">'http://127.0.0.1:5000/person/01FX8RMR7T60ANQTS4P9NKPKX8/age/28'</span>
</span></span></code></pre>
</div>
<p>
The server responds with
<code>
ok
</code>
.
</p>
<h3 id="delete-a-person">
Delete a Person
</h3>
<p>
If we know a person's ID, we can delete them from Redis without first having to load their data into a Person object. In the function
<code>
delete_person
</code>
in
<code>
app.py
</code>
, we call the
<code>
delete
</code>
class method on the Person class to do this:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-py" data-lang="py"><span class="line"><span class="cl"> <span class="n">Person</span><span class="o">.</span><span class="n">delete</span><span class="p">(</span><span class="nb">id</span><span class="p">)</span>
</span></span></code></pre>
</div>
<p>
Let's delete Dan Harris, the person with ID
<code>
01FX8RMR8545RWW4DYCE5MSZA1
</code>
:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">curl --location --request POST <span class="s1">'http://127.0.0.1:5000/person/01FX8RMR8545RWW4DYCE5MSZA1/delete'</span>
</span></span></code></pre>
</div>
<p>
The server responds with an
<code>
ok
</code>
response regardless of whether the ID provided existed in Redis.
</p>
<h3 id="setting-an-expiry-time-for-a-person">
Setting an Expiry Time for a Person
</h3>
<p>
This is an example of how to run arbitrary Redis commands against instances of a model saved in Redis. Let's see how we can set the time to live (TTL) on a person, so that Redis will expire the JSON document after a configurable number of seconds have passed.
</p>
<p>
The function
<code>
expire_by_id
</code>
in
<code>
app.py
</code>
handles this as follows. It takes two parameters:
<code>
id
</code>
- the ID of a person to expire, and
<code>
seconds
</code>
- the number of seconds in the future to expire the person after. This requires us to run the Redis
<a href="/docs/latest/commands/expire/">
<code>
EXPIRE
</code>
</a>
command against the person's key. To do this, we need to access the Redis connection from the
<code>
Person
</code>
model like so:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-py" data-lang="py"><span class="line"><span class="cl"> <span class="n">person_to_expire</span> <span class="o">=</span> <span class="n">Person</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="nb">id</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"> <span class="n">Person</span><span class="o">.</span><span class="n">db</span><span class="p">()</span><span class="o">.</span><span class="n">expire</span><span class="p">(</span><span class="n">person_to_expire</span><span class="o">.</span><span class="n">key</span><span class="p">(),</span> <span class="n">seconds</span><span class="p">)</span>
</span></span></code></pre>
</div>
<p>
Let's set the person with ID
<code>
01FX8RMR82D091TC37B45RCWY3
</code>
to expire in 600 seconds:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">curl --location --request POST <span class="s1">'http://localhost:5000/person/01FX8RMR82D091TC37B45RCWY3/expire/600'</span>
</span></span></code></pre>
</div>
<p>
Using
<code>
redis-cli
</code>
, you can check that the person now has a TTL set with the Redis
<code>
expire
</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> ttl :person.Person:01FX8RMR82D091TC37B45RCWY3
</span></span><span class="line"><span class="cl"><span class="o">(</span>integer<span class="o">)</span> <span class="m">584</span>
</span></span></code></pre>
</div>
<p>
This shows that Redis will expire the key 584 seconds from now.
</p>
<p>
You can use the
<code>
.db()
</code>
function on your model class to get at the underlying redis-py connection whenever you want to run lower level Redis commands. For more details, see the
<a href="https://redis-py.readthedocs.io/en/stable/">
redis-py documentation
</a>
.
</p>
<h2 id="shutting-down-redis-docker">
Shutting Down Redis (Docker)
</h2>
<p>
If you're using Docker, and want to shut down the Redis container when you are finished with the application, use
<code>
docker-compose down
</code>
:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ docker-compose down
</span></span><span class="line"><span class="cl">Stopping redis_om_python_flask_starter ... <span class="k">done</span>
</span></span><span class="line"><span class="cl">Removing redis_om_python_flask_starter ... <span class="k">done</span>
</span></span><span class="line"><span class="cl">Removing network redis-om-python-flask-skeleton-app_default
</span></span></code></pre>
</div>
<nav>
</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/redisom-for-python/"/>
<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/json/active-active/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Store JSON in Active-Active databases
</h1>
<p class="text-lg -mt-5 mb-10">
JSON support and conflict resolution rules for Active-Active databases.
</p>
<p>
RedisJSON v2.2 adds support for JSON in
<a href="/docs/latest/operate/rs/databases/active-active/">
Active-Active Redis Enterprise databases
</a>
.
</p>
<p>
The design is based on
<a href="https://arxiv.org/abs/1608.03960">
A Conflict-Free Replicated JSON Datatype
</a>
by Kleppmann and Beresford, but the implementation includes some changes. Several
<a href="#conflict-resolution-rules">
conflict resolution rule
</a>
examples were adapted from this paper as well.
</p>
<h2 id="create-an-active-active-json-database">
Create an Active-Active JSON database
</h2>
<p>
To use JSON in an Active-Active database, you must enable JSON during database creation.
</p>
<p>
Active-Active Redis Cloud databases add JSON by default. See
<a href="/docs/latest/operate/rc/databases/create-database/create-active-active-database/#select-capabilities">
Create an Active-Active database
</a>
in the Redis Cloud documentation for details.
</p>
<p>
In Redis Enterprise Software, JSON is not enabled by default for Active-Active databases. To create an Active-Active JSON database in Redis Enterprise Software:
</p>
<ol>
<li>
<p>
See
<a href="/docs/latest/operate/rs/databases/active-active/create/">
Create an Active-Active geo-replicated database
</a>
in the Redis Enterprise Software documentation for prerequisites and detailed steps.
</p>
</li>
<li>
<p>
In the
<strong>
Capabilities
</strong>
section of the
<strong>
Create Active-Active database
</strong>
screen, select
<strong>
JSON
</strong>
:
</p>
<a href="/docs/latest/images/rs/screenshots/databases/active-active-databases/create-a-a-db-json-search.png" sdata-lightbox="/images/rs/screenshots/databases/active-active-databases/create-a-a-db-json-search.png">
<img alt="Select JSON from the Capabilities section." src="/docs/latest/images/rs/screenshots/databases/active-active-databases/create-a-a-db-json-search.png"/>
</a>
<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 you select
<strong>
JSON
</strong>
,
<strong>
Search and Query
</strong>
is also selected by default to allow you to index and query JSON documents. If you do not want to use these additional features, you can clear the
<strong>
Search and Query
</strong>
check box.
</div>
</div>
</li>
<li>
<p>
Configure additional database settings.
</p>
</li>
<li>
<p>
Select
<strong>
Create
</strong>
.
</p>
</li>
</ol>
<h2 id="command-differences">
Command differences
</h2>
<p>
Some JSON commands work differently for Active-Active databases.
</p>
<h3 id="jsonclear">
<code>
JSON.CLEAR
</code>
</h3>
<p>
<a href="/docs/latest/commands/json.clear">
<code>
JSON.CLEAR
</code>
</a>
resets JSON arrays and objects. It supports concurrent updates to JSON documents from different instances in an Active-Active database and allows the results to be merged.
</p>
<h2 id="conflict-resolution-rules">
Conflict resolution rules
</h2>
<p>
With Active-Active databases, it's possible for two different instances to try to run write operations on the same data at the same time. If this happens, conflicts can arise when the replicas attempt to sync these changes with each other. Conflict resolution rules determine how the database handles conflicting operations.
</p>
<p>
There are two types of conflict resolution:
</p>
<ol>
<li>
<p>
Merge:
</p>
<ul>
<li>
<p>
The operations are associative.
</p>
</li>
<li>
<p>
Merges the results of both operations.
</p>
</li>
</ul>
</li>
<li>
<p>
Win over:
</p>
<ul>
<li>
<p>
The operations are not associative.
</p>
</li>
<li>
<p>
One operation wins the conflict and sets the value.
</p>
</li>
<li>
<p>
Ignores the losing operation.
</p>
</li>
</ul>
</li>
</ol>
<p>
The following conflict resolution rules show how Active-Active databases resolve conflicts for various JSON commands.
</p>
<h3 id="assign-different-types-to-a-key">
Assign different types to a key
</h3>
<p>
<strong>
Conflict
</strong>
</p>
<p>
Two instances concurrently assign values of different types to the same key within a JSON document.
</p>
<p>
For example:
</p>
<p>
Instance 1 assigns an object to a key within a JSON document.
</p>
<p>
Instance 2 assigns an array to the same key.
</p>
<p>
<strong>
Resolution type
</strong>
</p>
<p>
Win over
</p>
<p>
<strong>
Resolution rule
</strong>
</p>
<p>
The instance with the smaller ID wins, so the key becomes an object in the given example.
</p>
<p>
<strong>
Example
</strong>
</p>
<table>
<thead>
<tr>
<th style="text-align:center">
Time
</th>
<th style="text-align:left">
Description
</th>
<th style="text-align:left">
Instance 1
</th>
<th style="text-align:left">
Instance 2
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center">
t1
</td>
<td style="text-align:left">
Set the same key to an object or an array
</td>
<td style="text-align:left">
JSON.SET doc $.a '{}'
</td>
<td style="text-align:left">
JSON.SET doc $.a '[]'
</td>
</tr>
<tr>
<td style="text-align:center">
t2
</td>
<td style="text-align:left">
Add data to the object and array
</td>
<td style="text-align:left">
<nobr>
JSON.SET doc $.a.x 'βyβ'
</nobr>
<br/>
<br/>
Result:
<br/>
{"a": {"x": "y"}}
</td>
<td style="text-align:left">
<nobr>
JSON.SET doc $.a '["z"]'
</nobr>
<br/>
<br/>
Result:
<br/>
{βaβ: ["z"]}
</td>
</tr>
<tr>
<td style="text-align:center">
t3
</td>
<td style="text-align:left">
Active-Active synchronization
</td>
<td style="text-align:left">
β Sync β
</td>
<td style="text-align:left">
β Sync β
</td>
</tr>
<tr>
<td style="text-align:center">
t4
</td>
<td style="text-align:left">
Instance 1 wins
</td>
<td style="text-align:left">
JSON.GET doc $
<br/>
<br/>
Result:
<br/>
{"a": {"x": "y"}}
</td>
<td style="text-align:left">
JSON.GET doc $
<br/>
<br/>
Result:
<br/>
{"a": {"x": "y"}}
</td>
</tr>
</tbody>
</table>
<h3 id="create-versus-create">
Create versus create
</h3>
<p>
<strong>
Conflict
</strong>
</p>
<p>
Two instances concurrently use
<code>
JSON.SET
</code>
to assign a new JSON document to the same key.
</p>
<p>
<strong>
Resolution type
</strong>
</p>
<p>
Win over
</p>
<p>
<strong>
Resolution rule
</strong>
</p>
<p>
The instance with the smaller ID wins.
</p>
<p>
<strong>
Example
</strong>
</p>
<table>
<thead>
<tr>
<th style="text-align:center">
Time
</th>
<th style="text-align:left">
Description
</th>
<th style="text-align:left">
Instance 1
</th>
<th style="text-align:left">
Instance 2
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center">
t1
</td>
<td style="text-align:left">
Create a new JSON document
</td>
<td style="text-align:left">
<nobr>
JSON.SET doc $ '{"field": "a"}'
</nobr>
</td>
<td style="text-align:left">
<nobr>
JSON.SET doc $ '{"field": "b"}'
</nobr>
</td>
</tr>
<tr>
<td style="text-align:center">
t2
</td>
<td style="text-align:left">
Active-Active synchronization
</td>
<td style="text-align:left">
β Sync β
</td>
<td style="text-align:left">
β Sync β
</td>
</tr>
<tr>
<td style="text-align:center">
t3
</td>
<td style="text-align:left">
Instance 1 wins
</td>
<td style="text-align:left">
JSON.GET doc $
<br/>
<br/>
Result:
<br/>
{"field": "a"}
</td>
<td style="text-align:left">
JSON.GET doc $
<br/>
<br/>
Result:
<br/>
{"field": "a"}
</td>
</tr>
</tbody>
</table>
<h3 id="create-versus-update">
Create versus update
</h3>
<p>
<strong>
Conflict
</strong>
</p>
<p>
Instance 1 creates a new document and assigns it to an existing key with
<code>
JSON.SET
</code>
.
</p>
<p>
Instance 2 updates the existing content of the same key with
<code>
JSON.SET
</code>
.
</p>
<p>
<strong>
Resolution type
</strong>
</p>
<p>
Win over
</p>
<p>
<strong>
Resolution rule
</strong>
</p>
<p>
The operation that creates a new document wins.
</p>
<p>
<strong>
Example
</strong>
</p>
<table>
<thead>
<tr>
<th style="text-align:center">
Time
</th>
<th style="text-align:left">
Description
</th>
<th style="text-align:left">
Instance 1
</th>
<th style="text-align:left">
Instance 2
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center">
t1
</td>
<td style="text-align:left">
The document exists on both instances
</td>
<td style="text-align:left">
JSON.GET doc $
<br/>
<br/>
Result:
<br/>
{"field1": "value1"}
</td>
<td style="text-align:left">
JSON.GET doc $
<br/>
<br/>
Result:
<br/>
{"field1": "value1"}
</td>
</tr>
<tr>
<td style="text-align:center">
t2
</td>
<td style="text-align:left">
Instance 1 creates a new document; instance 2 updates the existing document
</td>
<td style="text-align:left">
<nobr>
JSON.SET doc $ '{"field2": "value2"}'
</nobr>
</td>
<td style="text-align:left">
<nobr>
JSON.SET doc $.field1 '[1, 2, 3]'
</nobr>
</td>
</tr>
<tr>
<td style="text-align:center">
t3
</td>
<td style="text-align:left">
Active-Active synchronization
</td>
<td style="text-align:left">
β Sync β
</td>
<td style="text-align:left">
β Sync β
</td>
</tr>
<tr>
<td style="text-align:center">
t4
</td>
<td style="text-align:left">
Instance 1 wins
</td>
<td style="text-align:left">
JSON.GET doc .
<br/>
<br/>
Result:
<br/>
{"field2": "value2"}
</td>
<td style="text-align:left">
JSON.GET doc .
<br/>
<br/>
Result:
<br/>
{"field2": "value2"}
</td>
</tr>
</tbody>
</table>
<h3 id="delete-versus-create">
Delete versus create
</h3>
<p>
<strong>
Conflict
</strong>
</p>
<p>
Instance 1 deletes a JSON document with
<code>
JSON.DEL
</code>
.
</p>
<p>
Instance 2 uses
<code>
JSON.SET
</code>
to create a new JSON document and assign it to the key deleted by instance 1.
</p>
<p>
<strong>
Resolution type
</strong>
</p>
<p>
Win over
</p>
<p>
<strong>
Resolution rule
</strong>
</p>
<p>
Document creation wins over deletion.
</p>
<p>
<strong>
Example
</strong>
</p>
<table>
<thead>
<tr>
<th style="text-align:center">
Time
</th>
<th style="text-align:left">
Description
</th>
<th style="text-align:left">
Instance 1
</th>
<th style="text-align:left">
Instance 2
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center">
t1
</td>
<td style="text-align:left">
The document exists on both instances
</td>
<td style="text-align:left">
JSON.GET doc $
<br/>
<br/>
Result:
<br/>
{"field1": "value1"}
</td>
<td style="text-align:left">
JSON.GET doc $
<br/>
<br/>
Result:
<br/>
{"field1": "value1"}
</td>
</tr>
<tr>
<td style="text-align:center">
t2
</td>
<td style="text-align:left">
Instance 1 deletes the document; instance 2 creates a new document
</td>
<td style="text-align:left">
JSON.DEL doc
</td>
<td style="text-align:left">
<nobr>
JSON.SET doc $ '{"field1": "value2"}'
</nobr>
</td>
</tr>
<tr>
<td style="text-align:center">
t3
</td>
<td style="text-align:left">
Active-Active synchronization
</td>
<td style="text-align:left">
β Sync β
</td>
<td style="text-align:left">
β Sync β
</td>
</tr>
<tr>
<td style="text-align:center">
t4
</td>
<td style="text-align:left">
Instance 2 wins
</td>
<td style="text-align:left">
JSON.GET doc $
<br/>
<br/>
Result:
<br/>
<nobr>
{"field1": "value2"}
</nobr>
</td>
<td style="text-align:left">
JSON.GET doc $
<br/>
<br/>
Result:
<br/>
{"field1": "value2"}
</td>
</tr>
</tbody>
</table>
<h3 id="delete-versus-update">
Delete versus update
</h3>
<p>
<strong>
Conflict
</strong>
</p>
<p>
Instance 1 deletes a JSON document with
<code>
JSON.DEL
</code>
.
</p>
<p>
Instance 2 updates the content of the same document with
<code>
JSON.SET
</code>
.
</p>
<p>
<strong>
Resolution type
</strong>
</p>
<p>
Win over
</p>
<p>
<strong>
Resolution rule
</strong>
</p>
<p>
Document deletion wins over updates.
</p>
<p>
<strong>
Example
</strong>
</p>
<table>
<thead>
<tr>
<th style="text-align:center">
Time
</th>
<th style="text-align:left">
Description
</th>
<th style="text-align:left">
Instance 1
</th>
<th style="text-align:left">
Instance 2
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center">
t1
</td>
<td style="text-align:left">
The document exists on both instances
</td>
<td style="text-align:left">
JSON.GET doc $
<br/>
<br/>
Result:
<br/>
<nobr>
{"field1": "value1"}
</nobr>
</td>
<td style="text-align:left">
JSON.GET doc $
<br/>
<br/>
Result:
<br/>
{"field1": "value1"}
</td>
</tr>
<tr>
<td style="text-align:center">
t2
</td>
<td style="text-align:left">
Instance 1 deletes the document; instance 2 updates it
</td>
<td style="text-align:left">
JSON.DEL doc
</td>
<td style="text-align:left">
<nobr>
JSON.SET doc $.field1 '[1, 2, 3]'
</nobr>
</td>
</tr>
<tr>
<td style="text-align:center">
t3
</td>
<td style="text-align:left">
Active-Active synchronization
</td>
<td style="text-align:left">
β Sync β
</td>
<td style="text-align:left">
β Sync β
</td>
</tr>
<tr>
<td style="text-align:center">
t4
</td>
<td style="text-align:left">
Instance 1 wins
</td>
<td style="text-align:left">
JSON.GET doc $
<br/>
<br/>
Result:
<br/>
(nil)
</td>
<td style="text-align:left">
JSON.GET doc $
<br/>
<br/>
Result:
<br/>
(nil)
</td>
</tr>
</tbody>
</table>
<h3 id="update-versus-update">
Update versus update
</h3>
<p>
<strong>
Conflict
</strong>
</p>
<p>
Instance 1 updates a field inside a JSON document with
<code>
JSON.SET
</code>
.
</p>
<p>
Instance 2 updates the same field with a different value.
</p>
<p>
<strong>
Resolution type
</strong>
</p>
<p>
Win over
</p>
<p>
<strong>
Resolution rule
</strong>
</p>
<p>
The instance with the smallest ID wins.
</p>
<p>
<strong>
Example
</strong>
</p>
<table>
<thead>
<tr>
<th style="text-align:center">
Time
</th>
<th style="text-align:left">
Description
</th>
<th style="text-align:left">
Instance 1
</th>
<th style="text-align:left">
Instance 2
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center">
t1
</td>
<td style="text-align:left">
The document exists on both instances
</td>
<td style="text-align:left">
JSON.GET doc $
<br/>
<br/>
Result:
<br/>
{"field": "a"}
</td>
<td style="text-align:left">
JSON.GET doc $
<br/>
<br/>
Result:
<br/>
{"field": "a"}
</td>
</tr>
<tr>
<td style="text-align:center">
t2
</td>
<td style="text-align:left">
Update the same field with different data
</td>
<td style="text-align:left">
<nobr>
JSON.SET doc $.field "b"
</nobr>
</td>
<td style="text-align:left">
<nobr>
JSON.SET doc $.field "c"
</nobr>
</td>
</tr>
<tr>
<td style="text-align:center">
t3
</td>
<td style="text-align:left">
Active-Active synchronization
</td>
<td style="text-align:left">
β Sync β
</td>
<td style="text-align:left">
β Sync β
</td>
</tr>
<tr>
<td style="text-align:center">
t4
</td>
<td style="text-align:left">
Instance 1 wins
</td>
<td style="text-align:left">
JSON.GET doc $
<br/>
<br/>
Result:
<br/>
{"field": "b"}
</td>
<td style="text-align:left">
JSON.GET doc $
<br/>
<br/>
Result:
<br/>
{"field": "b"}
</td>
</tr>
</tbody>
</table>
<h3 id="update-versus-clear">
Update versus clear
</h3>
<p>
The version of RedisJSON prior to v2.2 has two different ways to reset the content of a JSON object:
</p>
<ul>
<li>
<p>
Assign a new empty JSON object:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">JSON.SET doc $.colors <span class="s1">'{}'</span>
</span></span></code></pre>
</div>
<p>
If you use this method, it cannot be merged with a concurrent update.
</p>
</li>
<li>
<p>
For each key, remove it with
<code>
JSON.DEL
</code>
:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">JSON.DEL doc $.colors.blue
</span></span></code></pre>
</div>
<p>
With this method, it can merge the reset with concurrent updates.
</p>
</li>
</ul>
<p>
As of RedisJSON v2.2, you can use the
<code>
JSON.CLEAR
</code>
command to reset the JSON document without removing each key manually. This method also lets concurrent updates be merged.
</p>
<h4 id="assign-an-empty-object">
Assign an empty object
</h4>
<p>
<strong>
Conflict
</strong>
</p>
<p>
Instance 1 adds "red" to the existing "colors" object with
<code>
JSON.SET
</code>
.
</p>
<p>
Instance 2 assigns a new empty object for "colors".
</p>
<p>
<strong>
Resolution type
</strong>
</p>
<p>
Win over
</p>
<p>
<strong>
Resolution rule
</strong>
</p>
<p>
Document creation wins over the update, so the result will be an empty object.
</p>
<p>
<strong>
Example
</strong>
</p>
<table>
<thead>
<tr>
<th style="text-align:center">
Time
</th>
<th style="text-align:left">
Description
</th>
<th style="text-align:left">
Instance 1
</th>
<th style="text-align:left">
Instance 2
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center">
t1
</td>
<td style="text-align:left">
The document exists on both instances
</td>
<td style="text-align:left">
JSON.GET doc $
<br/>
<br/>
Result:
<br/>
{"colors": {"blue": "#0000ff"}}
</td>
<td style="text-align:left">
JSON.GET doc $
<br/>
<br/>
Result:
<br/>
{"colors": {"blue": "#0000ff"}}
</td>
</tr>
<tr>
<td style="text-align:center">
t2
</td>
<td style="text-align:left">
Instance 1 adds a new color; instance 2 resets colors to an empty object
</td>
<td style="text-align:left">
<nobr>
JSON.SET doc $.colors.red β#ff0000β
</nobr>
</td>
<td style="text-align:left">
JSON.SET doc $.colors β{}β
</td>
</tr>
<tr>
<td style="text-align:center">
t3
</td>
<td style="text-align:left">
Instance 2 adds a new color
</td>
<td style="text-align:left">
</td>
<td style="text-align:left">
<nobr>
JSON.SET doc $.colors.green β#00ff00β
</nobr>
</td>
</tr>
<tr>
<td style="text-align:center">
t4
</td>
<td style="text-align:left">
</td>
<td style="text-align:left">
JSON.GET doc $
<br/>
<br/>
Result:
<br/>
{"colors": {"blue": "#0000ff", "red": "#ff0000"}}
</td>
<td style="text-align:left">
JSON.GET doc $
<br/>
<br/>
Result:
<br/>
{"colors": {"green": "#00ff00"}}
</td>
</tr>
<tr>
<td style="text-align:center">
t5
</td>
<td style="text-align:left">
Active-Active synchronization
</td>
<td style="text-align:left">
β Sync β
</td>
<td style="text-align:left">
β Sync β
</td>
</tr>
<tr>
<td style="text-align:center">
t6
</td>
<td style="text-align:left">
Instance 2 wins
</td>
<td style="text-align:left">
JSON.GET doc $
<br/>
<br/>
Result:
<br/>
{"colors": {"green": "#00ff00"}}
</td>
<td style="text-align:left">
JSON.GET doc $
<br/>
<br/>
Result:
<br/>
{"colors": {"green": "#00ff00"}}
</td>
</tr>
</tbody>
</table>
<h4 id="use-jsonclear">
Use
<code>
JSON.CLEAR
</code>
</h4>
<p>
<strong>
Conflict
</strong>
</p>
<p>
Instance 1 adds "red" to the existing "colors" object with
<code>
JSON.SET
</code>
.
</p>
<p>
Instance 2 clears the "colors" object with
<code>
JSON.CLEAR
</code>
and adds "green" to "colors".
</p>
<p>
<strong>
Resolution type
</strong>
</p>
<p>
Merge
</p>
<p>
<strong>
Resolution rule
</strong>
</p>
<p>
Merges the results of all operations.
</p>
<p>
<strong>
Example
</strong>
</p>
<table>
<thead>
<tr>
<th style="text-align:center">
Time
</th>
<th style="text-align:left">
Description
</th>
<th style="text-align:left">
Instance 1
</th>
<th style="text-align:left">
Instance 2
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center">
t1
</td>
<td style="text-align:left">
The document exists on both instances
</td>
<td style="text-align:left">
JSON.GET doc $
<br/>
<br/>
Result:
<br/>
{"colors": {"blue": "#0000ff"}}
</td>
<td style="text-align:left">
JSON.GET doc $
<br/>
<br/>
Result:
<br/>
{"colors": {"blue": "#0000ff"}}
</td>
</tr>
<tr>
<td style="text-align:center">
t2
</td>
<td style="text-align:left">
Instance 1 adds a new color; instance 2 resets the colors
</td>
<td style="text-align:left">
<nobr>
JSON.SET doc $.colors.red β#ff0000β
</nobr>
</td>
<td style="text-align:left">
JSON.CLEAR doc $.colors
</td>
</tr>
<tr>
<td style="text-align:center">
t3
</td>
<td style="text-align:left">
</td>
<td style="text-align:left">
JSON.GET doc $
<br/>
<br/>
Result:
<br/>
{"colors": {"blue": "#0000ff", "red": "#ff0000"}}
</td>
<td style="text-align:left">
JSON.GET doc $
<br/>
<br/>
Result:
<br/>
{"colors": {}}
</td>
</tr>
<tr>
<td style="text-align:center">
t4
</td>
<td style="text-align:left">
Instance 2 adds a new color
</td>
<td style="text-align:left">
</td>
<td style="text-align:left">
<nobr>
JSON.SET doc $.colors.green β#00ff00β
</nobr>
</td>
</tr>
<tr>
<td style="text-align:center">
t5
</td>
<td style="text-align:left">
</td>
<td style="text-align:left">
</td>
<td style="text-align:left">
JSON.GET doc $
<br/>
<br/>
Result:
<br/>
{"colors": {"green": "#00ff00"}}
</td>
</tr>
<tr>
<td style="text-align:center">
t6
</td>
<td style="text-align:left">
Active-Active synchronization
</td>
<td style="text-align:left">
β Sync β
</td>
<td style="text-align:left">
β Sync β
</td>
</tr>
<tr>
<td style="text-align:center">
t7
</td>
<td style="text-align:left">
Merges the results of both instances
</td>
<td style="text-align:left">
JSON.GET doc $
<br/>
<br/>
Result:
<br/>
{"colors": {"red": "#ff0000", "green": "#00ff00"}}
</td>
<td style="text-align:left">
JSON.GET doc $
<br/>
<br/>
Result:
<br/>
{"colors": {"red": "#ff0000", "green": "#00ff00"}}
</td>
</tr>
</tbody>
</table>
<h3 id="update-versus-update-array">
Update versus update array
</h3>
<p>
<strong>
Conflict
</strong>
</p>
<p>
Two instances update the same existing array with different content.
</p>
<p>
<strong>
Resolution type
</strong>
</p>
<p>
Merge
</p>
<p>
<strong>
Resolution rule
</strong>
</p>
<p>
Merges the results of all operations on the array. Preserves the original element order from each instance.
</p>
<p>
<strong>
Example
</strong>
</p>
<table>
<thead>
<tr>
<th style="text-align:center">
Time
</th>
<th style="text-align:left">
Description
</th>
<th style="text-align:left">
Instance 1
</th>
<th style="text-align:left">
Instance 2
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center">
t1
</td>
<td style="text-align:left">
The document exists on both instances
</td>
<td style="text-align:left">
JSON.GET doc $
<br/>
<br/>
Result:
<br/>
'["a", "b", "c"]'
</td>
<td style="text-align:left">
JSON.GET doc $
<br/>
<br/>
Result:
<br/>
'["a", "b", "c"]'
</td>
</tr>
<tr>
<td style="text-align:center">
t2
</td>
<td style="text-align:left">
Instance 1 removes an array element; instance 2 adds one
</td>
<td style="text-align:left">
JSON.ARRPOP doc $ 1
<br/>
<br/>
Result:
<br/>
["a", "c"]
</td>
<td style="text-align:left">
<nobr>
JSON.ARRINSERT doc $ 0 ββyββ
</nobr>
<br/>
<br/>
Result:
<br/>
["y", "a", "b", "c"]
</td>
</tr>
<tr>
<td style="text-align:center">
t3
</td>
<td style="text-align:left">
Both instances add another element to the array
</td>
<td style="text-align:left">
<nobr>
JSON.ARRINSERT doc $ 1 ββxββ
</nobr>
<br/>
<br/>
Result:
<br/>
["a", "x", "c"]
</td>
<td style="text-align:left">
<nobr>
JSON.ARRINSERT doc $ 2 ββzββ
</nobr>
<br/>
<br/>
Result:
<br/>
["y", "a", "z", "b", "c"]
</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">
β Sync β
</td>
</tr>
<tr>
<td style="text-align:center">
t5
</td>
<td style="text-align:left">
Merge results from both instances
</td>
<td style="text-align:left">
JSON.GET doc $
<br/>
<br/>
Result:
<br/>
["y", "a", "x", "z", "c"]
</td>
<td style="text-align:left">
JSON.GET doc $
<br/>
<br/>
Result:
<br/>
["y", "a", "x", "z", "c"]
</td>
</tr>
</tbody>
</table>
<h3 id="update-versus-delete-array-element">
Update versus delete array element
</h3>
<p>
<strong>
Conflict
</strong>
</p>
<p>
Instance 1 removes an element from a JSON array with
<code>
JSON.ARRPOP
</code>
.
</p>
<p>
Instance 2 updates the same element that instance 1 removes.
</p>
<p>
<strong>
Resolution type
</strong>
</p>
<p>
Win over
</p>
<p>
<strong>
Resolution rule
</strong>
</p>
<p>
Deletion wins over updates.
</p>
<p>
<strong>
Example
</strong>
</p>
<table>
<thead>
<tr>
<th style="text-align:center">
Time
</th>
<th style="text-align:left">
Description
</th>
<th style="text-align:left">
Instance 1
</th>
<th style="text-align:left">
Instance 2
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center">
t1
</td>
<td style="text-align:left">
The document exists on both instances
</td>
<td style="text-align:left">
JSON.GET doc $
<br/>
<br/>
Result:
<br/>
{βtodoβ: [{βtitleβ: βbuy milkβ, βdoneβ: false}]}
</td>
<td style="text-align:left">
JSON.GET doc $
<br/>
<br/>
Result:
<br/>
{βtodoβ: [{βtitleβ: βbuy milkβ, βdoneβ: false}]}
</td>
</tr>
<tr>
<td style="text-align:center">
t2
</td>
<td style="text-align:left">
Instance 1 removes an array element; instance 2 updates the same element
</td>
<td style="text-align:left">
<nobr>
JSON.ARRPOP doc $.todo 0
</nobr>
</td>
<td style="text-align:left">
<nobr>
JSON.SET doc '$.todo[0]["done"]' 'true'β
</nobr>
</td>
</tr>
<tr>
<td style="text-align:center">
t3
</td>
<td style="text-align:left">
</td>
<td style="text-align:left">
JSON.GET doc $
<br/>
<br/>
Result:
<br/>
{βtodoβ: []}
</td>
<td style="text-align:left">
JSON.GET doc $
<br/>
<br/>
Result:
<br/>
[{βtitleβ: βbuy milkβ, βdoneβ: true}]}
</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">
β Sync β
</td>
</tr>
<tr>
<td style="text-align:center">
t5
</td>
<td style="text-align:left">
Instance 1 wins
</td>
<td style="text-align:left">
JSON.GET doc $
<br/>
<br/>
Result:
<br/>
doc = {βtodoβ: []}
</td>
<td style="text-align:left">
JSON.GET doc $
<br/>
<br/>
Result:
<br/>
doc = {βtodoβ: []}
</td>
</tr>
</tbody>
</table>
<h3 id="update-versus-update-object">
Update versus update object
</h3>
<p>
<strong>
Conflict
</strong>
</p>
<p>
Both instances update the same existing object with different content.
</p>
<p>
<strong>
Resolution type
</strong>
</p>
<p>
Merge
</p>
<p>
<strong>
Resolution rule
</strong>
</p>
<p>
Merges the results of all operations on the object.
</p>
<p>
<strong>
Example
</strong>
</p>
<table>
<thead>
<tr>
<th style="text-align:center">
Time
</th>
<th style="text-align:left">
Description
</th>
<th style="text-align:left">
Instance 1
</th>
<th style="text-align:left">
Instance 2
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center">
t1
</td>
<td style="text-align:left">
The document exists on both instances
</td>
<td style="text-align:left">
JSON.GET doc $
<br/>
<br/>
Result:
<br/>
'{"grocery": []}'
</td>
<td style="text-align:left">
JSON.GET doc $
<br/>
<br/>
Result:
<br/>
'{"grocery": []}'
</td>
</tr>
<tr>
<td style="text-align:center">
t2
</td>
<td style="text-align:left">
Add new elements to the array
</td>
<td style="text-align:left">
<nobr>
JSON.ARRAPPEND doc $.grocery ββeggsββ
</nobr>
</td>
<td style="text-align:left">
JSON.ARRAPPEND doc $.grocery ββmilkββ
</td>
</tr>
<tr>
<td style="text-align:center">
t3
</td>
<td style="text-align:left">
Add new elements to the array
</td>
<td style="text-align:left">
JSON.ARRAPPEND doc $.grocery ββhamββ
</td>
<td style="text-align:left">
<nobr>
JSON.ARRAPPEND doc $.grocery ββflourββ
</nobr>
</td>
</tr>
<tr>
<td style="text-align:center">
t4
</td>
<td style="text-align:left">
</td>
<td style="text-align:left">
JSON.GET doc $
<br/>
<br/>
Result:
<br/>
{"grocery":["eggs", "ham"]}
</td>
<td style="text-align:left">
JSON.GET doc $
<br/>
<br/>
Result:
<br/>
{"grocery":["milk", "flour"]}
</td>
</tr>
<tr>
<td style="text-align:center">
t5
</td>
<td style="text-align:left">
Active-Active synchronization
</td>
<td style="text-align:left">
β Sync β
</td>
<td style="text-align:left">
β Sync β
</td>
</tr>
<tr>
<td style="text-align:center">
t6
</td>
<td style="text-align:left">
Merges the results from both instances
</td>
<td style="text-align:left">
JSON.GET doc .
<br/>
<br/>
Result:
<br/>
{"grocery":["eggs","ham","milk", "flour"]}
</td>
<td style="text-align:left">
JSON.GET doc .
<br/>
<br/>
Result:
<br/>
{"grocery":["eggs","ham","milk", "flour" ]}
</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/json/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/integrate/redis-data-integration/reference/cli/redis-di-scaffold/.html | <section class="prose w-full py-12">
<h1>
redis-di scaffold
</h1>
<p class="text-lg -mt-5 mb-10">
Generates configuration files for RDI
</p>
<h2 id="usage">
Usage
</h2>
<pre tabindex="0"><code>Usage: redis-di scaffold [OPTIONS]
</code></pre>
<h2 id="options">
Options
</h2>
<ul>
<li>
<p>
<code>
log_level
</code>
:
</p>
<ul>
<li>
Type: Choice(['DEBUG', 'INFO', 'WARN', 'ERROR', 'CRITICAL'])
</li>
<li>
Default:
<code>
info
</code>
</li>
<li>
Usage:
<code>
--log-level -l
</code>
</li>
</ul>
</li>
<li>
<p>
<code>
db_type
</code>
(REQUIRED):
</p>
<ul>
<li>
Type: Choice([<DbType.MYSQL: 'mysql'>, <DbType.ORACLE: 'oracle'>, <DbType.POSTGRESQL: 'postgresql'>, <DbType.REDIS: 'redis'>, <DbType.SQLSERVER: 'sqlserver'>])
</li>
<li>
Default:
<code>
none
</code>
</li>
<li>
Usage:
<code>
--db-type
</code>
</li>
</ul>
<p>
DB type
</p>
</li>
<li>
<p>
<code>
strategy
</code>
:
</p>
<ul>
<li>
Type: Choice([<Strategy.INGEST: 'ingest'>, <Strategy.WRITE_BEHIND: 'write_behind'>])
</li>
<li>
Default:
<code>
ingest
</code>
</li>
<li>
Usage:
<code>
--strategy
</code>
</li>
</ul>
<p>
Strategy
</p>
<p>
Output to directory or stdout
</p>
</li>
<li>
<p>
<code>
directory
</code>
:
</p>
<ul>
<li>
Type: STRING
</li>
<li>
Default:
<code>
none
</code>
</li>
<li>
Usage:
<code>
--dir
</code>
</li>
</ul>
<p>
Directory containing RDI configuration
</p>
</li>
<li>
<p>
<code>
preview
</code>
:
</p>
<ul>
<li>
Type: STRING
</li>
<li>
Default:
<code>
none
</code>
</li>
<li>
Usage:
<code>
--preview
</code>
</li>
</ul>
<p>
Print the content of the scaffolded config file to CLI output
</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 scaffold [OPTIONS]
Generates configuration files for RDI
Options:
-l, --log-level [DEBUG|INFO|WARN|ERROR|CRITICAL]
[default: INFO]
--db-type [mysql|oracle|postgresql|redis|sqlserver]
DB type [required]
--strategy [ingest|write_behind]
Strategy [default: ingest]
Output formats: [mutually_exclusive, required]
Output to directory or stdout
--dir TEXT Directory containing RDI configuration
--preview TEXT Print the content of the scaffolded config
file to CLI output
--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/redis-data-integration/reference/cli/redis-di-scaffold/"/>
<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/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/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/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/objects/crdb/health_report/health_report_configuration/.html | <section class="prose w-full py-12 max-w-none">
<h1>
CRDB health report configuration object
</h1>
<p class="text-lg -mt-5 mb-10">
An object that represents the database configuration to include in an Active-Active database health report.
</p>
<p>
An object that represents the database configuration to include in an Active-Active database health report.
</p>
<table>
<thead>
<tr>
<th>
Name
</th>
<th>
Type/Value
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
causal_consistency
</td>
<td>
boolean
</td>
<td>
Enables causal consistency across Active-Active replicas
</td>
</tr>
<tr>
<td>
encryption
</td>
<td>
boolean
</td>
<td>
Intercluster encryption
</td>
</tr>
<tr>
<td>
featureset_version
</td>
<td>
integer
</td>
<td>
CRDB active FeatureSet version
</td>
</tr>
<tr>
<td>
instances
</td>
<td>
<pre><code>[{
// Unique instance ID
"id": integer,
// Local database instance ID
"db_uid": string,
"cluster": {
// Cluster FQDN
"name": string
// Cluster access URL
"url": string
}
}, ...] </code></pre>
</td>
<td>
Local database instances
</td>
</tr>
<tr>
<td>
name
</td>
<td>
string
</td>
<td>
Name of database
</td>
</tr>
<tr>
<td>
protocol_version
</td>
<td>
integer
</td>
<td>
CRDB active protocol version
</td>
</tr>
<tr>
<td>
status
</td>
<td>
string
</td>
<td>
Current status of the configuration.
<br/>
Possible values:
<br/>
<strong>
posted:
</strong>
Configuration was posted to all replicas
<br/>
<strong>
ready:
</strong>
All replicas have finished processing posted configuration (create a database)
<br/>
<strong>
committed
</strong>
: Posted configuration is now active on all replicas
<br/>
<strong>
commit-completed:
</strong>
All replicas have finished processing committed configuration (database is active)
<br/>
<strong>
failed:
</strong>
Configuration failed to post
</td>
</tr>
<tr>
<td>
version
</td>
<td>
integer
</td>
<td>
Database configuration version
</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/crdb/health_report/health_report_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/commands/json.arrpop/.html | <section class="prose w-full py-12">
<h1 class="command-name">
JSON.ARRPOP
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">JSON.ARRPOP key [path [index]]</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(N) when path is evaluated to a single value where N is the size of the array and the specified index is not the last element, O(1) when path is evaluated to a single value and the specified index is the last element, or O(N) when path is evaluated to multiple values, where N is the size of the key
</dd>
</dl>
<p>
Remove and return an element from the index in the array
</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>
index
</code>
</summary>
<p>
is position in the array to start popping from. Default is
<code>
-1
</code>
, meaning the last element. Out-of-range indexes round to their respective array ends. Popping an empty array returns null.
</p>
</details>
<h2 id="optional-arguments">
Optional arguments
</h2>
<details open="">
<summary>
<code>
path
</code>
</summary>
<p>
is JSONPath to specify. Default is root
<code>
$
</code>
.
</p>
</details>
<h2 id="return">
Return
</h2>
<p>
<code>
JSON.ARRPOP
</code>
returns an
<a href="/docs/latest/develop/reference/protocol-spec#resp-arrays">
array
</a>
of bulk string replies for each path, each reply is the popped JSON value, or
<code>
nil
</code>
, if the matching JSON value is not an array.
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>
Pop a value from an index and insert a new value
</b>
</summary>
<p>
Create two headphone products with maximum sound levels.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis> JSON.SET key $ <span class="s1">'[{"name":"Healthy headphones","description":"Wireless Bluetooth headphones with noise-cancelling technology","connection":{"wireless":true,"type":"Bluetooth"},"price":99.98,"stock":25,"colors":["black","silver"],"max_level":[60,70,80]},{"name":"Noisy headphones","description":"Wireless Bluetooth headphones with noise-cancelling technology","connection":{"wireless":true,"type":"Bluetooth"},"price":99.98,"stock":25,"colors":["black","silver"],"max_level":[80,90,100,120]}]'</span>
</span></span><span class="line"><span class="cl">OK</span></span></code></pre>
</div>
<p>
Get all maximum values for the second product.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis> JSON.GET key $.<span class="o">[</span>1<span class="o">]</span>.max_level
</span></span><span class="line"><span class="cl"><span class="s2">"[[80,90,100,120]]"</span></span></span></code></pre>
</div>
<p>
Update the
<code>
max_level
</code>
field of the product: remove an unavailable value and add a newly available value.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis> JSON.ARRPOP key $.<span class="o">[</span>1<span class="o">]</span>.max_level <span class="m">0</span>
</span></span><span class="line"><span class="cl">1<span class="o">)</span> <span class="s2">"80"</span></span></span></code></pre>
</div>
<p>
Get the updated array.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis> JSON.GET key $.<span class="o">[</span>1<span class="o">]</span>.max_level
</span></span><span class="line"><span class="cl"><span class="s2">"[[90,100,120]]"</span></span></span></code></pre>
</div>
<p>
Now insert a new lowest value.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis> JSON.ARRINSERT key $.<span class="o">[</span>1<span class="o">]</span>.max_level <span class="m">0</span> <span class="m">85</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></code></pre>
</div>
<p>
Get the updated array.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis> JSON.GET key $.<span class="o">[</span>1<span class="o">]</span>.max_level
</span></span><span class="line"><span class="cl"><span class="s2">"[[85,90,100,120]]"</span></span></span></code></pre>
</div>
</details>
<h2 id="see-also">
See also
</h2>
<p>
<a href="/docs/latest/commands/json.arrappend/">
<code>
JSON.ARRAPPEND
</code>
</a>
|
<a href="/docs/latest/commands/json.arrindex/">
<code>
JSON.ARRINDEX
</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.arrpop/"/>
<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/manage-passwords/password-complexity-rules/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Configure password complexity rules
</h1>
<p class="text-lg -mt-5 mb-10">
Enable password complexity rules and configure minimum password length.
</p>
<p>
Redis Enterprise Software provides optional password complexity rules that meet common requirements. When enabled, these rules require the password to have:
</p>
<ul>
<li>
At least 8 characters
</li>
<li>
At least one uppercase character
</li>
<li>
At least one lowercase character
</li>
<li>
At least one number
</li>
<li>
At least one special character
</li>
</ul>
<p>
These requirements reflect v6.2.12 and later. Earlier versions did not support numbers or special characters as the first or the last character of a password. This restriction was removed in v6.2.12.
</p>
<p>
In addition, the password:
</p>
<ul>
<li>
Cannot contain the user's email address or the reverse of the email address.
</li>
<li>
Cannot have more than three repeating characters.
</li>
</ul>
<p>
Password complexity rules apply when a new user account is created and when the password is changed. Password complexity rules are not applied to accounts authenticated by an external identity provider.
</p>
<h2 id="enable-password-complexity-rules">
Enable password complexity rules
</h2>
<p>
To enable password complexity rules, 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>
In the
<strong>
Password
</strong>
section, enable
<strong>
Complexity rules
</strong>
.
</p>
</li>
<li>
<p>
Select
<strong>
Save
</strong>
.
</p>
</li>
</ol>
</li>
<li>
<p>
<a href="/docs/latest/operate/rs/references/rest-api/requests/cluster/#put-cluster">
Update cluster
</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 https://<span class="o">[</span>host<span class="o">][</span>:port<span class="o">]</span>/v1/cluster
</span></span><span class="line"><span class="cl"><span class="o">{</span> <span class="s2">"password_complexity"</span>: <span class="nb">true</span> <span class="o">}</span>
</span></span></code></pre>
</div>
</li>
</ul>
<h2 id="change-minimum-password-length">
Change minimum password length
</h2>
<p>
When password complexity rules are enabled, passwords must have at least 8 characters by default.
</p>
<p>
If you change the minimum password length, the new minimum is enforced for new users and when existing users change their passwords.
</p>
<p>
To change the minimum password length, use one of the following methods:
</p>
<ul>
<li>
<p>
Cluster Manager UI:
</p>
<ol>
<li>
<p>
Go to
<strong>
Cluster > Security > Preferences
</strong>
.
</p>
</li>
<li>
<p>
Click
<strong>
Edit
</strong>
.
</p>
</li>
<li>
<p>
In the
<strong>
Password
</strong>
section, enable
<strong>
Complexity rules
</strong>
.
</p>
</li>
<li>
<p>
Set the number of characters for
<strong>
Minimum password length
</strong>
.
</p>
<a href="/docs/latest/images/rs/screenshots/cluster/security-preferences-min-password-length.png" sdata-lightbox="/images/rs/screenshots/cluster/security-preferences-min-password-length.png">
<img alt="The minimum password length setting appears in the password section of the cluster security preferences screen when complexity rules are enabled." src="/docs/latest/images/rs/screenshots/cluster/security-preferences-min-password-length.png"/>
</a>
</li>
<li>
<p>
Click
<strong>
Save
</strong>
.
</p>
</li>
</ol>
</li>
<li>
<p>
<a href="/docs/latest/operate/rs/references/rest-api/requests/cluster/#put-cluster">
Update cluster
</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 https://<span class="o">[</span>host<span class="o">][</span>:port<span class="o">]</span>/v1/cluster
</span></span><span class="line"><span class="cl"><span class="o">{</span> <span class="s2">"password_min_length"</span>: <integer between 8-256> <span class="o">}</span>
</span></span></code></pre>
</div>
</li>
</ul>
<h2 id="deactivate-password-complexity-rules">
Deactivate password complexity rules
</h2>
<p>
To deactivate password complexity rules, 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>
In the
<strong>
Password
</strong>
section, turn off
<strong>
Complexity rules
</strong>
.
</p>
</li>
<li>
<p>
Select
<strong>
Save
</strong>
.
</p>
</li>
</ol>
</li>
<li>
<p>
<a href="/docs/latest/operate/rs/references/rest-api/requests/cluster/#put-cluster">
Update cluster
</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 https://<span class="o">[</span>host<span class="o">][</span>:port<span class="o">]</span>/v1/cluster
</span></span><span class="line"><span class="cl"><span class="o">{</span> <span class="s2">"password_complexity"</span>: <span class="nb">false</span> <span class="o">}</span>
</span></span></code></pre>
</div>
</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/manage-passwords/password-complexity-rules/"/>
<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/redisbloom/redisbloom-2.4-release-notes/.html | <section class="prose w-full py-12 max-w-none">
<h1>
RedisBloom 2.4 release notes
</h1>
<p class="text-lg -mt-5 mb-10">
Added t-digest - a probabilistic data structure for estimating quantiles based on a data stream or a large dataset of floating-point values.
</p>
<h2 id="requirements">
Requirements
</h2>
<p>
RedisBloom v2.4.9 requires:
</p>
<ul>
<li>
Minimum Redis compatibility version (database): 6.0.16
</li>
<li>
Minimum Redis Enterprise Software version (cluster): 6.2.8
</li>
</ul>
<h2 id="v249-march-2024">
v2.4.9 (March 2024)
</h2>
<p>
This is a maintenance release for RedisBloom 2.4.
</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/RedisBloom/RedisBloom/issues/753">
#753
</a>
Potential crash on
<code>
CMS.MERGE
</code>
when using invalid arguments
</li>
</ul>
</li>
</ul>
<h2 id="v248-january-2024">
v2.4.8 (January 2024)
</h2>
<p>
This is a maintenance release for RedisBloom 2.4.
</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/RedisBloom/RedisBloom/pull/727">
#727
</a>
Additional fixes for potential crash on
<code>
CF.LOADCHUNK
</code>
(MOD-6344)
</li>
</ul>
</li>
</ul>
<h2 id="v247-january-2024">
v2.4.7 (January 2024)
</h2>
<p>
This is a maintenance release for RedisBloom 2.4.
</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/RedisBloom/RedisBloom/pull/735">
#735
</a>
Potential crash on
<code>
CF.RESERVE
</code>
(MOD-6343)
</li>
<li>
<a href="https://github.com/RedisBloom/RedisBloom/pull/727">
#727
</a>
Potential crash on
<code>
CF.LOADCHUNK
</code>
(MOD-6344)
</li>
</ul>
</li>
</ul>
<h2 id="v246-december-2023">
v2.4.6 (December 2023)
</h2>
<p>
This is a maintenance release for RedisBloom 2.4.
</p>
<p>
Update urgency:
<code>
LOW
</code>
: No need to upgrade unless there are new features you want to use.
</p>
<p>
Details:
</p>
<ul>
<li>
<p>
Bug fixes:
</p>
<ul>
<li>
<a href="https://github.com/RedisBloom/RedisBloom/pull/707">
#707
</a>
Top-K:
<code>
TOPK.ADD
</code>
and
<code>
TOPK.QUERY
</code>
crash when an item name is an empty string (RED-114676)
</li>
</ul>
</li>
<li>
<p>
Improvements:
</p>
<ul>
<li>
<a href="https://github.com/RedisBloom/RedisBloom/pull/706">
#706
</a>
Added support for CBL-Mariner 2 (MOD-6200)
</li>
</ul>
</li>
</ul>
<h2 id="v245-april-2023">
v2.4.5 (April 2023)
</h2>
<p>
This is a maintenance release for RedisBloom 2.4.
</p>
<p>
Update urgency:
<code>
LOW
</code>
: No need to upgrade unless there are new features you want to use.
</p>
<p>
Details:
</p>
<ul>
<li>
<p>
Improvements:
</p>
<ul>
<li>
Internal changes for supporting future Redis Enterprise releases
</li>
</ul>
</li>
</ul>
<h2 id="v244-february-2023">
v2.4.4 (February 2023)
</h2>
<p>
This is a maintenance release for RedisBloom 2.4.
</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/RedisBloom/RedisBloom/issues/609">
#609
</a>
<a href="/docs/latest/commands/cf.info">
CF.INFO
</a>
- incorrect information for large filters
</li>
</ul>
</li>
<li>
<p>
Improvements:
</p>
<ul>
<li>
<a href="https://github.com/RedisBloom/RedisBloom/issues/389">
#389
</a>
Introduce
<a href="/docs/latest/commands/bf.card">
BF.CARD
</a>
to retrieve the cardinality of a Bloom filter or 0 when such key does not exist
</li>
</ul>
</li>
</ul>
<h2 id="v24-ga-v243-november-2022">
v2.4 GA (v2.4.3) (November 2022)
</h2>
<p>
This is the General Availability release of RedisBloom 2.4.
</p>
<h3 id="highlights">
Highlights
</h3>
<p>
RedisBloom 2.4 introduces a new sketch data structure:
<strong>
t-digest
</strong>
.
</p>
<h3 id="whats-new-in-24">
What's new in 2.4
</h3>
<p>
<a href="https://www.sciencedirect.com/science/article/pii/S2665963820300403">
t-digest
</a>
is a probabilistic data structure for estimating quantiles based on a data stream or a large dataset of floating-point values. It can be used to answer the following questions:
</p>
<ul>
<li>
What fraction of the values in the data stream are smaller than a given value?
</li>
<li>
How many values in the data stream are smaller than a given value?
</li>
<li>
Which value is smaller than
<em>
p
</em>
percent of the values in the data stream? (what is the
<em>
p
</em>
-percentile value)?
</li>
<li>
What is the mean value between the
<em>
p1
</em>
-percentile value and the
<em>
p2
</em>
-percentile value?
</li>
<li>
What is the value of the
<em>
n
</em>
-th smallest / largest value in the data stream? (what is the value with [reverse] rank
<em>
n
</em>
)?
</li>
</ul>
<p>
As for any other probabilistic data structures, t-digest requires sublinear space and has controllable space-accuracy tradeoffs.
</p>
<p>
Using t-digest is simple and straightforward:
</p>
<ul>
<li>
<p>
<strong>
Creating a sketch and adding observations
</strong>
</p>
<p>
<code>
TDIGEST.CREATE key [COMPRESSION compression]
</code>
initializes a new t-digest sketch (and errors if the key already exists). The
<code>
COMPRESSION
</code>
argument is used to specify the tradeoff between accuracy and memory consumption. The default is 100. Higher values mean more accuracy.
</p>
<p>
<code>
TDIGEST.ADD key value...
</code>
adds new observations (floating-point values) to the sketch. You can repeat calling
<a href="/docs/latest/commands/tdigest.add">
TDIGEST.ADD
</a>
whenever new observations are available.
</p>
</li>
<li>
<p>
<strong>
Estimating fractions or ranks by values
</strong>
</p>
<p>
Use
<code>
TDIGEST.CDF key value...
</code>
to retrieve, for each input
<strong>
value
</strong>
, an estimation of the
<strong>
fraction
</strong>
of (observations
<strong>
smaller
</strong>
than the given value + half the observations equal to the given value).
</p>
<p>
<code>
TDIGEST.RANK key value...
</code>
is similar to
<a href="/docs/latest/commands/tdigest.cdf">
TDIGEST.CDF
</a>
, but used for estimating the number of observations instead of the fraction of observations. More accurately it returns, for each input
<strong>
value
</strong>
, an estimation of the
<strong>
number
</strong>
of (observations
<strong>
smaller
</strong>
than a given value + half the observations equal to the given value).
</p>
<p>
And lastly,
<code>
TDIGEST.REVRANK key value...
</code>
is similar to
<a href="/docs/latest/commands/tdigest.rank">
TDIGEST.RANK
</a>
, but returns, for each input
<strong>
value
</strong>
, an estimation of the
<strong>
number
</strong>
of (observations
<strong>
larger
</strong>
than a given value + half the observations equal to the given value).
</p>
</li>
<li>
<p>
<strong>
Estimating values by fractions or ranks
</strong>
</p>
<p>
<code>
TDIGEST.QUANTILE key fraction...
</code>
returns, for each input
<strong>
fraction
</strong>
, an estimation of the
<strong>
value
</strong>
(floating point) that is
<strong>
smaller
</strong>
than the given fraction of observations.
</p>
<p>
<code>
TDIGEST.BYRANK key rank...
</code>
returns, for each input
<strong>
rank
</strong>
, an estimation of the
<strong>
value
</strong>
(floating point) with that rank.
</p>
<p>
<code>
TDIGEST.BYREVRANK key rank...
</code>
returns, for each input
<strong>
reverse rank
</strong>
, an estimation of the
<strong>
value
</strong>
(floating point) with that reverse rank.
</p>
</li>
<li>
<p>
<strong>
Estimating trimmed mean
</strong>
</p>
<p>
Use
<code>
TDIGEST.TRIMMED_MEAN key lowFraction highFraction
</code>
to retrieve an estimation of the mean value between the specified fractions.
</p>
<p>
This is especially useful for calculating the average value ignoring outliers. For example, calculating the average value between the 20th percentile and the 80th percentile.
</p>
</li>
<li>
<p>
<strong>
Merging sketches
</strong>
</p>
<p>
Sometimes it is useful to merge sketches. For example, suppose we measure latencies for 3 servers, and we want to calculate the 90%, 95%, and 99% latencies for all the servers combined.
</p>
<p>
<code>
TDIGEST.MERGE destKey numKeys sourceKey... [COMPRESSION compression] [OVERRIDE]
</code>
merges multiple sketches into a single sketch.
</p>
<p>
If
<code>
destKey
</code>
does not exist, a new sketch is created.
</p>
<p>
If
<code>
destKey
</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>
</li>
<li>
<p>
<strong>
Retrieving sketch information
</strong>
</p>
<p>
Use
<code>
TDIGEST.MIN
</code>
key and
<code>
TDIGEST.MAX key
</code>
to retrieve the minimal and maximal values in the sketch, respectively.
</p>
<p>
Both return NaN (Not a Number) when the sketch is empty.
</p>
<p>
Both commands return accurate results and are equivalent to
<code>
TDIGEST.BYRANK key 0
</code>
and
<code>
TDIGEST.BYREVRANK key 0
</code>
respectively.
</p>
<p>
Use
<code>
TDIGEST.INFO key
</code>
to retrieve some additional information about the sketch.
</p>
</li>
<li>
<p>
<strong>
Resetting a sketch
</strong>
</p>
<p>
<code>
TDIGEST.RESET key
</code>
empties the sketch and reinitializes it.
</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/oss_and_stack/stack-with-enterprise/release-notes/redisbloom/redisbloom-2.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/oss_and_stack/stack-with-enterprise/release-notes/redistimeseries/redistimeseries-1.12-release-notes/.html | <section class="prose w-full py-12 max-w-none">
<h1>
RedisTimeSeries 1.12 release notes
</h1>
<p class="text-lg -mt-5 mb-10">
RedisTimeSeries 1.12 adds a highly requested feature - insertion-filter for close samples.
</p>
<h2 id="requirements">
Requirements
</h2>
<p>
RedisTimeSeries v1.12.2 requires:
</p>
<ul>
<li>
Minimum Redis compatibility version (database): 7.4
</li>
<li>
Minimum Redis Enterprise Software version (cluster): 7.6 (TBD)
</li>
</ul>
<h2 id="v112-ga-v1122-july-2024">
v1.12 GA (v1.12.2) (July 2024)
</h2>
<p>
This is the General Availability release of RedisTimeSeries 1.12
</p>
<h3 id="headlines">
Headlines
</h3>
<p>
RedisTimeSeries 1.12 adds a highly requested feature: insertion-filter for close samples. 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. When both the time difference and the value difference between the current and the previous sample are small, it may be preferable to ignore (not to add) the new measurement.
</p>
<h3 id="whats-new-in-112">
What's new in 1.12
</h3>
<ul>
<li>
<p>
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/1543">
#1543
</a>
insertion-filter for close samples:
</p>
<ul>
<li>
Two new
<a href="https://redis.io/docs/data-types/timeseries/configuration/">
module configuration parameters
</a>
are introduced:
<code>
IGNORE_MAX_TIME_DIFF
</code>
and
<code>
IGNORE_MAX_VAL_DIFF
</code>
.
</li>
<li>
Two new similar per-key parameters are introduced:
<code>
ignoreMaxTimeDiff
</code>
and
<code>
ignoreMaxValDiff
</code>
.
</li>
<li>
<code>
TS.ADD
</code>
,
<code>
TS.INCRBY
</code>
, and
<code>
TS.DECRBY
</code>
now have a new optional argument:
<code>
[IGNORE ignoreMaxTimeDiff ignoreMaxValDiff]
</code>
.
When creating a new time series, these two values are used to set the per-key parameters and override the two module configuration parameters. These values are ignored when specified with an existing time series.
</li>
<li>
<code>
[IGNORE ignoreMaxTimeDiff ignoreMaxValDiff]
</code>
is also supported by
<code>
TS.ALTER
</code>
.
</li>
<li>
For each call to
<code>
TS.ADD
</code>
, if the following conditions are met:
<ul>
<li>
series is not a compaction
</li>
<li>
the series'
<code>
DUPLICATE_POLICY
</code>
is
<code>
LAST
</code>
</li>
<li>
<code>
timestamp
</code>
β₯
<code>
max_timestamp
</code>
</li>
<li>
<code>
timestamp
</code>
-
<code>
max_timestamp
</code>
β€
<code>
ignoreMaxTimeDiff
</code>
</li>
<li>
abs(
<code>
value
</code>
-
<code>
value_at_max_timestamp
</code>
) β€
<code>
ignoreMaxValDiff
</code>
))
then this sample is ignored (not added) to the time series.
<code>
max_timestamp
</code>
is the maximal timestamp in the time series.
</li>
</ul>
</li>
<li>
The same logic also applies for each call to
<code>
TS.MADD
</code>
based on the values of the per-key parameters.
</li>
<li>
When a sample is ignored, the returned value for
<code>
TS.ADD
</code>
and for the applicable array element in
<code>
TS.MADD
</code>
is
<code>
max_timestamp
</code>
.
</li>
</ul>
</li>
</ul>
<h3 id="details">
Details
</h3>
<ul>
<li>
<p>
Bug fixes (since 1.12-RC1)
</p>
<ul>
<li>
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/1607">
#1607
</a>
Potential crash after deleting and recreating a source key of a compaction rule (MOD-7338)
</li>
<li>
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/1610">
#1610
</a>
<code>
COUNT
</code>
argument accepts non-positive values (MOD-5413)
</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>
<ul>
<li>
The version inside Redis will be 1.12.2 in semantic versioning. Since the version of a module in Redis is numeric, we could not add a GA flag.
</li>
<li>
Minimal Redis version: 7.4
</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/oss_and_stack/stack-with-enterprise/release-notes/redistimeseries/redistimeseries-1.12-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/7.4/references/compatibility/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Redis Enterprise compatibility with Redis Community Edition
</h1>
<p class="text-lg -mt-5 mb-10">
Redis Enterprise compatibility with Redis Community Edition.
</p>
<p>
Both Redis Enterprise Software and
<a href="/docs/latest/operate/rc/">
Redis Cloud
</a>
are compatible with Redis Community Edition.
</p>
<p>
Redis contributes extensively to the Redis project and uses it inside of Redis Enterprise Software and Redis Cloud. As a rule, we adhere to the project's specifications and update both productsΒ with the latest version of Redis.
</p>
<h2 id="redis-commands">
Redis commands
</h2>
<p>
See
<a href="/docs/latest/operate/rs/7.4/references/compatibility/commands/">
Compatibility with Redis commands
</a>
to learn which Redis commands are compatible with Redis Enterprise Software and Redis Cloud.
</p>
<h2 id="configuration-settings">
Configuration settings
</h2>
<p>
<a href="/docs/latest/operate/rs/7.4/references/compatibility/config-settings/">
Compatibility with Redis configuration settings
</a>
lists the Redis configuration settings supported by Redis Enterprise Software and Redis Cloud.
</p>
<h2 id="redis-clients">
Redis clients
</h2>
<p>
You can use any standard
<a href="/docs/latest/develop/clients/">
Redis client
</a>
with Redis Enterprise Software and Redis Cloud.
</p>
<h2 id="resp-compatibility">
RESP compatibility
</h2>
<p>
Redis Enterprise Software and Redis Cloud support RESP2 and RESP3. See
<a href="/docs/latest/operate/rs/7.4/references/compatibility/resp/">
RESP compatibility with Redis Enterprise
</a>
for more information.
</p>
<h2 id="compatibility-with-open-source-redis-cluster-api">
Compatibility with open source Redis Cluster API
</h2>
<p>
Redis Enterprise supports
<a href="/docs/latest/operate/rs/7.4/clusters/optimize/oss-cluster-api/">
Redis OSS Cluster API
</a>
if it is enabled for a database. For more information, see
<a href="/docs/latest/operate/rs/7.4/databases/configure/oss-cluster-api/">
Enable OSS Cluster API
</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/references/compatibility/"/>
<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/faq/.html | <section class="prose w-full py-12 max-w-none">
<h1>
FAQ
</h1>
<p class="text-lg -mt-5 mb-10">
Find answers to common questions about RDI
</p>
<h2 id="which-license-does-rdi-use">
Which license does RDI use?
</h2>
<p>
You must purchase a commercial license for RDI with Redis Enterprise. This includes two extra
Redis Enterprise shards (primary and replica) for the staging database.
</p>
<h2 id="how-does-rdi-track-data-changes-in-the-source-database">
How does RDI track data changes in the source database?
</h2>
<p>
RDI uses mechanisms that are specific for each of the supported
source databases:
</p>
<ul>
<li>
<strong>
Oracle
</strong>
: RDI uses
<code>
logminer
</code>
to parse the Oracle
<code>
binary log
</code>
and
<code>
archive logs
</code>
. This
lists any changes in a database view that RDI can query.
</li>
<li>
<strong>
MySQL/MariaDB
</strong>
: RDI uses
<code>
binary log replication
</code>
to get all the commits.
</li>
<li>
<strong>
PostgreSQL
</strong>
: RDI uses the
<code>
pgoutput
</code>
plugin.
</li>
<li>
<strong>
SQL Server
</strong>
: RDI uses the CDC mechanism.
</li>
</ul>
<h2 id="how-much-data-can-rdi-process">
How much data can RDI process?
</h2>
<p>
RDI uses the concept of
<em>
processing units
</em>
. Each processing unit uses 1 CPU core and can process
about 10,000 records per second, assuming the records have a size of about 1KB each. This throughput
might change slightly depending on the number of columns, the number of data transformations,
and the speed of the network. Typically, one processing unit is enough for RDI to deal with the
traffic from a relational database.
</p>
<h2 id="can-rdi-work-with-any-redis-database">
Can RDI work with any Redis database?
</h2>
<p>
No. RDI is designed and tested to work only with Redis Enterprise. The staging database can
only use version 6.4 or above. The target Redis database can be of any version and can be a
replica of an Active-Active replication setup or an Auto tiering database.
</p>
<h2 id="can-rdi-automatically-track-changes-to-the-source-database-schema">
Can RDI automatically track changes to the source database schema?
</h2>
<p>
If you don't configure RDI to capture a specific set of tables in the schema then it will
detect any new tables when they are added. Similarly, RDI will capture new table columns
and changes to column names unless you configure it for a specific set of columns.
Bear in mind that the Redis keys in the target database will change to reflect the
new or renamed tables and columns.
</p>
<h2 id="rdi-oom">
Should I be concerned when the log says RDI is out of memory?
</h2>
<p>
Sometimes the Debezium log will contain a message saying that RDI is out of
memory. This is not an error but an informative message to say that RDI
is applying
<em>
backpressure
</em>
to Debezium. See
<a href="/docs/latest/integrate/redis-data-integration/architecture/#backpressure-mechanism">
Backpressure mechanism
</a>
in the Architecture guide for more information.
</p>
<h2 id="what-happens-when-rdi-cant-write-to-the-target-redis-database">
What happens when RDI can't write to the target Redis database?
</h2>
<p>
RDI will keep attempting to write the changes to the target and will also attempt
to reconnect to it, if necessary. While the target is disconnected, RDI
will keep capturing change events from the source database and adding them to its
streams in the staging database. This continues until the staging database gets
low on space to store new events. When RDI detects this, it applies a "back pressure"
mechanism to capture data from the source less frequently, which reduces the risk of running
out of space altogether. The systems that the source databases use to record changes can
retain the change data for at least a few hours, and RDI can catch up with the
changes as soon as the target connection recovers or the staging database has
more space available.
</p>
<h2 id="what-does-rdi-do-if-the-data-is-corrupted-or-invalid">
What does RDI do if the data is corrupted or invalid?
</h2>
<p>
The collector reports the data to RDI in a structured JSON format. If
the structure of the JSON data is invalid or if there is a fatal bug in the transformation
job then RDI can't transform the data. When this happens, RDI will store the original data
in a "dead letter queue" along with a message to say why it was rejected. The dead letter
queue is stored as a capped stream in the RDI staging database. You can see its contents
with Redis Insight or with the
<a href="/docs/latest/integrate/redis-data-integration/reference/cli/redis-di-get-rejected/">
<code>
redis-di get-rejected
</code>
</a>
command from the CLI.
</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/faq/"/>
<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/rlec-4-0-june-2015/.html | <section class="prose w-full py-12 max-w-none">
<h1>
RLEC 4.0.0-49 Release Notes (June 18, 2015)
</h1>
<p>
If you are upgrading from a previous version, make sure to review the
<a href="/docs/latest/operate/rs/installing-upgrading/upgrading/">
upgrade
instructions
</a>
before running through the upgrade process.
</p>
<p>
In addition, when running the install.sh script to upgrade the software,
you might be prompted to approve changes to a configuration file named
ccs-redis.conf. It is crucial that you choose Yes when asked whether to
update this file.
</p>
<h2 id="new-features">
New features
</h2>
<ul>
<li>
Support for Red Hat Enterprise Linux (RHEL) and CentOS 6.5 and 7
operating systems.
</li>
<li>
Support for additional AWS AMIs for Ubuntu and Amazon Linux, on
multiple AWS regions.
</li>
<li>
Support for additional browsers and operating systems for the
management UI.
</li>
<li>
Replica Of feature which enables creating a Redis database that
keeps synchronizing data from another Redis database.
</li>
<li>
Rack-zone awareness feature which enables mapping nodes to
racks/zones to ensure a more sophisticated high-availability
mechanism.
</li>
<li>
Database-related alerts and email alerts.
</li>
<li>
Auto-configuration of synchronization of cluster server clocks with
NTP as part of installation script.
</li>
<li>
Database Export functionality.
</li>
<li>
Email alerts on database Export and Import.
</li>
</ul>
<h2 id="changes">
Changes
</h2>
<ul>
<li>
Database Backup Now functionality replaced with Export
functionality.
</li>
<li>
Database performance improvements to increase throughput and reduce
latency.
</li>
<li>
Improvement to AOF rewrite mechanism to deal with extreme-write
scenarios and limited disk space configurations.
</li>
<li>
Enhancements to rladmin CLI to support additional commands.
</li>
</ul>
<h2 id="fixed-issues">
Fixed issues
</h2>
<ul>
<li>
Cluster stability improvements related to removing nodes and taking
nodes offline.
</li>
<li>
rladmin CLI bug fixes.
</li>
</ul>
<h2 id="known-issues">
Known issues
</h2>
<ul>
<li>
<p>
<strong>
Issue
</strong>
: RLEC-6819 - Uninstall on Red Hat Enterprise Linux does
not stop all services and if you try to install the software again
on the same machine the new installation might use prior
installation data.
</p>
<p>
<strong>
Workaround
</strong>
: Before installing the software
again restart the machine or verify that all services are down.
</p>
</li>
<li>
<p>
<strong>
Issue
</strong>
: In the replica of process, if the source database is
resharded while the replica of process is active, the
synchronization process will fail.
</p>
<p>
<strong>
Workaround
</strong>
: You need to
manually stop and restart the synchronization process after
resharding of the source database is done.
</p>
</li>
<li>
<p>
<strong>
Issue
</strong>
: In the replica of process, high database traffic might cause the replica of process to restart frequently
as result of the "replica buffer" being exceeded. In this case you see
the status of the replica of process as "Syncing"
frequently.
</p>
<p>
<strong>
Workaround
</strong>
: You need to manually reconfigure the
"replica buffer" through rladmin and set the buffer size to a new
size. In order to find the appropriate buffer size please contact
support at:
<a href="mailto:[email protected]">
[email protected]
</a>
.
</p>
</li>
<li>
<p>
<strong>
Issue
</strong>
: In a cluster that is configured to support rack-zone
awareness, if the user forces migration of a master or replica shard,
through rladmin, to a node on the same rack-zone as its
corresponding master or replica shard, and later runs the rebalance
process, the rebalance process will not migrate the shards to ensure
rack-zone awareness compliance.
</p>
<p>
<strong>
Workaround
</strong>
: In the scenario
described above, you need to manually migrate the shard, through
rladmin, to a node on a valid rack-zone in order to ensure rack-zone
awareness compliance.
</p>
</li>
<li>
<p>
<strong>
Issue
</strong>
: In case you deploy a cluster and use the DNS option for
the cluster name (see details in
<a href="/docs/latest/operate/rs/networking/cluster-dns/">
How to set the Cluster Name
(FQDN)
</a>
,
do not configure the DNS entries for the cluster nodes, and try to
configure a database that is a replica of another database within
the cluster, then the UI allows you to configure the source database
but the replica of process fails in runtime.
</p>
<p>
<strong>
Workaround
</strong>
: The
configuration indicated in this issue is not a valid cluster
configuration. If you choose to use the DNS option for the cluster
name then you must configure DNS entries for the nodes, otherwise
the cluster does not operate correctly. You have to either update
the DNS accordingly, or recreate the cluster and use the mDNS option
for the cluster name as described in
<a href="/docs/latest/operate/rs/networking/cluster-dns/">
How to set the Cluster Name
(FQDN)
</a>
.
</p>
</li>
<li>
<p>
<strong>
Issue
</strong>
: When taking a node offline or removing a node, if the
node being taken offline or removed is currently serving as the web
server for the web browser being used to view the management UI,
then the management UI appears down while the node is
down.
</p>
<p>
<strong>
Workaround
</strong>
: If you are using the cluster name in order to
connect to the management UI in the browser, and the cluster name is
registered in your external DNS or you are using the mDNS option,
then the DNS entries will be updated to point to another node in the
cluster after a few seconds and the UI will open properly. If you
are not using the cluster name but rather the node IP in order to
connect to the management UI in the web browser, you have to use the
IP of another node in the cluster to access the management UI.
</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/legacy-release-notes/rlec-4-0-june-2015/"/>
<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/crdb/.html | <section class="prose w-full py-12 max-w-none">
<h1>
CRDB object
</h1>
<p class="text-lg -mt-5 mb-10">
An object that represents an Active-Active database
</p>
<p>
An object that represents an Active-Active database.
</p>
<table>
<thead>
<tr>
<th>
Name
</th>
<th>
Type/Value
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
guid
</td>
<td>
string
</td>
<td>
The global unique ID of the Active-Active database
</td>
</tr>
<tr>
<td>
causal_consistency
</td>
<td>
boolean
</td>
<td>
Enables causal consistency across CRDT instances
</td>
</tr>
<tr>
<td>
default_db_config
</td>
<td>
<a href="/docs/latest/operate/rs/references/rest-api/objects/crdb/database_config/">
CRDB database_config
</a>
object
</td>
<td>
Default database configuration
</td>
</tr>
<tr>
<td>
encryption
</td>
<td>
boolean
</td>
<td>
Encrypt communication
</td>
</tr>
<tr>
<td>
featureset_version
</td>
<td>
integer
</td>
<td>
Active-Active database active FeatureSet version
</td>
</tr>
<tr>
<td>
instances
</td>
<td>
array of
<a href="/docs/latest/operate/rs/references/rest-api/objects/crdb/instance_info/">
CRDB instance_info
</a>
objects
</td>
<td>
</td>
</tr>
<tr>
<td>
local_databases
</td>
<td>
<pre><code>[{
"bdb_uid": string,
"id": integer
}, ...] </code></pre>
</td>
<td>
Mapping of instance IDs for local databases to local BDB IDs
</td>
</tr>
<tr>
<td>
name
</td>
<td>
string
</td>
<td>
Name of Active-Active database
</td>
</tr>
<tr>
<td>
protocol_version
</td>
<td>
integer
</td>
<td>
Active-Active database active protocol version
</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/crdb/"/>
<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/recommendations/pod-stability/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Manage pod stability
</h1>
<p class="text-lg -mt-5 mb-10">
This section provides information about how you can use quality of service, priority class, eviction thresholds and resource monitoring to maintain cluster node pod stability.
</p>
<p>
Kubernetes clusters manage the allocation of system resources and can evict pods to release system resources.
Here are some ways that you can configure the Redis Enterprise node pods to maintain pod stability:
</p>
<h2 id="guaranteed-quality-of-service">
Guaranteed quality of service
</h2>
<p>
A running pod has a quality of service measure assigned to it that is
one of three
<a href="https://kubernetes.io/docs/tasks/configure-pod-container/quality-service-pod/">
quality of service classes
</a>
:
Guaranteed, Burstable, and Best Effort.
You can assure the Guaranteed class is assigned to the Redis Enterprise node pods
by following the right guidelines.
</p>
<p>
To get a Guaranteed quality of service class assigned:
</p>
<ul>
<li>
Every container in the pod must have a memory limit and a memory request, and they must be the same.
</li>
<li>
Every container in the pod must have a CPU limit and a CPU request, and they must be the same.
</li>
</ul>
<p>
If resources limits and requests are not specified in the Redis Enterprise CRD,
these requirements are met in the default version created by the operator. of your Redis Enterprise cluster CRD,
Otherwise, you must set the limits and requests to the same value for memory and CPU in the
<code>
redisEnterpriseNodeResources
</code>
section of the CRD.
</p>
<p>
Sidecar containers also impact the quality of service class assignment for the pod.
</p>
<p>
To check the quality of service class of any running Redis Enterprise node pod, run:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">kubectl get pod rec-0 --o <span class="nv">jsonpath</span><span class="o">=</span><span class="s2">"{.status.qosClass}"</span>
</span></span></code></pre>
</div>
<p>
where
<code>
rec-0
</code>
is the name of one of the pods associated with the Redis Enterprise cluster.
</p>
<h2 id="using-priority-to-protect-from-preemption">
Using priority to protect from preemption
</h2>
<p>
When a Redis Enterprise node pod is scheduled, it can be assigned a
<a href="https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/">
priority class
</a>
with the
<code>
priorityClassName
</code>
property. This property value is the name of
a priority class that must already exist within the cluster.
</p>
<p>
A sufficiently high priority will prevent other workloads with a lower
priority from preempting the scheduling of Redis Enterprise Nodes. Similarly,
a high value may also prevent eviction when lower priority workloads
are deployed on the same cluster.
</p>
<p>
The successful use of this strategy involves first creating a priority class with a very large priority value:
</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">scheduling.k8s.io/v1</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">PriorityClass</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-priority</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">value</span><span class="p">:</span><span class="w"> </span><span class="m">1000000000</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">globalDefault</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">description</span><span class="p">:</span><span class="w"> </span><span class="s2">"This priority class should be used for Redis Enterprise pods only."</span><span class="w">
</span></span></span></code></pre>
</div>
<p>
Then, you refer to the priority class by name in your Redis Enterprise cluster CRD:
</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">app.redislabs.com/v1</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">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">example-redisenterprisecluster</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"></span><span class="nt">spec</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">size</span><span class="p">:</span><span class="w"> </span><span class="m">3</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">priorityClassName</span><span class="p">:</span><span class="w"> </span><span class="s2">"redis-enterprise-priority"</span><span class="w">
</span></span></span></code></pre>
</div>
<p>
Alternatively, you can also
<a href="https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/#how-to-disable-preemption">
disable preemption entirely
</a>
.
</p>
<h2 id="managing-eviction-thresholds">
Managing eviction thresholds
</h2>
<p>
Eviction thresholds are typically managed by kubelet arguments.
You can set the thresholds:
</p>
<ul>
<li>
On OpenShift - In the
<a href="https://docs.openshift.com/container-platform/3.11/admin_guide/out_of_resource_handling.html#out-of-resource-create-config">
config file
</a>
.
</li>
<li>
On GKE - In the
<a href="https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-architecture#node_allocatable">
managed settings
</a>
.
</li>
</ul>
<p>
We recommend that you:
</p>
<ul>
<li>
Set the
<a href="https://kubernetes.io/docs/tasks/administer-cluster/out-of-resource/#soft-eviction-thresholds">
soft eviction threshold
</a>
to be higher than the
<a href="https://kubernetes.io/docs/tasks/administer-cluster/out-of-resource/#hard-eviction-thresholds">
hard eviction threshold
</a>
.
The high soft threshold makes the node condition change earlier, and alerts the administrator.
</li>
<li>
Set
<code>
eviction-max-pod-grace-period
</code>
high enough to allow the RS pods to migrate the Redis databases before the pods are force killed.
</li>
<li>
Set the
<code>
eviction-soft-grace-period
</code>
high enough that the administrator (or a k8s auto-scaling mechanism) scales k8s up or out.
</li>
</ul>
<h2 id="monitoring-for-memory-and-disk-usage">
Monitoring for memory and disk usage
</h2>
<p>
We recommend that you monitor the node for MemoryPressure and DiskPressure.
When both of these conditions are true, then an
<a href="https://kubernetes.io/docs/tasks/administer-cluster/out-of-resource/#eviction-thresholds">
eviction threshold
</a>
is met and the pod is evicted.
</p>
<p>
To retrieve the flags, run the command:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl"><span class="nv">$kubectl</span> get nodes -o <span class="nv">jsonpath</span><span class="o">=</span><span class="s1">'{range .items[*]}name:{.metadata.name}{"\t"}MemoryPressure:{.status.conditions[?(@.type == "MemoryPressure")].status}{"\t"}DiskPressure:{.status.conditions[?(@.type == "DiskPressure")].status}{"\n"}{end}'</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">name:gke-55d1ac88-213c MemoryPressure:False DiskPressure:False
</span></span><span class="line"><span class="cl">name:gke-55d1ac88-vrpp MemoryPressure:False DiskPressure:False
</span></span><span class="line"><span class="cl">name:gke-7253cc19-42g0 MemoryPressure:False DiskPressure:False
</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/kubernetes/recommendations/pod-stability/"/>
<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.arrappend.html | <section class="prose w-full py-12">
<h1 class="command-name">
JSON.ARRAPPEND
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">JSON.ARRAPPEND key [path] 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/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>
Append the
<code>
json
</code>
values into the array at
<code>
path
</code>
after the last element in it
</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>
value
</code>
</summary>
<p>
is one or more values to append to one or more arrays.
</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">
About using strings with JSON commands:
</div>
To specify a string as an array value to append, wrap the quoted string with an additional set of single quotes. Example:
<code>
'"silver"'
</code>
. For more detailed use, see
<a href="#examples">
Examples
</a>
.
</div>
</div>
</details>
<h2 id="optional-arguments">
Optional arguments
</h2>
<details open="">
<summary>
<code>
path
</code>
</summary>
<p>
is JSONPath to specify. Default is root
<code>
$
</code>
.
</p>
</details>
<h2 id="return-value">
Return value
</h2>
<p>
<code>
JSON.ARRAPEND
</code>
returns an
<a href="/docs/latest/develop/reference/protocol-spec#resp-arrays">
array
</a>
of integer replies for each path, the array's new size, or
<code>
nil
</code>
, if the matching JSON value is not an array.
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>
Add a new color to a list of product colors
</b>
</summary>
<p>
Create a document for noise-cancelling headphones in black and silver colors.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis> JSON.SET item:1 $ <span class="s1">'{"name":"Noise-cancelling Bluetooth headphones","description":"Wireless Bluetooth headphones with noise-cancelling technology","connection":{"wireless":true,"type":"Bluetooth"},"price":99.98,"stock":25,"colors":["black","silver"]}'</span>
</span></span><span class="line"><span class="cl">OK</span></span></code></pre>
</div>
<p>
Add color
<code>
blue
</code>
to the end of the
<code>
colors
</code>
array.
<code>
JSON.ARRAPEND
</code>
returns the array's new size.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis> JSON.ARRAPPEND item:1 $.colors <span class="s1">'"blue"'</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">3</span></span></span></code></pre>
</div>
<p>
Return the new length of the
<code>
colors
</code>
array.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis> JSON.GET item:1
</span></span><span class="line"><span class="cl"><span class="s2">"{\"name\":\"Noise-cancelling Bluetooth headphones\",\"description\":\"Wireless Bluetooth headphones with noise-cancelling technology\",\"connection\":{\"wireless\":true,\"type\":\"Bluetooth\"},\"price\":99.98,\"stock\":25,\"colors\":[\"black\",\"silver\",\"blue\"]}"</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.arrappend/"/>
<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/manage-passwords/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Set password policies
</h1>
<p class="text-lg -mt-5 mb-10">
Set password policies.
</p>
<p>
Redis Enterprise Software provides several ways to manage the passwords of local accounts, including:
</p>
<ul>
<li>
<p>
<a href="/docs/latest/operate/rs/security/access-control/manage-passwords/password-complexity-rules/">
Password complexity rules
</a>
</p>
</li>
<li>
<p>
<a href="/docs/latest/operate/rs/security/access-control/manage-passwords/password-expiration/">
Password expiration
</a>
</p>
</li>
<li>
<p>
<a href="/docs/latest/operate/rs/security/access-control/manage-passwords/rotate-passwords/">
Password rotation
</a>
</p>
</li>
</ul>
<p>
You can also manage a user's ability to
<a href="/docs/latest/operate/rs/security/access-control/manage-users/login-lockout/#user-login-lockout">
sign in
</a>
and control
<a href="/docs/latest/operate/rs/security/access-control/manage-users/login-lockout/#session-timeout">
session timeout
</a>
.
</p>
<p>
To enforce more advanced password policies, we recommend using
<a href="/docs/latest/operate/rs/security/access-control/ldap/">
LDAP integration
</a>
with an external identity provider, such as Active Directory.
</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>
Redis Enterprise Software stores all user passwords using the SHA-256 cryptographic hash function.
</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/security/access-control/manage-passwords/"/>
<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/cluster-spec.html | <section class="prose w-full py-12 max-w-none">
<h1>
Redis cluster specification
</h1>
<p class="text-lg -mt-5 mb-10">
Detailed specification for Redis cluster
</p>
<p>
Welcome to the
<strong>
Redis Cluster Specification
</strong>
. Here you'll find information
about the algorithms and design rationales of Redis Cluster. This document is a work
in progress as it is continuously synchronized with the actual implementation
of Redis.
</p>
<h2 id="main-properties-and-rationales-of-the-design">
Main properties and rationales of the design
</h2>
<h3 id="redis-cluster-goals">
Redis Cluster goals
</h3>
<p>
Redis Cluster is a distributed implementation of Redis with the following goals in order of importance in the design:
</p>
<ul>
<li>
High performance and linear scalability up to 1000 nodes. There are no proxies, asynchronous replication is used, and no merge operations are performed on values.
</li>
<li>
Acceptable degree of write safety: the system tries (in a best-effort way) to retain all the writes originating from clients connected with the majority of the master nodes. Usually there are small windows where acknowledged writes can be lost. Windows to lose acknowledged writes are larger when clients are in a minority partition.
</li>
<li>
Availability: Redis Cluster is able to survive partitions where the majority of the master nodes are reachable and there is at least one reachable replica for every master node that is no longer reachable. Moreover using
<em>
replicas migration
</em>
, masters no longer replicated by any replica will receive one from a master which is covered by multiple replicas.
</li>
</ul>
<p>
What is described in this document is implemented in Redis 3.0 or greater.
</p>
<h3 id="implemented-subset">
Implemented subset
</h3>
<p>
Redis Cluster implements all the single key commands available in the
non-distributed version of Redis. Commands performing complex multi-key
operations like set unions and intersections are implemented for cases where
all of the keys involved in the operation hash to the same slot.
</p>
<p>
Redis Cluster implements a concept called
<strong>
hash tags
</strong>
that can be used
to force certain keys to be stored in the same hash slot. However, during
manual resharding, multi-key operations may become unavailable for some time
while single-key operations are always available.
</p>
<p>
Redis Cluster does not support multiple databases like the standalone version
of Redis. We only support database
<code>
0
</code>
; the
<a href="/commands/select">
<code>
SELECT
</code>
</a>
command is not allowed.
</p>
<h2 id="client-and-server-roles-in-the-redis-cluster-protocol">
Client and Server roles in the Redis cluster protocol
</h2>
<p>
In Redis Cluster, nodes are responsible for holding the data,
and taking the state of the cluster, including mapping keys to the right nodes.
Cluster nodes are also able to auto-discover other nodes, detect non-working
nodes, and promote replica nodes to master when needed in order
to continue to operate when a failure occurs.
</p>
<p>
To perform their tasks all the cluster nodes are connected using a
TCP bus and a binary protocol, called the
<strong>
Redis Cluster Bus
</strong>
.
Every node is connected to every other node in the cluster using the cluster
bus. Nodes use a gossip protocol to propagate information about the cluster
in order to discover new nodes, to send ping packets to make sure all the
other nodes are working properly, and to send cluster messages needed to
signal specific conditions. The cluster bus is also used in order to
propagate Pub/Sub messages across the cluster and to orchestrate manual
failovers when requested by users (manual failovers are failovers which
are not initiated by the Redis Cluster failure detector, but by the
system administrator directly).
</p>
<p>
Since cluster nodes are not able to proxy requests, clients may be redirected
to other nodes using redirection errors
<code>
-MOVED
</code>
and
<code>
-ASK
</code>
.
The client is in theory free to send requests to all the nodes in the cluster,
getting redirected if needed, so the client is not required to hold the
state of the cluster. However clients that are able to cache the map between
keys and nodes can improve the performance in a sensible way.
</p>
<h3 id="write-safety">
Write safety
</h3>
<p>
Redis Cluster uses asynchronous replication between nodes, and
<strong>
last failover wins
</strong>
implicit merge function. This means that the last elected master dataset eventually replaces all the other replicas. There is always a window of time when it is possible to lose writes during partitions. However these windows are very different in the case of a client that is connected to the majority of masters, and a client that is connected to the minority of masters.
</p>
<p>
Redis Cluster tries harder to retain writes that are performed by clients connected to the majority of masters, compared to writes performed in the minority side.
The following are examples of scenarios that lead to loss of acknowledged
writes received in the majority partitions during failures:
</p>
<ol>
<li>
<p>
A write may reach a master, but while the master may be able to reply to the client, the write may not be propagated to replicas via the asynchronous replication used between master and replica nodes. If the master dies without the write reaching the replicas, the write is lost forever if the master is unreachable for a long enough period that one of its replicas is promoted. This is usually hard to observe in the case of a total, sudden failure of a master node since masters try to reply to clients (with the acknowledge of the write) and replicas (propagating the write) at about the same time. However it is a real world failure mode.
</p>
</li>
<li>
<p>
Another theoretically possible failure mode where writes are lost is the following:
</p>
</li>
</ol>
<ul>
<li>
A master is unreachable because of a partition.
</li>
<li>
It gets failed over by one of its replicas.
</li>
<li>
After some time it may be reachable again.
</li>
<li>
A client with an out-of-date routing table may write to the old master before it is converted into a replica (of the new master) by the cluster.
</li>
</ul>
<p>
The second failure mode is unlikely to happen because master nodes unable to communicate with the majority of the other masters for enough time to be failed over will no longer accept writes, and when the partition is fixed writes are still refused for a small amount of time to allow other nodes to inform about configuration changes. This failure mode also requires that the client's routing table has not yet been updated.
</p>
<p>
Writes targeting the minority side of a partition have a larger window in which to get lost. For example, Redis Cluster loses a non-trivial number of writes on partitions where there is a minority of masters and at least one or more clients, since all the writes sent to the masters may potentially get lost if the masters are failed over in the majority side.
</p>
<p>
Specifically, for a master to be failed over it must be unreachable by the majority of masters for at least
<code>
NODE_TIMEOUT
</code>
, so if the partition is fixed before that time, no writes are lost. When the partition lasts for more than
<code>
NODE_TIMEOUT
</code>
, all the writes performed in the minority side up to that point may be lost. However the minority side of a Redis Cluster will start refusing writes as soon as
<code>
NODE_TIMEOUT
</code>
time has elapsed without contact with the majority, so there is a maximum window after which the minority becomes no longer available. Hence, no writes are accepted or lost after that time.
</p>
<h3 id="availability">
Availability
</h3>
<p>
Redis Cluster is not available in the minority side of the partition. In the majority side of the partition assuming that there are at least the majority of masters and a replica for every unreachable master, the cluster becomes available again after
<code>
NODE_TIMEOUT
</code>
time plus a few more seconds required for a replica to get elected and failover its master (failovers are usually executed in a matter of 1 or 2 seconds).
</p>
<p>
This means that Redis Cluster is designed to survive failures of a few nodes in the cluster, but it is not a suitable solution for applications that require availability in the event of large net splits.
</p>
<p>
In the example of a cluster composed of N master nodes where every node has a single replica, the majority side of the cluster will remain available as long as a single node is partitioned away, and will remain available with a probability of
<code>
1-(1/(N*2-1))
</code>
when two nodes are partitioned away (after the first node fails we are left with
<code>
N*2-1
</code>
nodes in total, and the probability of the only master without a replica to fail is
<code>
1/(N*2-1))
</code>
.
</p>
<p>
For example, in a cluster with 5 nodes and a single replica per node, there is a
<code>
1/(5*2-1) = 11.11%
</code>
probability that after two nodes are partitioned away from the majority, the cluster will no longer be available.
</p>
<p>
Thanks to a Redis Cluster feature called
<strong>
replicas migration
</strong>
the Cluster
availability is improved in many real world scenarios by the fact that
replicas migrate to orphaned masters (masters no longer having replicas).
So at every successful failure event, the cluster may reconfigure the replicas
layout in order to better resist the next failure.
</p>
<h3 id="performance">
Performance
</h3>
<p>
In Redis Cluster nodes don't proxy commands to the right node in charge for a given key, but instead they redirect clients to the right nodes serving a given portion of the key space.
</p>
<p>
Eventually clients obtain an up-to-date representation of the cluster and which node serves which subset of keys, so during normal operations clients directly contact the right nodes in order to send a given command.
</p>
<p>
Because of the use of asynchronous replication, nodes do not wait for other nodes' acknowledgment of writes (if not explicitly requested using the
<a href="/commands/wait">
<code>
WAIT
</code>
</a>
command).
</p>
<p>
Also, because multi-key commands are only limited to
<em>
near
</em>
keys, data is never moved between nodes except when resharding.
</p>
<p>
Normal operations are handled exactly as in the case of a single Redis instance. This means that in a Redis Cluster with N master nodes you can expect the same performance as a single Redis instance multiplied by N as the design scales linearly. At the same time the query is usually performed in a single round trip, since clients usually retain persistent connections with the nodes, so latency figures are also the same as the single standalone Redis node case.
</p>
<p>
Very high performance and scalability while preserving weak but
reasonable forms of data safety and availability is the main goal of
Redis Cluster.
</p>
<h3 id="why-merge-operations-are-avoided">
Why merge operations are avoided
</h3>
<p>
The Redis Cluster design avoids conflicting versions of the same key-value pair in multiple nodes as in the case of the Redis data model this is not always desirable. Values in Redis are often very large; it is common to see lists or sorted sets with millions of elements. Also data types are semantically complex. Transferring and merging these kind of values can be a major bottleneck and/or may require the non-trivial involvement of application-side logic, additional memory to store meta-data, and so forth.
</p>
<p>
There are no strict technological limits here. CRDTs or synchronously replicated
state machines can model complex data types similar to Redis. However, the
actual run time behavior of such systems would not be similar to Redis Cluster.
Redis Cluster was designed in order to cover the exact use cases of the
non-clustered Redis version.
</p>
<h2 id="overview-of-redis-cluster-main-components">
Overview of Redis Cluster main components
</h2>
<h3 id="key-distribution-model">
Key distribution model
</h3>
<p>
The cluster's key space is split into 16384 slots, effectively setting an upper limit
for the cluster size of 16384 master nodes (however, the suggested max size of
nodes is on the order of ~ 1000 nodes).
</p>
<p>
Each master node in a cluster handles a subset of the 16384 hash slots.
The cluster is
<strong>
stable
</strong>
when there is no cluster reconfiguration in
progress (i.e. where hash slots are being moved from one node to another).
When the cluster is stable, a single hash slot will be served by a single node
(however the serving node can have one or more replicas that will replace it in the case of net splits or failures,
and that can be used in order to scale read operations where reading stale data is acceptable).
</p>
<p>
The base algorithm used to map keys to hash slots is the following
(read the next paragraph for the hash tag exception to this rule):
</p>
<pre><code>HASH_SLOT = CRC16(key) mod 16384
</code></pre>
<p>
The CRC16 is specified as follows:
</p>
<ul>
<li>
Name: XMODEM (also known as ZMODEM or CRC-16/ACORN)
</li>
<li>
Width: 16 bit
</li>
<li>
Poly: 1021 (That is actually x^16 + x^12 + x^5 + 1)
</li>
<li>
Initialization: 0000
</li>
<li>
Reflect Input byte: False
</li>
<li>
Reflect Output CRC: False
</li>
<li>
Xor constant to output CRC: 0000
</li>
<li>
Output for "123456789": 31C3
</li>
</ul>
<p>
14 out of 16 CRC16 output bits are used (this is why there is
a modulo 16384 operation in the formula above).
</p>
<p>
In our tests CRC16 behaved remarkably well in distributing different kinds of
keys evenly across the 16384 slots.
</p>
<p>
<strong>
Note
</strong>
: A reference implementation of the CRC16 algorithm used is available in the Appendix A of this document.
</p>
<h3 id="hash-tags">
Hash tags
</h3>
<p>
There is an exception for the computation of the hash slot that is used in order
to implement
<strong>
hash tags
</strong>
. Hash tags are a way to ensure that multiple keys
are allocated in the same hash slot. This is used in order to implement
multi-key operations in Redis Cluster.
</p>
<p>
To implement hash tags, the hash slot for a key is computed in a
slightly different way in certain conditions.
If the key contains a "{...}" pattern only the substring between
<code>
{
</code>
and
<code>
}
</code>
is hashed in order to obtain the hash slot. However since it is
possible that there are multiple occurrences of
<code>
{
</code>
or
<code>
}
</code>
the algorithm is
well specified by the following rules:
</p>
<ul>
<li>
IF the key contains a
<code>
{
</code>
character.
</li>
<li>
AND IF there is a
<code>
}
</code>
character to the right of
<code>
{
</code>
.
</li>
<li>
AND IF there are one or more characters between the first occurrence of
<code>
{
</code>
and the first occurrence of
<code>
}
</code>
.
</li>
</ul>
<p>
Then instead of hashing the key, only what is between the first occurrence of
<code>
{
</code>
and the following first occurrence of
<code>
}
</code>
is hashed.
</p>
<p>
Examples:
</p>
<ul>
<li>
The two keys
<code>
{user1000}.following
</code>
and
<code>
{user1000}.followers
</code>
will hash to the same hash slot since only the substring
<code>
user1000
</code>
will be hashed in order to compute the hash slot.
</li>
<li>
For the key
<code>
foo{}{bar}
</code>
the whole key will be hashed as usually since the first occurrence of
<code>
{
</code>
is followed by
<code>
}
</code>
on the right without characters in the middle.
</li>
<li>
For the key
<code>
foo{{bar}}zap
</code>
the substring
<code>
{bar
</code>
will be hashed, because it is the substring between the first occurrence of
<code>
{
</code>
and the first occurrence of
<code>
}
</code>
on its right.
</li>
<li>
For the key
<code>
foo{bar}{zap}
</code>
the substring
<code>
bar
</code>
will be hashed, since the algorithm stops at the first valid or invalid (without bytes inside) match of
<code>
{
</code>
and
<code>
}
</code>
.
</li>
<li>
What follows from the algorithm is that if the key starts with
<code>
{}
</code>
, it is guaranteed to be hashed as a whole. This is useful when using binary data as key names.
</li>
</ul>
<h4 id="glob-style-patterns">
Glob-style patterns
</h4>
<p>
Commands accepting a glob-style pattern, including
<a href="/commands/keys">
<code>
KEYS
</code>
</a>
,
<a href="/commands/scan">
<code>
SCAN
</code>
</a>
and
<a href="/commands/sort">
<code>
SORT
</code>
</a>
, are optimized for patterns that imply a single slot.
This means that if all keys that can match a pattern must belong to a specific slot, only this slot is searched for keys matching the pattern.
The pattern slot optimization is introduced in Redis 8.0.
</p>
<p>
The optimization kicks in when the pattern meets the following conditions:
</p>
<ul>
<li>
the pattern contains a hashtag,
</li>
<li>
there are no wildcards or escape characters before the hashtag, and
</li>
<li>
the hashtag within curly braces doesn't contain any wildcards or escape characters.
</li>
</ul>
<p>
For example,
<code>
SCAN 0 MATCH {abc}*
</code>
can successfully recognize the hashtag and scans only the slot corresponding to
<code>
abc
</code>
.
However, the patterns
<code>
*{abc}
</code>
,
<code>
{a*c}
</code>
, or
<code>
{a\*bc}
</code>
cannot recognize the hashtag, so all slots need to be scanned.
</p>
<h4 id="hash-slot-example-code">
Hash slot example code
</h4>
<p>
Adding the hash tags exception, the following is an implementation of the
<code>
HASH_SLOT
</code>
function in Ruby and C language.
</p>
<p>
Ruby example code:
</p>
<pre><code>def HASH_SLOT(key)
s = key.index "{"
if s
e = key.index "}",s+1
if e && e != s+1
key = key[s+1..e-1]
end
end
crc16(key) % 16384
end
</code></pre>
<p>
C example code:
</p>
<pre><code>unsigned int HASH_SLOT(char *key, int keylen) {
int s, e; /* start-end indexes of { and } */
/* Search the first occurrence of '{'. */
for (s = 0; s < keylen; s++)
if (key[s] == '{') break;
/* No '{' ? Hash the whole key. This is the base case. */
if (s == keylen) return crc16(key,keylen) & 16383;
/* '{' found? Check if we have the corresponding '}'. */
for (e = s+1; e < keylen; e++)
if (key[e] == '}') break;
/* No '}' or nothing between {} ? Hash the whole key. */
if (e == keylen || e == s+1) return crc16(key,keylen) & 16383;
/* If we are here there is both a { and a } on its right. Hash
* what is in the middle between { and }. */
return crc16(key+s+1,e-s-1) & 16383;
}
</code></pre>
<h3 id="cluster-node-attributes">
Cluster node attributes
</h3>
<p>
Every node has a unique name in the cluster. The node name is the
hex representation of a 160 bit random number, obtained the first time a
node is started (usually using /dev/urandom).
The node will save its ID in the node configuration file, and will use the
same ID forever, or at least as long as the node configuration file is not
deleted by the system administrator, or a
<em>
hard reset
</em>
is requested
via the
<a href="/commands/cluster-reset">
<code>
CLUSTER RESET
</code>
</a>
command.
</p>
<p>
The node ID is used to identify every node across the whole cluster.
It is possible for a given node to change its IP address without any need
to also change the node ID. The cluster is also able to detect the change
in IP/port and reconfigure using the gossip protocol running over the cluster
bus.
</p>
<p>
The node ID is not the only information associated with each node, but is
the only one that is always globally consistent. Every node has also the
following set of information associated. Some information is about the
cluster configuration detail of this specific node, and is eventually
consistent across the cluster. Some other information, like the last time
a node was pinged, is instead local to each node.
</p>
<p>
Every node maintains the following information about other nodes that it is
aware of in the cluster: The node ID, IP and port of the node, a set of
flags, what is the master of the node if it is flagged as
<code>
replica
</code>
, last time
the node was pinged and the last time the pong was received, the current
<em>
configuration epoch
</em>
of the node (explained later in this specification),
the link state and finally the set of hash slots served.
</p>
<p>
A detailed
<a href="/docs/latest/commands/cluster-nodes/">
explanation of all the node fields
</a>
is described in the
<a href="/commands/cluster-nodes">
<code>
CLUSTER NODES
</code>
</a>
documentation.
</p>
<p>
The
<a href="/commands/cluster-nodes">
<code>
CLUSTER NODES
</code>
</a>
command can be sent to any node in the cluster and provides the state of the cluster and the information for each node according to the local view the queried node has of the cluster.
</p>
<p>
The following is sample output of the
<a href="/commands/cluster-nodes">
<code>
CLUSTER NODES
</code>
</a>
command sent to a master
node in a small cluster of three nodes.
</p>
<pre><code>$ redis-cli cluster nodes
d1861060fe6a534d42d8a19aeb36600e18785e04 127.0.0.1:6379 myself - 0 1318428930 1 connected 0-1364
3886e65cc906bfd9b1f7e7bde468726a052d1dae 127.0.0.1:6380 master - 1318428930 1318428931 2 connected 1365-2729
d289c575dcbc4bdd2931585fd4339089e461a27d 127.0.0.1:6381 master - 1318428931 1318428931 3 connected 2730-4095
</code></pre>
<p>
In the above listing the different fields are in order: node id, address:port, flags, last ping sent, last pong received, configuration epoch, link state, slots. Details about the above fields will be covered as soon as we talk of specific parts of Redis Cluster.
</p>
<h3 id="the-cluster-bus">
The cluster bus
</h3>
<p>
Every Redis Cluster node has an additional TCP port for receiving
incoming connections from other Redis Cluster nodes. This port will be derived by adding 10000 to the data port or it can be specified with the cluster-port config.
</p>
<p>
Example 1:
</p>
<p>
If a Redis node is listening for client connections on port 6379,
and you do not add cluster-port parameter in redis.conf,
the Cluster bus port 16379 will be opened.
</p>
<p>
Example 2:
</p>
<p>
If a Redis node is listening for client connections on port 6379,
and you set cluster-port 20000 in redis.conf,
the Cluster bus port 20000 will be opened.
</p>
<p>
Node-to-node communication happens exclusively using the Cluster bus and
the Cluster bus protocol: a binary protocol composed of frames
of different types and sizes. The Cluster bus binary protocol is not
publicly documented since it is not intended for external software devices
to talk with Redis Cluster nodes using this protocol. However you can
obtain more details about the Cluster bus protocol by reading the
<code>
cluster.h
</code>
and
<code>
cluster.c
</code>
files in the Redis Cluster source code.
</p>
<h3 id="cluster-topology">
Cluster topology
</h3>
<p>
Redis Cluster is a full mesh where every node is connected with every other node using a TCP connection.
</p>
<p>
In a cluster of N nodes, every node has N-1 outgoing TCP connections, and N-1 incoming connections.
</p>
<p>
These TCP connections are kept alive all the time and are not created on demand.
When a node expects a pong reply in response to a ping in the cluster bus, before waiting long enough to mark the node as unreachable, it will try to
refresh the connection with the node by reconnecting from scratch.
</p>
<p>
While Redis Cluster nodes form a full mesh,
<strong>
nodes use a gossip protocol and
a configuration update mechanism in order to avoid exchanging too many
messages between nodes during normal conditions
</strong>
, so the number of messages
exchanged is not exponential.
</p>
<h3 id="node-handshake">
Node handshake
</h3>
<p>
Nodes always accept connections on the cluster bus port, and even reply to
pings when received, even if the pinging node is not trusted.
However, all other packets will be discarded by the receiving node if the
sending node is not considered part of the cluster.
</p>
<p>
A node will accept another node as part of the cluster only in two ways:
</p>
<ul>
<li>
<p>
If a node presents itself with a
<code>
MEET
</code>
message (
<a href="/commands/cluster-meet">
<code>
CLUSTER MEET
</code>
</a>
command). A meet message is exactly
like a
<a href="/commands/ping">
<code>
PING
</code>
</a>
message, but forces the receiver to accept the node as part of
the cluster. Nodes will send
<code>
MEET
</code>
messages to other nodes
<strong>
only if
</strong>
the system administrator requests this via the following command:
</p>
<p>
CLUSTER MEET ip port
</p>
</li>
<li>
<p>
A node will also register another node as part of the cluster if a node that is already trusted will gossip about this other node. So if A knows B, and B knows C, eventually B will send gossip messages to A about C. When this happens, A will register C as part of the network, and will try to connect with C.
</p>
</li>
</ul>
<p>
This means that as long as we join nodes in any connected graph, they'll eventually form a fully connected graph automatically. This means that the cluster is able to auto-discover other nodes, but only if there is a trusted relationship that was forced by the system administrator.
</p>
<p>
This mechanism makes the cluster more robust but prevents different Redis clusters from accidentally mixing after change of IP addresses or other network related events.
</p>
<h2 id="redirection-and-resharding">
Redirection and resharding
</h2>
<h3 id="moved-redirection">
MOVED Redirection
</h3>
<p>
A Redis client is free to send queries to every node in the cluster, including
replica nodes. The node will analyze the query, and if it is acceptable
(that is, only a single key is mentioned in the query, or the multiple keys
mentioned are all to the same hash slot) it will lookup what
node is responsible for the hash slot where the key or keys belong.
</p>
<p>
If the hash slot is served by the node, the query is simply processed, otherwise
the node will check its internal hash slot to node map, and will reply
to the client with a MOVED error, like in the following example:
</p>
<pre><code>GET x
-MOVED 3999 127.0.0.1:6381
</code></pre>
<p>
The error includes the hash slot of the key (3999) and the endpoint:port of the instance that can serve the query.
The client needs to reissue the query to the specified node's endpoint address and port.
The endpoint can be either an IP address, a hostname, or it can be empty (e.g.
<code>
-MOVED 3999 :6380
</code>
).
An empty endpoint indicates that the server node has an unknown endpoint, and the client should send the next request to the same endpoint as the current request but with the provided port.
</p>
<p>
Note that even if the client waits a long time before reissuing the query,
and in the meantime the cluster configuration changed, the destination node
will reply again with a MOVED error if the hash slot 3999 is now served by
another node. The same happens if the contacted node had no updated information.
</p>
<p>
So while from the point of view of the cluster nodes are identified by
IDs we try to simplify our interface with the client just exposing a map
between hash slots and Redis nodes identified by endpoint:port pairs.
</p>
<p>
The client is not required to, but should try to memorize that hash slot
3999 is served by 127.0.0.1:6381. This way once a new command needs to
be issued it can compute the hash slot of the target key and have a
greater chance of choosing the right node.
</p>
<p>
An alternative is to just refresh the whole client-side cluster layout
using the
<a href="/commands/cluster-shards">
<code>
CLUSTER SHARDS
</code>
</a>
, or the deprecated
<a href="/commands/cluster-slots">
<code>
CLUSTER SLOTS
</code>
</a>
, command
when a MOVED redirection is received. When a redirection is encountered, it
is likely multiple slots were reconfigured rather than just one, so updating
the client configuration as soon as possible is often the best strategy.
</p>
<p>
Note that when the Cluster is stable (no ongoing changes in the configuration),
eventually all the clients will obtain a map of hash slots -> nodes, making
the cluster efficient, with clients directly addressing the right nodes
without redirections, proxies or other single point of failure entities.
</p>
<p>
A client
<strong>
must be also able to handle -ASK redirections
</strong>
that are described
later in this document, otherwise it is not a complete Redis Cluster client.
</p>
<h3 id="live-reconfiguration">
Live reconfiguration
</h3>
<p>
Redis Cluster supports the ability to add and remove nodes while the cluster
is running. Adding or removing a node is abstracted into the same
operation: moving a hash slot from one node to another. This means
that the same basic mechanism can be used in order to rebalance the cluster, add
or remove nodes, and so forth.
</p>
<ul>
<li>
To add a new node to the cluster an empty node is added to the cluster and some set of hash slots are moved from existing nodes to the new node.
</li>
<li>
To remove a node from the cluster the hash slots assigned to that node are moved to other existing nodes.
</li>
<li>
To rebalance the cluster a given set of hash slots are moved between nodes.
</li>
</ul>
<p>
The core of the implementation is the ability to move hash slots around.
From a practical point of view a hash slot is just a set of keys, so
what Redis Cluster really does during
<em>
resharding
</em>
is to move keys from
an instance to another instance. Moving a hash slot means moving all the keys
that happen to hash into this hash slot.
</p>
<p>
To understand how this works we need to show the
<a href="/commands/cluster">
<code>
CLUSTER
</code>
</a>
subcommands
that are used to manipulate the slots translation table in a Redis Cluster node.
</p>
<p>
The following subcommands are available (among others not useful in this case):
</p>
<ul>
<li>
<a href="/commands/cluster-addslots">
<code>
CLUSTER ADDSLOTS
</code>
</a>
slot1 [slot2] ... [slotN]
</li>
<li>
<a href="/commands/cluster-delslots">
<code>
CLUSTER DELSLOTS
</code>
</a>
slot1 [slot2] ... [slotN]
</li>
<li>
<a href="/commands/cluster-addslotsrange">
<code>
CLUSTER ADDSLOTSRANGE
</code>
</a>
start-slot1 end-slot1 [start-slot2 end-slot2] ... [start-slotN end-slotN]
</li>
<li>
<a href="/commands/cluster-delslotsrange">
<code>
CLUSTER DELSLOTSRANGE
</code>
</a>
start-slot1 end-slot1 [start-slot2 end-slot2] ... [start-slotN end-slotN]
</li>
<li>
<a href="/commands/cluster-setslot">
<code>
CLUSTER SETSLOT
</code>
</a>
slot NODE node
</li>
<li>
<a href="/commands/cluster-setslot">
<code>
CLUSTER SETSLOT
</code>
</a>
slot MIGRATING node
</li>
<li>
<a href="/commands/cluster-setslot">
<code>
CLUSTER SETSLOT
</code>
</a>
slot IMPORTING node
</li>
</ul>
<p>
The first four commands,
<code>
ADDSLOTS
</code>
,
<code>
DELSLOTS
</code>
,
<code>
ADDSLOTSRANGE
</code>
and
<code>
DELSLOTSRANGE
</code>
, are simply used to assign
(or remove) slots to a Redis node. Assigning a slot means to tell a given
master node that it will be in charge of storing and serving content for
the specified hash slot.
</p>
<p>
After the hash slots are assigned they will propagate across the cluster
using the gossip protocol, as specified later in the
<em>
configuration propagation
</em>
section.
</p>
<p>
The
<code>
ADDSLOTS
</code>
and
<code>
ADDSLOTSRANGE
</code>
commands are usually used when a new cluster is created
from scratch to assign each master node a subset of all the 16384 hash
slots available.
</p>
<p>
The
<code>
DELSLOTS
</code>
and
<code>
DELSLOTSRANGE
</code>
are mainly used for manual modification of a cluster configuration
or for debugging tasks: in practice it is rarely used.
</p>
<p>
The
<code>
SETSLOT
</code>
subcommand is used to assign a slot to a specific node ID if
the
<code>
SETSLOT <slot> NODE
</code>
form is used. Otherwise the slot can be set in the
two special states
<code>
MIGRATING
</code>
and
<code>
IMPORTING
</code>
. Those two special states
are used in order to migrate a hash slot from one node to another.
</p>
<ul>
<li>
When a slot is set as MIGRATING, the node will accept all queries that
are about this hash slot, but only if the key in question
exists, otherwise the query is forwarded using a
<code>
-ASK
</code>
redirection to the
node that is target of the migration.
</li>
<li>
When a slot is set as IMPORTING, the node will accept all queries that
are about this hash slot, but only if the request is
preceded by an
<a href="/commands/asking">
<code>
ASKING
</code>
</a>
command. If the
<a href="/commands/asking">
<code>
ASKING
</code>
</a>
command was not given
by the client, the query is redirected to the real hash slot owner via
a
<code>
-MOVED
</code>
redirection error, as would happen normally.
</li>
</ul>
<p>
Let's make this clearer with an example of hash slot migration.
Assume that we have two Redis master nodes, called A and B.
We want to move hash slot 8 from A to B, so we issue commands like this:
</p>
<ul>
<li>
We send B: CLUSTER SETSLOT 8 IMPORTING A
</li>
<li>
We send A: CLUSTER SETSLOT 8 MIGRATING B
</li>
</ul>
<p>
All the other nodes will continue to point clients to node "A" every time
they are queried with a key that belongs to hash slot 8, so what happens
is that:
</p>
<ul>
<li>
All queries about existing keys are processed by "A".
</li>
<li>
All queries about non-existing keys in A are processed by "B", because "A" will redirect clients to "B".
</li>
</ul>
<p>
This way we no longer create new keys in "A".
In the meantime,
<code>
redis-cli
</code>
used during reshardings
and Redis Cluster configuration will migrate existing keys in
hash slot 8 from A to B.
This is performed using the following command:
</p>
<pre><code>CLUSTER GETKEYSINSLOT slot count
</code></pre>
<p>
The above command will return
<code>
count
</code>
keys in the specified hash slot.
For keys returned,
<code>
redis-cli
</code>
sends node "A" a
<a href="/commands/migrate">
<code>
MIGRATE
</code>
</a>
command, that
will migrate the specified keys from A to B in an atomic way (both instances
are locked for the time (usually very small time) needed to migrate keys so
there are no race conditions). This is how
<a href="/commands/migrate">
<code>
MIGRATE
</code>
</a>
works:
</p>
<pre><code>MIGRATE target_host target_port "" target_database id timeout KEYS key1 key2 ...
</code></pre>
<p>
<a href="/commands/migrate">
<code>
MIGRATE
</code>
</a>
will connect to the target instance, send a serialized version of
the key, and once an OK code is received, the old key from its own dataset
will be deleted. From the point of view of an external client a key exists
either in A or B at any given time.
</p>
<p>
In Redis Cluster there is no need to specify a database other than 0, but
<a href="/commands/migrate">
<code>
MIGRATE
</code>
</a>
is a general command that can be used for other tasks not
involving Redis Cluster.
<a href="/commands/migrate">
<code>
MIGRATE
</code>
</a>
is optimized to be as fast as possible even when moving complex
keys such as long lists, but in Redis Cluster reconfiguring the
cluster where big keys are present is not considered a wise procedure if
there are latency constraints in the application using the database.
</p>
<p>
When the migration process is finally finished, the
<code>
SETSLOT <slot> NODE <node-id>
</code>
command is sent to the two nodes involved in the migration in order to
set the slots to their normal state again. The same command is usually
sent to all other nodes to avoid waiting for the natural
propagation of the new configuration across the cluster.
</p>
<h3 id="ask-redirection">
ASK redirection
</h3>
<p>
In the previous section, we briefly talked about ASK redirection. Why can't
we simply use MOVED redirection? Because while MOVED means that
we think the hash slot is permanently served by a different node and the
next queries should be tried against the specified node. ASK means to
send only the next query to the specified node.
</p>
<p>
This is needed because the next query about hash slot 8 can be about a
key that is still in A, so we always want the client to try A and
then B if needed. Since this happens only for one hash slot out of 16384
available, the performance hit on the cluster is acceptable.
</p>
<p>
We need to force that client behavior, so to make sure
that clients will only try node B after A was tried, node B will only
accept queries of a slot that is set as IMPORTING if the client sends the
ASKING command before sending the query.
</p>
<p>
Basically the ASKING command sets a one-time flag on the client that forces
a node to serve a query about an IMPORTING slot.
</p>
<p>
The full semantics of ASK redirection from the point of view of the client is as follows:
</p>
<ul>
<li>
If ASK redirection is received, send only the query that was redirected to the specified node but continue sending subsequent queries to the old node.
</li>
<li>
Start the redirected query with the ASKING command.
</li>
<li>
Don't yet update local client tables to map hash slot 8 to B.
</li>
</ul>
<p>
Once hash slot 8 migration is completed, A will send a MOVED message and
the client may permanently map hash slot 8 to the new endpoint and port pair.
Note that if a buggy client performs the map earlier this is not
a problem since it will not send the ASKING command before issuing the query,
so B will redirect the client to A using a MOVED redirection error.
</p>
<p>
Slots migration is explained in similar terms but with different wording
(for the sake of redundancy in the documentation) in the
<a href="/commands/cluster-setslot">
<code>
CLUSTER SETSLOT
</code>
</a>
command documentation.
</p>
<h3 id="client-connections-and-redirection-handling">
Client connections and redirection handling
</h3>
<p>
To be efficient, Redis Cluster clients maintain a map of the current slot
configuration. However, this configuration is not
<em>
required
</em>
to be up to date.
When contacting the wrong node results in a redirection, the client
can update its internal slot map accordingly.
</p>
<p>
Clients usually need to fetch a complete list of slots and mapped node
addresses in two different situations:
</p>
<ul>
<li>
At startup, to populate the initial slots configuration
</li>
<li>
When the client receives a
<code>
MOVED
</code>
redirection
</li>
</ul>
<p>
Note that a client may handle the
<code>
MOVED
</code>
redirection by updating just the
moved slot in its table; however this is usually not efficient because often
the configuration of multiple slots will be modified at once. For example, if a
replica is promoted to master, all of the slots served by the old master will
be remapped). It is much simpler to react to a
<code>
MOVED
</code>
redirection by
fetching the full map of slots to nodes from scratch.
</p>
<p>
Client can issue a
<a href="/commands/cluster-slots">
<code>
CLUSTER SLOTS
</code>
</a>
command to retrieve an array of slot
ranges and the associated master and replica nodes serving the specified ranges.
</p>
<p>
The following is an example of output of
<a href="/commands/cluster-slots">
<code>
CLUSTER SLOTS
</code>
</a>
:
</p>
<pre tabindex="0"><code>127.0.0.1:7000> cluster slots
1) 1) (integer) 5461
2) (integer) 10922
3) 1) "127.0.0.1"
2) (integer) 7001
4) 1) "127.0.0.1"
2) (integer) 7004
2) 1) (integer) 0
2) (integer) 5460
3) 1) "127.0.0.1"
2) (integer) 7000
4) 1) "127.0.0.1"
2) (integer) 7003
3) 1) (integer) 10923
2) (integer) 16383
3) 1) "127.0.0.1"
2) (integer) 7002
4) 1) "127.0.0.1"
2) (integer) 7005
</code></pre>
<p>
The first two sub-elements of every element of the returned array are the
start and end slots of the range. The additional elements represent address-port
pairs. The first address-port pair is the master serving the slot, and the
additional address-port pairs are the replicas serving the same slot. Replicas
will be listed only when not in an error condition (i.e., when their FAIL flag is not set).
</p>
<p>
The first element in the output above says that slots from 5461 to 10922
(start and end included) are served by 127.0.0.1:7001, and it is possible
to scale read-only load contacting the replica at 127.0.0.1:7004.
</p>
<p>
<a href="/commands/cluster-slots">
<code>
CLUSTER SLOTS
</code>
</a>
is not guaranteed to return ranges that cover the full
16384 slots if the cluster is misconfigured, so clients should initialize the
slots configuration map filling the target nodes with NULL objects, and
report an error if the user tries to execute commands about keys
that belong to unassigned slots.
</p>
<p>
Before returning an error to the caller when a slot is found to
be unassigned, the client should try to fetch the slots configuration
again to check if the cluster is now configured properly.
</p>
<h3 id="multi-keys-operations">
Multi-keys operations
</h3>
<p>
Using hash tags, clients are free to use multi-key operations.
For example the following operation is valid:
</p>
<pre><code>MSET {user:1000}.name Angela {user:1000}.surname White
</code></pre>
<p>
Multi-key operations may become unavailable when a resharding of the
hash slot the keys belong to is in progress.
</p>
<p>
More specifically, even during a resharding the multi-key operations targeting
keys that all exist and all still hash to the same slot (either the source or
destination node) are still available.
</p>
<p>
Operations on keys that don't exist or are - during the resharding - split
between the source and destination nodes, will generate a
<code>
-TRYAGAIN
</code>
error.
The client can try the operation after some time, or report back the error.
</p>
<p>
As soon as migration of the specified hash slot has terminated, all
multi-key operations are available again for that hash slot.
</p>
<h3 id="scaling-reads-using-replica-nodes">
Scaling reads using replica nodes
</h3>
<p>
Normally replica nodes will redirect clients to the authoritative master for
the hash slot involved in a given command, however clients can use replicas
in order to scale reads using the
<a href="/commands/readonly">
<code>
READONLY
</code>
</a>
command.
</p>
<p>
<a href="/commands/readonly">
<code>
READONLY
</code>
</a>
tells a Redis Cluster replica node that the client is ok reading
possibly stale data and is not interested in running write queries.
</p>
<p>
When the connection is in readonly mode, the cluster will send a redirection
to the client only if the operation involves keys not served
by the replica's master node. This may happen because:
</p>
<ol>
<li>
The client sent a command about hash slots never served by the master of this replica.
</li>
<li>
The cluster was reconfigured (for example resharded) and the replica is no longer able to serve commands for a given hash slot.
</li>
</ol>
<p>
When this happens the client should update its hash slot map as explained in
the previous sections.
</p>
<p>
The readonly state of the connection can be cleared using the
<a href="/commands/readwrite">
<code>
READWRITE
</code>
</a>
command.
</p>
<h2 id="fault-tolerance">
Fault Tolerance
</h2>
<h3 id="heartbeat-and-gossip-messages">
Heartbeat and gossip messages
</h3>
<p>
Redis Cluster nodes continuously exchange ping and pong packets. Those two kinds of packets have the same structure, and both carry important configuration information. The only actual difference is the message type field. We'll refer to the sum of ping and pong packets as
<em>
heartbeat packets
</em>
.
</p>
<p>
Usually nodes send ping packets that will trigger the receivers to reply with pong packets. However this is not necessarily true. It is possible for nodes to just send pong packets to send information to other nodes about their configuration, without triggering a reply. This is useful, for example, in order to broadcast a new configuration as soon as possible.
</p>
<p>
Usually a node will ping a few random nodes every second so that the total number of ping packets sent (and pong packets received) by each node is a constant amount regardless of the number of nodes in the cluster.
</p>
<p>
However every node makes sure to ping every other node that hasn't sent a ping or received a pong for longer than half the
<code>
NODE_TIMEOUT
</code>
time. Before
<code>
NODE_TIMEOUT
</code>
has elapsed, nodes also try to reconnect the TCP link with another node to make sure nodes are not believed to be unreachable only because there is a problem in the current TCP connection.
</p>
<p>
The number of messages globally exchanged can be sizable if
<code>
NODE_TIMEOUT
</code>
is set to a small figure and the number of nodes (N) is very large, since every node will try to ping every other node for which they don't have fresh information every half the
<code>
NODE_TIMEOUT
</code>
time.
</p>
<p>
For example in a 100 node cluster with a node timeout set to 60 seconds, every node will try to send 99 pings every 30 seconds, with a total amount of pings of 3.3 per second. Multiplied by 100 nodes, this is 330 pings per second in the total cluster.
</p>
<p>
There are ways to lower the number of messages, however there have been no
reported issues with the bandwidth currently used by Redis Cluster failure
detection, so for now the obvious and direct design is used. Note that even
in the above example, the 330 packets per second exchanged are evenly
divided among 100 different nodes, so the traffic each node receives
is acceptable.
</p>
<h3 id="heartbeat-packet-content">
Heartbeat packet content
</h3>
<p>
Ping and pong packets contain a header that is common to all types of packets (for instance packets to request a failover vote), and a special gossip section that is specific to Ping and Pong packets.
</p>
<p>
The common header has the following information:
</p>
<ul>
<li>
Node ID, a 160 bit pseudorandom string that is assigned the first time a node is created and remains the same for all the life of a Redis Cluster node.
</li>
<li>
The
<code>
currentEpoch
</code>
and
<code>
configEpoch
</code>
fields of the sending node that are used to mount the distributed algorithms used by Redis Cluster (this is explained in detail in the next sections). If the node is a replica the
<code>
configEpoch
</code>
is the last known
<code>
configEpoch
</code>
of its master.
</li>
<li>
The node flags, indicating if the node is a replica, a master, and other single-bit node information.
</li>
<li>
A bitmap of the hash slots served by the sending node, or if the node is a replica, a bitmap of the slots served by its master.
</li>
<li>
The sender TCP base port that is the port used by Redis to accept client commands.
</li>
<li>
The cluster port that is the port used by Redis for node-to-node communication.
</li>
<li>
The state of the cluster from the point of view of the sender (down or ok).
</li>
<li>
The master node ID of the sending node, if it is a replica.
</li>
</ul>
<p>
Ping and pong packets also contain a gossip section. This section offers to the receiver a view of what the sender node thinks about other nodes in the cluster. The gossip section only contains information about a few random nodes among the set of nodes known to the sender. The number of nodes mentioned in a gossip section is proportional to the cluster size.
</p>
<p>
For every node added in the gossip section the following fields are reported:
</p>
<ul>
<li>
Node ID.
</li>
<li>
IP and port of the node.
</li>
<li>
Node flags.
</li>
</ul>
<p>
Gossip sections allow receiving nodes to get information about the state of other nodes from the point of view of the sender. This is useful both for failure detection and to discover other nodes in the cluster.
</p>
<h3 id="failure-detection">
Failure detection
</h3>
<p>
Redis Cluster failure detection is used to recognize when a master or replica node is no longer reachable by the majority of nodes and then respond by promoting a replica to the role of master. When replica promotion is not possible the cluster is put in an error state to stop receiving queries from clients.
</p>
<p>
As already mentioned, every node takes a list of flags associated with other known nodes. There are two flags that are used for failure detection that are called
<code>
PFAIL
</code>
and
<code>
FAIL
</code>
.
<code>
PFAIL
</code>
means
<em>
Possible failure
</em>
, and is a non-acknowledged failure type.
<code>
FAIL
</code>
means that a node is failing and that this condition was confirmed by a majority of masters within a fixed amount of time.
</p>
<p>
<strong>
PFAIL flag:
</strong>
</p>
<p>
A node flags another node with the
<code>
PFAIL
</code>
flag when the node is not reachable for more than
<code>
NODE_TIMEOUT
</code>
time. Both master and replica nodes can flag another node as
<code>
PFAIL
</code>
, regardless of its type.
</p>
<p>
The concept of non-reachability for a Redis Cluster node is that we have an
<strong>
active ping
</strong>
(a ping that we sent for which we have yet to get a reply) pending for longer than
<code>
NODE_TIMEOUT
</code>
. For this mechanism to work the
<code>
NODE_TIMEOUT
</code>
must be large compared to the network round trip time. In order to add reliability during normal operations, nodes will try to reconnect with other nodes in the cluster as soon as half of the
<code>
NODE_TIMEOUT
</code>
has elapsed without a reply to a ping. This mechanism ensures that connections are kept alive so broken connections usually won't result in false failure reports between nodes.
</p>
<p>
<strong>
FAIL flag:
</strong>
</p>
<p>
The
<code>
PFAIL
</code>
flag alone is just local information every node has about other nodes, but it is not sufficient to trigger a replica promotion. For a node to be considered down the
<code>
PFAIL
</code>
condition needs to be escalated to a
<code>
FAIL
</code>
condition.
</p>
<p>
As outlined in the node heartbeats section of this document, every node sends gossip messages to every other node including the state of a few random known nodes. Every node eventually receives a set of node flags for every other node. This way every node has a mechanism to signal other nodes about failure conditions they have detected.
</p>
<p>
A
<code>
PFAIL
</code>
condition is escalated to a
<code>
FAIL
</code>
condition when the following set of conditions are met:
</p>
<ul>
<li>
Some node, that we'll call A, has another node B flagged as
<code>
PFAIL
</code>
.
</li>
<li>
Node A collected, via gossip sections, information about the state of B from the point of view of the majority of masters in the cluster.
</li>
<li>
The majority of masters signaled the
<code>
PFAIL
</code>
or
<code>
FAIL
</code>
condition within
<code>
NODE_TIMEOUT * FAIL_REPORT_VALIDITY_MULT
</code>
time. (The validity factor is set to 2 in the current implementation, so this is just two times the
<code>
NODE_TIMEOUT
</code>
time).
</li>
</ul>
<p>
If all the above conditions are true, Node A will:
</p>
<ul>
<li>
Mark the node as
<code>
FAIL
</code>
.
</li>
<li>
Send a
<code>
FAIL
</code>
message (as opposed to a
<code>
FAIL
</code>
condition within a heartbeat message) to all the reachable nodes.
</li>
</ul>
<p>
The
<code>
FAIL
</code>
message will force every receiving node to mark the node in
<code>
FAIL
</code>
state, whether or not it already flagged the node in
<code>
PFAIL
</code>
state.
</p>
<p>
Note that
<em>
the FAIL flag is mostly one way
</em>
. That is, a node can go from
<code>
PFAIL
</code>
to
<code>
FAIL
</code>
, but a
<code>
FAIL
</code>
flag can only be cleared in the following situations:
</p>
<ul>
<li>
The node is already reachable and is a replica. In this case the
<code>
FAIL
</code>
flag can be cleared as replicas are not failed over.
</li>
<li>
The node is already reachable and is a master not serving any slot. In this case the
<code>
FAIL
</code>
flag can be cleared as masters without slots do not really participate in the cluster and are waiting to be configured in order to join the cluster.
</li>
<li>
The node is already reachable and is a master, but a long time (N times the
<code>
NODE_TIMEOUT
</code>
) has elapsed without any detectable replica promotion. It's better for it to rejoin the cluster and continue in this case.
</li>
</ul>
<p>
It is useful to note that while the
<code>
PFAIL
</code>
->
<code>
FAIL
</code>
transition uses a form of agreement, the agreement used is weak:
</p>
<ol>
<li>
Nodes collect views of other nodes over some time period, so even if the majority of master nodes need to "agree", actually this is just state that we collected from different nodes at different times and we are not sure, nor we require, that at a given moment the majority of masters agreed. However we discard failure reports which are old, so the failure was signaled by the majority of masters within a window of time.
</li>
<li>
While every node detecting the
<code>
FAIL
</code>
condition will force that condition on other nodes in the cluster using the
<code>
FAIL
</code>
message, there is no way to ensure the message will reach all the nodes. For instance a node may detect the
<code>
FAIL
</code>
condition and because of a partition will not be able to reach any other node.
</li>
</ol>
<p>
However the Redis Cluster failure detection has a liveness requirement: eventually all the nodes should agree about the state of a given node. There are two cases that can originate from split brain conditions. Either some minority of nodes believe the node is in
<code>
FAIL
</code>
state, or a minority of nodes believe the node is not in
<code>
FAIL
</code>
state. In both the cases eventually the cluster will have a single view of the state of a given node:
</p>
<p>
<strong>
Case 1
</strong>
: If a majority of masters have flagged a node as
<code>
FAIL
</code>
, because of failure detection and the
<em>
chain effect
</em>
it generates, every other node will eventually flag the master as
<code>
FAIL
</code>
, since in the specified window of time enough failures will be reported.
</p>
<p>
<strong>
Case 2
</strong>
: When only a minority of masters have flagged a node as
<code>
FAIL
</code>
, the replica promotion will not happen (as it uses a more formal algorithm that makes sure everybody knows about the promotion eventually) and every node will clear the
<code>
FAIL
</code>
state as per the
<code>
FAIL
</code>
state clearing rules above (i.e. no promotion after N times the
<code>
NODE_TIMEOUT
</code>
has elapsed).
</p>
<p>
<strong>
The
<code>
FAIL
</code>
flag is only used as a trigger to run the safe part of the algorithm
</strong>
for the replica promotion. In theory a replica may act independently and start a replica promotion when its master is not reachable, and wait for the masters to refuse to provide the acknowledgment if the master is actually reachable by the majority. However the added complexity of the
<code>
PFAIL -> FAIL
</code>
state, the weak agreement, and the
<code>
FAIL
</code>
message forcing the propagation of the state in the shortest amount of time in the reachable part of the cluster, have practical advantages. Because of these mechanisms, usually all the nodes will stop accepting writes at about the same time if the cluster is in an error state. This is a desirable feature from the point of view of applications using Redis Cluster. Also erroneous election attempts initiated by replicas that can't reach its master due to local problems (the master is otherwise reachable by the majority of other master nodes) are avoided.
</p>
<h2 id="configuration-handling-propagation-and-failovers">
Configuration handling, propagation, and failovers
</h2>
<h3 id="cluster-current-epoch">
Cluster current epoch
</h3>
<p>
Redis Cluster uses a concept similar to the Raft algorithm "term". In Redis Cluster the term is called epoch instead, and it is used in order to give incremental versioning to events. When multiple nodes provide conflicting information, it becomes possible for another node to understand which state is the most up to date.
</p>
<p>
The
<code>
currentEpoch
</code>
is a 64 bit unsigned number.
</p>
<p>
At node creation every Redis Cluster node, both replicas and master nodes, set the
<code>
currentEpoch
</code>
to 0.
</p>
<p>
Every time a packet is received from another node, if the epoch of the sender (part of the cluster bus messages header) is greater than the local node epoch, the
<code>
currentEpoch
</code>
is updated to the sender epoch.
</p>
<p>
Because of these semantics, eventually all the nodes will agree to the greatest
<code>
currentEpoch
</code>
in the cluster.
</p>
<p>
This information is used when the state of the cluster is changed and a node seeks agreement in order to perform some action.
</p>
<p>
Currently this happens only during replica promotion, as described in the next section. Basically the epoch is a logical clock for the cluster and dictates that given information wins over one with a smaller epoch.
</p>
<h3 id="configuration-epoch">
Configuration epoch
</h3>
<p>
Every master always advertises its
<code>
configEpoch
</code>
in ping and pong packets along with a bitmap advertising the set of slots it serves.
</p>
<p>
The
<code>
configEpoch
</code>
is set to zero in masters when a new node is created.
</p>
<p>
A new
<code>
configEpoch
</code>
is created during replica election. replicas trying to replace
failing masters increment their epoch and try to get authorization from
a majority of masters. When a replica is authorized, a new unique
<code>
configEpoch
</code>
is created and the replica turns into a master using the new
<code>
configEpoch
</code>
.
</p>
<p>
As explained in the next sections the
<code>
configEpoch
</code>
helps to resolve conflicts when different nodes claim divergent configurations (a condition that may happen because of network partitions and node failures).
</p>
<p>
replica nodes also advertise the
<code>
configEpoch
</code>
field in ping and pong packets, but in the case of replicas the field represents the
<code>
configEpoch
</code>
of its master as of the last time they exchanged packets. This allows other instances to detect when a replica has an old configuration that needs to be updated (master nodes will not grant votes to replicas with an old configuration).
</p>
<p>
Every time the
<code>
configEpoch
</code>
changes for some known node, it is permanently stored in the nodes.conf file by all the nodes that receive this information. The same also happens for the
<code>
currentEpoch
</code>
value. These two variables are guaranteed to be saved and
<code>
fsync-ed
</code>
to disk when updated before a node continues its operations.
</p>
<p>
The
<code>
configEpoch
</code>
values generated using a simple algorithm during failovers
are guaranteed to be new, incremental, and unique.
</p>
<h3 id="replica-election-and-promotion">
Replica election and promotion
</h3>
<p>
Replica election and promotion is handled by replica nodes, with the help of master nodes that vote for the replica to promote.
A replica election happens when a master is in
<code>
FAIL
</code>
state from the point of view of at least one of its replicas that has the prerequisites in order to become a master.
</p>
<p>
In order for a replica to promote itself to master, it needs to start an election and win it. All the replicas for a given master can start an election if the master is in
<code>
FAIL
</code>
state, however only one replica will win the election and promote itself to master.
</p>
<p>
A replica starts an election when the following conditions are met:
</p>
<ul>
<li>
The replica's master is in
<code>
FAIL
</code>
state.
</li>
<li>
The master was serving a non-zero number of slots.
</li>
<li>
The replica replication link was disconnected from the master for no longer than a given amount of time, in order to ensure the promoted replica's data is reasonably fresh. This time is user configurable.
</li>
</ul>
<p>
In order to be elected, the first step for a replica is to increment its
<code>
currentEpoch
</code>
counter, and request votes from master instances.
</p>
<p>
Votes are requested by the replica by broadcasting a
<code>
FAILOVER_AUTH_REQUEST
</code>
packet to every master node of the cluster. Then it waits for a maximum time of two times the
<code>
NODE_TIMEOUT
</code>
for replies to arrive (but always for at least 2 seconds).
</p>
<p>
Once a master has voted for a given replica, replying positively with a
<code>
FAILOVER_AUTH_ACK
</code>
, it can no longer vote for another replica of the same master for a period of
<code>
NODE_TIMEOUT * 2
</code>
. In this period it will not be able to reply to other authorization requests for the same master. This is not needed to guarantee safety, but useful for preventing multiple replicas from getting elected (even if with a different
<code>
configEpoch
</code>
) at around the same time, which is usually not wanted.
</p>
<p>
A replica discards any
<code>
AUTH_ACK
</code>
replies with an epoch that is less than the
<code>
currentEpoch
</code>
at the time the vote request was sent. This ensures it doesn't count votes intended for a previous election.
</p>
<p>
Once the replica receives ACKs from the majority of masters, it wins the election.
Otherwise if the majority is not reached within the period of two times
<code>
NODE_TIMEOUT
</code>
(but always at least 2 seconds), the election is aborted and a new one will be tried again after
<code>
NODE_TIMEOUT * 4
</code>
(and always at least 4 seconds).
</p>
<h3 id="replica-rank">
Replica rank
</h3>
<p>
As soon as a master is in
<code>
FAIL
</code>
state, a replica waits a short period of time before trying to get elected. That delay is computed as follows:
</p>
<pre><code>DELAY = 500 milliseconds + random delay between 0 and 500 milliseconds +
REPLICA_RANK * 1000 milliseconds.
</code></pre>
<p>
The fixed delay ensures that we wait for the
<code>
FAIL
</code>
state to propagate across the cluster, otherwise the replica may try to get elected while the masters are still unaware of the
<code>
FAIL
</code>
state, refusing to grant their vote.
</p>
<p>
The random delay is used to desynchronize replicas so they're unlikely to start an election at the same time.
</p>
<p>
The
<code>
REPLICA_RANK
</code>
is the rank of this replica regarding the amount of replication data it has processed from the master.
Replicas exchange messages when the master is failing in order to establish a (best effort) rank:
the replica with the most updated replication offset is at rank 0, the second most updated at rank 1, and so forth.
In this way the most updated replicas try to get elected before others.
</p>
<p>
Rank order is not strictly enforced; if a replica of higher rank fails to be
elected, the others will try shortly.
</p>
<p>
Once a replica wins the election, it obtains a new unique and incremental
<code>
configEpoch
</code>
which is higher than that of any other existing master. It starts advertising itself as master in ping and pong packets, providing the set of served slots with a
<code>
configEpoch
</code>
that will win over the past ones.
</p>
<p>
In order to speedup the reconfiguration of other nodes, a pong packet is broadcast to all the nodes of the cluster. Currently unreachable nodes will eventually be reconfigured when they receive a ping or pong packet from another node or will receive an
<code>
UPDATE
</code>
packet from another node if the information it publishes via heartbeat packets are detected to be out of date.
</p>
<p>
The other nodes will detect that there is a new master serving the same slots served by the old master but with a greater
<code>
configEpoch
</code>
, and will upgrade their configuration. Replicas of the old master (or the failed over master if it rejoins the cluster) will not just upgrade the configuration but will also reconfigure to replicate from the new master. How nodes rejoining the cluster are configured is explained in the next sections.
</p>
<h3 id="masters-reply-to-replica-vote-request">
Masters reply to replica vote request
</h3>
<p>
In the previous section, we discussed how replicas try to get elected. This section explains what happens from the point of view of a master that is requested to vote for a given replica.
</p>
<p>
Masters receive requests for votes in form of
<code>
FAILOVER_AUTH_REQUEST
</code>
requests from replicas.
</p>
<p>
For a vote to be granted the following conditions need to be met:
</p>
<ol>
<li>
A master only votes a single time for a given epoch, and refuses to vote for older epochs: every master has a lastVoteEpoch field and will refuse to vote again as long as the
<code>
currentEpoch
</code>
in the auth request packet is not greater than the lastVoteEpoch. When a master replies positively to a vote request, the lastVoteEpoch is updated accordingly, and safely stored on disk.
</li>
<li>
A master votes for a replica only if the replica's master is flagged as
<code>
FAIL
</code>
.
</li>
<li>
Auth requests with a
<code>
currentEpoch
</code>
that is less than the master
<code>
currentEpoch
</code>
are ignored. Because of this the master reply will always have the same
<code>
currentEpoch
</code>
as the auth request. If the same replica asks again to be voted, incrementing the
<code>
currentEpoch
</code>
, it is guaranteed that an old delayed reply from the master can not be accepted for the new vote.
</li>
</ol>
<p>
Example of the issue caused by not using rule number 3:
</p>
<p>
Master
<code>
currentEpoch
</code>
is 5, lastVoteEpoch is 1 (this may happen after a few failed elections)
</p>
<ul>
<li>
Replica
<code>
currentEpoch
</code>
is 3.
</li>
<li>
Replica tries to be elected with epoch 4 (3+1), master replies with an ok with
<code>
currentEpoch
</code>
5, however the reply is delayed.
</li>
<li>
Replica will try to be elected again, at a later time, with epoch 5 (4+1), the delayed reply reaches the replica with
<code>
currentEpoch
</code>
5, and is accepted as valid.
</li>
</ul>
<ol start="4">
<li>
Masters don't vote for a replica of the same master before
<code>
NODE_TIMEOUT * 2
</code>
has elapsed if a replica of that master was already voted for. This is not strictly required as it is not possible for two replicas to win the election in the same epoch. However, in practical terms it ensures that when a replica is elected it has plenty of time to inform the other replicas and avoid the possibility that another replica will win a new election, performing an unnecessary second failover.
</li>
<li>
Masters make no effort to select the best replica in any way. If the replica's master is in
<code>
FAIL
</code>
state and the master did not vote in the current term, a positive vote is granted. The best replica is the most likely to start an election and win it before the other replicas, since it will usually be able to start the voting process earlier because of its
<em>
higher rank
</em>
as explained in the previous section.
</li>
<li>
When a master refuses to vote for a given replica there is no negative response, the request is simply ignored.
</li>
<li>
Masters don't vote for replicas sending a
<code>
configEpoch
</code>
that is less than any
<code>
configEpoch
</code>
in the master table for the slots claimed by the replica. Remember that the replica sends the
<code>
configEpoch
</code>
of its master, and the bitmap of the slots served by its master. This means that the replica requesting the vote must have a configuration for the slots it wants to failover that is newer or equal the one of the master granting the vote.
</li>
</ol>
<h3 id="practical-example-of-configuration-epoch-usefulness-during-partitions">
Practical example of configuration epoch usefulness during partitions
</h3>
<p>
This section illustrates how the epoch concept is used to make the replica promotion process more resistant to partitions.
</p>
<ul>
<li>
A master is no longer reachable indefinitely. The master has three replicas A, B, C.
</li>
<li>
Replica A wins the election and is promoted to master.
</li>
<li>
A network partition makes A not available for the majority of the cluster.
</li>
<li>
Replica B wins the election and is promoted as master.
</li>
<li>
A partition makes B not available for the majority of the cluster.
</li>
<li>
The previous partition is fixed, and A is available again.
</li>
</ul>
<p>
At this point B is down and A is available again with a role of master (actually
<code>
UPDATE
</code>
messages would reconfigure it promptly, but here we assume all
<code>
UPDATE
</code>
messages were lost). At the same time, replica C will try to get elected in order to fail over B. This is what happens:
</p>
<ol>
<li>
C will try to get elected and will succeed, since for the majority of masters its master is actually down. It will obtain a new incremental
<code>
configEpoch
</code>
.
</li>
<li>
A will not be able to claim to be the master for its hash slots, because the other nodes already have the same hash slots associated with a higher configuration epoch (the one of B) compared to the one published by A.
</li>
<li>
So, all the nodes will upgrade their table to assign the hash slots to C, and the cluster will continue its operations.
</li>
</ol>
<p>
As you'll see in the next sections, a stale node rejoining a cluster
will usually get notified as soon as possible about the configuration change
because as soon as it pings any other node, the receiver will detect it
has stale information and will send an
<code>
UPDATE
</code>
message.
</p>
<h3 id="hash-slots-configuration-propagation">
Hash slots configuration propagation
</h3>
<p>
An important part of Redis Cluster is the mechanism used to propagate the information about which cluster node is serving a given set of hash slots. This is vital to both the startup of a fresh cluster and the ability to upgrade the configuration after a replica was promoted to serve the slots of its failing master.
</p>
<p>
The same mechanism allows nodes partitioned away for an indefinite amount of
time to rejoin the cluster in a sensible way.
</p>
<p>
There are two ways hash slot configurations are propagated:
</p>
<ol>
<li>
Heartbeat messages. The sender of a ping or pong packet always adds information about the set of hash slots it (or its master, if it is a replica) serves.
</li>
<li>
<code>
UPDATE
</code>
messages. Since in every heartbeat packet there is information about the sender
<code>
configEpoch
</code>
and set of hash slots served, if a receiver of a heartbeat packet finds the sender information is stale, it will send a packet with new information, forcing the stale node to update its info.
</li>
</ol>
<p>
The receiver of a heartbeat or
<code>
UPDATE
</code>
message uses certain simple rules in
order to update its table mapping hash slots to nodes. When a new Redis Cluster node is created, its local hash slot table is simply initialized to
<code>
NULL
</code>
entries so that each hash slot is not bound or linked to any node. This looks similar to the following:
</p>
<pre tabindex="0"><code>0 -> NULL
1 -> NULL
2 -> NULL
...
16383 -> NULL
</code></pre>
<p>
The first rule followed by a node in order to update its hash slot table is the following:
</p>
<p>
<strong>
Rule 1
</strong>
: If a hash slot is unassigned (set to
<code>
NULL
</code>
), and a known node claims it, I'll modify my hash slot table and associate the claimed hash slots to it.
</p>
<p>
So if we receive a heartbeat from node A claiming to serve hash slots 1 and 2 with a configuration epoch value of 3, the table will be modified to:
</p>
<pre tabindex="0"><code>0 -> NULL
1 -> A [3]
2 -> A [3]
...
16383 -> NULL
</code></pre>
<p>
When a new cluster is created, a system administrator needs to manually assign (using the
<a href="/commands/cluster-addslots">
<code>
CLUSTER ADDSLOTS
</code>
</a>
command, via the redis-cli command line tool, or by any other means) the slots served by each master node only to the node itself, and the information will rapidly propagate across the cluster.
</p>
<p>
However this rule is not enough. We know that hash slot mapping can change
during two events:
</p>
<ol>
<li>
A replica replaces its master during a failover.
</li>
<li>
A slot is resharded from a node to a different one.
</li>
</ol>
<p>
For now let's focus on failovers. When a replica fails over its master, it obtains
a configuration epoch which is guaranteed to be greater than the one of its
master (and more generally greater than any other configuration epoch
generated previously). For example node B, which is a replica of A, may failover
A with configuration epoch of 4. It will start to send heartbeat packets
(the first time mass-broadcasting cluster-wide) and because of the following
second rule, receivers will update their hash slot tables:
</p>
<p>
<strong>
Rule 2
</strong>
: If a hash slot is already assigned, and a known node is advertising it using a
<code>
configEpoch
</code>
that is greater than the
<code>
configEpoch
</code>
of the master currently associated with the slot, I'll rebind the hash slot to the new node.
</p>
<p>
So after receiving messages from B that claim to serve hash slots 1 and 2 with configuration epoch of 4, the receivers will update their table in the following way:
</p>
<pre tabindex="0"><code>0 -> NULL
1 -> B [4]
2 -> B [4]
...
16383 -> NULL
</code></pre>
<p>
Liveness property: because of the second rule, eventually all nodes in the cluster will agree that the owner of a slot is the one with the greatest
<code>
configEpoch
</code>
among the nodes advertising it.
</p>
<p>
This mechanism in Redis Cluster is called
<strong>
last failover wins
</strong>
.
</p>
<p>
The same happens during resharding. When a node importing a hash slot completes
the import operation, its configuration epoch is incremented to make sure the
change will be propagated throughout the cluster.
</p>
<h3 id="update-messages-a-closer-look">
UPDATE messages, a closer look
</h3>
<p>
With the previous section in mind, it is easier to see how update messages
work. Node A may rejoin the cluster after some time. It will send heartbeat
packets where it claims it serves hash slots 1 and 2 with configuration epoch
of 3. All the receivers with updated information will instead see that
the same hash slots are associated with node B having a higher configuration
epoch. Because of this they'll send an
<code>
UPDATE
</code>
message to A with the new
configuration for the slots. A will update its configuration because of the
<strong>
rule 2
</strong>
above.
</p>
<h3 id="how-nodes-rejoin-the-cluster">
How nodes rejoin the cluster
</h3>
<p>
The same basic mechanism is used when a node rejoins a cluster.
Continuing with the example above, node A will be notified
that hash slots 1 and 2 are now served by B. Assuming that these two were
the only hash slots served by A, the count of hash slots served by A will
drop to 0! So A will
<strong>
reconfigure to be a replica of the new master
</strong>
.
</p>
<p>
The actual rule followed is a bit more complex than this. In general it may
happen that A rejoins after a lot of time, in the meantime it may happen that
hash slots originally served by A are served by multiple nodes, for example
hash slot 1 may be served by B, and hash slot 2 by C.
</p>
<p>
So the actual
<em>
Redis Cluster node role switch rule
</em>
is:
<strong>
A master node will change its configuration to replicate (be a replica of) the node that stole its last hash slot
</strong>
.
</p>
<p>
During reconfiguration, eventually the number of served hash slots will drop to zero, and the node will reconfigure accordingly. Note that in the base case this just means that the old master will be a replica of the replica that replaced it after a failover. However in the general form the rule covers all possible cases.
</p>
<p>
Replicas do exactly the same: they reconfigure to replicate the node that
stole the last hash slot of its former master.
</p>
<h3 id="replica-migration">
Replica migration
</h3>
<p>
Redis Cluster implements a concept called
<em>
replica migration
</em>
in order to
improve the availability of the system. The idea is that in a cluster with
a master-replica setup, if the map between replicas and masters is fixed
availability is limited over time if multiple independent failures of single
nodes happen.
</p>
<p>
For example in a cluster where every master has a single replica, the cluster
can continue operations as long as either the master or the replica fail, but not
if both fail the same time. However there is a class of failures that are
the independent failures of single nodes caused by hardware or software issues
that can accumulate over time. For example:
</p>
<ul>
<li>
Master A has a single replica A1.
</li>
<li>
Master A fails. A1 is promoted as new master.
</li>
<li>
Three hours later A1 fails in an independent manner (unrelated to the failure of A). No other replica is available for promotion since node A is still down. The cluster cannot continue normal operations.
</li>
</ul>
<p>
If the map between masters and replicas is fixed, the only way to make the cluster
more resistant to the above scenario is to add replicas to every master, however
this is costly as it requires more instances of Redis to be executed, more
memory, and so forth.
</p>
<p>
An alternative is to create an asymmetry in the cluster, and let the cluster
layout automatically change over time. For example the cluster may have three
masters A, B, C. A and B have a single replica each, A1 and B1. However the master
C is different and has two replicas: C1 and C2.
</p>
<p>
Replica migration is the process of automatic reconfiguration of a replica
in order to
<em>
migrate
</em>
to a master that has no longer coverage (no working
replicas). With replica migration the scenario mentioned above turns into the
following:
</p>
<ul>
<li>
Master A fails. A1 is promoted.
</li>
<li>
C2 migrates as replica of A1, that is otherwise not backed by any replica.
</li>
<li>
Three hours later A1 fails as well.
</li>
<li>
C2 is promoted as new master to replace A1.
</li>
<li>
The cluster can continue the operations.
</li>
</ul>
<h3 id="replica-migration-algorithm">
Replica migration algorithm
</h3>
<p>
The migration algorithm does not use any form of agreement since the replica
layout in a Redis Cluster is not part of the cluster configuration that needs
to be consistent and/or versioned with config epochs. Instead it uses an
algorithm to avoid mass-migration of replicas when a master is not backed.
The algorithm guarantees that eventually (once the cluster configuration is
stable) every master will be backed by at least one replica.
</p>
<p>
This is how the algorithm works. To start we need to define what is a
<em>
good replica
</em>
in this context: a good replica is a replica not in
<code>
FAIL
</code>
state
from the point of view of a given node.
</p>
<p>
The execution of the algorithm is triggered in every replica that detects that
there is at least a single master without good replicas. However among all the
replicas detecting this condition, only a subset should act. This subset is
actually often a single replica unless different replicas have in a given moment
a slightly different view of the failure state of other nodes.
</p>
<p>
The
<em>
acting replica
</em>
is the replica among the masters with the maximum number
of attached replicas, that is not in FAIL state and has the smallest node ID.
</p>
<p>
So for example if there are 10 masters with 1 replica each, and 2 masters with
5 replicas each, the replica that will try to migrate is - among the 2 masters
having 5 replicas - the one with the lowest node ID. Given that no agreement
is used, it is possible that when the cluster configuration is not stable,
a race condition occurs where multiple replicas believe themselves to be
the non-failing replica with the lower node ID (it is unlikely for this to happen
in practice). If this happens, the result is multiple replicas migrating to the
same master, which is harmless. If the race happens in a way that will leave
the ceding master without replicas, as soon as the cluster is stable again
the algorithm will be re-executed again and will migrate a replica back to
the original master.
</p>
<p>
Eventually every master will be backed by at least one replica. However,
the normal behavior is that a single replica migrates from a master with
multiple replicas to an orphaned master.
</p>
<p>
The algorithm is controlled by a user-configurable parameter called
<code>
cluster-migration-barrier
</code>
: the number of good replicas a master
must be left with before a replica can migrate away. For example, if this
parameter is set to 2, a replica can try to migrate only if its master remains
with two working replicas.
</p>
<h3 id="configepoch-conflicts-resolution-algorithm">
configEpoch conflicts resolution algorithm
</h3>
<p>
When new
<code>
configEpoch
</code>
values are created via replica promotion during
failovers, they are guaranteed to be unique.
</p>
<p>
However there are two distinct events where new configEpoch values are
created in an unsafe way, just incrementing the local
<code>
currentEpoch
</code>
of
the local node and hoping there are no conflicts at the same time.
Both the events are system-administrator triggered:
</p>
<ol>
<li>
<a href="/commands/cluster-failover">
<code>
CLUSTER FAILOVER
</code>
</a>
command with
<code>
TAKEOVER
</code>
option is able to manually promote a replica node into a master
<em>
without the majority of masters being available
</em>
. This is useful, for example, in multi data center setups.
</li>
<li>
Migration of slots for cluster rebalancing also generates new configuration epochs inside the local node without agreement for performance reasons.
</li>
</ol>
<p>
Specifically, during manual resharding, when a hash slot is migrated from
a node A to a node B, the resharding program will force B to upgrade
its configuration to an epoch which is the greatest found in the cluster,
plus 1 (unless the node is already the one with the greatest configuration
epoch), without requiring agreement from other nodes.
Usually a real world resharding involves moving several hundred hash slots
(especially in small clusters). Requiring an agreement to generate new
configuration epochs during resharding, for each hash slot moved, is
inefficient. Moreover it requires a fsync in each of the cluster nodes
every time in order to store the new configuration. Because of the way it is
performed instead, we only need a new config epoch when the first hash slot is moved,
making it much more efficient in production environments.
</p>
<p>
However because of the two cases above, it is possible (though unlikely) to end
with multiple nodes having the same configuration epoch. A resharding operation
performed by the system administrator, and a failover happening at the same
time (plus a lot of bad luck) could cause
<code>
currentEpoch
</code>
collisions if
they are not propagated fast enough.
</p>
<p>
Moreover, software bugs and filesystem corruptions can also contribute
to multiple nodes having the same configuration epoch.
</p>
<p>
When masters serving different hash slots have the same
<code>
configEpoch
</code>
, there
are no issues. It is more important that replicas failing over a master have
unique configuration epochs.
</p>
<p>
That said, manual interventions or resharding may change the cluster
configuration in different ways. The Redis Cluster main liveness property
requires that slot configurations always converge, so under every circumstance
we really want all the master nodes to have a different
<code>
configEpoch
</code>
.
</p>
<p>
In order to enforce this,
<strong>
a conflict resolution algorithm
</strong>
is used in the
event that two nodes end up with the same
<code>
configEpoch
</code>
.
</p>
<ul>
<li>
IF a master node detects another master node is advertising itself with
the same
<code>
configEpoch
</code>
.
</li>
<li>
AND IF the node has a lexicographically smaller Node ID compared to the other node claiming the same
<code>
configEpoch
</code>
.
</li>
<li>
THEN it increments its
<code>
currentEpoch
</code>
by 1, and uses it as the new
<code>
configEpoch
</code>
.
</li>
</ul>
<p>
If there are any set of nodes with the same
<code>
configEpoch
</code>
, all the nodes but the one with the greatest Node ID will move forward, guaranteeing that, eventually, every node will pick a unique configEpoch regardless of what happened.
</p>
<p>
This mechanism also guarantees that after a fresh cluster is created, all
nodes start with a different
<code>
configEpoch
</code>
(even if this is not actually
used) since
<code>
redis-cli
</code>
makes sure to use
<a href="/commands/cluster-set-config-epoch">
<code>
CLUSTER SET-CONFIG-EPOCH
</code>
</a>
at startup.
However if for some reason a node is left misconfigured, it will update
its configuration to a different configuration epoch automatically.
</p>
<h3 id="node-resets">
Node resets
</h3>
<p>
Nodes can be software reset (without restarting them) in order to be reused
in a different role or in a different cluster. This is useful in normal
operations, in testing, and in cloud environments where a given node can
be reprovisioned to join a different set of nodes to enlarge or create a new
cluster.
</p>
<p>
In Redis Cluster nodes are reset using the
<a href="/commands/cluster-reset">
<code>
CLUSTER RESET
</code>
</a>
command. The
command is provided in two variants:
</p>
<ul>
<li>
<code>
CLUSTER RESET SOFT
</code>
</li>
<li>
<code>
CLUSTER RESET HARD
</code>
</li>
</ul>
<p>
The command must be sent directly to the node to reset. If no reset type is
provided, a soft reset is performed.
</p>
<p>
The following is a list of operations performed by a reset:
</p>
<ol>
<li>
Soft and hard reset: If the node is a replica, it is turned into a master, and its dataset is discarded. If the node is a master and contains keys the reset operation is aborted.
</li>
<li>
Soft and hard reset: All the slots are released, and the manual failover state is reset.
</li>
<li>
Soft and hard reset: All the other nodes in the nodes table are removed, so the node no longer knows any other node.
</li>
<li>
Hard reset only:
<code>
currentEpoch
</code>
,
<code>
configEpoch
</code>
, and
<code>
lastVoteEpoch
</code>
are set to 0.
</li>
<li>
Hard reset only: the Node ID is changed to a new random ID.
</li>
</ol>
<p>
Master nodes with non-empty data sets can't be reset (since normally you want to reshard data to the other nodes). However, under special conditions when this is appropriate (e.g. when a cluster is totally destroyed with the intent of creating a new one),
<a href="/commands/flushall">
<code>
FLUSHALL
</code>
</a>
must be executed before proceeding with the reset.
</p>
<h3 id="removing-nodes-from-a-cluster">
Removing nodes from a cluster
</h3>
<p>
It is possible to practically remove a node from an existing cluster by
resharding all its data to other nodes (if it is a master node) and
shutting it down. However, the other nodes will still remember its node
ID and address, and will attempt to connect with it.
</p>
<p>
For this reason, when a node is removed we want to also remove its entry
from all the other nodes tables. This is accomplished by using the
<code>
CLUSTER FORGET <node-id>
</code>
command.
</p>
<p>
The command does two things:
</p>
<ol>
<li>
It removes the node with the specified node ID from the nodes table.
</li>
<li>
It sets a 60 second ban which prevents a node with the same node ID from being re-added.
</li>
</ol>
<p>
The second operation is needed because Redis Cluster uses gossip in order to auto-discover nodes, so removing the node X from node A, could result in node B gossiping about node X to A again. Because of the 60 second ban, the Redis Cluster administration tools have 60 seconds in order to remove the node from all the nodes, preventing the re-addition of the node due to auto discovery.
</p>
<p>
Further information is available in the
<a href="/commands/cluster-forget">
<code>
CLUSTER FORGET
</code>
</a>
documentation.
</p>
<h2 id="publishsubscribe">
Publish/Subscribe
</h2>
<p>
In a Redis Cluster, clients can subscribe to every node, and can also
publish to every other node. The cluster will make sure that published
messages are forwarded as needed.
</p>
<p>
The clients can send SUBSCRIBE to any node and can also send PUBLISH to any node.
It will simply broadcast each published message to all other nodes.
</p>
<p>
Redis 7.0 and later features sharded pub/sub, in which 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 owns the slot the shard channel is hashed to.
The cluster makes sure the published shard messages are forwarded to all nodes in the shard, so clients can subscribe to a shard channel by connecting to either the master responsible for the slot, or to any of its replicas.
</p>
<h2 id="appendix">
Appendix
</h2>
<h3 id="appendix-a-crc16-reference-implementation-in-ansi-c">
Appendix A: CRC16 reference implementation in ANSI C
</h3>
<pre><code>/*
* Copyright 2001-2010 Georges Menie (www.menie.org)
* Copyright 2010 Salvatore Sanfilippo (adapted to Redis coding style)
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the University of California, Berkeley nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/* CRC16 implementation according to CCITT standards.
*
* Note by @antirez: this is actually the XMODEM CRC 16 algorithm, using the
* following parameters:
*
* Name : "XMODEM", also known as "ZMODEM", "CRC-16/ACORN"
* Width : 16 bit
* Poly : 1021 (That is actually x^16 + x^12 + x^5 + 1)
* Initialization : 0000
* Reflect Input byte : False
* Reflect Output CRC : False
* Xor constant to output CRC : 0000
* Output for "123456789" : 31C3
*/
static const uint16_t crc16tab[256]= {
0x0000,0x1021,0x2042,0x3063,0x4084,0x50a5,0x60c6,0x70e7,
0x8108,0x9129,0xa14a,0xb16b,0xc18c,0xd1ad,0xe1ce,0xf1ef,
0x1231,0x0210,0x3273,0x2252,0x52b5,0x4294,0x72f7,0x62d6,
0x9339,0x8318,0xb37b,0xa35a,0xd3bd,0xc39c,0xf3ff,0xe3de,
0x2462,0x3443,0x0420,0x1401,0x64e6,0x74c7,0x44a4,0x5485,
0xa56a,0xb54b,0x8528,0x9509,0xe5ee,0xf5cf,0xc5ac,0xd58d,
0x3653,0x2672,0x1611,0x0630,0x76d7,0x66f6,0x5695,0x46b4,
0xb75b,0xa77a,0x9719,0x8738,0xf7df,0xe7fe,0xd79d,0xc7bc,
0x48c4,0x58e5,0x6886,0x78a7,0x0840,0x1861,0x2802,0x3823,
0xc9cc,0xd9ed,0xe98e,0xf9af,0x8948,0x9969,0xa90a,0xb92b,
0x5af5,0x4ad4,0x7ab7,0x6a96,0x1a71,0x0a50,0x3a33,0x2a12,
0xdbfd,0xcbdc,0xfbbf,0xeb9e,0x9b79,0x8b58,0xbb3b,0xab1a,
0x6ca6,0x7c87,0x4ce4,0x5cc5,0x2c22,0x3c03,0x0c60,0x1c41,
0xedae,0xfd8f,0xcdec,0xddcd,0xad2a,0xbd0b,0x8d68,0x9d49,
0x7e97,0x6eb6,0x5ed5,0x4ef4,0x3e13,0x2e32,0x1e51,0x0e70,
0xff9f,0xefbe,0xdfdd,0xcffc,0xbf1b,0xaf3a,0x9f59,0x8f78,
0x9188,0x81a9,0xb1ca,0xa1eb,0xd10c,0xc12d,0xf14e,0xe16f,
0x1080,0x00a1,0x30c2,0x20e3,0x5004,0x4025,0x7046,0x6067,
0x83b9,0x9398,0xa3fb,0xb3da,0xc33d,0xd31c,0xe37f,0xf35e,
0x02b1,0x1290,0x22f3,0x32d2,0x4235,0x5214,0x6277,0x7256,
0xb5ea,0xa5cb,0x95a8,0x8589,0xf56e,0xe54f,0xd52c,0xc50d,
0x34e2,0x24c3,0x14a0,0x0481,0x7466,0x6447,0x5424,0x4405,
0xa7db,0xb7fa,0x8799,0x97b8,0xe75f,0xf77e,0xc71d,0xd73c,
0x26d3,0x36f2,0x0691,0x16b0,0x6657,0x7676,0x4615,0x5634,
0xd94c,0xc96d,0xf90e,0xe92f,0x99c8,0x89e9,0xb98a,0xa9ab,
0x5844,0x4865,0x7806,0x6827,0x18c0,0x08e1,0x3882,0x28a3,
0xcb7d,0xdb5c,0xeb3f,0xfb1e,0x8bf9,0x9bd8,0xabbb,0xbb9a,
0x4a75,0x5a54,0x6a37,0x7a16,0x0af1,0x1ad0,0x2ab3,0x3a92,
0xfd2e,0xed0f,0xdd6c,0xcd4d,0xbdaa,0xad8b,0x9de8,0x8dc9,
0x7c26,0x6c07,0x5c64,0x4c45,0x3ca2,0x2c83,0x1ce0,0x0cc1,
0xef1f,0xff3e,0xcf5d,0xdf7c,0xaf9b,0xbfba,0x8fd9,0x9ff8,
0x6e17,0x7e36,0x4e55,0x5e74,0x2e93,0x3eb2,0x0ed1,0x1ef0
};
uint16_t crc16(const char *buf, int len) {
int counter;
uint16_t crc = 0;
for (counter = 0; counter < len; counter++)
crc = (crc<<8) ^ crc16tab[((crc>>8) ^ *buf++)&0x00FF];
return crc;
}
</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/operate/oss_and_stack/reference/cluster-spec/"/>
<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/groupcms.html | <section class="prose w-full py-12">
<h1>
Commands
</h1>
</section>
|
https://redis.io/docs/latest/develop/clients/redis-py/connect/.html | <section class="prose w-full py-12">
<h1>
Connect to the server
</h1>
<p class="text-lg -mt-5 mb-10">
Connect your Python application to a Redis database
</p>
<h2 id="basic-connection">
Basic connection
</h2>
<p>
Connect to localhost on port 6379, set a value in Redis, and retrieve it. All responses are returned as bytes in Python. To receive decoded strings, set
<code>
decode_responses=True
</code>
. For more connection options, see
<a href="https://redis.readthedocs.io/en/stable/examples.html">
these examples
</a>
.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-python" data-lang="python"><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">host</span><span class="o">=</span><span class="s1">'localhost'</span><span class="p">,</span> <span class="n">port</span><span class="o">=</span><span class="mi">6379</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></code></pre>
</div>
<p>
Store and retrieve a simple string.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="n">r</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s1">'foo'</span><span class="p">,</span> <span class="s1">'bar'</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 class="n">r</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'foo'</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="c1"># bar</span>
</span></span></code></pre>
</div>
<p>
Store and retrieve a dict.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="n">r</span><span class="o">.</span><span class="n">hset</span><span class="p">(</span><span class="s1">'user-session:123'</span><span class="p">,</span> <span class="n">mapping</span><span class="o">=</span><span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="s1">'name'</span><span class="p">:</span> <span class="s1">'John'</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"surname"</span><span class="p">:</span> <span class="s1">'Smith'</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"company"</span><span class="p">:</span> <span class="s1">'Redis'</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"age"</span><span class="p">:</span> <span class="mi">29</span>
</span></span><span class="line"><span class="cl"><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">r</span><span class="o">.</span><span class="n">hgetall</span><span class="p">(</span><span class="s1">'user-session:123'</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="c1"># {'surname': 'Smith', 'name': 'John', 'company': 'Redis', 'age': '29'}</span>
</span></span></code></pre>
</div>
<h2 id="connect-to-a-redis-cluster">
Connect to a Redis cluster
</h2>
<p>
To connect to a Redis cluster, use
<code>
RedisCluster
</code>
.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">redis.cluster</span> <span class="kn">import</span> <span class="n">RedisCluster</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">rc</span> <span class="o">=</span> <span class="n">RedisCluster</span><span class="p">(</span><span class="n">host</span><span class="o">=</span><span class="s1">'localhost'</span><span class="p">,</span> <span class="n">port</span><span class="o">=</span><span class="mi">16379</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">rc</span><span class="o">.</span><span class="n">get_nodes</span><span class="p">())</span>
</span></span><span class="line"><span class="cl"><span class="c1"># [[host=127.0.0.1,port=16379,name=127.0.0.1:16379,server_type=primary,redis_connection=Redis<ConnectionPool<Connection<host=127.0.0.1,port=16379,db=0>>>], ...</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">rc</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s1">'foo'</span><span class="p">,</span> <span class="s1">'bar'</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">rc</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'foo'</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="c1"># b'bar'</span>
</span></span></code></pre>
</div>
<p>
For more information, see
<a href="https://redis-py.readthedocs.io/en/stable/clustering.html">
redis-py Clustering
</a>
.
</p>
<h2 id="connect-to-your-production-redis-with-tls">
Connect to your production Redis with TLS
</h2>
<p>
When you deploy your application, use TLS and follow the
<a href="/docs/latest/operate/oss_and_stack/management/security/">
Redis security
</a>
guidelines.
</p>
<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></span><span class="line"><span class="cl"> <span class="n">host</span><span class="o">=</span><span class="s2">"my-redis.cloud.redislabs.com"</span><span class="p">,</span> <span class="n">port</span><span class="o">=</span><span class="mi">6379</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="n">username</span><span class="o">=</span><span class="s2">"default"</span><span class="p">,</span> <span class="c1"># use your Redis user. More info https://redis.io/docs/latest/operate/oss_and_stack/management/security/acl/</span>
</span></span><span class="line"><span class="cl"> <span class="n">password</span><span class="o">=</span><span class="s2">"secret"</span><span class="p">,</span> <span class="c1"># use your Redis password</span>
</span></span><span class="line"><span class="cl"> <span class="n">ssl</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="n">ssl_certfile</span><span class="o">=</span><span class="s2">"./redis_user.crt"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="n">ssl_keyfile</span><span class="o">=</span><span class="s2">"./redis_user_private.key"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="n">ssl_ca_certs</span><span class="o">=</span><span class="s2">"./redis_ca.pem"</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="n">r</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s1">'foo'</span><span class="p">,</span> <span class="s1">'bar'</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">r</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'foo'</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="c1"># b'bar'</span>
</span></span></code></pre>
</div>
<p>
For more information, see
<a href="https://redis-py.readthedocs.io/en/stable/examples/ssl_connection_examples.html">
redis-py TLS examples
</a>
.
</p>
<h2 id="connect-using-client-side-caching">
Connect using client-side caching
</h2>
<p>
Client-side caching is a technique to reduce network traffic between
the client and server, resulting in better performance. See
<a href="/docs/latest/develop/clients/client-side-caching/">
Client-side caching introduction
</a>
for more information about how client-side caching works and how to use it effectively.
</p>
<p>
To enable client-side caching, add some extra parameters when you connect
to the server:
</p>
<ul>
<li>
<code>
protocol
</code>
: (Required) You must pass a value of
<code>
3
</code>
here because
client-side caching requires the
<a href="/docs/latest/develop/reference/protocol-spec/#resp-versions">
RESP3
</a>
protocol.
</li>
<li>
<code>
cache_config
</code>
: (Required) Pass
<code>
cache_config=CacheConfig()
</code>
here to enable client-side caching.
</li>
</ul>
<p>
The example below shows the simplest client-side caching connection to the default host and port,
<code>
localhost:6379
</code>
.
All of the connection variants described above accept these parameters, so you can
use client-side caching with a connection pool or a cluster connection in exactly the same way.
</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>
Client-side caching requires redis-py v5.1.0 or later.
To maximize compatibility with all Redis products, client-side caching
is supported by Redis v7.4 or later.
</div>
</div>
<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 class="kn">from</span> <span class="nn">redis.cache</span> <span class="kn">import</span> <span class="n">CacheConfig</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></span><span class="line"><span class="cl"> <span class="n">protocol</span><span class="o">=</span><span class="mi">3</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="n">cache_config</span><span class="o">=</span><span class="n">CacheConfig</span><span class="p">(),</span>
</span></span><span class="line"><span class="cl"> <span class="n">decode_responses</span><span class="o">=</span><span class="kc">True</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="n">r</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"city"</span><span class="p">,</span> <span class="s2">"New York"</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="n">cityNameAttempt1</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"city"</span><span class="p">)</span> <span class="c1"># Retrieved from Redis server and cached</span>
</span></span><span class="line"><span class="cl"><span class="n">cityNameAttempt2</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"city"</span><span class="p">)</span> <span class="c1"># Retrieved from cache</span>
</span></span></code></pre>
</div>
<p>
You can see the cache working if you connect to the same Redis database
with
<a href="/docs/latest/develop/tools/cli/">
<code>
redis-cli
</code>
</a>
and run the
<a href="/docs/latest/commands/monitor/">
<code>
MONITOR
</code>
</a>
command. If you run the
code above with the
<code>
cache_config
</code>
line commented out, you should see
the following in the CLI among the output from
<code>
MONITOR
</code>
:
</p>
<pre tabindex="0"><code>1723109720.268903 [...] "SET" "city" "New York"
1723109720.269681 [...] "GET" "city"
1723109720.270205 [...] "GET" "city"
</code></pre>
<p>
The server responds to both
<code>
get("city")
</code>
calls.
If you run the code again with
<code>
cache_config
</code>
uncommented, you will see
</p>
<pre tabindex="0"><code>1723110248.712663 [...] "SET" "city" "New York"
1723110248.713607 [...] "GET" "city"
</code></pre>
<p>
The first
<code>
get("city")
</code>
call contacted the server but the second
call was satisfied by the cache.
</p>
<h3 id="removing-items-from-the-cache">
Removing items from the cache
</h3>
<p>
You can remove individual keys from the cache with the
<code>
delete_by_redis_keys()
</code>
method. This removes all cached items associated
with the keys, so all results from multi-key commands (such as
<a href="/docs/latest/commands/mget/">
<code>
MGET
</code>
</a>
) and composite data structures
(such as
<a href="/docs/latest/develop/data-types/hashes/">
hashes
</a>
) will be
cleared at once. The example below shows the effect of removing a single
key from the cache:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="n">r</span><span class="o">.</span><span class="n">hget</span><span class="p">(</span><span class="s2">"person:1"</span><span class="p">,</span> <span class="s2">"name"</span><span class="p">)</span> <span class="c1"># Read from the server</span>
</span></span><span class="line"><span class="cl"><span class="n">r</span><span class="o">.</span><span class="n">hget</span><span class="p">(</span><span class="s2">"person:1"</span><span class="p">,</span> <span class="s2">"name"</span><span class="p">)</span> <span class="c1"># Read from the cache</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">hget</span><span class="p">(</span><span class="s2">"person:2"</span><span class="p">,</span> <span class="s2">"name"</span><span class="p">)</span> <span class="c1"># Read from the server</span>
</span></span><span class="line"><span class="cl"><span class="n">r</span><span class="o">.</span><span class="n">hget</span><span class="p">(</span><span class="s2">"person:2"</span><span class="p">,</span> <span class="s2">"name"</span><span class="p">)</span> <span class="c1"># Read from the cache</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">cache</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">get_cache</span><span class="p">()</span>
</span></span><span class="line"><span class="cl"><span class="n">cache</span><span class="o">.</span><span class="n">delete_by_redis_keys</span><span class="p">([</span><span class="s2">"person:1"</span><span class="p">])</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">hget</span><span class="p">(</span><span class="s2">"person:1"</span><span class="p">,</span> <span class="s2">"name"</span><span class="p">)</span> <span class="c1"># Read from the server</span>
</span></span><span class="line"><span class="cl"><span class="n">r</span><span class="o">.</span><span class="n">hget</span><span class="p">(</span><span class="s2">"person:1"</span><span class="p">,</span> <span class="s2">"name"</span><span class="p">)</span> <span class="c1"># Read from the cache</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">hget</span><span class="p">(</span><span class="s2">"person:2"</span><span class="p">,</span> <span class="s2">"name"</span><span class="p">)</span> <span class="c1"># Still read from the cache</span>
</span></span></code></pre>
</div>
<p>
You can also clear all cached items using the
<code>
flush()
</code>
method:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="n">r</span><span class="o">.</span><span class="n">hget</span><span class="p">(</span><span class="s2">"person:1"</span><span class="p">,</span> <span class="s2">"name"</span><span class="p">)</span> <span class="c1"># Read from the server</span>
</span></span><span class="line"><span class="cl"><span class="n">r</span><span class="o">.</span><span class="n">hget</span><span class="p">(</span><span class="s2">"person:1"</span><span class="p">,</span> <span class="s2">"name"</span><span class="p">)</span> <span class="c1"># Read from the cache</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">hget</span><span class="p">(</span><span class="s2">"person:2"</span><span class="p">,</span> <span class="s2">"name"</span><span class="p">)</span> <span class="c1"># Read from the cache</span>
</span></span><span class="line"><span class="cl"><span class="n">r</span><span class="o">.</span><span class="n">hget</span><span class="p">(</span><span class="s2">"person:2"</span><span class="p">,</span> <span class="s2">"name"</span><span class="p">)</span> <span class="c1"># Read from the cache</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">cache</span> <span class="o">=</span> <span class="n">r</span><span class="o">.</span><span class="n">get_cache</span><span class="p">()</span>
</span></span><span class="line"><span class="cl"><span class="n">cache</span><span class="o">.</span><span class="n">flush</span><span class="p">()</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">hget</span><span class="p">(</span><span class="s2">"person:1"</span><span class="p">,</span> <span class="s2">"name"</span><span class="p">)</span> <span class="c1"># Read from the server</span>
</span></span><span class="line"><span class="cl"><span class="n">r</span><span class="o">.</span><span class="n">hget</span><span class="p">(</span><span class="s2">"person:1"</span><span class="p">,</span> <span class="s2">"name"</span><span class="p">)</span> <span class="c1"># Read from the cache</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">hget</span><span class="p">(</span><span class="s2">"person:2"</span><span class="p">,</span> <span class="s2">"name"</span><span class="p">)</span> <span class="c1"># Read from the server</span>
</span></span><span class="line"><span class="cl"><span class="n">r</span><span class="o">.</span><span class="n">hget</span><span class="p">(</span><span class="s2">"person:2"</span><span class="p">,</span> <span class="s2">"name"</span><span class="p">)</span> <span class="c1"># Read from the cache</span>
</span></span></code></pre>
</div>
<p>
The client will also flush the cache automatically
if any connection (including one from a connection pool)
is disconnected.
</p>
<h2 id="connect-with-a-connection-pool">
Connect with a connection pool
</h2>
<p>
For production usage, you should use a connection pool to manage
connections rather than opening and closing connections individually.
A connection pool maintains several open connections and reuses them
efficiently. When you open a connection from a pool, the pool allocates
one of its open connections. When you subsequently close the same connection,
it is not actually closed but simply returned to the pool for reuse.
This avoids the overhead of repeated connecting and disconnecting.
See
<a href="/docs/latest/develop/clients/pools-and-muxing/">
Connection pools and multiplexing
</a>
for more information.
</p>
<p>
Use the following code to connect with a connection pool:
</p>
<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">pool</span> <span class="o">=</span> <span class="n">redis</span><span class="o">.</span><span class="n">ConnectionPool</span><span class="p">()</span><span class="o">.</span><span class="n">from_url</span><span class="p">(</span><span class="s2">"redis://localhost"</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="n">r1</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="o">.</span><span class="n">from_pool</span><span class="p">(</span><span class="n">pool</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="n">r2</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="o">.</span><span class="n">from_pool</span><span class="p">(</span><span class="n">pool</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="n">r3</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="o">.</span><span class="n">from_pool</span><span class="p">(</span><span class="n">pool</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">r1</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"wind:1"</span><span class="p">,</span> <span class="s2">"Hurricane"</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="n">r2</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"wind:2"</span><span class="p">,</span> <span class="s2">"Tornado"</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="n">r3</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"wind:3"</span><span class="p">,</span> <span class="s2">"Mistral"</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">r1</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
</span></span><span class="line"><span class="cl"><span class="n">r2</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
</span></span><span class="line"><span class="cl"><span class="n">r3</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">pool</span><span class="o">.</span><span class="n">close</span><span class="p">()</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/develop/clients/redis-py/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>
|
Subsets and Splits