blob: 5baddf0bb04ffe28295fc0923c9caaac7ab7cb4d [file] [log] [blame]
import{_ as n,r as s,o as l,c as r,b as e,d as a,a as o,e as i}from"./app-Bp5kEZWW.js";const d={},c=i('<h1 id="_1-监控面板安装部署" tabindex="-1"><a class="header-anchor" href="#_1-监控面板安装部署"><span>1. 监控面板安装部署</span></a></h1><p>从 IoTDB 1.0 版本开始,我们引入了系统监控模块,可以完成对 IoTDB 的重要运行指标进行监控,本文介绍了如何在 IoTDB 分布式开启系统监控模块,并且使用 Prometheus + Grafana 的方式完成对系统监控指标的可视化。</p><h2 id="_1-1-前期准备" tabindex="-1"><a class="header-anchor" href="#_1-1-前期准备"><span>1.1 前期准备</span></a></h2><h3 id="_1-1-1-软件要求" tabindex="-1"><a class="header-anchor" href="#_1-1-1-软件要求"><span>1.1.1 软件要求</span></a></h3>',4),p={href:"https://iotdb.apache.org/Download/",target:"_blank",rel:"noopener noreferrer"},h={href:"https://prometheus.io/download/",target:"_blank",rel:"noopener noreferrer"},g={href:"https://grafana.com/grafana/download",target:"_blank",rel:"noopener noreferrer"},m=e("li",null,"IoTDB 监控面板:基于企业版IoTDB的数据库监控面板,您可联系商务获取",-1),u=i(`<h3 id="_1-1-2-启动-confignode" tabindex="-1"><a class="header-anchor" href="#_1-1-2-启动-confignode"><span>1.1.2 启动 ConfigNode</span></a></h3><blockquote><p>本文以 3C3D 为例</p></blockquote><ol><li>进入<code>iotdb-enterprise-1.3.x.x-bin</code>包</li><li>修改配置文件<code>conf/iotdb-confignode.properties</code>,修改如下配置,其他配置保持不变:</li></ol><div class="language-properties line-numbers-mode" data-ext="properties" data-title="properties"><pre class="language-properties"><code><span class="token key attr-name">cn_metric_reporter_list</span><span class="token punctuation">=</span><span class="token value attr-value">PROMETHEUS</span>
<span class="token key attr-name">cn_metric_level</span><span class="token punctuation">=</span><span class="token value attr-value">IMPORTANT</span>
<span class="token key attr-name">cn_metric_prometheus_reporter_port</span><span class="token punctuation">=</span><span class="token value attr-value">9091</span>
</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><ol start="3"><li>运行脚本启动 ConfigNode:<code>./sbin/start-confignode.sh</code>,出现如下提示则为启动成功:</li></ol><figure><img src="https://spricoder.oss-cn-shanghai.aliyuncs.com/Apache IoTDB/metric/cluster-introduce/1.png" alt="" tabindex="0" loading="lazy"><figcaption></figcaption></figure>`,6),f={start:"4"},b={href:"http://localhost:9091/metrics%E7%BD%91%E5%9D%80%EF%BC%8C%E5%8F%AF%E4%BB%A5%E6%9F%A5%E7%9C%8B%E5%88%B0%E5%A6%82%E4%B8%8B%E7%9A%84%E7%9B%91%E6%8E%A7%E9%A1%B9%E4%BF%A1%E6%81%AF%EF%BC%9A",target:"_blank",rel:"noopener noreferrer"},_=i(`<figure><img src="https://spricoder.oss-cn-shanghai.aliyuncs.com/Apache IoTDB/metric/cluster-introduce/2.png" alt="" tabindex="0" loading="lazy"><figcaption></figcaption></figure><ol start="5"><li>同样地,另外两个 ConfigNode 节点可以分别配置到 9092 和 9093 端口。</li></ol><h3 id="_1-1-3-启动-datanode" tabindex="-1"><a class="header-anchor" href="#_1-1-3-启动-datanode"><span>1.1.3 启动 DataNode</span></a></h3><ol><li>进入<code>iotdb-enterprise-1.3.x.x-bin</code>包</li><li>修改配置文件<code>conf/iotdb-datanode.properties</code>,修改如下配置,其他配置保持不变:</li></ol><div class="language-properties line-numbers-mode" data-ext="properties" data-title="properties"><pre class="language-properties"><code><span class="token key attr-name">dn_metric_reporter_list</span><span class="token punctuation">=</span><span class="token value attr-value">PROMETHEUS</span>
<span class="token key attr-name">dn_metric_level</span><span class="token punctuation">=</span><span class="token value attr-value">IMPORTANT</span>
<span class="token key attr-name">dn_metric_prometheus_reporter_port</span><span class="token punctuation">=</span><span class="token value attr-value">9094</span>
</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><ol start="3"><li>运行脚本启动 DataNode:<code>./sbin/start-datanode.sh</code>,出现如下提示则为启动成功:</li></ol><figure><img src="https://spricoder.oss-cn-shanghai.aliyuncs.com/Apache IoTDB/metric/cluster-introduce/3.png" alt="" tabindex="0" loading="lazy"><figcaption></figcaption></figure><ol start="4"><li>在浏览器进入<code>http://localhost:9094/metrics</code>网址,可以查看到如下的监控项信息:</li></ol><figure><img src="https://spricoder.oss-cn-shanghai.aliyuncs.com/Apache IoTDB/metric/cluster-introduce/4.png" alt="" tabindex="0" loading="lazy"><figcaption></figcaption></figure><ol start="5"><li>同样地,另外两个 DataNode 可以配置到 9095 和 9096 端口。</li></ol><h3 id="_1-1-4-说明" tabindex="-1"><a class="header-anchor" href="#_1-1-4-说明"><span>1.1.4 说明</span></a></h3><p>进行以下操作前请确认IoTDB集群已启动。</p><p>本文将在一台机器(3 个 ConfigNode 和 3 个 DataNode)环境上进行监控面板搭建,其他集群配置是类似的,用户可以根据自己的集群情况(ConfigNode 和 DataNode 的数量)进行配置调整。本文搭建的集群的基本配置信息如下表所示。</p><table><thead><tr><th>集群角色</th><th>节点IP</th><th>监控模块推送器</th><th>监控模块级别</th><th>监控 Port</th></tr></thead><tbody><tr><td>ConfigNode</td><td>127.0.0.1</td><td>PROMETHEUS</td><td>IMPORTANT</td><td>9091</td></tr><tr><td>ConfigNode</td><td>127.0.0.1</td><td>PROMETHEUS</td><td>IMPORTANT</td><td>9092</td></tr><tr><td>ConfigNode</td><td>127.0.0.1</td><td>PROMETHEUS</td><td>IMPORTANT</td><td>9093</td></tr><tr><td>DataNode</td><td>127.0.0.1</td><td>PROMETHEUS</td><td>IMPORTANT</td><td>9094</td></tr><tr><td>DataNode</td><td>127.0.0.1</td><td>PROMETHEUS</td><td>IMPORTANT</td><td>9095</td></tr><tr><td>DataNode</td><td>127.0.0.1</td><td>PROMETHEUS</td><td>IMPORTANT</td><td>9096</td></tr></tbody></table><h2 id="_1-2-配置-prometheus-采集监控指标" tabindex="-1"><a class="header-anchor" href="#_1-2-配置-prometheus-采集监控指标"><span>1.2 配置 Prometheus 采集监控指标</span></a></h2><ol><li>下载安装包。下载Prometheus的二进制包到本地,解压后进入对应文件夹:</li></ol><div class="language-Shell line-numbers-mode" data-ext="Shell" data-title="Shell"><pre class="language-Shell"><code>tar xvfz prometheus-*.tar.gz
cd prometheus-*
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><ol start="2"><li>修改配置。修改Prometheus的配置文件prometheus.yml如下<br> a. 新增 confignode 任务收集 ConfigNode 的监控数据<br> b. 新增 datanode 任务收集 DataNode 的监控数据</li></ol><div class="language-YAML line-numbers-mode" data-ext="YAML" data-title="YAML"><pre class="language-YAML"><code>global:
scrape_interval: 15s
scrape_configs:
- job_name: &quot;prometheus&quot;
static_configs:
- targets: [&quot;localhost:9090&quot;]
- job_name: &quot;confignode&quot;
static_configs:
- targets: [&quot;localhost:9091&quot;, &quot;localhost:9092&quot;, &quot;localhost:9093&quot;]
honor_labels: true
- job_name: &quot;datanode&quot;
static_configs:
- targets: [&quot;localhost:9094&quot;, &quot;localhost:9095&quot;, &quot;localhost:9096&quot;]
honor_labels: true
</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 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 class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><ol start="3"><li>启动Promethues。Prometheus 监控数据的默认过期时间为 15d。在生产环境中,建议将其调整为 180d 以上,以对更长时间的历史监控数据进行追踪,启动命令如下所示:</li></ol><div class="language-Shell line-numbers-mode" data-ext="Shell" data-title="Shell"><pre class="language-Shell"><code>./prometheus --config.file=prometheus.yml --storage.tsdb.retention.time=180d
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div>`,21),v={start:"4"},D={href:"http://localhost:9090",target:"_blank",rel:"noopener noreferrer"},y=i(`<p><img src="https://alioss.timecho.com/docs/img/1a.PNG" alt="" loading="lazy"><br><img src="https://alioss.timecho.com/docs/img/2a.PNG" alt="" loading="lazy"></p><h2 id="_1-3-使用-grafana-查看监控数据" tabindex="-1"><a class="header-anchor" href="#_1-3-使用-grafana-查看监控数据"><span>1.3 使用 Grafana 查看监控数据</span></a></h2><h3 id="_1-3-1-step1-grafana-安装、配置与启动" tabindex="-1"><a class="header-anchor" href="#_1-3-1-step1-grafana-安装、配置与启动"><span>1.3.1 Step1:Grafana 安装、配置与启动</span></a></h3><ol><li>下载Grafana的二进制包到本地,解压后进入对应文件夹:</li></ol><div class="language-Shell line-numbers-mode" data-ext="Shell" data-title="Shell"><pre class="language-Shell"><code>tar -zxvf grafana-*.tar.gz
cd grafana-*
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><ol start="2"><li>启动Grafana并进入:</li></ol><div class="language-Shell line-numbers-mode" data-ext="Shell" data-title="Shell"><pre class="language-Shell"><code>./bin/grafana-server web
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div>`,7),T={start:"3"},k={href:"http://localhost:3000",target:"_blank",rel:"noopener noreferrer"},B=e("li",null,"首先我们在 Configuration 中配置 Data Source Prometheus",-1),x=i('<figure><img src="https://alioss.timecho.com/docs/img/3a.png" alt="" tabindex="0" loading="lazy"><figcaption></figcaption></figure><ol start="5"><li>在配置 Data Source 时注意 Prometheus 所在的URL,配置好后点击Save &amp; Test 出现 Data source is working 提示则为配置成功</li></ol><figure><img src="https://alioss.timecho.com/docs/img/4a.png" alt="" tabindex="0" loading="lazy"><figcaption></figcaption></figure><h3 id="_1-3-2-step2-导入-iotdb-监控看板" tabindex="-1"><a class="header-anchor" href="#_1-3-2-step2-导入-iotdb-监控看板"><span>1.3.2 Step2:导入 IoTDB 监控看板</span></a></h3><ol><li>进入 Grafana,选择 Dashboards 的 Browse</li></ol><figure><img src="https://alioss.timecho.com/docs/img/5a.png" alt="" tabindex="0" loading="lazy"><figcaption></figcaption></figure><ol start="2"><li>点击右侧 Import 按钮</li></ol><figure><img src="https://alioss.timecho.com/docs/img/6a.png" alt="" tabindex="0" loading="lazy"><figcaption></figcaption></figure><ol start="3"><li>选择一种方式导入 Dashboard<br> a. 上传本地已下载的 Dashboard 的 Json 文件<br> b. 将 Dashboard 的 Json 文件内容直接粘贴进入</li></ol><figure><img src="https://alioss.timecho.com/docs/img/7a.png" alt="" tabindex="0" loading="lazy"><figcaption></figcaption></figure><ol><li>选择 Dashboard 的 Prometheus 为刚刚配置好的 Data Source,然后点击 Import</li></ol><figure><img src="https://alioss.timecho.com/docs/img/8a.png" alt="" tabindex="0" loading="lazy"><figcaption></figcaption></figure><ol start="5"><li>之后进入 Apache ConfigNode Dashboard,就看到如下的监控面板</li></ol><figure><img src="https://alioss.timecho.com/docs/img/confignode.png" alt="" tabindex="0" loading="lazy"><figcaption></figcaption></figure><ol start="6"><li>同样,我们可以导入 Apache DataNode Dashboard,看到如下的监控面板:</li></ol><figure><img src="https://alioss.timecho.com/docs/img/datanode.png" alt="" tabindex="0" loading="lazy"><figcaption></figcaption></figure><ol start="7"><li>同样,我们可以导入 Apache Performance Overview Dashboard,看到如下的监控面板:</li></ol><figure><img src="https://alioss.timecho.com/docs/img/performance.png" alt="" tabindex="0" loading="lazy"><figcaption></figcaption></figure><ol start="8"><li>同样,我们可以导入 Apache System Overview Dashboard,看到如下的监控面板:</li></ol><figure><img src="https://alioss.timecho.com/docs/img/system.png" alt="" tabindex="0" loading="lazy"><figcaption></figcaption></figure><h3 id="_1-3-3-step3-创建新的-dashboard-进行数据可视化" tabindex="-1"><a class="header-anchor" href="#_1-3-3-step3-创建新的-dashboard-进行数据可视化"><span>1.3.3 Step3:创建新的 Dashboard 进行数据可视化</span></a></h3><ol><li>首先创建Dashboard,然后创建Panel</li></ol><figure><img src="https://alioss.timecho.com/docs/img/11a.png" alt="" tabindex="0" loading="lazy"><figcaption></figcaption></figure><ol start="2"><li>之后就可以在面板根据自己的需求对监控相关的数据进行可视化(所有相关的监控指标可以先在job中选择confignode/datanode筛选)</li></ol><figure><img src="https://alioss.timecho.com/docs/img/12a.png" alt="" tabindex="0" loading="lazy"><figcaption></figcaption></figure><ol start="3"><li>选择关注的监控指标可视化完成后,我们就得到了这样的面板:</li></ol><figure><img src="https://alioss.timecho.com/docs/img/13a.png" alt="" tabindex="0" loading="lazy"><figcaption></figcaption></figure>',27);function I(N,S){const t=s("ExternalLinkIcon");return l(),r("div",null,[c,e("ol",null,[e("li",null,[a("IoTDB:1.0 版本及以上,可以前往官网下载:"),e("a",p,[a("https://iotdb.apache.org/Download/"),o(t)])]),e("li",null,[a("Prometheus:2.30.3 版本及以上,可以前往官网下载:"),e("a",h,[a("https://prometheus.io/download/"),o(t)])]),e("li",null,[a("Grafana:8.4.2 版本及以上,可以前往官网下载:"),e("a",g,[a("https://grafana.com/grafana/download"),o(t)])]),m]),u,e("ol",f,[e("li",null,[a("在浏览器进入"),e("a",b,[a("http://localhost:9091/metrics网址,可以查看到如下的监控项信息:"),o(t)])])]),_,e("ol",v,[e("li",null,[a("确认启动成功。在浏览器中输入 "),e("a",D,[a("http://localhost:9090"),o(t)]),a(",进入Prometheus,点击进入Status下的Target界面(如下图1),当看到State均为Up时表示配置成功并已经联通(如下图2),点击左侧链接可以跳转到网页监控。")])]),y,e("ol",T,[e("li",null,[a("在浏览器中输入 "),e("a",k,[a("http://localhost:3000"),o(t)]),a(",进入Grafana,默认初始用户名和密码均为 admin。")]),B]),x])}const A=n(d,[["render",I],["__file","Monitoring-Board-Install-and-Deploy.html.vue"]]),E=JSON.parse('{"path":"/zh/UserGuide/latest/Deployment-and-Maintenance/Monitoring-Board-Install-and-Deploy.html","title":"1. 监控面板安装部署","lang":"zh-CN","frontmatter":{"description":"1. 监控面板安装部署 从 IoTDB 1.0 版本开始,我们引入了系统监控模块,可以完成对 IoTDB 的重要运行指标进行监控,本文介绍了如何在 IoTDB 分布式开启系统监控模块,并且使用 Prometheus + Grafana 的方式完成对系统监控指标的可视化。 1.1 前期准备 1.1.1 软件要求 IoTDB:1.0 版本及以上,可以前往官...","head":[["link",{"rel":"alternate","hreflang":"en-us","href":"https://iotdb.apache.org/UserGuide/latest/Deployment-and-Maintenance/Monitoring-Board-Install-and-Deploy.html"}],["meta",{"property":"og:url","content":"https://iotdb.apache.org/zh/UserGuide/latest/Deployment-and-Maintenance/Monitoring-Board-Install-and-Deploy.html"}],["meta",{"property":"og:site_name","content":"IoTDB Website"}],["meta",{"property":"og:title","content":"1. 监控面板安装部署"}],["meta",{"property":"og:description","content":"1. 监控面板安装部署 从 IoTDB 1.0 版本开始,我们引入了系统监控模块,可以完成对 IoTDB 的重要运行指标进行监控,本文介绍了如何在 IoTDB 分布式开启系统监控模块,并且使用 Prometheus + Grafana 的方式完成对系统监控指标的可视化。 1.1 前期准备 1.1.1 软件要求 IoTDB:1.0 版本及以上,可以前往官..."}],["meta",{"property":"og:type","content":"article"}],["meta",{"property":"og:image","content":"https://spricoder.oss-cn-shanghai.aliyuncs.com/Apache%20IoTDB/metric/cluster-introduce/1.png"}],["meta",{"property":"og:locale","content":"zh-CN"}],["meta",{"property":"og:locale:alternate","content":"en-US"}],["meta",{"property":"og:updated_time","content":"2024-04-08T07:45:55.000Z"}],["meta",{"property":"article:modified_time","content":"2024-04-08T07:45:55.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"1. 监控面板安装部署\\",\\"image\\":[\\"https://spricoder.oss-cn-shanghai.aliyuncs.com/Apache%20IoTDB/metric/cluster-introduce/1.png\\",\\"https://spricoder.oss-cn-shanghai.aliyuncs.com/Apache%20IoTDB/metric/cluster-introduce/2.png\\",\\"https://spricoder.oss-cn-shanghai.aliyuncs.com/Apache%20IoTDB/metric/cluster-introduce/3.png\\",\\"https://spricoder.oss-cn-shanghai.aliyuncs.com/Apache%20IoTDB/metric/cluster-introduce/4.png\\",\\"https://alioss.timecho.com/docs/img/1a.PNG\\",\\"https://alioss.timecho.com/docs/img/2a.PNG\\",\\"https://alioss.timecho.com/docs/img/3a.png\\",\\"https://alioss.timecho.com/docs/img/4a.png\\",\\"https://alioss.timecho.com/docs/img/5a.png\\",\\"https://alioss.timecho.com/docs/img/6a.png\\",\\"https://alioss.timecho.com/docs/img/7a.png\\",\\"https://alioss.timecho.com/docs/img/8a.png\\",\\"https://alioss.timecho.com/docs/img/confignode.png\\",\\"https://alioss.timecho.com/docs/img/datanode.png\\",\\"https://alioss.timecho.com/docs/img/performance.png\\",\\"https://alioss.timecho.com/docs/img/system.png\\",\\"https://alioss.timecho.com/docs/img/11a.png\\",\\"https://alioss.timecho.com/docs/img/12a.png\\",\\"https://alioss.timecho.com/docs/img/13a.png\\"],\\"dateModified\\":\\"2024-04-08T07:45:55.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"1.1 前期准备","slug":"_1-1-前期准备","link":"#_1-1-前期准备","children":[{"level":3,"title":"1.1.1 软件要求","slug":"_1-1-1-软件要求","link":"#_1-1-1-软件要求","children":[]},{"level":3,"title":"1.1.2 启动 ConfigNode","slug":"_1-1-2-启动-confignode","link":"#_1-1-2-启动-confignode","children":[]},{"level":3,"title":"1.1.3 启动 DataNode","slug":"_1-1-3-启动-datanode","link":"#_1-1-3-启动-datanode","children":[]},{"level":3,"title":"1.1.4 说明","slug":"_1-1-4-说明","link":"#_1-1-4-说明","children":[]}]},{"level":2,"title":"1.2 配置 Prometheus 采集监控指标","slug":"_1-2-配置-prometheus-采集监控指标","link":"#_1-2-配置-prometheus-采集监控指标","children":[]},{"level":2,"title":"1.3 使用 Grafana 查看监控数据","slug":"_1-3-使用-grafana-查看监控数据","link":"#_1-3-使用-grafana-查看监控数据","children":[{"level":3,"title":"1.3.1 Step1:Grafana 安装、配置与启动","slug":"_1-3-1-step1-grafana-安装、配置与启动","link":"#_1-3-1-step1-grafana-安装、配置与启动","children":[]},{"level":3,"title":"1.3.2 Step2:导入 IoTDB 监控看板","slug":"_1-3-2-step2-导入-iotdb-监控看板","link":"#_1-3-2-step2-导入-iotdb-监控看板","children":[]},{"level":3,"title":"1.3.3 Step3:创建新的 Dashboard 进行数据可视化","slug":"_1-3-3-step3-创建新的-dashboard-进行数据可视化","link":"#_1-3-3-step3-创建新的-dashboard-进行数据可视化","children":[]}]}],"git":{"createdTime":1692104943000,"updatedTime":1712562355000,"contributors":[{"name":"CritasWang","email":"critas@outlook.com","commits":1},{"name":"ZhangHongYin","email":"46039728+SpriCoder@users.noreply.github.com","commits":1},{"name":"wanghui42","email":"105700158+wanghui42@users.noreply.github.com","commits":1}]},"readingTime":{"minutes":4.63,"words":1390},"filePathRelative":"zh/UserGuide/latest/Deployment-and-Maintenance/Monitoring-Board-Install-and-Deploy.md","localizedDate":"2023年8月15日","autoDesc":true}');export{A as comp,E as data};