mirror of
http://github.com/valkey-io/valkey
synced 2024-11-22 18:04:52 +00:00
77 lines
4.9 KiB
HTML
77 lines
4.9 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
|
<html>
|
|
<head>
|
|
<link type="text/css" rel="stylesheet" href="style.css" />
|
|
</head>
|
|
<body>
|
|
<div id="page">
|
|
|
|
<div id='header'>
|
|
<a href="index.html">
|
|
<img style="border:none" alt="Redis Documentation" src="redis.png">
|
|
</a>
|
|
</div>
|
|
|
|
<div id="pagecontent">
|
|
<div class="index">
|
|
<!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
|
|
<b>ConfigCommand: Contents</b><br> <a href="#CONFIG GET _pattern_ (Redis >">CONFIG GET _pattern_ (Redis ></a><br> <a href="#CONFIG SET _parameter_ _value_ (Redis >">CONFIG SET _parameter_ _value_ (Redis ></a><br> <a href="#CONFIG GET _pattern_">CONFIG GET _pattern_</a><br> <a href="#CONFIG SET _parameter_ _value_">CONFIG SET _parameter_ _value_</a><br> <a href="#Parameters value format">Parameters value format</a><br> <a href="#See Also">See Also</a>
|
|
</div>
|
|
|
|
<h1 class="wikiname">ConfigCommand</h1>
|
|
|
|
<div class="summary">
|
|
|
|
</div>
|
|
|
|
<div class="narrow">
|
|
#sidebar <a href="ControlCommandsSidebar.html">ControlCommandsSidebar</a><h1><a name="CONFIG GET _pattern_ (Redis >">CONFIG GET _pattern_ (Redis ></a></h1> 2.0)=
|
|
<h1><a name="CONFIG SET _parameter_ _value_ (Redis >">CONFIG SET _parameter_ _value_ (Redis ></a></h1> 2.0)=<br/><br/><blockquote>The CONFIG command is able to retrieve or alter the configuration of a runningRedis server. Not all the configuration parameters are supported.</blockquote>
|
|
<blockquote>CONFIG has two sub commands, GET and SET. The GET command is used to readthe configuration, while the SET command is used to alter the configuration.</blockquote>
|
|
<h2><a name="CONFIG GET _pattern_">CONFIG GET _pattern_</a></h2><blockquote>CONFIG GET returns the current configuration parameters. This sub commandonly accepts a single argument, that is glob style pattern. All theconfiguration parameters matching this parameter are reported as alist of key-value pairs. Example:</blockquote><pre class="codeblock python" name="code">
|
|
$ redis-cli config get '*'
|
|
1. "dbfilename"
|
|
2. "dump.rdb"
|
|
3. "requirepass"
|
|
4. (nil)
|
|
5. "masterauth"
|
|
6. (nil)
|
|
7. "maxmemory"
|
|
8. "0\n"
|
|
9. "appendfsync"
|
|
10. "everysec"
|
|
11. "save"
|
|
12. "3600 1 300 100 60 10000"
|
|
|
|
$ redis-cli config get 'm*'
|
|
1. "masterauth"
|
|
2. (nil)
|
|
3. "maxmemory"
|
|
4. "0\n"
|
|
</pre>The return type of the command is a <a href="ReplyTypes.html">bulk reply</a>.<h2><a name="CONFIG SET _parameter_ _value_">CONFIG SET _parameter_ _value_</a></h2><blockquote>CONFIG SET is used in order to reconfigure the server, setting a specificconfiguration parameter to a new value.</blockquote>
|
|
<blockquote>The list of configuration parameters supported by CONFIG SET can beobtained issuing a <code name="code" class="python">CONFIG GET *</code> command.</blockquote>
|
|
<blockquote>The configuration set using CONFIG SET is immediately loaded by the Redisserver that will start acting as specified starting from the next command.</blockquote>
|
|
<blockquote>Example:</blockquote><pre class="codeblock python python" name="code">
|
|
$ ./redis-cli
|
|
redis> set x 10
|
|
OK
|
|
redis> config set maxmemory 200
|
|
OK
|
|
redis> set y 20
|
|
(error) ERR command not allowed when used memory > 'maxmemory'
|
|
redis> config set maxmemory 0
|
|
OK
|
|
redis> set y 20
|
|
OK
|
|
</pre><h2><a name="Parameters value format">Parameters value format</a></h2><blockquote>The value of the configuration parameter is the same as the one of thesame parameter in the Redis configuration file, with the following exceptions:</blockquote>
|
|
<ul><li> The <code name="code" class="python">save</code> paramter is a list of space-separated integers. Every pair of integers specify the time and number of changes limit to trigger a save. For instance the command <code name="code" class="python">CONFIG SET save "3600 10 60 10000"</code> will configure the server to issue a background saving of the RDB file every 3600 seconds if there are at least 10 changes in the dataset, and every 60 seconds if there are at least 10000 changes. To completely disable automatic snapshots just set the parameter as an empty string.</li><li> All the integer parameters representing memory are returned and accepted only using bytes as unit.</li></ul>
|
|
<h2><a name="See Also">See Also</a></h2>The <a href="InfoCommand.html">INFO</a> command can be used in order to read configuriaton parameters that are not available in the CONFIG command.
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|
|
|