| import{_ as s,O as n,P as a,ah as e,aW as o}from"./framework-62ad666a.js";const t={},p=o(`<h1 id="运维命令" tabindex="-1"><a class="header-anchor" href="#运维命令" aria-hidden="true">#</a> 运维命令</h1><h2 id="flush" tabindex="-1"><a class="header-anchor" href="#flush" aria-hidden="true">#</a> FLUSH</h2><p>将指定 database 的内存缓存区 Memory Table 的数据持久化到磁盘上,并将数据文件封口。在集群模式下,我们提供了持久化本节点的指定 database 的缓存、持久化整个集群指定 database 的缓存命令。</p><p>注意:此命令客户端不需要手动调用,IoTDB 有 wal 保证数据安全,IoTDB 会选择合适的时机进行 flush。 如果频繁调用 flush 会导致数据文件很小,降低查询性能。</p><div class="language-sql line-numbers-mode" data-ext="sql"><pre class="language-sql"><code>IoTDB<span class="token operator">></span> FLUSH |
| IoTDB<span class="token operator">></span> FLUSH <span class="token keyword">ON</span> <span class="token keyword">LOCAL</span> |
| IoTDB<span class="token operator">></span> FLUSH <span class="token keyword">ON</span> CLUSTER |
| IoTDB<span class="token operator">></span> FLUSH root<span class="token punctuation">.</span>ln |
| IoTDB<span class="token operator">></span> FLUSH root<span class="token punctuation">.</span>sg1<span class="token punctuation">,</span>root<span class="token punctuation">.</span>sg2 <span class="token keyword">ON</span> <span class="token keyword">LOCAL</span> |
| IoTDB<span class="token operator">></span> FLUSH root<span class="token punctuation">.</span>sg1<span class="token punctuation">,</span>root<span class="token punctuation">.</span>sg2 <span class="token keyword">ON</span> CLUSTER |
| </code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h2 id="clear-cache" tabindex="-1"><a class="header-anchor" href="#clear-cache" aria-hidden="true">#</a> CLEAR CACHE</h2><p>手动清除chunk, chunk metadata和timeseries metadata的缓存,在内存资源紧张时,可以通过此命令,释放查询时缓存所占的内存空间。在集群模式下,我们提供了清空本节点缓存、清空整个集群缓存命令。</p><div class="language-sql line-numbers-mode" data-ext="sql"><pre class="language-sql"><code>IoTDB<span class="token operator">></span> CLEAR CACHE |
| IoTDB<span class="token operator">></span> CLEAR CACHE <span class="token keyword">ON</span> <span class="token keyword">LOCAL</span> |
| IoTDB<span class="token operator">></span> CLEAR CACHE <span class="token keyword">ON</span> CLUSTER |
| </code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h2 id="set-system-to-readonly-running" tabindex="-1"><a class="header-anchor" href="#set-system-to-readonly-running" aria-hidden="true">#</a> SET SYSTEM TO READONLY / RUNNING</h2><p>手动设置系统为正常运行、只读状态。在集群模式下,我们提供了设置本节点状态、设置整个集群状态的命令,默认对整个集群生效。</p><div class="language-sql line-numbers-mode" data-ext="sql"><pre class="language-sql"><code>IoTDB<span class="token operator">></span> <span class="token keyword">SET</span> SYSTEM <span class="token keyword">TO</span> RUNNING |
| IoTDB<span class="token operator">></span> <span class="token keyword">SET</span> SYSTEM <span class="token keyword">TO</span> READONLY <span class="token keyword">ON</span> <span class="token keyword">LOCAL</span> |
| IoTDB<span class="token operator">></span> <span class="token keyword">SET</span> SYSTEM <span class="token keyword">TO</span> READONLY <span class="token keyword">ON</span> CLUSTER |
| </code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h2 id="终止查询" tabindex="-1"><a class="header-anchor" href="#终止查询" aria-hidden="true">#</a> 终止查询</h2><p>IoTDB 支持设置 Session 连接超时和查询超时时间,并支持手动终止正在执行的查询。</p><h3 id="session-超时" tabindex="-1"><a class="header-anchor" href="#session-超时" aria-hidden="true">#</a> Session 超时</h3><p>Session 超时控制何时关闭空闲 Session。空闲 Session 指在一段时间内没有发起任何操作的 Session。</p><p>Session 超时默认未开启。可以在配置文件中通过 <code>dn_session_timeout_threshold</code> 参数进行配置。</p><h3 id="查询超时" tabindex="-1"><a class="header-anchor" href="#查询超时" aria-hidden="true">#</a> 查询超时</h3><p>对于执行时间过长的查询,IoTDB 将强行中断该查询,并抛出超时异常,如下所示:</p><div class="language-sql line-numbers-mode" data-ext="sql"><pre class="language-sql"><code>IoTDB<span class="token operator">></span> <span class="token keyword">select</span> <span class="token operator">*</span> <span class="token keyword">from</span> root<span class="token punctuation">.</span><span class="token operator">*</span><span class="token operator">*</span><span class="token punctuation">;</span> |
| Msg: <span class="token number">701</span> <span class="token keyword">Current</span> query <span class="token operator">is</span> <span class="token keyword">time</span> <span class="token keyword">out</span><span class="token punctuation">,</span> please <span class="token keyword">check</span> your statement <span class="token operator">or</span> <span class="token keyword">modify</span> timeout parameter<span class="token punctuation">.</span> |
| </code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><p>系统默认的超时时间为 60000 ms,可以在配置文件中通过 <code>query_timeout_threshold</code> 参数进行自定义配置。</p><p>如果您使用 JDBC 或 Session,还支持对单个查询设置超时时间(单位为 ms):</p><div class="language-java line-numbers-mode" data-ext="java"><pre class="language-java"><code><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token class-name">IoTDBStatement</span><span class="token punctuation">)</span> statement<span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">executeQuery</span><span class="token punctuation">(</span><span class="token class-name">String</span> sql<span class="token punctuation">,</span> <span class="token keyword">long</span> timeoutInMS<span class="token punctuation">)</span> |
| session<span class="token punctuation">.</span><span class="token function">executeQueryStatement</span><span class="token punctuation">(</span><span class="token class-name">String</span> sql<span class="token punctuation">,</span> <span class="token keyword">long</span> timeout<span class="token punctuation">)</span> |
| </code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><blockquote><p>如果不配置超时时间参数或将超时时间设置为负数,将使用服务器端默认的超时时间。 如果超时时间设置为0,则会禁用超时功能。</p></blockquote><h3 id="查询终止" tabindex="-1"><a class="header-anchor" href="#查询终止" aria-hidden="true">#</a> 查询终止</h3><p>尚未支持</p>`,25);function i(r,c){return n(),a("div",null,[e(` |
| |
| Licensed to the Apache Software Foundation (ASF) under one |
| or more contributor license agreements. See the NOTICE file |
| distributed with this work for additional information |
| regarding copyright ownership. The ASF licenses this file |
| to you under the Apache License, Version 2.0 (the |
| "License"); you may not use this file except in compliance |
| with the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, |
| software distributed under the License is distributed on an |
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| KIND, either express or implied. See the License for the |
| specific language governing permissions and limitations |
| under the License. |
| |
| `),p])}const d=s(t,[["render",i],["__file","Maintenance-Command.html.vue"]]);export{d as default}; |