url
stringlengths 38
157
| content
stringlengths 72
15.1M
|
---|---|
https://redis.io/docs/latest/operate/rs/7.4/references/rest-api/requests/actions/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Actions requests
</h1>
<p class="text-lg -mt-5 mb-10">
Actions requests
</p>
<table>
<thead>
<tr>
<th>
Method
</th>
<th>
Path
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="#get-all-actions">
GET
</a>
</td>
<td>
<code>
/v1/actions
</code>
</td>
<td>
Get all actions
</td>
</tr>
<tr>
<td>
<a href="#get-action">
GET
</a>
</td>
<td>
<code>
/v1/actions/{uid}
</code>
</td>
<td>
Get a single action
</td>
</tr>
</tbody>
</table>
<h2 id="get-all-actions">
Get all actions
</h2>
<pre tabindex="0"><code>GET /v1/actions
</code></pre>
<p>
Get the status of all actions (executing, queued, or completed) on all entities (clusters, nodes, and databases). This API tracks long-lived API requests that return either a
<code>
task_id
</code>
or an
<code>
action_uid
</code>
.
</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_status_of_cluster_action">
view_status_of_cluster_action
</a>
</td>
</tr>
</tbody>
</table>
<h3 id="get-all-request">
Request
</h3>
<h4 id="example-http-request">
Example HTTP request
</h4>
<pre tabindex="0"><code>GET /actions
</code></pre>
<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/action/">
action objects
</a>
and an array of
<a href="/docs/latest/operate/rs/7.4/references/rest-api/objects/state-machine/">
state-machine objects
</a>
.
</p>
<p>
Regardless of an actionβs source, each action in the response contains the following attributes:
<code>
name
</code>
,
<code>
action_uid
</code>
,
<code>
status
</code>
, and
<code>
progress
</code>
.
</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">"actions"</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">"action_uid"</span><span class="p">:</span> <span class="s2">"159ca2f8-7bf3-4cda-97e8-4eb560665c28"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"name"</span><span class="p">:</span> <span class="s2">"retry_bdb"</span><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">"progress"</span><span class="p">:</span> <span class="s2">"100"</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">"completed"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"task_id"</span><span class="p">:</span> <span class="s2">"159ca2f8-7bf3-4cda-97e8-4eb560665c28"</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">"action_uid"</span><span class="p">:</span> <span class="s2">"661697c5-c747-41bd-ab81-ffc8fd13c494"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"name"</span><span class="p">:</span> <span class="s2">"retry_bdb"</span><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">"progress"</span><span class="p">:</span> <span class="s2">"100"</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">"completed"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"task_id"</span><span class="p">:</span> <span class="s2">"661697c5-c747-41bd-ab81-ffc8fd13c494"</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">"state-machines"</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">"action_uid"</span><span class="p">:</span> <span class="s2">"a10586b1-60bc-428e-9bc6-392eb5f0d8ae"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"heartbeat"</span><span class="p">:</span> <span class="mi">1650378874</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"name"</span><span class="p">:</span> <span class="s2">"SMCreateBDB"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"object_name"</span><span class="p">:</span> <span class="s2">"bdb:1"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"progress"</span><span class="p">:</span> <span class="mi">100</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">"completed"</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="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, response provides info about an ongoing action
</td>
</tr>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5">
404 Not Found
</a>
</td>
<td>
Action does not exist (i.e. not currently running and no available status of last run).
</td>
</tr>
</tbody>
</table>
<h2 id="get-action">
Get a specific action
</h2>
<pre tabindex="0"><code>GET /v1/actions/{uid}
</code></pre>
<p>
Get the status of a currently executing, queued, or completed action.
</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_status_of_cluster_action">
view_status_of_cluster_action
</a>
</td>
</tr>
</tbody>
</table>
<h3 id="get-request">
Request
</h3>
<h4 id="example-http-request-1">
Example HTTP request
</h4>
<pre tabindex="0"><code>GET /actions/{uid}
</code></pre>
<h4 id="url-parameters">
URL parameters
</h4>
<table>
<thead>
<tr>
<th>
Field
</th>
<th>
Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
uid
</td>
<td>
string
</td>
<td>
The action_uid to check
</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/action/">
action object
</a>
.
</p>
<p>
Regardless of an actionβs source, each action contains the following attributes:
<code>
name
</code>
,
<code>
action_uid
</code>
,
<code>
status
</code>
, and
<code>
progress
</code>
.
</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">"action_uid"</span><span class="p">:</span> <span class="s2">"159ca2f8-7bf3-4cda-97e8-4eb560665c28"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"name"</span><span class="p">:</span> <span class="s2">"retry_bdb"</span><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">"progress"</span><span class="p">:</span> <span class="s2">"100"</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">"completed"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"task_id"</span><span class="p">:</span> <span class="s2">"159ca2f8-7bf3-4cda-97e8-4eb560665c28"</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, response provides info about an ongoing action
</td>
</tr>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5">
404 Not Found
</a>
</td>
<td>
Action does not exist (i.e. not currently running and no available status of last run)
</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/actions/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/7.4/references/rest-api/objects/services_configuration/cm_server/.html | <section class="prose w-full py-12 max-w-none">
<h1>
CM server object
</h1>
<p class="text-lg -mt-5 mb-10">
Documents the cm_server 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>
operating_mode
</td>
<td>
'disabled'
<br/>
'enabled'
</td>
<td>
Enable/disable the CM server
</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/cm_server/"/>
<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/use/keyspace-notifications/.html | <section class="prose w-full py-12">
<h1>
Redis keyspace notifications
</h1>
<p class="text-lg -mt-5 mb-10">
Monitor changes to Redis keys and values in real time
</p>
<p>
Keyspace notifications allow clients to subscribe to Pub/Sub channels in order
to receive events affecting the Redis data set in some way.
</p>
<p>
Examples of events that can be received are:
</p>
<ul>
<li>
All the commands affecting a given key.
</li>
<li>
All the keys receiving an LPUSH operation.
</li>
<li>
All the keys expiring in the database 0.
</li>
</ul>
<p>
Note: Redis Pub/Sub is
<em>
fire and forget
</em>
; that is, if your Pub/Sub client disconnects,
and reconnects later, all the events delivered during the time the client was
disconnected are lost.
</p>
<h3 id="type-of-events">
Type of events
</h3>
<p>
Keyspace notifications are implemented by sending two distinct types of events
for every operation affecting the Redis data space. For instance a
<a href="/docs/latest/commands/del/">
<code>
DEL
</code>
</a>
operation targeting the key named
<code>
mykey
</code>
in database
<code>
0
</code>
will trigger
the delivering of two messages, exactly equivalent to the following two
<a href="/docs/latest/commands/publish/">
<code>
PUBLISH
</code>
</a>
commands:
</p>
<pre><code>PUBLISH __keyspace@0__:mykey del
PUBLISH __keyevent@0__:del mykey
</code></pre>
<p>
The first channel listens to all the events targeting
the key
<code>
mykey
</code>
and the other channel listens only to
<code>
del
</code>
operation
events on the key
<code>
mykey
</code>
</p>
<p>
The first kind of event, with
<code>
keyspace
</code>
prefix in the channel is called
a
<strong>
Key-space notification
</strong>
, while the second, with the
<code>
keyevent
</code>
prefix,
is called a
<strong>
Key-event notification
</strong>
.
</p>
<p>
In the previous example a
<code>
del
</code>
event was generated for the key
<code>
mykey
</code>
resulting
in two messages:
</p>
<ul>
<li>
The Key-space channel receives as message the name of the event.
</li>
<li>
The Key-event channel receives as message the name of the key.
</li>
</ul>
<p>
It is possible to enable only one kind of notification in order to deliver
just the subset of events we are interested in.
</p>
<h3 id="configuration">
Configuration
</h3>
<p>
By default keyspace event notifications are disabled because while not
very sensible the feature uses some CPU power. Notifications are enabled
using the
<code>
notify-keyspace-events
</code>
of redis.conf or via the
<strong>
CONFIG SET
</strong>
.
</p>
<p>
Setting the parameter to the empty string disables notifications.
In order to enable the feature a non-empty string is used, composed of multiple
characters, where every character has a special meaning according to the
following table:
</p>
<pre><code>K Keyspace events, published with __keyspace@<db>__ prefix.
E Keyevent events, published with __keyevent@<db>__ prefix.
g Generic commands (non-type specific) like DEL, EXPIRE, RENAME, ...
$ String commands
l List commands
s Set commands
h Hash commands
z Sorted set commands
t Stream commands
d Module key type events
x Expired events (events generated every time a key expires)
e Evicted events (events generated when a key is evicted for maxmemory)
m Key miss events (events generated when a key that doesn't exist is accessed)
n New key events (Note: not included in the 'A' class)
A Alias for "g$lshztxed", so that the "AKE" string means all the events except "m" and "n".
</code></pre>
<p>
At least
<code>
K
</code>
or
<code>
E
</code>
should be present in the string, otherwise no event
will be delivered regardless of the rest of the string.
</p>
<p>
For instance to enable just Key-space events for lists, the configuration
parameter must be set to
<code>
Kl
</code>
, and so forth.
</p>
<p>
You can use the string
<code>
KEA
</code>
to enable most types of events.
</p>
<h3 id="events-generated-by-different-commands">
Events generated by different commands
</h3>
<p>
Different commands generate different kind of events according to the following list.
</p>
<ul>
<li>
<a href="/docs/latest/commands/append/">
<code>
APPEND
</code>
</a>
generates an
<code>
append
</code>
event.
</li>
<li>
<a href="/docs/latest/commands/copy/">
<code>
COPY
</code>
</a>
generates a
<code>
copy_to
</code>
event.
</li>
<li>
<a href="/docs/latest/commands/del/">
<code>
DEL
</code>
</a>
generates a
<code>
del
</code>
event for every deleted key.
</li>
<li>
<a href="/docs/latest/commands/expire/">
<code>
EXPIRE
</code>
</a>
and all its variants (
<a href="/docs/latest/commands/pexpire/">
<code>
PEXPIRE
</code>
</a>
,
<a href="/docs/latest/commands/expireat/">
<code>
EXPIREAT
</code>
</a>
,
<a href="/docs/latest/commands/pexpireat/">
<code>
PEXPIREAT
</code>
</a>
) generate an
<code>
expire
</code>
event when called with a positive timeout (or a future timestamp). Note that when these commands are called with a negative timeout value or timestamp in the past, the key is deleted and only a
<code>
del
</code>
event is generated instead.
</li>
<li>
<a href="/docs/latest/commands/hdel/">
<code>
HDEL
</code>
</a>
generates a single
<code>
hdel
</code>
event, and an additional
<code>
del
</code>
event if the resulting hash is empty and the key is removed.
</li>
<li>
<a href="/docs/latest/commands/hexpire/">
<code>
HEXPIRE
</code>
</a>
and all its variants (
<a href="/docs/latest/commands/hpexpireat/">
<code>
HEXPIREAT
</code>
</a>
,
<a href="/docs/latest/commands/hpexpire/">
<code>
HPEXPIRE
</code>
</a>
,
<a href="/docs/latest/commands/hpexpireat/">
<code>
HPEXPIREAT
</code>
</a>
) generate
<code>
hexpire
</code>
events. Furthermore,
<code>
hexpired
</code>
events are generated when fields expire.
</li>
<li>
<a href="/docs/latest/commands/hincrbyfloat/">
<code>
HINCRBYFLOAT
</code>
</a>
generates an
<code>
hincrbyfloat
</code>
event.
</li>
<li>
<a href="/docs/latest/commands/hincrby/">
<code>
HINCRBY
</code>
</a>
generates an
<code>
hincrby
</code>
event.
</li>
<li>
<a href="/docs/latest/commands/hpersist/">
<code>
HPERSIST
</code>
</a>
generates an
<code>
hpersist
</code>
event.
</li>
<li>
<a href="/docs/latest/commands/hset/">
<code>
HSET
</code>
</a>
,
<a href="/docs/latest/commands/hsetnx/">
<code>
HSETNX
</code>
</a>
and
<a href="/docs/latest/commands/hmset/">
<code>
HMSET
</code>
</a>
all generate a single
<code>
hset
</code>
event.
</li>
<li>
<a href="/docs/latest/commands/incrbyfloat/">
<code>
INCRBYFLOAT
</code>
</a>
generates an
<code>
incrbyfloat
</code>
events.
</li>
<li>
<a href="/docs/latest/commands/incr/">
<code>
INCR
</code>
</a>
,
<a href="/docs/latest/commands/decr/">
<code>
DECR
</code>
</a>
,
<a href="/docs/latest/commands/incrby/">
<code>
INCRBY
</code>
</a>
,
<a href="/docs/latest/commands/decrby/">
<code>
DECRBY
</code>
</a>
commands all generate
<code>
incrby
</code>
events.
</li>
<li>
<a href="/docs/latest/commands/linsert/">
<code>
LINSERT
</code>
</a>
generates an
<code>
linsert
</code>
event.
</li>
<li>
<a href="/docs/latest/commands/lmove/">
<code>
LMOVE
</code>
</a>
and
<a href="/docs/latest/commands/blmove/">
<code>
BLMOVE
</code>
</a>
generate an
<code>
lpop
</code>
/
<code>
rpop
</code>
event (depending on the wherefrom argument) and an
<code>
lpush
</code>
/
<code>
rpush
</code>
event (depending on the whereto argument). In both cases the order is guaranteed (the
<code>
lpush
</code>
/
<code>
rpush
</code>
event will always be delivered after the
<code>
lpop
</code>
/
<code>
rpop
</code>
event). Additionally a
<code>
del
</code>
event will be generated if the resulting list is zero length and the key is removed.
</li>
<li>
<a href="/docs/latest/commands/lpop/">
<code>
LPOP
</code>
</a>
generates an
<code>
lpop
</code>
event. Additionally a
<code>
del
</code>
event is generated if the key is removed because the last element from the list was popped.
</li>
<li>
<a href="/docs/latest/commands/lpush/">
<code>
LPUSH
</code>
</a>
and
<a href="/docs/latest/commands/lpushx/">
<code>
LPUSHX
</code>
</a>
generates a single
<code>
lpush
</code>
event, even in the variadic case.
</li>
<li>
<a href="/docs/latest/commands/lrem/">
<code>
LREM
</code>
</a>
generates an
<code>
lrem
</code>
event, and additionally a
<code>
del
</code>
event if the resulting list is empty and the key is removed.
</li>
<li>
<a href="/docs/latest/commands/lset/">
<code>
LSET
</code>
</a>
generates an
<code>
lset
</code>
event.
</li>
<li>
<a href="/docs/latest/commands/ltrim/">
<code>
LTRIM
</code>
</a>
generates an
<code>
ltrim
</code>
event, and additionally a
<code>
del
</code>
event if the resulting list is empty and the key is removed.
</li>
<li>
<a href="/docs/latest/commands/migrate/">
<code>
MIGRATE
</code>
</a>
generates a
<code>
del
</code>
event if the source key is removed.
</li>
<li>
<a href="/docs/latest/commands/move/">
<code>
MOVE
</code>
</a>
generates two events, a
<code>
move_from
</code>
event for the source key, and a
<code>
move_to
</code>
event for the destination key.
</li>
<li>
<a href="/docs/latest/commands/mset/">
<code>
MSET
</code>
</a>
generates a separate
<code>
set
</code>
event for every key.
</li>
<li>
<a href="/docs/latest/commands/persist/">
<code>
PERSIST
</code>
</a>
generates a
<code>
persist
</code>
event if the expiry time associated with key has been successfully deleted.
</li>
<li>
<a href="/docs/latest/commands/rename/">
<code>
RENAME
</code>
</a>
generates two events, a
<code>
rename_from
</code>
event for the source key, and a
<code>
rename_to
</code>
event for the destination key.
</li>
<li>
<a href="/docs/latest/commands/restore/">
<code>
RESTORE
</code>
</a>
generates a
<code>
restore
</code>
event for the key.
</li>
<li>
<a href="/docs/latest/commands/rpoplpush/">
<code>
RPOPLPUSH
</code>
</a>
and
<a href="/docs/latest/commands/brpoplpush/">
<code>
BRPOPLPUSH
</code>
</a>
generate an
<code>
rpop
</code>
event and an
<code>
lpush
</code>
event. In both cases the order is guaranteed (the
<code>
lpush
</code>
event will always be delivered after the
<code>
rpop
</code>
event). Additionally a
<code>
del
</code>
event will be generated if the resulting list is zero length and the key is removed.
</li>
<li>
<a href="/docs/latest/commands/rpop/">
<code>
RPOP
</code>
</a>
generates an
<code>
rpop
</code>
event. Additionally a
<code>
del
</code>
event is generated if the key is removed because the last element from the list was popped.
</li>
<li>
<a href="/docs/latest/commands/rpush/">
<code>
RPUSH
</code>
</a>
and
<a href="/docs/latest/commands/rpushx/">
<code>
RPUSHX
</code>
</a>
generates a single
<code>
rpush
</code>
event, even in the variadic case.
</li>
<li>
<a href="/docs/latest/commands/sadd/">
<code>
SADD
</code>
</a>
generates a single
<code>
sadd
</code>
event, even in the variadic case.
</li>
<li>
<a href="/docs/latest/commands/setrange/">
<code>
SETRANGE
</code>
</a>
generates a
<code>
setrange
</code>
event.
</li>
<li>
<a href="/docs/latest/commands/set/">
<code>
SET
</code>
</a>
and all its variants (
<a href="/docs/latest/commands/setex/">
<code>
SETEX
</code>
</a>
,
<a href="/docs/latest/commands/setnx/">
<code>
SETNX
</code>
</a>
,
<a href="/docs/latest/commands/getset/">
<code>
GETSET
</code>
</a>
) generate
<code>
set
</code>
events. However
<a href="/docs/latest/commands/setex/">
<code>
SETEX
</code>
</a>
will also generate an
<code>
expire
</code>
events.
</li>
<li>
<a href="/docs/latest/commands/sinterstore/">
<code>
SINTERSTORE
</code>
</a>
,
<a href="/docs/latest/commands/sunionstore/">
<code>
SUNIONSTORE
</code>
</a>
,
<a href="/docs/latest/commands/sdiffstore/">
<code>
SDIFFSTORE
</code>
</a>
generate
<code>
sinterstore
</code>
,
<code>
sunionstore
</code>
,
<code>
sdiffstore
</code>
events respectively. In the special case the resulting set is empty, and the key where the result is stored already exists, a
<code>
del
</code>
event is generated since the key is removed.
</li>
<li>
<a href="/docs/latest/commands/smove/">
<code>
SMOVE
</code>
</a>
generates an
<code>
srem
</code>
event for the source key, and an
<code>
sadd
</code>
event for the destination key.
</li>
<li>
<a href="/docs/latest/commands/sort/">
<code>
SORT
</code>
</a>
generates a
<code>
sortstore
</code>
event when
<code>
STORE
</code>
is used to set a new key. If the resulting list is empty, and the
<code>
STORE
</code>
option is used, and there was already an existing key with that name, the result is that the key is deleted, so a
<code>
del
</code>
event is generated in this condition.
</li>
<li>
<a href="/docs/latest/commands/spop/">
<code>
SPOP
</code>
</a>
generates an
<code>
spop
</code>
event, and an additional
<code>
del
</code>
event if the resulting set is empty and the key is removed.
</li>
<li>
<a href="/docs/latest/commands/srem/">
<code>
SREM
</code>
</a>
generates a single
<code>
srem
</code>
event, and an additional
<code>
del
</code>
event if the resulting set is empty and the key is removed.
</li>
<li>
<a href="/docs/latest/commands/xadd/">
<code>
XADD
</code>
</a>
generates an
<code>
xadd
</code>
event, possibly followed an
<code>
xtrim
</code>
event when used with the
<code>
MAXLEN
</code>
subcommand.
</li>
<li>
<a href="/docs/latest/commands/xdel/">
<code>
XDEL
</code>
</a>
generates a single
<code>
xdel
</code>
event even when multiple entries are deleted.
</li>
<li>
<a href="/docs/latest/commands/xgroup-createconsumer/">
<code>
XGROUP CREATECONSUMER
</code>
</a>
generates an
<code>
xgroup-createconsumer
</code>
event.
</li>
<li>
<a href="/docs/latest/commands/xgroup-create/">
<code>
XGROUP CREATE
</code>
</a>
generates an
<code>
xgroup-create
</code>
event.
</li>
<li>
<a href="/docs/latest/commands/xgroup-delconsumer/">
<code>
XGROUP DELCONSUMER
</code>
</a>
generates an
<code>
xgroup-delconsumer
</code>
event.
</li>
<li>
<a href="/docs/latest/commands/xgroup-destroy/">
<code>
XGROUP DESTROY
</code>
</a>
generates an
<code>
xgroup-destroy
</code>
event.
</li>
<li>
<a href="/docs/latest/commands/xgroup-setid/">
<code>
XGROUP SETID
</code>
</a>
generates an
<code>
xgroup-setid
</code>
event.
</li>
<li>
<a href="/docs/latest/commands/xsetid/">
<code>
XSETID
</code>
</a>
generates an
<code>
xsetid
</code>
event.
</li>
<li>
<a href="/docs/latest/commands/xtrim/">
<code>
XTRIM
</code>
</a>
generates an
<code>
xtrim
</code>
event.
</li>
<li>
<a href="/docs/latest/commands/zadd/">
<code>
ZADD
</code>
</a>
generates a single
<code>
zadd
</code>
event even when multiple elements are added.
</li>
<li>
<a href="/docs/latest/commands/zdiffstore/">
<code>
ZDIFFSTORE
</code>
</a>
,
<a href="/docs/latest/commands/zinterstore/">
<code>
ZINTERSTORE
</code>
</a>
and
<a href="/docs/latest/commands/zunionstore/">
<code>
ZUNIONSTORE
</code>
</a>
respectively generate
<code>
zdiffstore
</code>
,
<code>
zinterstore
</code>
and
<code>
zunionstore
</code>
events. In the special case the resulting sorted set is empty, and the key where the result is stored already exists, a
<code>
del
</code>
event is generated since the key is removed.
</li>
<li>
<a href="/docs/latest/commands/zincrby/">
<code>
ZINCRBY
</code>
</a>
generates a
<code>
zincr
</code>
event.
</li>
<li>
<a href="/docs/latest/commands/zremrangebyrank/">
<code>
ZREMRANGEBYRANK
</code>
</a>
generates a single
<code>
zrembyrank
</code>
event. When the resulting sorted set is empty and the key is generated, an additional
<code>
del
</code>
event is generated.
</li>
<li>
<a href="/docs/latest/commands/zremrangebyscore/">
<code>
ZREMRANGEBYSCORE
</code>
</a>
generates a single
<code>
zrembyscore
</code>
event. When the resulting sorted set is empty and the key is generated, an additional
<code>
del
</code>
event is generated.
</li>
<li>
<a href="/docs/latest/commands/zrem/">
<code>
ZREM
</code>
</a>
generates a single
<code>
zrem
</code>
event even when multiple elements are deleted. When the resulting sorted set is empty and the key is generated, an additional
<code>
del
</code>
event is generated.
</li>
<li>
Every time a key with a time to live associated is removed from the data set because it expired, an
<code>
expired
</code>
event is generated.
</li>
<li>
Every time a key is evicted from the data set in order to free memory as a result of the
<code>
maxmemory
</code>
policy, an
<code>
evicted
</code>
event is generated.
</li>
<li>
Every time a new key is added to the data set, a
<code>
new
</code>
event is generated.
</li>
</ul>
<p>
<strong>
IMPORTANT
</strong>
all the commands generate events only if the target key is really modified. For instance an
<a href="/docs/latest/commands/srem/">
<code>
SREM
</code>
</a>
deleting a non-existing element from a Set will not actually change the value of the key, so no event will be generated.
</p>
<p>
If in doubt about how events are generated for a given command, the simplest
thing to do is to watch yourself:
</p>
<pre><code>$ redis-cli config set notify-keyspace-events KEA
$ redis-cli --csv psubscribe '__key*__:*'
Reading messages... (press Ctrl-C to quit)
"psubscribe","__key*__:*",1
</code></pre>
<p>
At this point use
<code>
redis-cli
</code>
in another terminal to send commands to the
Redis server and watch the events generated:
</p>
<pre><code>"pmessage","__key*__:*","__keyspace@0__:foo","set"
"pmessage","__key*__:*","__keyevent@0__:set","foo"
...
</code></pre>
<h3 id="timing-of-expired-events">
Timing of expired events
</h3>
<p>
Keys with a time to live associated are expired by Redis in two ways:
</p>
<ul>
<li>
When the key is accessed by a command and is found to be expired.
</li>
<li>
Via a background system that looks for expired keys in the background, incrementally, in order to be able to also collect keys that are never accessed.
</li>
</ul>
<p>
The
<code>
expired
</code>
events are generated when a key is accessed and is found to be expired by one of the above systems, as a result there are no guarantees that the Redis server will be able to generate the
<code>
expired
</code>
event at the time the key time to live reaches the value of zero.
</p>
<p>
If no command targets the key constantly, and there are many keys with a TTL associated, there can be a significant delay between the time the key time to live drops to zero, and the time the
<code>
expired
</code>
event is generated.
</p>
<p>
Expired (
<code>
expired
</code>
) events are generated when the Redis server deletes the key and not when the time to live theoretically reaches the value of zero.
</p>
<h3 id="events-in-a-cluster">
Events in a cluster
</h3>
<p>
Every node of a Redis cluster generates events about its own subset of the keyspace as described above. However, unlike regular Pub/Sub communication in a cluster, events' notifications
<strong>
are not
</strong>
broadcasted to all nodes. Put differently, keyspace events are node-specific. This means that to receive all keyspace events of a cluster, clients need to subscribe to each of the nodes.
</p>
<p>
@history
</p>
<ul>
<li>
<code>
>= 6.0
</code>
: Key miss events were added.
</li>
<li>
<code>
>= 7.0
</code>
: Event type
<code>
new
</code>
added
</li>
</ul>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/develop/use/keyspace-notifications/"/>
<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/redisjson/redisjson-1.0-release-notes/.html | <section class="prose w-full py-12 max-w-none">
<h1>
RedisJSON 1.0 release notes
</h1>
<p class="text-lg -mt-5 mb-10">
Serialization cache for JSON.GET.
</p>
<h2 id="requirements">
Requirements
</h2>
<p>
RedisJSON v1.0.8 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="v108-august-2021">
v1.0.8 (August 2021)
</h2>
<p>
This is a maintenance release for version 1.0.
</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>
Enhancements:
</p>
<ul>
<li>
#
<a href="https://github.com/redisjson/redisjson/issues/257">
257
</a>
Support inter shards TLS capability
</li>
</ul>
</li>
<li>
<p>
Bug fixes:
</p>
<ul>
<li>
#
<a href="https://github.com/redisjson/redisjson/issues/282">
282
</a>
Change
<code>
JSON.DEBUG
</code>
first key index to 2
</li>
</ul>
</li>
</ul>
<h2 id="v107-december-2020">
v1.0.7 (December 2020)
</h2>
<p>
This is a maintenance release for version 1.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>
<a href="https://github.com/RedisJSON/RedisJSON/pull/222">
#222
</a>
Validate path is not empty.
</li>
<li>
<a href="https://github.com/RedisJSON/RedisJSON/pull/253">
#253
</a>
<code>
NULL
</code>
de-reference after error.
</li>
</ul>
<h2 id="v105-september-2020">
v1.0.5 (September 2020)
</h2>
<p>
This is a maintenance release for version 1.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>
Republish docker image based on Redis 6
</li>
</ul>
</li>
<li>
Bugfixes:
<ul>
<li>
#
<a href="https://github.com/RedisJSON/RedisJSON/issues/200">
200
</a>
Following a call to JSON.ARRPOP and JSON.STRAPPEND, the LRU cache should be invalidated.
</li>
</ul>
</li>
</ul>
<h2 id="v104-february-2019">
v1.0.4 (February 2019)
</h2>
<p>
This release updates the version to 1.0.4.
</p>
<h2 id="v103-12-september-2018">
v1.0.3 (12 September 2018)
</h2>
<p>
This release disables the cache by default, and allows an explicit
<code>
CACHE
</code>
<code>
<ON|OFF>
</code>
module argument to enable it.
</p>
<h2 id="v102-10-september-2018">
v1.0.2 (10 September 2018)
</h2>
<p>
This release contains some bug fixes over 1.0.2. It also includes some ci changes as well.
</p>
<h2 id="v101-december-2017">
v1.0.1 (December 2017)
</h2>
<p>
This version provides a serialization cache for JSON.GET (when used with the
default parameters). The cache policy is LRU (last recently used), and extremely
small items are not cached.
</p>
<p>
In the future, options may be added to configure the cache, but for the time being
the cache is intended to be small and transparent.
</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/redisjson/redisjson-1.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/operate/rc/databases/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Manage databases
</h1>
<p>
Databases are the heart of any Redis Cloud deployment.
</p>
<p>
Here's how to perform a variety of tasks:
</p>
<h2 id="common-database-tasks">
Common database tasks
</h2>
<ul>
<li>
<p>
<a href="/docs/latest/operate/rc/databases/create-database/">
Create a database
</a>
</p>
<ul>
<li>
<a href="/docs/latest/operate/rc/databases/create-database/create-essentials-database/">
Create an Essentials database
</a>
</li>
<li>
<a href="/docs/latest/operate/rc/databases/create-database/create-pro-database-new/">
Create a Pro database with a new subscription
</a>
</li>
<li>
<a href="/docs/latest/operate/rc/databases/create-database/create-pro-database-existing/">
Create a Pro database in an existing subscription
</a>
</li>
<li>
<a href="/docs/latest/operate/rc/databases/create-database/create-active-active-database/">
Create an Active-Active database
</a>
</li>
</ul>
</li>
<li>
<p>
<a href="/docs/latest/operate/rc/databases/view-edit-database/">
View and edit databases
</a>
</p>
</li>
<li>
<p>
<a href="/docs/latest/operate/rc/databases/delete-database/">
Delete database
</a>
</p>
</li>
</ul>
<p>
If you're new to Redis Cloud, see the
<a href="/docs/latest/operate/rc/rc-quickstart/">
Quick Start
</a>
.
</p>
<h2 id="additional-tasks">
Additional tasks
</h2>
<ul>
<li>
<p>
<a href="/docs/latest/operate/rc/databases/monitor-performance/">
Monitor database performance
</a>
</p>
</li>
<li>
<p>
<a href="/docs/latest/operate/rc/databases/import-data/">
Import data into databases
</a>
</p>
</li>
<li>
<p>
<a href="/docs/latest/operate/rc/databases/back-up-data/">
Back up databases
</a>
</p>
</li>
<li>
<p>
<a href="/docs/latest/operate/rc/security/database-security/">
Secure database access
</a>
</p>
</li>
<li>
<p>
<a href="/docs/latest/operate/rc/databases/flush-data/">
Flush database data
</a>
</p>
</li>
</ul>
<h2 id="configuration-details">
Configuration details
</h2>
<p>
These topics provide background details that can help you tailor your databases to better fit your needs.
</p>
<ul>
<li>
<p>
<a href="/docs/latest/operate/rc/databases/configuration/clustering/">
Clustering Redis databases
</a>
: Redis Cloud uses clustering to manage very large databases (25 GB and larger). Learn how to manage clustering and how to use hashing policies to manage the process.
</p>
</li>
<li>
<p>
<a href="/docs/latest/operate/rc/databases/configuration/data-eviction-policies/">
Data eviction policies
</a>
: Data eviction policies control what happens when new data exceeds the memory limits of a database. Learn the available policies and how to control them.
</p>
</li>
<li>
<p>
<a href="/docs/latest/operate/rc/databases/configuration/data-persistence/">
Data persistence
</a>
: Data persistence enables recovery in the event of memory loss or other catastrophic failure. Learn which options are available and how to apply specific settings to individual databases.
</p>
</li>
<li>
<p>
<a href="/docs/latest/operate/rc/databases/configuration/high-availability/">
High availability and replication
</a>
: Replication allows for automatic failover and greater fault tolerance. It can prevent data loss in the event of a hardware or zone failure. Learn which options are available for Redis Cloud subscriptions.
</p>
</li>
<li>
<p>
<a href="/docs/latest/operate/rc/databases/configuration/advanced-capabilities/">
Advanced Capabilities
</a>
: Advanced capabilities extend Redis database functionality by adding new data types and options. Learn about the advanced capability options that are available for your database.
</p>
</li>
</ul>
<h2 id="compatibility">
Compatibility
</h2>
<p>
Redis Cloud does not support certain commands. Instead of using these commands, Redis Cloud automatically handles features like replication and lets you
<a href="/docs/latest/operate/rc/databases/">
manage your database
</a>
from the
<a href="https://cloud.redis.io/">
Redis Cloud console
</a>
or
<a href="/docs/latest/operate/rc/api/">
Redis Cloud REST API
</a>
.
</p>
<p>
For more details, see:
</p>
<ul>
<li>
<p>
<a href="/docs/latest/operate/rc/compatibility/">
Redis Cloud compatibility
</a>
</p>
</li>
<li>
<p>
<a href="/docs/latest/operate/rs/references/compatibility/commands/">
Command compatibility
</a>
</p>
</li>
<li>
<p>
<a href="/docs/latest/operate/rs/references/compatibility/config-settings/">
Configuration compatibility
</a>
</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/databases/"/>
<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/suffix/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Suffix object
</h1>
<p class="text-lg -mt-5 mb-10">
An object that represents a DNS suffix
</p>
<p>
An API object that represents a DNS suffix in the cluster.
</p>
<table>
<thead>
<tr>
<th>
Name
</th>
<th>
Type/Value
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
default
</td>
<td>
boolean
</td>
<td>
Suffix is the default suffix for the cluster (read-only)
</td>
</tr>
<tr>
<td>
internal
</td>
<td>
boolean
</td>
<td>
Does the suffix point to internal IP addresses (read-only)
</td>
</tr>
<tr>
<td>
mdns
</td>
<td>
boolean
</td>
<td>
Support for multicast DNS (read-only)
</td>
</tr>
<tr>
<td>
name
</td>
<td>
string
</td>
<td>
Unique suffix name that represents its zone (read-only)
</td>
</tr>
<tr>
<td>
slaves
</td>
<td>
array of strings
</td>
<td>
Frontend DNS servers to be updated by this suffix
</td>
</tr>
<tr>
<td>
use_aaaa_ns
</td>
<td>
boolean
</td>
<td>
Suffix uses AAAA NS entries (read-only)
</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/suffix/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/references/cli-utilities/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Command-line utilities
</h1>
<p class="text-lg -mt-5 mb-10">
Reference for Redis Enterprise Software command-line utilities, including rladmin, redis-cli, crdb-cli, and rlcheck.
</p>
<p>
Redis Enterprise Software includes a set of utilities to help you manage and test your cluster. To use a utility, run it from the command line.
</p>
<h2 id="public-utilities">
Public utilities
</h2>
<p>
Administrators can use these CLI tools to manage and test a Redis Enterprise cluster. You can find the binaries in the
<code>
/opt/redislabs/bin/
</code>
directory.
</p>
<table>
<thead>
<tr>
<th style="text-align:left">
Utility
</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/">
crdb-cli (manage Active-Active)
</a>
</td>
<td style="text-align:left">
Manage Active-Active databases.
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/rs/references/cli-utilities/redis-cli/">
redis-cli (run Redis commands)
</a>
</td>
<td style="text-align:left">
Run Redis commands.
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/rs/references/cli-utilities/rladmin/">
rladmin (manage cluster)
</a>
</td>
<td style="text-align:left">
Manage Redis Enterprise clusters and databases.
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="/docs/latest/operate/rs/references/cli-utilities/rlcheck/">
rlcheck (verify nodes)
</a>
</td>
<td style="text-align:left">
Verify nodes.
</td>
</tr>
</tbody>
</table>
<h2 id="internal-utilities">
Internal utilities
</h2>
<p>
The
<code>
/opt/redislabs/bin/
</code>
directory also contains utilities used internally by Redis Enterprise Software and for troubleshooting.
</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>
Do not use these tools for normal operations.
</div>
</div>
<table>
<thead>
<tr>
<th>
Utility
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
bdb-cli
</td>
<td>
<code>
redis-cli
</code>
connected to a database.
</td>
</tr>
<tr>
<td>
ccs-cli
</td>
<td>
Inspect Cluster Configuration Store.
</td>
</tr>
<tr>
<td>
cnm-ctl
</td>
<td>
Manages services for provisioning, migration, monitoring,
<br/>
resharding, rebalancing, deprovisioning, and autoscaling.
</td>
</tr>
<tr>
<td>
consistency_checker
</td>
<td>
Checks the consistency of Redis instances.
</td>
</tr>
<tr>
<td>
crdbtop
</td>
<td>
Monitor Active-Active databases.
</td>
</tr>
<tr>
<td>
debug_mode
</td>
<td>
Enables debug mode.
</td>
</tr>
<tr>
<td>
debuginfo
</td>
<td>
Collects cluster information.
</td>
</tr>
<tr>
<td>
dmc-cli
</td>
<td>
Configure and monitor the DMC proxy.
</td>
</tr>
<tr>
<td>
pdns_control
</td>
<td>
Sends commands to a running PowerDNS nameserver.
</td>
</tr>
<tr>
<td>
redis_ctl
</td>
<td>
Stops or starts Redis instances.
</td>
</tr>
<tr>
<td>
rl_rdbloader
</td>
<td>
Load RDB backup files to a server.
</td>
</tr>
<tr>
<td>
rlutil
</td>
<td>
Maintenance utility.
</td>
</tr>
<tr>
<td>
shard-cli
</td>
<td>
<code>
redis-cli
</code>
connected to a shard.
</td>
</tr>
<tr>
<td>
supervisorctl
</td>
<td>
Manages the lifecycles of Redis Enterprise services.
</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/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/develop/data-types/timeseries/configuration/.html | <section class="prose w-full py-12">
<h1>
Configuration Parameters
</h1>
<p class="text-lg -mt-5 mb-10">
RedisTimeSeries supports multiple module configuration parameters. All of these parameters can only be set at load-time.
</p>
<h2 id="setting-configuration-parameters-on-module-load">
Setting configuration parameters on module load
</h2>
<p>
Setting configuration parameters at load-time is done by appending arguments after the
<code>
--loadmodule
</code>
argument when starting a server from the command line or after the
<code>
loadmodule
</code>
directive in a Redis config file. For example:
</p>
<p>
In
<a href="/docs/latest/operate/oss_and_stack/management/config/">
redis.conf
</a>
:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">loadmodule ./redistimeseries.so <span class="o">[</span>OPT VAL<span class="o">]</span>...
</span></span></code></pre>
</div>
<p>
From the
<a href="/docs/latest/develop/tools/cli/">
Redis CLI
</a>
, using the
<a href="/docs/latest/commands/module-load/">
MODULE LOAD
</a>
command:
</p>
<pre tabindex="0"><code>127.0.0.6379> MODULE LOAD redistimeseries.so [OPT VAL]...
</code></pre>
<p>
From the command line:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ redis-server --loadmodule ./redistimeseries.so <span class="o">[</span>OPT VAL<span class="o">]</span>...
</span></span></code></pre>
</div>
<h2 id="redistimeseries-configuration-parameters">
RedisTimeSeries configuration parameters
</h2>
<p>
The following table summarizes which configuration parameters can be set at module load-time and run-time:
</p>
<table>
<thead>
<tr>
<th style="text-align:left">
Configuration Parameter
</th>
<th style="text-align:left">
Load-time
</th>
<th style="text-align:left">
Run-time
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">
<a href="#num_threads">
NUM_THREADS
</a>
(since RedisTimeSeries v1.6)
</td>
<td style="text-align:left">
β
</td>
<td style="text-align:left">
β¬
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="#compaction_policy">
COMPACTION_POLICY
</a>
</td>
<td style="text-align:left">
β
</td>
<td style="text-align:left">
β¬
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="#retention_policy">
RETENTION_POLICY
</a>
</td>
<td style="text-align:left">
β
</td>
<td style="text-align:left">
β¬
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="#duplicate_policy">
DUPLICATE_POLICY
</a>
</td>
<td style="text-align:left">
β
</td>
<td style="text-align:left">
β¬
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="#encoding">
ENCODING
</a>
(since RedisTimeSeries v1.6)
</td>
<td style="text-align:left">
β
</td>
<td style="text-align:left">
β¬
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="#chunk_size_bytes">
CHUNK_SIZE_BYTES
</a>
</td>
<td style="text-align:left">
β
</td>
<td style="text-align:left">
β¬
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="#oss_global_password">
OSS_GLOBAL_PASSWORD
</a>
(since RedisTimeSeries v1.8.4)
</td>
<td style="text-align:left">
β
</td>
<td style="text-align:left">
β¬
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="#ignore_max_time_diff-and-ignore_max_val_diff">
IGNORE_MAX_TIME_DIFF
</a>
(since RedisTimeSeries v1.12)
</td>
<td style="text-align:left">
β
</td>
<td style="text-align:left">
β¬
</td>
</tr>
<tr>
<td style="text-align:left">
<a href="#ignore_max_time_diff-and-ignore_max_val_diff">
IGNORE_MAX_VAL_DIFF
</a>
(since RedisTimeSeries v1.12)
</td>
<td style="text-align:left">
β
</td>
<td style="text-align:left">
β¬
</td>
</tr>
</tbody>
</table>
<h3 id="num_threads">
NUM_THREADS
</h3>
<p>
The maximal number of per-shard threads for cross-key queries when using cluster mode (TS.MRANGE, TS.MREVRANGE, TS.MGET, and TS.QUERYINDEX). The value must be equal to or greater than 1. Note that increasing this value may either increase or decrease the performance!
</p>
<h4 id="default">
Default
</h4>
<p>
<code>
3
</code>
</p>
<h4 id="example">
Example
</h4>
<pre tabindex="0"><code>$ redis-server --loadmodule ./redistimeseries.so NUM_THREADS 3
</code></pre>
<h3 id="compaction_policy">
COMPACTION_POLICY
</h3>
<p>
Default compaction rules for newly created key with
<a href="/docs/latest/commands/ts.add/">
<code>
TS.ADD
</code>
</a>
,
<a href="/docs/latest/commands/ts.incrby/">
<code>
TS.INCRBY
</code>
</a>
, and
<a href="/docs/latest/commands/ts.decrby/">
<code>
TS.DECRBY
</code>
</a>
.
</p>
<p>
Note that
<code>
COMPACTION_POLICY
</code>
has no effect on keys created with
<a href="/docs/latest/commands/ts.create/">
<code>
TS.CREATE
</code>
</a>
. To understand the motivation for this behavior, consider the following scenario: Suppose a
<code>
COMPACTION_POLICY
</code>
is defined, but then one wants to manually create an additional compaction rule (using
<a href="/docs/latest/commands/ts.createrule/">
<code>
TS.CREATERULE
</code>
</a>
) which requires first creating an empty destination key (using
<a href="/docs/latest/commands/ts.create/">
<code>
TS.CREATE
</code>
</a>
). But now there is a problem: due to the
<code>
COMPACTION_POLICY
</code>
, automatic compactions would be undesirably created for that destination key.
</p>
<p>
Each rule is separated by a semicolon (
<code>
;
</code>
), the rule consists of multiple fields that are separated by a colon (
<code>
:
</code>
):
</p>
<ul>
<li>
<p>
Aggregation type: One of the following:
</p>
<table>
<thead>
<tr>
<th>
aggregator
</th>
<th>
description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>
avg
</code>
</td>
<td>
arithmetic mean of all values
</td>
</tr>
<tr>
<td>
<code>
sum
</code>
</td>
<td>
sum of all values
</td>
</tr>
<tr>
<td>
<code>
min
</code>
</td>
<td>
minimum value
</td>
</tr>
<tr>
<td>
<code>
max
</code>
</td>
<td>
maximum value
</td>
</tr>
<tr>
<td>
<code>
range
</code>
</td>
<td>
difference between the highest and the lowest value
</td>
</tr>
<tr>
<td>
<code>
count
</code>
</td>
<td>
number of values
</td>
</tr>
<tr>
<td>
<code>
first
</code>
</td>
<td>
the value with the lowest timestamp in the bucket
</td>
</tr>
<tr>
<td>
<code>
last
</code>
</td>
<td>
the value with the highest timestamp in the bucket
</td>
</tr>
<tr>
<td>
<code>
std.p
</code>
</td>
<td>
population standard deviation of the values
</td>
</tr>
<tr>
<td>
<code>
std.s
</code>
</td>
<td>
sample standard deviation of the values
</td>
</tr>
<tr>
<td>
<code>
var.p
</code>
</td>
<td>
population variance of the values
</td>
</tr>
<tr>
<td>
<code>
var.s
</code>
</td>
<td>
sample variance of the values
</td>
</tr>
<tr>
<td>
<code>
twa
</code>
</td>
<td>
time-weighted average of all values (since RedisTimeSeries v1.8)
</td>
</tr>
</tbody>
</table>
</li>
<li>
<p>
Duration of each time bucket - number and the time representation (Example for one minute:
<code>
1M
</code>
,
<code>
60s
</code>
, or
<code>
60000m
</code>
)
</p>
<ul>
<li>
m - millisecond
</li>
<li>
s - seconds
</li>
<li>
M - minute
</li>
<li>
h - hour
</li>
<li>
d - day
</li>
</ul>
</li>
<li>
<p>
Retention time - number and the time representation (Example for one minute:
<code>
1M
</code>
,
<code>
60s
</code>
, or
<code>
60000m
</code>
)
</p>
<ul>
<li>
m - millisecond
</li>
<li>
s - seconds
</li>
<li>
M - minute
</li>
<li>
h - hour
</li>
<li>
d - day
</li>
</ul>
<p>
<code>
0m
</code>
,
<code>
0s
</code>
,
<code>
0M
</code>
,
<code>
0h
</code>
, or
<code>
0d
</code>
means no expiration.
</p>
</li>
<li>
<p>
(since RedisTimeSeries v1.8):
</p>
<p>
Optional: Time bucket alignment - number and the time representation (Example for one minute:
<code>
1M
</code>
,
<code>
60s
</code>
, or
<code>
60000m
</code>
)
</p>
<ul>
<li>
m - millisecond
</li>
<li>
s - seconds
</li>
<li>
M - minute
</li>
<li>
h - hour
</li>
<li>
d - day
</li>
</ul>
<p>
Assure that there is a bucket that starts at exactly
<em>
alignTimestamp
</em>
after the epoch and align all other buckets accordingly. Default value: 0 (aligned with the epoch). Example: if
<em>
bucketDuration
</em>
is 24 hours, setting
<em>
alignTimestamp
</em>
to
<code>
6h
</code>
(6 hours after the Epoch) will ensure that each bucketβs timeframe is [06:00 .. 06:00).
</p>
</li>
</ul>
<p>
When a compaction policy is defined, compaction rules will be created automatically for newly created time series, and their key would be set to:
</p>
<ul>
<li>
<p>
Before RedisTimeSeries v1.8:
</p>
<p>
<em>
key_dur_agg
</em>
where
<em>
key
</em>
is the key of the source time series,
<em>
dur
</em>
is the bucket duration, and
<em>
agg
</em>
is the aggregator.
</p>
</li>
<li>
<p>
Since RedisTimeSeries v1.8:
</p>
<p>
<em>
key_dur_agg_aln
</em>
where
<em>
key
</em>
is the key of the source time series,
<em>
dur
</em>
is the bucket duration,
<em>
agg
</em>
is the aggregator, and
<em>
aln
</em>
is the alignment timestamp.
</p>
</li>
</ul>
<p>
Examples:
</p>
<ul>
<li>
<code>
max:1M:1h
</code>
- Aggregate using
<code>
max
</code>
over one minute and retain the last hour
</li>
<li>
<code>
twa:1d:0m:360M
</code>
- Aggregate daily [06:00 .. 06:00) using
<code>
twa
</code>
; no expiration
</li>
</ul>
<h4 id="default-1">
Default
</h4>
<p>
No compaction rules.
</p>
<h4 id="example-1">
Example
</h4>
<pre tabindex="0"><code>$ redis-server --loadmodule ./redistimeseries.so COMPACTION_POLICY max:1m:1h;min:10s:5d:10d;last:5M:10m;avg:2h:10d;avg:3d:100d
</code></pre>
<h3 id="retention_policy">
RETENTION_POLICY
</h3>
<p>
Default retention period, in milliseconds, for newly created keys.
</p>
<p>
Retention period is the maximum age of samples compared to highest reported timestamp, per key. Samples are expired based solely on the difference between their timestamp and the timestamps passed to subsequent
<a href="/docs/latest/commands/ts.add/">
<code>
TS.ADD
</code>
</a>
,
<a href="/docs/latest/commands/ts.madd/">
<code>
TS.MADD
</code>
</a>
,
<a href="/docs/latest/commands/ts.incrby/">
<code>
TS.INCRBY
</code>
</a>
, and
<a href="/docs/latest/commands/ts.decrby/">
<code>
TS.DECRBY
</code>
</a>
calls.
</p>
<p>
The value
<code>
0
</code>
means no expiration.
</p>
<p>
When both
<code>
COMPACTION_POLICY
</code>
and
<code>
RETENTION_POLICY
</code>
are specified, the retention of newly created compactions is according to the retention time specified in
<code>
COMPACTION_POLICY
</code>
.
</p>
<h4 id="default-2">
Default
</h4>
<p>
0
</p>
<h4 id="example-2">
Example
</h4>
<p>
Setting the default retention to 300 days:
</p>
<pre tabindex="0"><code>$ redis-server --loadmodule ./redistimeseries.so RETENTION_POLICY 25920000000
</code></pre>
<h3 id="duplicate_policy">
DUPLICATE_POLICY
</h3>
<p>
Is policy for handling insertion (
<a href="/docs/latest/commands/ts.add/">
<code>
TS.ADD
</code>
</a>
and
<a href="/docs/latest/commands/ts.madd/">
<code>
TS.MADD
</code>
</a>
) of multiple samples with identical timestamps, with one of the following values:
</p>
<table>
<thead>
<tr>
<th>
policy
</th>
<th>
description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>
BLOCK
</code>
</td>
<td>
ignore any newly reported value and reply with an error
</td>
</tr>
<tr>
<td>
<code>
FIRST
</code>
</td>
<td>
ignore any newly reported value
</td>
</tr>
<tr>
<td>
<code>
LAST
</code>
</td>
<td>
override with the newly reported value
</td>
</tr>
<tr>
<td>
<code>
MIN
</code>
</td>
<td>
only override if the value is lower than the existing value
</td>
</tr>
<tr>
<td>
<code>
MAX
</code>
</td>
<td>
only override if the value is higher than the existing value
</td>
</tr>
<tr>
<td>
<code>
SUM
</code>
</td>
<td>
If a previous sample exists, add the new sample to it so that the updated value is equal to (previous + new). If no previous sample exists, set the updated value equal to the new value.
</td>
</tr>
</tbody>
</table>
<h4 id="precedence-order">
Precedence order
</h4>
<p>
Since the duplication policy can be provided at different levels, the actual precedence of the used policy will be:
</p>
<ol>
<li>
<a href="/docs/latest/commands/ts.add/">
<code>
TS.ADD
</code>
</a>
's
<code>
ON_DUPLICATE_policy
</code>
optional argument
</li>
<li>
Key-level policy (as set with
<a href="/docs/latest/commands/ts.create/">
<code>
TS.CREATE
</code>
</a>
's and
<a href="/docs/latest/commands/ts.alter/">
<code>
TS.ALTER
</code>
</a>
's
<code>
DUPLICATE_POLICY
</code>
optional argument)
</li>
<li>
The
<code>
DUPLICATE_POLICY
</code>
module configuration parameter
</li>
<li>
The default policy
</li>
</ol>
<h4 id="default-3">
Default
</h4>
<p>
The default policy is
<code>
BLOCK
</code>
. Both new and pre-existing keys will conform to this default policy.
</p>
<h4 id="example-3">
Example
</h4>
<pre tabindex="0"><code>$ redis-server --loadmodule ./redistimeseries.so DUPLICATE_POLICY LAST
</code></pre>
<h3 id="encoding">
ENCODING
</h3>
<p>
Default chunk encoding for automatically created keys when
<a href="#COMPACTION_POLICY">
COMPACTION_POLICY
</a>
is configured.
</p>
<p>
Possible values:
<code>
COMPRESSED
</code>
,
<code>
UNCOMPRESSED
</code>
.
</p>
<p>
Note: Before RedisTimeSeries 1.6 this configuration parameter was named
<code>
CHUNK_TYPE
</code>
.
</p>
<h4 id="default-4">
Default
</h4>
<p>
<code>
COMPRESSED
</code>
</p>
<h4 id="example-4">
Example
</h4>
<pre tabindex="0"><code>$ redis-server --loadmodule ./redistimeseries.so COMPACTION_POLICY max:1m:1h; ENCODING COMPRESSED
</code></pre>
<h3 id="chunk_size_bytes">
CHUNK_SIZE_BYTES
</h3>
<p>
Default initial allocation size, in bytes, for the data part of each new chunk, for newly created time series. Actual chunks may consume more memory.
</p>
<h4 id="default-5">
Default
</h4>
<p>
4096
</p>
<h4 id="example-5">
Example
</h4>
<pre tabindex="0"><code>$ redis-server --loadmodule ./redistimeseries.so COMPACTION_POLICY max:1m:1h; CHUNK_SIZE_BYTES 2048
</code></pre>
<h3 id="oss_global_password">
OSS_GLOBAL_PASSWORD
</h3>
<p>
Global Redis Community Edition cluster password used for connecting to other shards.
</p>
<h4 id="default-6">
Default
</h4>
<p>
Not set
</p>
<h4 id="example-6">
Example
</h4>
<pre tabindex="0"><code>$ redis-server --loadmodule ./redistimeseries.so OSS_GLOBAL_PASSWORD password
</code></pre>
<h3 id="ignore_max_time_diff-and-ignore_max_val_diff">
IGNORE_MAX_TIME_DIFF and IGNORE_MAX_VAL_DIFF
</h3>
<p>
Default values for newly created keys.
</p>
<p>
Many sensors report data periodically. Often, the difference between the measured value and the previous measured value is negligible and related to random noise or to measurement accuracy limitations. In such situations it may be preferable not to add the new measurement to the time series.
</p>
<p>
A new sample is considered a duplicate and is ignored if the following conditions are met:
</p>
<ol>
<li>
The time series is not a compaction;
</li>
<li>
The time series'
<code>
DUPLICATE_POLICY
</code>
IS
<code>
LAST
</code>
;
</li>
<li>
The sample is added in-order (
<code>
timestamp β₯ max_timestamp
</code>
);
</li>
<li>
The difference of the current timestamp from the previous timestamp (
<code>
timestamp - max_timestamp
</code>
) is less than or equal to
<code>
IGNORE_MAX_TIME_DIFF
</code>
;
</li>
<li>
The absolute value difference of the current value from the value at the previous maximum timestamp (
<code>
abs(value - value_at_max_timestamp
</code>
) is less than or equal to
<code>
IGNORE_MAX_VAL_DIFF
</code>
.
</li>
</ol>
<p>
where
<code>
max_timestamp
</code>
is the timestamp of the sample with the largest timestamp in the time series, and
<code>
value_at_max_timestamp
</code>
is the value at
<code>
max_timestamp
</code>
.
</p>
<h4 id="defaults">
Defaults
</h4>
<p>
<code>
IGNORE_MAX_TIME_DIFF
</code>
: 0
</p>
<p>
<code>
IGNORE_MAX_VAL_DIFF
</code>
: 0.0
</p>
<h4 id="example-7">
Example
</h4>
<pre tabindex="0"><code>$ redis-server --loadmodule ./redistimeseries.so IGNORE_MAX_TIME_DIFF 1 IGNORE_MAX_VALUE_DIFF 0.1
</code></pre>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/develop/data-types/timeseries/configuration/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/7.4/references/rest-api/requests/shards/stats/last/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Latest shards stats requests
</h1>
<p class="text-lg -mt-5 mb-10">
Most recent shard statistics requests
</p>
<table>
<thead>
<tr>
<th>
Method
</th>
<th>
Path
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="#get-all-shards-stats-last">
GET
</a>
</td>
<td>
<code>
/v1/shards/stats/last
</code>
</td>
<td>
Get most recent stats for all shards
</td>
</tr>
<tr>
<td>
<a href="#get-shard-stats-last">
GET
</a>
</td>
<td>
<code>
/v1/shards/stats/last/{uid}
</code>
</td>
<td>
Get most recent stats for a specific shard
</td>
</tr>
</tbody>
</table>
<h2 id="get-all-shards-stats-last">
Get latest stats for all shards
</h2>
<pre><code>GET /v1/shards/stats/last
</code></pre>
<p>
Get most recent statistics for all shards.
</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_shard_stats">
view_all_shard_stats
</a>
</td>
</tr>
</tbody>
</table>
<h3 id="get-all-request">
Request
</h3>
<h4 id="example-http-request">
Example HTTP request
</h4>
<pre><code>GET /shards/stats/last?interval=1sec&stime=015-05-27T08:27:35Z
</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>
interval
</td>
<td>
string
</td>
<td>
Time interval for which we want stats: 1sec/10sec/5min/15min/1hour/12hour/1week. Default: 1sec (optional)
</td>
</tr>
<tr>
<td>
stime
</td>
<td>
ISO_8601
</td>
<td>
Start time from which we want the stats. Should comply with the
<a href="https://en.wikipedia.org/wiki/ISO_8601">
ISO_8601
</a>
format (optional)
</td>
</tr>
<tr>
<td>
etime
</td>
<td>
ISO_8601
</td>
<td>
End time after which we don't want the stats. Should comply with the
<a href="https://en.wikipedia.org/wiki/ISO_8601">
ISO_8601
</a>
format (optional)
</td>
</tr>
</tbody>
</table>
<h3 id="get-all-response">
Response
</h3>
<p>
Returns most recent
<a href="/docs/latest/operate/rs/7.4/references/rest-api/objects/statistics/">
statistics
</a>
for all shards.
</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">"interval"</span><span class="p">:</span> <span class="s2">"1sec"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"stime"</span><span class="p">:</span> <span class="s2">"2015-05-28T08:27:35Z"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"etime"</span><span class="p">:</span> <span class="s2">"2015-05-28T08:28:36Z"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"used_memory_peak"</span><span class="p">:</span> <span class="mf">5888264.0</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="mf">5888264.0</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"read_hits"</span><span class="p">:</span> <span class="mf">0.0</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"pubsub_patterns"</span><span class="p">:</span> <span class="mf">0.0</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"no_of_keys"</span><span class="p">:</span> <span class="mf">0.0</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"mem_size_lua"</span><span class="p">:</span> <span class="mf">35840.0</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"last_save_time"</span><span class="p">:</span> <span class="mf">1432541051.0</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"sync_partial_ok"</span><span class="p">:</span> <span class="mf">0.0</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="mf">9.0</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"avg_ttl"</span><span class="p">:</span> <span class="mf">0.0</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"write_misses"</span><span class="p">:</span> <span class="mf">0.0</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"used_memory"</span><span class="p">:</span> <span class="mf">5651440.0</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"sync_full"</span><span class="p">:</span> <span class="mf">0.0</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"expired_objects"</span><span class="p">:</span> <span class="mf">0.0</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"total_req"</span><span class="p">:</span> <span class="mf">0.0</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"blocked_clients"</span><span class="p">:</span> <span class="mf">0.0</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"pubsub_channels"</span><span class="p">:</span> <span class="mf">0.0</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"evicted_objects"</span><span class="p">:</span> <span class="mf">0.0</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"no_of_expires"</span><span class="p">:</span> <span class="mf">0.0</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"interval"</span><span class="p">:</span> <span class="s2">"1sec"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"write_hits"</span><span class="p">:</span> <span class="mf">0.0</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"read_misses"</span><span class="p">:</span> <span class="mf">0.0</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"sync_partial_err"</span><span class="p">:</span> <span class="mf">0.0</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"rdb_changes_since_last_save"</span><span class="p">:</span> <span class="mf">0.0</span>
</span></span><span class="line"><span class="cl"> <span class="p">},</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"2"</span><span class="p">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"interval"</span><span class="p">:</span> <span class="s2">"1sec"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"stime"</span><span class="p">:</span> <span class="s2">"2015-05-28T08:27:40Z"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"etime"</span><span class="p">:</span> <span class="s2">"2015-05-28T08:28:45Z"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"// additional fields..."</span>
</span></span><span class="line"><span class="cl"> <span class="p">}</span>
</span></span><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>
<tr>
<td>
<a href="https://www.rfc-editor.org/rfc/rfc9110.html#name-404-not-found">
404 Not Found
</a>
</td>
<td>
No shards exist
</td>
</tr>
</tbody>
</table>
<h2 id="get-shard-stats-last">
Get latest shard stats
</h2>
<pre><code>GET /v1/shards/stats/last/{int: uid}
</code></pre>
<p>
Get most recent statistics for a specific shard.
</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_shard_stats">
view_shard_stats
</a>
</td>
</tr>
</tbody>
</table>
<h3 id="get-request">
Request
</h3>
<h4 id="example-http-request-1">
Example HTTP request
</h4>
<pre><code>GET /shards/stats/last/1?interval=1sec&stime=2015-05-28T08:27:35Z
</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 shard requested.
</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>
interval
</td>
<td>
string
</td>
<td>
Time interval for which we want stats: 1sec/10sec/5min/15min/1hour/12hour/1week. Default: 1sec. (optional)
</td>
</tr>
<tr>
<td>
stime
</td>
<td>
ISO_8601
</td>
<td>
Start time from which we want the stats. Should comply with the
<a href="https://en.wikipedia.org/wiki/ISO_8601">
ISO_8601
</a>
format (optional)
</td>
</tr>
<tr>
<td>
etime
</td>
<td>
ISO_8601
</td>
<td>
End time after which we don't want the stats. Should comply with the
<a href="https://en.wikipedia.org/wiki/ISO_8601">
ISO_8601
</a>
format (optional)
</td>
</tr>
</tbody>
</table>
<h3 id="get-response">
Response
</h3>
<p>
Returns the most recent
<a href="/docs/latest/operate/rs/7.4/references/rest-api/objects/statistics/">
statistics
</a>
for the specified shard.
</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">"1"</span><span class="p">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"interval"</span><span class="p">:</span> <span class="s2">"1sec"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"stime"</span><span class="p">:</span> <span class="s2">"2015-05-28T08:27:35Z"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"etime"</span><span class="p">:</span> <span class="s2">"2015-05-28T08:27:36Z"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"used_memory_peak"</span><span class="p">:</span> <span class="mf">5888264.0</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="mf">5888264.0</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"read_hits"</span><span class="p">:</span> <span class="mf">0.0</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"pubsub_patterns"</span><span class="p">:</span> <span class="mf">0.0</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"no_of_keys"</span><span class="p">:</span> <span class="mf">0.0</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"mem_size_lua"</span><span class="p">:</span> <span class="mf">35840.0</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"last_save_time"</span><span class="p">:</span> <span class="mf">1432541051.0</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"sync_partial_ok"</span><span class="p">:</span> <span class="mf">0.0</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="mf">9.0</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"avg_ttl"</span><span class="p">:</span> <span class="mf">0.0</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"write_misses"</span><span class="p">:</span> <span class="mf">0.0</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"used_memory"</span><span class="p">:</span> <span class="mf">5651440.0</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"sync_full"</span><span class="p">:</span> <span class="mf">0.0</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"expired_objects"</span><span class="p">:</span> <span class="mf">0.0</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"total_req"</span><span class="p">:</span> <span class="mf">0.0</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"blocked_clients"</span><span class="p">:</span> <span class="mf">0.0</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"pubsub_channels"</span><span class="p">:</span> <span class="mf">0.0</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"evicted_objects"</span><span class="p">:</span> <span class="mf">0.0</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"no_of_expires"</span><span class="p">:</span> <span class="mf">0.0</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"interval"</span><span class="p">:</span> <span class="s2">"1sec"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"write_hits"</span><span class="p">:</span> <span class="mf">0.0</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"read_misses"</span><span class="p">:</span> <span class="mf">0.0</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"sync_partial_err"</span><span class="p">:</span> <span class="mf">0.0</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"rdb_changes_since_last_save"</span><span class="p">:</span> <span class="mf">0.0</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="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 does not exist
</td>
</tr>
<tr>
<td>
<a href="https://www.rfc-editor.org/rfc/rfc9110.html#name-406-not-acceptable">
406 Not Acceptable
</a>
</td>
<td>
Shard isn't currently active
</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/stats/last/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/commands/memory-doctor/.html | <section class="prose w-full py-12">
<h1 class="command-name">
MEMORY DOCTOR
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">MEMORY DOCTOR</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>
@slow
</code>
<span class="mr-1 last:hidden">
,
</span>
</dd>
</dl>
<p>
The
<code>
MEMORY DOCTOR
</code>
command reports about different memory-related issues that
the Redis server experiences, and advises about possible remedies.
</p>
<h2 id="resp2-reply">
RESP2 Reply
</h2>
<a href="../../develop/reference/protocol-spec#bulk-strings">
Bulk string reply
</a>
: a memory problems report.
<h2 id="resp3-reply">
RESP3 Reply
</h2>
<a href="../../develop/reference/protocol-spec#verbatim-strings">
Verbatim string reply
</a>
: a memory problems report.
<br/>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/memory-doctor/"/>
<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/networking/cluster-lba-setup/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Set up a Redis Enterprise cluster behind a load balancer
</h1>
<p class="text-lg -mt-5 mb-10">
Set up a Redis Enterprise cluster using a load balancer instead of DNS to direct traffic to cluster nodes.
</p>
<p>
To set up a Redis Enterprise cluster in an environment that doesn't allow DNS, you can use a load balancer (LB) to direct traffic to the cluster nodes.
</p>
<h2 id="dns-role-for-databases">
DNS role for databases
</h2>
<p>
Normally, Redis Enterprise uses DNS to provide dynamic database endpoints.
A DNS name such as
<code>
redis-12345.clustername.domain
</code>
gives clients access to the database resource:
</p>
<ul>
<li>
If multiple proxies are in use, the DNS name resolves to multiple IP addresses so clients can load balance.
</li>
<li>
On failover or topology changes, the DNS name is automatically updated to reflect the live IP addresses.
</li>
</ul>
<p>
When DNS cannot be used, clients can still connect to the endpoints with the IP addresses,
but the benefits of load balancing and automatic updates to IP addresses won't be available.
</p>
<h2 id="network-architecture-with-load-balancer">
Network architecture with load balancer
</h2>
<p>
You can compensate for the lack of DNS resolution with load balancers that can expose services and provide service discovery.
A load balancer is configured in front of the Redis Enterprise cluster, exposing several logical services:
</p>
<ul>
<li>
Control plane services, such as the Cluster Manager UI
</li>
<li>
Data plane services, such as database endpoints for client application connections
</li>
</ul>
<p>
Depending on which Redis Enterprise services you want to access outside the cluster, you may need to configure the load balancers separately.
One or more virtual IPs (VIPs) are defined on the load balancer to expose Redis Enterprise services.
The architecture is shown in the following diagram with a 3-node Redis Enterprise cluster with one database (DB1) configured on port 12000:
</p>
<a href="/docs/latest/images/rs/cluster-behind-load-balancer-top-down.png" sdata-lightbox="/images/rs/cluster-behind-load-balancer-top-down.png">
<img alt="cluster-behind-load-balancer-top-down" src="/docs/latest/images/rs/cluster-behind-load-balancer-top-down.png"/>
</a>
<h2 id="set-up-a-cluster-with-load-balancers">
Set up a cluster with load balancers
</h2>
<h3 id="prerequisites">
Prerequisites
</h3>
<ul>
<li>
<a href="/docs/latest/operate/rs/installing-upgrading/">
Install
</a>
the latest version of Redis Enterprise Software on your clusters
</li>
<li>
Configure the cluster with the cluster name (FQDN) even though DNS is not in use.
Remember that the same cluster name is used to issue the license keys.
We recommend that you use a β.localβ suffix in the FQDN.
</li>
</ul>
<h3 id="configure-load-balancers">
Configure load balancers
</h3>
<ul>
<li>
Make sure that the load balancer is performing TCP health checks on the cluster nodes.
</li>
<li>
Expose the services that you require through a virtual IP, for example:
<ul>
<li>
Cluster Manager UI on port 8443
</li>
<li>
Rest API on port 9443 for secure HTTPS connections and port 8080 for HTTP
</li>
<li>
Database ports 10000-19999
</li>
</ul>
</li>
</ul>
<p>
Other ports are shown in the list of
<a href="/docs/latest/operate/rs/networking/port-configurations/">
Redis Enterprise network ports
</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>
<p>
Sticky, secured connections are needed only for the Redis Enterprise Cluster Manager UI on port 8443.
</p>
<ul>
<li>
Certain load balancers provide specific logic to close idle connections. Either turn off this feature or make sure the applications connecting to Redis use reconnection logic.
</li>
<li>
Make sure the load balancer is fast enough to resolve connections between two clusters or applications that are connected to Redis databases through a load balancer.
</li>
<li>
Choose the standard load balancer that is commonly used in your environment so that you have easy access to in-house expertise for troubleshooting issues.
</li>
</ul>
</div>
</div>
<h3 id="configure-cluster">
Configure cluster
</h3>
<p>
For clusters behind load balancers, we recommend using the
<code>
all-nodes
</code>
<a href="/docs/latest/operate/rs/databases/configure/proxy-policy/">
proxy policy
</a>
and enabling
<code>
handle_redirects
</code>
.
</p>
<p>
To allow inbound connections to be terminated on the relevant node inside the cluster, run the following
<code>
rladmin
</code>
commands on the cluster:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl"><span class="c1"># Enable all-nodes proxy policy by default</span>
</span></span><span class="line"><span class="cl">rladmin tune cluster default_sharded_proxy_policy all-nodes default_non_sharded_proxy_policy all-nodes
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Redirect where necessary when behind a load balancer</span>
</span></span><span class="line"><span class="cl">rladmin cluster config handle_redirects enabled
</span></span></code></pre>
</div>
<p>
Optionally configure sparse shard placement to allow closer termination of client connections to where the Redis shard is located:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl"><span class="c1"># Enable sparse placement by default</span>
</span></span><span class="line"><span class="cl">rladmin tune cluster default_shards_placement sparse
</span></span></code></pre>
</div>
<h3 id="configure-database">
Configure database
</h3>
<p>
After you update the cluster settings and configure the load balancers, you can go to the Redis Enterprise Cluster Manager UI at
<code>
https://load-balancer-virtual-ip:8443/
</code>
and
<a href="/docs/latest/operate/rs/databases/create/">
create a new database
</a>
.
</p>
<p>
To create an Active-Active database, use the
<code>
crdb-cli
</code>
utility. See the
<a href="/docs/latest/operate/rs/references/cli-utilities/crdb-cli/">
<code>
crdb-cli
</code>
reference
</a>
for more information about creating Active-Active databases from the command line.
</p>
<h3 id="update-load-balancer-configuration-when-cluster-configuration-changes">
Update load balancer configuration when cluster configuration changes
</h3>
<p>
When your Redis Enterprise cluster is behind a load balancer, you must update the load balancer when the cluster topology and IP addresses change.
Some common cases that require you to update the load balancer are:
</p>
<ul>
<li>
Adding new nodes to the Redis Enterprise cluster
</li>
<li>
Removing nodes from the Redis Enterprise cluster
</li>
<li>
Maintenance for Redis Enterprise cluster nodes
</li>
<li>
IP address changes for Redis Enterprise cluster nodes
</li>
</ul>
<p>
After these changes, make sure that the Redis connections in your applications can connect to the Redis database,
especially if they are directly connected on IP addresses that have changed.
</p>
<h2 id="intercluster-communication-considerations">
Intercluster communication considerations
</h2>
<p>
Redis Enterprise supports several topologies that allow intercluster replication, such as
<a href="/docs/latest/operate/rs/databases/import-export/replica-of/">
Replica Of
</a>
and
<a href="/docs/latest/operate/rs/databases/active-active/">
Active-Active
</a>
deployment options.
When your Redis Enterprise software clusters are behind load balancers, you must allow some network services to be open and defined in the load balancers to allow the replication to work.
</p>
<h3 id="replica-of">
Replica Of
</h3>
<p>
For Replica Of communication to work, you must expose database ports locally in each cluster and allow these ports through any firewalls between the clusters.
</p>
<h3 id="active-active">
Active-Active
</h3>
<p>
For Active-Active communication to work, you must expose several ports, including every database port and several control plane ports as defined in
<a href="/docs/latest/operate/rs/networking/port-configurations/">
Network port configurations
</a>
. Pay attention to services that include "Active-Active" in the connection source column, and allow these ports through any firewalls between the clusters.
</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/networking/cluster-lba-setup/"/>
<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/bdb/backup_location/.html | <section class="prose w-full py-12 max-w-none">
<h1>
BDB backup/export location object
</h1>
<p class="text-lg -mt-5 mb-10">
Documents the bdb backup_location/export_location object used with Redis Enterprise Software REST API calls.
</p>
<p>
You can back up or export a database's dataset to the following types of locations:
</p>
<ul>
<li>
FTP/S
</li>
<li>
SFTP
</li>
<li>
Amazon S3
</li>
<li>
Google Cloud Storage
</li>
<li>
Microsoft Azure Storage
</li>
<li>
NAS/Local Storage
</li>
</ul>
<h2 id="basic-parameters">
Basic parameters
</h2>
<p>
For all backup/export location objects, you need to specify the location type via the
<code>
type
</code>
field.
</p>
<table>
<thead>
<tr>
<th>
Location type
</th>
<th>
"type" value
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
FTP/S
</td>
<td>
"url"
</td>
</tr>
<tr>
<td>
SFTP
</td>
<td>
"sftp"
</td>
</tr>
<tr>
<td>
Amazon S3
</td>
<td>
"s3"
</td>
</tr>
<tr>
<td>
Google Cloud Storage
</td>
<td>
"gs"
</td>
</tr>
<tr>
<td>
Microsoft Azure Storage
</td>
<td>
"abs"
</td>
</tr>
<tr>
<td>
NAS/Local Storage
</td>
<td>
"mount_point"
</td>
</tr>
</tbody>
</table>
<h2 id="location-specific-parameters">
Location-specific parameters
</h2>
<p>
Any additional required parameters may differ based on the backup/export location type.
</p>
<h3 id="ftp">
FTP
</h3>
<table>
<thead>
<tr>
<th>
Key name
</th>
<th>
Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
url
</td>
<td>
string
</td>
<td>
A URI that represents a FTP/S location with the following format:
<code>
ftp://user:password@host:port/path/
</code>
. The user and password can be omitted if not needed.
</td>
</tr>
</tbody>
</table>
<h3 id="sftp">
SFTP
</h3>
<table>
<thead>
<tr>
<th>
Key name
</th>
<th>
Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
key
</td>
<td>
string
</td>
<td>
SSH private key to secure the SFTP server connection. If you do not specify an SSH private key, the autogenerated private key of the cluster is used, and you must add the SSH public key of the cluster to the SFTP server configuration. (optional)
</td>
</tr>
<tr>
<td>
sftp_url
</td>
<td>
string
</td>
<td>
SFTP URL in the format:
<code>
sftp://user:password@host[:port][/path/]
</code>
. The default port number is 22 and the default path is '/'.
</td>
</tr>
</tbody>
</table>
<h3 id="aws-s3">
AWS S3
</h3>
<table>
<thead>
<tr>
<th>
Key name
</th>
<th>
Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
access_key_id
</td>
<td>
string
</td>
<td>
The AWS Access Key ID with access to the bucket
</td>
</tr>
<tr>
<td>
bucket_name
</td>
<td>
string
</td>
<td>
S3 bucket name
</td>
</tr>
<tr>
<td>
region_name
</td>
<td>
string
</td>
<td>
Amazon S3 region name (optional)
</td>
</tr>
<tr>
<td>
secret_access_key
</td>
<td>
string
</td>
<td>
The AWS Secret Access Key that matches the Access Key ID
</td>
</tr>
<tr>
<td>
subdir
</td>
<td>
string
</td>
<td>
Path to the backup directory in the S3 bucket (optional)
</td>
</tr>
</tbody>
</table>
<h3 id="google-cloud-storage">
Google Cloud Storage
</h3>
<table>
<thead>
<tr>
<th>
Key name
</th>
<th>
Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
bucket_name
</td>
<td>
string
</td>
<td>
Cloud Storage bucket name
</td>
</tr>
<tr>
<td>
client_email
</td>
<td>
string
</td>
<td>
Email address for the Cloud Storage client ID
</td>
</tr>
<tr>
<td>
client_id
</td>
<td>
string
</td>
<td>
Cloud Storage client ID with access to the Cloud Storage bucket
</td>
</tr>
<tr>
<td>
private_key
</td>
<td>
string
</td>
<td>
Cloud Storage private key that matches the private key ID
</td>
</tr>
<tr>
<td>
private_key_id
</td>
<td>
string
</td>
<td>
Cloud Storage private key ID with access to the Cloud Storage bucket
</td>
</tr>
<tr>
<td>
subdir
</td>
<td>
string
</td>
<td>
Path to the backup directory in the Cloud Storage bucket (optional)
</td>
</tr>
</tbody>
</table>
<h3 id="azure-blob-storage">
Azure Blob Storage
</h3>
<table>
<thead>
<tr>
<th>
Key name
</th>
<th>
Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
account_key
</td>
<td>
string
</td>
<td>
Access key for the storage account
</td>
</tr>
<tr>
<td>
account_name
</td>
<td>
string
</td>
<td>
Storage account name with access to the container
</td>
</tr>
<tr>
<td>
container
</td>
<td>
string
</td>
<td>
Blob Storage container name
</td>
</tr>
<tr>
<td>
sas_token
</td>
<td>
string
</td>
<td>
Token to authenticate with shared access signature
</td>
</tr>
<tr>
<td>
subdir
</td>
<td>
string
</td>
<td>
Path to the backup directory in the Blob Storage container (optional)
</td>
</tr>
</tbody>
</table>
<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>
<code>
account_key
</code>
and
<code>
sas_token
</code>
are mutually exclusive
</div>
</div>
<h3 id="naslocal-storage">
NAS/Local Storage
</h3>
<table>
<thead>
<tr>
<th>
Key name
</th>
<th>
Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
path
</td>
<td>
string
</td>
<td>
Path to the local mount point. You must create the mount point on all nodes, and the
<code>
redislabs:redislabs
</code>
user must have read and write permissions on the local mount point.
</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/bdb/backup_location/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rc/databases/flush-data/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Flush data
</h1>
<p>
The
<a href="/docs/latest/commands/flushall/">
FLUSHALL
</a>
command provides a fast way to remove all data from a 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>
<p>
When you
<em>
flush
</em>
a database, you remove all data.
<br/>
<br/>
</p>
<p>
This
<em>
permanently
</em>
removes all data from the database. The data cannot be recovered, except by restoring from earlier backups.
<br/>
<br/>
</p>
<p>
We
<em>
strongly
</em>
recommend backing up databases before flushing them.
</p>
</div>
</div>
<h2 id="how-to-use-flushall">
How to use FLUSHALL
</h2>
<p>
To use it, connect your database and then issue the command.
</p>
<p>
There are several ways to do this, depending on your circumstances and environment.
</p>
<p>
The following sections provide some options:
</p>
<ul>
<li>
<a href="#redis-cli">
<code>
redis-cli
</code>
</a>
</li>
<li>
<a href="#redisinsight">
Redis Insight CLI
</a>
</li>
<li>
<a href="#sasl-connection">
SASL connection
</a>
</li>
</ul>
<h3 id="redis-cli">
redis-cli
</h3>
<p>
To use the
<code>
redis-cli
</code>
utility:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">redis-cli -h <hostname> -p <portnumber> -a <password> flushall
</span></span></code></pre>
</div>
<p>
Example:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">redis-cli -h redis-12345.server.cloud.redislabs.example.com -p <span class="m">12345</span> -a xyz flushall
</span></span></code></pre>
</div>
<h3 id="redis-insight">
Redis Insight
</h3>
<p>
If you install
<a href="/docs/latest/develop/tools/insight/">
Redis Insight
</a>
and
<a href="/docs/latest/operate/rc/rc-quickstart/#using-redisinsight">
add your database
</a>
, you can use the Redis Insight workbench to run commands:
</p>
<ol>
<li>
<p>
Start Redis Insight and connect to your database.
</p>
</li>
<li>
<p>
From the Redis Insight menu, select
<strong>
Workbench
</strong>
and wait for the client to connect to your database.
</p>
</li>
<li>
<p>
In the command area, enter
<code>
flushall
</code>
and then select the green
<strong>
run
</strong>
arrow.
</p>
<a href="/docs/latest/images/rc/redisinsight-cli-flushall-example.png" sdata-lightbox="/images/rc/redisinsight-cli-flushall-example.png">
<img alt="You can use Redis Insight to issue commands to a database." src="/docs/latest/images/rc/redisinsight-cli-flushall-example.png"/>
</a>
<p>
The 'OK' response indicates that the command executed properly.
</p>
</li>
</ol>
<!--
### netcat
If you have shell access to your database's host server, you can use [netcat](https://en.wikipedia.org/wiki/Netcat) (`nc`) to send the `flush_all` command to your database:
```sh
echo "flush_all" | nc redis-12345.server.cloud.redislabs.example.com 12345
```
-->
<h3 id="sasl-connection">
SASL connection
</h3>
<p>
If you do not have permission to access the command shell of the server hosting your database or are unable to use Redis Insight, but you have connection credentials and your database supports
<a href="https://en.wikipedia.org/wiki/Simple_Authentication_and_Security_Layer">
Simple Authentication and Security Layer
</a>
connections, you can use an SASL-enabled command-line client.
</p>
<p>
For example, suppose you're using Memcached Enterprise Cloud and that your database has SASL enabled. In this case, you can can use the
<a href="https://github.com/RedisLabs/bmemcached-cli">
bmemcached-CLI
</a>
client to connect and issue commands to your database.
</p>
<p>
Setup instructions vary according to the environment. Many Linux systems, such as Ubuntu, follow this process:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ wget https://github.com/RedisLabs/bmemcached-cli/archive/master.zip
</span></span><span class="line"><span class="cl">$ sudo apt-get install unzip python-pip
</span></span><span class="line"><span class="cl">$ unzip master.zip -d bmemcached-cli
</span></span><span class="line"><span class="cl">$ <span class="nb">cd</span> bmemcached-cli/bmemcached-cli-master/
</span></span><span class="line"><span class="cl">$ sudo pip install --upgrade pip
</span></span><span class="line"><span class="cl">$ sudo pip install . -r requirements.pip
</span></span></code></pre>
</div>
<p>
Adjust as needed for your operating system and configuration.
</p>
<p>
When the client is properly installed, you can use it to run the
<code>
flush_all
</code>
command:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">bmemcached-cli <span class="o">[</span>user<span class="o">]</span>:<span class="o">[</span>password<span class="o">]</span>@<span class="o">[</span>host<span class="o">]</span>:<span class="o">[</span>port<span class="o">]</span>
</span></span></code></pre>
</div>
<p>
Here's an example:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ bmemcached-cli username:[email protected]:12345
</span></span><span class="line"><span class="cl"><span class="o">([</span>B<span class="o">]</span>memcached<span class="o">)</span> flush_all
</span></span><span class="line"><span class="cl">True
</span></span><span class="line"><span class="cl"><span class="nb">exit</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/rc/databases/flush-data/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/commands/lastsave/.html | <section class="prose w-full py-12">
<h1 class="command-name">
LASTSAVE
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">LASTSAVE</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>
@admin
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@fast
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@dangerous
</code>
<span class="mr-1 last:hidden">
,
</span>
</dd>
</dl>
<p>
Return the UNIX TIME of the last DB save executed with success.
A client may check if a
<a href="/docs/latest/commands/bgsave/">
<code>
BGSAVE
</code>
</a>
command succeeded reading the
<code>
LASTSAVE
</code>
value,
then issuing a
<a href="/docs/latest/commands/bgsave/">
<code>
BGSAVE
</code>
</a>
command and checking at regular intervals every N
seconds if
<code>
LASTSAVE
</code>
changed. Redis considers the database saved successfully at startup.
</p>
<h2 id="resp2resp3-reply">
RESP2/RESP3 Reply
</h2>
<a href="../../develop/reference/protocol-spec#integers">
Integer reply
</a>
: UNIX TIME of the last DB save executed with success.
<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/lastsave/"/>
<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/previous-releases/k8s-6-0-20-12/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Redis Enterprise for Kubernetes Release Notes 6.0.20-12 (July 2021)
</h1>
<p class="text-lg -mt-5 mb-10">
Support for RS 6.0.20-97, EKS, Hashicorp Vault, and added feature support for OpenShift OLM.
</p>
<h2 id="overview">
Overview
</h2>
<p>
The Redis Enterprise
<a href="https://github.com/RedisLabs/redis-enterprise-k8s-docs/releases/tag/v6.0.20-12">
K8s 6.0.20-12
</a>
release is a
<em>
major release
</em>
on top of
<a href="https://github.com/RedisLabs/redis-enterprise-k8s-docs/releases/tag/v6.0.20-4">
6.0.20-4
</a>
providing support for the
<a href="https://docs.redislabs.com/latest/rs/release-notes/rs-6-0-20-april-2021/">
Redis Enterprise Software release 6.0.20-97
</a>
and includes several enhancements and bug fixes.
</p>
<p>
This release of the operator provides:
</p>
<ul>
<li>
New features
</li>
<li>
Various bug fixes
</li>
</ul>
<h2 id="images">
Images
</h2>
<p>
This release includes the following container images:
</p>
<ul>
<li>
<strong>
Redis Enterprise
</strong>
:
<code>
redislabs/redis:6.0.20-97
</code>
or redislabs/redis:6.0.20-97.rhel7-openshift`
</li>
<li>
<strong>
Operator and Bootstrapper
</strong>
:
<code>
redislabs/operator:6.0.20-12
</code>
</li>
<li>
<strong>
Services Rigger
</strong>
:
<code>
redislabs/k8s-controller:6.0.20-12
</code>
or
<code>
redislabs/services-manager:6.0.20-12
</code>
(on the Red Hat registry)
</li>
</ul>
<h2 id="new-features">
New features
</h2>
<ul>
<li>
EKS support
</li>
<li>
Feature parity for Openshift OLM; added support for:
<ul>
<li>
REDB
</li>
<li>
admission
</li>
<li>
Hashicorp Vault integration
</li>
</ul>
</li>
<li>
Hashicorp Vault integration is now GA
</li>
<li>
Moved Operator environment variables to configmap
</li>
</ul>
<h2 id="important-fixes">
Important fixes
</h2>
<ul>
<li>
Admission controller deployment combined with operator deployment to simplify deployment (RED-52701)
</li>
<li>
Additional verbosity in the
<code>
kubectl get redb
</code>
command output (RED-55042)
</li>
<li>
Support for Redis Enterprise license storage within secrets; Vault and K8s secrets (RED-55587)
</li>
<li>
Support for manual procedure to replace the REC credentials (RED-56529, RED-56530)
</li>
<li>
Fixed cluster recovery issue - recovery process was not starting (RED-55500)
</li>
<li>
When a pod status is CrashLoopBackOff and we run the cluster recovery, the process will not complete (RED-33713)
</li>
<li>
Master pod is not always labeled in Rancher (fixed in 6.0.8 but was not documented) (RED-42896)
</li>
</ul>
<h2 id="known-limitations">
Known limitations
</h2>
<h3 id="hashicorp-vault-integration---no-support-for-gesher-red-55080">
Hashicorp Vault integration - no support for Gesher (RED-55080)
</h3>
<p>
There is no workaround at this time
</p>
<h3 id="nodes-down-indefinitely-after-the-redis-enterprise-node-container-of-a-rec-pod-is-restarted-53042">
Nodes down indefinitely after the redis-enterprise-node container of a REC pod is restarted (53042)
</h3>
<p>
In some cases where the Redis Enterprise Cluster container in the Redis Enterprise Cluster(REC) pod is restarted, the REC node remains down. Workaround: restart the pod, while ensuring the majority of REC nodes are available.
</p>
<h3 id="crashloopbackoff-causes-cluster-recovery-to-be-incomplete--red33713">
CrashLoopBackOff causes cluster recovery to be incomplete (RED33713)
</h3>
<p>
When a pod's status is
<code>
CrashLoopBackOff
</code>
and we run the cluster recovery, the process will not complete. The workaround is to delete the crashing pods manually. The recovery process will then continue.
</p>
<h3 id="long-cluster-names-cause-routes-to-be-rejected--red25871">
Long cluster names cause routes to be rejected (RED25871)
</h3>
<p>
A cluster name longer than 20 characters will result in a rejected route configuration because the host part of the domain name will exceed 63 characters. The workaround is to limit cluster name to 20 characters or fewer.
</p>
<h3 id="cluster-cr-rec-errors-are-not-reported-after-invalid-updates-red25542">
Cluster CR (REC) errors are not reported after invalid updates (RED25542)
</h3>
<p>
A cluster CR specification error is not reported if two or more invalid CR resources are updated in sequence.
</p>
<h3 id="an-unreachable-cluster-has-status-running-red32805">
An unreachable cluster has status running (RED32805)
</h3>
<p>
When a cluster is in an unreachable state, the state is still
<code>
running
</code>
instead of being reported as an error.
</p>
<h3 id="readiness-probe-incorrect-on-failures-red39300">
Readiness probe incorrect on failures (RED39300)
</h3>
<p>
STS Readiness probe does not mark a node as "not ready" when running
<code>
rladmin status
</code>
on the node fails.
</p>
<h3 id="role-missing-on-replica-sets-red39002">
Role missing on replica sets (RED39002)
</h3>
<p>
The
<code>
redis-enterprise-operator
</code>
role is missing permission on replica sets.
</p>
<h3 id="private-registries-are-not-supported-on-openshift-311-red38579">
Private registries are not supported on OpenShift 3.11 (RED38579)
</h3>
<p>
Openshift 3.11 does not support DockerHub private registries. This is a known OpenShift issue.
</p>
<h3 id="internal-dns-and-kubernetes-dns-may-have-conflicts-red37462">
Internal DNS and Kubernetes DNS may have conflicts (RED37462)
</h3>
<p>
DNS conflicts are possible between the cluster mdns_server and the K8s DNS. This only impacts DNS resolution from within cluster nodes for Kubernetes DNS names.
</p>
<h3 id="5410-negatively-impacts-546-red37233">
5.4.10 negatively impacts 5.4.6 (RED37233)
</h3>
<p>
Kubernetes-based 5.4.10 deployments seem to negatively impact existing 5.4.6 deployments that share a Kubernetes cluster.
</p>
<h3 id="node-cpu-usage-is-reported-instead-of-pod-cpu-usage-red36884">
Node CPU usage is reported instead of pod CPU usage (RED36884)
</h3>
<p>
In Kubernetes, the node CPU usage we report on is the usage of the Kubernetes worker node hosting the REC pod.
</p>
<h3 id="clusters-must-be-named-rec-in-olm-based-deployments-red39825">
Clusters must be named "rec" in OLM-based deployments (RED39825)
</h3>
<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) is bound to a specific service account name (i.e., "rec"). The workaround is to name the cluster "rec".
</p>
<h3 id="master-pod-label-in-rancher-red42896">
Master pod label in Rancher (RED42896)
</h3>
<p>
The master pod is not always labeled in Rancher.
</p>
<h3 id="rec-clusters-fail-to-start-on-kubernetes-clusters-with-unsynchronized-clocks-red47254">
REC clusters fail to start on Kubernetes clusters with unsynchronized clocks (RED47254)
</h3>
<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>
<h3 id="deleting-an-openshift-project-with-an-rec-deployed-may-hang-red47192">
Deleting an OpenShift project with an REC deployed may hang (RED47192)
</h3>
<p>
When a 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. As such, until the
REDB resources are deleted, the project deletion will hang. The fix is to delete the
REDB resources first and the REC second. Afterwards, you may delete the project.
</p>
<h3 id="rec-extralabels-are-not-applied-to-pvcs-on-k8s-versions-115-or-older-red51921">
REC extraLabels are not applied to PVCs on K8s versions 1.15 or older (RED51921)
</h3>
<p>
In K8s 1.15 or older, the PVC labels come from the match selectors and not the
PVC templates. As such, these versions can not support PVC labels. If this feature
is required, the only fix is to upgrade the K8s cluster to a newer version.
</p>
<h2 id="compatibility-notes">
Compatibility Notes
</h2>
<ul>
<li>
EKS is now supported (K8s 1.18)
</li>
<li>
OpenShift 4.4 (previously deprecated) is no longer supported
</li>
<li>
GKE K8s versions 1.15, 1.16 (previously deprecated) is no longer supported
</li>
<li>
VMWare TKGI 1.10 (K8s 1.19) is now supported
</li>
</ul>
<h2 id="deprecation-notice">
Deprecation notice
</h2>
<ul>
<li>
GKE K8s version 1.17 (no longer supported by Google) is deprecated
</li>
<li>
kOps 1.15 is deprecated
</li>
<li>
VMWare TKGI 1.7 (K8s 1.16), VMWare TKGI 1.8 (K8s 1.17) are deprecated (no longer supported by VMWare)
</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/previous-releases/k8s-6-0-20-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/rc/security/access-control/access-management/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Access management
</h1>
<p class="text-lg -mt-5 mb-10">
Control who can make changes to your databases using the Redis Cloud console.
</p>
<p>
The
<strong>
Access management
</strong>
screen helps you manage:
</p>
<ul>
<li>
The team of users allowed to access your subscription and its databases.
</li>
<li>
The API keys that authenticate application access to your account.
</li>
<li>
<a href="/docs/latest/operate/rc/security/access-control/saml-sso/">
Single sign-on (SSO) with SAML
</a>
.
</li>
</ul>
<p>
Here, you learn how to manage your team's users and control their level of access.
</p>
<p>
For help managing API keys, see
<a href="/docs/latest/operate/rc/api/get-started/manage-api-keys/">
Manage API keys
</a>
.
</p>
<h2 id="manage-team-access">
Manage team access
</h2>
<p>
The
<strong>
Team
</strong>
tab lets you manage the people allowed to access your account. Each authorized person is assigned to a role that specifies their privileges.
</p>
<a href="/docs/latest/images/rc/access-management-team-tab.png" sdata-lightbox="/images/rc/access-management-team-tab.png">
<img alt="The Access management tab helps you manage the people allowed to access your subscription." src="/docs/latest/images/rc/access-management-team-tab.png"/>
</a>
<p>
The list contains one entry summarizing the team settings for each user in your team. By default, the list includes the account owner.
</p>
<p>
The list includes several buttons and icons to help you manage the list:
</p>
<table>
<thead>
<tr>
<th>
Icon
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="/docs/latest/images/rc/button-access-management-add.png#no-click" sdata-lightbox="/images/rc/button-access-management-add.png#no-click">
<img alt="Use the Add button to add members to your team." class="inline" src="/docs/latest/images/rc/button-access-management-add.png#no-click" width="30px"/>
</a>
</td>
<td>
The
<strong>
Add
</strong>
button lets you add members to your team
</td>
</tr>
<tr>
<td>
<a href="/docs/latest/images/rc/icon-access-management-edit-user.png#no-click" sdata-lightbox="/images/rc/icon-access-management-edit-user.png#no-click">
<img alt="Use the Edit button change details for a team member." class="inline" src="/docs/latest/images/rc/icon-access-management-edit-user.png#no-click" width="30px"/>
</a>
</td>
<td>
The
<strong>
Edit
</strong>
button lets you edit the settings for the selected team member
</td>
</tr>
<tr>
<td>
<a href="/docs/latest/images/rc/icon-access-management-delete-user.png#no-click" sdata-lightbox="/images/rc/icon-access-management-delete-user.png#no-click">
<img alt="Use the Delete button to remove a member from your team." class="inline" src="/docs/latest/images/rc/icon-access-management-delete-user.png#no-click" width="30px"/>
</a>
</td>
<td>
The
<strong>
Delete
</strong>
button lets you remove members from your team
</td>
</tr>
<tr>
<td>
<a href="/docs/latest/images/rc/icon-list-filter.png#no-click" sdata-lightbox="/images/rc/icon-list-filter.png#no-click">
<img alt="Use the Filter button to display team members that match specified conditions." class="inline" src="/docs/latest/images/rc/icon-list-filter.png#no-click" width="30px"/>
</a>
</td>
<td>
<strong>
Filter
</strong>
icons let you display team members matching conditions you specify
</td>
</tr>
<tr>
<td>
<nobr>
<a href="/docs/latest/images/rc/icon-list-sort-asc.png#no-click" sdata-lightbox="/images/rc/icon-list-sort-asc.png#no-click">
<img alt="The Sort ascending button displays members in ascending order according to the values of the selected field." class="inline" src="/docs/latest/images/rc/icon-list-sort-asc.png#no-click" width="30px"/>
</a>
<a href="/docs/latest/images/rc/icon-list-sort-desc.png#no-click" sdata-lightbox="/images/rc/icon-list-sort-desc.png#no-click">
<img alt="The Sort descending button displays members in descending order according to the values of the selected field." class="inline" src="/docs/latest/images/rc/icon-list-sort-desc.png#no-click" width="30px"/>
</a>
</nobr>
</td>
<td>
The
<strong>
Sort ascending
</strong>
and
<strong>
Sort descending
</strong>
icons display the list according to the selected order
</td>
</tr>
</tbody>
</table>
<p>
If you have a large team, you can use the controls in the list footer to navigate quickly through the list. These controls are deactivated for small teams.
</p>
<h3 id="add-user">
Add user
</h3>
<p>
When you add a member to your team, the
<strong>
Add user
</strong>
dialog appears.
</p>
<a href="/docs/latest/images/rc/access-mgmt-add-user-dialog.png" sdata-lightbox="/images/rc/access-mgmt-add-user-dialog.png">
<img alt="Use the Add User dialog to specify the details for your new user." src="/docs/latest/images/rc/access-mgmt-add-user-dialog.png" width="50%"/>
</a>
<p>
Use the dialog to specify these values.
</p>
<table>
<thead>
<tr>
<th>
Setting
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<strong>
First name
</strong>
</td>
<td>
First name of the user displayed in the Redis Cloud console and in email messages
</td>
</tr>
<tr>
<td>
<strong>
Last name
</strong>
</td>
<td>
Last name of the user displayed in the Redis Cloud console and in email messages
</td>
</tr>
<tr>
<td>
<strong>
Role
</strong>
</td>
<td>
The role identifies their subscription and account privileges. For details, see
<a href="#team-management-roles">
Team management roles
</a>
.
</td>
</tr>
<tr>
<td>
<strong>
Email
</strong>
</td>
<td>
The address used for alerts and other email messages regarding the account
</td>
</tr>
<tr>
<td>
<strong>
Alert emails
</strong>
</td>
<td>
Enable to be notified when subscription databases cross certain thresholds, such as exceeding memory limits or latency requirements
</td>
</tr>
<tr>
<td>
<strong>
Operational emails
</strong>
</td>
<td>
Notifications about subscription and database changes, such as creating or deleting a database, and
<a href="/docs/latest/operate/rc/subscriptions/maintenance/">
subscription and database maintenance
</a>
</td>
</tr>
<tr>
<td>
<strong>
Billing emails
</strong>
</td>
<td>
Notifications about billing, such as when bills are issued and paid
</td>
</tr>
<tr>
<td>
<strong>
Multi-factor authentication
</strong>
</td>
<td>
Whether MFA is enabled for the member. This is deactivated when members have not enabled or confirmed MFA in their user profile settings.
</td>
</tr>
</tbody>
</table>
<p>
Use the
<strong>
Add user
</strong>
button to save your new team member details.
</p>
<p>
Redis will send an activation email to the user once their details are saved. After following the activation link, they can sign in.
</p>
<h3 id="edit-user">
Edit user
</h3>
<p>
To edit user team details, select the user from the list and then select the
<strong>
Edit
</strong>
button.
The
<strong>
Edit user
</strong>
dialog displays the details you can change.
</p>
<a href="/docs/latest/images/rc/access-mgmt-edit-user-dialog.png" sdata-lightbox="/images/rc/access-mgmt-edit-user-dialog.png">
<img alt="Use the Edit User dialog to change the details for a user" src="/docs/latest/images/rc/access-mgmt-edit-user-dialog.png" width="50%"/>
</a>
<p>
You can change any detail except the team member's email address.
</p>
<p>
Select
<strong>
Save user
</strong>
to save your changes.
</p>
<h3 id="delete-user">
Delete user
</h3>
<p>
To remove a member from your team, select them from the list and then select the
<strong>
Delete
</strong>
button. A confirmation dialog appears.
</p>
<a href="/docs/latest/images/rc/access-management-delete-user-dialog.png" sdata-lightbox="/images/rc/access-management-delete-user-dialog.png">
<img alt="Confirm that you want to remove a user from your team" src="/docs/latest/images/rc/access-management-delete-user-dialog.png" width="50%"/>
</a>
<p>
Select
<strong>
Delete user
</strong>
to confirm removal. This is a permanent action that cannot be undone.
</p>
<h2 id="team-management-roles">
Team management roles
</h2>
<p>
Each team member is assigned a role that identifies their privileges and limits their activities in the Redis Cloud console.
</p>
<p>
Roles and responsibilities are:
</p>
<ul>
<li>
<p>
<strong>
Owner
</strong>
can view, create, and edit any settings in the account.
</p>
<p>
Each subscription must have at least one account owner. Accounts can have multiple owners.
</p>
<p>
Owners can also manage subscriptions, databases, and API keys.
</p>
</li>
<li>
<p>
<strong>
Billing Admin
</strong>
can view and edit settings related to billing and payments.
</p>
<p>
Billing Admins can add and remove payment methods and change the payment method for a subscription, but they cannot change any other subscription or database settings.
</p>
</li>
<li>
<p>
<strong>
Manager
</strong>
can view, create, and edit any setting in the subscription.
</p>
<p>
Managers can change subscription costs and change payment methods associated with a subscription, but they cannot add or remove available payment methods.
</p>
</li>
<li>
<p>
<strong>
Member
</strong>
can view, create, and edit databases in ways that do not impact costs.
</p>
<p>
Members cannot create databases or edit databases in ways that impact costs.
</p>
</li>
<li>
<p>
<strong>
Viewer
</strong>
can view all databases and their configurations, including database secrets.
</p>
</li>
</ul>
<p>
This table shows each role's ability to perform common tasks using the Redis Cloud console.
</p>
<table>
<thead>
<tr>
<th>
<strong>
Task
</strong>
</th>
<th>
<strong>
Owner
</strong>
</th>
<th>
<strong>
Billing Admin
</strong>
</th>
<th>
<strong>
Manager
</strong>
</th>
<th>
<strong>
Member
</strong>
</th>
<th>
<strong>
Viewer
</strong>
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
Access management
</td>
<td>
<span title="Owners can manage account access">
β
Yes
</span>
</td>
<td>
<span title="Billing Admins may not manage account access">
β No
</span>
</td>
<td>
<span title="Managers may not manage account access">
β No
</span>
</td>
<td>
<span title="Members may not manage account access">
β No
</span>
</td>
<td>
<span title="Viewers may not manage account access">
β No
</span>
</td>
</tr>
<tr>
<td>
Account settings
</td>
<td>
<span title="Owners can change account settings">
β
Yes
</span>
</td>
<td>
<span title="Billing Admins can change the billing address in account settings">
β
Yes
<sup>
<a href="#table-note-1">
1
</a>
</sup>
</span>
</td>
<td>
<span title="Managers may not manage account settings">
β No
</span>
</td>
<td>
<span title="Members may not manage account settings">
β No
</span>
</td>
<td>
<span title="Viewers may not manage account settings">
β No
</span>
</td>
</tr>
<tr>
<td>
Billing & payments
</td>
<td>
<span title="Owners can add/remove payment methods and view history">
β
Yes
</span>
</td>
<td>
<span title="Billing Admins can add/remove payment methods and view history">
β
Yes
</span>
</td>
<td>
<span title="Managers may not add/remove payment methods or view billing history (Managers may change subscription payment methods between those available to the account)">
β No
</span>
</td>
<td>
<span title="Members may not add/remove payment methods or view billing history">
β No
</span>
</td>
<td>
<span title="Viewers may not add/remove payment methods or view billing history">
β No
</span>
</td>
</tr>
<tr>
<td>
Create subscription
</td>
<td>
<span title="Owners can create new subscriptions">
β
Yes
</span>
</td>
<td>
<span title="Billing Admins may not create subscriptions">
β No
</span>
</td>
<td>
<span title="Managers can create new subscriptions">
β
Yes
</span>
</td>
<td>
<span title="Members may not create subscriptions">
β No
</span>
</td>
<td>
<span title="Viewers may not create subscriptions">
β No
</span>
</td>
</tr>
<tr>
<td>
Edit subscription
</td>
<td>
<span title="Owners can edit subscriptions">
β
Yes
</span>
</td>
<td>
<span title="Billing Admins can edit subscriptions to change the payment method">
β
Yes
<sup>
<a href="#table-note-2">
2
</a>
</sup>
</span>
</td>
<td>
<span title="Managers can edit subscriptions">
β
Yes
</span>
</td>
<td>
<span title="Members may not edit subscriptions">
β No
</span>
</td>
<td>
<span title="Viewers may not edit subscriptions">
β No
</span>
</td>
</tr>
<tr>
<td>
Create database (affects cost)
</td>
<td>
<span title="Owners can create databases when doing so will impact costs">
β
Yes
</span>
</td>
<td>
<span title="Billing Admins may not create databases when doing so will impact costs">
β No
</span>
</td>
<td>
<span title="Managers can create databases when doing so will impact costs">
β
Yes
</span>
</td>
<td>
<span title="Members may not create databases when doing so will impact costs">
β No
</span>
</td>
<td>
<span title="Viewers may not create databases when doing so will impact costs">
β No
</span>
</td>
</tr>
<tr>
<td>
Edit database (affects cost)
</td>
<td>
<span title="Owners can edit databases in ways that will impact costs">
β
Yes
</span>
</td>
<td>
<span title="Billing Admins may not edit databases in ways that impact costs">
β No
</span>
</td>
<td>
<span title="Managers can edit databases in ways that impact costs">
β
Yes
</span>
</td>
<td>
<span title="Members may not edit databases in ways that impact costs">
β No
</span>
</td>
<td>
<span title="Viewers may not edit databases in ways that impact costs">
β No
</span>
</td>
</tr>
<tr>
<td>
Create database (no cost impact)
</td>
<td>
<span title="Owners can create databases when doing so will not impact costs">
β
Yes
</span>
</td>
<td>
<span title="Billing Admins may not create databases when doing so will not impact costs">
β No
</span>
</td>
<td>
<span title="Managers can create databases when doing so will not impact costs">
β
Yes
</span>
</td>
<td>
<span title="Members can create databases when doing so will not impact costs">
β
Yes
</span>
</td>
<td>
<span title="Viewers may not create databases when doing so will not impact costs">
β No
</span>
</td>
</tr>
<tr>
<td>
Edit database (no cost impact)
</td>
<td>
<span title="Owners can edit databases in ways that do not impact costs">
β
Yes
</span>
</td>
<td>
<span title="Billing Admins may not change databases in ways that do not affect costs">
β No
</span>
</td>
<td>
<span title="Managers can change databases in ways that do not affect costs">
β
Yes
</span>
</td>
<td>
<span title="Members can change databases in ways that do not affect costs">
β
Yes
</span>
</td>
<td>
<span title="Viewers may not change databases in ways that do not affect costs">
β No
</span>
</td>
</tr>
<tr>
<td>
View subscription
</td>
<td>
<span title="Owners can view subscription details">
β
Yes
</span>
</td>
<td>
<span title="Billing Admins can view subscription details">
β
Yes
</span>
</td>
<td>
<span title="Managers can view subscription details">
β
Yes
</span>
</td>
<td>
<span title="Members can view subscription details">
β
Yes
</span>
</td>
<td>
<span title="Viewers can view subscription details">
β
Yes
</span>
</td>
</tr>
<tr>
<td>
View database
</td>
<td>
<span title="Owners can view database details">
β
Yes
</span>
</td>
<td>
<span title="Billing Admins can view the list of databases but not database details">
β
Yes
<sup>
<a href="#table-note-3">
3
</a>
</sup>
</span>
</td>
<td>
<span title="Managers can view database details">
β
Yes
</span>
</td>
<td>
<span title="Members can view database details">
β
Yes
</span>
</td>
<td>
<span title="Viewers can view database details">
β
Yes
</span>
</td>
</tr>
</tbody>
</table>
<ol>
<li>
<p>
<a name="table-note-1" style="display: block; height: 80px; margin-top: -80px;">
</a>
Billing Admins can only edit the account billing address in Account Settings.
</p>
</li>
<li>
<p>
<a name="table-note-2" style="display: block; height: 80px; margin-top: -80px;">
</a>
Billing Admins can only change the payment method when editing a subscription.
</p>
</li>
<li>
<p>
<a name="table-note-3" style="display: block; height: 80px; margin-top: -80px;">
</a>
Billing Admins can see the list of databases, but can not see database details, including connection details.
</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/rc/security/access-control/access-management/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/7.4/databases/active-active/get-started/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Get started with Redis Enterprise Active-Active databases
</h1>
<p class="text-lg -mt-5 mb-10">
Quick start guide to create an Active-Active database for test and development.
</p>
<p>
To get started, this article will help you set up an Active-Active database, formerly known as CRDB (conflict-free replicated database), spanning across two Redis Enterprise Software
clusters for test and development environments. Here are the steps:
</p>
<ol>
<li>
<p>
Run two Redis Enterprise Software Docker containers.
</p>
</li>
<li>
<p>
Set up each container as a cluster.
</p>
</li>
<li>
<p>
Create a new Redis Enterprise Active-Active database.
</p>
</li>
<li>
<p>
Test connectivity to the Active-Active database.
</p>
</li>
</ol>
<p>
To run an Active-Active database on installations from the
<a href="/docs/latest/operate/rs/7.4/installing-upgrading/quickstarts/redis-enterprise-software-quickstart/">
Redis Enterprise Software download package
</a>
,
set up two Redis Enterprise Software installations and continue from Step 2.
</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>
This getting started guide is for development or demonstration environments.
For production environments, see
<a href="/docs/latest/operate/rs/7.4/databases/active-active/create/">
Create an Active-Active geo-replicated database
</a>
for instructions.
</div>
</div>
<h2 id="run-two-containers">
Run two containers
</h2>
<p>
To spin up two Redis Enterprise Software containers, run these commands:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">docker run -d --cap-add sys_resource -h rs1_node1 --name rs1_node1 -p 8443:8443 -p 9443:9443 -p 12000:12000 redislabs/redis
</span></span></code></pre>
</div>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">docker run -d --cap-add sys_resource -h rs2_node1 --name rs2_node1 -p 8445:8443 -p 9445:9443 -p 12002:12000 redislabs/redis
</span></span></code></pre>
</div>
<p>
The
<strong>
-p
</strong>
options map the Cluster Manager UI port (8443), REST API port (9443), and
database access port differently for each container to make sure that all
containers can be accessed from the host OS that is running the containers.
</p>
<h2 id="set-up-two-clusters">
Set up two clusters
</h2>
<ol>
<li>
<p>
For cluster 1, go to
<code>
https://localhost:8443
</code>
in a browser on the
host machine to access the Redis Enterprise Software Cluster Manager UI.
</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>
Depending on your browser, you may see a certificate error. Continue to the website.
</div>
</div>
</li>
<li>
<p>
Click
<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 click
<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>
</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 of the
<strong>
Cluster
</strong>
settings page, enter a cluster FQDN, for example
<code>
cluster1.local
</code>
:
</p>
<a href="/docs/latest/images/rs/screenshots/cluster/setup/config-cluster1.png" sdata-lightbox="/images/rs/screenshots/cluster/setup/config-cluster1.png">
<img alt="Configure the cluster FQDN." src="/docs/latest/images/rs/screenshots/cluster/setup/config-cluster1.png"/>
</a>
</li>
<li>
<p>
On the node setup screen, keep the default settings and click
<strong>
Create cluster
</strong>
:
</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>
Click
<strong>
OK
</strong>
to confirm that you are aware of the replacement of the HTTPS SSL/TLS
certificate on the node, and proceed through the browser warning.
</p>
</li>
<li>
<p>
Repeat the previous steps for cluster 2 with these differences:
</p>
<ul>
<li>
<p>
In your web browser, go to
<code>
https://localhost:8445
</code>
to set up the cluster 2.
</p>
</li>
<li>
<p>
For the
<strong>
Cluster name (FQDN)
</strong>
, enter a different name, such as
<code>
cluster2.local
</code>
.
</p>
</li>
</ul>
</li>
</ol>
<p>
Now you have two Redis Enterprise Software clusters with FQDNs
<code>
cluster1.local
</code>
and
<code>
cluster2.local
</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>
Each Active-Active instance must have a unique fully-qualified domain name (FQDN).
</div>
</div>
<h2 id="create-an-active-active-database">
Create an Active-Active database
</h2>
<ol>
<li>
<p>
Sign in to cluster1.local's Cluster Manager UI at
<code>
https://localhost:8443
</code>
</p>
</li>
<li>
<p>
Open the
<strong>
Create database
</strong>
menu with one of the following methods:
</p>
<ul>
<li>
<p>
Click the
<strong>
+
</strong>
button next to
<strong>
Databases
</strong>
in the navigation menu:
</p>
<a href="/docs/latest/images/rs/screenshots/databases/create-db-plus-drop-down.png" sdata-lightbox="/images/rs/screenshots/databases/create-db-plus-drop-down.png">
<img alt="Create database menu has two options: Single Region and Active-Active database." src="/docs/latest/images/rs/screenshots/databases/create-db-plus-drop-down.png" width="350px"/>
</a>
</li>
<li>
<p>
Go to the
<strong>
Databases
</strong>
screen and select
<strong>
Create database
</strong>
:
</p>
<a href="/docs/latest/images/rs/screenshots/databases/create-db-button-drop-down.png" sdata-lightbox="/images/rs/screenshots/databases/create-db-button-drop-down.png">
<img alt="Create database menu has two options: Single Region and Active-Active database." src="/docs/latest/images/rs/screenshots/databases/create-db-button-drop-down.png" width="350px"/>
</a>
</li>
</ul>
</li>
<li>
<p>
Select
<strong>
Active-Active database
</strong>
.
</p>
</li>
<li>
<p>
Enter the cluster's local admin credentials, then click
<strong>
Save
</strong>
:
</p>
<a href="/docs/latest/images/rs/screenshots/databases/active-active-databases/enter-local-admin-credentials-cluster1.png" sdata-lightbox="/images/rs/screenshots/databases/active-active-databases/enter-local-admin-credentials-cluster1.png">
<img alt="Enter the cluster's admin username and password." src="/docs/latest/images/rs/screenshots/databases/active-active-databases/enter-local-admin-credentials-cluster1.png"/>
</a>
</li>
<li>
<p>
Add participating clusters that will host instances of the Active-Active database:
</p>
<ol>
<li>
<p>
In the
<strong>
Participating clusters
</strong>
section, go to
<strong>
Other participating clusters
</strong>
and click
<strong>
+ Add cluster
</strong>
.
</p>
</li>
<li>
<p>
In the
<strong>
Add cluster
</strong>
configuration panel, enter the new cluster's URL, port number, and the admin username and password for the new participating cluster:
</p>
<p>
In the
<strong>
Other participating clusters
</strong>
list, add the address and admin credentials for the other cluster:
<code>
https://cluster2.local:9443
</code>
</p>
<a href="/docs/latest/images/rs/screenshots/databases/active-active-databases/participating-clusters-add-cluster2.png" sdata-lightbox="/images/rs/screenshots/databases/active-active-databases/participating-clusters-add-cluster2.png">
<img alt="Add cluster panel." src="/docs/latest/images/rs/screenshots/databases/active-active-databases/participating-clusters-add-cluster2.png"/>
</a>
</li>
<li>
<p>
Click
<strong>
Join cluster
</strong>
to add the cluster to the list of participating clusters.
</p>
</li>
</ol>
</li>
<li>
<p>
Enter
<code>
database1
</code>
for
<strong>
Database name
</strong>
and
<code>
12000
</code>
for
<strong>
Port
</strong>
:
</p>
<a href="/docs/latest/images/rs/screenshots/databases/active-active-databases/quickstart-db-name-port.png" sdata-lightbox="/images/rs/screenshots/databases/active-active-databases/quickstart-db-name-port.png">
<img alt="Database name and port text boxes." src="/docs/latest/images/rs/screenshots/databases/active-active-databases/quickstart-db-name-port.png"/>
</a>
</li>
<li>
<p>
Configure additional settings:
</p>
<ol>
<li>
<p>
In the
<strong>
High availability & durability
</strong>
section, turn off
<strong>
Replication
</strong>
since each cluster has only one node in this setup:
</p>
<a href="/docs/latest/images/rs/screenshots/databases/active-active-databases/quickstart-ha-turn-off-replication.png" sdata-lightbox="/images/rs/screenshots/databases/active-active-databases/quickstart-ha-turn-off-replication.png">
<img alt="Turn off replication in the High availability & durability section." src="/docs/latest/images/rs/screenshots/databases/active-active-databases/quickstart-ha-turn-off-replication.png"/>
</a>
</li>
<li>
<p>
In the
<strong>
Clustering
</strong>
section, either:
</p>
<ul>
<li>
<p>
Make sure that
<strong>
Sharding
</strong>
is enabled and select the number of shards you want to have in the database. When database clustering is enabled,
databases are subject to limitations on
<a href="/docs/latest/operate/rs/7.4/databases/durability-ha/clustering/">
Multi-key commands
</a>
.
You can increase the number of shards in the database at any time.
</p>
</li>
<li>
<p>
Turn off
<strong>
Sharding
</strong>
to use only one shard and avoid
<a href="/docs/latest/operate/rs/7.4/databases/durability-ha/clustering/">
Multi-key command
</a>
limitations.
</p>
</li>
</ul>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Note:
</div>
You cannot enable or turn off database clustering after the Active-Active database is created.
</div>
</div>
</li>
</ol>
</li>
<li>
<p>
Click
<strong>
Create
</strong>
.
</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 cannot activate the database because of a memory limitation,
make sure that Docker has at least 4 GB of memory allocated in the
<strong>
Advanced
</strong>
section of Docker
<strong>
Settings
</strong>
.
</div>
</div>
</li>
<li>
<p>
After the Active-Active database is created, sign in to the Cluster Manager UIs for cluster 1 at
<code>
https://localhost:8443
</code>
and cluster 2 at
<code>
https://localhost:8445
</code>
.
</p>
</li>
<li>
<p>
Make sure each cluster has an Active-Active database member database with the name
<code>
database1
</code>
.
</p>
<p>
In a real-world deployment, cluster 1 and cluster 2 would most likely be
in separate data centers in different regions. However, for
local testing we created the scale-minimized deployment using two
local clusters running on the same host.
</p>
</li>
</ol>
<!-- Also in getting-started-crdbs.md -->
<h2 id="test-connection">
Test connection
</h2>
<p>
With the Redis database created, you are ready to connect to your
database. See
<a href="/docs/latest/operate/rs/7.4/databases/active-active/connect/">
Connect to Active-Active databases
</a>
for tutorials and examples of multiple connection methods.
</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/active-active/get-started/"/>
<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/nodejs/produsage/.html | <section class="prose w-full py-12">
<h1>
Production usage
</h1>
<p class="text-lg -mt-5 mb-10">
Get your Node.js app ready for production
</p>
<p>
The following sections explain how to handle situations that may occur
in your production environment.
</p>
<h3 id="handling-errors">
Handling errors
</h3>
<p>
Node-Redis provides
<a href="https://github.com/redis/node-redis?tab=readme-ov-file#events">
multiple events to handle various scenarios
</a>
, among which the most critical is the
<code>
error
</code>
event.
</p>
<p>
This event is triggered whenever an error occurs within the client.
</p>
<p>
It is crucial to listen for error events.
</p>
<p>
If a client does not register at least one error listener and an error occurs, the system will throw that error, potentially causing the Node.js process to exit unexpectedly.
See
<a href="https://nodejs.org/api/events.html#events_error_events">
the EventEmitter docs
</a>
for more details.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-typescript" data-lang="typescript"><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="c1">// ... client options
</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="c1">// Always ensure there's a listener for errors in the client to prevent process crashes due to unhandled errors
</span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="nx">client</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s1">'error'</span><span class="p">,</span> <span class="nx">error</span> <span class="o">=></span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nx">console</span><span class="p">.</span><span class="nx">error</span><span class="p">(</span><span class="sb">`Redis client error:`</span><span class="p">,</span> <span class="nx">error</span><span class="p">);</span>
</span></span><span class="line"><span class="cl"><span class="p">});</span>
</span></span></code></pre>
</div>
<h3 id="handling-reconnections">
Handling reconnections
</h3>
<p>
If network issues or other problems unexpectedly close the socket, the client will reject all commands already sent, since the server might have already executed them.
The rest of the pending commands will remain queued in memory until a new socket is established.
This behaviour is controlled by the
<code>
enableOfflineQueue
</code>
option, which is enabled by default.
</p>
<p>
The client uses
<code>
reconnectStrategy
</code>
to decide when to attempt to reconnect.
The default strategy is to calculate the delay before each attempt based on the attempt number
<code>
Math.min(retries * 50, 500)
</code>
. You can customize this strategy by passing a supported value to
<code>
reconnectStrategy
</code>
option:
</p>
<ol>
<li>
Define a callback
<code>
(retries: number, cause: Error) => false | number | Error
</code>
<strong>
(recommended)
</strong>
</li>
</ol>
<div class="highlight">
<pre class="chroma"><code class="language-typescript" data-lang="typescript"><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="nx">socket</span><span class="o">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nx">reconnectStrategy</span>: <span class="kt">function</span><span class="p">(</span><span class="nx">retries</span><span class="p">)</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="k">if</span> <span class="p">(</span><span class="nx">retries</span> <span class="o">></span> <span class="mi">20</span><span class="p">)</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">"Too many attempts to reconnect. Redis connection was terminated"</span><span class="p">);</span>
</span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="k">new</span> <span class="nb">Error</span><span class="p">(</span><span class="s2">"Too many retries."</span><span class="p">);</span>
</span></span><span class="line"><span class="cl"> <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="nx">retries</span> <span class="o">*</span> <span class="mi">500</span><span class="p">;</span>
</span></span><span class="line"><span class="cl"> <span class="p">}</span>
</span></span><span class="line"><span class="cl"> <span class="p">}</span>
</span></span><span class="line"><span class="cl"> <span class="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">client</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s1">'error'</span><span class="p">,</span> <span class="nx">error</span> <span class="o">=></span> <span class="nx">console</span><span class="p">.</span><span class="nx">error</span><span class="p">(</span><span class="s1">'Redis client error:'</span><span class="p">,</span> <span class="nx">error</span><span class="p">));</span>
</span></span></code></pre>
</div>
<p>
In the provided reconnection strategy callback, the client attempts to reconnect up to 20 times with a delay of
<code>
retries * 500
</code>
milliseconds between attempts.
After approximately two minutes, the client logs an error message and terminates the connection if the maximum retry limit is exceeded.
</p>
<ol start="2">
<li>
Use a numerical value to set a fixed delay in milliseconds.
</li>
<li>
Use
<code>
false
</code>
to disable reconnection attempts. This option should only be used for testing purposes.
</li>
</ol>
<h3 id="timeouts">
Timeouts
</h3>
<p>
To set a timeout for a connection, use the
<code>
connectTimeout
</code>
option:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-typescript" data-lang="typescript"><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="nx">socket</span><span class="o">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="c1">// setting a 10-second timeout
</span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="nx">connectTimeout</span>: <span class="kt">10000</span> <span class="c1">// in milliseconds
</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><span class="line"><span class="cl"><span class="nx">client</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s1">'error'</span><span class="p">,</span> <span class="nx">error</span> <span class="o">=></span> <span class="nx">console</span><span class="p">.</span><span class="nx">error</span><span class="p">(</span><span class="s1">'Redis client error:'</span><span class="p">,</span> <span class="nx">error</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/nodejs/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/rs/references/rest-api/objects/proxy/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Proxy object
</h1>
<p class="text-lg -mt-5 mb-10">
An object that represents a proxy in the cluster
</p>
<p>
An API object that represents a
<a href="https://en.wikipedia.org/wiki/Proxy_server">
proxy
</a>
in the cluster.
</p>
<table>
<thead>
<tr>
<th>
Name
</th>
<th>
Type/Value
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
uid
</td>
<td>
integer
</td>
<td>
Unique ID of the proxy (read-only)
</td>
</tr>
<tr>
<td>
backlog
</td>
<td>
integer
</td>
<td>
TCP listen queue backlog
</td>
</tr>
<tr>
<td>
client_keepcnt
</td>
<td>
integer
</td>
<td>
Client TCP keepalive count
</td>
</tr>
<tr>
<td>
client_keepidle
</td>
<td>
integer
</td>
<td>
Client TCP keepalive idle
</td>
</tr>
<tr>
<td>
client_keepintvl
</td>
<td>
integer
</td>
<td>
Client TCP keepalive interval
</td>
</tr>
<tr>
<td>
conns
</td>
<td>
integer
</td>
<td>
Number of connections
</td>
</tr>
<tr>
<td>
duration_usage_threshold
</td>
<td>
integer,
<nobr>
(range: 10-300)
</nobr>
</td>
<td>
Max number of threads
</td>
</tr>
<tr>
<td>
dynamic_threads_scaling
</td>
<td>
boolean
</td>
<td>
Automatically adjust the number of threads
</td>
</tr>
<tr>
<td>
ignore_bdb_cconn_limit
</td>
<td>
boolean
</td>
<td>
Ignore client connection limits
</td>
</tr>
<tr>
<td>
ignore_bdb_cconn_output_buff_limits
</td>
<td>
boolean
</td>
<td>
Ignore buffer limit
</td>
</tr>
<tr>
<td>
log_level
</td>
<td>
<code>
crit
</code>
<br/>
<code>
error
</code>
<br/>
<code>
warn
</code>
<br/>
<code>
info
</code>
<br/>
<code>
trace
</code>
<br/>
<code>
debug
</code>
</td>
<td>
Minimum log level to log. Only logs with this level or greater will be logged.
</td>
</tr>
<tr>
<td>
max_listeners
</td>
<td>
integer
</td>
<td>
Max number of listeners
</td>
</tr>
<tr>
<td>
max_servers
</td>
<td>
integer
</td>
<td>
Max number of Redis servers
</td>
</tr>
<tr>
<td>
max_threads
</td>
<td>
integer,
<nobr>
(range: 1-256)
</nobr>
</td>
<td>
Max number of threads
</td>
</tr>
<tr>
<td>
max_worker_client_conns
</td>
<td>
integer
</td>
<td>
Max client connections per thread
</td>
</tr>
<tr>
<td>
max_worker_server_conns
</td>
<td>
integer
</td>
<td>
Max server connections per thread
</td>
</tr>
<tr>
<td>
max_worker_txns
</td>
<td>
integer
</td>
<td>
Max in-flight transactions per thread
</td>
</tr>
<tr>
<td>
threads
</td>
<td>
integer,
<nobr>
(range: 1-256)
</nobr>
</td>
<td>
Number of threads
</td>
</tr>
<tr>
<td>
threads_usage_threshold
</td>
<td>
integer,
<nobr>
(range: 50-99)
</nobr>
</td>
<td>
Max number of threads
</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/proxy/"/>
<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.insert/.html | <section class="prose w-full py-12">
<h1 class="command-name">
BF.INSERT
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">BF.INSERT key [CAPACITYΒ capacity] [ERRORΒ error]
[EXPANSIONΒ expansion] [NOCREATE] [NONSCALING] ITEMS 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>
Creates a new Bloom filter if the
<code>
key
</code>
does not exist using the specified error rate, capacity, and expansion, then adds all specified items to the Bloom Filter.
</p>
<p>
This command is similar to
<a href="/docs/latest/commands/bf.madd/">
<code>
BF.MADD
</code>
</a>
, except that the error rate, capacity, and expansion can be specified. It is a sugarcoated combination of
<a href="/docs/latest/commands/bf.reserve/">
<code>
BF.RESERVE
</code>
</a>
and
<a href="/docs/latest/commands/bf.madd/">
<code>
BF.MADD
</code>
</a>
.
</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 items to.
</p>
<p>
If
<code>
key
</code>
does not exist, a new Bloom filter is created.
</p>
</details>
<details open="">
<summary>
<code>
ITEMS item...
</code>
</summary>
<p>
One or more items to add.
</p>
</details>
<h2 id="optional-arguments">
Optional arguments
</h2>
<details open="">
<summary>
<code>
NOCREATE
</code>
</summary>
<p>
Indicates that the filter should not be created if it does not already exist.
If the filter does not yet exist, an error is returned rather than creating it automatically.
This may be used where a strict separation between filter creation and filter addition is desired.
It is an error to specify
<code>
NOCREATE
</code>
together with either
<code>
CAPACITY
</code>
or
<code>
ERROR
</code>
.
</p>
</details>
<details open="">
<summary>
<code>
CAPACITY capacity
</code>
</summary>
<p>
Specifies the desired
<code>
capacity
</code>
for the filter to be created.
This parameter is ignored if the filter already exists.
If the filter is automatically created and this parameter is absent, then the module-level
<code>
capacity
</code>
is used.
See
<a href="/docs/latest/commands/bf.reserve/">
<code>
BF.RESERVE
</code>
</a>
for more information about the impact of this value.
</p>
</details>
<details open="">
<summary>
<code>
ERROR error
</code>
</summary>
<p>
Specifies the
<code>
error
</code>
ratio of the newly created filter if it does not yet exist.
If the filter is automatically created and
<code>
error
</code>
is not specified then the module-level error rate is used.
See
<a href="/docs/latest/commands/bf.reserve/">
<code>
BF.RESERVE
</code>
</a>
for more information about the format of this value.
</p>
</details>
<details open="">
<summary>
<code>
NONSCALING
</code>
</summary>
<p>
Prevents the filter from creating additional sub-filters if initial capacity is reached.
Non-scaling filters require slightly less memory than their scaling counterparts. The filter returns an error when
<code>
capacity
</code>
is reached.
</p>
</details>
<details open="">
<summary>
<code>
EXPANSION expansion
</code>
</summary>
<p>
When
<code>
capacity
</code>
is reached, an additional sub-filter is created.
The size of the new sub-filter is the size of the last sub-filter multiplied by
<code>
expansion
</code>
, specified as a positive integer.
</p>
<p>
If the number of elements to be stored in the filter is unknown, use an
<code>
expansion
</code>
of
<code>
2
</code>
or more to reduce the number of sub-filters.
Otherwise, use an
<code>
expansion
</code>
of
<code>
1
</code>
to reduce memory consumption. The default value is
<code>
2
</code>
.
</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 one of these options:
<ul>
<li>
<a href="/docs/latest/develop/reference/protocol-spec/#integers">
Integer reply
</a>
, where
<code>
1
</code>
denotes that the item has been added successfully, and
<code>
0
</code>
means that such item had 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>
[], for example, when the number of arguments or key type is wrong, and also when
<code>
NOCREATE
</code>
is specified and
<code>
key
</code>
does not exist.
</li>
</ul>
<h2 id="examples">
Examples
</h2>
<p>
Add three items to a filter, then create the filter with default parameters if it does not already exist.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">BF.INSERT filter ITEMS foo bar baz</span></span></code></pre>
</div>
<p>
Add one item to a filter, then create the filter with a capacity of 10000 if it does not already exist.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">BF.INSERT filter CAPACITY <span class="m">10000</span> ITEMS hello</span></span></code></pre>
</div>
<p>
Add two items to a filter, then return error if the filter does not already exist.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">BF.INSERT filter NOCREATE ITEMS foo bar</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.insert/"/>
<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/security/ldap/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Enable LDAP authentication
</h1>
<p class="text-lg -mt-5 mb-10">
Enable LDAP authentication for Redis Enterprise for Kubernetes.
</p>
<h2 id="ldap-support-for-redis-enterprise-software">
LDAP support for Redis Enterprise Software
</h2>
<p>
Redis Enterprise Software supports LDAP authentication and authorization through
<a href="/docs/latest/operate/rs/security/access-control/">
role-based access controls
</a>
(RBAC). You can map LDAP groups to
<a href="/docs/latest/operate/rs/security/access-control/">
Redis Enterprise roles
</a>
to control access to your database and the Cluster Manager UI. For more details on how LDAP works with Redis Enterprise, see
<a href="/docs/latest/operate/rs/security/access-control/ldap/">
LDAP authentication
</a>
.
</p>
<p>
Redis Enterprise for Kubernetes supports enabling and configuring LDAP authentication using the
<code>
RedisEnterpriseCluster
</code>
(REC) custom resource. Currently, the Redis Enterprise cluster (REC) only supports configuration related to the LDAP server, such as server addresses, connection details, credentials, and query configuration.
</p>
<p>
To
<a href="/docs/latest/operate/rs/security/access-control/ldap/enable-role-based-ldap/">
map LDAP groups to Redis Enterprise access control roles
</a>
, you'll need to use the Redis Enterprise
<a href="/docs/latest/operate/rs/references/rest-api/requests/ldap_mappings/">
API
</a>
or
<a href="/docs/latest/operate/rs/security/access-control/ldap/enable-role-based-ldap/">
admin console
</a>
.
</p>
<h2 id="enable-ldap">
Enable LDAP
</h2>
<p>
To enable LDAP for your REC, use the
<code>
.spec.ldap
</code>
field in the
<code>
RedisEnterpriseCluster
</code>
custom resource.
</p>
<p>
The following
<code>
RedisEnterpriseCluster
</code>
example resource enables a basic LDAP configuration:
</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">rec</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">nodes</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">ldap</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">protocol</span><span class="p">:</span><span class="w"> </span><span class="l">LDAP</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">servers</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span>- <span class="nt">host</span><span class="p">:</span><span class="w"> </span><span class="l">openldap.openldap.svc</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">port</span><span class="p">:</span><span class="w"> </span><span class="m">389</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">bindCredentialsSecretName</span><span class="p">:</span><span class="w"> </span><span class="l">ldap-bind-credentials</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">cacheTTLSeconds</span><span class="p">:</span><span class="w"> </span><span class="m">600</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">enabledForControlPlane</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">enabledForDataPlane</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">authenticationQuery</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">template</span><span class="p">:</span><span class="w"> </span><span class="l">cn=%u,ou=default,dc=example,dc=org</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">authorizationQuery</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">attribute</span><span class="p">:</span><span class="w"> </span><span class="l">memberOf</span><span class="w">
</span></span></span></code></pre>
</div>
<p>
Refer to the
<code>
RedisEnterpriseCluster
</code>
<a href="https://github.com/RedisLabs/redis-enterprise-k8s-docs/blob/master/redis_enterprise_cluster_api.md#ldapspec">
API reference
</a>
for full details on the available fields.
</p>
<h3 id="bind-credentials">
Bind credentials
</h3>
<p>
For LDAP servers that require authentication for client queries, store the bind credentials in a secret and reference them in the
<code>
RedisEnterpriseCluster
</code>
custom resource.
</p>
<ol>
<li>
<p>
Create a secret to store the bind credentials.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">kubectl -n <rec-namespace> create secret generic <bind-secret-name> <span class="se">\
</span></span></span><span class="line"><span class="cl"><span class="se"></span> --from-literal<span class="o">=</span><span class="nv">dn</span><span class="o">=</span><span class="s1">'<disinguished-name>'</span> <span class="se">\
</span></span></span><span class="line"><span class="cl"><span class="se"></span> --from-literal<span class="o">=</span><span class="nv">password</span><span class="o">=</span><password>
</span></span></code></pre>
</div>
<p>
The secret must:
</p>
<ul>
<li>
Reside within the same namespace as the
<code>
RedisEnterpriseCluster
</code>
custom resource.
</li>
<li>
Include a
<code>
dn
</code>
key with the distinguished name for the user performing the query (such as
<code>
cn=admin,dc=example,dc=org
</code>
).
</li>
<li>
Include a
<code>
password
</code>
key with the bind password.
</li>
</ul>
<p>
Replace the
<code>
<placeholders>
</code>
in the command above with your own values.
</p>
</li>
<li>
<p>
Reference the secret name in the
<code>
.spec.ldap.bindCredentialsSecretName
</code>
field of the
<code>
RedisEnterpriseCluster
</code>
custom resource.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><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">ldap</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">bindCredentialsSecretName</span><span class="p">:</span><span class="w"> </span><span class="l"><bind-secret-name></span><span class="w">
</span></span></span></code></pre>
</div>
</li>
</ol>
<h3 id="ldaps-or-starttls-protocols">
LDAPS or STARTTLS protocols
</h3>
<p>
In addition to plain LDAP protocol, Redis Enterprise Software also supports LDAPS and STARTTLS protocols for secure communication with the LDAP server.
</p>
<p>
To enable one of these protocols, edit the
<code>
spec.ldap.protocol
</code>
field in the
<code>
RedisEnterpriseCluster
</code>
custom resource:
</p>
<h4 id="enable-ldaps">
Enable
<code>
LDAPS
</code>
</h4>
<div class="highlight">
<pre class="chroma"><code class="language-yaml" data-lang="yaml"><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">ldap</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">protocol</span><span class="p">:</span><span class="w"> </span><span class="l">LDAPS</span><span class="w">
</span></span></span></code></pre>
</div>
<p>
Default port: 636
</p>
<h4 id="enable-starttls">
Enable
<code>
STARTTLS
</code>
</h4>
<div class="highlight">
<pre class="chroma"><code class="language-yaml" data-lang="yaml"><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">ldap</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">protocol</span><span class="p">:</span><span class="w"> </span><span class="l">STARTTLS</span><span class="w">
</span></span></span></code></pre>
</div>
<p>
Default port: 389
</p>
<h3 id="ca-certificate">
CA certificate
</h3>
<p>
To use a custom CA certificate for validating the LDAP server certificate, store the CA certificate in a secret and reference the secret in the
<code>
RedisEnterpriseCluster
</code>
custom resource.
</p>
<ol>
<li>
<p>
Create a secret to hold the CA certificate.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">kubectl -n <rec-namespace> create secret generic <ca-secret-name> <span class="se">\
</span></span></span><span class="line"><span class="cl"><span class="se"></span> --from-file<span class="o">=</span><span class="nv">cert</span><span class="o">=</span><ca-cert>.pem
</span></span></code></pre>
</div>
<p>
The secret must:
</p>
<ul>
<li>
Reside within the same namespace as the
<code>
RedisEnterpriseCluster
</code>
custom resource.
</li>
<li>
Include a
<code>
cert
</code>
key with a PEM-encoded CA certificate (such as
<code>
cacert.pem
</code>
).
</li>
</ul>
<p>
Replace the
<code>
<placeholders>
</code>
in the command above with your own values.
</p>
</li>
<li>
<p>
Reference the secret name in the
<code>
spec.ldap.caCertificateSecretName
</code>
field of the
<code>
RedisEnterpriseCluster
</code>
custom resource.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><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">ldap</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">caCertificateSecretName</span><span class="p">:</span><span class="w"> </span><span class="l"><ca-secret-name></span><span class="w">
</span></span></span></code></pre>
</div>
</li>
</ol>
<h3 id="client-certificates">
Client certificates
</h3>
<p>
To use an LDAP client certificate, store the certificate in a secret and reference the secret in the
<code>
RedisEnterpriseCluster
</code>
custom resource.
</p>
<ol>
<li>
<p>
Create a secret to hold the client certificate.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">kubectl -n <rec-namespace> create secret generic <client-secret-name> <span class="se">\
</span></span></span><span class="line"><span class="cl"><span class="se"></span> --from-literal<span class="o">=</span><span class="nv">name</span><span class="o">=</span>ldap_client <span class="se">\
</span></span></span><span class="line"><span class="cl"><span class="se"></span> --from-file<span class="o">=</span><span class="nv">certificate</span><span class="o">=</span><client-cert-file> <span class="se">\
</span></span></span><span class="line"><span class="cl"><span class="se"></span> --from-file<span class="o">=</span><span class="nv">key</span><span class="o">=</span><private-key-file>
</span></span></code></pre>
</div>
<p>
The secret must:
</p>
<ul>
<li>
Reside within the same namespace as the
<code>
RedisEnterpriseCluster
</code>
custom resource.
</li>
<li>
Include a
<code>
name
</code>
key explicitly set to
<code>
ldap_client
</code>
.
</li>
<li>
Include a
<code>
certificate
</code>
key for the public key (such as
<code>
cert.pem
</code>
).
</li>
<li>
Include a
<code>
key
</code>
key for the private key (such as
<code>
key.pem
</code>
).
</li>
</ul>
<p>
Replace the
<code>
<placeholders>
</code>
in the command above with your own values.
</p>
</li>
<li>
<p>
Reference the secret name in the
<code>
.spec.certificates.ldapClientCertificateSecretName
</code>
field of the
<code>
RedisEnterpriseCluster
</code>
custom resource, substituting your own values for
<code>
<placeholders>
</code>
.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><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">certificates</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">ldapClientCertificateSecretName</span><span class="p">:</span><span class="w"> </span><span class="l"><client-secret-name></span><span class="w">
</span></span></span></code></pre>
</div>
</li>
</ol>
<h2 id="known-limitations">
Known limitations
</h2>
<p>
Redis Enterprise Software can't resolve DNS names with a
<code>
.local
</code>
suffix.
If your LDAP server is in the same Kubernetes cluster and exposed via a Service object,
<em>
avoid
</em>
addresses such as
<code>
openldap.openldap.svc.cluster.local
</code>
. Instead,
<em>
use short-form addresses
</em>
such as
<code>
openldap.openldap.svc
</code>
.
</p>
<h2 id="next-steps">
Next steps
</h2>
<p>
To
<a href="/docs/latest/operate/rs/security/access-control/ldap/enable-role-based-ldap/">
map LDAP groups to Redis Enterprise access control roles
</a>
, you'll need to use the Redis Enterprise
<a href="/docs/latest/operate/rs/references/rest-api/requests/ldap_mappings/">
API
</a>
or
<a href="/docs/latest/operate/rs/security/access-control/ldap/enable-role-based-ldap/">
admin console
</a>
.
</p>
<p>
For more details on how LDAP works with Redis Enterprise, see
<a href="/docs/latest/operate/rs/security/access-control/ldap/">
LDAP authentication
</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/security/ldap/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/oss_and_stack/management/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Manage Redis
</h1>
<p class="text-lg -mt-5 mb-10">
An administrator's guide to Redis
</p>
<nav>
<a href="/docs/latest/operate/oss_and_stack/management/admin/">
Redis administration
</a>
<p>
Advice for configuring and managing Redis in production
</p>
<a href="/docs/latest/operate/oss_and_stack/management/security/">
Redis security
</a>
<p>
Security model and features in Redis
</p>
<a href="/docs/latest/operate/oss_and_stack/management/config/">
Redis configuration
</a>
<p>
Overview of redis.conf, the Redis configuration file
</p>
<a href="/docs/latest/operate/oss_and_stack/management/config-file/">
Redis configuration file example
</a>
<p>
The self-documented
<code>
redis.conf
</code>
file that's shipped with every version.
</p>
<a href="/docs/latest/operate/oss_and_stack/management/sentinel/">
High availability with Redis Sentinel
</a>
<p>
High availability for non-clustered Redis
</p>
<a href="/docs/latest/operate/oss_and_stack/management/replication/">
Redis replication
</a>
<p>
How Redis supports high availability and failover with replication
</p>
<a href="/docs/latest/operate/oss_and_stack/management/scaling/">
Scale with Redis Cluster
</a>
<p>
Horizontal scaling with Redis Cluster
</p>
<a href="/docs/latest/operate/oss_and_stack/management/persistence/">
Redis persistence
</a>
<p>
How Redis writes data to disk
</p>
<a href="/docs/latest/operate/oss_and_stack/management/optimization/">
Optimizing Redis
</a>
<p>
Benchmarking, profiling, and optimizations for memory and latency
</p>
<a href="/docs/latest/operate/oss_and_stack/management/troubleshooting/">
Troubleshooting Redis
</a>
<p>
Problems with Redis? Start here.
</p>
<a href="/docs/latest/operate/oss_and_stack/management/debugging/">
Debugging
</a>
<p>
A guide to debugging Redis server processes
</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/oss_and_stack/management/"/>
<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.set/.html | <section class="prose w-full py-12">
<h1 class="command-name">
JSON.SET
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">JSON.SET key path value [NX | XX]</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(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>
Set the JSON value at
<code>
path
</code>
in
<code>
key
</code>
</p>
<p>
<a href="#examples">
Examples
</a>
</p>
<h2 id="required-arguments">
Required arguments
</h2>
<details open="">
<summary>
<code>
key
</code>
</summary>
<p>
is key to modify.
</p>
</details>
<details open="">
<summary>
<code>
path
</code>
</summary>
<p>
is JSONPath to specify. Default is root
<code>
$
</code>
. For new Redis keys the
<code>
path
</code>
must be the root. For existing keys, when the entire
<code>
path
</code>
exists, the value that it contains is replaced with the
<code>
json
</code>
value. For existing keys, when the
<code>
path
</code>
exists, except for the last element, a new child is added with the
<code>
json
</code>
value.
</p>
<p>
Adds a key (with its respective value) to a JSON Object (in a RedisJSON data type key) only if it is the last child in the
<code>
path
</code>
, or it is the parent of a new child being added in the
<code>
path
</code>
. Optional arguments
<code>
NX
</code>
and
<code>
XX
</code>
modify this behavior for both new RedisJSON data type keys as well as the JSON Object keys in them.
</p>
</details>
<details open="">
<summary>
<code>
value
</code>
</summary>
<p>
is value to set at the specified path
</p>
</details>
<h2 id="optional-arguments">
Optional arguments
</h2>
<details open="">
<summary>
<code>
NX
</code>
</summary>
<p>
sets the key only if it does not already exist.
</p>
</details>
<details open="">
<summary>
<code>
XX
</code>
</summary>
<p>
sets the key only if it already exists.
</p>
</details>
<h2 id="return-value">
Return value
</h2>
<p>
JSET.SET returns a simple string reply:
<code>
OK
</code>
if executed correctly or
<code>
nil
</code>
if the specified
<code>
NX
</code>
or
<code>
XX
</code>
conditions were not met.
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>
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.SET 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>
Add a new 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.SET 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>
Update 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.SET doc $..a <span class="m">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">"{\"f1\":{\"a\":3},\"f2\":{\"a\":3}}"</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>
</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.set/"/>
<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/internals/rdd/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Redis design draft #2 (historical)
</h1>
<p class="text-lg -mt-5 mb-10">
A design for the RDB format written in the early days of Redis
</p>
<p>
<strong>
Note: this document was written by the creator of Redis, Salvatore Sanfilippo, early in the development of Redis (c. 2013), as part of a series of design drafts. This is preserved for historical interest.
</strong>
</p>
<h2 id="redis-design-draft-2----rdb-version-7-info-fields">
Redis Design Draft 2 -- RDB version 7 info fields
</h2>
<ul>
<li>
Author: Salvatore Sanfilippo
<code>
[email protected]
</code>
</li>
<li>
GitHub issue
<a href="https://github.com/redis/redis/issues/1048">
#1048
</a>
</li>
</ul>
<h3 id="history-of-revisions">
History of revisions
</h3>
<p>
1.0, 10 April 2013 - Initial draft.
</p>
<h3 id="overview">
Overview
</h3>
<p>
The Redis RDB format lacks a simple way to add info fields to an RDB file
without causing a backward compatibility issue even if the added meta data
is not required in order to load data from the RDB file.
</p>
<p>
For example thanks to the info fields specified in this document it will
be possible to add to RDB information like file creation time, Redis version
generating the file, and any other useful information, in a way that not
every field is required for an RDB version 7 file to be correctly processed.
</p>
<p>
Also with minimal changes it will be possible to add RDB version 7 support to
Redis 2.6 without actually supporting the additional fields but just skipping
them when loading an RDB file.
</p>
<p>
RDB info fields may have semantic meaning if needed, so that the presence
of the field may add information about the data set specified in the RDB
file format, however when an info field is required to be correctly decoded
in order to understand and load the data set content of the RDB file, the
RDB file format must be increased so that previous versions of Redis will not
attempt to load it.
</p>
<p>
However currently the info fields are designed to only hold additional
information that are not useful to load the dataset, but can better specify
how the RDB file was created.
</p>
<h3 id="info-fields-representation">
Info fields representation
</h3>
<p>
The RDB format 6 has the following layout:
</p>
<ul>
<li>
A 9 bytes magic "REDIS0006"
</li>
<li>
key-value pairs
</li>
<li>
An EOF opcode
</li>
<li>
CRC64 checksum
</li>
</ul>
<p>
The proposal for RDB format 7 is to add the optional fields immediately
after the first 9 bytes magic, so that the new format will be:
</p>
<ul>
<li>
A 9 bytes magic "REDIS0007"
</li>
<li>
Info field 1
</li>
<li>
Info field 2
</li>
<li>
...
</li>
<li>
Info field N
</li>
<li>
Info field end-of-fields
</li>
<li>
key-value pairs
</li>
<li>
An EOF opcode
</li>
<li>
CRC64 checksum
</li>
</ul>
<p>
Every single info field has the following structure:
</p>
<ul>
<li>
A 16 bit identifier
</li>
<li>
A 64 bit data length
</li>
<li>
A data section of the exact length as specified
</li>
</ul>
<p>
Both the identifier and the data length are stored in little endian byte
ordering.
</p>
<p>
The special identifier 0 means that there are no other info fields, and that
the remaining of the RDB file contains the key-value pairs.
</p>
<h3 id="handling-of-info-fields">
Handling of info fields
</h3>
<p>
A program can simply skip every info field it does not understand, as long
as the RDB version matches the one that it is capable to load.
</p>
<h3 id="specification-of-info-fields-ids-and-content">
Specification of info fields IDs and content.
</h3>
<h4 id="info-field-0----end-of-info-fields">
Info field 0 -- End of info fields
</h4>
<p>
This just means there are no longer info fields to process.
</p>
<h4 id="info-field-1----creation-date">
Info field 1 -- Creation date
</h4>
<p>
This field represents the unix time at which the RDB file was created.
The format of the unix time is a 64 bit little endian integer representing
seconds since 1th January 1970.
</p>
<h4 id="info-field-2----redis-version">
Info field 2 -- Redis version
</h4>
<p>
This field represents a null-terminated string containing the Redis version
that generated the file, as displayed in the Redis version INFO field.
</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/internals/rdd/"/>
<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/debuginfo/node/bdb/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Current node database debug info requests
</h1>
<p class="text-lg -mt-5 mb-10">
Documents the Redis Enterprise Software REST API debuginfo/node/bdb requests.
</p>
<div class="banner-article rounded-md" style="background-color: ">
<p>
This REST API path is deprecated as of Redis Enterprise Software version 7.4.2. Use the new path
<a href="/docs/latest/operate/rs/references/rest-api/requests/bdbs/debuginfo/">
<code>
/v1/bdbs/debuginfo
</code>
</a>
instead.
</p>
</div>
<table>
<thead>
<tr>
<th>
Method
</th>
<th>
Path
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="#get-debuginfo-node-bdb">
GET
</a>
</td>
<td>
<code>
/v1/debuginfo/node/bdb/{bdb_uid}
</code>
</td>
<td>
Get debug info for the current node regarding a specific database
</td>
</tr>
</tbody>
</table>
<h2 id="get-debuginfo-node-bdb">
Get database debug info for current node
</h2>
<pre><code>GET /v1/debuginfo/node/bdb/{int: bdb_uid}
</code></pre>
<p>
Downloads a tar file that contains debug info for the specified database (
<code>
bdb_uid
</code>
) from the current node.
</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/references/rest-api/permissions/#view_debugging_info">
view_debugging_info
</a>
</td>
</tr>
</tbody>
</table>
<h3 id="get-request">
Request
</h3>
<h4 id="example-http-request">
Example HTTP request
</h4>
<pre><code>GET /debuginfo/node/bdb/1
</code></pre>
<h3 id="get-response">
Response
</h3>
<p>
Downloads the debug info in a tar file called
<code>
filename.tar.gz
</code>
. Extract the files from the tar file to access the debug info.
</p>
<h4 id="response-headers">
Response headers
</h4>
<table>
<thead>
<tr>
<th>
Key
</th>
<th>
Value
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
Content-Type
</td>
<td>
application/x-gzip
</td>
<td>
Media type of request/response body
</td>
</tr>
<tr>
<td>
Content-Length
</td>
<td>
653350
</td>
<td>
Length of the response body in octets
</td>
</tr>
<tr>
<td>
Content-Disposition
</td>
<td>
attachment; filename=debuginfo.tar.gz
</td>
<td>
Display response in browser
</td>
</tr>
</tbody>
</table>
<h3 id="get-status-codes">
Status codes
</h3>
<table>
<thead>
<tr>
<th>
Code
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1">
200 OK
</a>
</td>
<td>
Success.
</td>
</tr>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.1">
500 Internal Server Error
</a>
</td>
<td>
Failed to get debug info.
</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/debuginfo/node/bdb/"/>
<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/networking/private-public-endpoints/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Enable private andΒ public database endpoints
</h1>
<p class="text-lg -mt-5 mb-10">
Describes how to enable public and private endpoints for databases on a cluster.
</p>
<p>
Each node in Redis Enterprise can be configured with
<a href="/docs/latest/operate/rs/networking/multi-ip-ipv6/">
private and external IP addresses
</a>
. By default, Redis Enterprise Software databases expose a single endpoint, e.g. cluster.com (FQDN), using the external IP addresses, making it available to the public network (e.g. the internet). Additionally, the cluster can be configured to expose a private FQDN, which utilizes the private IP addresses for access from the private network only (e.g. VPC or an internal network).
</p>
<p>
When you create a cluster via the UI, you can configure it to expose private and public endpoints.
This is common for environments such as cloud platforms and enterprises.
</p>
<p>
When doing so, the cluster creates an additional FQDN, e.g. internal.cluster.com for private network (e.g. VPC or an internal network), while the cluster.com FQDN can be used by a public network (e.g. the internet).
</p>
<p>
You can enable public and private endpoints during cluster creation only.
However, you can still add an additional FQDN in a different domain (cluster.io, for example) after cluster creation.
</p>
<p>
To enable private and public endpoints:
</p>
<ol>
<li>
<p>
Verify the IP addresses are bound to the server or instance.
</p>
</li>
<li>
<p>
During cluster setup, turn on
<strong>
Enable public endpoints support
</strong>
in the
<strong>
Cluster
</strong>
screen's
<strong>
Configuration
</strong>
section.
</p>
<a href="/docs/latest/images/rs/screenshots/cluster/setup/enable-public-endpoints.png" sdata-lightbox="/images/rs/screenshots/cluster/setup/enable-public-endpoints.png">
<img alt="The endpoint support setting appears in the **Configuration section** of the **Cluster** setup screen." src="/docs/latest/images/rs/screenshots/cluster/setup/enable-public-endpoints.png" width="75%"/>
</a>
<p>
If this setting is not enabled when the cluster is created, databases on the cluster support only a single endpoint.
</p>
</li>
<li>
<p>
Select
<strong>
Next
</strong>
to proceed to
<strong>
Node
</strong>
configuration.
</p>
</li>
<li>
<p>
In the
<strong>
Network configuration
</strong>
section:
</p>
<ol>
<li>
<p>
Configure the machine's public IP address for external traffic.
</p>
</li>
<li>
<p>
Configure the private IP address for both internal and external traffic so it can be used for private database endpoints.
</p>
</li>
</ol>
</li>
</ol>
<p>
After cluster creation, both sets of endpoints are available for databases in the cluster.
</p>
<p>
To view and copy public and private endpoints for a database in the cluster, see the database's
<strong>
Configuration > General
</strong>
section.
</p>
<a href="/docs/latest/images/rs/screenshots/databases/config-general-endpoints.png" sdata-lightbox="/images/rs/screenshots/databases/config-general-endpoints.png">
<img alt="View public and private endpoints from the General section of the database's Configuration screen." src="/docs/latest/images/rs/screenshots/databases/config-general-endpoints.png" width="75%"/>
</a>
<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/networking/private-public-endpoints/"/>
<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/advanced-concepts/vectors/.html | <section class="prose w-full py-12">
<h1>
Vectors
</h1>
<p class="text-lg -mt-5 mb-10">
Learn how to use vector fields and perform vector searches in Redis
</p>
<p>
Redis includes a
<a href="https://redis.io/blog/benchmarking-results-for-vector-databases/">
high-performance vector database
</a>
that lets you perform semantic searches over vector embeddings. You can augment these searches with filtering over text, numerical, geospatial, and tag metadata.
</p>
<p>
To quickly get started, check out the
<a href="/docs/latest/develop/get-started/vector-database">
Redis vector quickstart guide
</a>
and the
<a href="https://github.com/redis-developer/redis-ai-resources">
Redis AI Resources
</a>
Github repo.
</p>
<h2 id="overview">
Overview
</h2>
<ol>
<li>
<a href="/docs/latest/develop/interact/search-and-query/advanced-concepts/vectors#create-a-vector-index">
<strong>
Create a vector index
</strong>
</a>
: Redis maintains a secondary index over your data with a defined schema (including vector fields and metadata). Redis supports
<a href="/docs/latest/develop/interact/search-and-query/advanced-concepts/vectors#flat-index">
<code>
FLAT
</code>
</a>
and
<a href="/docs/latest/develop/interact/search-and-query/advanced-concepts/vectors#hnsw-index">
<code>
HNSW
</code>
</a>
vector index types.
</li>
<li>
<a href="/docs/latest/develop/interact/search-and-query/advanced-concepts/vectors#store-and-update-vectors">
<strong>
Store and update vectors
</strong>
</a>
: Redis stores vectors and metadata in hashes or JSON objects.
</li>
<li>
<a href="/docs/latest/develop/interact/search-and-query/advanced-concepts/vectors#search-with-vectors">
<strong>
Search with vectors
</strong>
</a>
: Redis supports several advanced querying strategies with vector fields including k-nearest neighbor (
<a href="/docs/latest/develop/interact/search-and-query/advanced-concepts/vectors#knn-vector-search">
KNN
</a>
),
<a href="/docs/latest/develop/interact/search-and-query/advanced-concepts/vectors#vector-range-queries">
vector range queries
</a>
, and
<a href="/docs/latest/develop/interact/search-and-query/advanced-concepts/vectors#filters">
metadata filters
</a>
.
</li>
<li>
<a href="/docs/latest/develop/interact/search-and-query/advanced-concepts/vectors#runtime-query-params">
<strong>
Configure vector queries at runtime
</strong>
</a>
.
</li>
<li>
<a href="/docs/latest/develop/interact/search-and-query/advanced-concepts/vectors#vector-search-examples">
<strong>
Vector search examples
</strong>
</a>
: Explore several vector search examples that cover different use cases and techniques.
</li>
</ol>
<h2 id="create-a-vector-index">
Create a vector index
</h2>
<p>
When you define the schema for an index, you can include one or more vector fields as shown below.
</p>
<p>
<strong>
Syntax
</strong>
</p>
<pre tabindex="0"><code>FT.CREATE <index_name>
ON <storage_type>
PREFIX 1 <key_prefix>
SCHEMA ... <field_name> VECTOR <algorithm> <index_attribute_count> <index_attribute_name> <index_attribute_value>
[<index_attribute_name> <index_attribute_value> ...]
</code></pre>
<p>
Refer to the full
<a href="/docs/latest/develop/interact/search-and-query/indexing/">
indexing
</a>
documentation for additional fields, options, and noted limitations.
</p>
<p>
<strong>
Parameters
</strong>
</p>
<table>
<thead>
<tr>
<th style="text-align:left">
Parameter
</th>
<th style="text-align:left">
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">
<code>
index_name
</code>
</td>
<td style="text-align:left">
Name of the index.
</td>
</tr>
<tr>
<td style="text-align:left">
<code>
storage_type
</code>
</td>
<td style="text-align:left">
Storage option (
<code>
HASH
</code>
or
<code>
JSON
</code>
).
</td>
</tr>
<tr>
<td style="text-align:left">
<code>
prefix
</code>
(optional)
</td>
<td style="text-align:left">
Key prefix used to select which keys should be indexed. Defaults to all keys if omitted.
</td>
</tr>
<tr>
<td style="text-align:left">
<code>
field_name
</code>
</td>
<td style="text-align:left">
Name of the vector field.
</td>
</tr>
<tr>
<td style="text-align:left">
<code>
algorithm
</code>
</td>
<td style="text-align:left">
Vector index algorithm (
<code>
FLAT
</code>
or
<code>
HNSW
</code>
).
</td>
</tr>
<tr>
<td style="text-align:left">
<code>
index_attribute_count
</code>
</td>
<td style="text-align:left">
Number of vector field attributes.
</td>
</tr>
<tr>
<td style="text-align:left">
<code>
index_attribute_name
</code>
</td>
<td style="text-align:left">
Vector field attribute name.
</td>
</tr>
<tr>
<td style="text-align:left">
<code>
index_attribute_value
</code>
</td>
<td style="text-align:left">
Vector field attribute value.
</td>
</tr>
</tbody>
</table>
<h3 id="flat-index">
FLAT index
</h3>
<p>
Choose the
<code>
FLAT
</code>
index when you have small datasets (< 1M vectors) or when perfect search accuracy is more important than search latency.
</p>
<p>
<strong>
Required attributes
</strong>
</p>
<table>
<thead>
<tr>
<th style="text-align:left">
Attribute
</th>
<th style="text-align:left">
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">
<code>
TYPE
</code>
</td>
<td style="text-align:left">
Vector type (
<code>
BFLOAT16
</code>
,
<code>
FLOAT16
</code>
,
<code>
FLOAT32
</code>
,
<code>
FLOAT64
</code>
).
<code>
BFLOAT16
</code>
and
<code>
FLOAT16
</code>
require v2.10 or later.
</td>
</tr>
<tr>
<td style="text-align:left">
<code>
DIM
</code>
</td>
<td style="text-align:left">
The width, or number of dimensions, of the vector embeddings stored in this field. In other words, the number of floating point elements comprising the vector.
<code>
DIM
</code>
must be a positive integer. The vector used to query this field must have the exact dimensions as the field itself.
</td>
</tr>
<tr>
<td style="text-align:left">
<code>
DISTANCE_METRIC
</code>
</td>
<td style="text-align:left">
Distance metric (
<code>
L2
</code>
,
<code>
IP
</code>
,
<code>
COSINE
</code>
).
</td>
</tr>
</tbody>
</table>
<p>
<strong>
Example
</strong>
</p>
<pre tabindex="0"><code>FT.CREATE documents
ON HASH
PREFIX 1 docs:
SCHEMA doc_embedding VECTOR FLAT 6
TYPE FLOAT32
DIM 1536
DISTANCE_METRIC COSINE
</code></pre>
<p>
In the example above, an index named
<code>
documents
</code>
is created over hashes with the key prefix
<code>
docs:
</code>
and a
<code>
FLAT
</code>
vector field named
<code>
doc_embedding
</code>
with three index attributes:
<code>
TYPE
</code>
,
<code>
DIM
</code>
, and
<code>
DISTANCE_METRIC
</code>
.
</p>
<h3 id="hnsw-index">
HNSW index
</h3>
<p>
<code>
HNSW
</code>
, or hierarchical navigable small world, is an approximate nearest neighbors algorithm that uses a multi-layered graph to make vector search more scalable.
</p>
<ul>
<li>
The lowest layer contains all data points, and each higher layer contains a subset, forming a hierarchy.
</li>
<li>
At runtime, the search traverses the graph on each layer from top to bottom, finding the local minima before dropping to the subsequent layer.
</li>
</ul>
<p>
Choose the
<code>
HNSW
</code>
index type when you have larger datasets (> 1M documents) or when search performance and scalability are more important than perfect search accuracy.
</p>
<p>
<strong>
Required attributes
</strong>
</p>
<table>
<thead>
<tr>
<th style="text-align:left">
Attribute
</th>
<th style="text-align:left">
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">
<code>
TYPE
</code>
</td>
<td style="text-align:left">
Vector type (
<code>
BFLOAT16
</code>
,
<code>
FLOAT16
</code>
,
<code>
FLOAT32
</code>
,
<code>
FLOAT64
</code>
).
<code>
BFLOAT16
</code>
and
<code>
FLOAT16
</code>
require v2.10 or later.
</td>
</tr>
<tr>
<td style="text-align:left">
<code>
DIM
</code>
</td>
<td style="text-align:left">
The width, or number of dimensions, of the vector embeddings stored in this field. In other words, the number of floating point elements comprising the vector.
<code>
DIM
</code>
must be a positive integer. The vector used to query this field must have the exact dimensions as the field itself.
</td>
</tr>
<tr>
<td style="text-align:left">
<code>
DISTANCE_METRIC
</code>
</td>
<td style="text-align:left">
Distance metric (
<code>
L2
</code>
,
<code>
IP
</code>
,
<code>
COSINE
</code>
).
</td>
</tr>
</tbody>
</table>
<p>
<strong>
Optional attributes
</strong>
</p>
<p>
<a href="https://arxiv.org/ftp/arxiv/papers/1603/1603.09320.pdf">
<code>
HNSW
</code>
</a>
supports a number of additional parameters to tune
the accuracy of the queries, while trading off performance.
</p>
<table>
<thead>
<tr>
<th style="text-align:left">
Attribute
</th>
<th style="text-align:left">
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">
<code>
M
</code>
</td>
<td style="text-align:left">
Max number of outgoing edges (connections) for each node in a graph layer. On layer zero, the max number of connections will be
<code>
2 * M
</code>
. Higher values increase accuracy, but also increase memory usage and index build time. The default is 16.
</td>
</tr>
<tr>
<td style="text-align:left">
<code>
EF_CONSTRUCTION
</code>
</td>
<td style="text-align:left">
Max number of connected neighbors to consider during graph building. Higher values increase accuracy, but also increase index build time. The default is 200.
</td>
</tr>
<tr>
<td style="text-align:left">
<code>
EF_RUNTIME
</code>
</td>
<td style="text-align:left">
Max top candidates during KNN search. Higher values increase accuracy, but also increase search latency. The default is 10.
</td>
</tr>
<tr>
<td style="text-align:left">
<code>
EPSILON
</code>
</td>
<td style="text-align:left">
Relative factor that sets the boundaries in which a range query may search for candidates. That is, vector candidates whose distance from the query vector is
<code>
radius * (1 + EPSILON)
</code>
are potentially scanned, allowing more extensive search and more accurate results, at the expense of run time. The default is 0.01.
</td>
</tr>
</tbody>
</table>
<p>
<strong>
Example
</strong>
</p>
<pre tabindex="0"><code>FT.CREATE documents
ON HASH
PREFIX 1 docs:
SCHEMA doc_embedding VECTOR HNSW 10
TYPE FLOAT64
DIM 1536
DISTANCE_METRIC COSINE
M 40
EF_CONSTRUCTION 250
</code></pre>
<p>
In the example above, an index named
<code>
documents
</code>
is created over hashes with the key prefix
<code>
docs:
</code>
and an
<code>
HNSW
</code>
vector field named
<code>
doc_embedding
</code>
with five index attributes:
<code>
TYPE
</code>
,
<code>
DIM
</code>
,
<code>
DISTANCE_METRIC
</code>
,
<code>
M
</code>
, and
<code>
EF_CONSTRUCTION
</code>
.
</p>
<h3 id="distance-metrics">
Distance metrics
</h3>
<p>
Redis supports three popular distance metrics to measure the degree of similarity between two vectors
<mjx-container class="MathJax CtxtMenu_Attached_0" ctxtmenu_counter="0" jax="CHTML" style="font-size: 120%; position: relative;" tabindex="0">
<mjx-math aria-hidden="true" class="MJX-TEX">
<mjx-mi class="mjx-i">
<mjx-c class="mjx-c1D462 TEX-I">
</mjx-c>
</mjx-mi>
</mjx-math>
<mjx-assistive-mml display="inline" unselectable="on">
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mi>
u
</mi>
</math>
</mjx-assistive-mml>
</mjx-container>
,
<mjx-container class="MathJax CtxtMenu_Attached_0" ctxtmenu_counter="1" jax="CHTML" style="font-size: 120%; position: relative;" tabindex="0">
<mjx-math aria-hidden="true" class="MJX-TEX">
<mjx-mi class="mjx-i">
<mjx-c class="mjx-c1D463 TEX-I">
</mjx-c>
</mjx-mi>
</mjx-math>
<mjx-assistive-mml display="inline" unselectable="on">
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mi>
v
</mi>
</math>
</mjx-assistive-mml>
</mjx-container>
<mjx-container class="MathJax CtxtMenu_Attached_0" ctxtmenu_counter="2" jax="CHTML" style="font-size: 120%; position: relative;" tabindex="0">
<mjx-math aria-hidden="true" class="MJX-TEX">
<mjx-mo class="mjx-n">
<mjx-c class="mjx-c2208">
</mjx-c>
</mjx-mo>
<mjx-msup space="4">
<mjx-texatom texclass="ORD">
<mjx-mi class="mjx-ds mjx-b">
<mjx-c class="mjx-c211D TEX-A">
</mjx-c>
</mjx-mi>
</mjx-texatom>
<mjx-script style="vertical-align: 0.363em;">
<mjx-mi class="mjx-i" size="s">
<mjx-c class="mjx-c1D45B TEX-I">
</mjx-c>
</mjx-mi>
</mjx-script>
</mjx-msup>
</mjx-math>
<mjx-assistive-mml display="inline" unselectable="on">
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mo>
β
</mo>
<msup>
<mrow data-mjx-texclass="ORD">
<mi mathvariant="double-struck">
R
</mi>
</mrow>
<mi>
n
</mi>
</msup>
</math>
</mjx-assistive-mml>
</mjx-container>
, where
<mjx-container class="MathJax CtxtMenu_Attached_0" ctxtmenu_counter="3" jax="CHTML" style="font-size: 120%; position: relative;" tabindex="0">
<mjx-math aria-hidden="true" class="MJX-TEX">
<mjx-mi class="mjx-i">
<mjx-c class="mjx-c1D45B TEX-I">
</mjx-c>
</mjx-mi>
</mjx-math>
<mjx-assistive-mml display="inline" unselectable="on">
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mi>
n
</mi>
</math>
</mjx-assistive-mml>
</mjx-container>
is the length of the vectors:
</p>
<table>
<thead>
<tr>
<th style="text-align:left">
Distance metric
</th>
<th style="text-align:left">
Description
</th>
<th style="text-align:left">
Mathematical representation
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">
<code>
L2
</code>
</td>
<td style="text-align:left">
Euclidean distance between two vectors.
</td>
<td style="text-align:left">
<mjx-container class="MathJax CtxtMenu_Attached_0" ctxtmenu_counter="4" jax="CHTML" style="font-size: 119.9%; position: relative;" tabindex="0">
<mjx-math aria-hidden="true" class="MJX-TEX">
<mjx-mi class="mjx-i">
<mjx-c class="mjx-c1D451 TEX-I">
</mjx-c>
</mjx-mi>
<mjx-mo class="mjx-n">
<mjx-c class="mjx-c28">
</mjx-c>
</mjx-mo>
<mjx-mi class="mjx-i">
<mjx-c class="mjx-c1D462 TEX-I">
</mjx-c>
</mjx-mi>
<mjx-mo class="mjx-n">
<mjx-c class="mjx-c2C">
</mjx-c>
</mjx-mo>
<mjx-mi class="mjx-i" space="2">
<mjx-c class="mjx-c1D463 TEX-I">
</mjx-c>
</mjx-mi>
<mjx-mo class="mjx-n">
<mjx-c class="mjx-c29">
</mjx-c>
</mjx-mo>
<mjx-mo class="mjx-n" space="4">
<mjx-c class="mjx-c3D">
</mjx-c>
</mjx-mo>
<mjx-msqrt space="4">
<mjx-sqrt>
<mjx-surd>
<mjx-mo class="mjx-s4">
<mjx-c class="mjx-c221A TEX-S4">
</mjx-c>
</mjx-mo>
</mjx-surd>
<mjx-box style="padding-top: 0.103em;">
<mjx-mstyle>
<mjx-munderover>
<mjx-over style="padding-bottom: 0.192em; padding-left: 0.51em;">
<mjx-mi class="mjx-i" size="s">
<mjx-c class="mjx-c1D45B TEX-I">
</mjx-c>
</mjx-mi>
</mjx-over>
<mjx-box>
<mjx-munder>
<mjx-row>
<mjx-base>
<mjx-mo class="mjx-lop">
<mjx-c class="mjx-c2211 TEX-S2">
</mjx-c>
</mjx-mo>
</mjx-base>
</mjx-row>
<mjx-row>
<mjx-under style="padding-top: 0.167em; padding-left: 0.148em;">
<mjx-texatom size="s" texclass="ORD">
<mjx-mi class="mjx-i">
<mjx-c class="mjx-c1D456 TEX-I">
</mjx-c>
</mjx-mi>
<mjx-mo class="mjx-n">
<mjx-c class="mjx-c3D">
</mjx-c>
</mjx-mo>
<mjx-mn class="mjx-n">
<mjx-c class="mjx-c31">
</mjx-c>
</mjx-mn>
</mjx-texatom>
</mjx-under>
</mjx-row>
</mjx-munder>
</mjx-box>
</mjx-munderover>
<mjx-texatom space="2" texclass="ORD">
<mjx-mo class="mjx-n">
<mjx-c class="mjx-c28">
</mjx-c>
</mjx-mo>
<mjx-msub>
<mjx-mi class="mjx-i">
<mjx-c class="mjx-c1D462 TEX-I">
</mjx-c>
</mjx-mi>
<mjx-script style="vertical-align: -0.15em;">
<mjx-mi class="mjx-i" size="s">
<mjx-c class="mjx-c1D456 TEX-I">
</mjx-c>
</mjx-mi>
</mjx-script>
</mjx-msub>
<mjx-mo class="mjx-n" space="3">
<mjx-c class="mjx-c2212">
</mjx-c>
</mjx-mo>
<mjx-msub space="3">
<mjx-mi class="mjx-i">
<mjx-c class="mjx-c1D463 TEX-I">
</mjx-c>
</mjx-mi>
<mjx-script style="vertical-align: -0.15em;">
<mjx-mi class="mjx-i" size="s">
<mjx-c class="mjx-c1D456 TEX-I">
</mjx-c>
</mjx-mi>
</mjx-script>
</mjx-msub>
<mjx-msup>
<mjx-mo class="mjx-n">
<mjx-c class="mjx-c29">
</mjx-c>
</mjx-mo>
<mjx-script style="vertical-align: 0.413em;">
<mjx-mn class="mjx-n" size="s">
<mjx-c class="mjx-c32">
</mjx-c>
</mjx-mn>
</mjx-script>
</mjx-msup>
</mjx-texatom>
</mjx-mstyle>
</mjx-box>
</mjx-sqrt>
</mjx-msqrt>
</mjx-math>
<mjx-assistive-mml display="inline" unselectable="on">
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mi>
d
</mi>
<mo stretchy="false">
(
</mo>
<mi>
u
</mi>
<mo>
,
</mo>
<mi>
v
</mi>
<mo stretchy="false">
)
</mo>
<mo>
=
</mo>
<msqrt>
<mstyle displaystyle="true" scriptlevel="0">
<munderover>
<mo data-mjx-texclass="OP">
β
</mo>
<mrow data-mjx-texclass="ORD">
<mi>
i
</mi>
<mo>
=
</mo>
<mn>
1
</mn>
</mrow>
<mi>
n
</mi>
</munderover>
<mrow data-mjx-texclass="ORD">
<mo stretchy="false">
(
</mo>
<msub>
<mi>
u
</mi>
<mi>
i
</mi>
</msub>
<mo>
β
</mo>
<msub>
<mi>
v
</mi>
<mi>
i
</mi>
</msub>
<msup>
<mo stretchy="false">
)
</mo>
<mn>
2
</mn>
</msup>
</mrow>
</mstyle>
</msqrt>
</math>
</mjx-assistive-mml>
</mjx-container>
</td>
</tr>
<tr>
<td style="text-align:left">
<code>
IP
</code>
</td>
<td style="text-align:left">
Inner product of two vectors.
</td>
<td style="text-align:left">
<mjx-container class="MathJax CtxtMenu_Attached_0" ctxtmenu_counter="5" jax="CHTML" style="font-size: 119.9%; position: relative;" tabindex="0">
<mjx-math aria-hidden="true" class="MJX-TEX">
<mjx-mi class="mjx-i">
<mjx-c class="mjx-c1D451 TEX-I">
</mjx-c>
</mjx-mi>
<mjx-mo class="mjx-n">
<mjx-c class="mjx-c28">
</mjx-c>
</mjx-mo>
<mjx-mi class="mjx-i">
<mjx-c class="mjx-c1D462 TEX-I">
</mjx-c>
</mjx-mi>
<mjx-mo class="mjx-n">
<mjx-c class="mjx-c2C">
</mjx-c>
</mjx-mo>
<mjx-mi class="mjx-i" space="2">
<mjx-c class="mjx-c1D463 TEX-I">
</mjx-c>
</mjx-mi>
<mjx-mo class="mjx-n">
<mjx-c class="mjx-c29">
</mjx-c>
</mjx-mo>
<mjx-mo class="mjx-n" space="4">
<mjx-c class="mjx-c3D">
</mjx-c>
</mjx-mo>
<mjx-mn class="mjx-n" space="4">
<mjx-c class="mjx-c31">
</mjx-c>
</mjx-mn>
<mjx-mo class="mjx-n" space="3">
<mjx-c class="mjx-c2212">
</mjx-c>
</mjx-mo>
<mjx-mi class="mjx-i" space="3">
<mjx-c class="mjx-c1D462 TEX-I">
</mjx-c>
</mjx-mi>
<mjx-mo class="mjx-n" space="3">
<mjx-c class="mjx-c22C5">
</mjx-c>
</mjx-mo>
<mjx-mi class="mjx-i" space="3">
<mjx-c class="mjx-c1D463 TEX-I">
</mjx-c>
</mjx-mi>
</mjx-math>
<mjx-assistive-mml display="inline" unselectable="on">
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mi>
d
</mi>
<mo stretchy="false">
(
</mo>
<mi>
u
</mi>
<mo>
,
</mo>
<mi>
v
</mi>
<mo stretchy="false">
)
</mo>
<mo>
=
</mo>
<mn>
1
</mn>
<mo>
β
</mo>
<mi>
u
</mi>
<mo>
β
</mo>
<mi>
v
</mi>
</math>
</mjx-assistive-mml>
</mjx-container>
</td>
</tr>
<tr>
<td style="text-align:left">
<code>
COSINE
</code>
</td>
<td style="text-align:left">
Cosine distance of two vectors.
</td>
<td style="text-align:left">
<mjx-container class="MathJax CtxtMenu_Attached_0" ctxtmenu_counter="6" jax="CHTML" style="font-size: 119.9%; position: relative;" tabindex="0">
<mjx-math aria-hidden="true" class="MJX-TEX">
<mjx-mi class="mjx-i">
<mjx-c class="mjx-c1D451 TEX-I">
</mjx-c>
</mjx-mi>
<mjx-mo class="mjx-n">
<mjx-c class="mjx-c28">
</mjx-c>
</mjx-mo>
<mjx-mi class="mjx-i">
<mjx-c class="mjx-c1D462 TEX-I">
</mjx-c>
</mjx-mi>
<mjx-mo class="mjx-n">
<mjx-c class="mjx-c2C">
</mjx-c>
</mjx-mo>
<mjx-mi class="mjx-i" space="2">
<mjx-c class="mjx-c1D463 TEX-I">
</mjx-c>
</mjx-mi>
<mjx-mo class="mjx-n">
<mjx-c class="mjx-c29">
</mjx-c>
</mjx-mo>
<mjx-mo class="mjx-n" space="4">
<mjx-c class="mjx-c3D">
</mjx-c>
</mjx-mo>
<mjx-mn class="mjx-n" space="4">
<mjx-c class="mjx-c31">
</mjx-c>
</mjx-mn>
<mjx-mo class="mjx-n" space="3">
<mjx-c class="mjx-c2212">
</mjx-c>
</mjx-mo>
<mjx-mfrac space="3">
<mjx-frac>
<mjx-num>
<mjx-nstrut>
</mjx-nstrut>
<mjx-mrow size="s">
<mjx-mi class="mjx-i">
<mjx-c class="mjx-c1D462 TEX-I">
</mjx-c>
</mjx-mi>
<mjx-mo class="mjx-n">
<mjx-c class="mjx-c22C5">
</mjx-c>
</mjx-mo>
<mjx-mi class="mjx-i">
<mjx-c class="mjx-c1D463 TEX-I">
</mjx-c>
</mjx-mi>
</mjx-mrow>
</mjx-num>
<mjx-dbox>
<mjx-dtable>
<mjx-line>
</mjx-line>
<mjx-row>
<mjx-den>
<mjx-dstrut>
</mjx-dstrut>
<mjx-mrow size="s">
<mjx-mo class="mjx-n">
<mjx-c class="mjx-c2016">
</mjx-c>
</mjx-mo>
<mjx-mi class="mjx-i">
<mjx-c class="mjx-c1D462 TEX-I">
</mjx-c>
</mjx-mi>
<mjx-mo class="mjx-n">
<mjx-c class="mjx-c2016">
</mjx-c>
</mjx-mo>
<mjx-mo class="mjx-n">
<mjx-c class="mjx-c2016">
</mjx-c>
</mjx-mo>
<mjx-mi class="mjx-i">
<mjx-c class="mjx-c1D463 TEX-I">
</mjx-c>
</mjx-mi>
<mjx-mo class="mjx-n">
<mjx-c class="mjx-c2016">
</mjx-c>
</mjx-mo>
</mjx-mrow>
</mjx-den>
</mjx-row>
</mjx-dtable>
</mjx-dbox>
</mjx-frac>
</mjx-mfrac>
</mjx-math>
<mjx-assistive-mml display="inline" unselectable="on">
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mi>
d
</mi>
<mo stretchy="false">
(
</mo>
<mi>
u
</mi>
<mo>
,
</mo>
<mi>
v
</mi>
<mo stretchy="false">
)
</mo>
<mo>
=
</mo>
<mn>
1
</mn>
<mo>
β
</mo>
<mfrac>
<mrow>
<mi>
u
</mi>
<mo>
β
</mo>
<mi>
v
</mi>
</mrow>
<mrow>
<mo data-mjx-texclass="OPEN" fence="false" stretchy="false">
β
</mo>
<mi>
u
</mi>
<mo data-mjx-texclass="CLOSE" fence="false" stretchy="false">
β
</mo>
<mo data-mjx-texclass="OPEN" fence="false" stretchy="false">
β
</mo>
<mi>
v
</mi>
<mo data-mjx-texclass="CLOSE" fence="false" stretchy="false">
β
</mo>
</mrow>
</mfrac>
</math>
</mjx-assistive-mml>
</mjx-container>
</td>
</tr>
</tbody>
</table>
<p>
The above metrics calculate distance between two vectors, where the smaller the value is, the closer the two vectors are in the vector space.
</p>
<h2 id="store-and-update-vectors">
Store and update vectors
</h2>
<p>
On index creation, the
<code>
<storage_type>
</code>
dictates how vector and metadata are structured and loaded into Redis.
</p>
<h3 id="hash">
Hash
</h3>
<p>
Store or update vectors and any metadata in
<a href="/docs/latest/develop/data-types/hashes/">
hashes
</a>
using the
<a href="/docs/latest/commands/hset/">
<code>
HSET
</code>
</a>
command.
</p>
<p>
<strong>
Example
</strong>
</p>
<pre tabindex="0"><code>HSET docs:01 doc_embedding <vector_bytes> category sports
</code></pre>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Tip:
</div>
Hash values are stored as binary-safe strings. The value
<code>
<vector_bytes>
</code>
represents the vector's underlying memory buffer.
</div>
</div>
<p>
A common method for converting vectors to bytes uses the
<a href="https://redis-py.readthedocs.io/en/stable/examples/search_vector_similarity_examples.html">
redis-py
</a>
client library and the Python
<a href="https://numpy.org/doc/stable/reference/generated/numpy.ndarray.tobytes.html">
NumPy
</a>
library.
</p>
<p>
<strong>
Example
</strong>
</p>
<div class="highlight">
<pre class="chroma"><code class="language-py" data-lang="py"><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">redis</span> <span class="kn">import</span> <span class="n">Redis</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">redis_client</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></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Create a FLOAT32 vector</span>
</span></span><span class="line"><span class="cl"><span class="n">vector</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">([</span><span class="mf">0.34</span><span class="p">,</span> <span class="mf">0.63</span><span class="p">,</span> <span class="o">-</span><span class="mf">0.54</span><span class="p">,</span> <span class="o">-</span><span class="mf">0.69</span><span class="p">,</span> <span class="mf">0.98</span><span class="p">,</span> <span class="mf">0.61</span><span class="p">],</span> <span class="n">dtype</span><span class="o">=</span><span class="n">np</span><span class="o">.</span><span class="n">float32</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Convert vector to bytes</span>
</span></span><span class="line"><span class="cl"><span class="n">vector_bytes</span> <span class="o">=</span> <span class="n">vector</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="c1"># Use the Redis client to store the vector bytes and metadata at a specified key</span>
</span></span><span class="line"><span class="cl"><span class="n">redis_client</span><span class="o">.</span><span class="n">hset</span><span class="p">(</span><span class="s1">'docs:01'</span><span class="p">,</span> <span class="n">mapping</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"vector"</span><span class="p">:</span> <span class="n">vector_bytes</span><span class="p">,</span> <span class="s2">"category"</span><span class="p">:</span> <span class="s2">"sports"</span><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">
Tip:
</div>
The vector blob size must match the dimension and float type of the vector field specified in the index's schema; otherwise, indexing will fail.
</div>
</div>
<h3 id="json">
JSON
</h3>
<p>
You can store or update vectors and any associated metadata in
<a href="/docs/latest/develop/data-types/json/">
JSON
</a>
using the
<a href="/docs/latest/commands/json.set/">
<code>
JSON.SET
</code>
</a>
command.
</p>
<p>
To store vectors in Redis as JSON, you store the vector as a JSON array of floats. Note that this differs from vector storage in Redis hashes, which are instead stored as raw bytes.
</p>
<p>
<strong>
Example
</strong>
</p>
<pre tabindex="0"><code>JSON.SET docs:01 $ '{"doc_embedding":[0.34,0.63,-0.54,-0.69,0.98,0.61], "category": "sports"}'
</code></pre>
<p>
One of the benefits of JSON is schema flexibility. As of v2.6.1, JSON supports multi-value indexing.
This allows you to index multiple vectors under the same
<a href="/docs/latest/develop/data-types/json/path/">
JSONPath
</a>
.
</p>
<p>
Here are some examples of multi-value indexing with vectors:
</p>
<p>
<strong>
Multi-value indexing example
</strong>
</p>
<pre tabindex="0"><code>JSON.SET docs:01 $ '{"doc_embedding":[[1,2,3,4], [5,6,7,8]]}'
JSON.SET docs:01 $ '{"chunk1":{"doc_embedding":[1,2,3,4]}, "chunk2":{"doc_embedding":[5,6,7,8]}}'
</code></pre>
<p>
Additional information and examples are available in the
<a href="/docs/latest/develop/interact/search-and-query/indexing/#index-json-arrays-as-vector">
Indexing JSON documents
</a>
section.
</p>
<h2 id="search-with-vectors">
Search with vectors
</h2>
<p>
You can run vector search queries with the
<a href="/docs/latest/commands/ft.search/">
<code>
FT.SEARCH
</code>
</a>
or
<a href="/docs/latest/commands/ft.aggregate/">
<code>
FT.AGGREGATE
</code>
</a>
commands.
</p>
<p>
To issue a vector search query with
<code>
FT.SEARCH
</code>
, you must set the
<code>
DIALECT
</code>
option to >=
<code>
2
</code>
. See the
<a href="/docs/latest/develop/interact/search-and-query/advanced-concepts/dialects/">
dialects documentation
</a>
for more information.
</p>
<h3 id="knn-vector-search">
KNN vector search
</h3>
<p>
KNN vector search finds the top k nearest neighbors to a query vector. It has the following syntax:
</p>
<p>
<strong>
Syntax
</strong>
</p>
<pre tabindex="0"><code>FT.SEARCH <index_name>
<primary_filter_query>=>[KNN <top_k> @<vector_field> $<vector_blob_param> $<vector_query_params> AS <distance_field>]
PARAMS <query_params_count> [$<vector_blob_param> <vector_blob> <query_param_name> <query_param_value> ...]
SORTBY <distance_field>
DIALECT 4
</code></pre>
<p>
<strong>
Parameters
</strong>
</p>
<table>
<thead>
<tr>
<th style="text-align:left">
Parameter
</th>
<th style="text-align:left">
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">
<code>
index_name
</code>
</td>
<td style="text-align:left">
Name of the index.
</td>
</tr>
<tr>
<td style="text-align:left">
<code>
primary_filter_query
</code>
</td>
<td style="text-align:left">
<a href="/docs/latest/develop/interact/search-and-query/advanced-concepts/vectors#filters">
Filter
</a>
criteria. Use
<code>
*
</code>
when no filters are required.
</td>
</tr>
<tr>
<td style="text-align:left">
<code>
top_k
</code>
</td>
<td style="text-align:left">
Number of nearest neighbors to fetch from the index.
</td>
</tr>
<tr>
<td style="text-align:left">
<code>
vector_field
</code>
</td>
<td style="text-align:left">
Name of the vector field to search against.
</td>
</tr>
<tr>
<td style="text-align:left">
<code>
vector_blob_param
</code>
</td>
<td style="text-align:left">
The query vector, passed in as a blob of raw bytes. The blob's byte size must match the vector field's dimensions and type.
</td>
</tr>
<tr>
<td style="text-align:left">
<code>
vector_query_params
</code>
(optional)
</td>
<td style="text-align:left">
An optional section for marking one or more vector query parameters passed through the
<code>
PARAMS
</code>
section. Valid parameters should be provided as key-value pairs. See which
<a href="/docs/latest/develop/interact/search-and-query/advanced-concepts/vectors#runtime-query-params">
runtime query params
</a>
are supported for each vector index type.
</td>
</tr>
<tr>
<td style="text-align:left">
<code>
distance_field
</code>
(optional)
</td>
<td style="text-align:left">
The optional distance field name used in the response and/or for sorting. By default, the distance field name is
<code>
__<vector_field>_score
</code>
and it can be used for sorting without using
<code>
AS <distance_field>
</code>
in the query.
</td>
</tr>
<tr>
<td style="text-align:left">
<code>
vector_query_params_count
</code>
</td>
<td style="text-align:left">
The number of vector query parameters.
</td>
</tr>
<tr>
<td style="text-align:left">
<code>
vector_query_param_name
</code>
</td>
<td style="text-align:left">
The name of the vector query parameter.
</td>
</tr>
<tr>
<td style="text-align:left">
<code>
vector_query_param_value
</code>
</td>
<td style="text-align:left">
The value of the vector query parameter.
</td>
</tr>
</tbody>
</table>
<p>
<strong>
Example
</strong>
</p>
<pre tabindex="0"><code>FT.SEARCH documents "*=>[KNN 10 @doc_embedding $BLOB]" PARAMS 2 BLOB "\x12\xa9\xf5\x6c" DIALECT 4
</code></pre>
<p>
<strong>
Use query attributes
</strong>
</p>
<p>
Alternatively, as of v2.6,
<code>
<vector_query_params>
</code>
and
<code>
<distance_field>
</code>
name can be specified in runtime
<a href="/docs/latest/develop/interact/search-and-query/advanced-concepts/query_syntax/#query-attributes">
query attributes
</a>
as shown below.
</p>
<pre tabindex="0"><code>[KNN <top_k> @<vector_field> $<vector_blob_param>]=>{$yield_distance_as: <distance_field>}
</code></pre>
<h3 id="vector-range-queries">
Vector range queries
</h3>
<p>
Vector range queries allow you to filter the index using a
<code>
radius
</code>
parameter representing the semantic distance between an input query vector and indexed vector fields. This is useful in scenarios when you don't know exactly how many nearest (
<code>
top_k
</code>
) neighbors to fetch, but you do know how similar the results should be.
</p>
<p>
For example, imagine a fraud or anomaly detection scenario where you aren't sure if there are any matches in the vector index. You can issue a vector range query to quickly check if there are any records of interest in the index within the specified radius.
</p>
<p>
Vector range queries operate slightly different than KNN vector queries:
</p>
<ul>
<li>
Vector range queries can appear multiple times in a query as filter criteria.
</li>
<li>
Vector range queries can be a part of the
<code>
<primary_filter_query>
</code>
in KNN vector search.
</li>
</ul>
<p>
<strong>
Syntax
</strong>
</p>
<pre tabindex="0"><code>FT.SEARCH <index_name>
@<vector_field>:[VECTOR_RANGE (<radius> | $<radius_param>) $<vector_blob_param> $<vector_query_params>]
PARAMS <vector_query_params_count> [<vector_query_param_name> <vector_query_param_value> ...]
SORTBY <distance_field>
DIALECT 4
</code></pre>
<table>
<thead>
<tr>
<th style="text-align:left">
Parameter
</th>
<th style="text-align:left">
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">
<code>
index_name
</code>
</td>
<td style="text-align:left">
Name of the index.
</td>
</tr>
<tr>
<td style="text-align:left">
<code>
vector_field
</code>
</td>
<td style="text-align:left">
Name of the vector field in the index.
</td>
</tr>
<tr>
<td style="text-align:left">
<code>
radius
</code>
or
<code>
radius_param
</code>
</td>
<td style="text-align:left">
The maximum semantic distance allowed between the query vector and indexed vectors. You can provide the value directly in the query, passed to the
<code>
PARAMS
</code>
section, or as a query attribute.
</td>
</tr>
<tr>
<td style="text-align:left">
<code>
vector_blob_param
</code>
</td>
<td style="text-align:left">
The query vector, passed in as a blob of raw bytes. The blob's byte size must match the vector field's dimensions and type.
</td>
</tr>
<tr>
<td style="text-align:left">
<code>
vector_query_params
</code>
(optional)
</td>
<td style="text-align:left">
An optional section for marking one or more vector query parameters passed through the
<code>
PARAMS
</code>
section. Valid parameters should be provided as key-value pairs. See which
<a href="/docs/latest/develop/interact/search-and-query/advanced-concepts/vectors#runtime-query-params">
runtime query params
</a>
are supported for each vector index type.
</td>
</tr>
<tr>
<td style="text-align:left">
<code>
vector_query_params_count
</code>
</td>
<td style="text-align:left">
The number of vector query parameters.
</td>
</tr>
<tr>
<td style="text-align:left">
<code>
vector_query_param_name
</code>
</td>
<td style="text-align:left">
The name of the vector query parameter.
</td>
</tr>
<tr>
<td style="text-align:left">
<code>
vector_query_param_value
</code>
</td>
<td style="text-align:left">
The value of the vector query parameter.
</td>
</tr>
</tbody>
</table>
<p>
<strong>
Use query attributes
</strong>
</p>
<p>
A vector range query clause can be followed by a query attributes section as follows:
</p>
<pre tabindex="0"><code>@<vector_field>: [VECTOR_RANGE (<radius> | $<radius_param>) $<vector_blob_param>]=>{$<param>: (<value> |
$<value_attribute>); ... }
</code></pre>
<p>
where the relevant parameters in that case are
<code>
$yield_distance_as
</code>
and
<code>
$epsilon
</code>
. Note that there is no default distance field name in range queries.
</p>
<h3 id="filters">
Filters
</h3>
<p>
Redis supports vector searches that include filters to narrow the search space based on defined criteria. If your index contains searchable fields (for example,
<code>
TEXT
</code>
,
<code>
TAG
</code>
,
<code>
NUMERIC
</code>
,
<code>
GEO
</code>
,
<code>
GEOSHAPE
</code>
, and
<code>
VECTOR
</code>
), you can perform vector searches with filters.
</p>
<p>
<strong>
Supported filter types
</strong>
</p>
<ul>
<li>
<a href="https://redis.io/docs/develop/interact/search-and-query/query/exact-match/">
Exact match
</a>
</li>
<li>
<a href="https://redis.io/docs/develop/interact/search-and-query/query/range/">
Numeric range
</a>
</li>
<li>
<a href="https://redis.io/docs/develop/interact/search-and-query/query/full-text/">
Full-text
</a>
</li>
<li>
<a href="https://redis.io/docs/develop/interact/search-and-query/query/geo-spatial/">
Geospatial
</a>
</li>
</ul>
<p>
You can also
<a href="https://redis.io/docs/develop/interact/search-and-query/query/combined/">
combine multiple queries
</a>
as a filter.
</p>
<p>
<strong>
Syntax
</strong>
</p>
<p>
Vector search queries with filters follow this basic structure:
</p>
<pre tabindex="0"><code>FT.SEARCH <index_name> <primary_filter_query>=>[...]
</code></pre>
<p>
where
<code>
<primary_filter_query>
</code>
defines document selection and filtering.
</p>
<p>
<strong>
Example
</strong>
</p>
<pre tabindex="0"><code>FT.SEARCH documents "(@title:Sports @year:[2020 2022])=>[KNN 10 @doc_embedding $BLOB]" PARAMS 2 BLOB "\x12\xa9\xf5\x6c" DIALECT 4
</code></pre>
<h3 id="how-filtering-works">
How filtering works
</h3>
<p>
Redis uses internal algorithms to optimize the filtering computation for vector search.
The runtime algorithm is determined by heuristics that aim to minimize query latency based on several factors derived from the query and the index.
</p>
<p>
<strong>
Batches mode
</strong>
</p>
<p>
Batches mode works by paginating through small batches of nearest neighbors from the index:
</p>
<ul>
<li>
A batch of high-scoring documents from the vector index is retrieved. These documents are yielded only if the
<code>
<primary_filter_query>
</code>
is satisfied. In other words, the document must contain a similar vector and meet the filter criteria.
</li>
<li>
The iterative procedure terminates when
<code>
<top_k>
</code>
documents that pass the filter criteria are yielded, or after every vector in the index has been processed.
</li>
<li>
The batch size is determined automatically by heuristics based on
<code>
<top_k>
</code>
and the ratio between the expected number of documents in the index that pass the
<code>
<primary_filter_query>
</code>
and the vector index size.
</li>
<li>
The goal is to minimize the total number of batches required to get the
<code>
<top_k>
</code>
results while preserving the smallest batch size possible. Note that the batch size may change dynamically in each iteration based on the number of results that pass the filter in previous batches.
</li>
</ul>
<p>
<strong>
Ad-hoc brute force mode
</strong>
</p>
<ul>
<li>
The score of every vector corresponding to a document that passes the filter is computed, and the
<code>
<top_k>
</code>
results are selected and returned.
</li>
<li>
This approach is preferable when the number of documents passing the
<code>
<primary_filter_query>
</code>
is relatively small.
</li>
<li>
The results of the KNN query will always be accurate in this mode, even if the underlying vector index algorithm is an approximate one.
</li>
</ul>
<p>
The execution mode may switch from batch mode to ad-hoc brute-force mode during the run, based on updated estimations of relevant factors from one batch to another.
</p>
<h2 id="runtime-query-parameters">
Runtime query parameters
</h2>
<h3 id="filter-mode">
Filter mode
</h3>
<p>
By default, Redis selects the best filter mode to optimize query execution. You can override the auto-selected policy using these optional parameters:
</p>
<table>
<thead>
<tr>
<th style="text-align:left">
Parameter
</th>
<th style="text-align:left">
Description
</th>
<th style="text-align:left">
Options
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">
<code>
HYBRID_POLICY
</code>
</td>
<td style="text-align:left">
Specifies the filter mode to use during vector search with filters (hybrid).
</td>
<td style="text-align:left">
<code>
BATCHES
</code>
or
<code>
ADHOC_BF
</code>
</td>
</tr>
<tr>
<td style="text-align:left">
<code>
BATCH_SIZE
</code>
</td>
<td style="text-align:left">
A fixed batch size to use in every iteration when the
<code>
BATCHES
</code>
policy is auto-selected or requested.
</td>
<td style="text-align:left">
Positive integer.
</td>
</tr>
</tbody>
</table>
<h3 id="index-specific-query-parameters">
Index-specific query parameters
</h3>
<p>
<strong>
FLAT
</strong>
</p>
<p>
Currently, there are no runtime parameters available for FLAT indexes.
</p>
<p>
<strong>
HNSW
</strong>
</p>
<p>
Optional runtime parameters for HNSW indexes are:
</p>
<table>
<thead>
<tr>
<th style="text-align:left">
Parameter
</th>
<th style="text-align:left">
Description
</th>
<th style="text-align:left">
Default value
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">
<code>
EF_RUNTIME
</code>
</td>
<td style="text-align:left">
The maximum number of top candidates to hold during the KNN search. Higher values lead to more accurate results at the expense of a longer query runtime.
</td>
<td style="text-align:left">
The value passed during index creation. The default is 10.
</td>
</tr>
<tr>
<td style="text-align:left">
<code>
EPSILON
</code>
</td>
<td style="text-align:left">
The relative factor that sets the boundaries for a vector range query. Vector candidates whose distance from the query vector is
<code>
radius * (1 + EPSILON)
</code>
are potentially scanned, allowing a more extensive search and more accurate results at the expense of runtime.
</td>
<td style="text-align:left">
The value passed during index creation. The default is 0.01.
</td>
</tr>
</tbody>
</table>
<h3 id="important-notes">
Important notes
</h3>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Important notes:
</div>
<ol>
<li>
<p>
When performing a KNN vector search, you specify
<code>
<top_k>
</code>
nearest neighbors. However, the default Redis query
<code>
LIMIT
</code>
parameter (used for pagination) is 10. In order to get
<code>
<top_k>
</code>
returned results, you must also specify
<code>
LIMIT 0 <top_k>
</code>
in your search command. See examples below.
</p>
</li>
<li>
<p>
By default, the results are sorted by their document's score. To sort by vector similarity score, use
<code>
SORTBY <distance_field>
</code>
. See examples below.
</p>
</li>
<li>
<p>
Depending on your chosen distance metric, the calculated distance between vectors in an index have different bounds. For example,
<code>
Cosine
</code>
distance is bounded by
<code>
2
</code>
, while
<code>
L2
</code>
distance is not bounded. When performing a vector range query, the best practice is to adjust the
<code>
<radius>
</code>
parameter based on your use case and required recall or precision metrics.
</p>
</li>
</ol>
</div>
</div>
<h2 id="vector-search-examples">
Vector search examples
</h2>
<p>
Below are a number of examples to help you get started. For more comprehensive walkthroughs, see the
<a href="/docs/latest/develop/get-started/vector-database">
Redis vector quickstart guide
</a>
and the
<a href="https://github.com/redis-developer/redis-ai-resources">
Redis AI Resources
</a>
Github repo.
</p>
<h3 id="knn-vector-search-examples">
KNN vector search examples
</h3>
<p>
Return the 10 nearest neighbor documents for which the
<code>
doc_embedding
</code>
vector field is the closest to the query vector represented by the following 4-byte blob:
</p>
<pre tabindex="0"><code>FT.SEARCH documents "*=>[KNN 10 @doc_embedding $BLOB]" PARAMS 2 BLOB "\x12\xa9\xf5\x6c" SORTBY __vector_score DIALECT 4
</code></pre>
<p>
Return the top 10 nearest neighbors and customize the
<code>
K
</code>
and
<code>
EF_RUNTIME
</code>
parameters using query parameters. See the "Optional arguments" section in
<a href="/docs/latest/commands/ft.search">
FT.SEARCH command
</a>
. Set the
<code>
EF_RUNTIME
</code>
value to 150, assuming
<code>
doc_embedding
</code>
is an
<code>
HNSW
</code>
index:
</p>
<pre tabindex="0"><code>FT.SEARCH documents "*=>[KNN $K @doc_embedding $BLOB EF_RUNTIME $EF]" PARAMS 6 BLOB "\x12\xa9\xf5\x6c" K 10 EF 150 DIALECT 4
</code></pre>
<p>
Assign a custom name to the distance field (
<code>
vector_distance
</code>
) and then sort using that name:
</p>
<pre tabindex="0"><code>FT.SEARCH documents "*=>[KNN 10 @doc_embedding $BLOB AS vector_distance]" PARAMS 2 BLOB "\x12\xa9\xf5\x6c" SORTBY vector_distance DIALECT 4
</code></pre>
<p>
Use
<a href="/docs/latest/develop/interact/search-and-query/advanced-concepts/query_syntax#query-attributes">
query attributes
</a>
syntax to specify optional parameters and the distance field name:
</p>
<pre tabindex="0"><code>FT.SEARCH documents "*=>[KNN 10 @doc_embedding $BLOB]=>{$EF_RUNTIME: $EF; $YIELD_DISTANCE_AS: vector_distance}" PARAMS 4 EF 150 BLOB "\x12\xa9\xf5\x6c" SORTBY vector_distance DIALECT 4
</code></pre>
<p>
To explore additional Python vector search examples, review recipes for the
<a href="https://github.com/redis-developer/redis-ai-resources/blob/main/python-recipes/vector-search/00_redispy.ipynb">
<code>
Redis Python
</code>
</a>
client library and the
<a href="https://github.com/redis-developer/redis-ai-resources/blob/main/python-recipes/vector-search/01_redisvl.ipynb">
<code>
Redis Vector Library
</code>
</a>
.
</p>
<h3 id="filter-examples">
Filter examples
</h3>
<p>
For these examples, assume you created an index named
<code>
movies
</code>
with records of different movies and their metadata.
</p>
<p>
Among the movies that have
<code>
'Dune'
</code>
in the
<code>
title
</code>
field and
<code>
year
</code>
between
<code>
[2020, 2022]
</code>
, return the top 10 nearest neighbors, sorted by
<code>
movie_distance
</code>
:
</p>
<pre tabindex="0"><code>FT.SEARCH movies "(@title:Dune @year:[2020 2022])=>[KNN 10 @movie_embedding $BLOB AS movie_distance]" PARAMS 2 BLOB "\x12\xa9\xf5\x6c" SORTBY movie_distance DIALECT 4
</code></pre>
<p>
Among the movies that have
<code>
action
</code>
as a category tag, but not
<code>
drama
</code>
, return the top 10 nearest neighbors, sorted by
<code>
movie_distance
</code>
:
</p>
<pre tabindex="0"><code>FT.SEARCH movies "(@category:{action} ~@category:{drama})=>[KNN 10 @doc_embedding $BLOB AS movie_distance]" PARAMS 2 BLOB "\x12\xa9\xf5\x6c" SORTBY movie_distance DIALECT 4
</code></pre>
<p>
Among the movies that have
<code>
drama
</code>
or
<code>
action
</code>
as a category tag, return the top 10 nearest neighbors and explicitly set the filter mode (hybrid policy) to "ad-hoc brute force" rather than it being auto-selected:
</p>
<pre tabindex="0"><code>FT.SEARCH movies "(@category:{drama | action})=>[KNN 10 @doc_embedding $BLOB HYBRID_POLICY ADHOC_BF]" PARAMS 2 BLOB "\x12\xa9\xf5\x6c" SORTBY __vec_score DIALECT 4
</code></pre>
<p>
Among the movies that have
<code>
action
</code>
as a category tag, return the top 10 nearest neighbors and explicitly set the filter mode (hybrid policy) to "batches" and batch size 50 using a query parameter:
</p>
<pre tabindex="0"><code>FT.SEARCH movies "(@category:{action})=>[KNN 10 @doc_embedding $BLOB HYBRID_POLICY BATCHES BATCH_SIZE $BATCH_SIZE]" PARAMS 4 BLOB "\x12\xa9\xf5\x6c" BATCH_SIZE 50 DIALECT 4
</code></pre>
<p>
Run the same query as above and use the query attributes syntax to specify optional parameters:
</p>
<pre tabindex="0"><code>FT.SEARCH movies "(@category:{action})=>[KNN 10 @doc_embedding $BLOB]=>{$HYBRID_POLICY: BATCHES; $BATCH_SIZE: 50}" PARAMS 2 BLOB "\x12\xa9\xf5\x6c" DIALECT 4
</code></pre>
<p>
To explore additional Python vector search examples, review recipes for the
<a href="https://github.com/redis-developer/redis-ai-resources/blob/main/python-recipes/vector-search/00_redispy.ipynb">
<code>
Redis Python
</code>
</a>
client library and the
<a href="https://github.com/redis-developer/redis-ai-resources/blob/main/python-recipes/vector-search/01_redisvl.ipynb">
<code>
Redis Vector Library
</code>
</a>
.
</p>
<h3 id="range-query-examples">
Range query examples
</h3>
<p>
For these examples, assume you created an index named
<code>
products
</code>
with records of different products and metadata from an ecommerce site.
</p>
<p>
Return 100 products for which the distance between the
<code>
description_vector
</code>
field and the specified query vector blob is at most 5:
</p>
<pre tabindex="0"><code>FT.SEARCH products "@description_vector:[VECTOR_RANGE 5 $BLOB]" PARAMS 2 BLOB "\x12\xa9\xf5\x6c" LIMIT 0 100 DIALECT 4
</code></pre>
<p>
Run the same query as above and set the
<code>
EPSILON
</code>
parameter to
<code>
0.5
</code>
, assuming
<code>
description_vector
</code>
is HNSW index, yield the vector distance between
<code>
description_vector
</code>
and the query result in a field named
<code>
vector_distance
</code>
, and sort the results by that distance.
</p>
<pre tabindex="0"><code>FT.SEARCH products "@description_vector:[VECTOR_RANGE 5 $BLOB]=>{$EPSILON:0.5; $YIELD_DISTANCE_AS: vector_distance}" PARAMS 2 BLOB "\x12\xa9\xf5\x6c" SORTBY vector_distance LIMIT 0 100 DIALECT 4
</code></pre>
<p>
Use the vector range query as a filter: return all the documents that contain either
<code>
'shirt'
</code>
in their
<code>
type
</code>
tag with their
<code>
year
</code>
value in the range
<code>
[2020, 2022]
</code>
or a vector stored in
<code>
description_vector
</code>
whose distance from the query vector is no more than
<code>
0.8
</code>
, then sort the results by their vector distance, if it is in the range:
</p>
<pre tabindex="0"><code>FT.SEARCH products "(@type:{shirt} @year:[2020 2022]) | @description_vector:[VECTOR_RANGE 0.8 $BLOB]=>{$YIELD_DISTANCE_AS: vector_distance}" PARAMS 2 BLOB "\x12\xa9\xf5\x6c" SORTBY vector_distance DIALECT 4
</code></pre>
<p>
To explore additional Python vector search examples, review recipes for the
<a href="https://github.com/redis-developer/redis-ai-resources/blob/main/python-recipes/vector-search/00_redispy.ipynb">
<code>
Redis Python
</code>
</a>
client library and the
<a href="https://github.com/redis-developer/redis-ai-resources/blob/main/python-recipes/vector-search/01_redisvl.ipynb">
<code>
Redis Vector Library
</code>
</a>
.
</p>
<h2 id="next-steps">
Next steps
</h2>
<p>
Vector embeddings and vector search are not new concepts. Many of the largest companies have used
vectors to represent products in ecommerce catalogs or content in advertising pipelines for well over a decade.
</p>
<p>
With the emergence of Large Language Models (LLMs) and the proliferation of applications that require advanced information
retrieval techniques, Redis is well positioned to serve as your high performance query engine for semantic search and more.
</p>
<p>
Here are some additonal resources that apply vector search for different use cases:
</p>
<ul>
<li>
<a href="https://github.com/redis-developer/redis-ai-resources/blob/main/python-recipes/RAG/01_redisvl.ipynb">
Retrieval augmented generation from scratch
</a>
</li>
<li>
<a href="https://github.com/redis-developer/redis-ai-resources/blob/main/python-recipes/semantic-cache/semantic_caching_gemini.ipynb">
Semantic caching
</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/develop/interact/search-and-query/advanced-concepts/vectors/"/>
<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/setnx/.html | <section class="prose w-full py-12">
<h1 class="command-name">
SETNX
<span class="text-base">
(deprecated)
</span>
</h1>
<div class="border-l-8 pl-4">
<p>
As of Redis version 2.6.12, this command is regarded as deprecated.
</p>
<p>
It can be replaced by
<a href="/docs/latest/commands/set/">
<code>
SET
</code>
</a>
with the
<code>
NX
</code>
argument when migrating or writing new code.
</p>
</div>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">SETNX key value</pre>
<dl class="grid grid-cols-[auto,1fr] gap-2 mb-12">
<dt class="font-semibold text-redis-ink-900 m-0">
Available since:
</dt>
<dd class="m-0">
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>
@write
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@string
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@fast
</code>
<span class="mr-1 last:hidden">
,
</span>
</dd>
</dl>
<p>
Set
<code>
key
</code>
to hold string
<code>
value
</code>
if
<code>
key
</code>
does not exist.
In that case, it is equal to
<a href="/docs/latest/commands/set/">
<code>
SET
</code>
</a>
.
When
<code>
key
</code>
already holds a value, no operation is performed.
<code>
SETNX
</code>
is short for "
<strong>
SET
</strong>
if
<strong>
N
</strong>
ot e
<strong>
X
</strong>
ists".
</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> SETNX mykey "Hello"
(integer) 1
redis> SETNX mykey "World"
(integer) 0
redis> GET mykey
"Hello"
</pre>
<div class="prompt" style="">
<span>
redis>
</span>
<input autocomplete="off" name="prompt" spellcheck="false" type="text"/>
</div>
</form>
<h2 id="design-pattern-locking-with-setnx">
Design pattern: Locking with
<code>
SETNX
</code>
</h2>
<p>
<strong>
Please note that:
</strong>
</p>
<ol>
<li>
The following pattern is discouraged in favor of
<a href="/docs/latest/develop/use/patterns/distributed-locks/">
the Redlock algorithm
</a>
which is only a bit more complex to implement, but offers better guarantees and is fault tolerant.
</li>
<li>
We document the old pattern anyway because certain existing implementations link to this page as a reference. Moreover it is an interesting example of how Redis commands can be used in order to mount programming primitives.
</li>
<li>
Anyway even assuming a single-instance locking primitive, starting with 2.6.12 it is possible to create a much simpler locking primitive, equivalent to the one discussed here, using the
<a href="/docs/latest/commands/set/">
<code>
SET
</code>
</a>
command to acquire the lock, and a simple Lua script to release the lock. The pattern is documented in the
<a href="/docs/latest/commands/set/">
<code>
SET
</code>
</a>
command page.
</li>
</ol>
<p>
That said,
<code>
SETNX
</code>
can be used, and was historically used, as a locking primitive. For example, to acquire the lock of the key
<code>
foo
</code>
, the client could try the
following:
</p>
<pre tabindex="0"><code>SETNX lock.foo <current Unix time + lock timeout + 1>
</code></pre>
<p>
If
<code>
SETNX
</code>
returns
<code>
1
</code>
the client acquired the lock, setting the
<code>
lock.foo
</code>
key
to the Unix time at which the lock should no longer be considered valid.
The client will later use
<code>
DEL lock.foo
</code>
in order to release the lock.
</p>
<p>
If
<code>
SETNX
</code>
returns
<code>
0
</code>
the key is already locked by some other client.
We can either return to the caller if it's a non blocking lock, or enter a loop
retrying to hold the lock until we succeed or some kind of timeout expires.
</p>
<h3 id="handling-deadlocks">
Handling deadlocks
</h3>
<p>
In the above locking algorithm there is a problem: what happens if a client
fails, crashes, or is otherwise not able to release the lock?
It's possible to detect this condition because the lock key contains a UNIX
timestamp.
If such a timestamp is equal to the current Unix time the lock is no longer
valid.
</p>
<p>
When this happens we can't just call
<a href="/docs/latest/commands/del/">
<code>
DEL
</code>
</a>
against the key to remove the lock
and then try to issue a
<code>
SETNX
</code>
, as there is a race condition here, when
multiple clients detected an expired lock and are trying to release it.
</p>
<ul>
<li>
C1 and C2 read
<code>
lock.foo
</code>
to check the timestamp, because they both received
<code>
0
</code>
after executing
<code>
SETNX
</code>
, as the lock is still held by C3 that crashed
after holding the lock.
</li>
<li>
C1 sends
<code>
DEL lock.foo
</code>
</li>
<li>
C1 sends
<code>
SETNX lock.foo
</code>
and it succeeds
</li>
<li>
C2 sends
<code>
DEL lock.foo
</code>
</li>
<li>
C2 sends
<code>
SETNX lock.foo
</code>
and it succeeds
</li>
<li>
<strong>
ERROR
</strong>
: both C1 and C2 acquired the lock because of the race condition.
</li>
</ul>
<p>
Fortunately, it's possible to avoid this issue using the following algorithm.
Let's see how C4, our sane client, uses the good algorithm:
</p>
<ul>
<li>
<p>
C4 sends
<code>
SETNX lock.foo
</code>
in order to acquire the lock
</p>
</li>
<li>
<p>
The crashed client C3 still holds it, so Redis will reply with
<code>
0
</code>
to C4.
</p>
</li>
<li>
<p>
C4 sends
<code>
GET lock.foo
</code>
to check if the lock expired.
If it is not, it will sleep for some time and retry from the start.
</p>
</li>
<li>
<p>
Instead, if the lock is expired because the Unix time at
<code>
lock.foo
</code>
is older
than the current Unix time, C4 tries to perform:
</p>
<pre tabindex="0"><code>GETSET lock.foo <current Unix timestamp + lock timeout + 1>
</code></pre>
</li>
<li>
<p>
Because of the
<a href="/docs/latest/commands/getset/">
<code>
GETSET
</code>
</a>
semantic, C4 can check if the old value stored at
<code>
key
</code>
is still an expired timestamp.
If it is, the lock was acquired.
</p>
</li>
<li>
<p>
If another client, for instance C5, was faster than C4 and acquired the lock
with the
<a href="/docs/latest/commands/getset/">
<code>
GETSET
</code>
</a>
operation, the C4
<a href="/docs/latest/commands/getset/">
<code>
GETSET
</code>
</a>
operation will return a non
expired timestamp.
C4 will simply restart from the first step.
Note that even if C4 set the key a bit a few seconds in the future this is
not a problem.
</p>
</li>
</ul>
<p>
In order to make this locking algorithm more robust, a
client holding a lock should always check the timeout didn't expire before
unlocking the key with
<a href="/docs/latest/commands/del/">
<code>
DEL
</code>
</a>
because client failures can be complex, not just
crashing but also blocking a lot of time against some operations and trying
to issue
<a href="/docs/latest/commands/del/">
<code>
DEL
</code>
</a>
after a lot of time (when the LOCK is already held by another
client).
</p>
<h2 id="resp2resp3-reply">
RESP2/RESP3 Reply
</h2>
<p>
One of the following:
</p>
<ul>
<li>
<a href="../../develop/reference/protocol-spec#integers">
Integer reply
</a>
:
<code>
0
</code>
if the key was not set.
</li>
<li>
<a href="../../develop/reference/protocol-spec#integers">
Integer reply
</a>
:
<code>
1
</code>
if the key was set.
</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/setnx/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rc/databases/configuration/data-persistence/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Data persistence
</h1>
<p class="text-lg -mt-5 mb-10">
Data persistence enables recovery in the event of memory loss or other catastrophic failure. Here, you learn data persistence options, when they're available, and how to apply specific settings to individual databases.
</p>
<p>
Redis Cloud can persist data to enable recovery in the event of memory loss or other catastrophic failure. When you enable data persistence, in-memory data is copied to persistent storage attached to the underlying cloud instance.
</p>
<h2 id="persistence-options">
Persistence options
</h2>
<p>
Data can be persisted in one of two ways:
</p>
<ul>
<li>
<p>
An
<em>
Append-Only File
</em>
(AOF) maintains a record (sometimes called a
<em>
redo log
</em>
or
<em>
journal
</em>
) of write operations. This allows the data to be restored by using the record to reconstruct the database up to the point of failure.
</p>
<p>
The AOF file records write operations made to the database; it can be updated every second or on every write (
<em>
Redis Cloud Pro plans only
</em>
).
</p>
</li>
<li>
<p>
Snapshots are copies of the in-memory database, taken at periodic intervals (one, six, or twelve hours). You can restore data to the snapshot's point in time.
</p>
</li>
</ul>
<p>
AOF files provide greater protection (durability) than snapshots at the cost of resources and recovery time.
Although snapshot recovery is faster, the risk of data loss is higher, depending on the time between failure and the most recent snapshot.
</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>
If you turn off data persistence, data is lost when the database goes down.
</div>
</div>
<h2 id="configure-data-persistence">
Configure data persistence
</h2>
<p>
In Redis Cloud, data persistence is a database configuration setting that can be changed by
<a href="/docs/latest/operate/rc/databases/view-edit-database/">
editing your database
</a>
settings.
</p>
<p>
The availability of the setting depends on your plan:
</p>
<ul>
<li>
<p>
Free Redis Cloud Essentials plans do not support data persistence; the setting is disabled entirely.
</p>
</li>
<li>
<p>
Paid Redis Cloud Essentials plans support AOF every second and all snapshot options.
</p>
</li>
<li>
<p>
Redis Cloud Pro enables data persistence settings for every database.
</p>
</li>
</ul>
<p>
When enabled, you can change the
<strong>
Data persistence
</strong>
setting to one of the following values:
</p>
<table>
<thead>
<tr>
<th>
<strong>
Options
</strong>
</th>
<th>
<strong>
Description
</strong>
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
None
</td>
<td>
Data is not persisted to disk at all.
</td>
</tr>
<tr>
<td>
Append Only File (AoF) every write
</td>
<td>
<em>
(Redis Cloud Pro only)
</em>
Every write is recorded (synchronized to disk using
<code>
fsync
</code>
)
</td>
</tr>
<tr>
<td>
Append Only File (AoF) every 1 second
</td>
<td>
Record is updated every second (synchronized to disk using
<code>
fsync
</code>
)
</td>
</tr>
<tr>
<td>
Snapshot every 1 hour
</td>
<td>
A snapshot of the database is created every hour
</td>
</tr>
<tr>
<td>
Snapshot every 6 hours
</td>
<td>
A snapshot of the database is created every 6 hours
</td>
</tr>
<tr>
<td>
Snapshot every 12 hours
</td>
<td>
A snapshot of the database is created every 12 hours
</td>
</tr>
</tbody>
</table>
<p>
When you save changes to data persistence settings, the updates are applied in the background. This means there is a brief delay while the new settings are applied.
</p>
<p>
When replication is enabled for a database, persistence is performed against replicas (copies) to reduce performance impact on the primary (
<em>
master
</em>
) database.
</p>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rc/databases/configuration/data-persistence/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/7.4/security/encryption/internode-encryption/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Internode encryption
</h1>
<p class="text-lg -mt-5 mb-10">
Describes internode encryption which improves the security of data in transit.
</p>
<p>
As of v6.2.4, Redis Enterprise Software supports
<em>
internode encryption
</em>
, which encrypts internal communication between nodes. This improves the security of data as it travels within a cluster.
</p>
<p>
Internode encryption is enabled for the
<em>
control plane
</em>
, which manages the cluster and its databases.
</p>
<p>
Internode encryption is supported for the
<em>
data plane
</em>
, which encrypts communication used to replicate shards between nodes and proxy communication with shards located on different nodes.
</p>
<p>
The following diagram shows how this works.
</p>
<a href="/docs/latest/images/rs/internode-encryption.png" sdata-lightbox="/images/rs/internode-encryption.png">
<img alt="A diagram showing the interaction between data internode encryption, control plane encryption, and various elements of a cluster." src="/docs/latest/images/rs/internode-encryption.png"/>
</a>
<p>
Data internode encryption is disabled by default for individual databases in order to optimize for performance. Encryption adds latency and overhead; the impact is measurable and varies according to the database, its field types, and the details of the underlying use case.
</p>
<p>
You can enable data internode encryption for a database by changing the database configuration settings. This lets you choose when to favor performance and when to encrypt data.
</p>
<h2 id="prerequisites">
Prerequisites
</h2>
<p>
Internode encryption requires certain prerequisites.
</p>
<p>
You need to:
</p>
<ul>
<li>
<p>
Upgrade all nodes in the cluster to v6.2.4 or later.
</p>
</li>
<li>
<p>
Open port 3342 for the TLS channel used for encrypted communication.
</p>
</li>
</ul>
<h2 id="enable-data-internode-encryption">
Enable data internode encryption
</h2>
<p>
To enable internode encryption for a database (also called
<em>
data internode encryption
</em>
), you need to enable the appropriate setting for each database you wish to encrypt. To do so, you can:
</p>
<ul>
<li>
<p>
Use the Cluster Manager UI to enable the
<strong>
Internode Encryption
</strong>
setting from the database
<strong>
Security
</strong>
screen.
</p>
</li>
<li>
<p>
Use the
<code>
rladmin
</code>
command-line utility to set the
<a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/tune/#tune-db">
data_internode_encryption
</a>
setting for the database:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl">rladmin tune db <database_id> data_internode_encryption enabled
</span></span></code></pre>
</div>
</li>
<li>
<p>
Use the Redis Enterprise Software REST API to set the
<code>
data_internode_encryption
</code>
setting for the database.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-rest" data-lang="rest"><span class="line"><span class="cl">put /v1/bdbs/${database_id}<span class="err">
</span></span></span><span class="line"><span class="cl"><span class="err"></span>{ βdata_internode_encryptionβ : true }<span class="err">
</span></span></span></code></pre>
</div>
</li>
</ul>
<p>
When you change the data internode encryption setting for a database, all active remote client connections are disconnected. This restarts the internal (DMC) proxy and disconnects all client connections.
</p>
<h2 id="change-cluster-policy">
Change cluster policy
</h2>
<p>
To enable internode encryption for new databases by default, use one of the following methods:
</p>
<ul>
<li>
<p>
Cluster Manager UI
</p>
<ol>
<li>
<p>
On the
<strong>
Databases
</strong>
screen, select
<a href="/docs/latest/images/rs/buttons/button-toggle-actions-vertical.png#no-click" sdata-lightbox="/images/rs/buttons/button-toggle-actions-vertical.png#no-click">
<img alt="Toggle actions button" class="inline" src="/docs/latest/images/rs/buttons/button-toggle-actions-vertical.png#no-click" width="22px"/>
</a>
to open a list of additional actions.
</p>
</li>
<li>
<p>
Select
<strong>
Database defaults
</strong>
.
</p>
</li>
<li>
<p>
Go to
<strong>
Internode Encryption
</strong>
and click
<strong>
Change
</strong>
.
</p>
</li>
<li>
<p>
Select
<strong>
Enabled
</strong>
to enable internode encryption for new databases by default.
</p>
</li>
<li>
<p>
Click
<strong>
Change
</strong>
.
</p>
</li>
<li>
<p>
Select
<strong>
Save
</strong>
.
</p>
</li>
</ol>
</li>
<li>
<p>
<a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/tune/#tune-cluster">
rladmin tune cluster
</a>
:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin tune cluster data_internode_encryption enabled
</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">"data_internode_encryption"</span>: <span class="nb">true</span> <span class="o">}</span>
</span></span></code></pre>
</div>
</li>
</ul>
<h2 id="encryption-ciphers-and-settings">
Encryption ciphers and settings
</h2>
<p>
To encrypt internode communications, Redis Enterprise Software uses TLS 1.2 and the following cipher suites:
</p>
<ul>
<li>
ECDHE-RSA-AES256-GCM-SHA384
</li>
<li>
ECDHE-RSA-AES128-GCM-SHA256
</li>
</ul>
<p>
As of Redis Enterprise Software v7.4, internode encryption also supports TLS 1.3 with the following cipher suites:
</p>
<ul>
<li>
TLS_AES_128_GCM_SHA256
</li>
<li>
TLS_AES_256_GCM_SHA384
</li>
</ul>
<p>
The TLS layer determines which TLS version to use.
</p>
<p>
No configurable settings are exposed; internode encryption is used internally within a cluster and not exposed to any outside service.
</p>
<h2 id="certificate-authority-and-rotation">
Certificate authority and rotation
</h2>
<p>
Starting with v6.2.4, internode communication is managed, in part, by two certificates: one for the control plane and one for the data plane. These certificates are signed by a private certificate authority (CA). The CA is not exposed outside of the cluster, so it cannot be accessed by external processes or services. In addition, each cluster generates a unique CA that is not used anywhere else.
</p>
<p>
The private CA is generated when a cluster is created or upgraded to 6.2.4.
</p>
<p>
When nodes join the cluster, the cluster CA is used to generate certificates for the new node, one for each plane. Certificates signed by the private CA are not shared between clusters and they're not exposed outside the cluster.
</p>
<p>
All certificates signed by the internal CA expire after ninety (90) days and automatically rotate every thirty (30) days. Alerts also monitor certificate expiration and trigger when certificate expiration falls below 45 days. If you receive such an alert, contact support.
</p>
<p>
You can use the Redis Enterprise Software REST API to rotate certificates manually:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-rest" data-lang="rest"><span class="line"><span class="cl">POST /v1/cluster/certificates/rotate<span class="err">
</span></span></span></code></pre>
</div>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/security/encryption/internode-encryption/"/>
<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/map/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Map
</h1>
<p class="text-lg -mt-5 mb-10">
Maps records one-to-one.
</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="o"><</span><span class="n">I</span> <span class="kd">extends</span> <span class="n">java</span><span class="o">.</span><span class="na">io</span><span class="o">.</span><span class="na">Serializable</span><span class="o">></span> <span class="n">GearsBuilder</span><span class="o"><</span><span class="n">I</span><span class="o">></span> <span class="n">map</span><span class="err">β</span><span class="o">(</span>
</span></span><span class="line"><span class="cl"> <span class="n">gears</span><span class="o">.</span><span class="na">operations</span><span class="o">.</span><span class="na">MapOperation</span><span class="o"><</span><span class="n">T</span><span class="o">,</span><span class="err">β</span><span class="n">I</span><span class="o">></span> <span class="n">mapper</span><span class="o">)</span>
</span></span></code></pre>
</div>
<p>
Maps each input record in the pipe to an output record, one-to-one.
</p>
<h2 id="parameters">
Parameters
</h2>
<p>
Type parameters:
</p>
<table>
<thead>
<tr>
<th>
Name
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
I
</td>
<td>
The template type of the returned builder
</td>
</tr>
</tbody>
</table>
<p>
Function parameters:
</p>
<table>
<thead>
<tr>
<th>
Name
</th>
<th>
Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
mapper
</td>
<td>
<nobr>
MapOperation<T,βI>
</nobr>
</td>
<td>
For each input record, returns a new output record
</td>
</tr>
</tbody>
</table>
<h2 id="returns">
Returns
</h2>
<p>
Returns a GearsBuilder object with a new template type.
</p>
<h2 id="example">
Example
</h2>
<p>
Map each record to its string value:
</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">CreateGearsBuilder</span><span class="o">(</span><span class="n">reader</span><span class="o">).</span>
</span></span><span class="line"><span class="cl"> <span class="n">map</span><span class="o">(</span><span class="n">r</span><span class="o">->{</span>
</span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="n">r</span><span class="o">.</span><span class="na">getStringVal</span><span class="o">();</span>
</span></span><span class="line"><span class="cl"><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/map/"/>
<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/roles/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Roles requests
</h1>
<p class="text-lg -mt-5 mb-10">
Roles requests
</p>
<table>
<thead>
<tr>
<th>
Method
</th>
<th>
Path
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="#get-all-roles">
GET
</a>
</td>
<td>
<code>
/v1/roles
</code>
</td>
<td>
Get all roles
</td>
</tr>
<tr>
<td>
<a href="#get-role">
GET
</a>
</td>
<td>
<code>
/v1/roles/{uid}
</code>
</td>
<td>
Get a single role
</td>
</tr>
<tr>
<td>
<a href="#put-role">
PUT
</a>
</td>
<td>
<code>
/v1/roles/{uid}
</code>
</td>
<td>
Update an existing role
</td>
</tr>
<tr>
<td>
<a href="#post-role">
POST
</a>
</td>
<td>
<code>
/v1/roles
</code>
</td>
<td>
Create a new role
</td>
</tr>
<tr>
<td>
<a href="#delete-role">
DELETE
</a>
</td>
<td>
<code>
/v1/roles/{uid}
</code>
</td>
<td>
Delete a role
</td>
</tr>
</tbody>
</table>
<h2 id="get-all-roles">
Get all roles
</h2>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">GET /v1/roles
</span></span></code></pre>
</div>
<p>
Get all roles' details.
</p>
<h3 id="permissions">
Permissions
</h3>
<table>
<thead>
<tr>
<th>
Permission name
</th>
<th>
Roles
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="/docs/latest/operate/rs/7.4/references/rest-api/permissions/#view_all_roles_info">
view_all_roles_info
</a>
</td>
<td>
admin
<br/>
cluster_member
<br/>
cluster_viewer
<br/>
db_member
<br/>
db_viewer
</td>
</tr>
</tbody>
</table>
<h3 id="get-all-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 /roles
</span></span></code></pre>
</div>
<h4 id="headers">
Headers
</h4>
<table>
<thead>
<tr>
<th>
Key
</th>
<th>
Value
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
Host
</td>
<td>
cnm.cluster.fqdn
</td>
<td>
Domain name
</td>
</tr>
<tr>
<td>
Accept
</td>
<td>
application/json
</td>
<td>
Accepted media type
</td>
</tr>
</tbody>
</table>
<h3 id="get-all-response">
Response
</h3>
<p>
Returns a JSON array of
<a href="/docs/latest/operate/rs/7.4/references/rest-api/objects/role/">
role 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="mi">1</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"name"</span><span class="p">:</span> <span class="s2">"Admin"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"management"</span><span class="p">:</span> <span class="s2">"admin"</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">"name"</span><span class="p">:</span> <span class="s2">"Cluster Member"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"management"</span><span class="p">:</span> <span class="s2">"cluster_member"</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">3</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"name"</span><span class="p">:</span> <span class="s2">"Cluster Viewer"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"management"</span><span class="p">:</span> <span class="s2">"cluster_viewer"</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">4</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"name"</span><span class="p">:</span> <span class="s2">"DB Member"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"management"</span><span class="p">:</span> <span class="s2">"db_member"</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">5</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"name"</span><span class="p">:</span> <span class="s2">"DB Viewer"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"management"</span><span class="p">:</span> <span class="s2">"db_viewer"</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">6</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"name"</span><span class="p">:</span> <span class="s2">"None"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"management"</span><span class="p">:</span> <span class="s2">"none"</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">17</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"name"</span><span class="p">:</span> <span class="s2">"DBA"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"management"</span><span class="p">:</span> <span class="s2">"admin"</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="get-all-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.5.2">
501 Not Implemented
</a>
</td>
<td>
Cluster doesn't support roles yet.
</td>
</tr>
</tbody>
</table>
<h2 id="get-role">
Get role
</h2>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">GET /v1/roles/<span class="o">{</span>int: uid<span class="o">}</span>
</span></span></code></pre>
</div>
<p>
Get the details of a single role.
</p>
<h3 id="permissions-1">
Permissions
</h3>
<table>
<thead>
<tr>
<th>
Permission name
</th>
<th>
Roles
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="/docs/latest/operate/rs/7.4/references/rest-api/permissions/#view_role_info">
view_role_info
</a>
</td>
<td>
admin
<br/>
cluster_member
<br/>
cluster_viewer
<br/>
db_member
<br/>
db_viewer
</td>
</tr>
</tbody>
</table>
<h3 id="get-request">
Request
</h3>
<h4 id="example-http-request-1">
Example HTTP request
</h4>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">GET /roles/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>
</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 role's unique ID.
</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/role/">
role object
</a>
.
</p>
<h4 id="example-json-body-1">
Example JSON body
</h4>
<div class="highlight">
<pre class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"uid"</span><span class="p">:</span> <span class="mi">17</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"name"</span><span class="p">:</span> <span class="s2">"DBA"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"management"</span><span class="p">:</span> <span class="s2">"admin"</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span></code></pre>
</div>
<h4 id="get-status-codes">
Status codes
</h4>
<table>
<thead>
<tr>
<th>
Code
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1">
200 OK
</a>
</td>
<td>
Success.
</td>
</tr>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.4">
403 Forbidden
</a>
</td>
<td>
Operation is forbidden.
</td>
</tr>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5">
404 Not Found
</a>
</td>
<td>
Role does not exist.
</td>
</tr>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.2">
501 Not Implemented
</a>
</td>
<td>
Cluster doesn't support roles yet.
</td>
</tr>
</tbody>
</table>
<h2 id="put-role">
Update role
</h2>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">PUT /v1/roles/<span class="o">{</span>int: uid<span class="o">}</span>
</span></span></code></pre>
</div>
<p>
Update an existing role's details.
</p>
<h3 id="permissions-2">
Permissions
</h3>
<table>
<thead>
<tr>
<th>
Permission name
</th>
<th>
Roles
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="/docs/latest/operate/rs/7.4/references/rest-api/permissions/#update_role">
update_role
</a>
</td>
<td>
admin
</td>
</tr>
</tbody>
</table>
<h3 id="put-request">
Request
</h3>
<h4 id="example-http-request-2">
Example HTTP request
</h4>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">PUT /roles/17
</span></span></code></pre>
</div>
<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">"management"</span><span class="p">:</span> <span class="s2">"cluster_member"</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span></code></pre>
</div>
<h4 id="headers-2">
Headers
</h4>
<table>
<thead>
<tr>
<th>
Key
</th>
<th>
Value
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
Host
</td>
<td>
cnm.cluster.fqdn
</td>
<td>
Domain name
</td>
</tr>
<tr>
<td>
Accept
</td>
<td>
application/json
</td>
<td>
Accepted media type
</td>
</tr>
</tbody>
</table>
<h4 id="body">
Body
</h4>
<p>
Include a
<a href="/docs/latest/operate/rs/7.4/references/rest-api/objects/role/">
role object
</a>
with updated fields in the request body.
</p>
<h3 id="put-response">
Response
</h3>
<p>
Returns a
<a href="/docs/latest/operate/rs/7.4/references/rest-api/objects/role/">
role object
</a>
with the updated fields.
</p>
<h4 id="example-json-body-3">
Example JSON body
</h4>
<div class="highlight">
<pre class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"uid"</span><span class="p">:</span> <span class="mi">17</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"name"</span><span class="p">:</span> <span class="s2">"DBA"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"management"</span><span class="p">:</span> <span class="s2">"cluster_member"</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span></code></pre>
</div>
<h3 id="put-error-codes">
Error codes
</h3>
<p>
Possible
<code>
error_code
</code>
values:
</p>
<table>
<thead>
<tr>
<th>
Code
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
unsupported_resource
</td>
<td>
The cluster is not yet able to handle this resource type. This could happen in a partially upgraded cluster, where some of the nodes are still on a previous version.
</td>
</tr>
<tr>
<td>
name_already_exists
</td>
<td>
An object of the same type and name exists.
</td>
</tr>
<tr>
<td>
change_last_admin_role_not_allowed
</td>
<td>
At least one user with admin role should exist.
</td>
</tr>
</tbody>
</table>
<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>
Success, role is created.
</td>
</tr>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1">
400 Bad Request
</a>
</td>
<td>
Bad or missing configuration parameters.
</td>
</tr>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5">
404 Not Found
</a>
</td>
<td>
Attempting to change a non-existant role.
</td>
</tr>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.2">
501 Not Implemented
</a>
</td>
<td>
Cluster doesn't support roles yet.
</td>
</tr>
</tbody>
</table>
<h2 id="post-role">
Create role
</h2>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">POST /v1/roles
</span></span></code></pre>
</div>
<p>
Create a new role.
</p>
<h3 id="permissions-3">
Permissions
</h3>
<table>
<thead>
<tr>
<th>
Permission name
</th>
<th>
Roles
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="/docs/latest/operate/rs/7.4/references/rest-api/permissions/#create_role">
create_role
</a>
</td>
<td>
admin
</td>
</tr>
</tbody>
</table>
<h3 id="post-request">
Request
</h3>
<h4 id="example-http-request-3">
Example HTTP request
</h4>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">POST /roles
</span></span></code></pre>
</div>
<h4 id="example-json-body-4">
Example JSON body
</h4>
<div class="highlight">
<pre class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"name"</span><span class="p">:</span> <span class="s2">"DBA"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"management"</span><span class="p">:</span> <span class="s2">"admin"</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span></code></pre>
</div>
<h4 id="headers-3">
Headers
</h4>
<table>
<thead>
<tr>
<th>
Key
</th>
<th>
Value
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
Host
</td>
<td>
cnm.cluster.fqdn
</td>
<td>
Domain name
</td>
</tr>
<tr>
<td>
Accept
</td>
<td>
application/json
</td>
<td>
Accepted media type
</td>
</tr>
</tbody>
</table>
<h4 id="body-1">
Body
</h4>
<p>
Include a
<a href="/docs/latest/operate/rs/7.4/references/rest-api/objects/role/">
role object
</a>
in the request body.
</p>
<h3 id="post-response">
Response
</h3>
<p>
Returns the newly created
<a href="/docs/latest/operate/rs/7.4/references/rest-api/objects/role/">
role object
</a>
.
</p>
<h4 id="example-json-body-5">
Example JSON body
</h4>
<div class="highlight">
<pre class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"uid"</span><span class="p">:</span> <span class="mi">17</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"name"</span><span class="p">:</span> <span class="s2">"DBA"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"management"</span><span class="p">:</span> <span class="s2">"admin"</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span></code></pre>
</div>
<h3 id="post-error-codes">
Error codes
</h3>
<p>
Possible
<code>
error_code
</code>
values:
</p>
<table>
<thead>
<tr>
<th>
Code
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
unsupported_resource
</td>
<td>
The cluster is not yet able to handle this resource type. This could happen in a partially upgraded cluster, where some of the nodes are still on a previous version.
</td>
</tr>
<tr>
<td>
name_already_exists
</td>
<td>
An object of the same type and name exists
</td>
</tr>
<tr>
<td>
missing_field
</td>
<td>
A needed field is missing
</td>
</tr>
</tbody>
</table>
<h4 id="post-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>
Success, role is created.
</td>
</tr>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1">
400 Bad Request
</a>
</td>
<td>
Bad or missing configuration parameters.
</td>
</tr>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.2">
501 Not Implemented
</a>
</td>
<td>
Cluster doesn't support roles yet.
</td>
</tr>
</tbody>
</table>
<h3 id="examples">
Examples
</h3>
<h4 id="curl">
cURL
</h4>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">curl -k -u <span class="s2">"[username]:[password]"</span> -X POST <span class="se">\
</span></span></span><span class="line"><span class="cl"><span class="se"></span> -H <span class="s1">'Content-Type: application/json'</span> <span class="se">\
</span></span></span><span class="line"><span class="cl"><span class="se"></span> -d <span class="s1">'{ "name": "DBA", "management": "admin" }'</span> <span class="se">\
</span></span></span><span class="line"><span class="cl"><span class="se"></span> https://<span class="o">[</span>host<span class="o">][</span>:port<span class="o">]</span>/v1/roles
</span></span></code></pre>
</div>
<h4 id="python">
Python
</h4>
<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">requests</span>
</span></span><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></span><span class="line"><span class="cl"><span class="n">url</span> <span class="o">=</span> <span class="s2">"https://[host][:port]/v1/roles"</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">headers</span> <span class="o">=</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="s1">'Content-Type'</span><span class="p">:</span> <span class="s1">'application/json'</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">payload</span> <span class="o">=</span> <span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">({</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"name"</span><span class="p">:</span> <span class="s2">"DBA"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"management"</span><span class="p">:</span> <span class="s2">"admin"</span>
</span></span><span class="line"><span class="cl"><span class="p">})</span>
</span></span><span class="line"><span class="cl"><span class="n">auth</span><span class="o">=</span><span class="p">(</span><span class="s2">"[username]"</span><span class="p">,</span> <span class="s2">"[password]"</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">response</span> <span class="o">=</span> <span class="n">requests</span><span class="o">.</span><span class="n">request</span><span class="p">(</span><span class="s2">"POST"</span><span class="p">,</span> <span class="n">url</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="n">auth</span><span class="o">=</span><span class="n">auth</span><span class="p">,</span> <span class="n">headers</span><span class="o">=</span><span class="n">headers</span><span class="p">,</span> <span class="n">payload</span><span class="o">=</span><span class="n">payload</span><span class="p">,</span> <span class="n">verify</span><span class="o">=</span><span class="kc">False</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">response</span><span class="o">.</span><span class="n">text</span><span class="p">)</span>
</span></span></code></pre>
</div>
<h2 id="delete-role">
Delete role
</h2>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">DELETE /v1/roles/<span class="o">{</span>int: uid<span class="o">}</span>
</span></span></code></pre>
</div>
<p>
Delete a role object.
</p>
<h3 id="permissions-4">
Permissions
</h3>
<table>
<thead>
<tr>
<th>
Permission name
</th>
<th>
Roles
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="/docs/latest/operate/rs/7.4/references/rest-api/permissions/#delete_role">
delete_role
</a>
</td>
<td>
admin
</td>
</tr>
</tbody>
</table>
<h3 id="delete-request">
Request
</h3>
<h4 id="example-http-request-4">
Example HTTP request
</h4>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">DELETE /roles/1
</span></span></code></pre>
</div>
<h4 id="headers-4">
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-1">
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 role unique ID.
</td>
</tr>
</tbody>
</table>
<h3 id="delete-response">
Response
</h3>
<p>
Returns a status code to indicate role deletion success or failure.
</p>
<h4 id="delete-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>
Success, the role is deleted.
</td>
</tr>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5">
404 Not Found
</a>
</td>
<td>
Role 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>
The request is not acceptable.
</td>
</tr>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.2">
501 Not Implemented
</a>
</td>
<td>
Cluster doesn't support roles yet.
</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/roles/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/7.4/clusters/configure/license-keys/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Cluster license keys
</h1>
<p class="text-lg -mt-5 mb-10">
The cluster key (or license) enables features and capacity within Redis Enterprise Software
</p>
<p>
The cluster license key enables Redis Enterprise Software features and determines shard usage and limits.
You can add or update a cluster key at any time.
</p>
<h2 id="trial-mode">
Trial mode
</h2>
<p>
Trial mode allows all features to be enabled during the trial period.
</p>
<p>
Trial mode is limited to 30 days and 4 shards, including master and replica shards. A new Redis Enterprise Software installation starts its 30-day trial period from the day you set up the cluster on the first node.
</p>
<p>
Trial mode requires a trial license. If you do not provide a license when you create a cluster using the Cluster Manager UI or a
<a href="/docs/latest/operate/rs/7.4/references/rest-api/requests/bootstrap/#post-bootstrap">
bootstrapping REST API request
</a>
, a trial cluster license is generated by default.
</p>
<h2 id="view-cluster-license-key">
View cluster license key
</h2>
<p>
To view the cluster license key, use:
</p>
<ul>
<li>
<p>
Cluster Manager UI
</p>
<ol>
<li>
<p>
Go to
<strong>
Cluster > Configuration > General > License
</strong>
to see the cluster license details.
</p>
</li>
<li>
<p>
Select
<strong>
Change
</strong>
to view the cluster license key.
</p>
</li>
</ol>
</li>
<li>
<p>
REST API -
<a href="/docs/latest/operate/rs/7.4/references/rest-api/requests/license/#get-license">
<code>
GET /v1/license
</code>
</a>
</p>
<p>
For a list of returned fields, see the
<a href="/docs/latest/operate/rs/7.4/references/rest-api/requests/license/#get-response">
response section
</a>
.
</p>
</li>
</ul>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Note:
</div>
As of version 7.2, Redis Enterprise enforces shard limits by shard types, RAM or flash, instead of the total number of shards. The flash shards limit only appears in the UI if Auto Tiering is enabled.
</div>
</div>
<h2 id="update-cluster-license">
Update cluster license
</h2>
<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>
After you add a cluster key, you cannot remove the key to return the cluster to trial mode.
</div>
</div>
<p>
You can update the cluster license key:
</p>
<ul>
<li>
<p>
During cluster setup using the Cluster Manager UI or CLI
</p>
</li>
<li>
<p>
After cluster setup using the Cluster Manager UI:
</p>
<ol>
<li>
<p>
Go to
<strong>
Cluster > Configuration > General > License
</strong>
.
</p>
</li>
<li>
<p>
Select
<strong>
Change
</strong>
.
</p>
</li>
<li>
<p>
Upload or enter your cluster license key.
</p>
</li>
<li>
<p>
Select
<strong>
Save
</strong>
.
</p>
</li>
</ol>
</li>
</ul>
<p>
You can update an existing cluster key at any time.
Redis Enterprise checks its validity for the following:
</p>
<ul>
<li>
Cluster name
</li>
<li>
Activation and expiration dates
</li>
<li>
Shard usage and limits
</li>
<li>
Features
</li>
</ul>
<p>
If saving a new cluster key fails, the operation returns an error with the failure's cause.
In this case, the existing key stays in effect.
</p>
<h2 id="expired-cluster-license">
Expired cluster license
</h2>
<p>
When the license is expired:
</p>
<ul>
<li>
<p>
You cannot do these actions:
</p>
<ul>
<li>
<p>
Change database settings, including security and configuration options.
</p>
</li>
<li>
<p>
Add a database.
</p>
</li>
</ul>
</li>
<li>
<p>
You can do these actions:
</p>
<ul>
<li>
<p>
Sign in to the Cluster Manager UI and view settings and metrics at all resolutions for the cluster, nodes, and databases.
</p>
</li>
<li>
<p>
Change cluster settings, including the license key, security for administrators, and cluster alerts.
</p>
</li>
<li>
<p>
Fail over when a node fails and explicitly migrate shards between nodes.
</p>
</li>
<li>
<p>
Upgrade a node to a new version of Redis Enterprise Software.
</p>
</li>
</ul>
</li>
</ul>
<h2 id="monitor-cluster-license">
Monitor cluster license
</h2>
<p>
As of version 7.2, Redis Enterprise exposes the license quotas and the shards consumption metrics in the Cluster Manager UI or via the
<a href="/docs/latest/integrate/prometheus-with-redis-enterprise/">
Prometheus integration
</a>
.
</p>
<p>
The
<code>
cluster_shards_limit
</code>
metric displays the total shard limit by shard type.
</p>
<p>
Examples:
</p>
<ul>
<li>
<code>
cluster_shards_limit{cluster="mycluster.local",shard_type="ram"} 100.0
</code>
</li>
<li>
<code>
cluster_shards_limit{cluster="mycluster.local",shard_type="flash"} 50.0
</code>
</li>
</ul>
<p>
The
<code>
bdb_shards_used
</code>
metric displays the used shard count by database and shard type.
</p>
<p>
Examples:
</p>
<ul>
<li>
<code>
bdb_shards_used{bdb="2",cluster="mycluster.local",shard_type="ram"} 86.0
</code>
</li>
<li>
<code>
bdb_shards_used{bdb="3",cluster="mycluster.local",shard_type="flash"} 23.0
</code>
</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/clusters/configure/license-keys/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/kubernetes/re-clusters/expand-pvc/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Expand PersistentVolumeClaim (PVC)
</h1>
<p class="text-lg -mt-5 mb-10">
Expand your persistent volume claim by editing the REC.
</p>
<p>
This article outlines steps to increase the size of the persistent volume claim for your Redis Enterprise cluster (REC).
</p>
<p>
<a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes/#expanding-persistent-volumes-claims">
PersistentVolumeClaims (PVC)
</a>
are created by the Redis Enterprise operator and used by the RedisEnterpriseCluster (REC). PVCs are created with a specific size and
<a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes/#expanding-persistent-volumes-claims">
can be expanded
</a>
with the following steps, if the underlying
<a href="https://kubernetes.io/docs/concepts/storage/storage-classes/">
storage class
</a>
supports it.
</p>
<p>
This process involves deleting and recreating the REC StatefulSet with a larger persistent volume size. The pods owned by the StatefulSet are not restarted or affected by the deletion and recreation process, except when they are left without an owner momentarily.
</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>
Shrinking (reducing the size) of your PVC is not allowed. This process only allows you to expand (size up) your PVC.
</div>
</div>
<h2 id="prerequisites">
Prerequisites
</h2>
<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 change any other REC fields related to the StatefulSet while resizing is in progress.
</div>
</div>
<ul>
<li>
PVC expansion must be supported and enabled by the StorageClass and underlying storage driver of the REC PVCs.
<ul>
<li>
The relevant StorageClass is the one associated with the REC PVCs. The StorageClass for existing PVCs cannot be changed.
</li>
</ul>
</li>
<li>
The StorageClass must be configured with
<code>
allowVolumeExpansion: true
</code>
.
</li>
<li>
Your storage driver must support online expansion.
</li>
<li>
We highly recommend you backup your databases before beginning this PVC expansion process.
</li>
</ul>
<h2 id="expand-rec-pvc">
Expand REC PVC
</h2>
<ol>
<li>
<p>
Enable the REC persistent volume resize flag.
</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 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">persistentSpec</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">enablePersistentVolumeResize</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="w">
</span></span></span></code></pre>
</div>
</li>
<li>
<p>
Set the value of
<code>
volumeSize
</code>
to your desired size.
</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 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">persistentSpec</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">enablePersistentVolumeResize</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">volumeSize</span><span class="p">:</span><span class="w"> </span><span class="l"><new-size>Gi</span><span class="w">
</span></span></span></code></pre>
</div>
</li>
<li>
<p>
Apply the changes to the REC, replacing
<code>
<your-rec.yaml>
</code>
with the name of your REC.
</p>
</li>
</ol>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">kubectl apply -f <your-rec.yaml>
</span></span></code></pre>
</div>
<p>
After applying the REC changes, the PVCs will begin to expand to the new size.
</p>
<p>
Once all the PVCs finish the resizing process, the operator will delete and recreate the StatefulSet with the new volume size.
</p>
<h3 id="track-progress">
Track progress
</h3>
<p>
You can track the progress by monitoring the status of the REC and PersistentVolumeClaim objects.
</p>
<p>
The REC status will correspond to the status of one or more PVCs, and will reflect if the resizing is successful or failed.
</p>
<p>
While the resizing is in progress, the status will be:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">status</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">persistenceStatus</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">status</span><span class="p">:</span><span class="w"> </span><span class="l">Resizing</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">succeeded</span><span class="p">:</span><span class="w"> </span><span class="m">2</span><span class="l">/3</span><span class="w">
</span></span></span></code></pre>
</div>
<p>
When the resizing is complete, the status becomes Provisioned and the new volume size is available for use by the REC pods.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">status</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">persistenceStatus</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">status</span><span class="p">:</span><span class="w"> </span><span class="l">Provisioned</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">succeeded</span><span class="p">:</span><span class="w"> </span><span class="m">3</span><span class="l">/3</span><span class="w">
</span></span></span></code></pre>
</div>
<h3 id="troubleshooting">
Troubleshooting
</h3>
<p>
If an error occurs during this process:
</p>
<ul>
<li>
<p>
Examine the status and events of the REC and PVC objects.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">kubectl describe pvc
</span></span></code></pre>
</div>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">kubectl get events
</span></span></code></pre>
</div>
</li>
<li>
<p>
Examine the logs of the operator pods.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">kubectl logs <operator_pod_name>
</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/kubernetes/re-clusters/expand-pvc/"/>
<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/latency-reset/.html | <section class="prose w-full py-12">
<h1 class="command-name">
LATENCY RESET
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">LATENCY RESET [event [event ...]]</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.8.13
</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>
LATENCY RESET
</code>
command resets the latency spikes time series of all, or only some, events.
</p>
<p>
When the command is called without arguments, it resets all the
events, discarding the currently logged latency spike events, and resetting
the maximum event time register.
</p>
<p>
It is possible to reset only specific events by providing the
<code>
event
</code>
names
as arguments.
</p>
<p>
Valid values for
<code>
event
</code>
are:
</p>
<ul>
<li>
<code>
active-defrag-cycle
</code>
</li>
<li>
<code>
aof-fsync-always
</code>
</li>
<li>
<code>
aof-stat
</code>
</li>
<li>
<code>
aof-rewrite-diff-write
</code>
</li>
<li>
<code>
aof-rename
</code>
</li>
<li>
<code>
aof-write
</code>
</li>
<li>
<code>
aof-write-active-child
</code>
</li>
<li>
<code>
aof-write-alone
</code>
</li>
<li>
<code>
aof-write-pending-fsync
</code>
</li>
<li>
<code>
command
</code>
</li>
<li>
<code>
expire-cycle
</code>
</li>
<li>
<code>
eviction-cycle
</code>
</li>
<li>
<code>
eviction-del
</code>
</li>
<li>
<code>
fast-command
</code>
</li>
<li>
<code>
fork
</code>
</li>
<li>
<code>
rdb-unlink-temp-file
</code>
</li>
</ul>
<p>
For more information refer to the
<a href="/operate/oss_and_stack/management/optimization/latency-monitor.md">
Latency Monitoring Framework page
</a>
.
</p>
<h2 id="resp2resp3-reply">
RESP2/RESP3 Reply
</h2>
<a href="../../develop/reference/protocol-spec#integers">
Integer reply
</a>
: the number of event time series that were reset.
<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/latency-reset/"/>
<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/bdb_group/.html | <section class="prose w-full py-12 max-w-none">
<h1>
BDB group object
</h1>
<p class="text-lg -mt-5 mb-10">
An object that represents a group of databases with a shared memory pool
</p>
<p>
An API object that represents a group of databases that share a memory pool.
</p>
<table>
<thead>
<tr>
<th>
Name
</th>
<th>
Type/Value
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
uid
</td>
<td>
integer
</td>
<td>
Cluster unique ID of the database group
</td>
</tr>
<tr>
<td>
members
</td>
<td>
array of strings
</td>
<td>
A list of UIDs of member databases (read-only)
</td>
</tr>
<tr>
<td>
memory_size
</td>
<td>
integer
</td>
<td>
The common memory pool size limit for all databases in the group, expressed in bytes
</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/bdb_group/"/>
<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/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Lettuce guide (Java)
</h1>
<p class="text-lg -mt-5 mb-10">
Connect your Lettuce application to a Redis database
</p>
<p>
<a href="https://github.com/redis/lettuce/tree/main/src/main">
Lettuce
</a>
is an advanced Java client for Redis
that supports synchronous, asynchronous, and reactive connections.
If you only need synchronous connections then you may find the other Java client
<a href="/docs/latest/develop/clients/jedis/">
Jedis
</a>
easier to use.
</p>
<p>
The sections below explain how to install
<code>
Lettuce
</code>
and connect your application
to a Redis database.
</p>
<p>
<code>
Lettuce
</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>
<h2 id="install">
Install
</h2>
<p>
To include Lettuce as a dependency in your application, edit the appropriate dependency file as shown below.
</p>
<p>
If you use Maven, add the following dependency to your
<code>
pom.xml
</code>
:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-xml" data-lang="xml"><span class="line"><span class="cl"><span class="nt"><dependency></span>
</span></span><span class="line"><span class="cl"> <span class="nt"><groupId></span>io.lettuce<span class="nt"></groupId></span>
</span></span><span class="line"><span class="cl"> <span class="nt"><artifactId></span>lettuce-core<span class="nt"></artifactId></span>
</span></span><span class="line"><span class="cl"> <span class="nt"><version></span>6.3.2.RELEASE<span class="nt"></version></span> <span class="c"><!-- Check for the latest version on Maven Central --></span>
</span></span><span class="line"><span class="cl"><span class="nt"></dependency></span>
</span></span></code></pre>
</div>
<p>
If you use Gradle, include this line in your
<code>
build.gradle
</code>
file:
</p>
<pre tabindex="0"><code>dependencies {
compileOnly 'io.lettuce:lettuce-core:6.3.2.RELEASE'
}
</code></pre>
<p>
If you wish to use the JAR files directly, download the latest Lettuce and, optionally, Apache Commons Pool2 JAR files from Maven Central or any other Maven repository.
</p>
<p>
To build from source, see the instructions on the
<a href="https://github.com/lettuce-io/lettuce-core">
Lettuce source code GitHub repo
</a>
.
</p>
<h2 id="connect-and-test">
Connect and test
</h2>
<p>
Connect to a local server using the following code. This example
also stores and retrieves a simple string value to test the connection.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-java" data-lang="java"><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">io.lettuce.core.*</span><span class="o">;</span>
</span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">io.lettuce.core.api.StatefulRedisConnection</span><span class="o">;</span>
</span></span><span class="line"><span class="cl"><span class="kn">import</span> <span class="nn">io.lettuce.core.api.sync.RedisCommands</span><span class="o">;</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="kd">public</span> <span class="kd">class</span> <span class="nc">ConnectBasicTest</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="kt">void</span> <span class="nf">connectBasic</span><span class="o">()</span> <span class="o">{</span>
</span></span><span class="line"><span class="cl"> <span class="n">RedisURI</span> <span class="n">uri</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 class="mi">6379</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">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">uri</span><span class="o">);</span>
</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">RedisCommands</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">commands</span> <span class="o">=</span> <span class="n">connection</span><span class="o">.</span><span class="na">sync</span><span class="o">();</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="n">commands</span><span class="o">.</span><span class="na">set</span><span class="o">(</span><span class="s">"foo"</span><span class="o">,</span> <span class="s">"bar"</span><span class="o">);</span>
</span></span><span class="line"><span class="cl"> <span class="n">String</span> <span class="n">result</span> <span class="o">=</span> <span class="n">commands</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="s">"foo"</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">result</span><span class="o">);</span> <span class="c1">// >>> bar
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl"> <span class="n">connection</span><span class="o">.</span><span class="na">close</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">shutdown</span><span class="o">();</span>
</span></span><span class="line"><span class="cl"> <span class="o">}</span>
</span></span><span class="line"><span class="cl"><span class="o">}</span>
</span></span></code></pre>
</div>
<h2 id="more-information">
More information
</h2>
<p>
The
<a href="https://redis.github.io/lettuce/">
Lettuce reference guide
</a>
has more examples
and an API reference. You may also be interested in the
<a href="https://projectreactor.io/">
Project Reactor
</a>
library that Lettuce uses.
</p>
<p>
See also the other pages in this section for more information and examples:
</p>
<nav>
<a href="/docs/latest/develop/clients/lettuce/connect/">
Connect to the server
</a>
<p>
Connect your .NET application to a Redis database
</p>
<a href="/docs/latest/develop/clients/lettuce/produsage/">
Production usage
</a>
<p>
Get your Lettuce app ready for production
</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/lettuce/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/develop/data-types/json/developer/.html | <section class="prose w-full py-12">
<h1>
Developer notes
</h1>
<p class="text-lg -mt-5 mb-10">
Notes on JSON debugging, testing and documentation.
</p>
<p>
Developing Redis JSON involves setting up the development environment (which can be either Linux-based or macOS-based), building RedisJSON (the Redis module providing JSON), running tests and benchmarks, and debugging both the JSON module and its tests.
</p>
<h2 id="cloning-the-git-repository">
Cloning the git repository
</h2>
<p>
To clone the RedisJSON module and its submodules, run:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">git clone --recursive https://github.com/RedisJSON/RedisJSON.git
</span></span></code></pre>
</div>
<h2 id="working-in-an-isolated-environment">
Working in an isolated environment
</h2>
<p>
There are several reasons to use an isolated environment for development, like keeping your workstation clean and developing for a different Linux distribution.
</p>
<p>
You can use a virtual machine as an isolated development environment. To set one up, you can use
<a href="https://www.vagrantup.com">
Vagrant
</a>
or Docker.
</p>
<p>
To set up a virtual machine with Docker:
</p>
<pre tabindex="0"><code>rejson=$(docker run -d -it -v $PWD:/build debian:bullseye bash)
docker exec -it $rejson bash
</code></pre>
<p>
Then run
<code>
cd /build
</code>
from within the container.
</p>
<p>
In this mode, all installations remain in the scope of the Docker container.
After you exit the container, you can either restart it with the previous
<code>
docker exec
</code>
command or save the state of the container to an image and resume it at a later time:
</p>
<pre tabindex="0"><code>docker commit $rejson redisjson1
docker stop $rejson
rejson=$(docker run -d -it -v $PWD:/build redisjson1 bash)
docker exec -it $rejson bash
</code></pre>
<p>
You can replace
<code>
debian:bullseye
</code>
with your OS of choice. If you use the same OS as your host machine, you can run the RedisJSON binary on your host after it is built.
</p>
<h2 id="installing-prerequisites">
Installing prerequisites
</h2>
<p>
To build and test RedisJSON one needs to install several packages, depending on the underlying OS. Currently, we support the Ubuntu/Debian, CentOS, Fedora, and macOS.
</p>
<p>
Enter the
<code>
RedisJSON
</code>
directory and run:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ ./sbin/setup
</span></span></code></pre>
</div>
<p>
<strong>
This will install various packages on your system
</strong>
using the native package manager and pip. It will invoke
<code>
sudo
</code>
on its own, prompting for permission.
</p>
<p>
If you prefer to avoid that, you can:
</p>
<ul>
<li>
Review
<code>
system-setup.py
</code>
and install packages manually,
</li>
<li>
Use
<code>
system-setup.py --nop
</code>
to display installation commands without executing them,
</li>
<li>
Use an isolated environment like explained above,
</li>
<li>
Use a Python virtual environment, as Python installations are known to be sensitive when not used in isolation:
<code>
python -m virtualenv venv; . ./venv/bin/activate
</code>
</li>
</ul>
<h2 id="installing-redis">
Installing Redis
</h2>
<p>
Generally, it is best to run the latest Redis version.
</p>
<p>
If your OS has a Redis 6.x package, you can install it using the OS package manager.
</p>
<p>
Otherwise, you can invoke
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ ./deps/readies/bin/getredis
</span></span></code></pre>
</div>
<h2 id="getting-help">
Getting help
</h2>
<p>
<code>
make help
</code>
provides a quick summary of the development features:
</p>
<pre tabindex="0"><code>make setup # install prerequisites
make build
DEBUG=1 # build debug variant
SAN=type # build with LLVM sanitizer (type=address|memory|leak|thread)
VALGRIND|VG=1 # build for testing with Valgrind
make clean # remove binary files
ALL=1 # remove binary directories
make all # build all libraries and packages
make test # run both cargo and python tests
make cargo_test # run inbuilt rust unit tests
make pytest # run flow tests using RLTest
TEST=file:name # run test matching `name` from `file`
TEST_ARGS="..." # RLTest arguments
QUICK=1 # run only general tests
GEN=1 # run general tests on a standalone Redis topology
AOF=1 # run AOF persistency tests on a standalone Redis topology
SLAVES=1 # run replication tests on standalone Redis topology
CLUSTER=1 # run general tests on a Redis Community Edition Cluster topology
VALGRIND|VG=1 # run specified tests with Valgrind
VERBOSE=1 # display more RLTest-related information
make pack # build package (RAMP file)
make upload-artifacts # copy snapshot packages to S3
OSNICK=nick # copy snapshots for specific OSNICK
make upload-release # copy release packages to S3
common options for upload operations:
STAGING=1 # copy to staging lab area (for validation)
FORCE=1 # allow operation outside CI environment
VERBOSE=1 # show more details
NOP=1 # do not copy, just print commands
make coverage # perform coverage analysis
make show-cov # show coverage analysis results (implies COV=1)
make upload-cov # upload coverage analysis results to codecov.io (implies COV=1)
make docker # build for specific Linux distribution
OSNICK=nick # Linux distribution to build for
REDIS_VER=ver # use Redis version `ver`
TEST=1 # test after build
PACK=1 # create packages
ARTIFACTS=1 # copy artifacts from docker image
PUBLISH=1 # publish (i.e. docker push) after build
make sanbox # create container for CLang Sanitizer tests
</code></pre>
<h2 id="building-from-source">
Building from source
</h2>
<p>
Run
<code>
make build
</code>
to build RedisJSON.
</p>
<p>
Notes:
</p>
<ul>
<li>
<p>
Binary files are placed under
<code>
target/release/
</code>
, according to platform and build variant.
</p>
</li>
<li>
<p>
RedisJSON uses
<a href="https://github.com/rust-lang/cargo">
Cargo
</a>
as its build system.
<code>
make build
</code>
will invoke both Cargo and the subsequent
<code>
make
</code>
command that's required to complete the build.
</p>
</li>
</ul>
<p>
Use
<code>
make clean
</code>
to remove built artifacts.
<code>
make clean ALL=1
</code>
will remove the entire bin subdirectory.
</p>
<h2 id="running-tests">
Running tests
</h2>
<p>
There are several sets of unit tests:
</p>
<ul>
<li>
Rust tests, integrated in the source code, run by
<code>
make cargo_test
</code>
.
</li>
<li>
Python tests (enabled by RLTest), located in
<code>
tests/pytests
</code>
, run by
<code>
make pytest
</code>
.
</li>
</ul>
<p>
You can run all tests with
<code>
make test
</code>
.
To run only specific tests, use the
<code>
TEST
</code>
parameter. For example, run
<code>
make test TEST=regex
</code>
.
</p>
<p>
You can run the module's tests against an "embedded" disposable Redis instance or against an instance
you provide. To use the "embedded" mode, you must include the
<code>
redis-server
</code>
executable in your
<code>
PATH
</code>
.
</p>
<p>
You can override the spawning of the embedded server by specifying a Redis port via the
<code>
REDIS_PORT
</code>
environment variable, e.g.:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ <span class="c1"># use an existing local Redis instance for testing the module</span>
</span></span><span class="line"><span class="cl">$ <span class="nv">REDIS_PORT</span><span class="o">=</span><span class="m">6379</span> make <span class="nb">test</span>
</span></span></code></pre>
</div>
<h2 id="debugging">
Debugging
</h2>
<p>
To include debugging information, you need to set the
<a href="/docs/latest/commands/debug/">
<code>
DEBUG
</code>
</a>
environment variable before you compile RedisJSON. For example, run
<code>
export DEBUG=1
</code>
.
</p>
<p>
You can add breakpoints to Python tests in single-test mode. To set a breakpoint, call the
<code>
BB()
</code>
function inside a test.
</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/data-types/json/developer/"/>
<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/actions/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Shard actions requests
</h1>
<p class="text-lg -mt-5 mb-10">
REST API requests to perform shard actions
</p>
<h2 id="migrate">
Migrate
</h2>
<table>
<thead>
<tr>
<th>
Method
</th>
<th>
Path
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="/docs/latest/operate/rs/7.4/references/rest-api/requests/shards/actions/migrate/#post-multi-shards">
POST
</a>
</td>
<td>
<code>
/v1/shards/actions/migrate
</code>
</td>
<td>
Migrate multiple shards
</td>
</tr>
<tr>
<td>
<a href="/docs/latest/operate/rs/7.4/references/rest-api/requests/shards/actions/migrate/#post-shard">
POST
</a>
</td>
<td>
<code>
/v1/shards/{uid}/actions/migrate
</code>
</td>
<td>
Migrate a specific shard
</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/actions/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/7.4/clusters/logging/log-security/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Manage logs
</h1>
<p>
Redis Enterprise comes with
<a href="/docs/latest/operate/rs/7.4/clusters/logging/">
a set of logs
</a>
on the server and available through the user interface to assist users in investigating actions taken on the server and to troubleshoot issues.
</p>
<h2 id="send-logs-to-a-remote-logging-server">
Send logs to a remote logging server
</h2>
<p>
Redis Enterprise sends logs to syslog by default. You can send these logs to a remote logging server by configuring syslog.
</p>
<p>
To do this, modify the syslog or rsyslog configuration on your operating system to send logs in the
<code>
$logdir
</code>
directory (
<code>
/var/opt/redislabs/log
</code>
in default installations) to a remote monitoring server of your choice. See
<a href="/docs/latest/operate/rs/7.4/clusters/logging/rsyslog-logging/">
rsyslog logging
</a>
for additional details.
</p>
<h2 id="log-rotation">
Log rotation
</h2>
<p>
Redis Enterprise Software's job scheduler runs
<code>
logrotate
</code>
every five minutes to examine logs stored on the operating system and rotate them based on the log rotation configuration. You can find the log rotation configuration file at
<code>
$pkgconfdir/logrotate.conf
</code>
as of Redis Enterprise Software version 7.2 (
<code>
pkgconfdir
</code>
is
<code>
/opt/redislabs/config
</code>
by default, but can be changed in a custom installation).
</p>
<p>
By default, log rotation occurs when a log exceeds 200 MB. We recommend sending log files to a remote logging server so you can maintain them more effectively.
</p>
<p>
The following log rotation policy is enabled by default in Redis Enterprise Software, but you can modify it as needed.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">/var/opt/redislabs/log/*.log <span class="o">{</span>
</span></span><span class="line"><span class="cl"> su <span class="si">${</span><span class="nv">osuser</span><span class="si">}</span> <span class="si">${</span><span class="nv">osgroup</span><span class="si">}</span>
</span></span><span class="line"><span class="cl"> size 200M
</span></span><span class="line"><span class="cl"> missingok
</span></span><span class="line"><span class="cl"> copytruncate
</span></span><span class="line"><span class="cl"> <span class="c1"># 2000 is logrotate's way of saying 'infinite'</span>
</span></span><span class="line"><span class="cl"> rotate <span class="m">2000</span>
</span></span><span class="line"><span class="cl"> maxage <span class="m">7</span>
</span></span><span class="line"><span class="cl"> compress
</span></span><span class="line"><span class="cl"> notifempty
</span></span><span class="line"><span class="cl"> nodateext
</span></span><span class="line"><span class="cl"> nosharedscripts
</span></span><span class="line"><span class="cl"> prerotate
</span></span><span class="line"><span class="cl"> <span class="c1"># copy cluster_wd log to another file that will have longer retention</span>
</span></span><span class="line"><span class="cl"> <span class="k">if</span> <span class="o">[</span> <span class="s2">"\$1"</span> <span class="o">=</span> <span class="s2">"/var/opt/redislabs/log/cluster_wd.log"</span> <span class="o">]</span><span class="p">;</span> <span class="k">then</span>
</span></span><span class="line"><span class="cl"> cp -p /var/opt/redislabs/log/cluster_wd.log /var/opt/redislabs/log/cluster_wd.log.long_retention
</span></span><span class="line"><span class="cl"> <span class="k">fi</span>
</span></span><span class="line"><span class="cl"> endscript
</span></span><span class="line"><span class="cl"><span class="o">}</span>
</span></span><span class="line"><span class="cl">/var/opt/redislabs/log/cluster_wd.log.long_retention <span class="o">{</span>
</span></span><span class="line"><span class="cl"> su <span class="si">${</span><span class="nv">osuser</span><span class="si">}</span> <span class="si">${</span><span class="nv">osgroup</span><span class="si">}</span>
</span></span><span class="line"><span class="cl"> daily
</span></span><span class="line"><span class="cl"> missingok
</span></span><span class="line"><span class="cl"> copytruncate
</span></span><span class="line"><span class="cl"> rotate <span class="m">30</span>
</span></span><span class="line"><span class="cl"> compress
</span></span><span class="line"><span class="cl"> notifempty
</span></span><span class="line"><span class="cl"> nodateext
</span></span><span class="line"><span class="cl"><span class="o">}</span>
</span></span></code></pre>
</div>
<ul>
<li>
<p>
<code>
/var/opt/redislabs/log/*.log
</code>
-
<code>
logrotate
</code>
checks the files under the
<code>
$logdir
</code>
directory (
<code>
/var/opt/redislabs/log/
</code>
) and rotates any files that end with the extension
<code>
.log
</code>
.
</p>
</li>
<li>
<p>
<code>
/var/opt/redislabs/log/cluster_wd.log.long_retention
</code>
- The contents of
<code>
cluster_wd.log
</code>
is copied to
<code>
cluster_wd.log.long_retention
</code>
before rotation, and this copy is kept for longer than normal (30 days).
</p>
</li>
<li>
<p>
<code>
size 200M
</code>
- Rotate log files that exceed 200 MB.
</p>
</li>
<li>
<p>
<code>
missingok
</code>
- If there are missing log files, do nothing.
</p>
</li>
<li>
<p>
<code>
copytruncate
</code>
- Truncate the original log file to zero sizes after creating a copy.
</p>
</li>
<li>
<p>
<code>
rotate 2000
</code>
- Keep up to 2000 (effectively infinite) log files.
</p>
</li>
<li>
<p>
<code>
compress
</code>
- gzip log files.
</p>
</li>
<li>
<p>
<code>
maxage 7
</code>
- Keep the rotated log files for 7 days.
</p>
</li>
<li>
<p>
<code>
notifempty
</code>
- Don't rotate the log file if it is empty.
</p>
</li>
</ul>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Note:
</div>
For large scale deployments, you might need to rotate logs at faster intervals than daily. You can also use a cronjob or external vendor solutions.
</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/clusters/logging/log-security/"/>
<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/internals/internals-rediseventlib/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Event library
</h1>
<p class="text-lg -mt-5 mb-10">
What's an event library, and how was the original Redis event library implemented?
</p>
<p>
<strong>
Note: this document was written by the creator of Redis, Salvatore Sanfilippo, early in the development of Redis (c. 2010), and does not necessarily reflect the latest Redis implementation.
</strong>
</p>
<h2 id="why-is-an-event-library-needed-at-all">
Why is an Event Library needed at all?
</h2>
<p>
Let us figure it out through a series of Q&As.
</p>
<p>
Q: What do you expect a network server to be doing all the time?
<br/>
A: Watch for inbound connections on the port its listening and accept them.
</p>
<p>
Q: Calling
<a href="http://man.cx/accept%282%29">
accept
</a>
yields a descriptor. What do I do with it?
<br/>
A: Save the descriptor and do a non-blocking read/write operation on it.
</p>
<p>
Q: Why does the read/write have to be non-blocking?
<br/>
A: If the file operation ( even a socket in Unix is a file ) is blocking how could the server for example accept other connection requests when its blocked in a file I/O operation.
</p>
<p>
Q: I guess I have to do many such non-blocking operations on the socket to see when it's ready. Am I right?
<br/>
A: Yes. That is what an event library does for you. Now you get it.
</p>
<p>
Q: How do Event Libraries do what they do?
<br/>
A: They use the operating system's polling facility along with timers.
</p>
<p>
Q: So are there any open source event libraries that do what you just described?
<br/>
A: Yes.
<code>
libevent
</code>
and
<code>
libev
</code>
are two such event libraries that I can recall off the top of my head.
</p>
<p>
Q: Does Redis use such open source event libraries for handling socket I/O?
<br/>
A: No. For various
<a href="http://groups.google.com/group/redis-db/browse_thread/thread/b52814e9ef15b8d0/">
reasons
</a>
Redis uses its own event library.
</p>
<h2 id="the-redis-event-library">
The Redis event library
</h2>
<p>
Redis implements its own event library. The event library is implemented in
<code>
ae.c
</code>
.
</p>
<p>
The best way to understand how the Redis event library works is to understand how Redis uses it.
</p>
<h2 id="event-loop-initialization">
Event Loop Initialization
</h2>
<p>
<code>
initServer
</code>
function defined in
<code>
redis.c
</code>
initializes the numerous fields of the
<code>
redisServer
</code>
structure variable. One such field is the Redis event loop
<code>
el
</code>
:
</p>
<pre><code>aeEventLoop *el
</code></pre>
<p>
<code>
initServer
</code>
initializes
<code>
server.el
</code>
field by calling
<code>
aeCreateEventLoop
</code>
defined in
<code>
ae.c
</code>
. The definition of
<code>
aeEventLoop
</code>
is below:
</p>
<pre><code>typedef struct aeEventLoop
{
int maxfd;
long long timeEventNextId;
aeFileEvent events[AE_SETSIZE]; /* Registered events */
aeFiredEvent fired[AE_SETSIZE]; /* Fired events */
aeTimeEvent *timeEventHead;
int stop;
void *apidata; /* This is used for polling API specific data */
aeBeforeSleepProc *beforesleep;
} aeEventLoop;
</code></pre>
<h2 id="aecreateeventloop">
<code>
aeCreateEventLoop
</code>
</h2>
<p>
<code>
aeCreateEventLoop
</code>
first
<code>
malloc
</code>
s
<code>
aeEventLoop
</code>
structure then calls
<code>
ae_epoll.c:aeApiCreate
</code>
.
</p>
<p>
<code>
aeApiCreate
</code>
<code>
malloc
</code>
s
<code>
aeApiState
</code>
that has two fields -
<code>
epfd
</code>
that holds the
<code>
epoll
</code>
file descriptor returned by a call from
<a href="http://man.cx/epoll_create%282%29">
<code>
epoll_create
</code>
</a>
and
<code>
events
</code>
that is of type
<code>
struct epoll_event
</code>
define by the Linux
<code>
epoll
</code>
library. The use of the
<code>
events
</code>
field will be described later.
</p>
<p>
Next is
<code>
ae.c:aeCreateTimeEvent
</code>
. But before that
<code>
initServer
</code>
call
<code>
anet.c:anetTcpServer
</code>
that creates and returns a
<em>
listening descriptor
</em>
. The descriptor listens on
<em>
port 6379
</em>
by default. The returned
<em>
listening descriptor
</em>
is stored in
<code>
server.fd
</code>
field.
</p>
<h2 id="aecreatetimeevent">
<code>
aeCreateTimeEvent
</code>
</h2>
<p>
<code>
aeCreateTimeEvent
</code>
accepts the following as parameters:
</p>
<ul>
<li>
<code>
eventLoop
</code>
: This is
<code>
server.el
</code>
in
<code>
redis.c
</code>
</li>
<li>
milliseconds: The number of milliseconds from the current time after which the timer expires.
</li>
<li>
<code>
proc
</code>
: Function pointer. Stores the address of the function that has to be called after the timer expires.
</li>
<li>
<code>
clientData
</code>
: Mostly
<code>
NULL
</code>
.
</li>
<li>
<code>
finalizerProc
</code>
: Pointer to the function that has to be called before the timed event is removed from the list of timed events.
</li>
</ul>
<p>
<code>
initServer
</code>
calls
<code>
aeCreateTimeEvent
</code>
to add a timed event to
<code>
timeEventHead
</code>
field of
<code>
server.el
</code>
.
<code>
timeEventHead
</code>
is a pointer to a list of such timed events. The call to
<code>
aeCreateTimeEvent
</code>
from
<code>
redis.c:initServer
</code>
function is given below:
</p>
<pre><code>aeCreateTimeEvent(server.el /*eventLoop*/, 1 /*milliseconds*/, serverCron /*proc*/, NULL /*clientData*/, NULL /*finalizerProc*/);
</code></pre>
<p>
<code>
redis.c:serverCron
</code>
performs many operations that helps keep Redis running properly.
</p>
<h2 id="aecreatefileevent">
<code>
aeCreateFileEvent
</code>
</h2>
<p>
The essence of
<code>
aeCreateFileEvent
</code>
function is to execute
<a href="http://man.cx/epoll_ctl">
<code>
epoll_ctl
</code>
</a>
system call which adds a watch for
<code>
EPOLLIN
</code>
event on the
<em>
listening descriptor
</em>
create by
<code>
anetTcpServer
</code>
and associate it with the
<code>
epoll
</code>
descriptor created by a call to
<code>
aeCreateEventLoop
</code>
.
</p>
<p>
Following is an explanation of what precisely
<code>
aeCreateFileEvent
</code>
does when called from
<code>
redis.c:initServer
</code>
.
</p>
<p>
<code>
initServer
</code>
passes the following arguments to
<code>
aeCreateFileEvent
</code>
:
</p>
<ul>
<li>
<code>
server.el
</code>
: The event loop created by
<code>
aeCreateEventLoop
</code>
. The
<code>
epoll
</code>
descriptor is got from
<code>
server.el
</code>
.
</li>
<li>
<code>
server.fd
</code>
: The
<em>
listening descriptor
</em>
that also serves as an index to access the relevant file event structure from the
<code>
eventLoop->events
</code>
table and store extra information like the callback function.
</li>
<li>
<code>
AE_READABLE
</code>
: Signifies that
<code>
server.fd
</code>
has to be watched for
<code>
EPOLLIN
</code>
event.
</li>
<li>
<code>
acceptHandler
</code>
: The function that has to be executed when the event being watched for is ready. This function pointer is stored in
<code>
eventLoop->events[server.fd]->rfileProc
</code>
.
</li>
</ul>
<p>
This completes the initialization of Redis event loop.
</p>
<h2 id="event-loop-processing">
Event Loop Processing
</h2>
<p>
<code>
ae.c:aeMain
</code>
called from
<code>
redis.c:main
</code>
does the job of processing the event loop that is initialized in the previous phase.
</p>
<p>
<code>
ae.c:aeMain
</code>
calls
<code>
ae.c:aeProcessEvents
</code>
in a while loop that processes pending time and file events.
</p>
<h2 id="aeprocessevents">
<code>
aeProcessEvents
</code>
</h2>
<p>
<code>
ae.c:aeProcessEvents
</code>
looks for the time event that will be pending in the smallest amount of time by calling
<code>
ae.c:aeSearchNearestTimer
</code>
on the event loop. In our case there is only one timer event in the event loop that was created by
<code>
ae.c:aeCreateTimeEvent
</code>
.
</p>
<p>
Remember, that the timer event created by
<code>
aeCreateTimeEvent
</code>
has probably elapsed by now because it had an expiry time of one millisecond. Since the timer has already expired, the seconds and microseconds fields of the
<code>
tvp
</code>
<code>
timeval
</code>
structure variable is initialized to zero.
</p>
<p>
The
<code>
tvp
</code>
structure variable along with the event loop variable is passed to
<code>
ae_epoll.c:aeApiPoll
</code>
.
</p>
<p>
<code>
aeApiPoll
</code>
functions does an
<a href="http://man.cx/epoll_wait">
<code>
epoll_wait
</code>
</a>
on the
<code>
epoll
</code>
descriptor and populates the
<code>
eventLoop->fired
</code>
table with the details:
</p>
<ul>
<li>
<code>
fd
</code>
: The descriptor that is now ready to do a read/write operation depending on the mask value.
</li>
<li>
<code>
mask
</code>
: The read/write event that can now be performed on the corresponding descriptor.
</li>
</ul>
<p>
<code>
aeApiPoll
</code>
returns the number of such file events ready for operation. Now to put things in context, if any client has requested for a connection then
<code>
aeApiPoll
</code>
would have noticed it and populated the
<code>
eventLoop->fired
</code>
table with an entry of the descriptor being the
<em>
listening descriptor
</em>
and mask being
<code>
AE_READABLE
</code>
.
</p>
<p>
Now,
<code>
aeProcessEvents
</code>
calls the
<code>
redis.c:acceptHandler
</code>
registered as the callback.
<code>
acceptHandler
</code>
executes
<a href="http://man.cx/accept">
accept
</a>
on the
<em>
listening descriptor
</em>
returning a
<em>
connected descriptor
</em>
with the client.
<code>
redis.c:createClient
</code>
adds a file event on the
<em>
connected descriptor
</em>
through a call to
<code>
ae.c:aeCreateFileEvent
</code>
like below:
</p>
<pre><code>if (aeCreateFileEvent(server.el, c->fd, AE_READABLE,
readQueryFromClient, c) == AE_ERR) {
freeClient(c);
return NULL;
}
</code></pre>
<p>
<code>
c
</code>
is the
<code>
redisClient
</code>
structure variable and
<code>
c->fd
</code>
is the connected descriptor.
</p>
<p>
Next the
<code>
ae.c:aeProcessEvent
</code>
calls
<code>
ae.c:processTimeEvents
</code>
</p>
<h2 id="processtimeevents">
<code>
processTimeEvents
</code>
</h2>
<p>
<code>
ae.processTimeEvents
</code>
iterates over list of time events starting at
<code>
eventLoop->timeEventHead
</code>
.
</p>
<p>
For every timed event that has elapsed
<code>
processTimeEvents
</code>
calls the registered callback. In this case it calls the only timed event callback registered, that is,
<code>
redis.c:serverCron
</code>
. The callback returns the time in milliseconds after which the callback must be called again. This change is recorded via a call to
<code>
ae.c:aeAddMilliSeconds
</code>
and will be handled on the next iteration of
<code>
ae.c:aeMain
</code>
while loop.
</p>
<p>
That's all.
</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/internals/internals-rediseventlib/"/>
<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/strlen/.html | <section class="prose w-full py-12">
<h1 class="command-name">
STRLEN
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">STRLEN 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.2.0
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
Time complexity:
</dt>
<dd class="m-0">
O(1)
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
ACL categories:
</dt>
<dd class="m-0">
<code>
@read
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@string
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@fast
</code>
<span class="mr-1 last:hidden">
,
</span>
</dd>
</dl>
<p>
Returns the length of the string value stored at
<code>
key
</code>
.
An error is returned when
<code>
key
</code>
holds a non-string value.
</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> SET mykey "Hello world"
"OK"
redis> STRLEN mykey
(integer) 11
redis> STRLEN nonexisting
(integer) 0
</pre>
<div class="prompt" style="">
<span>
redis>
</span>
<input autocomplete="off" name="prompt" spellcheck="false" type="text"/>
</div>
</form>
<h2 id="resp2resp3-reply">
RESP2/RESP3 Reply
</h2>
<a href="../../develop/reference/protocol-spec#integers">
Integer reply
</a>
: the length of the string stored at key, 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/strlen/"/>
<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-0-99-february-2015/.html | <section class="prose w-full py-12 max-w-none">
<h1>
RLEC 0.99.5-24 Release Notes (February 15, 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>
If you are upgrading from version 0.99.5-11:
</p>
<ol>
<li>
You must restart the services after the upgrade by running the
following command with user root (sudo su). From the operating
system's CLI, run the following command:
cnm_ctl restart
</li>
<li>
After the upgrade, rladmin status command will report that the
databases are from an old version. It is recommended that you
upgrade the databases as soon as possible, as described in the
<a href="/docs/latest/operate/rs/installing-upgrading/upgrading/">
upgrade
instructions
</a>
.
</li>
</ol>
<h2 id="new-features">
New features
</h2>
<p>
None.
</p>
<h2 id="changes">
Changes
</h2>
<ul>
<li>
Enhancements to memtier_benchmark tool that is included in the
installation package. You can find more details in the
<a href="https://github.com/RedisLabs/memtier_benchmark">
GitHub
project.
</a>
</li>
</ul>
<h2 id="fixed-issues">
Fixed issues
</h2>
<ul>
<li>
Improvements and fixes related to node failover, remove node and
take node offline functionality.
</li>
</ul>
<h2 id="known-issues">
Known issues
</h2>
<ul>
<li>
<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, the
management UI appears down while the node is down.
<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.
</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-0-99-february-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/commands/topk.count.html | <section class="prose w-full py-12">
<h1 class="command-name">
TOPK.COUNT
<span class="text-base">
(deprecated)
</span>
</h1>
<div class="border-l-8 pl-4">
<p>
As of Bloom version 2.4, this command is regarded as deprecated.
</p>
</div>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">TOPK.COUNT 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 2.0.0
</a>
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
Time complexity:
</dt>
<dd class="m-0">
O(n) where n is the number of items
</dd>
</dl>
<p>
Returns count for an item.
Multiple items can be requested at once.
Please note this number will never be higher than the real count and likely to be lower.
</p>
<p>
This command has been deprecated. The count value is not a representative of
the number of appearances of an item.
</p>
<h3 id="parameters">
Parameters
</h3>
<ul>
<li>
<strong>
key
</strong>
: Name of sketch where item is counted.
</li>
<li>
<strong>
item
</strong>
: Item/s to be counted.
</li>
</ul>
<h2 id="return">
Return
</h2>
<p>
<a href="/docs/latest/develop/reference/protocol-spec/#arrays">
Array reply
</a>
of
<a href="/docs/latest/develop/reference/protocol-spec/#integers">
Integer reply
</a>
- count for responding item.
</p>
<h2 id="examples">
Examples
</h2>
<pre tabindex="0"><code>redis> TOPK.COUNT topk foo 42 nonexist
1) (integer) 3
2) (integer) 1
3) (integer) 0
</code></pre>
<br/>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/topk.count/"/>
<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/cluster/certificates/rotate/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Rotate cluster certificates requests
</h1>
<p class="text-lg -mt-5 mb-10">
Rotate cluster certificates requests
</p>
<table>
<thead>
<tr>
<th>
Method
</th>
<th>
Path
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="#post-cluster-certificates-rotate">
POST
</a>
</td>
<td>
<code>
/v1/cluster/certificates/rotate
</code>
</td>
<td>
Regenerate all internal cluster certificates
</td>
</tr>
</tbody>
</table>
<h2 id="post-cluster-certificates-rotate">
Rotate cluster certificates
</h2>
<pre><code>POST /v1/cluster/certificates/rotate
</code></pre>
<p>
Regenerates all
<em>
internal
</em>
cluster certificates.
</p>
<p>
The certificate rotation will be performed on all nodes within the cluster. If
"name" is provided, only rotate the specified certificate on all nodes within the cluster.
</p>
<h3 id="post-request">
Request
</h3>
<h4 id="example-http-request">
Example HTTP request
</h4>
<pre><code>POST /cluster/certificates/rotate
</code></pre>
<h4 id="request-headers">
Request headers
</h4>
<table>
<thead>
<tr>
<th>
Key
</th>
<th>
Value
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
Host
</td>
<td>
cnm.cluster.fqdn
</td>
<td>
Domain name
</td>
</tr>
<tr>
<td>
Accept
</td>
<td>
application/json
</td>
<td>
Accepted media type
</td>
</tr>
</tbody>
</table>
<h3 id="post-response">
Response
</h3>
<p>
Responds with a
<code>
200 OK
</code>
status code if the internal certificates successfully rotate across the entire cluster.
</p>
<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
</td>
</tr>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1">
400 Bad Request
</a>
</td>
<td>
Failed, not all nodes have been updated.
</td>
</tr>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.4">
403 Forbidden
</a>
</td>
<td>
Unsupported internal certificate rotation.
</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/cluster/certificates/rotate/"/>
<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.suglen.html | <section class="prose w-full py-12">
<h1 class="command-name">
FT.SUGLEN
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">FT.SUGLEN key
</pre>
<dl class="grid grid-cols-[auto,1fr] gap-2 mb-12">
<dt class="font-semibold text-redis-ink-900 m-0">
Available in:
</dt>
<dd class="m-0">
<a href="/docs/stack">
Redis Stack
</a>
/
<a href="/docs/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>
Get the size of an auto-complete suggestion dictionary
</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>
<h2 id="return">
Return
</h2>
<p>
FT.SUGLEN returns an integer reply, which is the current size of the suggestion dictionary.
</p>
<h2 id="examples">
Examples
</h2>
<details open="">
<summary>
<b>
Get the size of an auto-complete suggestion dictionary
</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.SUGLEN sug
</span></span><span class="line"><span class="cl"><span class="o">(</span>integer<span class="o">)</span> <span class="m">2</span></span></span></code></pre>
</div>
</details>
<h2 id="see-also">
See also
</h2>
<p>
<a href="/docs/latest/commands/ft.sugadd/">
<code>
FT.SUGADD
</code>
</a>
|
<a href="/docs/latest/commands/ft.sugdel/">
<code>
FT.SUGDEL
</code>
</a>
|
<a href="/docs/latest/commands/ft.sugget/">
<code>
FT.SUGGET
</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.suglen/"/>
<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/networking/cluster-lba-setup/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Set up a Redis Enterprise cluster behind a load balancer
</h1>
<p class="text-lg -mt-5 mb-10">
Set up a Redis Enterprise cluster using a load balancer instead of DNS to direct traffic to cluster nodes.
</p>
<p>
To set up a Redis Enterprise cluster in an environment that doesn't allow DNS, you can use a load balancer (LB) to direct traffic to the cluster nodes.
</p>
<h2 id="dns-role-for-databases">
DNS role for databases
</h2>
<p>
Normally, Redis Enterprise uses DNS to provide dynamic database endpoints.
A DNS name such as
<code>
redis-12345.clustername.domain
</code>
gives clients access to the database resource:
</p>
<ul>
<li>
If multiple proxies are in use, the DNS name resolves to multiple IP addresses so clients can load balance.
</li>
<li>
On failover or topology changes, the DNS name is automatically updated to reflect the live IP addresses.
</li>
</ul>
<p>
When DNS cannot be used, clients can still connect to the endpoints with the IP addresses,
but the benefits of load balancing and automatic updates to IP addresses won't be available.
</p>
<h2 id="network-architecture-with-load-balancer">
Network architecture with load balancer
</h2>
<p>
You can compensate for the lack of DNS resolution with load balancers that can expose services and provide service discovery.
A load balancer is configured in front of the Redis Enterprise cluster, exposing several logical services:
</p>
<ul>
<li>
Control plane services, such as the Cluster Manager UI
</li>
<li>
Data plane services, such as database endpoints for client application connections
</li>
</ul>
<p>
Depending on which Redis Enterprise services you want to access outside the cluster, you may need to configure the load balancers separately.
One or more virtual IPs (VIPs) are defined on the load balancer to expose Redis Enterprise services.
The architecture is shown in the following diagram with a 3-node Redis Enterprise cluster with one database (DB1) configured on port 12000:
</p>
<a href="/docs/latest/images/rs/cluster-behind-load-balancer-top-down.png" sdata-lightbox="/images/rs/cluster-behind-load-balancer-top-down.png">
<img alt="cluster-behind-load-balancer-top-down" src="/docs/latest/images/rs/cluster-behind-load-balancer-top-down.png"/>
</a>
<h2 id="set-up-a-cluster-with-load-balancers">
Set up a cluster with load balancers
</h2>
<h3 id="prerequisites">
Prerequisites
</h3>
<ul>
<li>
<a href="/docs/latest/operate/rs/7.4/installing-upgrading/">
Install
</a>
the latest version of Redis Enterprise Software on your clusters
</li>
<li>
Configure the cluster with the cluster name (FQDN) even though DNS is not in use.
Remember that the same cluster name is used to issue the license keys.
We recommend that you use a β.localβ suffix in the FQDN.
</li>
</ul>
<h3 id="configure-load-balancers">
Configure load balancers
</h3>
<ul>
<li>
Make sure that the load balancer is performing TCP health checks on the cluster nodes.
</li>
<li>
Expose the services that you require through a virtual IP, for example:
<ul>
<li>
Cluster Manager UI on port 8443
</li>
<li>
Rest API on port 9443 for secure HTTPS connections and port 8080 for HTTP
</li>
<li>
Database ports 10000-19999
</li>
</ul>
</li>
</ul>
<p>
Other ports are shown in the list of
<a href="/docs/latest/operate/rs/7.4/networking/port-configurations/">
Redis Enterprise network ports
</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>
<p>
Sticky, secured connections are needed only for the Redis Enterprise Cluster Manager UI on port 8443.
</p>
<ul>
<li>
Certain load balancers provide specific logic to close idle connections. Either turn off this feature or make sure the applications connecting to Redis use reconnection logic.
</li>
<li>
Make sure the load balancer is fast enough to resolve connections between two clusters or applications that are connected to Redis databases through a load balancer.
</li>
<li>
Choose the standard load balancer that is commonly used in your environment so that you have easy access to in-house expertise for troubleshooting issues.
</li>
</ul>
</div>
</div>
<h3 id="configure-cluster">
Configure cluster
</h3>
<p>
For clusters behind load balancers, we recommend using the
<code>
all-nodes
</code>
<a href="/docs/latest/operate/rs/7.4/databases/configure/proxy-policy/">
proxy policy
</a>
and enabling
<code>
handle_redirects
</code>
.
</p>
<p>
To allow inbound connections to be terminated on the relevant node inside the cluster, run the following
<code>
rladmin
</code>
commands on the cluster:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl"><span class="c1"># Enable all-nodes proxy policy by default</span>
</span></span><span class="line"><span class="cl">rladmin tune cluster default_sharded_proxy_policy all-nodes default_non_sharded_proxy_policy all-nodes
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Redirect where necessary when behind a load balancer</span>
</span></span><span class="line"><span class="cl">rladmin cluster config handle_redirects enabled
</span></span></code></pre>
</div>
<p>
Optionally configure sparse shard placement to allow closer termination of client connections to where the Redis shard is located:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl"><span class="c1"># Enable sparse placement by default</span>
</span></span><span class="line"><span class="cl">rladmin tune cluster default_shards_placement sparse
</span></span></code></pre>
</div>
<h3 id="configure-database">
Configure database
</h3>
<p>
After you update the cluster settings and configure the load balancers, you can go to the Redis Enterprise Cluster Manager UI at
<code>
https://load-balancer-virtual-ip:8443/
</code>
and
<a href="/docs/latest/operate/rs/7.4/databases/create/">
create a new database
</a>
.
</p>
<p>
To create an Active-Active database, use the
<code>
crdb-cli
</code>
utility. See the
<a href="/docs/latest/operate/rs/7.4/references/cli-utilities/crdb-cli/">
<code>
crdb-cli
</code>
reference
</a>
for more information about creating Active-Active databases from the command line.
</p>
<h3 id="update-load-balancer-configuration-when-cluster-configuration-changes">
Update load balancer configuration when cluster configuration changes
</h3>
<p>
When your Redis Enterprise cluster is behind a load balancer, you must update the load balancer when the cluster topology and IP addresses change.
Some common cases that require you to update the load balancer are:
</p>
<ul>
<li>
Adding new nodes to the Redis Enterprise cluster
</li>
<li>
Removing nodes from the Redis Enterprise cluster
</li>
<li>
Maintenance for Redis Enterprise cluster nodes
</li>
<li>
IP address changes for Redis Enterprise cluster nodes
</li>
</ul>
<p>
After these changes, make sure that the Redis connections in your applications can connect to the Redis database,
especially if they are directly connected on IP addresses that have changed.
</p>
<h2 id="intercluster-communication-considerations">
Intercluster communication considerations
</h2>
<p>
Redis Enterprise supports several topologies that allow intercluster replication, such as
<a href="/docs/latest/operate/rs/7.4/databases/import-export/replica-of/">
Replica Of
</a>
and
<a href="/docs/latest/operate/rs/7.4/databases/active-active/">
Active-Active
</a>
deployment options.
When your Redis Enterprise software clusters are behind load balancers, you must allow some network services to be open and defined in the load balancers to allow the replication to work.
</p>
<h3 id="replica-of">
Replica Of
</h3>
<p>
For Replica Of communication to work, you must expose database ports locally in each cluster and allow these ports through any firewalls between the clusters.
</p>
<h3 id="active-active">
Active-Active
</h3>
<p>
For Active-Active communication to work, you must expose several ports, including every database port and several control plane ports as defined in
<a href="/docs/latest/operate/rs/7.4/networking/port-configurations/">
Network port configurations
</a>
. Pay attention to services that include "Active-Active" in the connection source column, and allow these ports through any firewalls between the clusters.
</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/networking/cluster-lba-setup/"/>
<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/metrics/resource-usage/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Resource usage metrics
</h1>
<h2 id="connections">
Connections
</h2>
<p>
Number of connections to the database.
</p>
<p>
<strong>
Components measured
</strong>
: Cluster, Node, and Database
</p>
<h2 id="cpu-usage">
CPU usage
</h2>
<p>
Percent of the node CPU used.
</p>
<p>
<strong>
Components measured
</strong>
: Cluster and Node
</p>
<h3 id="main-thread-cpu-usage">
Main thread CPU usage
</h3>
<p>
Percent of the CPU used by the main thread.
</p>
<p>
<strong>
Components measured
</strong>
: Database and Shard
</p>
<h3 id="fork-cpu-usage">
Fork CPU usage
</h3>
<p>
CPU usage of Redis child forks.
</p>
<p>
<strong>
Components measured
</strong>
: Database and Shard
</p>
<h3 id="total-cpu-usage">
Total CPU usage
</h3>
<p>
Percent usage of the CPU for all nodes.
</p>
<p>
<strong>
Components measured
</strong>
: Database
</p>
<h2 id="free-disk-space">
Free disk space
</h2>
<p>
Remaining unused disk space.
</p>
<p>
<strong>
Components measured
</strong>
: Cluster and Node
</p>
<h2 id="memory">
Memory
</h2>
<h3 id="used-memory">
Used memory
</h3>
<p>
Total memory used by the database, including RAM,
<a href="/docs/latest/operate/rs/7.4/databases/auto-tiering/">
Flash
</a>
(if enabled), and
<a href="/docs/latest/operate/rs/7.4/databases/durability-ha/replication/">
replication
</a>
(if enabled).
</p>
<p>
Used memory does not include:
</p>
<ol>
<li>
Fragmentation overhead - The ratio of memory seen by the operating system to memory allocated by Redis
</li>
<li>
Replication buffers at the primary nodes - Set to 10% of used memory and is between 64 MB and 2048 MB
</li>
<li>
Memory used by Lua scripts - Does not exceed 1 MB
</li>
<li>
Copy on Write (COW) operation that can be triggered by:
<ul>
<li>
A full replication process
</li>
<li>
A database snapshot process
</li>
<li>
AOF rewrite process
</li>
</ul>
</li>
</ol>
<p>
Used memory is not measured during
<a href="/docs/latest/operate/rs/7.4/databases/configure/replica-ha/">
shard migration
</a>
.
</p>
<p>
<strong>
Components measured
</strong>
: Database and Shard
</p>
<h3 id="free-ram">
Free RAM
</h3>
<p>
Available RAM for System use.
</p>
<p>
<strong>
Components measured
</strong>
: Cluster and Node
</p>
<h3 id="memory-limit">
Memory limit
</h3>
<p>
Memory size limit of the database, enforced on the
<a href="#used-memory">
used memory
</a>
.
</p>
<p>
<strong>
Components measured
</strong>
: Database
</p>
<h3 id="memory-usage">
Memory usage
</h3>
<p>
Percent of memory used by Redis out of the
<a href="#memory-limit">
memory limit
</a>
.
</p>
<p>
<strong>
Components measured
</strong>
: Database
</p>
<h2 id="traffic">
Traffic
</h2>
<h3 id="incoming-traffic">
Incoming traffic
</h3>
<p>
Total incoming traffic to the database in bytes/sec.
</p>
<p>
All incoming traffic is not measured during
<a href="/docs/latest/operate/rs/7.4/databases/configure/replica-ha/">
shard migration
</a>
.
</p>
<p>
<strong>
Components measured
</strong>
: Cluster, Node and Database
</p>
<h4 id="incoming-traffic-compressed">
Incoming traffic compressed
</h4>
<p>
Total incoming compressed traffic (in bytes/sec) per
<a href="/docs/latest/operate/rs/7.4/databases/active-active/">
Active-Active
</a>
replica database.
</p>
<h4 id="incoming-traffic-uncompressed">
Incoming traffic uncompressed
</h4>
<p>
Total incoming uncompressed traffic (in bytes/sec) per
<a href="/docs/latest/operate/rs/7.4/databases/active-active/">
Active-Active
</a>
replica database.
</p>
<h3 id="outgoing-traffic">
Outgoing traffic
</h3>
<p>
Total outgoing traffic from the database in bytes per second.
</p>
<p>
Outgoing traffic is not measured during
<a href="/docs/latest/operate/rs/7.4/databases/configure/replica-ha/">
shard migration
</a>
.
</p>
<p>
<strong>
Components measured
</strong>
: Cluster, Node and Database
</p>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/references/metrics/resource-usage/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/7.4/databases/active-active/develop/develop-for-aa/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Develop applications with Active-Active databases
</h1>
<p class="text-lg -mt-5 mb-10">
Overview of how developing applications differs for Active-Active databases from standalone Redis databases.
</p>
<p>
Developing geo-distributed, multi-master applications can be difficult.
Application developers may have to understand a large number of race
conditions between updates to various sites, network, and cluster
failures that could reorder the events and change the outcome of the
updates performed across geo-distributed writes.
</p>
<p>
Active-Active databases (formerly known as CRDB) are geo-distributed databases that span multiple Redis Enterprise Software (RS) clusters.
Active-Active databases depend on multi-master replication (MMR) and Conflict-free
Replicated Data Types (CRDTs) to power a simple development experience
for geo-distributed applications. Active-Active databases allow developers to use existing
Redis data types and commands, but understand the developers intent and
automatically handle conflicting concurrent writes to the same key
across multiple geographies. For example, developers can simply use the
INCR or INCRBY method in Redis in all instances of the geo-distributed
application, and Active-Active databases handle the additive nature of INCR to reflect the
correct final value. The following example displays a sequence of events
over time : t1 to t9. This Active-Active database has two member Active-Active databases : member CRDB1 and
member CRDB2. The local operations executing in each member Active-Active database is
listed under the member Active-Active database name. The "Sync" even represent the moment
where synchronization catches up to distribute all local member Active-Active database
updates to other participating clusters and other member Active-Active databases.
</p>
<table>
<thead>
<tr>
<th style="text-align:center">
<strong>
Time
</strong>
</th>
<th style="text-align:center">
<strong>
Member CRDB1
</strong>
</th>
<th style="text-align:center">
<strong>
Member CRDB2
</strong>
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center">
t1
</td>
<td style="text-align:center">
INCRBY key1 7
</td>
<td style="text-align:center">
</td>
</tr>
<tr>
<td style="text-align:center">
t2
</td>
<td style="text-align:center">
</td>
<td style="text-align:center">
INCRBY key1 3
</td>
</tr>
<tr>
<td style="text-align:center">
t3
</td>
<td style="text-align:center">
GET key1
<br/>
7
</td>
<td style="text-align:center">
GET key1
<br/>
3
</td>
</tr>
<tr>
<td style="text-align:center">
t4
</td>
<td style="text-align:center">
β Sync β
</td>
<td style="text-align:center">
β Sync β
</td>
</tr>
<tr>
<td style="text-align:center">
t5
</td>
<td style="text-align:center">
GET key1
<br/>
10
</td>
<td style="text-align:center">
GET key1
<br/>
10
</td>
</tr>
<tr>
<td style="text-align:center">
t6
</td>
<td style="text-align:center">
DECRBY key1 3
</td>
<td style="text-align:center">
</td>
</tr>
<tr>
<td style="text-align:center">
t7
</td>
<td style="text-align:center">
</td>
<td style="text-align:center">
INCRBY key1 6
</td>
</tr>
<tr>
<td style="text-align:center">
t8
</td>
<td style="text-align:center">
β Sync β
</td>
<td style="text-align:center">
β Sync β
</td>
</tr>
<tr>
<td style="text-align:center">
t9
</td>
<td style="text-align:center">
GET key1
<br/>
13
</td>
<td style="text-align:center">
GET key1
<br/>
13
</td>
</tr>
</tbody>
</table>
<p>
Databases provide various approaches to address some of these concerns:
</p>
<ul>
<li>
Active-Passive Geo-distributed deployments: With active-passive
distributions, all writes go to an active cluster. Redis Enterprise
provides a "Replica Of" capability that provides a similar approach.
This can be employed when the workload is heavily balanced towards
read and few writes. However, WAN performance and availability
is quite flaky and traveling large distances for writes take away
from application performance and availability.
</li>
<li>
Two-phase Commit (2PC): This approach is designed around a protocol
that commits a transaction across multiple transaction managers.
Two-phase commit provides a consistent transactional write across
regions but fails transactions unless all participating transaction
managers are "available" at the time of the transaction. The number
of messages exchanged and its cross-regional availability
requirement make two-phase commit unsuitable for even moderate
throughputs and cross-geo writes that go over WANs.
</li>
<li>
Sync update with Quorum-based writes: This approach synchronously
coordinates a write across majority number of replicas across
clusters spanning multiple regions. However, just like two-phase
commit, number of messages exchanged and its cross-regional
availability requirement make geo-distributed quorum writes
unsuitable for moderate throughputs and cross geo writes that go
over WANs.
</li>
<li>
Last-Writer-Wins (LWW) Conflict Resolution: Some systems provide
simplistic conflict resolution for all types of writes where the
system clocks are used to determine the winner across conflicting
writes. LWW is lightweight and can be suitable for simpler data.
However, LWW can be destructive to updates that are not necessarily
conflicting. For example adding a new element to a set across two
geographies concurrently would result in only one of these new
elements appearing in the final result with LWW.
</li>
<li>
MVCC (multi-version concurrency control): MVCC systems maintain
multiple versions of data and may expose ways for applications to
resolve conflicts. Even though MVCC system can provide a flexible
way to resolve conflicting writes, it comes at a cost of great
complexity in the development of a solution.
</li>
</ul>
<p>
Even though types and commands in Active-Active databases look identical to standard Redis
types and commands, the underlying types in RS are enhanced to maintain
more metadata to create the conflict-free data type experience. This
section explains what you need to know about developing with Active-Active databases on
Redis Enterprise Software.
</p>
<h2 id="lua-scripts">
Lua scripts
</h2>
<p>
Active-Active databases support Lua scripts, but unlike standard Redis, Lua scripts always
execute in effects replication mode. There is currently no way to
execute them in script-replication mode.
</p>
<h2 id="eviction">
Eviction
</h2>
<p>
The default policy for Active-Active databases is
<em>
noeviction
</em>
mode. Redis Enterprise version 6.0.20 and later support all eviction policies for Active-Active databases, unless
<a href="/docs/latest/operate/rs/7.4/databases/auto-tiering/">
Auto Tiering
</a>
(previously known as Redis on Flash) is enabled.
For details, see
<a href="/docs/latest/operate/rs/7.4/databases/memory-performance/eviction-policy/#active-active-database-eviction">
eviction for Active-Active databases
</a>
.
</p>
<h2 id="expiration">
Expiration
</h2>
<p>
Expiration is supported with special multi-master semantics.
</p>
<p>
If a key's expiration time is changed at the same time on different
members of the Active-Active database, the longer extended time set via TTL on a key is
preserved. As an example:
</p>
<p>
If this command was performed on key1 on cluster #1
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">127.0.0.1:6379> EXPIRE key1 <span class="m">10</span>
</span></span></code></pre>
</div>
<p>
And if this command was performed on key1 on cluster #2
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">127.0.0.1:6379> EXPIRE key1 <span class="m">50</span>
</span></span></code></pre>
</div>
<p>
The EXPIRE command setting the key to 50 would win.
</p>
<p>
And if this command was performed on key1 on cluster #3:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">127.0.0.1:6379> PERSIST key1
</span></span></code></pre>
</div>
<p>
It would win out of the three clusters hosting the Active-Active database as it sets the
TTL on key1 to an infinite time.
</p>
<p>
The replica responsible for the "winning" expire value is also
responsible to expire the key and propagate a DEL effect when this
happens. A "losing" replica is from this point on not responsible
for expiring the key, unless another EXPIRE command resets the TTL.
Furthermore, a replica that is NOT the "owner" of the expired value:
</p>
<ul>
<li>
<p>
Silently ignores the key if a user attempts to access it in READ
mode, e.g. treating it as if it was expired but not propagating a
DEL.
</p>
</li>
<li>
<p>
Expires it (sending a DEL) before making any modifications if a user
attempts to access it in WRITE mode.
</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>
Expiration values are in the range of [0,Β 2^49] for Active-Active databases and [0,Β 2^64] for non Active-Active databases.
</div>
</div>
</li>
</ul>
<h2 id="outofmemory-oom">
Out-of-Memory (OOM)
</h2>
<p>
If a member Active-Active database is in an out of memory situation, that member is marked
"inconsistent" by RS, the member stops responding to user traffic, and
the syncer initiates full reconciliation with other peers in the Active-Active database.
</p>
<h2 id="active-active-database-key-counts">
Active-Active Database Key Counts
</h2>
<p>
Keys are counted differently for Active-Active databases:
</p>
<ul>
<li>
DBSIZE (in
<code>
shard-cli dbsize
</code>
) reports key header instances
that represent multiple potential values of a key before a replication conflict is resolved.
</li>
<li>
expired_keys (in
<code>
bdb-cli info
</code>
) can be more than the keys count in DBSIZE (in
<code>
shard-cli dbsize
</code>
)
because expires are not always removed when a key becomes a tombstone.
A tombstone is a key that is logically deleted but still takes memory
until it is collected by the garbage collector.
</li>
<li>
The Expires average TTL (in
<code>
bdb-cli info
</code>
) is computed for local expires only.
</li>
</ul>
<h2 id="info">
INFO
</h2>
<p>
The INFO command has an additional crdt section which provides advanced
troubleshooting information (applicable to support etc.):
</p>
<table>
<thead>
<tr>
<th>
<strong>
Section
</strong>
</th>
<th>
<strong>
Field
</strong>
</th>
<th>
<strong>
Description
</strong>
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<strong>
CRDT Context
</strong>
</td>
<td>
crdt_config_version
</td>
<td>
Currently active Active-Active database configuration version.
</td>
</tr>
<tr>
<td>
</td>
<td>
crdt_slots
</td>
<td>
Hash slots assigned and reported by this shard.
</td>
</tr>
<tr>
<td>
</td>
<td>
crdt_replid
</td>
<td>
Unique Replica/Shard IDs.
</td>
</tr>
<tr>
<td>
</td>
<td>
crdt_clock
</td>
<td>
Clock value of local vector clock.
</td>
</tr>
<tr>
<td>
</td>
<td>
crdt_ovc
</td>
<td>
Locally observed Active-Active database vector clock.
</td>
</tr>
<tr>
<td>
<strong>
Peers
</strong>
</td>
<td>
A list of currently connected Peer Replication peers. This is similar to the slaves list reported by Redis.
</td>
<td>
</td>
</tr>
<tr>
<td>
<strong>
Backlogs
</strong>
</td>
<td>
A list of Peer Replication backlogs currently maintained. Typically in a full mesh topology only a single backlog is used for all peers, as the requested Ids are identical.
</td>
<td>
</td>
</tr>
<tr>
<td>
<strong>
CRDT Stats
</strong>
</td>
<td>
crdt_sync_full
</td>
<td>
Number of inbound full synchronization processes performed.
</td>
</tr>
<tr>
<td>
</td>
<td>
crdt_sync_partial_ok
</td>
<td>
Number of partial (backlog based) re-synchronization processes performed.
</td>
</tr>
<tr>
<td>
</td>
<td>
crdt_sync_partial-err
</td>
<td>
Number of partial re-synchronization processes failed due to exhausted backlog.
</td>
</tr>
<tr>
<td>
</td>
<td>
crdt_merge_reqs
</td>
<td>
Number of inbound merge requests processed.
</td>
</tr>
<tr>
<td>
</td>
<td>
crdt_effect_reqs
</td>
<td>
Number of inbound effect requests processed.
</td>
</tr>
<tr>
<td>
</td>
<td>
crdt_ovc_filtered_effect_reqs
</td>
<td>
Number of inbound effect requests filtered due to old vector clock.
</td>
</tr>
<tr>
<td>
</td>
<td>
crdt_gc_pending
</td>
<td>
Number of elements pending garbage collection.
</td>
</tr>
<tr>
<td>
</td>
<td>
crdt_gc_attempted
</td>
<td>
Number of attempts to garbage collect tombstones.
</td>
</tr>
<tr>
<td>
</td>
<td>
crdt_gc_collected
</td>
<td>
Number of tombstones garbaged collected successfully.
</td>
</tr>
<tr>
<td>
</td>
<td>
crdt_gc_gvc_min
</td>
<td>
The minimal globally observed vector clock, as computed locally from all received observed clocks.
</td>
</tr>
<tr>
<td>
</td>
<td>
crdt_stale_released_with_merge
</td>
<td>
Indicates last stale flag transition was a result of a complete full sync.
</td>
</tr>
<tr>
<td>
<strong>
CRDT Replicas
</strong>
</td>
<td>
A list of crdt_replica <uid> entries, each describes the known state of a remote instance with the following fields:
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
config_version
</td>
<td>
Last configuration version reported.
</td>
</tr>
<tr>
<td>
</td>
<td>
shards
</td>
<td>
Number of shards.
</td>
</tr>
<tr>
<td>
</td>
<td>
slots
</td>
<td>
Total number of hash slots.
</td>
</tr>
<tr>
<td>
</td>
<td>
slot_coverage
</td>
<td>
A flag indicating remote shards provide full coverage (i.e. all shards are alive).
</td>
</tr>
<tr>
<td>
</td>
<td>
max_ops_lag
</td>
<td>
Number of local operations not yet observed by the least updated remote shard
</td>
</tr>
<tr>
<td>
</td>
<td>
min_ops_lag
</td>
<td>
Number of local operations not yet observed by the most updated remote shard
</td>
</tr>
</tbody>
</table>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/databases/active-active/develop/develop-for-aa/"/>
<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/localaccumulateby/.html | <section class="prose w-full py-12 max-w-none">
<h1>
LocalAccumulateBy
</h1>
<p class="text-lg -mt-5 mb-10">
Groups records and reduces each group to a single record per group locally on each shard.
</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="o"><</span><span class="n">I</span> <span class="kd">extends</span> <span class="n">java</span><span class="o">.</span><span class="na">io</span><span class="o">.</span><span class="na">Serializable</span><span class="o">></span> <span class="n">GearsBuilder</span><span class="o"><</span><span class="n">I</span><span class="o">></span> <span class="n">localAccumulateBy</span><span class="err">β</span><span class="o">(</span>
</span></span><span class="line"><span class="cl"> <span class="n">gears</span><span class="o">.</span><span class="na">operations</span><span class="o">.</span><span class="na">ExtractorOperation</span><span class="o"><</span><span class="n">T</span><span class="o">></span> <span class="n">extractor</span><span class="o">,</span>
</span></span><span class="line"><span class="cl"> <span class="n">gears</span><span class="o">.</span><span class="na">operations</span><span class="o">.</span><span class="na">AccumulateByOperation</span><span class="o"><</span><span class="n">T</span><span class="o">,</span><span class="err">β</span><span class="n">I</span><span class="o">></span> <span class="n">accumulator</span><span class="o">)</span>
</span></span></code></pre>
</div>
<p>
The
<code>
localAccumulateBy
</code>
function is similar to
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/gears-v1/jvm/classes/gearsbuilder/accumulateby/">
<code>
accumulateBy
</code>
</a>
, except it performs the operation locally on each shard without moving data between shards.
</p>
<p>
On each shard, it iterates through the records in the pipe, groups them based on the provided extractor, and then reduces each group to a single record per group with the accumulator function.
</p>
<p>
The initial value of the accumulator is null.
</p>
<h2 id="parameters">
Parameters
</h2>
<p>
Type parameters:
</p>
<table>
<thead>
<tr>
<th>
Name
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
I
</td>
<td>
The template type of the returned builder
</td>
</tr>
</tbody>
</table>
<p>
Function parameters:
</p>
<table>
<thead>
<tr>
<th>
Name
</th>
<th>
Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
accumulator
</td>
<td>
<nobr>
AccumulateByOperation<T,βI>
</nobr>
</td>
<td>
A function with logic to update the accumulator value with each record
</td>
</tr>
<tr>
<td>
extractor
</td>
<td>
ExtractorOperation
<t>
</t>
</td>
<td>
Extracts a specific value from each record
</td>
</tr>
</tbody>
</table>
<h2 id="returns">
Returns
</h2>
<p>
Returns a GearsBuilder object with a new template type.
</p>
<h2 id="example">
Example
</h2>
<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">CreateGearsBuilder</span><span class="o">(</span><span class="n">reader</span><span class="o">).</span>
</span></span><span class="line"><span class="cl"> <span class="n">localAccumulateBy</span><span class="o">(</span><span class="n">r</span><span class="o">->{</span>
</span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="n">r</span><span class="o">.</span><span class="na">getStringVal</span><span class="o">();</span>
</span></span><span class="line"><span class="cl"> <span class="o">},(</span><span class="n">k</span><span class="o">,</span> <span class="n">a</span><span class="o">,</span> <span class="n">r</span><span class="o">)->{</span>
</span></span><span class="line"><span class="cl"> <span class="n">Integer</span> <span class="n">ret</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
</span></span><span class="line"><span class="cl"> <span class="k">if</span><span class="o">(</span><span class="n">a</span> <span class="o">==</span> <span class="kc">null</span><span class="o">)</span> <span class="o">{</span>
</span></span><span class="line"><span class="cl"> <span class="n">ret</span> <span class="o">=</span> <span class="mi">0</span><span class="o">;</span>
</span></span><span class="line"><span class="cl"> <span class="o">}</span><span class="k">else</span> <span class="o">{</span>
</span></span><span class="line"><span class="cl"> <span class="n">ret</span> <span class="o">=</span> <span class="o">(</span><span class="n">Integer</span><span class="o">)</span><span class="n">a</span><span class="o">;</span>
</span></span><span class="line"><span class="cl"> <span class="o">}</span>
</span></span><span class="line"><span class="cl"> <span class="k">return</span> <span class="n">ret</span> <span class="o">+</span> <span class="mi">1</span><span class="o">;</span>
</span></span><span class="line"><span class="cl"><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/localaccumulateby/"/>
<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/users/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Users requests
</h1>
<p class="text-lg -mt-5 mb-10">
User requests
</p>
<table>
<thead>
<tr>
<th>
Method
</th>
<th>
Path
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="#get-all-users">
GET
</a>
</td>
<td>
<code>
/v1/users
</code>
</td>
<td>
Get all users
</td>
</tr>
<tr>
<td>
<a href="#get-user">
GET
</a>
</td>
<td>
<code>
/v1/users/{uid}
</code>
</td>
<td>
Get a single user
</td>
</tr>
<tr>
<td>
<a href="#put-user">
PUT
</a>
</td>
<td>
<code>
/v1/users/{uid}
</code>
</td>
<td>
Update a user's configuration
</td>
</tr>
<tr>
<td>
<a href="#post-user">
POST
</a>
</td>
<td>
<code>
/v1/users
</code>
</td>
<td>
Create a new user
</td>
</tr>
<tr>
<td>
<a href="#delete-user">
DELETE
</a>
</td>
<td>
<code>
/v1/users/{uid}
</code>
</td>
<td>
Delete a user
</td>
</tr>
</tbody>
</table>
<h2 id="get-all-users">
Get all users
</h2>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">GET /v1/users
</span></span></code></pre>
</div>
<p>
Get a list of all users.
</p>
<h3 id="permissions">
Permissions
</h3>
<table>
<thead>
<tr>
<th>
Permission name
</th>
<th>
Roles
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="/docs/latest/operate/rs/7.4/references/rest-api/permissions/#view_all_users_info">
view_all_users_info
</a>
</td>
<td>
admin
</td>
</tr>
</tbody>
</table>
<h3 id="get-all-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 /users
</span></span></code></pre>
</div>
<h4 id="headers">
Headers
</h4>
<table>
<thead>
<tr>
<th>
Key
</th>
<th>
Value
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
Host
</td>
<td>
cnm.cluster.fqdn
</td>
<td>
Domain name
</td>
</tr>
<tr>
<td>
Accept
</td>
<td>
application/json
</td>
<td>
Accepted media type
</td>
</tr>
</tbody>
</table>
<h3 id="get-all-response">
Response
</h3>
<p>
Returns a JSON array of
<a href="/docs/latest/operate/rs/7.4/references/rest-api/objects/user/">
user 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="mi">1</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"password_issue_date"</span><span class="p">:</span> <span class="s2">"2017-03-02T09:43:34Z"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"email"</span><span class="p">:</span> <span class="s2">"[email protected]"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"name"</span><span class="p">:</span> <span class="s2">"John Doe"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"email_alerts"</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">"bdbs_email_alerts"</span><span class="p">:</span> <span class="p">[</span><span class="s2">"1"</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">"admin"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"auth_method"</span><span class="p">:</span> <span class="s2">"regular"</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">"password_issue_date"</span><span class="p">:</span> <span class="s2">"2017-03-02T09:43:34Z"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"email"</span><span class="p">:</span> <span class="s2">"[email protected]"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"name"</span><span class="p">:</span> <span class="s2">"Jane Poe"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"email_alerts"</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">"role"</span><span class="p">:</span> <span class="s2">"db_viewer"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"auth_method"</span><span class="p">:</span> <span class="s2">"regular"</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></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-user">
Get user
</h2>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">GET /v1/users/<span class="o">{</span>int: uid<span class="o">}</span>
</span></span></code></pre>
</div>
<p>
Get a single user's details.
</p>
<h3 id="permissions-1">
Permissions
</h3>
<table>
<thead>
<tr>
<th>
Permission name
</th>
<th>
Roles
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="/docs/latest/operate/rs/7.4/references/rest-api/permissions/#view_user_info">
view_user_info
</a>
</td>
<td>
admin
</td>
</tr>
</tbody>
</table>
<h3 id="get-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">GET /users/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>
</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 user's unique ID
</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/user/">
user object
</a>
that contains the details for the specified user ID.
</p>
<h4 id="example-json-body-1">
Example JSON body
</h4>
<div class="highlight">
<pre class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"uid"</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"password_issue_date"</span><span class="p">:</span> <span class="s2">"2017-03-07T15:11:08Z"</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">"db_viewer"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"email_alerts"</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">"bdbs_email_alerts"</span><span class="p">:</span> <span class="p">[</span><span class="s2">"1"</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">"email"</span><span class="p">:</span> <span class="s2">"[email protected]"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"name"</span><span class="p">:</span> <span class="s2">"John Doe"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"auth_method"</span><span class="p">:</span> <span class="s2">"regular"</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></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>
Success.
</td>
</tr>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.4">
403 Forbidden
</a>
</td>
<td>
Operation is forbidden.
</td>
</tr>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5">
404 Not Found
</a>
</td>
<td>
User does not exist.
</td>
</tr>
</tbody>
</table>
<h2 id="put-user">
Update user
</h2>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">PUT /v1/users/<span class="o">{</span>int: uid<span class="o">}</span>
</span></span></code></pre>
</div>
<p>
Update an existing user's configuration.
</p>
<h3 id="permissions-2">
Permissions
</h3>
<table>
<thead>
<tr>
<th>
Permission name
</th>
<th>
Roles
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="/docs/latest/operate/rs/7.4/references/rest-api/permissions/#update_user">
update_user
</a>
</td>
<td>
admin
</td>
</tr>
</tbody>
</table>
<p>
Any user can change their own name, password, or alert preferences.
</p>
<h3 id="put-request">
Request
</h3>
<h4 id="example-http-request-2">
Example HTTP request
</h4>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">PUT /users/1
</span></span></code></pre>
</div>
<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">"email_alerts"</span><span class="p">:</span> <span class="kc">false</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"role_uids"</span><span class="p">:</span> <span class="p">[</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">4</span> <span class="p">]</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span></code></pre>
</div>
<h4 id="headers-2">
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-1">
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 user's unique ID
</td>
</tr>
</tbody>
</table>
<h4 id="request-body">
Request body
</h4>
<p>
Include a
<a href="/docs/latest/operate/rs/7.4/references/rest-api/objects/user/">
user object
</a>
with updated fields in the request body.
</p>
<h3 id="put-response">
Response
</h3>
<p>
Returns the updated
<a href="/docs/latest/operate/rs/7.4/references/rest-api/objects/user/">
user object
</a>
.
</p>
<h4 id="example-json-body-3">
Example JSON body
</h4>
<div class="highlight">
<pre class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"uid"</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"password_issue_date"</span><span class="p">:</span> <span class="s2">"2017-03-07T15:11:08Z"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"email"</span><span class="p">:</span> <span class="s2">"[email protected]"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"name"</span><span class="p">:</span> <span class="s2">"Jane Poe"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"email_alerts"</span><span class="p">:</span> <span class="kc">false</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">"db_viewer"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"role_uids"</span><span class="p">:</span> <span class="p">[</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">4</span> <span class="p">],</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"auth_method"</span><span class="p">:</span> <span class="s2">"regular"</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">
Note:
</div>
For
<a href="/docs/latest/operate/rs/7.4/security/access-control/">
RBAC-enabled clusters
</a>
, the returned user details include
<code>
role_uids
</code>
instead of
<code>
role
</code>
.
</div>
</div>
<h3 id="put-error-codes">
Error codes
</h3>
<p>
When errors are reported, the server may return a JSON object with
<code>
error_code
</code>
and
<code>
message
</code>
field that provide additional information. The following are possible
<code>
error_code
</code>
values:
</p>
<table>
<thead>
<tr>
<th>
Code
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
password_not_complex
</td>
<td>
The given password is not complex enough (Only works when the password_complexity feature is enabled).
</td>
</tr>
<tr>
<td>
new_password_same_as_current
</td>
<td>
The given new password is identical to the old password.
</td>
</tr>
<tr>
<td>
email_already_exists
</td>
<td>
The given email is already taken.
</td>
</tr>
<tr>
<td>
change_last_admin_role_not_allowed
</td>
<td>
At least one user with admin role should exist.
</td>
</tr>
</tbody>
</table>
<h3 id="put-status-codes">
Status codes
</h3>
<table>
<thead>
<tr>
<th>
Code
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1">
200 OK
</a>
</td>
<td>
Success, the user is updated.
</td>
</tr>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1">
400 Bad Request
</a>
</td>
<td>
Bad or missing configuration parameters.
</td>
</tr>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5">
404 Not Found
</a>
</td>
<td>
Attempting to change a non-existing user.
</td>
</tr>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.7">
406 Not Acceptable
</a>
</td>
<td>
The requested configuration is invalid.
</td>
</tr>
</tbody>
</table>
<h2 id="post-user">
Create user
</h2>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">POST /v1/users
</span></span></code></pre>
</div>
<p>
Create a new user.
</p>
<h3 id="permissions-3">
Permissions
</h3>
<table>
<thead>
<tr>
<th>
Permission name
</th>
<th>
Roles
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="/docs/latest/operate/rs/7.4/references/rest-api/permissions/#create_new_user">
create_new_user
</a>
</td>
<td>
admin
</td>
</tr>
</tbody>
</table>
<h3 id="post-request">
Request
</h3>
<h4 id="example-http-request-3">
Example HTTP request
</h4>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">POST /users
</span></span></code></pre>
</div>
<h4 id="headers-3">
Headers
</h4>
<table>
<thead>
<tr>
<th>
Key
</th>
<th>
Value
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
Host
</td>
<td>
cnm.cluster.fqdn
</td>
<td>
Domain name
</td>
</tr>
<tr>
<td>
Accept
</td>
<td>
application/json
</td>
<td>
Accepted media type
</td>
</tr>
</tbody>
</table>
<h4 id="body">
Body
</h4>
<p>
Include a single
<a href="/docs/latest/operate/rs/7.4/references/rest-api/objects/user/">
user object
</a>
in the request body. The user object must have an email, password, and role.
</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>
For
<a href="/docs/latest/operate/rs/7.4/security/access-control/">
RBAC-enabled clusters
</a>
, use
<code>
role_uids
</code>
instead of
<code>
role
</code>
in the request body.
</div>
</div>
<p>
<code>
email_alerts
</code>
can be configured either as:
</p>
<ul>
<li>
<p>
<code>
true
</code>
- user will receive alerts for all databases configured in
<code>
bdbs_email_alerts
</code>
. The user will receive alerts for all databases by default if
<code>
bdbs_email_alerts
</code>
is not configured.
<code>
bdbs_email_alerts
</code>
can be a list of database UIDs or
<code>
[βallβ]
</code>
meaning all databases.
</p>
</li>
<li>
<p>
<code>
false
</code>
- user will not receive alerts for any databases
</p>
</li>
</ul>
<h5 id="example-json-body-4">
Example JSON body
</h5>
<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">"email"</span><span class="p">:</span> <span class="s2">"[email protected]"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"password"</span><span class="p">:</span> <span class="s2">"my-password"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"name"</span><span class="p">:</span> <span class="s2">"Pat Doe"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"email_alerts"</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">"bdbs_email_alerts"</span><span class="p">:</span> <span class="p">[</span><span class="s2">"1"</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_uids"</span><span class="p">:</span> <span class="p">[</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span> <span class="p">],</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"auth_method"</span><span class="p">:</span> <span class="s2">"regular"</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span></code></pre>
</div>
<h3 id="post-response">
Response
</h3>
<p>
Returns the newly created
<a href="/docs/latest/operate/rs/7.4/references/rest-api/objects/user/">
user object
</a>
.
</p>
<h4 id="example-json-body-5">
Example JSON body
</h4>
<div class="highlight">
<pre class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"uid"</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"password_issue_date"</span><span class="p">:</span> <span class="s2">"2017-03-07T15:11:08Z"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"email"</span><span class="p">:</span> <span class="s2">"[email protected]"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"name"</span><span class="p">:</span> <span class="s2">"Pat Doe"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"email_alerts"</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">"bdbs_email_alerts"</span><span class="p">:</span> <span class="p">[</span><span class="s2">"1"</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">"db_viewer"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"role_uids"</span><span class="p">:</span> <span class="p">[</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span> <span class="p">],</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"auth_method"</span><span class="p">:</span> <span class="s2">"regular"</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span></code></pre>
</div>
<h3 id="post-error-codes">
Error codes
</h3>
<p>
When errors are reported, the server may return a JSON object with
<code>
error_code
</code>
and
<code>
message
</code>
field that provide additional information.
</p>
<p>
The following are possible
<code>
error_code
</code>
values:
</p>
<table>
<thead>
<tr>
<th>
Code
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
password_not_complex
</td>
<td>
The given password is not complex enough (Only works when the password_complexity feature is enabled).
</td>
</tr>
<tr>
<td>
email_already_exists
</td>
<td>
The given email is already taken.
</td>
</tr>
<tr>
<td>
name_already_exists
</td>
<td>
The given name is already taken.
</td>
</tr>
</tbody>
</table>
<h3 id="post-status-codes">
Status codes
</h3>
<table>
<thead>
<tr>
<th>
Code
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1">
200 OK
</a>
</td>
<td>
Success, user is created.
</td>
</tr>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1">
400 Bad Request
</a>
</td>
<td>
Bad or missing configuration parameters.
</td>
</tr>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.10">
409 Conflict
</a>
</td>
<td>
User with the same email already exists.
</td>
</tr>
</tbody>
</table>
<h3 id="examples">
Examples
</h3>
<h4 id="curl">
cURL
</h4>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ curl -k -X POST -u <span class="s1">'[username]:[password]'</span> <span class="se">\
</span></span></span><span class="line"><span class="cl"><span class="se"></span> -H <span class="s1">'Content-Type: application/json'</span> <span class="se">\
</span></span></span><span class="line"><span class="cl"><span class="se"></span> -d <span class="s1">'{ "email": "[email protected]", \
</span></span></span><span class="line"><span class="cl"><span class="s1"> "password": "my-password", \
</span></span></span><span class="line"><span class="cl"><span class="s1"> "name": "Pat Doe", \
</span></span></span><span class="line"><span class="cl"><span class="s1"> "email_alerts": true, \
</span></span></span><span class="line"><span class="cl"><span class="s1"> "bdbs_email_alerts": ["1","2"], \
</span></span></span><span class="line"><span class="cl"><span class="s1"> "role_uids": [ 3, 4 ], \
</span></span></span><span class="line"><span class="cl"><span class="s1"> "auth_method": "regular" }'</span> <span class="se">\
</span></span></span><span class="line"><span class="cl"><span class="se"></span> <span class="s1">'https://[host][:port]/v1/users'</span>
</span></span></code></pre>
</div>
<h4 id="python">
Python
</h4>
<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">requests</span>
</span></span><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></span><span class="line"><span class="cl"><span class="n">url</span> <span class="o">=</span> <span class="s2">"https://[host][:port]/v1/users"</span>
</span></span><span class="line"><span class="cl"><span class="n">auth</span> <span class="o">=</span> <span class="p">(</span><span class="s2">"[username]"</span><span class="p">,</span> <span class="s2">"[password]"</span><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">payload</span> <span class="o">=</span> <span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">({</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"email"</span><span class="p">:</span> <span class="s2">"[email protected]"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"password"</span><span class="p">:</span> <span class="s2">"my-password"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"name"</span><span class="p">:</span> <span class="s2">"Pat Doe"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"email_alerts"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"bdbs_email_alerts"</span><span class="p">:</span> <span class="p">[</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"1"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"2"</span>
</span></span><span class="line"><span class="cl"> <span class="p">],</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"role_uids"</span><span class="p">:</span> <span class="p">[</span>
</span></span><span class="line"><span class="cl"> <span class="mi">3</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="mi">4</span>
</span></span><span class="line"><span class="cl"> <span class="p">],</span>
</span></span><span class="line"><span class="cl"> <span class="s2">"auth_method"</span><span class="p">:</span> <span class="s2">"regular"</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">headers</span> <span class="o">=</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="s1">'Content-Type'</span><span class="p">:</span> <span class="s1">'application/json'</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">response</span> <span class="o">=</span> <span class="n">requests</span><span class="o">.</span><span class="n">request</span><span class="p">(</span><span class="s2">"POST"</span><span class="p">,</span> <span class="n">url</span><span class="p">,</span> <span class="n">auth</span><span class="o">=</span><span class="n">auth</span><span class="p">,</span> <span class="n">headers</span><span class="o">=</span><span class="n">headers</span><span class="p">,</span> <span class="n">data</span><span class="o">=</span><span class="n">payload</span><span class="p">,</span> <span class="n">verify</span><span class="o">=</span><span class="kc">False</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">response</span><span class="o">.</span><span class="n">text</span><span class="p">)</span>
</span></span></code></pre>
</div>
<h2 id="delete-user">
Delete user
</h2>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">DELETE /v1/users/<span class="o">{</span>int: uid<span class="o">}</span>
</span></span></code></pre>
</div>
<p>
Delete a user.
</p>
<h3 id="permissions-4">
Permissions
</h3>
<table>
<thead>
<tr>
<th>
Permission name
</th>
<th>
Roles
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="/docs/latest/operate/rs/7.4/references/rest-api/permissions/#delete_user">
delete_user
</a>
</td>
<td>
admin
</td>
</tr>
</tbody>
</table>
<h3 id="delete-request">
Request
</h3>
<h4 id="example-http-request-4">
Example HTTP request
</h4>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">DELETE /users/1
</span></span></code></pre>
</div>
<h4 id="headers-4">
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-2">
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 user's unique ID
</td>
</tr>
</tbody>
</table>
<h3 id="delete-response">
Response
</h3>
<p>
Returns a status code to indicate the success or failure of the user deletion.
</p>
<h3 id="delete-status-codes">
Status codes
</h3>
<table>
<thead>
<tr>
<th>
Code
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1">
200 OK
</a>
</td>
<td>
Success, the user is deleted.
</td>
</tr>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.7">
406 Not Acceptable
</a>
</td>
<td>
The request is not acceptable.
</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/users/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/7.4/references/rest-api/objects/crdb/modify_request/.html | <section class="prose w-full py-12 max-w-none">
<h1>
CRDB modify request object
</h1>
<p class="text-lg -mt-5 mb-10">
An object to update an Active-Active database
</p>
<p>
An object to update an Active-Active database.
</p>
<table>
<thead>
<tr>
<th>
Name
</th>
<th>
Type/Value
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
add_instances
</td>
<td>
array of
<a href="/docs/latest/operate/rs/7.4/references/rest-api/objects/crdb/instance_info/">
CRDB instance_info
</a>
objects
</td>
<td>
List of new CRDB instances
</td>
</tr>
<tr>
<td>
crdb
</td>
<td>
<a href="/docs/latest/operate/rs/7.4/references/rest-api/objects/crdb/">
CRDB
</a>
object
</td>
<td>
An object that represents an Active-Active database
</td>
</tr>
<tr>
<td>
force_update
</td>
<td>
boolean
</td>
<td>
(Warning: This flag can cause unintended and dangerous changes) Force the configuration update and increment the configuration version even if there is no change to the configuration parameters. If you use force, you can mistakenly cause the other instances to update to the configuration version even though it was not changed.
</td>
</tr>
<tr>
<td>
remove_instances
</td>
<td>
array of integers
</td>
<td>
List of unique instance IDs
</td>
</tr>
<tr>
<td>
remove_instances.force_remove
</td>
<td>
boolean
</td>
<td>
Force removal of instance from the Active-Active database. Before we remove an instance from an Active-Active database, all of the operations that the instance received from clients must be propagated to the other instances. This is the safe method to remove an instance from the Active-Active database. If the instance does not have connectivity to other instances, the propagation fails and removal fails. To remove an instance that does not have connectivity to other instances, you must use the force flag. The removed instance keeps its data and configuration for the instance. After you remove an instance by force, you must use the purge_instances API on the removed instance.
</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/crdb/modify_request/"/>
<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.profile.html | <section class="prose w-full py-12">
<h1 class="command-name">
FT.PROFILE
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">FT.PROFILE index SEARCH | AGGREGATE [LIMITED] QUERY query
</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 2.2.0
</a>
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
Time complexity:
</dt>
<dd class="m-0">
O(N)
</dd>
</dl>
<p>
Apply
<a href="/docs/latest/commands/ft.search/">
<code>
FT.SEARCH
</code>
</a>
or
<a href="/docs/latest/commands/ft.aggregate/">
<code>
FT.AGGREGATE
</code>
</a>
command to collect performance details. For usage, see
<a href="#examples">
Examples
</a>
.
</p>
<h2 id="required-arguments">
Required arguments
</h2>
<details open="">
<summary>
<code>
index
</code>
</summary>
<p>
is the name of an index created using
<a href="/docs/latest/commands/ft.create/">
<code>
FT.CREATE
</code>
</a>
.
</p>
</details>
<details open="">
<summary>
<code>
SEARCH | AGGREGATE
</code>
</summary>
<p>
represents the profile type, either
<a href="/docs/latest/commands/ft.search/">
<code>
FT.SEARCH
</code>
</a>
or
<a href="/docs/latest/commands/ft.aggregate/">
<code>
FT.AGGREGATE
</code>
</a>
.
</p>
</details>
<details open="">
<summary>
<code>
LIMITED
</code>
</summary>
<p>
removes details of any
<code>
reader
</code>
iterators.
</p>
</details>
<details open="">
<summary>
<code>
QUERY {query}
</code>
</summary>
<p>
is the query string, sent to
<code>
FT.SEARCH
</code>
or
<code>
FT.AGGREGATE
</code>
.
</p>
</details>
<p>
<note>
<b>
Note:
</b>
To reduce the size of the output, use
<code>
NOCONTENT
</code>
or
<code>
LIMIT 0 0
</code>
to reduce the number of reply results, or
<code>
LIMITED
</code>
to not reply with details of
<code>
reader iterators
</code>
inside built-in unions, such as
<code>
fuzzy
</code>
or
<code>
prefix
</code>
iterators.
</note>
</p>
<h2 id="return">
Return
</h2>
<p>
<code>
FT.PROFILE
</code>
returns a two-element array reply. The first element contains the results of the provided
<code>
FT.SEARCH
</code>
or
<code>
FT.AGGREGATE
</code>
command.
The second element contains information about query creation, iterator profiles, and result processor profiles.
Details of the second element follow in the sections below.
</p>
<h3 id="results">
Results
</h3>
<p>
This section contains the search results.
</p>
<h3 id="per-shard-profiles">
Per-shard profiles
</h3>
<p>
This section contains query execution details for each shard.
When more than one shard is in play, the shards will be labeled
<code>
Shard #1
</code>
,
<code>
Shard #2
</code>
, etc.
If there's only one shard, the label will be omitted.
</p>
<table>
<thead>
<tr>
<th style="text-align:left">
Returned field name
</th>
<th style="text-align:left">
Definition
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">
<code>
Total
</code>
<code>
profile
</code>
<code>
time
</code>
</td>
<td style="text-align:left">
The total run time (ms) of the query. Normally just a few ms.
</td>
</tr>
<tr>
<td style="text-align:left">
<code>
Parsing
</code>
<code>
time
</code>
</td>
<td style="text-align:left">
The time (ms) spent parsing the query and its parameters into a query plan. Normally just a few ms.
</td>
</tr>
<tr>
<td style="text-align:left">
<code>
Pipeline
</code>
<code>
creation
</code>
<code>
time
</code>
</td>
<td style="text-align:left">
The creation time (ms) of the execution plan, including iterators, result processors, and reducers creation. Normally just a few ms for
<code>
FT.SEARCH
</code>
queries, but expect a larger number for
<code>
FT.AGGREGATE
</code>
queries.
</td>
</tr>
<tr>
<td style="text-align:left">
<code>
Warning
</code>
</td>
<td style="text-align:left">
Errors that occurred during query execution.
</td>
</tr>
</tbody>
</table>
<h3 id="iterator-profiles">
Iterator profiles
</h3>
<p>
This section contains index iterator information, including
<code>
Type
</code>
,
<code>
Query Type
</code>
,
<code>
Term
</code>
(when applicable),
<code>
Time
</code>
(in ms),
<code>
Counter
</code>
,
<code>
Child iterator
</code>
, and
<code>
Size
</code>
information.
Each iterator represents an executor for each part of the query plan, nested per the execution plan. The operation types mentioned below (
<code>
UNION
</code>
, etc) should match up with the provided query.
</p>
<p>
Inverted-index iterators also include the number of elements they contain. Hybrid vector iterators return the top results from the vector index in batches, including the number of batches.
</p>
<p>
Iterator types include:
</p>
<ul>
<li>
<code>
INTERSECT
</code>
(and) with
<code>
Child iterator
</code>
</li>
<li>
<code>
UNION
</code>
(or) with
<code>
Child iterator
</code>
</li>
<li>
<code>
NOT
</code>
(
<code>
-
</code>
) with
<code>
Child iterator
</code>
</li>
<li>
<code>
Child iterator
</code>
- details of a sub-query component of a compound query.
</li>
<li>
<code>
TEXT
</code>
with
<code>
Term
</code>
</li>
<li>
<code>
TAG
</code>
with
<code>
Term
</code>
</li>
<li>
<code>
NUMERIC
</code>
with
<code>
Term
</code>
</li>
<li>
<code>
VECTOR
</code>
</li>
<li>
<code>
EMPTY
</code>
</li>
<li>
<code>
WILDCARD
</code>
</li>
<li>
<code>
OPTIONAL
</code>
</li>
</ul>
<p>
<strong>
Notes on
<code>
Counter
</code>
and
<code>
Size
</code>
</strong>
</p>
<p>
Counter is the number of times an iterator was interacted with. A very high value in comparison to others is a possible warning flag.
<code>
NUMERIC
</code>
and
<code>
Child interator
</code>
types are broken into ranges, and
<code>
Counter
</code>
will vary depending on the range. For
<code>
UNION
</code>
, the sum of the counters in child iterators should be equal or greater than the child iteratorβs counters.
</p>
<p>
<code>
Size
</code>
is the size of the document set.
<code>
Counter
</code>
should always be equal or less than
<code>
Size
</code>
.
</p>
<h3 id="result-processor-profiles">
Result processor profiles
</h3>
<p>
Result processors form a powerful pipeline in Redis Query Engine. They work in stages to gather, filter, score, sort, and return results as efficiently as possible based on complex query needs. Each processor reports
<code>
Time
</code>
information, which represents the total duration (in milliseconds, or ms) spent by the processor to complete its operation, and
<code>
Counter
</code>
information, which indicates the number of times the processor was invoked during the query.
</p>
<table>
<thead>
<tr>
<th style="text-align:left">
Type
</th>
<th style="text-align:left">
Definition
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">
<code>
Metrics
</code>
<code>
Applier
</code>
</td>
<td style="text-align:left">
The
<code>
Metrics Applier
</code>
processor calculates or aggregates specific metrics related to the search results. For example, this might include applying a distance or similarity metric to vector search results, or calculating scores based on relevance or other parameters.
</td>
</tr>
<tr>
<td style="text-align:left">
<code>
Index
</code>
</td>
<td style="text-align:left">
The
<code>
Index
</code>
processor is responsible for the core retrieval of matching documents from the index based on the initial query criteria (e.g., full-text terms, filters, or numeric ranges).
</td>
</tr>
<tr>
<td style="text-align:left">
<code>
Scorer
</code>
</td>
<td style="text-align:left">
The
<code>
Scorer
</code>
processor assigns a relevance score to each document based on the queryβs specified scoring function. This function could involve factors like term frequency, inverse document frequency, or other weighted metrics.
</td>
</tr>
<tr>
<td style="text-align:left">
<code>
Sorter
</code>
</td>
<td style="text-align:left">
The
<code>
Sorter
</code>
processor arranges the query results based on a specified sorting criterion. This could be a field value (e.g., sorting by price, date, or another attribute) or by the score assigned during the scoring phase. It operates after documents are fetched and scored, ensuring the results are ordered as required by the query (e.g., ascending or descending order).
<code>
Scorer
</code>
results will always be present in
<code>
FT.SEARCH
</code>
profiles.
</td>
</tr>
<tr>
<td style="text-align:left">
<code>
Loader
</code>
</td>
<td style="text-align:left">
The
<code>
Loader
</code>
processor retrieves the document contents after the results have been sorted and filtered. It ensures that only the fields specified by the query are loaded, which improves efficiency, especially when dealing with large documents where only a few fields are needed.
</td>
</tr>
<tr>
<td style="text-align:left">
<code>
Highlighter
</code>
</td>
<td style="text-align:left">
The
<code>
Highlighter
</code>
processor is used to highlight matching terms in the search results. This is especially useful for full-text search applications, where relevant terms are often emphasized in the UI.
</td>
</tr>
<tr>
<td style="text-align:left">
<code>
Paginator
</code>
</td>
<td style="text-align:left">
The
<code>
Paginator
</code>
processor is responsible for handling pagination by limiting the results to a specific range (e.g., LIMIT 0 10).It trims down the set of results to fit the required pagination window, ensuring efficient memory usage when dealing with large result sets.
</td>
</tr>
<tr>
<td style="text-align:left">
<code>
Vector
</code>
<code>
Filter
</code>
</td>
<td style="text-align:left">
For vector searches, the
<code>
Vector Filter
</code>
processor is sometimes used to pre-process results based on vector similarity thresholds before the main scoring and sorting.
</td>
</tr>
</tbody>
</table>
<h3 id="coordinator">
Coordinator
</h3>
<p>
This section is only present when run in a multi-shard environment.
</p>
<table>
<thead>
<tr>
<th style="text-align:left">
Returned field name
</th>
<th style="text-align:left">
Definition
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">
<code>
Total coordinator time
</code>
</td>
<td style="text-align:left">
Time measured from the beginning of query execution until all shards have completed query execution. (ms)
</td>
</tr>
<tr>
<td style="text-align:left">
<code>
Post-processing time
</code>
</td>
<td style="text-align:left">
The time spent generating the FT.PROFILE output (overhead) (ms).
</td>
</tr>
</tbody>
</table>
<h2 id="examples">
Examples
</h2>
<details>
<summary>
<b>
Collect performance information about a simple JSON index.
</b>
</summary>
<p>
Imagine you have (1) a dataset consisting of 10 JSON documents, each with the following structure;
</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">"pickup_zone"</span><span class="p">:</span> <span class="s2">"POLYGON((-74.0610 40.7578, -73.9510 40.7578, -73.9510 40.6678, -74.0610 40.6678, -74.0610 40.7578))"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"store_location"</span><span class="p">:</span> <span class="s2">"-74.0060,40.7128"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"brand"</span><span class="p">:</span> <span class="s2">"Velorim"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"model"</span><span class="p">:</span> <span class="s2">"Jigger"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"price"</span><span class="p">:</span> <span class="mi">270</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"description"</span><span class="p">:</span> <span class="s2">"Small and powerful, the Jigger is the best ride for the smallest of tikes! This is the tiniest kidsβ pedal bike on the market available without a coaster brake, the Jigger is the vehicle of choice for the rare tenacious little rider raring to go."</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"condition"</span><span class="p">:</span> <span class="s2">"new"</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span></code></pre>
</div>
<p>
And (2) a corresponding index:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">FT.CREATE idx:bicycle ON JSON PREFIX <span class="m">1</span> bicycle: SCORE 1.0 SCHEMA $.pickup_zone AS pickup_zone GEOSHAPE $.store_location AS store_location GEO $.brand AS brand TEXT WEIGHT 1.0 $.model AS model TEXT WEIGHT 1.0 $.description AS description TEXT WEIGHT 1.0 $.price AS price NUMERIC $.condition AS condition TAG SEPARATOR ,
</span></span></code></pre>
</div>
<p>
Here's an example of running the
<code>
FT.PROFILE
</code>
command for a compound query.
</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.profile idx:bicycle search query <span class="s2">"@description:(kids | small) @condition:{new | used}"</span>
</span></span><span class="line"><span class="cl">1<span class="o">)</span> 1<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"> 2<span class="o">)</span> <span class="s2">"bicycle:0"</span>
</span></span><span class="line"><span class="cl"> 3<span class="o">)</span> 1<span class="o">)</span> <span class="s2">"</span>$<span class="s2">"</span>
</span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="s2">"{\"pickup_zone\":\"POLYGON((-74.0610 40.7578, -73.9510 40.7578, -73.9510 40.6678, -74.0610 40.6678, -74.0610 40.7578))\",\"store_location\":\"-74.0060,40.7128\",\"brand\":\"Velorim\",\"model\":\"Jigger\",\"price\":270,\"description\":\"Small and powerful, the Jigger is the best ride for the smallest of tikes! This is the tiniest kids\xe2\x80\x99 pedal bike on the market available without a coaster brake, the Jigger is the vehicle of choice for the rare tenacious little rider raring to go.\",\"condition\":\"new\"}"</span>
</span></span><span class="line"><span class="cl"> 4<span class="o">)</span> <span class="s2">"bicycle:1"</span>
</span></span><span class="line"><span class="cl"> 5<span class="o">)</span> 1<span class="o">)</span> <span class="s2">"</span>$<span class="s2">"</span>
</span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="s2">"{\"pickup_zone\":\"POLYGON((-118.2887 34.0972, -118.1987 34.0972, -118.1987 33.9872, -118.2887 33.9872, -118.2887 34.0972))\",\"store_location\":\"-118.2437,34.0522\",\"brand\":\"Bicyk\",\"model\":\"Hillcraft\",\"price\":1200,\"description\":\"Kids want to ride with as little weight as possible. Especially on an incline! They may be at the age when a 27.5\\\" wheel bike is just too clumsy coming off a 24\\\" bike. The Hillcraft 26 is just the solution they need!\",\"condition\":\"used\"}"</span>
</span></span><span class="line"><span class="cl"> 6<span class="o">)</span> <span class="s2">"bicycle:2"</span>
</span></span><span class="line"><span class="cl"> 7<span class="o">)</span> 1<span class="o">)</span> <span class="s2">"</span>$<span class="s2">"</span>
</span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="s2">"{\"pickup_zone\":\"POLYGON((-87.6848 41.9331, -87.5748 41.9331, -87.5748 41.8231, -87.6848 41.8231, -87.6848 41.9331))\",\"store_location\":\"-87.6298,41.8781\",\"brand\":\"Nord\",\"model\":\"Chook air 5\",\"price\":815,\"description\":\"The Chook Air 5 gives kids aged six years and older a durable and uberlight mountain bike for their first experience on tracks and easy cruising through forests and fields. The lower top tube makes it easy to mount and dismount in any situation, giving your kids greater safety on the trails.\",\"condition\":\"used\"}"</span>
</span></span><span class="line"><span class="cl">2<span class="o">)</span> 1<span class="o">)</span> 1<span class="o">)</span> Total profile <span class="nb">time</span>
</span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="s2">"0"</span>
</span></span><span class="line"><span class="cl"> 2<span class="o">)</span> 1<span class="o">)</span> Parsing <span class="nb">time</span>
</span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="s2">"0"</span>
</span></span><span class="line"><span class="cl"> 3<span class="o">)</span> 1<span class="o">)</span> Pipeline creation <span class="nb">time</span>
</span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="s2">"0"</span>
</span></span><span class="line"><span class="cl"> 4<span class="o">)</span> 1<span class="o">)</span> Warning
</span></span><span class="line"><span class="cl"> 5<span class="o">)</span> 1<span class="o">)</span> Iterators profile
</span></span><span class="line"><span class="cl"> 2<span class="o">)</span> 1<span class="o">)</span> Type
</span></span><span class="line"><span class="cl"> 2<span class="o">)</span> INTERSECT
</span></span><span class="line"><span class="cl"> 3<span class="o">)</span> Time
</span></span><span class="line"><span class="cl"> 4<span class="o">)</span> <span class="s2">"0"</span>
</span></span><span class="line"><span class="cl"> 5<span class="o">)</span> Counter
</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">6</span>
</span></span><span class="line"><span class="cl"> 7<span class="o">)</span> Child iterators
</span></span><span class="line"><span class="cl"> 8<span class="o">)</span> 1<span class="o">)</span> Type
</span></span><span class="line"><span class="cl"> 2<span class="o">)</span> UNION
</span></span><span class="line"><span class="cl"> 3<span class="o">)</span> Query <span class="nb">type</span>
</span></span><span class="line"><span class="cl"> 4<span class="o">)</span> UNION
</span></span><span class="line"><span class="cl"> 5<span class="o">)</span> Time
</span></span><span class="line"><span class="cl"> 6<span class="o">)</span> <span class="s2">"0"</span>
</span></span><span class="line"><span class="cl"> 7<span class="o">)</span> Counter
</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"> 9<span class="o">)</span> Child iterators
</span></span><span class="line"><span class="cl"> 10<span class="o">)</span> 1<span class="o">)</span> Type
</span></span><span class="line"><span class="cl"> 2<span class="o">)</span> UNION
</span></span><span class="line"><span class="cl"> 3<span class="o">)</span> Query <span class="nb">type</span>
</span></span><span class="line"><span class="cl"> 4<span class="o">)</span> UNION
</span></span><span class="line"><span class="cl"> 5<span class="o">)</span> Time
</span></span><span class="line"><span class="cl"> 6<span class="o">)</span> <span class="s2">"0"</span>
</span></span><span class="line"><span class="cl"> 7<span class="o">)</span> Counter
</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">4</span>
</span></span><span class="line"><span class="cl"> 9<span class="o">)</span> Child iterators
</span></span><span class="line"><span class="cl"> 10<span class="o">)</span> 1<span class="o">)</span> Type
</span></span><span class="line"><span class="cl"> 2<span class="o">)</span> TEXT
</span></span><span class="line"><span class="cl"> 3<span class="o">)</span> Term
</span></span><span class="line"><span class="cl"> 4<span class="o">)</span> kids
</span></span><span class="line"><span class="cl"> 5<span class="o">)</span> Time
</span></span><span class="line"><span class="cl"> 6<span class="o">)</span> <span class="s2">"0"</span>
</span></span><span class="line"><span class="cl"> 7<span class="o">)</span> Counter
</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">4</span>
</span></span><span class="line"><span class="cl"> 9<span class="o">)</span> Size
</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">4</span>
</span></span><span class="line"><span class="cl"> 11<span class="o">)</span> 1<span class="o">)</span> Type
</span></span><span class="line"><span class="cl"> 2<span class="o">)</span> TEXT
</span></span><span class="line"><span class="cl"> 3<span class="o">)</span> Term
</span></span><span class="line"><span class="cl"> 4<span class="o">)</span> +kid
</span></span><span class="line"><span class="cl"> 5<span class="o">)</span> Time
</span></span><span class="line"><span class="cl"> 6<span class="o">)</span> <span class="s2">"0"</span>
</span></span><span class="line"><span class="cl"> 7<span class="o">)</span> Counter
</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">4</span>
</span></span><span class="line"><span class="cl"> 9<span class="o">)</span> Size
</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">4</span>
</span></span><span class="line"><span class="cl"> 11<span class="o">)</span> 1<span class="o">)</span> Type
</span></span><span class="line"><span class="cl"> 2<span class="o">)</span> TEXT
</span></span><span class="line"><span class="cl"> 3<span class="o">)</span> Term
</span></span><span class="line"><span class="cl"> 4<span class="o">)</span> small
</span></span><span class="line"><span class="cl"> 5<span class="o">)</span> Time
</span></span><span class="line"><span class="cl"> 6<span class="o">)</span> <span class="s2">"0"</span>
</span></span><span class="line"><span class="cl"> 7<span class="o">)</span> Counter
</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">2</span>
</span></span><span class="line"><span class="cl"> 9<span class="o">)</span> Size
</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">2</span>
</span></span><span class="line"><span class="cl"> 9<span class="o">)</span> 1<span class="o">)</span> Type
</span></span><span class="line"><span class="cl"> 2<span class="o">)</span> UNION
</span></span><span class="line"><span class="cl"> 3<span class="o">)</span> Query <span class="nb">type</span>
</span></span><span class="line"><span class="cl"> 4<span class="o">)</span> TAG
</span></span><span class="line"><span class="cl"> 5<span class="o">)</span> Time
</span></span><span class="line"><span class="cl"> 6<span class="o">)</span> <span class="s2">"0"</span>
</span></span><span class="line"><span class="cl"> 7<span class="o">)</span> Counter
</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"> 9<span class="o">)</span> Child iterators
</span></span><span class="line"><span class="cl"> 10<span class="o">)</span> 1<span class="o">)</span> Type
</span></span><span class="line"><span class="cl"> 2<span class="o">)</span> TAG
</span></span><span class="line"><span class="cl"> 3<span class="o">)</span> Term
</span></span><span class="line"><span class="cl"> 4<span class="o">)</span> new
</span></span><span class="line"><span class="cl"> 5<span class="o">)</span> Time
</span></span><span class="line"><span class="cl"> 6<span class="o">)</span> <span class="s2">"0"</span>
</span></span><span class="line"><span class="cl"> 7<span class="o">)</span> Counter
</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">4</span>
</span></span><span class="line"><span class="cl"> 9<span class="o">)</span> Size
</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">10</span>
</span></span><span class="line"><span class="cl"> 11<span class="o">)</span> 1<span class="o">)</span> Type
</span></span><span class="line"><span class="cl"> 2<span class="o">)</span> TAG
</span></span><span class="line"><span class="cl"> 3<span class="o">)</span> Term
</span></span><span class="line"><span class="cl"> 4<span class="o">)</span> used
</span></span><span class="line"><span class="cl"> 5<span class="o">)</span> Time
</span></span><span class="line"><span class="cl"> 6<span class="o">)</span> <span class="s2">"0"</span>
</span></span><span class="line"><span class="cl"> 7<span class="o">)</span> Counter
</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">4</span>
</span></span><span class="line"><span class="cl"> 9<span class="o">)</span> Size
</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">8</span>
</span></span><span class="line"><span class="cl"> 6<span class="o">)</span> 1<span class="o">)</span> Result processors profile
</span></span><span class="line"><span class="cl"> 2<span class="o">)</span> 1<span class="o">)</span> Type
</span></span><span class="line"><span class="cl"> 2<span class="o">)</span> Index
</span></span><span class="line"><span class="cl"> 3<span class="o">)</span> Time
</span></span><span class="line"><span class="cl"> 4<span class="o">)</span> <span class="s2">"0"</span>
</span></span><span class="line"><span class="cl"> 5<span class="o">)</span> Counter
</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">3</span>
</span></span><span class="line"><span class="cl"> 3<span class="o">)</span> 1<span class="o">)</span> Type
</span></span><span class="line"><span class="cl"> 2<span class="o">)</span> Scorer
</span></span><span class="line"><span class="cl"> 3<span class="o">)</span> Time
</span></span><span class="line"><span class="cl"> 4<span class="o">)</span> <span class="s2">"0"</span>
</span></span><span class="line"><span class="cl"> 5<span class="o">)</span> Counter
</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">3</span>
</span></span><span class="line"><span class="cl"> 4<span class="o">)</span> 1<span class="o">)</span> Type
</span></span><span class="line"><span class="cl"> 2<span class="o">)</span> Sorter
</span></span><span class="line"><span class="cl"> 3<span class="o">)</span> Time
</span></span><span class="line"><span class="cl"> 4<span class="o">)</span> <span class="s2">"0"</span>
</span></span><span class="line"><span class="cl"> 5<span class="o">)</span> Counter
</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">3</span>
</span></span><span class="line"><span class="cl"> 5<span class="o">)</span> 1<span class="o">)</span> Type
</span></span><span class="line"><span class="cl"> 2<span class="o">)</span> Loader
</span></span><span class="line"><span class="cl"> 3<span class="o">)</span> Time
</span></span><span class="line"><span class="cl"> 4<span class="o">)</span> <span class="s2">"0"</span>
</span></span><span class="line"><span class="cl"> 5<span class="o">)</span> Counter
</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">3</span></span></span></code></pre>
</div>
</details>
<details>
<summary>
<b>
Collect performance information about a JSON index that includes vector data.
</b>
</summary>
<p>
For this example, you'll create a very simple vector database and index.
</p>
<p>
Index:
</p>
<pre tabindex="0"><code class="language-redis" data-lang="redis">FT.CREATE vss_idx ON JSON PREFIX 1 vec: SCHEMA $.vector AS vector VECTOR FLAT 6 TYPE FLOAT32 DIM 4 DISTANCE_METRIC L2
</code></pre>
<p>
Database:
</p>
<pre tabindex="0"><code class="language-redis" data-lang="redis">JSON.SET vec:1 $ '{"vector":[1,1,1,1]}'
JSON.SET vec:2 $ '{"vector":[2,2,2,2]}'
JSON.SET vec:3 $ '{"vector":[3,3,3,3]}'
JSON.SET vec:4 $ '{"vector":[4,4,4,4]}'
</code></pre>
<p>
Here's an example of running the
<code>
FT.PROFILE
</code>
command for a vector query.
</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.profile vss_idx search query <span class="s2">"*=>[KNN 3 @vector </span><span class="nv">$query_vec</span><span class="s2">]"</span> PARAMS <span class="m">2</span> query_vec <span class="s2">"\x00\x00\x00@\x00\x00\x00@\x00\x00@@\x00\x00@@"</span> SORTBY __vector_score DIALECT <span class="m">2</span>
</span></span><span class="line"><span class="cl">1<span class="o">)</span> 1<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"> 2<span class="o">)</span> <span class="s2">"vec:2"</span>
</span></span><span class="line"><span class="cl"> 3<span class="o">)</span> 1<span class="o">)</span> <span class="s2">"__vector_score"</span>
</span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="s2">"2"</span>
</span></span><span class="line"><span class="cl"> 3<span class="o">)</span> <span class="s2">"</span>$<span class="s2">"</span>
</span></span><span class="line"><span class="cl"> 4<span class="o">)</span> <span class="s2">"{\"vector\":[2,2,2,2]}"</span>
</span></span><span class="line"><span class="cl"> 4<span class="o">)</span> <span class="s2">"vec:3"</span>
</span></span><span class="line"><span class="cl"> 5<span class="o">)</span> 1<span class="o">)</span> <span class="s2">"__vector_score"</span>
</span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="s2">"2"</span>
</span></span><span class="line"><span class="cl"> 3<span class="o">)</span> <span class="s2">"</span>$<span class="s2">"</span>
</span></span><span class="line"><span class="cl"> 4<span class="o">)</span> <span class="s2">"{\"vector\":[3,3,3,3]}"</span>
</span></span><span class="line"><span class="cl"> 6<span class="o">)</span> <span class="s2">"vec:1"</span>
</span></span><span class="line"><span class="cl"> 7<span class="o">)</span> 1<span class="o">)</span> <span class="s2">"__vector_score"</span>
</span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="s2">"10"</span>
</span></span><span class="line"><span class="cl"> 3<span class="o">)</span> <span class="s2">"</span>$<span class="s2">"</span>
</span></span><span class="line"><span class="cl"> 4<span class="o">)</span> <span class="s2">"{\"vector\":[1,1,1,1]}"</span>
</span></span><span class="line"><span class="cl">2<span class="o">)</span> 1<span class="o">)</span> 1<span class="o">)</span> Total profile <span class="nb">time</span>
</span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="s2">"0"</span>
</span></span><span class="line"><span class="cl"> 2<span class="o">)</span> 1<span class="o">)</span> Parsing <span class="nb">time</span>
</span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="s2">"0"</span>
</span></span><span class="line"><span class="cl"> 3<span class="o">)</span> 1<span class="o">)</span> Pipeline creation <span class="nb">time</span>
</span></span><span class="line"><span class="cl"> 2<span class="o">)</span> <span class="s2">"0"</span>
</span></span><span class="line"><span class="cl"> 4<span class="o">)</span> 1<span class="o">)</span> Warning
</span></span><span class="line"><span class="cl"> 5<span class="o">)</span> 1<span class="o">)</span> Iterators profile
</span></span><span class="line"><span class="cl"> 2<span class="o">)</span> 1<span class="o">)</span> Type
</span></span><span class="line"><span class="cl"> 2<span class="o">)</span> VECTOR
</span></span><span class="line"><span class="cl"> 3<span class="o">)</span> Time
</span></span><span class="line"><span class="cl"> 4<span class="o">)</span> <span class="s2">"0"</span>
</span></span><span class="line"><span class="cl"> 5<span class="o">)</span> Counter
</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">3</span>
</span></span><span class="line"><span class="cl"> 6<span class="o">)</span> 1<span class="o">)</span> Result processors profile
</span></span><span class="line"><span class="cl"> 2<span class="o">)</span> 1<span class="o">)</span> Type
</span></span><span class="line"><span class="cl"> 2<span class="o">)</span> Index
</span></span><span class="line"><span class="cl"> 3<span class="o">)</span> Time
</span></span><span class="line"><span class="cl"> 4<span class="o">)</span> <span class="s2">"0"</span>
</span></span><span class="line"><span class="cl"> 5<span class="o">)</span> Counter
</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">3</span>
</span></span><span class="line"><span class="cl"> 3<span class="o">)</span> 1<span class="o">)</span> Type
</span></span><span class="line"><span class="cl"> 2<span class="o">)</span> Metrics Applier
</span></span><span class="line"><span class="cl"> 3<span class="o">)</span> Time
</span></span><span class="line"><span class="cl"> 4<span class="o">)</span> <span class="s2">"0"</span>
</span></span><span class="line"><span class="cl"> 5<span class="o">)</span> Counter
</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">3</span>
</span></span><span class="line"><span class="cl"> 4<span class="o">)</span> 1<span class="o">)</span> Type
</span></span><span class="line"><span class="cl"> 2<span class="o">)</span> Sorter
</span></span><span class="line"><span class="cl"> 3<span class="o">)</span> Time
</span></span><span class="line"><span class="cl"> 4<span class="o">)</span> <span class="s2">"0"</span>
</span></span><span class="line"><span class="cl"> 5<span class="o">)</span> Counter
</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">3</span>
</span></span><span class="line"><span class="cl"> 5<span class="o">)</span> 1<span class="o">)</span> Type
</span></span><span class="line"><span class="cl"> 2<span class="o">)</span> Loader
</span></span><span class="line"><span class="cl"> 3<span class="o">)</span> Time
</span></span><span class="line"><span class="cl"> 4<span class="o">)</span> <span class="s2">"0"</span>
</span></span><span class="line"><span class="cl"> 5<span class="o">)</span> Counter
</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">3</span></span></span></code></pre>
</div>
</details>
<h2 id="see-also">
See also
</h2>
<p>
<a href="/docs/latest/commands/ft.search/">
<code>
FT.SEARCH
</code>
</a>
|
<a href="/docs/latest/commands/ft.aggregate/">
<code>
FT.AGGREGATE
</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.profile/"/>
<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/getrange/.html | <section class="prose w-full py-12">
<h1 class="command-name">
GETRANGE
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">GETRANGE key start end</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.4.0
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
Time complexity:
</dt>
<dd class="m-0">
O(N) where N is the length of the returned string. The complexity is ultimately determined by the returned length, but because creating a substring from an existing string is very cheap, it can be considered O(1) for small strings.
</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>
@string
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@slow
</code>
<span class="mr-1 last:hidden">
,
</span>
</dd>
</dl>
<p>
Returns the substring of the string value stored at
<code>
key
</code>
, determined by the
offsets
<code>
start
</code>
and
<code>
end
</code>
(both are inclusive).
Negative offsets can be used in order to provide an offset starting from the end
of the string.
So -1 means the last character, -2 the penultimate and so forth.
</p>
<p>
The function handles out of range requests by limiting the resulting range to
the actual length of the string.
</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> SET mykey "This is a string"
"OK"
redis> GETRANGE mykey 0 3
"This"
redis> GETRANGE mykey -3 -1
"ing"
redis> GETRANGE mykey 0 -1
"This is a string"
redis> GETRANGE mykey 10 100
"string"
</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#bulk-strings">
Bulk string reply
</a>
: The substring of the string value stored at key, determined by the offsets start and end (both are inclusive).
<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/getrange/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/release-notes/rs-6-4-2-releases/rs-6-4-2-69/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Redis Enterprise Software release notes 6.4.2-69 (May 2023)
</h1>
<p class="text-lg -mt-5 mb-10">
Amazon Linux 2 support. Configure envoy ports using rladmin. Added option to avoid specific nodes when using the optimized shards placement API. Added failure_detection_sensitivity to replace watchdog_profile.
</p>
<p>
This is a maintenance release for β
<a href="https://redis.com/redis-enterprise-software/download-center/software/">
βRedis Enterprise Software version 6.4.2
</a>
.
</p>
<p>
The following table shows the MD5 checksums for the available packages:
</p>
<table>
<thead>
<tr>
<th>
Package
</th>
<th>
MD5 checksum (6.4.2-69 May release)
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
Ubuntu 16
</td>
<td>
31631248672de0154ec20aee0bff9adc
</td>
</tr>
<tr>
<td>
Ubuntu 18
</td>
<td>
7d9ebd4ea5a23137d2bb3928134ea6ef
</td>
</tr>
<tr>
<td>
Ubuntu 20
</td>
<td>
357ceda7467fd66962f3cb5aa143def7
</td>
</tr>
<tr>
<td>
RedHat Enterprise Linux (RHEL) 7
<br/>
Oracle Enterprise Linux (OL) 7
</td>
<td>
4d53fcce8c80910a05ed37ab64b57a7a
</td>
</tr>
<tr>
<td>
RedHat Enterprise Linux (RHEL) 8
<br/>
Oracle Enterprise Linux (OL) 8
<br/>
Rocky Enterprise Linux
</td>
<td>
88dc6a4d96b948b086f785dc42786d03
</td>
</tr>
<tr>
<td>
Amazon Linux 2
</td>
<td>
7ed06bc0b35494e4a5c084528d6e8b9f
</td>
</tr>
</tbody>
</table>
<h2 id="new-features-and-enhancements">
New features and enhancements
</h2>
<ul>
<li>
<p>
Amazon Linux 2 support
</p>
</li>
<li>
<p>
Enhanced installation logs (RS69079, RS69571, RS77857, RS89760)
</p>
</li>
<li>
<p>
Added support for
<code>
rladmin
</code>
envoy port configuration (RS95483)
</p>
</li>
<li>
<p>
Support the option to avoid specific nodes when using optimized shards placement API (RS98795)
</p>
</li>
<li>
<p>
Check port availability before installation and upgrade (RS80815)
</p>
</li>
<li>
<p>
Added
<code>
failure_detection_sensitivity
</code>
policy to
<a href="/docs/latest/operate/rs/references/rest-api/requests/cluster/policy/">
cluster policy REST API requests
</a>
. See the
<a href="#watchdog_profile">
<code>
watchdog_profile
</code>
deprecation notice
</a>
for more details.
</p>
</li>
</ul>
<h4 id="redis-stack-v626">
Redis Stack v6.2.6
</h4>
<p>
Redis Enterprise Software v6.4.2 includes the new features delivered in the latest
<a href="https://redis.com/blog/introducing-redis-stack-6-2-6-and-7-0-6/">
Redis Stack release (6.2.6 v6)
</a>
:
</p>
<ul>
<li>
<p>
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/search/">
RediSearch v2.6.6
</a>
</p>
</li>
<li>
<p>
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/json/">
RedisJSON v2.4.7
</a>
</p>
</li>
<li>
<p>
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/bloom/">
RedisBloom v2.4.5
</a>
</p>
</li>
<li>
<p>
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/graph/">
RedisGraph v2.10.9
</a>
</p>
</li>
<li>
<p>
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/timeseries/">
RedisTimeSeries v1.8.9
</a>
</p>
</li>
</ul>
<p>
See
<a href="/docs/latest/operate/oss_and_stack/stack-with-enterprise/install/upgrade-module/">
Upgrade modules
</a>
to learn how to upgrade a module for a database.
</p>
<h2 id="version-changes">
Version changes
</h2>
<h3 id="deprecations">
Deprecations
</h3>
<h4 id="watchdog_profile">
watchdog_profile
</h4>
<p>
The
<code>
watchdog_profile
</code>
setting is deprecated and will be removed in a future release. Instead, use the
<code>
failure_detection_sensitivity
</code>
policy for predefined thresholds and timeouts:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin tune cluster failure_detection_sensitivity <span class="o">[</span> high <span class="p">|</span> low <span class="o">]</span>
</span></span></code></pre>
</div>
<p>
The
<code>
failure_detection_sensitivity
</code>
policy has the following options:
</p>
<ul>
<li>
<p>
<code>
high
</code>
(previously known as
<code>
local-network watchdog_profile
</code>
) β high failure detection sensitivity, lower thresholds, and faster failure detection and failover
</p>
</li>
<li>
<p>
<code>
low
</code>
(previously known as
<code>
cloud watchdog_profile
</code>
) β low failure detection sensitivity and higher tolerance for latency variance (also called network jitter)
</p>
</li>
</ul>
<h4 id="ubuntu-1604">
Ubuntu 16.04
</h4>
<p>
Ubuntu 16 support is deprecated, and support will be removed in a future release.
</p>
<h4 id="active-active-database-persistence">
Active-Active database persistence
</h4>
<p>
The RDB snapshot option for
<a href="/docs/latest/operate/rs/databases/active-active/manage/#data-persistence">
Active-Active database persistence
</a>
is deprecated and will be removed in a future release.
</p>
<p>
Please plan to reconfigure any Active-Active databases to use append-only file (AOF) persistence with the following command:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">crdb-cli crdb update --crdb-guid <CRDB_GUID> <span class="se">\
</span></span></span><span class="line"><span class="cl"><span class="se"></span> --default-db-config <span class="s1">'{"data_persistence": "aof", "aof_policy":"appendfsync-every-sec"}'</span>
</span></span></code></pre>
</div>
<h2 id="resolved-issues">
Resolved issues
</h2>
<ul>
<li>
<p>
RS97528 - Prevent
<a href="/docs/latest/operate/rs/security/certificates/create-certificates/">
self-signed certificate
</a>
script error on Ubuntu 20.04 by changing the user instructions.
</p>
</li>
<li>
<p>
RS99643 - Fix
<a href="/docs/latest/operate/rs/security/encryption/tls/ciphers/">
<code>
cipher_suites
</code>
</a>
configuration to allow default cipher suites according to the control plane, data plane, and discovery service.
</p>
</li>
<li>
<p>
RS99696 - Fix
<a href="https://github.com/redis/redis/security/advisories/GHSA-hjv8-vjf6-wcr6">
<code>
HINCRBYFLOT
</code>
</a>
CVE
</p>
</li>
<li>
<p>
RS54226 - During upgrades, a CRDB worker process would intermittently get stuck in a restart loop. This issue is now fixed.
</p>
</li>
</ul>
<h2 id="known-limitations">
Known limitations
</h2>
<h3 id="feature-limitations">
Feature limitations
</h3>
<ul>
<li>
RS78430 - When
<a href="/docs/latest/operate/rs/references/cli-utilities/rladmin/tune/#tune-db">
tuning module arguments
</a>
, any typo or use of unsupported arguments can cause shards to get stuck after restart.
</li>
</ul>
<h3 id="operating-system-limitations">
Operating system limitations
</h3>
<h4 id="ubuntu-2004">
Ubuntu 20.04
</h4>
<p>
By default, you cannot use the SHA1 hash algorithm (
<a href="https://manpages.ubuntu.com/manpages/focal/man3/SSL_CTX_set_security_level.3ssl.html#notes">
OpenSSLβs default security level is set to 2
</a>
). The operating system will reject SHA1 certificates even if the
<code>
mtls_allow_weak_hashing
</code>
option is enabled. You need to replace SHA1 certificates with newer certificates that use SHA-256. Note that the certificates provided with Redis Enterprise Software use SHA-256.
</p>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/release-notes/rs-6-4-2-releases/rs-6-4-2-69/"/>
<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/upgrade/upgrade-redis-cluster/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Upgrade Redis Enterprise for Kubernetes
</h1>
<p class="text-lg -mt-5 mb-10">
This task describes how to upgrade a Redis Enterprise cluster via the operator.
</p>
<p>
Redis implements rolling updates for software upgrades in Kubernetes deployments. The upgrade process includes updating three components:
</p>
<ol>
<li>
<a href="#upgrade-the-operator">
Upgrade the Redis Enterprise operator
</a>
</li>
<li>
<a href="#upgrade-the-redis-enterprise-cluster-rec">
Upgrade the Redis Enterprise cluster (REC)
</a>
</li>
<li>
<a href="#upgrade-databases">
Upgrade Redis Enterprise databases (REDB)
</a>
</li>
</ol>
<h2 id="prerequisites">
Prerequisites
</h2>
<ol>
<li>
<p>
Check
<a href="/docs/latest/operate/kubernetes/reference/supported_k8s_distributions/">
Supported Kubernetes distributions
</a>
to make sure your Kubernetes distribution is supported.
</p>
</li>
<li>
<p>
Use
<code>
kubectl get rec
</code>
and verify the
<code>
LICENSE STATE
</code>
is valid on your REC before you start the upgrade process.
</p>
</li>
<li>
<p>
Verify you are upgrading from Redis Enterprise operator version 6.2.10-45 or later. If you are not, you must upgrade to 6.2.10-45 before upgrading to versions 6.2.18 or later.
</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>
<strong>
Upgrade cluster operating system
</strong>
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>
<h2 id="upgrade-the-operator">
Upgrade the operator
</h2>
<h3 id="download-the-bundle">
Download the bundle
</h3>
<p>
Make sure you pull the correct version of the bundle. You can find the version tags
by checking the
<a href="https://github.com/RedisLabs/redis-enterprise-k8s-docs/releases">
operator releases on GitHub
</a>
or by
<a href="https://docs.github.com/en/rest/reference/repos#releases">
using the GitHub API
</a>
.
</p>
<p>
You can download the bundle for the latest release with the following
<code>
curl
</code>
command:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl"><span class="nv">VERSION</span><span class="o">=</span><span class="sb">`</span>curl --silent https://api.github.com/repos/RedisLabs/redis-enterprise-k8s-docs/releases/latest <span class="p">|</span> grep tag_name <span class="p">|</span> awk -F<span class="s1">'"'</span> <span class="s1">'{print $4}'</span><span class="sb">`</span>
</span></span><span class="line"><span class="cl">curl --silent -O https://raw.githubusercontent.com/RedisLabs/redis-enterprise-k8s-docs/<span class="nv">$VERSION</span>/bundle.yaml
</span></span></code></pre>
</div>
<p>
If you need a different release, replace
<code>
VERSION
</code>
in the above with a specific release tag.
</p>
<h3 id="apply-the-bundle">
Apply the bundle
</h3>
<p>
Apply the bundle to deploy the new operator binary. This will also apply any changes in the new release to custom resource definitions, roles, role binding, or operator service accounts.
</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 not pulling images from Docker Hub, update the operator image spec to point to your private repository.
If you have made changes to the role, role binding, RBAC, or custom resource definition (CRD) in the previous version, merge them with the updated declarations in the new version files.
</div>
</div>
<p>
Upgrade the bundle and operator with a single command, passing in the bundle YAML file:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">kubectl apply -f bundle.yaml
</span></span></code></pre>
</div>
<p>
After running this command, you should see a result similar to this:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">role.rbac.authorization.k8s.io/redis-enterprise-operator configured
</span></span><span class="line"><span class="cl">serviceaccount/redis-enterprise-operator configured
</span></span><span class="line"><span class="cl">rolebinding.rbac.authorization.k8s.io/redis-enterprise-operator configured
</span></span><span class="line"><span class="cl">customresourcedefinition.apiextensions.k8s.io/redisenterpriseclusters.app.redislabs.com configured
</span></span><span class="line"><span class="cl">customresourcedefinition.apiextensions.k8s.io/redisenterprisedatabases.app.redislabs.com configured
</span></span><span class="line"><span class="cl">deployment.apps/redis-enterprise-operator configured
</span></span></code></pre>
</div>
<h3 id="reapply-webhook">
Reapply the admission controller webhook
</h3>
<p>
If you have the admission controller enabled, you need to manually reapply the
<code>
ValidatingWebhookConfiguration
</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>
<p>
<a href="/docs/latest/operate/kubernetes/release-notes/6-4-2-releases/">
Versions 6.4.2 and later
</a>
uses a new
<code>
ValidatingWebhookConfiguration
</code>
resource to replace
<code>
redb-admission
</code>
. To use newer releases, delete the old webhook resource and apply the new file.
</p>
<ol>
<li>
<p>
Delete the existing
<code>
ValidatingWebhookConfiguration
</code>
on the Kubernetes cluster (named
<code>
redb-admission
</code>
).
</p>
<pre><code> ```sh
kubectl delete ValidatingWebhookConfiguration redb-admission
```
</code></pre>
</li>
<li>
<p>
Apply the resource from the new file.
</p>
<pre><code> ```sh
kubectl apply -f deploy/admission/webhook.yaml
```
</code></pre>
</li>
</ol>
</div>
</div>
<ol>
<li>
<p>
Verify the
<code>
admission-tls
</code>
secret exists.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">kubectl get secret admission-tls
</span></span></code></pre>
</div>
<p>
The output should look similar to
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">NAME TYPE DATA AGE
</span></span><span class="line"><span class="cl">admission-tls Opaque <span class="m">2</span> 2m43s
</span></span></code></pre>
</div>
</li>
<li>
<p>
Save the certificate to a local environment variable.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl"><span class="nv">CERT</span><span class="o">=</span><span class="sb">`</span>kubectl get secret admission-tls -o <span class="nv">jsonpath</span><span class="o">=</span><span class="s1">'{.data.cert}'</span><span class="sb">`</span>
</span></span></code></pre>
</div>
</li>
<li>
<p>
Create a Kubernetes validating webhook, replacing
<code>
<namespace>
</code>
with the namespace where the REC was installed.
</p>
<p>
The
<code>
webhook.yaml
</code>
template can be found in
<a href="https://github.com/RedisLabs/redis-enterprise-k8s-docs/tree/master/admission">
redis-enterprise-k8s-docs/admission
</a>
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">sed <span class="s1">'s/OPERATOR_NAMESPACE/<namespace>/g'</span> webhook.yaml <span class="p">|</span> kubectl create -f -
</span></span></code></pre>
</div>
</li>
<li>
<p>
Create a patch file for the Kubernetes validating webhook.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">cat > modified-webhook.yaml <span class="s"><<EOF
</span></span></span><span class="line"><span class="cl"><span class="s">webhooks:
</span></span></span><span class="line"><span class="cl"><span class="s">- name: redisenterprise.admission.redislabs
</span></span></span><span class="line"><span class="cl"><span class="s"> clientConfig:
</span></span></span><span class="line"><span class="cl"><span class="s"> caBundle: $CERT
</span></span></span><span class="line"><span class="cl"><span class="s">EOF</span>
</span></span></code></pre>
</div>
</li>
<li>
<p>
Patch the webhook with the certificate.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">kubectl patch ValidatingWebhookConfiguration <span class="se">\
</span></span></span><span class="line"><span class="cl"><span class="se"></span> redis-enterprise-admission --patch <span class="s2">"</span><span class="k">$(</span>cat modified-webhook.yaml<span class="k">)</span><span class="s2">"</span>
</span></span></code></pre>
</div>
</li>
</ol>
<h3 id="verify-the-operator-is-running">
Verify the operator is running
</h3>
<p>
You can check your deployment to verify the operator is running in your namespace.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">kubectl get deployment/redis-enterprise-operator
</span></span></code></pre>
</div>
<p>
You should see a result similar to this:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">NAME READY UP-TO-DATE AVAILABLE AGE
</span></span><span class="line"><span class="cl">redis-enterprise-operator 1/1 <span class="m">1</span> <span class="m">1</span> 0m36s
</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>
We recommend upgrading the REC as soon as possible after updating the operator. After the operator upgrade completes, the operator suspends the management of the REC and its associated REDBs, until the REC upgrade completes.
</div>
</div>
<h2 id="upgrade-the-redis-enterprise-cluster-rec">
Upgrade the Redis Enterprise cluster (REC)
</h2>
<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>
<p>
Verify your license is valid before upgrading. Invalid licenses will cause the upgrade to fail.
</p>
<p>
Use
<code>
kubectl get rec
</code>
and verify the
<code>
LICENSE STATE
</code>
is valid on your REC before you start the upgrade process.
</p>
</div>
</div>
<p>
The Redis Enterprise cluster (REC) can be updated automatically or manually. To trigger automatic upgrade of the REC after the operator upgrade completes, specify
<code>
autoUpgradeRedisEnterprise: true
</code>
in your REC spec. If you don't have automatic upgrade enabled, follow the below steps for the manual upgrade.
</p>
<p>
Before beginning the upgrade of the Redis Enterprise cluster, check the K8s operator release notes to find the Redis Enterprise image tag. For example, in Redis Enterprise K8s operator release
<a href="https://github.com/RedisLabs/redis-enterprise-k8s-docs/releases/tag/v6.0.12-5">
6.0.12-5
</a>
, the
<code>
Images
</code>
section shows the Redis Enterprise tag is
<code>
6.0.12-57
</code>
.
</p>
<p>
After the operator upgrade is complete, you can upgrade Redis Enterprise cluster (REC).
</p>
<h3 id="upgrade-an-rec-with-an-active-active-database">
Upgrade an REC with an Active-Active database
</h3>
<p>
We recommend upgrading all participating clusters to the same operator version.
</p>
<p>
If you are upgrading from a preview version of the Active-Active controller, you can remove the following environment variables:
<code>
ACTIVE_ACTIVE_DATABASE_CONTROLLER_ENABLED
</code>
,
<code>
REMOTE_CLUSTER_CONTROLLER_ENABLED
</code>
, and
<code>
ENABLE_ALPHA_FEATURES
</code>
.
</p>
<h3 id="edit-redisenterpriseimagespec-in-the-rec-spec">
Edit
<code>
redisEnterpriseImageSpec
</code>
in the REC spec
</h3>
<ol>
<li>
<p>
Edit the REC custom resource YAML file.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">kubectl edit rec <your-rec.yaml>
</span></span></code></pre>
</div>
</li>
<li>
<p>
Replace the
<code>
versionTag:
</code>
declaration under
<code>
redisEnterpriseImageSpec
</code>
with the new version tag.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-YAML" data-lang="YAML"><span class="line"><span class="cl"><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">redisEnterpriseImageSpec</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">imagePullPolicy</span><span class="p">:</span><span class="w"> </span><span class="l">IfNotPresent</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">repository</span><span class="p">:</span><span class="w"> </span><span class="l">redislabs/redis</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">versionTag</span><span class="p">:</span><span class="w"> </span><span class="l"><new-version-tag></span><span class="w">
</span></span></span></code></pre>
</div>
</li>
<li>
<p>
Save the changes to apply.
</p>
</li>
</ol>
<h3 id="reapply-roles-and-role-bindings">
Reapply roles and role bindings
</h3>
<p>
If your operator is monitoring multiple namespaces, you'll need to
<a href="/docs/latest/operate/kubernetes/re-clusters/multi-namespace/#create-role-and-role-binding-for-managed-namespaces">
reapply your role and role bindings
</a>
for each managed namespace. See
<a href="/docs/latest/operate/kubernetes/re-clusters/multi-namespace/">
Manage databases in multiple namespaces
</a>
for more details.
</p>
<h3 id="monitor-the-upgrade">
Monitor the upgrade
</h3>
<p>
You can view the state of the REC with
<code>
kubectl get rec
</code>
.
</p>
<p>
During the upgrade, the state should be
<code>
Upgrade
</code>
.
When the upgrade is complete and the cluster is ready to use, the state will change to
<code>
Running
</code>
.
If the state is
<code>
InvalidUpgrade
</code>
, there is an error (usually relating to configuration) in the upgrade.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ kubectl get rec
</span></span><span class="line"><span class="cl">NAME NODES VERSION STATE SPEC STATUS LICENSE STATE SHARDS LIMIT LICENSE EXPIRATION DATE AGE
</span></span><span class="line"><span class="cl">rec <span class="m">3</span> 6.2.10-107 Upgrade Valid Valid <span class="m">4</span> 2022-07-16T13:59:00Z 92m
</span></span></code></pre>
</div>
<p>
To see the status of the current rolling upgrade, run:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">kubectl rollout status sts <REC_name>
</span></span></code></pre>
</div>
<h3 id="upgrade-databases">
Upgrade databases
</h3>
<p>
After the cluster is upgraded, you can upgrade your databases. The process for upgrading databases is the same for both Kubernetes and non-Kubernetes deployments.
</p>
<p>
For more details on how to
<a href="/docs/latest/operate/rs/installing-upgrading/upgrading/upgrade-database/">
upgrade a database
</a>
, see the
<a href="/docs/latest/operate/rs/installing-upgrading/upgrading/">
Upgrade an existing Redis Enterprise Software deployment
</a>
documentation.
</p>
<p>
For Active-Active databases, see
<a href="/docs/latest/operate/rs/installing-upgrading/upgrading/upgrade-active-active/">
Upgrade an Active-Active database
</a>
.
</p>
<p>
Note that if your cluster
<a href="/docs/latest/operate/kubernetes/reference/redis_enterprise_cluster_api/#redisupgradepolicy">
<code>
redisUpgradePolicy
</code>
</a>
or your database
<a href="/docs/latest/operate/kubernetes/reference/redis_enterprise_database_api/#redisversion">
<code>
redisVersion
</code>
</a>
are set to
<code>
major
</code>
, you won't be able to upgrade those databases to minor versions. See
<a href="/docs/latest/operate/rs/installing-upgrading/upgrading/#redis-upgrade-policy">
Redis upgrade policy
</a>
for more details.
</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/upgrade/upgrade-redis-cluster/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/kubernetes/release-notes/6-4-2-releases/6-4-2-6/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Redis Enterprise for Kubernetes release notes 6.4.2-6 (June 2023)
</h1>
<p class="text-lg -mt-5 mb-10">
The Redis Enterprise K8s 6.4.2-6 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-6 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-81
</code>
</li>
<li>
<strong>
Operator
</strong>
:
<code>
redislabs/operator:6.4.2-6
</code>
</li>
<li>
<strong>
Services Rigger
</strong>
:
<code>
redislabs/k8s-controller:6.4.2-6
</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-81.rhel8-openshift
</code>
(or
<code>
redislabs/redis-enterprise:6.4.2-81.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-6
</code>
</li>
<li>
<strong>
Services Rigger
</strong>
:
<code>
registry.connect.redhat.com/redislabs/services-manager:6.4.2-6
</code>
</li>
</ul>
<h3 id="openshift-olm-bundles">
OpenShift OLM bundles
</h3>
<ul>
<li>
Redis Enterprise operator bundle version:
<code>
v6.4.2-6
</code>
</li>
</ul>
<h2 id="new-features">
New features
</h2>
<ul>
<li>
General availability of the Active-Active database controller for declarative configuration support
</li>
</ul>
<h2 id="feature-improvements">
Feature improvements
</h2>
<ul>
<li>
Active-Active controller improvements include adding support for the following:
<ul>
<li>
Configuration via OLM
</li>
<li>
Certificates in
<code>
globalConfiguration
</code>
</li>
<li>
Backups in
<code>
globalConfiguration
</code>
</li>
<li>
Modules (preview)
</li>
<li>
Hashicorp Vault secrets
</li>
<li>
indication of sync failures to REAADB
</li>
</ul>
</li>
<li>
Added support for separate
<code>
podAnnotations
</code>
for Redis Enterprise pods to allow setting
<code>
appArmor
</code>
exceptions
</li>
<li>
Timezone can be passed as environment variable into Redis Enterprise pods
</li>
<li>
REDB namespaces can be labelled without the operator going into
<code>
CrashLoopBackoff
</code>
</li>
<li>
Added support for K8s 1.27
</li>
<li>
Added support for K8s 1.25 for EKS
</li>
<li>
Added support for K8s 1.26 for AKS and GKE
</li>
<li>
Improved log collector execution log, filtering out empty files, capturing volume attachments, option to disable RS capture debug info package
</li>
<li>
Added
<code>
extraEnvVars
</code>
field in REC to support environment variables for RS pods
</li>
<li>
Changed RKE2 to the default for Rancher distributions
</li>
</ul>
<h2 id="fixed-bugs">
Fixed bugs
</h2>
<ul>
<li>
REC in invalid state can't be deleted (RED-78124)
</li>
<li>
OpenShift route not deleted after REC is deleted (RED-94121)
</li>
<li>
REAADB secret status not being updated in source cluster (RED-96296)
</li>
<li>
Invalid REAADB that is not rejected by admission might be deleted after apply (RED-96300)
</li>
<li>
Operator logs an error about missing permissions to nodes on startup (RED-98227)
</li>
<li>
Operator continues to update REC certificates in a loop (RED-98586)
</li>
<li>
Log collector script may crash when trying to write multi-byte characters to file (RED-99869)
</li>
<li>
Log collector fails to include RS debuginfo when old kubectl is used (RED-101170)
</li>
<li>
REC creation fails due to required LDAP configuration in OLM form view (RED-100517)
</li>
<li>
Upgrading to 6.4.2 (or 6.2.18) on OpenShift will fail if pod 0 is not the master node when upgrade starts (RED-102100)
</li>
<li>
Upgrading from 6.2.8-15 (and below) to 6.2.12-1 (and above) may break the databases (RED-102241)
</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/">
RedisEnterpriseCluster (REC) API
</a>
:
</p>
<ul>
<li>
<p>
<code>
containerTimezoneSpec.timezoneName
</code>
added to configure timezones on the Redis Enterprise pods
</p>
</li>
<li>
<p>
<code>
hostAliases
</code>
added for adding an entry to the Redis Enterprise pods'
<code>
/etc/hosts
</code>
</p>
</li>
<li>
<p>
<code>
redisEnteprisePodAnnotations
</code>
added to specify annotations that should only be set on the Redis Enterprise pods
</p>
</li>
<li>
<p>
<code>
ingressOrRouteSpec
</code>
enabled to use without alpha features enabled
</p>
</li>
<li>
<p>
<code>
extraEnvVars
</code>
added for advanced users to add environment variables to the Redis Enterprise pods
</p>
</li>
<li>
<p>
<code>
ServicesRiggerConfigurationSpec.podAnnotations
</code>
added to specify annotations that should only be set on the service rigger pods
</p>
</li>
<li>
<p>
The following custom resources definitions were added:
</p>
<ul>
<li>
<a href="/docs/latest/operate/kubernetes/reference/redis_enterprise_remote_cluster_api/">
<code>
RedisEnterpriseRemoteCluster
</code>
(RERC) API
</a>
</li>
<li>
<a href="/docs/latest/operate/kubernetes/reference/redis_enterprise_active_active_database_api/">
<code>
RedisEnterpriseActiveActiveDatabase
</code>
(REAADB) API
</a>
</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>
</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.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>
<th style="text-align:center">
1.27
</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">
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">
</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">
deprecated
</td>
<td style="text-align:center">
supported
</td>
<td style="text-align:center">
supported
</td>
<td style="text-align:center">
supported*
</td>
<td>
</td>
</tr>
<tr>
<td style="text-align:left">
Google GKE
</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">
Rancher 2.6
</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">
</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">
deprecated
</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">
VMware TKG 1.6
</td>
<td style="text-align:center">
deprecated
</td>
<td style="text-align:center">
deprecated
</td>
<td style="text-align:center">
</td>
<td style="text-align:center">
</td>
<td style="text-align:center">
</td>
<td style="text-align:center">
</td>
</tr>
<tr>
<td style="text-align:left">
<strong>
OpenShift version
</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>
<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>
<tr>
<td style="text-align:left">
<strong>
VMware TKGI version
</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>
<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">
</td>
<td style="text-align:center">
</td>
<td style="text-align:center">
</td>
</tr>
</tbody>
</table>
<p>
* Support added in this release
</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 for Kubernetes now uses RKE2 as the default for Rancher distributions.
</div>
</div>
<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 to 6.4.2-6.
</p>
<ul>
<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>
<li>
<p>
<strong>
OpenShift SCC
</strong>
</p>
<p>
This release includes 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 details.
</p>
</li>
</ul>
<h2 id="known-limitations">
Known limitations
</h2>
<h3 id="new-limitations">
New limitations
</h3>
<ul>
<li>
<p>
<strong>
Admission controller may not alert when patching the REAADB with missing secret or RERC (RED-104463)
</strong>
Remove the secret from the spec and create the missing secret, and then re-patch the REAADB again.
</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>
Misleading error appears when a service creation has failed due to service already existing "
<code>
provided IP is already allocated
</code>
" (RED-100669)
</strong>
Delete the service manually.
</p>
</li>
<li>
<p>
<strong>
Existing OpenShift route during REC creation might prevent REC from starting (RED-100668)
</strong>
Delete the route manually.
</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>
</ul>
<h3 id="existing-limitations">
Existing limitations
</h3>
<ul>
<li>
<p>
<strong>
RERC resources must have a unique name (
<code>
<rec-name>/<rec-namespace>
</code>
) (RED-96302)
</strong>
</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 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 the
<a href="/docs/latest/operate/kubernetes/deployment/quick-start/">
quick start
</a>
.
</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 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>
<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>
5.4.10 negatively impacts 5.4.6 (RED-37233)
</strong>
Kubernetes-based 5.4.10 deployments seem to negatively impact existing 5.4.6 deployments that share a Kubernetes cluster.
</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 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>
<h2 id="security">
Security
</h2>
<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-81/">
Redis Enterprise 6.4.2-81 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/6-4-2-6/"/>
<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/georadius_ro/.html | <section class="prose w-full py-12">
<h1 class="command-name">
GEORADIUS_RO
<span class="text-base">
(deprecated)
</span>
</h1>
<div class="border-l-8 pl-4">
<p>
As of Redis version 6.2.0, this command is regarded as deprecated.
</p>
<p>
It can be replaced by
<a href="/docs/latest/commands/geosearch/">
<code>
GEOSEARCH
</code>
</a>
with the
<code>
BYRADIUS
</code>
argument when migrating or writing new code.
</p>
</div>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">GEORADIUS_RO key longitude latitude radius <m | km | ft | mi>
[WITHCOORD] [WITHDIST] [WITHHASH] [COUNTΒ count [ANY]] [ASC | DESC]</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.10
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
Time complexity:
</dt>
<dd class="m-0">
O(N+log(M)) where N is the number of elements inside the bounding box of the circular area delimited by center and radius and M is the number of items inside the index.
</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>
@geo
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@slow
</code>
<span class="mr-1 last:hidden">
,
</span>
</dd>
</dl>
<p>
Read-only variant of the
<a href="/docs/latest/commands/georadius/">
<code>
GEORADIUS
</code>
</a>
command.
</p>
<p>
This command is identical to the
<a href="/docs/latest/commands/georadius/">
<code>
GEORADIUS
</code>
</a>
command, except that it doesn't support the optional
<code>
STORE
</code>
and
<code>
STOREDIST
</code>
parameters.
</p>
<h2 id="resp2resp3-reply">
RESP2/RESP3 Reply
</h2>
<p>
One of the following:
</p>
<ul>
<li>
If no
<code>
WITH*
</code>
option is specified, an
<a href="../../develop/reference/protocol-spec#arrays">
Array reply
</a>
of matched member names
</li>
<li>
If
<code>
WITHCOORD
</code>
,
<code>
WITHDIST
</code>
, or
<code>
WITHHASH
</code>
options are specified, the command returns an
<a href="../../develop/reference/protocol-spec#arrays">
Array reply
</a>
of arrays, where each sub-array represents a single item:
<ul>
<li>
The distance from the center as a floating point number, in the same unit specified in the radius.
</li>
<li>
The Geohash integer.
</li>
<li>
The coordinates as a two items x,y array (longitude,latitude).
</li>
</ul>
</li>
</ul>
<br/>
<h2>
History
</h2>
<ul>
<li>
Starting with Redis version 6.2.0: Added the
<code>
ANY
</code>
option for
<code>
COUNT
</code>
.
</li>
</ul>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/georadius_ro/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/commands/bitfield_ro/.html | <section class="prose w-full py-12">
<h1 class="command-name">
BITFIELD_RO
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">BITFIELD_RO key [GETΒ encoding offset [GET encoding offset ...]]</pre>
<dl class="grid grid-cols-[auto,1fr] gap-2 mb-12">
<dt class="font-semibold text-redis-ink-900 m-0">
Available since:
</dt>
<dd class="m-0">
6.0.0
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
Time complexity:
</dt>
<dd class="m-0">
O(1) for each subcommand specified
</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>
@bitmap
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@fast
</code>
<span class="mr-1 last:hidden">
,
</span>
</dd>
</dl>
<p>
Read-only variant of the
<a href="/docs/latest/commands/bitfield/">
<code>
BITFIELD
</code>
</a>
command.
It is like the original
<a href="/docs/latest/commands/bitfield/">
<code>
BITFIELD
</code>
</a>
but only accepts
<code>
GET
</code>
subcommand and can safely be used in read-only replicas.
</p>
<p>
Since the original
<a href="/docs/latest/commands/bitfield/">
<code>
BITFIELD
</code>
</a>
has
<code>
SET
</code>
and
<code>
INCRBY
</code>
options it is technically flagged as a writing command in the Redis command table.
For this reason read-only replicas in a Redis Cluster will redirect it to the master instance even if the connection is in read-only mode (see the
<a href="/docs/latest/commands/readonly/">
<code>
READONLY
</code>
</a>
command of Redis Cluster).
</p>
<p>
Since Redis 6.2, the
<code>
BITFIELD_RO
</code>
variant was introduced in order to allow
<a href="/docs/latest/commands/bitfield/">
<code>
BITFIELD
</code>
</a>
behavior in read-only replicas without breaking compatibility on command flags.
</p>
<p>
See original
<a href="/docs/latest/commands/bitfield/">
<code>
BITFIELD
</code>
</a>
for more details.
</p>
<h2 id="examples">
Examples
</h2>
<pre tabindex="0"><code>BITFIELD_RO hello GET i8 16
</code></pre>
<h2 id="resp2resp3-reply">
RESP2/RESP3 Reply
</h2>
<a href="../../develop/reference/protocol-spec#arrays">
Array reply
</a>
: each entry being the corresponding result of the sub-command given at the same position.
<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/bitfield_ro/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/develop/tools/insight/tutorials/insight-stream-consumer/.html | <section class="prose w-full py-12">
<h1>
Manage streams and consumer groups in Redis Insight
</h1>
<p class="text-lg -mt-5 mb-10">
Learn how to manage streams and consumer groups in Redis Insight
</p>
<p>
A
<em>
stream
</em>
is an append-only log file.
When you add data to it, you cannot change it.
That may seem like a disadvantage; however, a stream serves as a log or single source of truth.
It can also be used as a buffer between processes that work at different speeds and do not need to know about each other.
For more conceptual information about streams, see
<a href="/docs/latest/develop/data-types/streams/">
Redis Streams
</a>
.
</p>
<p>
In this topic, you will learn how to add and work with streams as well as consumer groups in Redis Insight.
</p>
<p>
Here's a stream that models temperature and humidity sensors. Processes interacting with the stream perform one of two roles:
<em>
consumer
</em>
and
<em>
producer
</em>
.
The point of a stream is that it's not going to end, so you cannot capture whole datasets and do some processing on them.
</p>
<p>
In this stream, sensors are considered
<em>
producers
</em>
, which broadcast data.
A
<em>
consumer
</em>
reads from the stream and does some work on it.
For example, if the temperature is above a certain threshold, it puts a message out to turn on the air conditioner in that unit or notify the maintenance.
</p>
<img src="../images/stream.png"/>
<p>
It is possible to have multiple consumers doing different jobs, one measuring humidity, and another taking temperature measurements over periods of time.
Redis stores a copy of the entire dataset in memory, which is a finite resource.
To avoid runaway data, streams can be trimmed when you add something to them.
When adding to a stream with
<a href="/docs/latest/commands/xadd/">
<code>
XADD
</code>
</a>
, you can optionally specify that the stream should be trimmed to a specific or approximate number of the newest entries, or to only include entries whose ID is higher than the ID specified.
You can also manage the storage required for streaming data using key expiry. For example, by writing each day's data to its own stream in Redis and expiring each stream's key after a period of time, say a week.
An ID can be any number, but each new entry in the stream must have an ID whose value is higher than the last ID added to the stream.
</p>
<h2 id="adding-new-entries">
Adding new entries
</h2>
<p>
Use
<a href="/docs/latest/commands/xadd/">
<code>
XADD
</code>
</a>
with
<code>
*
</code>
for the ID to have Redis automatically generate a new ID for you consisting of a millisecond precision timestamp, a dash and a sequence number. For example
<code>
1656416957625-0
</code>
. Then supply the field names and values to store in the new stream entry.
</p>
<p>
There are a couple of ways of retrieving things. You can retrieve entries by time range or you could ask for everything that's happened since a timestamp or ID that you specify. Using a single command you can ask for anything from 10:30 until 11:15 am on a given day.
</p>
<h2 id="consumer-groups">
Consumer groups
</h2>
<p>
A more realistic use case would be a system with many temperature sensors whose data Redis puts in a stream, records the time they arrive, and orders them.
</p>
<img src="../images/consumer.png"/>
<p>
On the right side we have two consumers that read the stream. One of them is alerting if the temperature is over a certain number and texting the maintenance crew that they need to do something, and the other is a data warehouse that is taking the data and putting it into a database.
</p>
<p>
They run independently of each other.
Up in the right, we have another sort of task.
Let's assume that alerting and data warehouse are really fast.
You get a message whether the temperature is larger than a specific value, which might take a millisecond.
And alerting can keep up with the data flow.
One way you can scale consumers is
<em>
consumer groups
</em>
, which allows multiple instances of the same consumer or same code to work as a team to process the stream.
</p>
<h2 id="managing-streams-in-redis-insight">
Managing streams in Redis Insight
</h2>
<p>
You can add a stream in Redis Insight in two ways: create a new stream or add to an existing stream.
</p>
<p>
To create a stream, start by selecting the key type (stream).
You cannot set time to live (TTL) because it cannot be put on a message in a stream; it can only be done on a Redis key. Name the stream
<em>
mystream
</em>
.
Then, set the
<em>
Entry ID
</em>
to
<code>
*
</code>
to default to timestamp.
If you have your own ID generation strategy, enter the next ID from your sequence. Remember that the ID must be higher than the ID of any other entry in the stream.
</p>
<p>
Then, enter fields and values using + to add more than one (for example, name and location).
Now you have a stream that appears in the
<strong>
Streams
</strong>
view and you can continue adding fields and values to it.
</p>
<p>
Redis Insight runs read commands for you so you can see the stream entries in the
<strong>
Streams
</strong>
view.
And the
<strong>
Consumer Groups
</strong>
view shows each consumers in a given consumer group and the last time Redis allocated a message, what the ID of it was and how many times that process has happened, and whether a consumer has you have told Redis that you are finished working with that task using the
<a href="/docs/latest/commands/xack/">
<code>
XACK
</code>
</a>
command.
</p>
<h2 id="monitor-temperature-and-humidity-from-sensors-in-redis-insight">
Monitor temperature and humidity from sensors in Redis Insight
</h2>
<p>
This example shows how to bring an existing stream into Redis Insight and work with it.
</p>
<h3 id="setup">
Setup
</h3>
<ol>
<li>
Install
<a href="https://redis.com/redis-enterprise/redis-insight/?_ga=2.48624486.1318387955.1655817244-1963545967.1655260674#insight-form">
Redis Insight
</a>
.
</li>
<li>
Download and install
<a href="https://nodejs.org/en/download/">
Node.js
</a>
(LTS version).
</li>
<li>
Install
<a href="/docs/latest/operate/oss_and_stack/install/">
Redis
</a>
. In Docker, check that Redis is running locally on the default port 6379 (with no password set).
</li>
<li>
Clone the
<a href="https://github.com/redis-developer/introducing-redis-talk">
code repository
</a>
for this example.
See the
<a href="https://github.com/redis-developer/introducing-redis-talk/tree/main/streams">
README
</a>
for more information about this example and installation tips.
</li>
<li>
On your command-line, navigate to the folder containing the code repository and install the Node.js package manager (npm).
</li>
</ol>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">npm install</span></span></code></pre>
</div>
<h3 id="run-the-producer">
Run the producer
</h3>
<p>
To start the producer, which will add a new entry to the stream every few seconds, enter:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">npm run producer
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">> [email protected] producer
</span></span><span class="line"><span class="cl">> node producer.js
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">Starting producer...
</span></span><span class="line"><span class="cl">Adding reading <span class="k">for</span> location: 62, temperature: 40.3, humidity: 36.5
</span></span><span class="line"><span class="cl">Added as 1632771056648-0
</span></span><span class="line"><span class="cl">Adding reading <span class="k">for</span> location: 96, temperature: 15.4, humidity: <span class="m">70</span>
</span></span><span class="line"><span class="cl">Added as 1632771059039-0
</span></span><span class="line"><span class="cl">...</span></span></code></pre>
</div>
<p>
The producer runs indefinitely.
Select
<code>
Ctrl+C
</code>
to stop it.
You can start multiple instances of the producer if you want to add entries to the stream faster.
</p>
<h3 id="run-the-consumer">
Run the consumer
</h3>
<p>
To start the consumer, which reads from the stream every few seconds, enter:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">npm run consumer
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">> [email protected] consumer
</span></span><span class="line"><span class="cl">> node consumer.js
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">Starting consumer...
</span></span><span class="line"><span class="cl">Resuming from ID 1632744741693-0
</span></span><span class="line"><span class="cl">Reading stream...
</span></span><span class="line"><span class="cl">Received entry 1632771056648-0:
</span></span><span class="line"><span class="cl"><span class="o">[</span> <span class="s1">'location'</span>, <span class="s1">'62'</span>, <span class="s1">'temp'</span>, <span class="s1">'40.3'</span>, <span class="s1">'humidity'</span>, <span class="s1">'36.5'</span> <span class="o">]</span>
</span></span><span class="line"><span class="cl">Finished working with entry 1632771056648-0
</span></span><span class="line"><span class="cl">Reading stream...
</span></span><span class="line"><span class="cl">Received entry 1632771059039-0:
</span></span><span class="line"><span class="cl"><span class="o">[</span> <span class="s1">'location'</span>, <span class="s1">'96'</span>, <span class="s1">'temp'</span>, <span class="s1">'15.4'</span>, <span class="s1">'humidity'</span>, <span class="s1">'70'</span> <span class="o">]</span></span></span></code></pre>
</div>
<p>
The consumer stores the last entry ID that it read in a Redis string at the key
<code>
consumer:lastid
</code>
. It uses this string to pick up from where it left off after it is restarted. Try this out by stopping it with
<code>
Ctrl+C
</code>
and restarting it.
</p>
<p>
Once the consumer has processed every entry in the stream, it will wait indefinitely for instances of the producer to add more:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">Reading stream...
</span></span><span class="line"><span class="cl">No new entries since entry 1632771060229-0.
</span></span><span class="line"><span class="cl">Reading stream...
</span></span><span class="line"><span class="cl">No new entries since entry 1632771060229-0.
</span></span><span class="line"><span class="cl">Reading stream...</span></span></code></pre>
</div>
<p>
Stop it using
<code>
Ctrl+C
</code>
.
</p>
<h3 id="run-a-consumer-group">
Run a consumer group
</h3>
<p>
A consumer group consists of multiple consumer instances working together. Redis manages allocation of entries read from the stream to members of a consumer group. A consumer in a group will receive a subset of the entries, with the group as a whole receiving all of them. When working in a consumer group, a consumer process must acknowledge receipt/processing of each entry.
</p>
<p>
Using multiple terminal windows, start three instances of the consumer group consumer, giving each a unique name:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">npm run consumergroup consumer1
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">> [email protected] consumergroup
</span></span><span class="line"><span class="cl">> node consumer_group.js -- <span class="s2">"consumer1"</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">Starting consumer consumer1...
</span></span><span class="line"><span class="cl">Consumer group temphumidity_consumers exists, not created.
</span></span><span class="line"><span class="cl">Reading stream...
</span></span><span class="line"><span class="cl">Received entry 1632771059039-0:
</span></span><span class="line"><span class="cl"><span class="o">[</span> <span class="s1">'location'</span>, <span class="s1">'96'</span>, <span class="s1">'temp'</span>, <span class="s1">'15.4'</span>, <span class="s1">'humidity'</span>, <span class="s1">'70'</span> <span class="o">]</span>
</span></span><span class="line"><span class="cl">Acknowledged processing of entry 1632771059039-0.
</span></span><span class="line"><span class="cl">Reading stream...</span></span></code></pre>
</div>
<p>
In a second terminal:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">npm run consumergroup consumer2</span></span></code></pre>
</div>
<p>
And in a third:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">npm run consumergroup consumer3</span></span></code></pre>
</div>
<p>
The consumers will run indefinitely, waiting for new messages to be added to the stream by a producer instance when they have collectively consumed the entire stream.
Note that in this model, each consumer instance does not receive all of the entries from the stream, but the three members of the group each receive a subset.
</p>
<h3 id="view-the-stream-in-redis-insight">
View the stream in Redis Insight
</h3>
<ol>
<li>
Launch Redis Insight.
</li>
<li>
Select
<code>
localhost:6379
</code>
</li>
<li>
Select
<strong>
STREAM
</strong>
. Optionally, select full screen from the upper right corner to expand the view.
</li>
</ol>
<img src="../images/insight_streams.png"/>
<p>
You can now toggle between
<strong>
Stream
</strong>
and
<strong>
Consumer Groups
</strong>
views to see your data.
As mentioned earlier in this topic, a stream is an append-only log so you can't modify the contents of an entry, but you can delete an entire entry.
A case when that's useful is in the event of a so-called
<em>
poison-pill message
</em>
that can cause consumers to crash. You can physically remove such messages in the
<strong>
Streams
</strong>
view or use the
<a href="/docs/latest/commands/xdel/">
<code>
XDEL
</code>
</a>
command at the command-line interface (CLI).
</p>
<p>
You can continue interacting with your stream at the CLI. For example, to get the current length of a stream, use the
<a href="/docs/latest/commands/xlen/">
<code>
XLEN
</code>
</a>
command:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">XLEN ingest:temphumidity</span></span></code></pre>
</div>
<p>
Use streams for auditing and processing events in banking, gaming, supply chain, IoT, social media, and so on.
</p>
<h2 id="related-topics">
Related topics
</h2>
<ul>
<li>
<a href="/docs/latest/develop/data-types/streams/">
Redis Streams
</a>
</li>
<li>
<a href="https://www.youtube.com/watch?v=q2UOkQmIo9Q">
Introducing Redis Streams with Redis Insight, node.js, and Python
</a>
(video)
</li>
</ul>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/develop/tools/insight/tutorials/insight-stream-consumer/"/>
<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/upgrading/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Upgrade an existing Redis Enterprise Software deployment
</h1>
<p>
To upgrade Redis Enterprise Software:
</p>
<ol>
<li>
<p>
Verify appropriate
<a href="/docs/latest/operate/rs/networking/port-configurations/">
network ports
</a>
are either open or used by Redis Enterprise Software.
</p>
</li>
<li>
<p>
<a href="/docs/latest/operate/rs/installing-upgrading/upgrading/upgrade-cluster/">
Upgrade the software on all nodes of the cluster.
</a>
</p>
</li>
<li>
<p>
<em>
(Optional)
</em>
<a href="/docs/latest/operate/rs/installing-upgrading/upgrading/upgrade-database/">
Upgrade each database
</a>
in the cluster or
<a href="/docs/latest/operate/rs/installing-upgrading/upgrading/upgrade-active-active/">
upgrade an Active-Active database
</a>
to enable new features and important fixes.
</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/installing-upgrading/upgrading/"/>
<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/cluster/alerts/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Cluster alerts requests
</h1>
<p class="text-lg -mt-5 mb-10">
Cluster alert requests
</p>
<table>
<thead>
<tr>
<th>
Method
</th>
<th>
Path
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="#get-all-alerts">
GET
</a>
</td>
<td>
<code>
/v1/cluster/alerts
</code>
</td>
<td>
Get all cluster alerts
</td>
</tr>
<tr>
<td>
<a href="#get-alert">
GET
</a>
</td>
<td>
<code>
/v1/cluster/alerts/{alert}
</code>
</td>
<td>
Get a specific cluster alert
</td>
</tr>
</tbody>
</table>
<h2 id="get-all-alerts">
Get all cluster alerts
</h2>
<pre><code>GET /v1/cluster/alerts
</code></pre>
<p>
Get all alert states for the cluster object.
</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_cluster_alerts">
view_cluster_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 /cluster/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
<a href="/docs/latest/operate/rs/7.4/references/rest-api/objects/alert/">
alert objects
</a>
and their states.
</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">"cluster_too_few_nodes_for_replication"</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-22T11:48: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">"state"</span><span class="p">:</span> <span class="kc">false</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="s2">"off"</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-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-alert">
Get cluster alert
</h2>
<pre><code>GET /v1/cluster/alerts/{alert}
</code></pre>
<p>
Get a cluster alert state.
</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_cluster_alerts">
view_cluster_alerts
</a>
</td>
</tr>
</tbody>
</table>
<h3 id="get-request">
Request
</h3>
<h4 id="example-http-request-1">
Example HTTP request
</h4>
<pre><code>GET /cluster/alerts/cluster_too_few_nodes_for_replication
</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">
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-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">"change_time"</span><span class="p">:</span> <span class="s2">"2014-12-22T11:48: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">"state"</span><span class="p">:</span> <span class="kc">false</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="s2">"off"</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 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/cluster/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/commands/ping/.html | <section class="prose w-full py-12">
<h1 class="command-name">
PING
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">PING [message]</pre>
<dl class="grid grid-cols-[auto,1fr] gap-2 mb-12">
<dt class="font-semibold text-redis-ink-900 m-0">
Available since:
</dt>
<dd class="m-0">
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>
@fast
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@connection
</code>
<span class="mr-1 last:hidden">
,
</span>
</dd>
</dl>
<p>
Returns
<code>
PONG
</code>
if no argument is provided, otherwise return a copy of the
argument as a bulk.
This command is useful for:
</p>
<ol>
<li>
Testing whether a connection is still alive.
</li>
<li>
Verifying the server's ability to serve data - an error is returned when this isn't the case (e.g., during load from persistence or accessing a stale replica).
</li>
<li>
Measuring latency.
</li>
</ol>
<p>
If the client is subscribed to a channel or a pattern, it will instead return a
multi-bulk with a "pong" in the first position and an empty bulk in the second
position, unless an argument is provided in which case it returns a copy
of the argument.
</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> PING
"PONG"
redis> PING "hello world"
"hello world"
</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>
<p>
Any of the following:
</p>
<ul>
<li>
<a href="../../develop/reference/protocol-spec#simple-strings">
Simple string reply
</a>
:
<code>
PONG
</code>
when no argument is provided.
</li>
<li>
<a href="../../develop/reference/protocol-spec#bulk-strings">
Bulk string reply
</a>
: the provided argument.
</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/ping/"/>
<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/xpending/.html | <section class="prose w-full py-12">
<h1 class="command-name">
XPENDING
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">XPENDING key group [[IDLEΒ min-idle-time] start end count [consumer]]</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(N) with N being the number of elements returned, so asking for a small fixed number of entries per call is O(1). O(M), where M is the total number of entries scanned when used with the IDLE filter. When the command returns just the summary and the list of consumers is small, it runs in O(1) time; otherwise, an additional O(N) time for iterating every consumer.
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
ACL categories:
</dt>
<dd class="m-0">
<code>
@read
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@stream
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@slow
</code>
<span class="mr-1 last:hidden">
,
</span>
</dd>
</dl>
<p>
Fetching data from a stream via a consumer group, and not acknowledging
such data, has the effect of creating
<em>
pending entries
</em>
. This is
well explained in the
<a href="/docs/latest/commands/xreadgroup/">
<code>
XREADGROUP
</code>
</a>
command, and even better in our
<a href="/docs/latest/develop/data-types/streams/">
introduction to Redis Streams
</a>
. The
<a href="/docs/latest/commands/xack/">
<code>
XACK
</code>
</a>
command
will immediately remove the pending entry from the Pending Entries List (PEL)
since once a message is successfully processed, there is no longer need
for the consumer group to track it and to remember the current owner
of the message.
</p>
<p>
The
<code>
XPENDING
</code>
command is the interface to inspect the list of pending
messages, and is as thus a very important command in order to observe
and understand what is happening with a streams consumer groups: what
clients are active, what messages are pending to be consumed, or to see
if there are idle messages. Moreover this command, together with
<a href="/docs/latest/commands/xclaim/">
<code>
XCLAIM
</code>
</a>
is used in order to implement recovering of consumers that are failing
for a long time, and as a result certain messages are not processed: a
different consumer can claim the message and continue. This is better
explained in the
<a href="/docs/latest/develop/data-types/streams/">
streams intro
</a>
and in the
<a href="/docs/latest/commands/xclaim/">
<code>
XCLAIM
</code>
</a>
command page, and is not covered here.
</p>
<h2 id="summary-form-of-xpending">
Summary form of XPENDING
</h2>
<p>
When
<code>
XPENDING
</code>
is called with just a key name and a consumer group
name, it just outputs a summary about the pending messages in a given
consumer group. In the following example, we create a consumer group and
immediately create a pending message by reading from the group with
<a href="/docs/latest/commands/xreadgroup/">
<code>
XREADGROUP
</code>
</a>
.
</p>
<pre tabindex="0"><code>> XGROUP CREATE mystream group55 0-0
OK
> XREADGROUP GROUP group55 consumer-123 COUNT 1 STREAMS mystream >
1) 1) "mystream"
2) 1) 1) 1526984818136-0
2) 1) "duration"
2) "1532"
3) "event-id"
4) "5"
5) "user-id"
6) "7782813"
</code></pre>
<p>
We expect the pending entries list for the consumer group
<code>
group55
</code>
to
have a message right now: consumer named
<code>
consumer-123
</code>
fetched the
message without acknowledging its processing. The simple
<code>
XPENDING
</code>
form will give us this information:
</p>
<pre tabindex="0"><code>> XPENDING mystream group55
1) (integer) 1
2) 1526984818136-0
3) 1526984818136-0
4) 1) 1) "consumer-123"
2) "1"
</code></pre>
<p>
In this form, the command outputs the total number of pending messages for this
consumer group, which is one, followed by the smallest and greatest ID among the
pending messages, and then list every consumer in the consumer group with
at least one pending message, and the number of pending messages it has.
</p>
<h2 id="extended-form-of-xpending">
Extended form of XPENDING
</h2>
<p>
The summary provides a good overview, but sometimes we are interested in the
details. In order to see all the pending messages with more associated
information we need to also pass a range of IDs, in a similar way we do it with
<a href="/docs/latest/commands/xrange/">
<code>
XRANGE
</code>
</a>
, and a non optional
<em>
count
</em>
argument, to limit the number
of messages returned per call:
</p>
<pre tabindex="0"><code>> XPENDING mystream group55 - + 10
1) 1) 1526984818136-0
2) "consumer-123"
3) (integer) 196415
4) (integer) 1
</code></pre>
<p>
In the extended form we no longer see the summary information, instead there
is detailed information for each message in the pending entries list. For
each message four attributes are returned:
</p>
<ol>
<li>
The ID of the message.
</li>
<li>
The name of the consumer that fetched the message and has still to acknowledge it. We call it the current
<em>
owner
</em>
of the message.
</li>
<li>
The number of milliseconds that elapsed since the last time this message was delivered to this consumer.
</li>
<li>
The number of times this message was delivered.
</li>
</ol>
<p>
The deliveries counter, that is the fourth element in the array, is incremented
when some other consumer
<em>
claims
</em>
the message with
<a href="/docs/latest/commands/xclaim/">
<code>
XCLAIM
</code>
</a>
, or when the
message is delivered again via
<a href="/docs/latest/commands/xreadgroup/">
<code>
XREADGROUP
</code>
</a>
, when accessing the history
of a consumer in a consumer group (see the
<a href="/docs/latest/commands/xreadgroup/">
<code>
XREADGROUP
</code>
</a>
page for more info).
</p>
<p>
It is possible to pass an additional argument to the command, in order
to see the messages having a specific owner:
</p>
<pre tabindex="0"><code>> XPENDING mystream group55 - + 10 consumer-123
</code></pre>
<p>
But in the above case the output would be the same, since we have pending
messages only for a single consumer. However what is important to keep in
mind is that this operation, filtering by a specific consumer, is not
inefficient even when there are many pending messages from many consumers:
we have a pending entries list data structure both globally, and for
every consumer, so we can very efficiently show just messages pending for
a single consumer.
</p>
<h2 id="idle-time-filter">
Idle time filter
</h2>
<p>
It is also possible to filter pending stream entries by their idle-time,
given in milliseconds (useful for
<a href="/docs/latest/commands/xclaim/">
<code>
XCLAIM
</code>
</a>
ing entries that have not been
processed for some time):
</p>
<pre tabindex="0"><code>> XPENDING mystream group55 IDLE 9000 - + 10
> XPENDING mystream group55 IDLE 9000 - + 10 consumer-123
</code></pre>
<p>
The first case will return the first 10 (or less) PEL entries of the entire group
that are idle for over 9 seconds, whereas in the second case only those of
<code>
consumer-123
</code>
.
</p>
<h2 id="exclusive-ranges-and-iterating-the-pel">
Exclusive ranges and iterating the PEL
</h2>
<p>
The
<code>
XPENDING
</code>
command allows iterating over the pending entries just like
<a href="/docs/latest/commands/xrange/">
<code>
XRANGE
</code>
</a>
and
<a href="/docs/latest/commands/xrevrange/">
<code>
XREVRANGE
</code>
</a>
allow for the stream's entries. You can do this by
prefixing the ID of the last-read pending entry with the
<code>
(
</code>
character that
denotes an open (exclusive) range, and proving it to the subsequent call to the
command.
</p>
<h2 id="resp2resp3-reply">
RESP2/RESP3 Reply
</h2>
<ul>
<li>
<a href="../../develop/reference/protocol-spec#arrays">
Array reply
</a>
: different data depending on the way XPENDING is called, as explained on this page.
</li>
</ul>
<br/>
<h2>
History
</h2>
<ul>
<li>
Starting with Redis version 6.2.0: Added the
<code>
IDLE
</code>
option and exclusive range intervals.
</li>
</ul>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/xpending/"/>
<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/statistics/shard-metrics/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Shard metrics
</h1>
<p class="text-lg -mt-5 mb-10">
Documents the shard metrics used with Redis Enterprise Software REST API calls.
</p>
<table>
<thead>
<tr>
<th>
Metric name
</th>
<th>
Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
aof_rewrite_inprog
</td>
<td>
float
</td>
<td>
The number of simultaneous AOF rewrites that are in progress
</td>
</tr>
<tr>
<td>
avg_ttl
</td>
<td>
float
</td>
<td>
Estimated average time to live of a random key (msec)
</td>
</tr>
<tr>
<td>
big_del_flash
</td>
<td>
float
</td>
<td>
Rate of key deletes for keys on flash (BigRedis) (key access/sec). Only returned when BigRedis is enabled.
</td>
</tr>
<tr>
<td>
big_del_ram
</td>
<td>
float
</td>
<td>
Rate of key deletes for keys in RAM (BigRedis) (key access/sec); this includes write misses (new keys created). Only returned when BigRedis is enabled.
</td>
</tr>
<tr>
<td>
big_fetch_flash
</td>
<td>
float
</td>
<td>
Rate of key reads/updates for keys on flash (BigRedis) (key access/sec). Only returned when BigRedis is enabled.
</td>
</tr>
<tr>
<td>
big_fetch_ram
</td>
<td>
float
</td>
<td>
Rate of key reads/updates for keys in RAM (BigRedis) (key access/sec). Only returned when BigRedis is enabled.
</td>
</tr>
<tr>
<td>
big_io_ratio_flash
</td>
<td>
float
</td>
<td>
Rate of key operations on flash. Can be used to compute the ratio of I/O operations (key access/sec). Only returned when BigRedis is enabled.
</td>
</tr>
<tr>
<td>
big_io_ratio_redis
</td>
<td>
float
</td>
<td>
Rate of Redis operations on keys. Can be used to compute the ratio of I/O operations) (key access/sec). Only returned when BigRedis is enabled.
</td>
</tr>
<tr>
<td>
big_write_flash
</td>
<td>
float
</td>
<td>
Rate of key writes for keys on flash (BigRedis) (key access/sec). Only returned when BigRedis is enabled.
</td>
</tr>
<tr>
<td>
big_write_ram
</td>
<td>
float
</td>
<td>
Rate of key writes for keys in RAM (BigRedis) (key access/sec); this includes write misses (new keys created). Only returned when BigRedis is enabled.
</td>
</tr>
<tr>
<td>
bigstore_io_dels
</td>
<td>
float
</td>
<td>
Rate of key deletions from flash (key access/sec). Only returned when BigRedis is enabled.
</td>
</tr>
<tr>
<td>
bigstore_io_read_bytes
</td>
<td>
float
</td>
<td>
Throughput of I/O read operations against backend flash for all shards of the DB (BigRedis) (bytes/sec). Only returned when BigRedis is enabled.
</td>
</tr>
<tr>
<td>
bigstore_io_reads
</td>
<td>
float
</td>
<td>
Rate of key reads from flash (key access/sec). Only returned when BigRedis is enabled.
</td>
</tr>
<tr>
<td>
bigstore_io_write_bytes
</td>
<td>
float
</td>
<td>
Throughput of I/O write operations against backend flash for all shards of the DB (BigRedis) (bytes/sec). Only returned when BigRedis is enabled.
</td>
</tr>
<tr>
<td>
bigstore_io_writes
</td>
<td>
float
</td>
<td>
Rate of key writes from flash (key access/sec). Only returned when BigRedis is enabled.
</td>
</tr>
<tr>
<td>
bigstore_iops
</td>
<td>
float
</td>
<td>
Rate of I/O operations against backend flash for all shards of the DB (BigRedis) (ops/sec). Only returned when BigRedis is enabled.
</td>
</tr>
<tr>
<td>
bigstore_kv_ops
</td>
<td>
float
</td>
<td>
Rate of value read/write/del operations against backend flash for all shards of the DB (BigRedis) (key access/sec). Only returned when BigRedis is enabled.
</td>
</tr>
<tr>
<td>
bigstore_objs_flash
</td>
<td>
float
</td>
<td>
Key count on flash (BigRedis). Only returned when BigRedis is enabled.
</td>
</tr>
<tr>
<td>
bigstore_objs_ram
</td>
<td>
float
</td>
<td>
Key count in RAM (BigRedis). Only returned when BigRedis is enabled.
</td>
</tr>
<tr>
<td>
bigstore_throughput
</td>
<td>
float
</td>
<td>
Throughput of I/O operations against backend flash for all shards of the DB (BigRedis) (bytes/sec). Only returned when BigRedis is enabled.
</td>
</tr>
<tr>
<td>
blocked_clients
</td>
<td>
float
</td>
<td>
Count the clients waiting on a blocking call
</td>
</tr>
<tr>
<td>
connected_clients
</td>
<td>
float
</td>
<td>
Number of client connections to the specific shard
</td>
</tr>
<tr>
<td>
disk_frag_ratio
</td>
<td>
float
</td>
<td>
Flash fragmentation ratio (used/required). Only returned when BigRedis is enabled.
</td>
</tr>
<tr>
<td>
evicted_objects
</td>
<td>
float
</td>
<td>
Rate of key evictions from DB (evictions/sec)
</td>
</tr>
<tr>
<td>
expired_objects
</td>
<td>
float
</td>
<td>
Rate keys expired in DB (expirations/sec)
</td>
</tr>
<tr>
<td>
fork_cpu_system
</td>
<td>
float
</td>
<td>
% cores utilization in system mode for the Redis shard fork child process
</td>
</tr>
<tr>
<td>
fork_cpu_user
</td>
<td>
float
</td>
<td>
% cores utilization in user mode for the Redis shard fork child process
</td>
</tr>
<tr>
<td>
last_save_time
</td>
<td>
float
</td>
<td>
Time of the last RDB save
</td>
</tr>
<tr>
<td>
main_thread_cpu_system
</td>
<td>
float
</td>
<td>
% cores utilization in system mode for the Redis shard main thread
</td>
</tr>
<tr>
<td>
main_thread_cpu_user
</td>
<td>
float
</td>
<td>
% cores utilization in user mode for the Redis shard main thread
</td>
</tr>
<tr>
<td>
mem_frag_ratio
</td>
<td>
float
</td>
<td>
RAM fragmentation ratio (RSS/allocated RAM)
</td>
</tr>
<tr>
<td>
mem_not_counted_for_evict
</td>
<td>
float
</td>
<td>
Portion of used_memory (in bytes) not counted for eviction and OOM errors
</td>
</tr>
<tr>
<td>
mem_size_lua
</td>
<td>
float
</td>
<td>
Redis Lua scripting heap size (bytes)
</td>
</tr>
<tr>
<td>
no_of_expires
</td>
<td>
float
</td>
<td>
Number of volatile keys on the shard
</td>
</tr>
<tr>
<td>
no_of_keys
</td>
<td>
float
</td>
<td>
Number of keys in DB
</td>
</tr>
<tr>
<td>
pubsub_channels
</td>
<td>
float
</td>
<td>
Count the pub/sub channels with subscribed clients
</td>
</tr>
<tr>
<td>
pubsub_patterns
</td>
<td>
float
</td>
<td>
Count the pub/sub patterns with subscribed clients
</td>
</tr>
<tr>
<td>
rdb_changes_since_last_save
</td>
<td>
float
</td>
<td>
Count changes since last RDB save
</td>
</tr>
<tr>
<td>
read_hits
</td>
<td>
float
</td>
<td>
Rate of read operations accessing an existing key (ops/sec)
</td>
</tr>
<tr>
<td>
read_misses
</td>
<td>
float
</td>
<td>
Rate of read operations accessing a nonexistent key (ops/sec)
</td>
</tr>
<tr>
<td>
shard_cpu_system
</td>
<td>
float
</td>
<td>
% cores utilization in system mode for the Redis shard process
</td>
</tr>
<tr>
<td>
shard_cpu_user
</td>
<td>
float
</td>
<td>
% cores utilization in user mode for the Redis shard process
</td>
</tr>
<tr>
<td>
total_req
</td>
<td>
float
</td>
<td>
Rate of operations on DB (ops/sec)
</td>
</tr>
<tr>
<td>
used_memory
</td>
<td>
float
</td>
<td>
Memory used by shard (in BigRedis this includes flash) (bytes)
</td>
</tr>
<tr>
<td>
used_memory_peak
</td>
<td>
float
</td>
<td>
The largest amount of memory used by this shard (bytes)
</td>
</tr>
<tr>
<td>
used_memory_rss
</td>
<td>
float
</td>
<td>
Resident set size of this shard (bytes)
</td>
</tr>
<tr>
<td>
write_hits
</td>
<td>
float
</td>
<td>
Rate of write operations accessing an existing key (ops/sec)
</td>
</tr>
<tr>
<td>
write_misses
</td>
<td>
float
</td>
<td>
Rate of write operations accessing a nonexistent key (ops/sec)
</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/statistics/shard-metrics/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/references/compatibility/config-settings/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Compatibility with Redis Community Edition configuration settings
</h1>
<p class="text-lg -mt-5 mb-10">
Redis Community Edition configuration settings supported by Redis Enterprise.
</p>
<p>
Redis Enterprise Software and
<a href="/docs/latest/operate/rc/">
Redis Cloud
</a>
only support a subset of
<a href="/docs/latest/operate/oss_and_stack/management/config/">
Redis Community Edition configuration settings
</a>
. Using
<a href="/docs/latest/commands/config-get/">
<code>
CONFIG GET
</code>
</a>
or
<a href="/docs/latest/commands/config-set/">
<code>
CONFIG SET
</code>
</a>
with unsupported configuration settings returns an error.
</p>
<table>
<thead>
<tr>
<th style="text-align:left">
Setting
</th>
<th style="text-align:left">
Redis
<br/>
Enterprise
</th>
<th style="text-align:left">
Redis
<br/>
Cloud
</th>
<th style="text-align:left">
Notes
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">
activerehashing
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
</td>
</tr>
<tr>
<td style="text-align:left">
busy-reply-threshold
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Not supported">
β Standard
</span>
<br/>
<span title="Not supported">
<nobr>
β Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
Value must be between 0 and 60000 milliseconds.
</td>
</tr>
<tr>
<td style="text-align:left">
hash-max-listpack-entries
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
</td>
</tr>
<tr>
<td style="text-align:left">
hash-max-listpack-value
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
</td>
</tr>
<tr>
<td style="text-align:left">
hash-max-ziplist-entries
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
</td>
</tr>
<tr>
<td style="text-align:left">
hash-max-ziplist-value
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
</td>
</tr>
<tr>
<td style="text-align:left">
hll-sparse-max-bytes
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
</td>
</tr>
<tr>
<td style="text-align:left">
list-compress-depth
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
</td>
</tr>
<tr>
<td style="text-align:left">
list-max-listpack-size
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
</td>
</tr>
<tr>
<td style="text-align:left">
list-max-ziplist-size
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
</td>
</tr>
<tr>
<td style="text-align:left">
lua-time-limit
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Not supported">
β Standard
</span>
<br/>
<span title="Not supported">
<nobr>
β Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
Value must be between 0 and 60000 milliseconds.
</td>
</tr>
<tr>
<td style="text-align:left">
notify-keyspace-events
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
</td>
</tr>
<tr>
<td style="text-align:left">
set-max-intset-entries
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
</td>
</tr>
<tr>
<td style="text-align:left">
slowlog-log-slower-than
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
Value must be larger than 1000 microseconds.
</td>
</tr>
<tr>
<td style="text-align:left">
slowlog-max-len
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
Value must be between 128 and 1024.
</td>
</tr>
<tr>
<td style="text-align:left">
stream-node-max-bytes
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
</td>
</tr>
<tr>
<td style="text-align:left">
stream-node-max-entries
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
</td>
</tr>
<tr>
<td style="text-align:left">
tracking-table-max-keys
</td>
<td style="text-align:left">
<span title="Not supported">
β Standard
</span>
<br/>
<span title="Not supported">
<nobr>
β Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Not supported">
β Standard
</span>
<br/>
<span title="Not supported">
<nobr>
β Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
For Redis Software, use an
<a href="/docs/latest/operate/rs/references/rest-api/requests/bdbs/#put-bdbs">
update database configuration
</a>
REST API request or
<a href="/docs/latest/operate/rs/references/cli-utilities/rladmin/tune/#tune-db">
<code>
rladmin tune db
</code>
</a>
to set
<code>
tracking_table_max_keys
</code>
instead.
</td>
</tr>
<tr>
<td style="text-align:left">
zset-max-listpack-entries
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
</td>
</tr>
<tr>
<td style="text-align:left">
zset-max-listpack-value
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
</td>
</tr>
<tr>
<td style="text-align:left">
zset-max-ziplist-entries
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
</td>
</tr>
<tr>
<td style="text-align:left">
zset-max-ziplist-value
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
<span title="Supported">
β
Standard
</span>
<br/>
<span title="Supported">
<nobr>
β
Active-Active
</nobr>
</span>
</td>
<td style="text-align:left">
</td>
</tr>
</tbody>
</table>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/references/compatibility/config-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/rs/7.4/security/access-control/ldap/update-database-acls/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Update database ACLs
</h1>
<p class="text-lg -mt-5 mb-10">
Describes how to use the Cluster Manager UI to update database access control lists (ACLs) to authorize access to roles authorizing LDAP user access.
</p>
<p>
To grant LDAP users access to a database, assign the mapped access role to the access control list (ACL) for the database.
</p>
<ol>
<li>
<p>
In the Cluster Manager UI, go to
<strong>
Databases
</strong>
, then select the database from the list.
</p>
</li>
<li>
<p>
From the
<strong>
Security
</strong>
tab, select the
<strong>
Edit
</strong>
button.
</p>
</li>
<li>
<p>
In the
<strong>
Access Control List
</strong>
section, select
<strong>
+ Add ACL
</strong>
.
</p>
<a href="/docs/latest/images/rs/screenshots/databases/security-access-control-acl-only.png" sdata-lightbox="/images/rs/screenshots/databases/security-access-control-acl-only.png">
<img alt="Updating a database access control list (ACL)" src="/docs/latest/images/rs/screenshots/databases/security-access-control-acl-only.png"/>
</a>
</li>
<li>
<p>
Select the appropriate roles and then save your changes.
</p>
</li>
</ol>
<p>
If you assign multiple roles to an ACL and a user is authorized by more than one of these roles, their access is determined by the first βmatchingβ rule in the list.
</p>
<p>
If the first rule gives them read access and the third rule authorizes write access, the user will only be able to read data.
</p>
<p>
As a result, we recommend ordering roles so that higher access roles appear before roles with more limited access.
</p>
<h2 id="more-info">
More info
</h2>
<ul>
<li>
Enable and configure
<a href="/docs/latest/operate/rs/7.4/security/access-control/ldap/enable-role-based-ldap/">
role-based LDAP
</a>
</li>
<li>
Map LDAP groups to
<a href="/docs/latest/operate/rs/7.4/security/access-control/ldap/map-ldap-groups-to-roles/">
access control roles
</a>
</li>
<li>
Learn more about Redis Enterprise Software
<a href="/docs/latest/operate/rs/7.4/security/">
security and practices
</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/operate/rs/7.4/security/access-control/ldap/update-database-acls/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/references/compatibility/client-side-caching/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Client-side caching compatibility with Redis Software and Redis Cloud
</h1>
<p class="text-lg -mt-5 mb-10">
Redis Software and Redis Cloud compatibility with client-side caching.
</p>
<p>
Redis Software and Redis Cloud support
<a href="/docs/latest/develop/clients/client-side-caching/">
client-side caching
</a>
for databases with Redis versions 7.4 or later.
</p>
<h2 id="required-database-versions">
Required database versions
</h2>
<p>
Client-side caching in Redis Software and Redis Cloud requires Redis database versions 7.4 or later.
</p>
<p>
The following table shows the differences in client-side caching support by product:
</p>
<table>
<thead>
<tr>
<th>
Redis product
</th>
<th>
Client-side caching support
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
Redis Community Edition
</td>
<td>
Redis v6.0 and later
</td>
</tr>
<tr>
<td>
Redis Cloud
</td>
<td>
Redis database v7.4 and later
</td>
</tr>
<tr>
<td>
Redis Software
</td>
<td>
Redis database v7.4 and later
</td>
</tr>
</tbody>
</table>
<h2 id="supported-resp-versions">
Supported RESP versions
</h2>
<p>
Client-side caching in Redis Software and Redis Cloud requires
<a href="/docs/latest/develop/reference/protocol-spec/#resp-versions">
RESP3
</a>
.
</p>
<p>
The following table shows the differences in client-side caching support for RESP by product:
</p>
<table>
<thead>
<tr>
<th>
Redis product with client-side caching
</th>
<th>
RESP2
</th>
<th>
RESP3
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
Redis Community Edition
</td>
<td>
<span title="Supported">
β
</span>
</td>
<td>
<span title="Supported">
β
</span>
</td>
</tr>
<tr>
<td>
Redis Cloud
</td>
<td>
<span title="Not supported">
β
</span>
</td>
<td>
<span title="Supported">
β
</span>
</td>
</tr>
<tr>
<td>
Redis Software
</td>
<td>
<span title="Not supported">
β
</span>
</td>
<td>
<span title="Supported">
β
</span>
</td>
</tr>
</tbody>
</table>
<h2 id="two-connections-mode-with-redirect-not-supported">
Two connections mode with REDIRECT not supported
</h2>
<p>
Unlike Redis Community Edition, Redis Software and Redis Cloud do not support
<a href="/docs/latest/develop/reference/client-side-caching/#two-connections-mode">
two connections mode
</a>
or the
<code>
REDIRECT
</code>
option for
<a href="/docs/latest/commands/client-tracking/">
<code>
CLIENT TRACKING
</code>
</a>
.
</p>
<h2 id="change-tracking_table_max_keys-for-a-database">
Change tracking_table_max_keys for a database
</h2>
<p>
When client-side caching is enabled, Redis uses an invalidation table to track which keys are cached by each connected client.
</p>
<p>
The configuration setting
<code>
tracking-table-max-keys
</code>
determines the maximum number of keys stored in the invalidation table and is set to
<code>
1000000
</code>
keys by default. Redis Software does not support using
<code>
CONFIG SET
</code>
to change this value, but you can use the REST API or rladmin instead.
</p>
<p>
To change
<code>
tracking_table_max_keys
</code>
for a database in a Redis Software cluster:
</p>
<ul>
<li>
<p>
<a href="/docs/latest/operate/rs/references/cli-utilities/rladmin/tune/#tune-db">
<code>
rladmin tune db
</code>
</a>
:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin tune db db:<ID> tracking_table_max_keys <span class="m">2000000</span>
</span></span></code></pre>
</div>
<p>
You can use the database name in place of
<code>
db:<ID>
</code>
in the preceding command.
</p>
</li>
<li>
<p>
<a href="/docs/latest/operate/rs/references/rest-api/requests/bdbs/#put-bdbs">
Update database configuration
</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/bdbs/<uid>
</span></span><span class="line"><span class="cl"><span class="o">{</span> <span class="s2">"tracking_table_max_keys"</span>: <span class="m">2000000</span> <span class="o">}</span>
</span></span></code></pre>
</div>
</li>
</ul>
<h2 id="change-default-tracking_table_max_keys">
Change default tracking_table_max_keys
</h2>
<p>
The cluster-wide option
<code>
default_tracking_table_max_keys_policy
</code>
determines the default value of
<code>
tracking_table_max_keys
</code>
for new databases in a Redis Software cluster.
<code>
default_tracking_table_max_keys_policy
</code>
is set to
<code>
1000000
</code>
keys by default.
</p>
<p>
To change
<code>
default_tracking_table_max_keys_policy
</code>
, use one of the following methods:
</p>
<ul>
<li>
<p>
<a href="/docs/latest/operate/rs/references/cli-utilities/rladmin/tune/#tune-cluster">
<code>
rladmin tune cluster
</code>
</a>
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin tune cluster default_tracking_table_max_keys_policy <span class="m">2000000</span>
</span></span></code></pre>
</div>
</li>
<li>
<p>
<a href="/docs/latest/operate/rs/references/rest-api/requests/cluster/policy/#put-cluster-policy">
Update cluster policy
</a>
REST API request:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">PUT /v1/cluster/policy
</span></span><span class="line"><span class="cl"><span class="o">{</span> <span class="s2">"default_tracking_table_max_keys_policy"</span>: <span class="m">2000000</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/references/compatibility/client-side-caching/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/cluster/running_actions/.html | <section class="prose w-full py-12 max-w-none">
<h1>
rladmin cluster running_actions
</h1>
<p class="text-lg -mt-5 mb-10">
Lists all active tasks.
</p>
<p>
Lists all active tasks running on the cluster.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin cluster running_actions
</span></span></code></pre>
</div>
<h3 id="parameters">
Parameters
</h3>
<p>
None
</p>
<h3 id="returns">
Returns
</h3>
<p>
Returns details about any active tasks running on the cluster.
</p>
<h3 id="example">
Example
</h3>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">$ rladmin cluster running_actions
</span></span><span class="line"><span class="cl">Got <span class="m">1</span> tasks:
</span></span><span class="line"><span class="cl">1<span class="o">)</span> Task: maintenance_on <span class="o">(</span>ce391d81-8d51-4ce2-8f63-729c7ac2589e<span class="o">)</span> Node: <span class="m">1</span> Status: running
</span></span></code></pre>
</div>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/cluster/running_actions/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/7.4/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/7.4/references/rest-api/">
REST API
</a>
:
</p>
<ol>
<li>
<p>
Use the REST API to
<a href="/docs/latest/operate/rs/7.4/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/7.4/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/7.4/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/7.4/references/cli-utilities/rladmin/">
<code>
rladmin
</code>
</a>
command-line utility:
</p>
<ol>
<li>
<p>
Use
<a href="/docs/latest/operate/rs/7.4/references/cli-utilities/rladmin/cluster/certificate/">
<code>
rladmin
</code>
</a>
to
<a href="/docs/latest/operate/rs/7.4/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/7.4/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/7.4/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/kubernetes/release-notes/previous-releases/k8s-6-0-6-23/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Redis Enterprise for Kubernetes Release Notes 6.0.6-23 (August 2020)
</h1>
<p class="text-lg -mt-5 mb-10">
Support for Redis Enterprise Software 6.0.6-39, Rancher support, new database backup and alert options.
</p>
<p>
The Redis Enterprise K8s 6.0.6-23 release is a
<em>
major release
</em>
on top of
<a href="https://github.com/RedisLabs/redis-enterprise-k8s-docs/releases/tag/v6.0.6-11">
6.0.6-11
</a>
providing support for the latest
<a href="https://docs.redislabs.com/latest/rs/release-notes/rs-6-0-may-2020/">
Redis Enterprise Software release 6.0.6-39
</a>
and includes several enhancements (including Rancher support) and bug fixes.
</p>
<h2 id="overview">
Overview
</h2>
<p>
This release of the operator provides:
</p>
<ul>
<li>
Support for the Redis Enterprise Software release 6.0.6-39
</li>
<li>
Support for Rancher
</li>
<li>
Backup options in the database custom resource and controller
</li>
<li>
Alert option in the database custom resource and controller
</li>
<li>
UBI images
</li>
<li>
Various other enhancements and bug fixes
</li>
</ul>
<p>
To upgrade your deployment to this latest release, see
<a href="/docs/latest/operate/kubernetes/upgrade/upgrade-redis-cluster/">
"Upgrade a Redis Enterprise cluster (REC) on Kubernetes"
</a>
.
</p>
<h2 id="images">
Images
</h2>
<ul>
<li>
<strong>
Redis Enterprise
</strong>
- redislabs/redis:6.0.6-39 or redislabs/redis:6.0.6-39.rhel7-openshift
</li>
<li>
<strong>
Operator
</strong>
- redislabs/operator:6.0.6-23
</li>
<li>
<strong>
Services Rigger
</strong>
- redislabs/k8s-controller:6.0.6-23 or redislabs/services-manager:6.0.6-23 (on the RedHat registry)
</li>
</ul>
<h2 id="new-features">
New features
</h2>
<p>
Red Hat UBI base images (RED29651) - The services rigger and operator images are now based on Red Hat UBI base images. Also, the same images are now used in both OpenShift and non-OpenShift environments.
</p>
<ul>
<li>
<p>
Rancher support (RED37918) - The operator is now supported on
<a href="https://rancher.com/">
Rancher
</a>
version (
<a href="https://rancher.com/support-maintenance-terms/all-supported-versions/rancher-v2.4.5/">
v2.4.5
</a>
). Note that since this release of the operator doesn't support K8s 1.18, it requires one of the other supported upstread version in this Rancher release, i.e. 1.15.12, 1.16.13 or 1.17.9.
</p>
</li>
<li>
<p>
Database Replica Of support (RED40160) - Support for
<a href="https://docs.redislabs.com/latest/rs/administering/active-passive/">
Replica Of
</a>
was added to the
<a href="https://github.com/RedisLabs/redis-enterprise-k8s-docs/blob/master/redis_enterprise_database_api.md#replicasource">
DB controller
</a>
.
</p>
</li>
<li>
<p>
Database backup configuration (RED40165) - Support for
<a href="https://docs.redislabs.com/latest/rs/administering/database-operations/database-backup/">
backup configuration
</a>
was added to the
<a href="https://github.com/RedisLabs/redis-enterprise-k8s-docs/blob/master/redis_enterprise_database_api.md#backupspec">
DB controller spec
</a>
.
</p>
</li>
<li>
<p>
Alert configuration (RED40166) - Support for alert configuration was added to the
<a href="https://github.com/RedisLabs/redis-enterprise-k8s-docs/blob/master/redis_enterprise_database_api.md#dbalertssettings">
DB controller spec
</a>
.
</p>
</li>
<li>
<p>
Database TLS configuration (RED41758) - Support for TLS authentication configuration was added to the
<a href="https://github.com/RedisLabs/redis-enterprise-k8s-docs/blob/0ec741ffb3d621d371b5eec5b0a045ee7364e50e/redis_enterprise_database_api.md#redisenterprisedatabasespec">
DB controller spec
</a>
.
</p>
</li>
<li>
<p>
OpenShift 4.4 support (RED41352) - The operator is now supported on
<a href="https://docs.openshift.com/container-platform/4.4/welcome/index.html">
Openshift 4.4
</a>
.
</p>
</li>
<li>
<p>
DB controller resources via the OLM (RED41755) - Support for configuration of DB controller resources was added to the OLM (preview channel).
</p>
</li>
</ul>
<h2 id="important-fixes">
Important fixes
</h2>
<ul>
<li>
Openshift OLM upgrade support was fixed. Also, installing past versions was added through dedicated channels. (RED44130)
</li>
<li>
Fixed log_collector failures when pods were not scheduled. (RED45347)
</li>
<li>
Fixed wrong handling of the operator environment variables. Specifically, enabling/disabling the database controller now works correctly. (RED45351)
</li>
</ul>
<h2 id="known-limitations">
Known limitations
</h2>
<ul>
<li>
<p>
CrashLoopBackOff causes cluster recovery to be incomplete (RED33713) - When a pod status is CrashLoopBackOff and we run the cluster recovery, the process will not complete. The solution is to delete the crashing pods manually and recovery process will continue.
</p>
</li>
<li>
<p>
Long cluster names cause routes to be rejected (RED25871) - A cluster name longer than 20 characters will result in a rejected route configuration as the host part of the domain name exceeds 63 characters. The workaround is to limit cluster name to 20 characters or less.
</p>
</li>
<li>
<p>
Cluster CR (REC) errors are not reported after invalid updates (RED25542) - 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 (RED32805) - When a cluster is in an unreachable state the state is still running instead of being reported as an error.
</p>
</li>
<li>
<p>
Readiness probe incorrect on failures (RED39300) - STS Readiness probe doesn't mark a node as not ready when rladmin status on the node fails
</p>
</li>
<li>
<p>
Role missing on replica sets (RED39002) - The redis-enterprise-operator role is missing permission on replica sets.
</p>
</li>
<li>
<p>
Private registries are not supported on OpenShift 3.11 (RED38579) - Openshift 3.11 doesn't support dockerhub private registry. This is a known OpenShift issue.
</p>
</li>
<li>
<p>
Internal DNS and K8s DNS may have conflicts (RED37462) - DNS conflicts are possible between the cluster mdns_server and the K8s DNS. This only impacts DNS resolution from within cluster nodes for K8s DNS names.
</p>
</li>
<li>
<p>
5.4.10 negatively impacts 5.4.6 (RED37233) - K8S-based 5.4.10 clusters seem to negatively impact existing 5.4.6
</p>
</li>
<li>
<p>
Node CPU usage is reported instead of pod CPU usage (RED36884) - In Kubernetes, the node CPU usage we report on is the usage of the K8S worker node hosting the REC pod.
</p>
</li>
<li>
<p>
Clusters must be named "rec" in OLM-based deployments (RED39825) - 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) is bound to a specific service account name (i.e., "rec"). The workaround is to name the cluster "rec".
</p>
</li>
<li>
<p>
Updating UI service in Rancher (RED45771) - Updating the UI service type may fail in Rancher. When this happens, delete the service manually and the operator will recreate it correctly.
</p>
</li>
<li>
<p>
Master pod label in Rancher (RED42896) - Master pod is not always labeled in Rancher.
</p>
</li>
</ul>
<h2 id="deprecation-notice">
Deprecation notice
</h2>
<p>
Support for Kubernetes version 1.11 and 1.12 is deprecated (excludes Openshift 3.11, which continues to be supported).
</p>
<h2 id="compatibility-updates">
Compatibility updates
</h2>
<ul>
<li>
Added support for Rancher
</li>
<li>
Added support for Openshift 4.4
</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/previous-releases/k8s-6-0-6-23/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/commands/memory-help/.html | <section class="prose w-full py-12">
<h1 class="command-name">
MEMORY HELP
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">MEMORY 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">
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>
@slow
</code>
<span class="mr-1 last:hidden">
,
</span>
</dd>
</dl>
<p>
The
<code>
MEMORY HELP
</code>
command returns a helpful text describing the different
subcommands.
</p>
<h2 id="resp2-reply">
RESP2 Reply
</h2>
<a href="../../develop/reference/protocol-spec#arrays">
Array reply
</a>
: a list of sub-commands and their descriptions
<h2 id="resp3-reply">
RESP3 Reply
</h2>
<a href="../../develop/reference/protocol-spec#arrays">
Array reply
</a>
: a list of sub-commands and their descriptions.
<br/>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/memory-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/executearray/.html | <section class="prose w-full py-12 max-w-none">
<h1>
ExecuteArray
</h1>
<p class="text-lg -mt-5 mb-10">
Runs a Redis command.
</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="kd">native</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="nf">executeArray</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">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. It accepts an array of strings, which represents the command to execute.
</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>
array of strings
</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="example">
Example
</h2>
<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">executeArray</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/executearray/"/>
<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/stats_archiver/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Stats archiver object
</h1>
<p class="text-lg -mt-5 mb-10">
Documents the stats_archiver 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>
operating_mode
</td>
<td>
'disabled'
<br/>
'enabled'
</td>
<td>
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/stats_archiver/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/commands/sunsubscribe/.html | <section class="prose w-full py-12">
<h1 class="command-name">
SUNSUBSCRIBE
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">SUNSUBSCRIBE [shardchannel [shardchannel ...]]</pre>
<dl class="grid grid-cols-[auto,1fr] gap-2 mb-12">
<dt class="font-semibold text-redis-ink-900 m-0">
Available since:
</dt>
<dd class="m-0">
7.0.0
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
Time complexity:
</dt>
<dd class="m-0">
O(N) where N is the number of shard channels to unsubscribe.
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
ACL categories:
</dt>
<dd class="m-0">
<code>
@pubsub
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@slow
</code>
<span class="mr-1 last:hidden">
,
</span>
</dd>
</dl>
<p>
Unsubscribes the client from the given shard channels, or from all of them if none is given.
</p>
<p>
When no shard channels are specified, the client is unsubscribed from all the previously subscribed shard channels.
In this case a message for every unsubscribed shard channel will be sent to the client.
</p>
<p>
Note: The global channels and shard channels needs to be unsubscribed from separately.
</p>
<p>
For more information about sharded Pub/Sub, see
<a href="/docs/latest/develop/interact/pubsub/#sharded-pubsub">
Sharded Pub/Sub
</a>
.
</p>
<h2 id="resp2resp3-reply">
RESP2/RESP3 Reply
</h2>
When successful, this command doesn't return anything. Instead, for each shard channel, one message with the first element being the string
<code>
sunsubscribe
</code>
is pushed as a confirmation that the command succeeded.
<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/sunsubscribe/"/>
<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/append/.html | <section class="prose w-full py-12">
<h1 class="command-name">
APPEND
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">APPEND key value</pre>
<dl class="grid grid-cols-[auto,1fr] gap-2 mb-12">
<dt class="font-semibold text-redis-ink-900 m-0">
Available since:
</dt>
<dd class="m-0">
2.0.0
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
Time complexity:
</dt>
<dd class="m-0">
O(1). The amortized time complexity is O(1) assuming the appended value is small and the already present value is of any size, since the dynamic string library used by Redis will double the free space available on every reallocation.
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
ACL categories:
</dt>
<dd class="m-0">
<code>
@write
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@string
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@fast
</code>
<span class="mr-1 last:hidden">
,
</span>
</dd>
</dl>
<p>
If
<code>
key
</code>
already exists and is a string, this command appends the
<code>
value
</code>
at the
end of the string.
If
<code>
key
</code>
does not exist it is created and set as an empty string, so
<code>
APPEND
</code>
will be similar to
<a href="/docs/latest/commands/set/">
<code>
SET
</code>
</a>
in this special case.
</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> EXISTS mykey
(integer) 0
redis> APPEND mykey "Hello"
(integer) 5
redis> APPEND mykey " World"
(integer) 11
redis> GET mykey
"Hello World"
</pre>
<div class="prompt" style="">
<span>
redis>
</span>
<input autocomplete="off" name="prompt" spellcheck="false" type="text"/>
</div>
</form>
<h2 id="pattern-time-series">
Pattern: Time series
</h2>
<p>
The
<code>
APPEND
</code>
command can be used to create a very compact representation of a
list of fixed-size samples, usually referred as
<em>
time series
</em>
.
Every time a new sample arrives we can store it using the command
</p>
<pre tabindex="0"><code>APPEND timeseries "fixed-size sample"
</code></pre>
<p>
Accessing individual elements in the time series is not hard:
</p>
<ul>
<li>
<a href="/docs/latest/commands/strlen/">
<code>
STRLEN
</code>
</a>
can be used in order to obtain the number of samples.
</li>
<li>
<a href="/docs/latest/commands/getrange/">
<code>
GETRANGE
</code>
</a>
allows for random access of elements.
If our time series have associated time information we can easily implement
a binary search to get range combining
<a href="/docs/latest/commands/getrange/">
<code>
GETRANGE
</code>
</a>
with the Lua scripting
engine available in Redis 2.6.
</li>
<li>
<a href="/docs/latest/commands/setrange/">
<code>
SETRANGE
</code>
</a>
can be used to overwrite an existing time series.
</li>
</ul>
<p>
The limitation of this pattern is that we are forced into an append-only mode
of operation, there is no way to cut the time series to a given size easily
because Redis currently lacks a command able to trim string objects.
However the space efficiency of time series stored in this way is remarkable.
</p>
<p>
Hint: it is possible to switch to a different key based on the current Unix
time, in this way it is possible to have just a relatively small amount of
samples per key, to avoid dealing with very big keys, and to make this pattern
more friendly to be distributed across many Redis instances.
</p>
<p>
An example sampling the temperature of a sensor using fixed-size strings (using
a binary format is better in real implementations).
</p>
<div class="bg-slate-900 border-b border-slate-700 rounded-t-xl px-4 py-3 w-full flex">
<svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20">
<path d="M2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10Z">
</path>
</svg>
<svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20">
<path d="M10 2.5L18.6603 17.5L1.33975 17.5L10 2.5Z">
</path>
</svg>
<svg class="shrink-0 h-[1.0625rem] w-[1.0625rem] fill-slate-50" fill="currentColor" viewbox="0 0 20 20">
<path d="M10 2.5L12.0776 7.9322L17.886 8.22949L13.3617 11.8841L14.8738 17.5L10 14.3264L5.1262 17.5L6.63834 11.8841L2.11403 8.22949L7.92238 7.9322L10 2.5Z">
</path>
</svg>
</div>
<form class="redis-cli overflow-y-auto max-h-80">
<pre tabindex="0">redis> APPEND ts "0043"
(integer) 4
redis> APPEND ts "0035"
(integer) 8
redis> GETRANGE ts 0 3
"0043"
redis> GETRANGE ts 4 7
"0035"
</pre>
<div class="prompt" style="">
<span>
redis>
</span>
<input autocomplete="off" name="prompt" spellcheck="false" type="text"/>
</div>
</form>
<h2 id="resp2resp3-reply">
RESP2/RESP3 Reply
</h2>
<a href="../../develop/reference/protocol-spec#integers">
Integer reply
</a>
: the length of the string after the append operation.
<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/append/"/>
<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/restore/.html | <section class="prose w-full py-12">
<h1 class="command-name">
RESTORE
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">RESTORE key ttl serialized-value [REPLACE] [ABSTTL]
[IDLETIMEΒ seconds] [FREQΒ frequency]</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">
O(1) to create the new key and additional O(N*M) to reconstruct the serialized value, where N is the number of Redis objects composing the value and M their average size. For small string values the time complexity is thus O(1)+O(1*M) where M is small, so simply O(1). However for sorted set values the complexity is O(N*M*log(N)) because inserting values into sorted sets is O(log(N)).
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
ACL categories:
</dt>
<dd class="m-0">
<code>
@keyspace
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@write
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@slow
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@dangerous
</code>
<span class="mr-1 last:hidden">
,
</span>
</dd>
</dl>
<p>
Create a key associated with a value that is obtained by deserializing the
provided serialized value (obtained via
<a href="/docs/latest/commands/dump/">
<code>
DUMP
</code>
</a>
).
</p>
<p>
If
<code>
ttl
</code>
is 0 the key is created without any expire, otherwise the specified
expire time (in milliseconds) is set.
</p>
<p>
If the
<code>
ABSTTL
</code>
modifier was used,
<code>
ttl
</code>
should represent an absolute
<a href="http://en.wikipedia.org/wiki/Unix_time">
Unix timestamp
</a>
(in milliseconds) in which the key will expire.
</p>
<p>
For eviction purposes, you may use the
<code>
IDLETIME
</code>
or
<code>
FREQ
</code>
modifiers. See
<a href="/docs/latest/commands/object/">
<code>
OBJECT
</code>
</a>
for more information.
</p>
<p>
<code>
RESTORE
</code>
will return a "Target key name is busy" error when
<code>
key
</code>
already
exists unless you use the
<code>
REPLACE
</code>
modifier.
</p>
<p>
<code>
RESTORE
</code>
checks the RDB version and data checksum.
If they don't match an error is returned.
</p>
<h2 id="examples">
Examples
</h2>
<pre tabindex="0"><code>redis> DEL mykey
0
redis> RESTORE mykey 0 "\n\x17\x17\x00\x00\x00\x12\x00\x00\x00\x03\x00\
x00\xc0\x01\x00\x04\xc0\x02\x00\x04\xc0\x03\x00\
xff\x04\x00u#<\xc0;.\xe9\xdd"
OK
redis> TYPE mykey
list
redis> LRANGE mykey 0 -1
1) "1"
2) "2"
3) "3"
</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/>
<h2>
History
</h2>
<ul>
<li>
Starting with Redis version 3.0.0: Added the
<code>
REPLACE
</code>
modifier.
</li>
<li>
Starting with Redis version 5.0.0: Added the
<code>
ABSTTL
</code>
modifier.
</li>
<li>
Starting with Redis version 5.0.0: Added the
<code>
IDLETIME
</code>
and
<code>
FREQ
</code>
options.
</li>
</ul>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/restore/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/commands/topk.reserve/.html | <section class="prose w-full py-12">
<h1 class="command-name">
TOPK.RESERVE
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">TOPK.RESERVE key topk [width depth decay]</pre>
<dl class="grid grid-cols-[auto,1fr] gap-2 mb-12">
<dt class="font-semibold text-redis-ink-900 m-0">
Available in:
</dt>
<dd class="m-0">
<a href="/docs/stack">
Redis Stack
</a>
/
<a href="/docs/data-types/probabilistic">
Bloom 2.0.0
</a>
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
Time complexity:
</dt>
<dd class="m-0">
O(1)
</dd>
</dl>
<p>
Initializes a TopK with specified parameters.
</p>
<h3 id="parameters">
Parameters
</h3>
<ul>
<li>
<strong>
key
</strong>
: Key under which the sketch is to be found.
</li>
<li>
<strong>
topk
</strong>
: Number of top occurring items to keep.
</li>
</ul>
<p>
Optional parameters
</p>
<ul>
<li>
<strong>
width
</strong>
: Number of counters kept in each array. (Default 8)
</li>
<li>
<strong>
depth
</strong>
: Number of arrays. (Default 7)
</li>
<li>
<strong>
decay
</strong>
: The probability of reducing a counter in an occupied bucket. It is raised to power of it's counter (decay ^ bucket[i].counter). Therefore, as the counter gets higher, the chance of a reduction is being reduced. (Default 0.9)
</li>
</ul>
<h2 id="return">
Return
</h2>
<p>
<a href="/docs/latest/develop/reference/protocol-spec/#simple-strings">
Simple string reply
</a>
-
<code>
OK
</code>
if executed correctly, or [] otherwise.
</p>
<h2 id="examples">
Examples
</h2>
<pre tabindex="0"><code>redis> TOPK.RESERVE topk 50 2000 7 0.925
OK
</code></pre>
<br/>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/topk.reserve/"/>
<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/networking/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Networking
</h1>
<p>
Redis Enterprise for Kubernetes supports several ways to route external traffic to your RedisEnterpriseCluster:
</p>
<ul>
<li>
Ingress controllers
<a href="https://haproxy-ingress.github.io/">
HAProxy
</a>
and
<a href="https://kubernetes.github.io/ingress-nginx/">
NGINX
</a>
require an
<code>
ingress
</code>
API resource.
</li>
<li>
<a href="https://istio.io/latest/docs/setup/getting-started/">
Istio
</a>
requires
<code>
Gateway
</code>
and
<code>
VirtualService
</code>
API resources.
</li>
<li>
OpenShift uses
<a href="/docs/latest/operate/kubernetes/networking/routes/">
routes
</a>
to route external traffic.
</li>
<li>
The RedisEnterpriseActiveActiveDatabase (REAADB) requires any of the above routing methods to be configured in the RedisEnterpriseCluster (REC) with the
<code>
ingressOrRouteSpec
</code>
field.
</li>
</ul>
<h2 id="external-routing-using-redis-enterprise-for-kubernetes">
External routing using Redis Enterprise for Kubernetes
</h2>
<p>
Every time a RedisEnterpriseDatabase (REDB), Redis Enterprise Active-Active database (REAADB), or Redis Enterprise cluster (REC) is created, the Redis Enterprise operator automatically creates a
<a href="https://kubernetes.io/docs/concepts/services-networking/service/">
service
</a>
to allow requests to be routed to that resource.
</p>
<p>
Redis Enterprise supports three
<a href="https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types">
types of services
</a>
for accessing databases:
<code>
ClusterIP
</code>
,
<code>
headless
</code>
, or
<code>
LoadBalancer
</code>
.
</p>
<p>
By default, the operator creates a
<code>
ClusterIP
</code>
type service, which exposes a cluster-internal IP and that can only be accessed from within the K8s cluster. For requests to be routed from outside the K8s cluster, you need an
<a href="https://kubernetes.io/docs/concepts/services-networking/ingress/">
Ingress
</a>
(or
<a href="https://docs.openshift.com/container-platform/4.12/networking/routes/route-configuration.html">
route
</a>
if you are using OpenShift). See
<a href="https://kubernetes.io/docs/">
kubernetes.io
</a>
for more details on
<a href="https://kubernetes.io/docs/concepts/services-networking/ingress/">
Ingress
</a>
and
<a href="https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/">
Ingress controllers
</a>
.
</p>
<ul>
<li>
To use NGINX or HAProxy Ingress controllers, see
<a href="/docs/latest/operate/kubernetes/networking/ingress/">
Ingress routing
</a>
.
</li>
<li>
To use OpenShift routes, see
<a href="/docs/latest/operate/kubernetes/networking/routes/">
OpenShift routes
</a>
.
</li>
<li>
To use Istio as an Ingress controller, see
<a href="/docs/latest/operate/kubernetes/networking/istio-ingress/">
Istio Ingress routing
</a>
</li>
</ul>
<h2 id="ingressorroutespec-for-active-active-databases">
<code>
ingressOrRouteSpec
</code>
for Active-Active databases
</h2>
<p>
Versions 6.4.2 or later of Redis Enterprise for Kubernetes include a feature for ingress configuration. The
<code>
ingressOrRouteSpec
</code>
field is available in the RedisEnterpriseCluster spec to automatically create an Ingress (or route) for the API service and databases (REAADB) on that REC. See
<a href="/docs/latest/operate/kubernetes/networking/ingressorroutespec/">
REC external routing
</a>
for more details.
</p>
<p>
This feature only supports automatic Ingress creation for Active-Active databases created and managed with the RedisEnterpriseActiveActiveDatabase (REAADB) custom resource. Use with the standard Redis Enterprise database (REDB) is not currently supported.
</p>
<h2 id="rec-domain-name">
REC domain name
</h2>
<p>
The RedisEnterpriseCluster does not support custom domain names. Domain names for the REC are in the following format:
<code>
<rec-name>.<namespace>.svc.cluster.local
</code>
.
</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/networking/"/>
<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/spop/.html | <section class="prose w-full py-12">
<h1 class="command-name">
SPOP
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">SPOP key [count]</pre>
<dl class="grid grid-cols-[auto,1fr] gap-2 mb-12">
<dt class="font-semibold text-redis-ink-900 m-0">
Available since:
</dt>
<dd class="m-0">
1.0.0
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
Time complexity:
</dt>
<dd class="m-0">
Without the count argument O(1), otherwise O(N) where N is the value of the passed count.
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
ACL categories:
</dt>
<dd class="m-0">
<code>
@write
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@set
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@fast
</code>
<span class="mr-1 last:hidden">
,
</span>
</dd>
</dl>
<p>
Removes and returns one or more random members from the set value store at
<code>
key
</code>
.
</p>
<p>
This operation is similar to
<a href="/docs/latest/commands/srandmember/">
<code>
SRANDMEMBER
</code>
</a>
, that returns one or more random elements from a set but does not remove it.
</p>
<p>
By default, the command pops a single member from the set. When provided with
the optional
<code>
count
</code>
argument, the reply will consist of up to
<code>
count
</code>
members,
depending on the set's 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 myset "one"
(integer) 1
redis> SADD myset "two"
(integer) 1
redis> SADD myset "three"
(integer) 1
redis> SPOP myset
"three"
redis> SMEMBERS myset
1) "one"
2) "two"
redis> SADD myset "four"
(integer) 1
redis> SADD myset "five"
(integer) 1
redis> SPOP myset 3
1) "one"
2) "two"
3) "five"
redis> SMEMBERS myset
1) "four"
</pre>
<div class="prompt" style="">
<span>
redis>
</span>
<input autocomplete="off" name="prompt" spellcheck="false" type="text"/>
</div>
</form>
<h2 id="distribution-of-returned-elements">
Distribution of returned elements
</h2>
<p>
Note that this command is not suitable when you need a guaranteed uniform distribution of the returned elements. For more information about the algorithms used for
<code>
SPOP
</code>
, look up both the Knuth sampling and Floyd sampling algorithms.
</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>
: if the key does not exist.
</li>
<li>
<a href="../../develop/reference/protocol-spec#bulk-strings">
Bulk string reply
</a>
: when called without the
<em>
count
</em>
argument, the removed member.
</li>
<li>
<a href="../../develop/reference/protocol-spec#arrays">
Array reply
</a>
: when called with the
<em>
count
</em>
argument, a list of the removed members.
</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>
: if the key does not exist.
</li>
<li>
<a href="../../develop/reference/protocol-spec#bulk-strings">
Bulk string reply
</a>
: when called without the
<em>
count
</em>
argument, the removed member.
</li>
<li>
<a href="../../develop/reference/protocol-spec#arrays">
Array reply
</a>
: when called with the
<em>
count
</em>
argument, a list of the removed members.
</li>
</ul>
<br/>
<h2>
History
</h2>
<ul>
<li>
Starting with Redis version 3.2.0: Added the
<code>
count
</code>
argument.
</li>
</ul>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/spop/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/integrate/redis-data-integration/installation.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 RDI
</p>
<p>
The guides in this section explain the options you have for installing RDI.
Before you use RDI, you must also configure your source database to use the CDC connector. See the
<a href="/docs/latest/integrate/redis-data-integration/data-pipelines/prepare-dbs/">
Prepare source databases
</a>
section to learn how to do this.
</p>
<nav>
<a href="/docs/latest/integrate/redis-data-integration/installation/install-vm/">
Install on VMs
</a>
<p>
Learn how to install RDI on one or more VMs
</p>
<a href="/docs/latest/integrate/redis-data-integration/installation/install-k8s/">
Install on Kubernetes
</a>
<p>
Learn how to install RDI on Kubernetes
</p>
</nav>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/integrate/redis-data-integration/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/redisinsight/install/install-on-desktop/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Install on desktop
</h1>
<p class="text-lg -mt-5 mb-10">
How to install Redis Insight on the desktop
</p>
<p>
Install desktop Redis Insight to use it in development.
</p>
<h2 id="supported-operating-systems">
Supported operating systems
</h2>
<p>
Redis Insight is supported on multiple operating systems:
</p>
<ul>
<li>
Windows
</li>
<li>
Linux
</li>
<li>
macOS
</li>
</ul>
<h2 id="install">
Install
</h2>
<p>
Redis Insight is available for download for free from this
<a href="https://redis.io/insight/?utm_source=redisinsight&utm_medium=website&utm_campaign=install_redisinsight#insight-form">
web site
</a>
.
</p>
<p>
It is also available on:
</p>
<ul>
<li>
Microsoft Store
</li>
<li>
Apple Store
</li>
<li>
Snapcraft
</li>
<li>
Flathub
</li>
<li>
<a href="/docs/latest/operate/redisinsight/install/install-on-docker/">
Docker Hub
</a>
.
</li>
</ul>
<p>
After installation, run the Redis Insight application in the same was as you would run other desktop applications.
</p>
<h2 id="build">
Build
</h2>
<p>
Alternatively, you can also build Redis Insight from source. See the
<a href="https://github.com/RedisInsight/RedisInsight#build">
wiki
</a>
for instructions.
</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/redisinsight/install/install-on-desktop/"/>
<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/.html | <section class="prose w-full py-12">
<h1>
redis-di
</h1>
<p class="text-lg -mt-5 mb-10">
A command line tool to manage & configure Redis Data Integration
</p>
<h2 id="usage">
Usage
</h2>
<pre tabindex="0"><code>Usage: redis-di [OPTIONS] COMMAND [ARGS]...
</code></pre>
<h2 id="options">
Options
</h2>
<ul>
<li>
<p>
<code>
version
</code>
:
</p>
<ul>
<li>
Type: BOOL
</li>
<li>
Default:
<code>
false
</code>
</li>
<li>
Usage:
<code>
--version
</code>
</li>
</ul>
<p>
Show the version and exit.
</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 [OPTIONS] COMMAND [ARGS]...
A command line tool to manage & configure Redis Data Integration
Options:
--version Show the version and exit.
--help Show this message and exit.
Commands:
add-context Adds a new context
config-rdi Configures RDI db connection credentials
delete Deletes RDI database permanently
delete-all-contexts Deletes all contexts
delete-context Deletes a context
deploy Deploys the RDI configurations including target
describe-job Describes a transformation engine's job
dump-support-package Dumps RDI support package
get-rejected Returns all the stored rejected entries
install Installs RDI
list-contexts Lists all saved contexts
list-jobs Lists transformation engine's jobs
monitor Monitors RDI by collecting metrics and exporting...
reset Resets the pipeline into initial full sync mode
scaffold Generates configuration files for RDI
set-context Sets a context to be the active one
set-secret Creates a secret of a specified key
start Starts the pipeline
status Displays the status of the pipeline end to end
stop Stops the pipeline
trace Starts a trace session for troubleshooting data...
</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/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/rs/7.4/references/rest-api/requests/bdbs/actions/backup_reset_status/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Backup reset status database action requests
</h1>
<p class="text-lg -mt-5 mb-10">
Reset database backup status requests
</p>
<table>
<thead>
<tr>
<th>
Method
</th>
<th>
Path
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="#put-bdbs-actions-backup-reset-status">
PUT
</a>
</td>
<td>
<code>
/v1/bdbs/{uid}/actions/backup_reset_status
</code>
</td>
<td>
Reset database backup status
</td>
</tr>
</tbody>
</table>
<h2 id="put-bdbs-actions-backup-reset-status">
Reset database backup status
</h2>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">PUT /v1/bdbs/<span class="o">{</span>int: uid<span class="o">}</span>/actions/backup_reset_status
</span></span></code></pre>
</div>
<p>
Resets the database's
<code>
backup_status
</code>
to idle if a backup is not in progress and clears the value of the
<code>
backup_failure_reason
</code>
field.
</p>
<h3 id="permissions">
Permissions
</h3>
<table>
<thead>
<tr>
<th>
Permission name
</th>
<th>
Roles
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="/docs/latest/operate/rs/7.4/references/rest-api/permissions/#reset_bdb_current_backup_status">
reset_bdb_current_backup_status
</a>
</td>
<td>
admin
<br/>
cluster_member
<br/>
db_member
</td>
</tr>
</tbody>
</table>
<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 /bdbs/1/actions/backup_reset_status
</span></span></code></pre>
</div>
<h4 id="headers">
Headers
</h4>
<table>
<thead>
<tr>
<th>
Key
</th>
<th>
Value
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
Host
</td>
<td>
cnm.cluster.fqdn
</td>
<td>
Domain name
</td>
</tr>
<tr>
<td>
Accept
</td>
<td>
application/json
</td>
<td>
Accepted media type
</td>
</tr>
</tbody>
</table>
<h4 id="url-parameters">
URL parameters
</h4>
<table>
<thead>
<tr>
<th>
Field
</th>
<th>
Type
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
uid
</td>
<td>
integer
</td>
<td>
The unique ID of the database
</td>
</tr>
</tbody>
</table>
<h3 id="put-response">
Response
</h3>
<p>
Returns a status code.
</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>
The request is accepted and is being processed.
</td>
</tr>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5">
404 Not Found
</a>
</td>
<td>
Attempting to perform an action on a nonexistent database.
</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 all the modules loaded to the database support 'backup_restore' capability
</td>
</tr>
<tr>
<td>
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.10">
409 Conflict
</a>
</td>
<td>
Database is currently busy with another action. In this context, this is a temporary condition and the request should be reattempted later.
</td>
</tr>
</tbody>
</table>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/7.4/references/rest-api/requests/bdbs/actions/backup_reset_status/"/>
<div class="flex flex-row justify-between">
<div class="grid justify-center">
<span class="font-mono">
RATE THIS PAGE
</span>
<div class="star-rating">
<input id="5-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="5"/>
<label class="star" for="5-stars">
β
</label>
<input id="4-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="4"/>
<label class="star" for="4-stars">
β
</label>
<input id="3-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="3"/>
<label class="star" for="3-stars">
β
</label>
<input id="2-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="2"/>
<label class="star" for="2-stars">
β
</label>
<input id="1-stars" name="rating" onchange="document.querySelector('#feedback-form').classList.remove('hidden')" type="radio" value="1"/>
<label class="star" for="1-stars">
β
</label>
</div>
</div>
<a class="font-mono no-underline" href="#">
Back to top β
</a>
</div>
<div class="hidden" id="feedback-form">
<div class="grid gap-2">
<textarea class="p-2 mt-1 block w-full h-24 border border-opacity-50 border-redis-ink-900 rounded-md" name="comment" placeholder="Why did you choose this rating?" rows="3"></textarea>
<button class="font-mono button text-redis-ink-900 border border-solid border-transparent bg-redis-red-500 hover:bg-redis-red-600 focus:bg-red-600 focus:ring-red-600; w-min justify-self-end" type="submit">
Submit
</button>
</div>
</div>
</form>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("#page-feedback");
form.addEventListener("submit", function(event) {
event.preventDefault();
var xhr = new XMLHttpRequest();
var url = "\/docusight\/api\/rate";
var params = new URLSearchParams(new FormData(form));
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
const responseData = JSON.parse(xhr.responseText);
const responseMessage = responseData.response;
const newText = document.createTextNode(responseMessage);
form.parentNode.replaceChild(newText, form);
}
};
xhr.send(params);
});
});
</script>
</section>
|
https://redis.io/docs/latest/operate/redisinsight/configuration/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Redis Insight configuration settings
</h1>
<h2 id="environment-variables">
Environment variables
</h2>
<table>
<thead>
<tr>
<th>
Variable
</th>
<th>
Purpose
</th>
<th>
Default
</th>
<th>
Additional info
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
RI_APP_PORT
</td>
<td>
The port that Redis Insight listens on
</td>
<td>
<ul>
<li>
Docker: 5540
</li>
<li>
desktop: 5530
</li>
</ul>
</td>
<td>
See
<a href="https://expressjs.com/en/api.html#app.listen">
Express Documentation
</a>
</td>
</tr>
<tr>
<td>
RI_APP_HOST
</td>
<td>
The host that Redis Insight connects to
</td>
<td>
<ul>
<li>
Docker: 0.0.0.0
</li>
<li>
desktop: 127.0.0.1
</li>
</ul>
</td>
<td>
See
<a href="https://expressjs.com/en/api.html#app.listen">
Express Documentation
</a>
</td>
</tr>
<tr>
<td>
RI_SERVER_TLS_KEY
</td>
<td>
Private key for HTTPS
</td>
<td>
n/a
</td>
<td>
Private key in
<a href="https://www.ssl.com/guide/pem-der-crt-and-cer-x-509-encodings-and-conversions/#ftoc-heading-3">
PEM format
</a>
. Can be a path to a file or a string in PEM format.
</td>
</tr>
<tr>
<td>
RI_SERVER_TLS_CERT
</td>
<td>
Certificate for supplied private key
</td>
<td>
n/a
</td>
<td>
Public certificate in
<a href="https://www.ssl.com/guide/pem-der-crt-and-cer-x-509-encodings-and-conversions/#ftoc-heading-3">
PEM format
</a>
. Can be a path to a file or a string in PEM format.
</td>
</tr>
<tr>
<td>
RI_ENCRYPTION_KEY
</td>
<td>
Key to encrypt data with
</td>
<td>
n/a
</td>
<td>
Available only for Docker.
<br/>
Redis insight stores sensitive information (database passwords, Workbench history, etc.) locally (using
<a href="https://github.com/TryGhost/node-sqlite3">
sqlite3
</a>
). This variable allows you to store sensitive information encrypted using the specified encryption key.
<br/>
Note: The same encryption key should be provided for subsequent
<code>
docker run
</code>
commands with the same volume attached to decrypt the information.
</td>
</tr>
<tr>
<td>
RI_LOG_LEVEL
</td>
<td>
Configures the log level of the application.
</td>
<td>
<code>
info
</code>
</td>
<td>
Supported logging levels are prioritized from highest to lowest:
<ul>
<li>
error
</li>
<li>
warn
</li>
<li>
info
</li>
<li>
http
</li>
<li>
verbose
</li>
<li>
debug
</li>
<li>
silly
</li>
</ul>
</td>
</tr>
<tr>
<td>
RI_FILES_LOGGER
</td>
<td>
Logs to file
</td>
<td>
<code>
true
</code>
</td>
<td>
By default, you can find log files in the following folders:
<ul>
<li>
Docker:
<code>
/data/logs
</code>
</li>
<li>
desktop:
<code>
<user-home-dir>/.redisinsight-app/logs
</code>
</li>
</ul>
</td>
</tr>
<tr>
<td>
RI_STDOUT_LOGGER
</td>
<td>
Logs to STDOUT
</td>
<td>
<code>
true
</code>
</td>
<td>
</td>
</tr>
<tr>
<td>
RI_PROXY_PATH
</td>
<td>
Configures a subpath for a proxy
</td>
<td>
n/a
</td>
<td>
Available only for Docker.
</td>
</tr>
</tbody>
</table>
<h2 id="use-redis-insight-behind-a-reverse-proxy">
Use Redis Insight behind a reverse proxy
</h2>
<p>
When you configure Redis Insight to run behind a reverse proxy like
<a href="https://www.nginx.com/">
NGINX
</a>
, set the request timeout to over 30 seconds on the reverse proxy because some requests can be long-running.
</p>
<p>
Redis Insight also allows you to manage its connection timeout on the form to configure the connection details. The default timeout is 30 seconds.
</p>
<p>
Hosting Redis Insight behind a prefix path (path-rewriting) is not supported.
</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/redisinsight/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/develop/interact/search-and-query/basic-constructs/schema-definition/.html | <section class="prose w-full py-12">
<h1>
Schema definition
</h1>
<p class="text-lg -mt-5 mb-10">
How to define the schema of an index.
</p>
<p>
An index structure is defined by a schema. The schema specifies the fields, their types, whether they should be indexed or stored, and other additional configuration options. By properly configuring the schema, you can optimize search performance and control the storage requirements of your index.
</p>
<pre tabindex="0"><code>FT.CREATE idx
ON HASH
PREFIX 1 blog:post:
SCHEMA
title TEXT WEIGHT 5.0
content TEXT
author TAG
created_date NUMERIC SORTABLE
views NUMERIC
</code></pre>
<p>
In this example, a schema is defined for an index named
<code>
idx
</code>
that will index all hash documents whose keyname starts with
<code>
blog:post:
</code>
.
The schema includes the fields
<code>
title
</code>
,
<code>
content
</code>
,
<code>
author
</code>
,
<code>
created_date
</code>
, and
<code>
views
</code>
. The
<code>
TEXT
</code>
type indicates that the
<code>
title
</code>
and
<code>
content
</code>
fields are text-based, the
<code>
TAG
</code>
type is used for the
<code>
author
</code>
field, and the
<code>
NUMERIC
</code>
type is used for the
<code>
created_date
</code>
and
<code>
views
</code>
fields. Additionally, a weight of 5.0 is assigned to the
<code>
title
</code>
field to give it more relevance in search results, and
<code>
created_date
</code>
is marked as
<code>
SORTABLE
</code>
to enable sorting based on this field.
</p>
<p>
You can learn more about the available field types and options on the
<a href="/docs/latest/commands/ft.create/">
<code>
FT.CREATE
</code>
</a>
page.
</p>
<h2 id="more-schema-definition-examples">
More schema definition examples
</h2>
<h5 id="index-tags-with-a-separator">
Index tags with a separator
</h5>
<p>
Index books that have a
<code>
categories
</code>
attribute, where each category is separated by a
<code>
;
</code>
character.
</p>
<pre tabindex="0"><code>FT.CREATE books-idx
ON HASH
PREFIX 1 book:details
SCHEMA
title TEXT
categories TAG SEPARATOR ";"
</code></pre>
<h5 id="index-a-single-field-in-multiple-ways">
Index a single field in multiple ways
</h5>
<p>
Index the
<code>
sku
</code>
attribute from a hash as both a
<code>
TAG
</code>
and as
<code>
TEXT
</code>
:
</p>
<pre tabindex="0"><code>FT.CREATE idx
ON HASH
PREFIX 1 blog:post:
SCHEMA
sku AS sku_text TEXT
sku AS sku_tag TAG SORTABLE
</code></pre>
<h5 id="index-documents-with-multiple-prefixes">
Index documents with multiple prefixes
</h5>
<p>
Index two different hashes, one containing author data and one containing book data:
</p>
<pre tabindex="0"><code>FT.CREATE author-books-idx
ON HASH
PREFIX 2 author:details: book:details:
SCHEMA
author_id TAG SORTABLE
author_ids TAG
title TEXT name TEXT
</code></pre>
<p>
In this example, keys for author data use the key pattern
<code>
author:details:<id>
</code>
, while keys for book data use the pattern
<code>
book:details:<id>
</code>
.
</p>
<h5 id="only-index-documents-if-a-field-specifies-a-certain-value-using-filter">
Only index documents if a field specifies a certain value using
<code>
FILTER
</code>
</h5>
<p>
Index authors whose names start with G:
</p>
<pre tabindex="0"><code>FT.CREATE g-authors-idx
ON HASH
PREFIX 1 author:details
FILTER 'startswith(@name, "G")'
SCHEMA
name TEXT
</code></pre>
<p>
Index only books that have a subtitle:
</p>
<pre tabindex="0"><code>FT.CREATE subtitled-books-idx
ON HASH
PREFIX 1 book:details
FILTER '@subtitle != ""'
SCHEMA
title TEXT
</code></pre>
<h5 id="index-a-json-document-using-a-jsonpath-expression">
Index a JSON document using a JSONPath expression
</h5>
<p>
Index a JSON document that has
<code>
title
</code>
and
<code>
categories
</code>
fields. The
<code>
title
</code>
field is indexed as
<code>
TEXT
</code>
and the
<code>
categories
</code>
field is indexed as
<code>
TAG
</code>
.
</p>
<pre tabindex="0"><code>FT.CREATE idx
ON JSON
SCHEMA
$.title AS title TEXT
$.categories AS categories TAG
</code></pre>
<p>
You can learn more about the available field types and options on the
<a href="/docs/latest/commands/ft.create/">
<code>
FT.CREATE
</code>
</a>
page.
</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/basic-constructs/schema-definition/"/>
<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/redisvl/overview/.html | <section class="prose w-full py-12 max-w-none">
<h1>
RedisVL Overview
</h1>
<p class="text-lg -mt-5 mb-10">
An overview of RedisVL
</p>
<p>
RedisVL provides the following features:
</p>
<ul>
<li>
<p>
<strong>
Index management
</strong>
- Design search schema and indexes with ease from YAML, with Python, or from the CLI.
</p>
</li>
<li>
<p>
<strong>
Advanced vector search
</strong>
- Perform powerful vector searches with complex filtering support.
</p>
</li>
<li>
<p>
<strong>
Embedding creation
</strong>
- Use OpenAI or any of the other supported vectorizers to create embeddings.
</p>
</li>
<li>
<p>
<strong>
CLI
</strong>
- Interact with RedisVL using a command line interface (CLI) for ease of use.
</p>
</li>
<li>
<p>
<strong>
Semantic caching
</strong>
- Use RedisVL to cache large language model (LLM) results, increasing queries per second (QPS) and decreasing cost.
</p>
</li>
</ul>
<nav>
<a href="/docs/latest/integrate/redisvl/overview/install/">
Install RedisVL
</a>
<p>
How to install RedisVL
</p>
<a href="/docs/latest/integrate/redisvl/overview/cli/">
RedisVL CLI
</a>
<p>
How to use RedisVL's CLI
</p>
</nav>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/integrate/redisvl/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/integrate/write-behind/data-transformation/transformation-examples/foreach-example/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Write-behind foreach example
</h1>
<p>
The
<code>
foreach
</code>
section is used to explode a list of objects or arrays to rows in a selected target.
The
<code>
foreach
</code>
expression is structured as
<code>
<field_name>:<JMESPath expression>
</code>
.
The following example uses the
<code>
add_field
</code>
transformation to prepare the input JSON to the desired structure. Then, it applies
<code>
foreach
</code>
to write each
<code>
order
</code>
object as a relational database record using
<code>
keys
</code>
and
<code>
mapping
</code>
.
In this example, the
<code>
JMESPath
</code>
function
<code>
to_string
</code>
is used to flatten an array of objects,
<code>
specs
</code>
, to a string.
</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">redis</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">key_pattern</span><span class="p">:</span><span class="w"> </span><span class="l">orderdetail:*</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">trigger</span><span class="p">:</span><span class="w"> </span><span class="l">write-behind</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">exclude_commands</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="s2">"json.del"</span><span class="p">]</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">my_orders</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="p">|</span><span class="sd">
</span></span></span><span class="line"><span class="cl"><span class="sd"> orders[*].{
</span></span></span><span class="line"><span class="cl"><span class="sd"> code: code
</span></span></span><span class="line"><span class="cl"><span class="sd"> periodStartTime: periodStartTime
</span></span></span><span class="line"><span class="cl"><span class="sd"> periodEndTime: periodEndTime
</span></span></span><span class="line"><span class="cl"><span class="sd"> specs: to_string(specs)
</span></span></span><span class="line"><span class="cl"><span class="sd"> }</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">relational.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">mssql</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">OrderMaster</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">keys</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span>- <span class="nt">Code</span><span class="p">:</span><span class="w"> </span><span class="l">orderDetail.code</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">mapping</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span>- <span class="nt">DeliveryDate</span><span class="p">:</span><span class="w"> </span><span class="l">orderDetail.deliveryDate</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span>- <span class="nt">ProductCode</span><span class="p">:</span><span class="w"> </span><span class="l">orderDetail.productCode</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span>- <span class="nt">CountryCode</span><span class="p">:</span><span class="w"> </span><span class="l">orderDetail.countryCode</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">relational.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">mssql</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">Order</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">foreach</span><span class="p">:</span><span class="w"> </span><span class="s2">"order: my_orders[]"</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">keys</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span>- <span class="nt">Code</span><span class="p">:</span><span class="w"> </span><span class="l">order.code</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span><span class="nt">mapping</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span>- <span class="nt">OrderDetailCode</span><span class="p">:</span><span class="w"> </span><span class="l">orderDetail.code</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span>- <span class="nt">PeriodStartTime</span><span class="p">:</span><span class="w"> </span><span class="l">order.periodStartTime</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span>- <span class="nt">PeriodEndTime</span><span class="p">:</span><span class="w"> </span><span class="l">order.periodEndTime</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w"> </span>- <span class="nt">Specs</span><span class="p">:</span><span class="w"> </span><span class="l">order.specs</span><span class="w">
</span></span></span></code></pre>
</div>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/integrate/write-behind/data-transformation/transformation-examples/foreach-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/oss_and_stack/stack-with-enterprise/release-notes/redistimeseries/redistimeseries-1.6-release-notes.html | <section class="prose w-full py-12 max-w-none">
<h1>
RedisTimeSeries 1.6 release notes
</h1>
<p class="text-lg -mt-5 mb-10">
Added support for aggregating across multiple time series (multi-key). Can compute queries such as βthe maximum observed value of a set of time seriesβ server-side instead of client-side.
</p>
<h2 id="requirements">
Requirements
</h2>
<p>
RedisTimeSeries v1.6.19 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="v1619-february-2023">
v1.6.19 (February 2023)
</h2>
<p>
This is a maintenance release for RedisTimeSeries 1.6.
</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/RedisTimeSeries/RedisTimeSeries/issues/1397">
#1397
</a>
Memory leak when trying to create an already existing key (MOD-4724, RED-93418)
</li>
</ul>
</li>
</ul>
<h2 id="v1617-july-2022">
v1.6.17 (July 2022)
</h2>
<p>
This is a maintenance release for RedisTimeSeries 1.6.
</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/RedisTimeSeries/RedisTimeSeries/pull/1240">
#1240
</a>
Compaction rules are not saved to
<a href="https://docs.redis.com/latest/rs/databases/redis-on-flash">
RoF
</a>
(Redis Enterprise)
</li>
</ul>
</li>
</ul>
<h2 id="v1616-june-2022">
v1.6.16 (June 2022)
</h2>
<p>
This is a maintenance release for RedisTimeSeries 1.6.
</p>
<p>
Update urgency:
<code>
HIGH
</code>
: There is a critical bug that may affect a subset of users. Upgrade!
</p>
<p>
Details:
</p>
<ul>
<li>
<p>
Features:
</p>
<ul>
<li>
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/1193">
#1193
</a>
Commands that donβt execute on the main thread now appear in
<a href="/docs/latest/commands/slowlog/">
SLOWLOG
</a>
</li>
</ul>
</li>
<li>
<p>
Bug fixes:
</p>
<ul>
<li>
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/1203">
#1203
</a>
Compaction rules are not replicated (Replica Of) on Redis Enterprise
</li>
<li>
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/issues/1204">
#1204
</a>
When the last sample is deleted with
<a href="/docs/latest/commands/ts.del">
<code>
TS.DEL
</code>
</a>
, it may still be accessible with
<a href="/docs/latest/commands/ts.get">
<code>
TS.GET
</code>
</a>
</li>
<li>
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/1226">
#1226
</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>
: on a multi-shard environment, some chunks may be skipped
</li>
</ul>
</li>
</ul>
<div class="alert p-3 relative flex flex-row items-center text-base bg-redis-pencil-200 rounded-md">
<div class="p-2 pr-5">
<svg fill="none" height="21" viewbox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg">
<circle cx="10.5" cy="10.5" r="9.75" stroke="currentColor" stroke-width="1.5">
</circle>
<path d="M10.5 14V16" stroke="currentColor" stroke-width="2">
</path>
<path d="M10.5 5V12" stroke="currentColor" stroke-width="2">
</path>
</svg>
</div>
<div class="p-1 pl-6 border-l border-l-redis-ink-900 border-opacity-50">
<div class="font-medium">
Note:
</div>
New RDB version (v5). RDB files created with 1.6.16 are not backward compatible.
</div>
</div>
<h2 id="v1613-june-2022">
v1.6.13 (June 2022)
</h2>
<p>
This is a maintenance release for RedisTimeSeries 1.6.
</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/RedisTimeSeries/RedisTimeSeries/issues/1176">
#1176
</a>
,
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/1187">
#1187
</a>
When executing
<a href="/docs/latest/commands/ts.del">
<code>
DEL
</code>
</a>
, chunk index could be set to a wrong value and cause some data to be inaccessible
</li>
<li>
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/1180">
#1180
</a>
When executing
<a href="/docs/latest/commands/ts.madd">
<code>
MADD
</code>
</a>
, make sure that only successful insertions are replicated
</li>
</ul>
</li>
</ul>
<h2 id="v1611-may-2022">
v1.6.11 (May 2022)
</h2>
<p>
This is a maintenance release for RedisTimeSeries 1.6.
</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/RedisTimeSeries/RedisTimeSeries/pull/1166">
#1166
</a>
Stop forwarding multi-shard commands during cluster resharding and upgrade (MOD-3154)
</li>
<li>
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/1165">
#1165
</a>
Stop forwarding multi-shard commands during transactions (
<code>
MULTI EXEC
</code>
) (MOD-3182)
</li>
<li>
<a href="https://github.com/RedisGears/LibMR">
LibMR
</a>
: Fixed crash on multi-shard commands in some rare scenarios (MOD-3182)
</li>
</ul>
</li>
</ul>
<h2 id="v1610-may-2022">
v1.6.10 (May 2022)
</h2>
<p>
This is a maintenance release for RedisTimeSeries 1.6.
</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/RedisTimeSeries/RedisTimeSeries/pull/1074">
#1074
</a>
<a href="/docs/latest/commands/ts.range">
<code>
RANGE
</code>
</a>
,
<a href="/docs/latest/commands/ts.revrange">
<code>
REVRANGE
</code>
</a>
,
<a href="/docs/latest/commands/ts.mrange">
<code>
MRANGE
</code>
</a>
, and
<a href="/docs/latest/commands/ts.mrevrange">
<code>
MREVRANGE
</code>
</a>
: Possibly incorrect result when using
<code>
ALIGN
</code>
and aggregating a bucket with a timestamp close to 0
</li>
<li>
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/1094">
#1094
</a>
<a href="https://github.com/RedisGears/LibMR">
LibMR
</a>
: Potential memory leak; memory release delay
</li>
<li>
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/1127">
#1127
</a>
Memory leak on
<a href="/docs/latest/commands/ts.range">
<code>
RANGE
</code>
</a>
and
<a href="/docs/latest/commands/ts.revrange">
<code>
REVRANGE
</code>
</a>
when argument parsing fails
</li>
<li>
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/1096">
#1096
</a>
<a href="/docs/latest/commands/ts.range">
<code>
RANGE
</code>
</a>
,
<a href="/docs/latest/commands/ts.revrange">
<code>
REVRANGE
</code>
</a>
,
<a href="/docs/latest/commands/ts.mrange">
<code>
MRANGE
</code>
</a>
, and
<a href="/docs/latest/commands/ts.mrevrange">
<code>
MREVRANGE
</code>
</a>
: Using
<code>
FILTER_BY_TS
</code>
without specifying timestamps now returns an error as expected
</li>
</ul>
</li>
</ul>
<h2 id="v169-february-2022">
v1.6.9 (February 2022)
</h2>
<p>
This is a maintenance release for RedisTimeSeries 1.6.
</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>
Security and privacy:
</p>
<ul>
<li>
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/1061">
#1061
</a>
Internode communications encryption: support passphrases for PEM files
</li>
</ul>
</li>
<li>
<p>
Bug fixes:
</p>
<ul>
<li>
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/1056">
#1056
</a>
Return an error when a shard is down (in v1.6.8, returned an empty result)
</li>
</ul>
</li>
</ul>
<h2 id="v16-ga-v168-january-2022">
v1.6 GA (v1.6.8) (January 2022)
</h2>
<p>
This is the General Availability release of RedisTimeSeries 1.6.
</p>
<h3 id="highlights">
Highlights
</h3>
<p>
RedisTimeSeries 1.6 adds support for aggregating across multiple time series (multi-key). Before this version, queries such as βthe maximum observed value of a set of time seriesβ needed to be calculated client-side. Such queries can now be computed server-side, leveraging the heart of RedisGears (
<a href="https://github.com/RedisGears/LibMR">
LibMR
</a>
) for clustered databases.
</p>
<h3 id="whats-new-in-16">
What's new in 1.6
</h3>
<ul>
<li>
<p>
Introduction of
<code>
GROUPBY
</code>
and
<code>
REDUCE
</code>
in
<code>
TS.MRANGE
</code>
and
<code>
TS.MREVRANGE
</code>
to add support for "multi-key aggregation" and support for such aggregations spanning multiple shards, leveraging
<a href="https://github.com/RedisGears/LibMR">
LibMR
</a>
. Currently, we support
<code>
min
</code>
,
<code>
max
</code>
, and
<code>
sum
</code>
as reducers and grouping by a label.
</p>
</li>
<li>
<p>
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/722">
#722
</a>
,
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/275">
#275
</a>
Filter results using
<code>
FILTER_BY_TS
</code>
by providing a list of timestamps and
<code>
FILTER_BY_VALUE
</code>
by providing a
<code>
min
</code>
and a
<code>
max
</code>
value (
<code>
TS.RANGE
</code>
,
<code>
TS.REVRANGE
</code>
,
<code>
TS.MRANGE
</code>
, and
<code>
TS.MREVRANGE
</code>
).
</p>
</li>
<li>
<p>
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/603">
#603
</a>
,
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/611">
#611
</a>
,
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/841">
#841
</a>
Introduction ofΒ TS.DELΒ which allows deleting samples in a time series within two timestamps (inclusive).
</p>
</li>
<li>
<p>
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/762">
#762
</a>
Limit the number of returned labels in the response of read commands (
<code>
TS.MRANGE
</code>
,
<code>
TS.MREVRANGE
</code>
, and
<code>
TS.MGET
</code>
) using
<code>
SELECTED_LABELS
</code>
. This can be a significant performance improvement when returning a large number of series.
</p>
</li>
<li>
<p>
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/655">
#655
</a>
,
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/801">
#801
</a>
Ability toΒ align the aggregation bucketsΒ with the requested start, end, or specific timestamp onΒ aggregation queries using
<code>
ALIGN
</code>
(
<code>
TS.RANGE
</code>
,
<code>
TS.REVRANGE
</code>
,
<code>
TS.MRANGE
</code>
, and
<code>
TS.MREVRANGE
</code>
).
</p>
</li>
<li>
<p>
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/675">
#675
</a>
Add keyspace notifications for all CRUD commands. Check out
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/blob/master/tests/flow/test_ts_keyspace.py">
this test
</a>
for the details.
</p>
</li>
<li>
<p>
<a href="https://github.com/RedisTimeSeries/RedisTimeSeries/pull/882">
#882
</a>
<a href="https://docs.redis.com/latest/rs/databases/redis-on-flash//#:~:text=Redis%20on%20Flash%20%20offers,dedicated%20flash%20memory%20(SSD).">
Auto Tiering
</a>
support.
</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/redistimeseries/redistimeseries-1.6-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/security/certificates/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Certificates
</h1>
<p class="text-lg -mt-5 mb-10">
An overview of certificates in Redis Enterprise Software.
</p>
<p>
Redis Enterprise Software uses self-signed certificates by default to ensure that the product is secure. If using a self-signed certificate is not the right solution for you, you can import a certificate signed by a certificate authority of your choice.
</p>
<p>
Here's the list of self-signed certificates that create secure, encrypted connections to your Redis Enterprise cluster:
</p>
<table>
<thead>
<tr>
<th>
Certificate name
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>
api
</code>
</td>
<td>
Encrypts
<a href="/docs/latest/operate/rs/references/rest-api/">
REST API
</a>
requests and responses.
</td>
</tr>
<tr>
<td>
<code>
cm
</code>
</td>
<td>
Secures connections to the Redis Enterprise Cluster Manager UI.
</td>
</tr>
<tr>
<td>
<code>
ldap_client
</code>
</td>
<td>
Secures connections between LDAP clients and LDAP servers.
</td>
</tr>
<tr>
<td>
<code>
metrics_exporter
</code>
</td>
<td>
Sends Redis Enterprise metrics to external
<a href="/docs/latest/operate/rs/clusters/monitoring/">
monitoring tools
</a>
over a secure connection.
</td>
</tr>
<tr>
<td>
<code>
proxy
</code>
</td>
<td>
Creates secure, encrypted connections between clients and databases.
</td>
</tr>
<tr>
<td>
<code>
syncer
</code>
</td>
<td>
For
<a href="/docs/latest/operate/rs/databases/active-active/">
Active-Active
</a>
or
<a href="/docs/latest/operate/rs/databases/import-export/replica-of/">
Replica Of
</a>
databases, encrypts data during the synchronization of participating clusters.
</td>
</tr>
</tbody>
</table>
<p>
These self-signed certificates are generated on the first node of each Redis Enterprise Software installation and are copied to all other nodes added to the cluster.
</p>
<p>
When you use the default self-signed certificates and you connect to the Cluster Manager UI over a web browser, you'll see an untrusted connection notification.
</p>
<p>
Depending on your browser, you can allow the connection for each session or add an exception to trust the certificate for all future sessions.
</p>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/operate/rs/security/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/oss_and_stack/install/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Install Redis or Redis Stack
</h1>
<p class="text-lg -mt-5 mb-10">
How to install your preferred Redis flavor on your target platform
</p>
<p>
You can install
<a href="/docs/latest/operate/oss_and_stack/">
Redis
</a>
or
<a href="/docs/latest/operate/oss_and_stack/">
Redis Stack
</a>
locally on your machine. Redis and Redis Stack are available on Linux, macOS, and Windows.
</p>
<p>
Here are the installation instructions:
</p>
<ul>
<li>
<a href="/docs/latest/operate/oss_and_stack/install/install-redis/">
Install Redis
</a>
</li>
<li>
<a href="/docs/latest/operate/oss_and_stack/install/install-stack/">
Install Redis Stack
</a>
</li>
</ul>
<p>
While you can install Redis or Redis Stack locally, you might also consider using Redis Cloud by creating a
<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">
free account
</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/oss_and_stack/install/"/>
<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-3-aug-2016/.html | <section class="prose w-full py-12 max-w-none">
<h1>
RLEC 4.3.0-230 Release Notes (August 2, 2016)
</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>
You can upgrade to this version from any 4.2 version. If you have a
version older than 4.2 you should first upgrade to 4.2 and only then
upgrade to this version.
</p>
<h3 id="new-features">
New features
</h3>
<ul>
<li>
Various improvements to internal performance and stability were
implemented.
</li>
<li>
RLEC Flash functionality added. For additional details, refer to
<a href="/docs/latest/operate/rs/databases/auto-tiering/">
Auto Tiering
</a>
and contact
<a href="mailto:[email protected]">
[email protected]
</a>
if you are interested in this
functionality.
</li>
<li>
Support for Redis version 3.0 added. When you install or upgrade the
cluster the new default version for Redis databases will be 3.0 and
when you upgrade the databases they will be updated to this version.
If you would like to change the default version to Redis 2.8 refer
to the instruction in the
<a href="/docs/latest/operate/rs/installing-upgrading/upgrading/">
Upgrading
databases
</a>
section. If you would like to upgrade existing databases to the
latest 2.8 minor version, refer to the Known Issues section below.
</li>
<li>
Complete cluster failure recovery instructions added. For additional
details, refer to
<a href="/docs/latest/operate/rs/clusters/cluster-recovery/">
Cluster
Recovery
</a>
.
</li>
<li>
Major improvements made to database replication performance process
by using diskless replication between master and replica shards. The
data between the master and replica shards is streamed directly,
instead of using the default file-on-disk mechanism. This behavior
can be changed for the entire cluster or per database through
rladmin.
</li>
<li>
Major enhancements made to rladmin command line interface to add new
administration functionalities.
</li>
<li>
rlcheck installation verification utility added to facilitate
checking node health. For additional details, refer to
<a href="/docs/latest/operate/rs/references/cli-utilities/rlcheck/">
rlcheck
installation verification
utility
</a>
.
</li>
<li>
Added the ability to allow the user to configure how machine IP
addresses are used in Node Configuration setup in the management UI.
For additional details, refer to
<a href="/docs/latest/operate/rs/clusters/new-cluster-setup/">
Initial setup - creating a new
cluster.
</a>
</li>
<li>
Connection to database endpoint can now be encrypted with SSL. For
additional details, refer to
<a href="/docs/latest/operate/rs/security/encryption/tls/">
Securing client connection with
SSL
</a>
.
</li>
<li>
Added support for running the cluster on the following operating
systems and versions: RHEL/CentOS 6.6, 7.1, 7.2, RHEL 6.7, Oracle
Linux 6.5.
</li>
</ul>
<h3 id="changes">
Changes
</h3>
<ul>
<li>
Environment configuration profile with name "default" has been
changed to "cloud" and the default value has been changed to
"local-network". For additional details, refer to
<a href="/docs/latest/operate/rs/clusters/optimize/optimization/">
Performance
optimization
</a>
section.
</li>
<li>
In the REST API, when creating a database and not setting the
database replication parameter to "true", the default value assigned
by the cluster has changed from "true" to "false".
</li>
<li>
rladmin syntax updates can affect commands written for prior
versions of RLEC. In this version commands that are run directly
from the operating system CLI prompt (not through the rladmin
prompt) no longer require quotation marks for text with special
characters.
</li>
<li>
Option added to the
<em>
Replica-of
</em>
process that allows gradual
"shard-by- shard" replication of a sharded database, reducing the
load on internal buffers. This optimization setting can be
configured on the target database using the gradual_sync_mode
parameter in rladmin.
</li>
<li>
The functionality for taking a node offline was removed from the UI.
</li>
</ul>
<h3 id="fixed-issues">
Fixed issues
</h3>
<ul>
<li>
RLEC-7110 - node does not recover properly after restart in case
ephemeral storage is not available yet
</li>
<li>
RLEC-7502 - log rotate job not working properly on RHEL operating
system
</li>
<li>
RLEC-7599 - issues running on a server with no IPv6 kernel support
</li>
<li>
RLEC-7561, RLEC-7597 - issues connecting to database endpoint as
result of cluster name containing capital letters
</li>
<li>
RLEC-7245 - on machines with multiple IPs sometimes the wrong IP
address is chosen for internal traffic
</li>
<li>
RLEC-6815 - wrong log entry is added when enabling cluster alert
regarding database version compatibility
</li>
<li>
RLEC-7652 - database is down in certain failover scenarios only
when the database is completely empty
</li>
<li>
RLEC-7737 - issue where in a specific scenario after node restarts,
a database with replication both master and replica shards are
reported as down
</li>
<li>
RLEC-7712 - in some cases, the Replica Of process may fail when
Redis password is set
</li>
<li>
RLEC-7726 - node object "avg_latency" statistic is not returned in
the REST API
</li>
<li>
RLEC-7358 - install script issue when running on LVM disks
</li>
<li>
RLEC-8086 - port 9443 missing from redislabs-clients.xml
</li>
<li>
RLEC-7281 - rotation of internal log files not working properly
</li>
<li>
RLEC-8279 - updates to a user definition might cause password reset
to be required
</li>
<li>
RLEC-8512 - when upgrading an existing cluster that has uppercase
letters in the cluster name (FQDN) the cluster might not function
properly after the upgrade and attempts to connect to a database
might fail
</li>
<li>
RLEC-8371 - email alerts do not work when using Amazon SES service
</li>
<li>
In certain scenarios the node upgrade process may fail if the node
is in the offline state
</li>
</ul>
<h3 id="known-issues">
Known issues
</h3>
<ul>
<li>
<p>
<strong>
Issue
</strong>
: When upgrading to this version from a previous RLEC
version, rladmin status output will show the database status as
having an old version. When you upgrade the Redis database (using
rladmin upgrade db command) the Redis version will be updated to 3.0
even if you updated the cluster's Redis default version to
2.8.
</p>
<p>
<strong>
Workaround
</strong>
: If you would like to cancel the old version
indication in rladmin status without upgrading the Redis version to
3.0 you should first change the cluster default version to 2.8
(using rladmin tune cluster command), and then trigger the Redis
process to be restarted by migrating the database shards (using
rladmin migrate db command).
</p>
</li>
<li>
<p>
<strong>
Issue
</strong>
: RLEC-8486 - On Ubuntu, when uninstalling RLEC using the
apt-get purge command, some of the Redis processes on the machine
might continue running.
</p>
<p>
<strong>
Workaround
</strong>
: If you encounter this issue
you must manually kill the Redis processes.
</p>
</li>
<li>
<p>
<strong>
Issue
</strong>
: RLEC-8283 - The cluster recovery process does not work
properly when the cluster that needs to be recovered does not have a
node with ID 1.
</p>
<p>
<strong>
Workaround
</strong>
: If you encounter this issue please
<a href="https://redislabs.com/company/support/">
contact Redis support
</a>
</p>
</li>
<li>
<p>
<strong>
Issue
</strong>
: In the Replica Of process, if the target database does
not have replication enabled and it is restarted or fails for any
reason, the data on the target database might not be in sync with
the source database, although the status of the Replica Of process
indicates that it is.
</p>
<p>
<strong>
Workaround
</strong>
: You must manually stop and
restart the synchronization process in order to ensure the databases
are in sync.
</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 must manually
stop and restart the synchronization process after the resharding of
the source database is done.
</p>
</li>
<li>
<p>
<strong>
Issue
</strong>
: In the Replica Of process, high database traffic might restart the Replica Of process due to the "replica buffer" being exceeded. In this case
you will often see the status of the Replica Of process display as
"Syncing".
</p>
<p>
<strong>
Workaround
</strong>
: You must manually increase the "replica
buffer" size through rladmin. In order to find the appropriate
buffer size please
<a href="https://redislabs.com/company/support/">
contact Redis support
</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 must use rladmin to manually migrate the shard, to a node
on a valid rack-zone in order to ensure rack-zone awareness
compliance.
</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-3-aug-2016/"/>
<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/xtrim/.html | <section class="prose w-full py-12">
<h1 class="command-name">
XTRIM
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">XTRIM key <MAXLEN | MINID> [= | ~] threshold [LIMITΒ count]</pre>
<dl class="grid grid-cols-[auto,1fr] gap-2 mb-12">
<dt class="font-semibold text-redis-ink-900 m-0">
Available since:
</dt>
<dd class="m-0">
5.0.0
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
Time complexity:
</dt>
<dd class="m-0">
O(N), with N being the number of evicted entries. Constant times are very small however, since entries are organized in macro nodes containing multiple entries that can be released with a single deallocation.
</dd>
<dt class="font-semibold text-redis-ink-900 m-0">
ACL categories:
</dt>
<dd class="m-0">
<code>
@write
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@stream
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@slow
</code>
<span class="mr-1 last:hidden">
,
</span>
</dd>
</dl>
<p>
<code>
XTRIM
</code>
trims the stream by evicting older entries (entries with lower IDs) if needed.
</p>
<p>
Trimming the stream can be done using one of these strategies:
</p>
<ul>
<li>
<code>
MAXLEN
</code>
: Evicts entries as long as the stream's length exceeds the specified
<code>
threshold
</code>
, where
<code>
threshold
</code>
is a positive integer.
</li>
<li>
<code>
MINID
</code>
: Evicts entries with IDs lower than
<code>
threshold
</code>
, where
<code>
threshold
</code>
is a stream ID.
</li>
</ul>
<p>
For example, this will trim the stream to exactly the latest 1000 items:
</p>
<pre tabindex="0"><code>XTRIM mystream MAXLEN 1000
</code></pre>
<p>
Whereas in this example, all entries that have an ID lower than 649085820-0 will be evicted:
</p>
<pre tabindex="0"><code>XTRIM mystream MINID 649085820
</code></pre>
<p>
By default, or when provided with the optional
<code>
=
</code>
argument, the command performs exact trimming.
</p>
<p>
Depending on the strategy, exact trimming means:
</p>
<ul>
<li>
<code>
MAXLEN
</code>
: the trimmed stream's length will be exactly the minimum between its original length and the specified
<code>
threshold
</code>
.
</li>
<li>
<code>
MINID
</code>
: the oldest ID in the stream will be exactly the maximum between its original oldest ID and the specified
<code>
threshold
</code>
.
</li>
</ul>
<h2 id="nearly-exact-trimming">
Nearly exact trimming
</h2>
<p>
Because exact trimming may require additional effort from the Redis server, the optional
<code>
~
</code>
argument can be provided to make it more efficient.
</p>
<p>
For example:
</p>
<pre tabindex="0"><code>XTRIM mystream MAXLEN ~ 1000
</code></pre>
<p>
The
<code>
~
</code>
argument between the
<code>
MAXLEN
</code>
strategy and the
<code>
threshold
</code>
means that the user is requesting to trim the stream so its length is
<strong>
at least
</strong>
the
<code>
threshold
</code>
, but possibly slightly more.
In this case, Redis will stop trimming early when performance can be gained (for example, when a whole macro node in the data structure can't be removed).
This makes trimming much more efficient, and it is usually what you want, although after trimming, the stream may have few tens of additional entries over the
<code>
threshold
</code>
.
</p>
<p>
Another way to control the amount of work done by the command when using the
<code>
~
</code>
, is the
<code>
LIMIT
</code>
clause.
When used, it specifies the maximal
<code>
count
</code>
of entries that will be evicted.
When
<code>
LIMIT
</code>
and
<code>
count
</code>
aren't specified, the default value of 100 * the number of entries in a macro node will be implicitly used as the
<code>
count
</code>
.
Specifying the value 0 as
<code>
count
</code>
disables the limiting mechanism entirely.
</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> XADD mystream * field1 A field2 B field3 C field4 D
"1731587428729-0"
redis> XTRIM mystream MAXLEN 2
(integer) 0
redis> XRANGE mystream - +
1) 1) "1731587428729-0"
2) 1) "field1"
2) "A"
3) "field2"
4) "B"
5) "field3"
6) "C"
7) "field4"
8) "D"
</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 entries deleted from the stream.
<br/>
<h2>
History
</h2>
<ul>
<li>
Starting with Redis version 6.2.0: Added the
<code>
MINID
</code>
trimming strategy and the
<code>
LIMIT
</code>
option.
</li>
</ul>
<form class="text-sm w-full mt-24 pt-5 border-t border-t-redis-pen-700 border-opacity-50" id="page-feedback" name="page-feedback">
<input class="hidden" name="origin" value="https://redis.io/docs/latest/commands/xtrim/"/>
<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/incrby/.html | <section class="prose w-full py-12">
<h1 class="command-name">
INCRBY
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">INCRBY key increment</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>
@write
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@string
</code>
<span class="mr-1 last:hidden">
,
</span>
<code>
@fast
</code>
<span class="mr-1 last:hidden">
,
</span>
</dd>
</dl>
<p>
Increments the number stored at
<code>
key
</code>
by
<code>
increment
</code>
.
If the key does not exist, it is set to
<code>
0
</code>
before performing the operation.
An error is returned if the key contains a value of the wrong type or contains a
string that can not be represented as integer.
This operation is limited to 64 bit signed integers.
</p>
<p>
See
<a href="/docs/latest/commands/incr/">
<code>
INCR
</code>
</a>
for extra information on increment/decrement operations.
</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> SET mykey "10"
"OK"
redis> INCRBY mykey 5
(integer) 15
</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 value of the key after the increment.
<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/incrby/"/>
<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.loadchunk.html | <section class="prose w-full py-12">
<h1 class="command-name">
CF.LOADCHUNK
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">CF.LOADCHUNK key iterator data</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(n), where n is the capacity
</dd>
</dl>
<p>
Restores a cuckoo filter previously saved using
<a href="/docs/latest/commands/cf.scandump/">
<code>
CF.SCANDUMP
</code>
</a>
.
</p>
<p>
See the
<a href="/docs/latest/commands/cf.scandump/">
<code>
CF.SCANDUMP
</code>
</a>
command for example usage.
</p>
<p>
<note>
<b>
Notes
</b>
</note>
</p>
<ul>
<li>
This command overwrites the cuckoo filter stored under
<code>
key
</code>
.
</li>
<li>
Make sure that the cuckoo filter is not changed between invocations.
</li>
</ul>
<h2 id="required-arguments">
Required arguments
</h2>
<details open="">
<summary>
<code>
key
</code>
</summary>
<p>
is key name for a cuckoo filter to restore.
</p>
</details>
<details open="">
<summary>
<code>
iterator
</code>
</summary>
<p>
Iterator value associated with
<code>
data
</code>
(returned by
<a href="/docs/latest/commands/cf.scandump/">
<code>
CF.SCANDUMP
</code>
</a>
)
</p>
</details>
<details open="">
<summary>
<code>
data
</code>
</summary>
<p>
Current data chunk (returned by
<a href="/docs/latest/commands/cf.scandump/">
<code>
CF.SCANDUMP
</code>
</a>
)
</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, wrong key type, wrong data, etc.)
</li>
</ul>
<h2 id="examples">
Examples
</h2>
<p>
See
<a href="/docs/latest/commands/cf.scandump/">
<code>
CF.SCANDUMP
</code>
</a>
for an example.
</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/cf.loadchunk/"/>
<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/configure/replica-ha/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Configure high availability for replica shards
</h1>
<p class="text-lg -mt-5 mb-10">
Configure high availability for replica shards so that the cluster automatically migrates the replica shards to an available node.
</p>
<p>
When you enable
<a href="/docs/latest/operate/rs/databases/durability-ha/replication/">
database replication
</a>
,
Redis Enterprise Software creates a replica of each primary shard. The replica shard will always be
located on a different node than the primary shard to make your data highly available. If the primary shard
fails or if the node hosting the primary shard fails, then the replica is promoted to primary.
</p>
<p>
Without replica high availability (
<em>
replica_ha
</em>
) enabled, the promoted primary shard becomes a single point of failure
as the only copy of the data.
</p>
<p>
Enabling
<em>
replica_ha
</em>
configures the cluster to automatically replicate the promoted replica on an available node.
This automatically returns the database to a state where there are two copies of the data:
the former replica shard which has been promoted to primary and a new replica shard.
</p>
<p>
An available node:
</p>
<ol>
<li>
Meets replica migration requirements, such as
<a href="/docs/latest/operate/rs/clusters/configure/rack-zone-awareness/">
rack-awareness
</a>
.
</li>
<li>
Has enough available RAM to store the replica shard.
</li>
<li>
Does not also contain the primary shard.
</li>
</ol>
<p>
In practice, replica migration creates a new replica shard and copies the data from the primary shard to the new replica shard.
</p>
<p>
For example:
</p>
<ol>
<li>
<p>
Node:2 has a primary shard and node:3 has the corresponding replica shard.
</p>
</li>
<li>
<p>
Either:
</p>
<ul>
<li>
Node:2 fails and the replica shard on node:3 is promoted to primary.
</li>
<li>
Node:3 fails and the primary shard is no longer replicated to the replica shard on the failed node.
</li>
</ul>
</li>
<li>
<p>
If replica HA is enabled, a new replica shard is created on an available node.
</p>
</li>
<li>
<p>
The data from the primary shard is replicated to the new replica shard.
</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>
Replica HA follows all prerequisites of replica migration, such as
<a href="/docs/latest/operate/rs/clusters/configure/rack-zone-awareness/">
rack-awareness
</a>
.
</li>
<li>
Replica HA migrates as many shards as possible based on available DRAM in the target node. When no DRAM is available, replica HA stops migrating replica shards to that node.
</li>
</ul>
</div>
</div>
<h2 id="configure-high-availability-for-replica-shards">
Configure high availability for replica shards
</h2>
<p>
If replica high availability is enabled for both the cluster and a database,
the database's replica shards automatically migrate to another node when a primary or replica shard fails.
If replica HA is not enabled at the cluster level,
replica HA will not migrate replica shards even if replica HA is enabled for a database.
</p>
<p>
Replica high availability is enabled for the cluster by default.
</p>
<p>
When you create a database using the Cluster Manager UI, replica high availability is enabled for the database by default if you enable replication.
</p>
<a href="/docs/latest/images/rs/screenshots/databases/config-replica-ha-enabled-7-8-2.png" sdata-lightbox="/images/rs/screenshots/databases/config-replica-ha-enabled-7-8-2.png">
<img alt="When you select the Replication checkbox in the High availability section of the database configuration screen, the Replica high availability checkbox is also selected by default." src="/docs/latest/images/rs/screenshots/databases/config-replica-ha-enabled-7-8-2.png"/>
</a>
<p>
To use replication without replication high availability, clear the
<strong>
Replica high availability
</strong>
checkbox.
</p>
<p>
You can also enable or turn off replica high availability for a database using
<code>
rladmin
</code>
or the REST API.
</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>
For Active-Active databases, replica HA is enabled for the database by default to make sure that replica shards are available for Active-Active replication.
</div>
</div>
<h3 id="configure-cluster-policy-for-replica-ha">
Configure cluster policy for replica HA
</h3>
<p>
To enable or turn off replica high availability by default for the entire cluster, use one of the following methods:
</p>
<ul>
<li>
<p>
<a href="/docs/latest/operate/rs/references/cli-utilities/rladmin/tune/#tune-cluster">
rladmin tune cluster
</a>
:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">rladmin tune cluster slave_ha <span class="o">{</span> enabled <span class="p">|</span> disabled <span class="o">}</span>
</span></span></code></pre>
</div>
</li>
<li>
<p>
<a href="/docs/latest/operate/rs/references/rest-api/requests/cluster/policy/#put-cluster-policy">
Update cluster policy
</a>
REST API request:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">PUT /v1/cluster/policy
</span></span><span class="line"><span class="cl"><span class="o">{</span> <span class="s2">"slave_ha"</span>: <boolean> <span class="o">}</span>
</span></span></code></pre>
</div>
</li>
</ul>
<h3 id="turn-off-replica-ha-for-a-database">
Turn off replica HA for a database
</h3>
<p>
To turn off replica high availability for a specific database using
<code>
rladmin
</code>
, run:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">rladmin tune db db:<ID> slave_ha disabled
</span></span></code></pre>
</div>
<p>
You can use the database name in place of
<code>
db:<ID>
</code>
in the preceding command.
</p>
<h2 id="configuration-options">
Configuration options
</h2>
<p>
You can see the current configuration options for replica HA with:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">rladmin info cluster
</span></span></code></pre>
</div>
<h3 id="grace-period">
Grace period
</h3>
<p>
By default, replica HA has a 10-minute grace period after node failure and before new replica shards are created.
</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 default grace period is 30 minutes for containerized applications using
<a href="/docs/latest/operate/kubernetes/">
Redis Enterprise Software for Kubernetes
</a>
.
</div>
</div>
<p>
To configure this grace period from rladmin, run:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">rladmin tune cluster slave_ha_grace_period <time_in_seconds>
</span></span></code></pre>
</div>
<h3 id="shard-priority">
Shard priority
</h3>
<p>
Replica shard migration is based on priority. When memory resources are limited, the most important replica shards are migrated first:
</p>
<ol>
<li>
<p>
<code>
slave_ha_priority
</code>
- Replica shards with higher
integer values are migrated before shards with lower values.
</p>
<p>
To assign priority to a database, run:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">rladmin tune db db:<ID> slave_ha_priority <positive integer>
</span></span></code></pre>
</div>
<p>
You can use the database name in place of
<code>
db:<ID>
</code>
in the preceding command.
</p>
</li>
<li>
<p>
Active-Active databases - Active-Active database synchronization uses replica shards to synchronize between the replicas.
</p>
</li>
<li>
<p>
Database size - It is easier and more efficient to move replica shards of smaller databases.
</p>
</li>
<li>
<p>
Database UID - The replica shards of databases with a higher UID are moved first.
</p>
</li>
</ol>
<h3 id="cooldown-periods">
Cooldown periods
</h3>
<p>
Both the cluster and the database have cooldown periods.
</p>
<p>
After node failure, the cluster cooldown period (
<code>
slave_ha_cooldown_period
</code>
) prevents another replica migration due to another node failure for any
database in the cluster until the cooldown period ends. The default is one hour.
</p>
<p>
After a database is migrated with replica HA,
it cannot go through another migration due to another node failure until the cooldown period for the database (
<code>
slave_ha_bdb_cooldown_period
</code>
) ends. The default is two hours.
</p>
<p>
To configure cooldown periods, use
<a href="/docs/latest/operate/rs/references/cli-utilities/rladmin/tune/#tune-cluster">
<code>
rladmin tune cluster
</code>
</a>
:
</p>
<ul>
<li>
<p>
For the cluster:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">rladmin tune cluster slave_ha_cooldown_period <time_in_seconds>
</span></span></code></pre>
</div>
</li>
<li>
<p>
For all databases in the cluster:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">rladmin tune cluster slave_ha_bdb_cooldown_period <time_in_seconds>
</span></span></code></pre>
</div>
</li>
</ul>
<h3 id="alerts">
Alerts
</h3>
<p>
The following alerts are sent during replica HA activation:
</p>
<ul>
<li>
Shard migration begins after the grace period.
</li>
<li>
Shard migration fails because there is no available node (sent hourly).
</li>
<li>
Shard migration is delayed because of the cooldown period.
</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/databases/configure/replica-ha/"/>
<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/go/queryjson/.html | <section class="prose w-full py-12">
<h1>
Example - Index and query JSON documents
</h1>
<p class="text-lg -mt-5 mb-10">
Learn how to use the Redis query engine with JSON
</p>
<p>
This example shows how to create a
<a href="/docs/latest/develop/interact/search-and-query/indexing/">
search index
</a>
for
<a href="/docs/latest/develop/data-types/json/">
JSON
</a>
data and
run queries against the index.
</p>
<p>
Make sure that you have Redis Stack and
<code>
NRedisStack
</code>
installed.
</p>
<p>
Start by connecting to the Redis server:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-go" data-lang="go"><span class="line"><span class="cl"><span class="kn">import</span> <span class="p">(</span>
</span></span><span class="line"><span class="cl"> <span class="s">"context"</span>
</span></span><span class="line"><span class="cl"> <span class="s">"fmt"</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="s">"github.com/redis/go-redis/v9"</span>
</span></span><span class="line"><span class="cl"><span class="p">)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="kd">func</span> <span class="nf">main</span><span class="p">()</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nx">ctx</span> <span class="o">:=</span> <span class="nx">context</span><span class="p">.</span><span class="nf">Background</span><span class="p">()</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"> <span class="nx">rdb</span> <span class="o">:=</span> <span class="nx">redis</span><span class="p">.</span><span class="nf">NewClient</span><span class="p">(</span><span class="o">&</span><span class="nx">redis</span><span class="p">.</span><span class="nx">Options</span><span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nx">Addr</span><span class="p">:</span> <span class="s">"localhost:6379"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nx">Password</span><span class="p">:</span> <span class="s">""</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nx">DB</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nx">Protocol</span><span class="p">:</span> <span class="mi">2</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="c1">// ...
</span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="p">}</span>
</span></span></code></pre>
</div>
<p>
Add some
<code>
map
</code>
objects to store in JSON format in the database:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-go" data-lang="go"><span class="line"><span class="cl"><span class="nx">user1</span> <span class="o">:=</span> <span class="kd">map</span><span class="p">[</span><span class="kt">string</span><span class="p">]</span><span class="kd">interface</span><span class="p">{}{</span>
</span></span><span class="line"><span class="cl"> <span class="s">"name"</span><span class="p">:</span> <span class="s">"Paul John"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s">"email"</span><span class="p">:</span> <span class="s">"[email protected]"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s">"age"</span><span class="p">:</span> <span class="mi">42</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s">"city"</span><span class="p">:</span> <span class="s">"London"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="nx">user2</span> <span class="o">:=</span> <span class="kd">map</span><span class="p">[</span><span class="kt">string</span><span class="p">]</span><span class="kd">interface</span><span class="p">{}{</span>
</span></span><span class="line"><span class="cl"> <span class="s">"name"</span><span class="p">:</span> <span class="s">"Eden Zamir"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s">"email"</span><span class="p">:</span> <span class="s">"[email protected]"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s">"age"</span><span class="p">:</span> <span class="mi">29</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s">"city"</span><span class="p">:</span> <span class="s">"Tel Aviv"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="nx">user3</span> <span class="o">:=</span> <span class="kd">map</span><span class="p">[</span><span class="kt">string</span><span class="p">]</span><span class="kd">interface</span><span class="p">{}{</span>
</span></span><span class="line"><span class="cl"> <span class="s">"name"</span><span class="p">:</span> <span class="s">"Paul Zamir"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s">"email"</span><span class="p">:</span> <span class="s">"[email protected]"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s">"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="s">"city"</span><span class="p">:</span> <span class="s">"Tel Aviv"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span></code></pre>
</div>
<p>
Use the code below to create a search index. The
<code>
FTCreateOptions
</code>
parameter enables
indexing only for JSON objects where the key has a
<code>
user:
</code>
prefix.
The
<a href="/docs/latest/develop/interact/search-and-query/indexing/">
schema
</a>
for the index has three fields for the user's name, age, and city.
The
<code>
FieldName
</code>
field of the
<code>
FieldSchema
</code>
struct specifies a
<a href="/docs/latest/develop/data-types/json/path/">
JSON path
</a>
that identifies which data field to index. Use the
<code>
As
</code>
struct field
to provide an alias for the JSON path expression. You can use
the alias in queries as a short and intuitive way to refer to the
expression, instead of typing it in full:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-go" data-lang="go"><span class="line"><span class="cl"><span class="nx">_</span><span class="p">,</span> <span class="nx">err</span> <span class="o">:=</span> <span class="nx">rdb</span><span class="p">.</span><span class="nf">FTCreate</span><span class="p">(</span>
</span></span><span class="line"><span class="cl"> <span class="nx">ctx</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s">"idx:users"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="c1">// Options:
</span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="o">&</span><span class="nx">redis</span><span class="p">.</span><span class="nx">FTCreateOptions</span><span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nx">OnJSON</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nx">Prefix</span><span class="p">:</span> <span class="p">[]</span><span class="kd">interface</span><span class="p">{}{</span><span class="s">"user:"</span><span class="p">},</span>
</span></span><span class="line"><span class="cl"> <span class="p">},</span>
</span></span><span class="line"><span class="cl"> <span class="c1">// Index schema fields:
</span></span></span><span class="line"><span class="cl"><span class="c1"></span> <span class="o">&</span><span class="nx">redis</span><span class="p">.</span><span class="nx">FieldSchema</span><span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nx">FieldName</span><span class="p">:</span> <span class="s">"$.name"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nx">As</span><span class="p">:</span> <span class="s">"name"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nx">FieldType</span><span class="p">:</span> <span class="nx">redis</span><span class="p">.</span><span class="nx">SearchFieldTypeText</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="o">&</span><span class="nx">redis</span><span class="p">.</span><span class="nx">FieldSchema</span><span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nx">FieldName</span><span class="p">:</span> <span class="s">"$.city"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nx">As</span><span class="p">:</span> <span class="s">"city"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nx">FieldType</span><span class="p">:</span> <span class="nx">redis</span><span class="p">.</span><span class="nx">SearchFieldTypeTag</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="o">&</span><span class="nx">redis</span><span class="p">.</span><span class="nx">FieldSchema</span><span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nx">FieldName</span><span class="p">:</span> <span class="s">"$.age"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nx">As</span><span class="p">:</span> <span class="s">"age"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nx">FieldType</span><span class="p">:</span> <span class="nx">redis</span><span class="p">.</span><span class="nx">SearchFieldTypeNumeric</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 class="nf">Result</span><span class="p">()</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="k">if</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nb">panic</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span></code></pre>
</div>
<p>
Add the three sets of user data to the database as
<a href="/docs/latest/develop/data-types/json/">
JSON
</a>
objects.
If you use keys with the
<code>
user:
</code>
prefix then Redis will index the
objects automatically as you add them:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-go" data-lang="go"><span class="line"><span class="cl"><span class="nx">_</span><span class="p">,</span> <span class="nx">err</span> <span class="p">=</span> <span class="nx">rdb</span><span class="p">.</span><span class="nf">JSONSet</span><span class="p">(</span><span class="nx">ctx</span><span class="p">,</span> <span class="s">"user:1"</span><span class="p">,</span> <span class="s">"$"</span><span class="p">,</span> <span class="nx">user1</span><span class="p">).</span><span class="nf">Result</span><span class="p">()</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="k">if</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nb">panic</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="nx">_</span><span class="p">,</span> <span class="nx">err</span> <span class="p">=</span> <span class="nx">rdb</span><span class="p">.</span><span class="nf">JSONSet</span><span class="p">(</span><span class="nx">ctx</span><span class="p">,</span> <span class="s">"user:2"</span><span class="p">,</span> <span class="s">"$"</span><span class="p">,</span> <span class="nx">user2</span><span class="p">).</span><span class="nf">Result</span><span class="p">()</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="k">if</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nb">panic</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="nx">_</span><span class="p">,</span> <span class="nx">err</span> <span class="p">=</span> <span class="nx">rdb</span><span class="p">.</span><span class="nf">JSONSet</span><span class="p">(</span><span class="nx">ctx</span><span class="p">,</span> <span class="s">"user:3"</span><span class="p">,</span> <span class="s">"$"</span><span class="p">,</span> <span class="nx">user3</span><span class="p">).</span><span class="nf">Result</span><span class="p">()</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="k">if</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nb">panic</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span></code></pre>
</div>
<p>
You can now use the index to search the JSON objects. The
<a href="/docs/latest/develop/interact/search-and-query/query/">
query
</a>
below searches for objects that have the text "Paul" in any field
and have an
<code>
age
</code>
value in the range 30 to 40:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-go" data-lang="go"><span class="line"><span class="cl"><span class="nx">searchResult</span><span class="p">,</span> <span class="nx">err</span> <span class="o">:=</span> <span class="nx">rdb</span><span class="p">.</span><span class="nf">FTSearch</span><span class="p">(</span>
</span></span><span class="line"><span class="cl"> <span class="nx">ctx</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s">"idx:users"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="s">"Paul @age:[30 40]"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"><span class="p">).</span><span class="nf">Result</span><span class="p">()</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="k">if</span> <span class="nx">err</span> <span class="o">!=</span> <span class="kc">nil</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nb">panic</span><span class="p">(</span><span class="nx">err</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="nx">fmt</span><span class="p">.</span><span class="nf">Println</span><span class="p">(</span><span class="nx">searchResult</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="c1">// >>> {1 [{user:3 <nil> <nil> <nil> map[$:{"age":35,"city":"Tel Aviv"...
</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/go/queryjson/"/>
<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.scandump.html | <section class="prose w-full py-12">
<h1 class="command-name">
BF.SCANDUMP
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">BF.SCANDUMP key iterator</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(n), where n is the capacity
</dd>
</dl>
<p>
Begins an incremental save of the Bloom filter.
</p>
<p>
This command is useful for large Bloom filters that cannot fit into the
<a href="/docs/latest/commands/dump/">
<code>
DUMP
</code>
</a>
and
<a href="/docs/latest/commands/restore/">
<code>
RESTORE
</code>
</a>
model.
</p>
<p>
The first time this command is called, the value of
<code>
iter
</code>
should be 0.
</p>
<p>
This command returns successive
<code>
(iter, data)
</code>
pairs until
<code>
(0, NULL)
</code>
to indicate completion.
</p>
<h2 id="required-arguments">
Required arguments
</h2>
<details open="">
<summary>
<code>
key
</code>
</summary>
<p>
is key name for a Bloom filter to save.
</p>
</details>
<details open="">
<summary>
<code>
iterator
</code>
</summary>
<p>
Iterator value; either 0 or the iterator from a previous invocation of this command
</p>
</details>
<h2 id="return-value">
Return value
</h2>
<p>
Returns one of these replies:
</p>
<ul>
<li>
<p>
<a href="/docs/latest/develop/reference/protocol-spec/#arrays">
Array reply
</a>
of
<a href="/docs/latest/develop/reference/protocol-spec/#integers">
Integer reply
</a>
(
<em>
Iterator
</em>
) and [] (
<em>
Data
</em>
).
</p>
<p>
The Iterator is passed as input to the next invocation of
<code>
BF.SCANDUMP
</code>
. If
<em>
Iterator
</em>
is 0, then it means iteration has completed.
</p>
<p>
The iterator-data pair should also be passed to
<a href="/docs/latest/commands/bf.loadchunk/">
<code>
BF.LOADCHUNK
</code>
</a>
when restoring the filter.
</p>
</li>
<li>
<p>
[] on error (invalid arguments, key not found, wrong key type, etc.)
</p>
</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.RESERVE bf 0.1 <span class="m">10</span>
</span></span><span class="line"><span class="cl">OK
</span></span><span class="line"><span class="cl">redis> BF.ADD bf item1
</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">redis> BF.SCANDUMP bf <span class="m">0</span>
</span></span><span class="line"><span class="cl">1<span class="o">)</span> <span class="o">(</span>integer<span class="o">)</span> <span class="m">1</span>
</span></span><span class="line"><span class="cl">2<span class="o">)</span> <span class="s2">"\x01\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x05\x00\x00\x00\x02\x00\x00\x00\b\x00\x00\x00\x00\x00\x00\x00@\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x9a\x99\x99\x99\x99\x99\xa9?J\xf7\xd4\x9e\xde\xf0\x18@\x05\x00\x00\x00\n\x00\x00\x00\x00\x00\x00\x00\x00"</span>
</span></span><span class="line"><span class="cl">redis> BF.SCANDUMP bf <span class="m">1</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">9</span>
</span></span><span class="line"><span class="cl">2<span class="o">)</span> <span class="s2">"\x01\b\x00\x80\x00\x04 \x00"</span>
</span></span><span class="line"><span class="cl">redis> BF.SCANDUMP bf <span class="m">9</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">0</span>
</span></span><span class="line"><span class="cl">2<span class="o">)</span> <span class="s2">""</span>
</span></span><span class="line"><span class="cl">redis> DEL bf
</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> BF.LOADCHUNK bf <span class="m">1</span> <span class="s2">"\x01\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x05\x00\x00\x00\x02\x00\x00\x00\b\x00\x00\x00\x00\x00\x00\x00@\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x9a\x99\x99\x99\x99\x99\xa9?J\xf7\xd4\x9e\xde\xf0\x18@\x05\x00\x00\x00\n\x00\x00\x00\x00\x00\x00\x00\x00"</span>
</span></span><span class="line"><span class="cl">OK
</span></span><span class="line"><span class="cl">redis> BF.LOADCHUNK bf <span class="m">9</span> <span class="s2">"\x01\b\x00\x80\x00\x04 \x00"</span>
</span></span><span class="line"><span class="cl">OK
</span></span><span class="line"><span class="cl">redis> BF.EXISTS bf 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></code></pre>
</div>
<p>
Python code:
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="nv">chunks</span> <span class="o">=</span> <span class="o">[]</span>
</span></span><span class="line"><span class="cl"><span class="nv">iter</span> <span class="o">=</span> <span class="m">0</span>
</span></span><span class="line"><span class="cl"><span class="k">while</span> True:
</span></span><span class="line"><span class="cl"> iter, <span class="nv">data</span> <span class="o">=</span> BF.SCANDUMP<span class="o">(</span>key, iter<span class="o">)</span>
</span></span><span class="line"><span class="cl"> <span class="k">if</span> <span class="nv">iter</span> <span class="o">==</span> 0:
</span></span><span class="line"><span class="cl"> <span class="nb">break</span>
</span></span><span class="line"><span class="cl"> <span class="k">else</span>:
</span></span><span class="line"><span class="cl"> chunks.append<span class="o">([</span>iter, data<span class="o">])</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Load it back</span>
</span></span><span class="line"><span class="cl"><span class="k">for</span> chunk in chunks:
</span></span><span class="line"><span class="cl"> iter, <span class="nv">data</span> <span class="o">=</span> chunk
</span></span><span class="line"><span class="cl"> BF.LOADCHUNK<span class="o">(</span>key, iter, data<span class="o">)</span></span></span></code></pre>
</div>
<p>
</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/bf.scandump/"/>
<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/suffixes/.html | <section class="prose w-full py-12 max-w-none">
<h1>
Suffixes requests
</h1>
<p class="text-lg -mt-5 mb-10">
DNS suffixes requests
</p>
<table>
<thead>
<tr>
<th>
Method
</th>
<th>
Path
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="#get-all-suffixes">
GET
</a>
</td>
<td>
<code>
/v1/suffixes
</code>
</td>
<td>
Get all DNS suffixes
</td>
</tr>
</tbody>
</table>
<h2 id="get-all-suffixes">
Get all suffixes
</h2>
<pre><code>GET /v1/suffixes
</code></pre>
<p>
Get all DNS suffixes in the cluster.
</p>
<h3 id="get-all-request">
Request
</h3>
<h4 id="example-http-request">
Example HTTP request
</h4>
<pre><code>GET /suffixes
</code></pre>
<h4 id="request-headers">
Request headers
</h4>
<table>
<thead>
<tr>
<th>
Key
</th>
<th>
Value
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
Host
</td>
<td>
cnm.cluster.fqdn
</td>
<td>
Domain name
</td>
</tr>
<tr>
<td>
Accept
</td>
<td>
application/json
</td>
<td>
Accepted media type
</td>
</tr>
</tbody>
</table>
<h3 id="get-all-response">
Response
</h3>
<p>
The response body contains a JSON array with all suffixes, represented as
<a href="/docs/latest/operate/rs/references/rest-api/objects/suffix/">
suffix 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">"name"</span><span class="p">:</span> <span class="s2">"cluster.fqdn"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"// additional fields..."</span>
</span></span><span class="line"><span class="cl"> <span class="p">},</span>
</span></span><span class="line"><span class="cl"> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"name"</span><span class="p">:</span> <span class="s2">"internal.cluster.fqdn"</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">"// additional fields..."</span>
</span></span><span class="line"><span class="cl"> <span class="p">}</span>
</span></span><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>
<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/suffixes/"/>
<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.arrinsert.html | <section class="prose w-full py-12">
<h1 class="command-name">
JSON.ARRINSERT
</h1>
<div class="font-semibold text-redis-ink-900">
Syntax
</div>
<pre class="command-syntax">JSON.ARRINSERT key path index 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(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>
Insert the
<code>
json
</code>
values into the array at
<code>
path
</code>
before the
<code>
index
</code>
(shifts to the right)
</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 insert in 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 insert, 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>
<details open="">
<summary>
<code>
index
</code>
</summary>
<p>
is position in the array where you want to insert a value. The index must be in the array's range. Inserting at
<code>
index
</code>
0 prepends to the array. Negative index values start from the end of the array.
</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-value">
Return value
</h2>
<p>
<code>
JSON.ARRINSERT
</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 new colors to a specific place in 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>
<p>
Get the list of colors for the product.
</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 class="s1">'$.colors[*]'</span>
</span></span><span class="line"><span class="cl"><span class="s2">"[\"black\",\"silver\",\"blue\"]"</span></span></span></code></pre>
</div>
<p>
Insert two more colors after the second color. You now have five colors.
</p>
<div class="highlight">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">redis> JSON.ARRINSERT item:1 $.colors <span class="m">2</span> <span class="s1">'"yellow"'</span> <span class="s1">'"gold"'</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 list of colors.
</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 $.colors
</span></span><span class="line"><span class="cl"><span class="s2">"[[\"black\",\"silver\",\"yellow\",\"gold\",\"blue\"]]"</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.arrinsert/"/>
<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