forked from docs/doc-exports
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com> Co-authored-by: Chen, Junjie <chenjunjie@huawei.com> Co-committed-by: Chen, Junjie <chenjunjie@huawei.com>
21 lines
2.6 KiB
HTML
21 lines
2.6 KiB
HTML
<a name="dcs-faq-0730041"></a><a name="dcs-faq-0730041"></a>
|
|
|
|
<h1 class="topictitle1">Why Does a Redis Command Fail to Take Effect?</h1>
|
|
<div id="body1596093494759"><p id="dcs-faq-0730041__en-us_topic_0192035902_p1017169153514">Run the command in redis-cli to check whether the command takes effect.</p>
|
|
<p id="dcs-faq-0730041__en-us_topic_0192035902_p1808164714374">The following describes two scenarios:</p>
|
|
<ul id="dcs-faq-0730041__en-us_topic_0192035902_ul58061534382"><li id="dcs-faq-0730041__en-us_topic_0192035902_li86421320145219">Scenario 1: Set and query the value of a key to check whether the <strong id="dcs-faq-0730041__b204771411478">SET</strong> and <strong id="dcs-faq-0730041__b24833411373">GET</strong> commands work.<p id="dcs-faq-0730041__en-us_topic_0192035902_p7361226135213">The <strong id="dcs-faq-0730041__b1753111424716">SET</strong> command is used to set the string value. If the value is not changed, run the following commands in redis-cli to access the instance:</p>
|
|
<p id="dcs-faq-0730041__en-us_topic_0192035902_p6171296354"><span><img id="dcs-faq-0730041__en-us_topic_0192035902_image418199203517" src="en-us_image_0266322522.jpg"></span></p>
|
|
</li><li id="dcs-faq-0730041__en-us_topic_0192035902_li15497141023813">Scenario 2: If the timeout set using the <strong id="dcs-faq-0730041__b1272412441576">EXPIRE</strong> command is incorrect, perform the following operations:<p id="dcs-faq-0730041__en-us_topic_0192035902_p597831543412">Set the timeout to 10 seconds and run the <strong id="dcs-faq-0730041__b128483452718">TTL</strong> command to view the remaining time. As shown in the following example, the remaining time is 7 seconds.</p>
|
|
<p id="dcs-faq-0730041__en-us_topic_0192035902_p73301313143416"><span><img id="dcs-faq-0730041__en-us_topic_0192035902_image3330191383413" src="en-us_image_0266322523.png"></span></p>
|
|
</li></ul>
|
|
<div class="note" id="dcs-faq-0730041__en-us_topic_0192035902_note56151919396"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="dcs-faq-0730041__en-us_topic_0192035902_p54201911409">Redis clients (including redis-cli, Jedis clients, and Python clients) communicate with Redis server using a binary protocol.</p>
|
|
<p id="dcs-faq-0730041__en-us_topic_0192035902_p061419203919">If Redis commands are run properly in redis-cli, the problem may lie in the service code. In this case, create logs in the code for further analysis.</p>
|
|
</div></div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="dcs-faq-190921003.html">Redis Commands</a></div>
|
|
</div>
|
|
</div>
|
|
|