{"id":234022,"date":"2022-01-21T09:19:12","date_gmt":"2022-01-21T01:19:12","guid":{"rendered":"https:\/\/gulass.cn\/?p=234022"},"modified":"2022-01-08T18:20:16","modified_gmt":"2022-01-08T10:20:16","slug":"victoriametrics","status":"publish","type":"post","link":"https:\/\/gulass.cn\/victoriametrics.html","title":{"rendered":"VictoriaMetrics\u5982\u4f55\u8fd0\u7528\uff1f"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u4e0a\u6b21\u8bf4\u5230\u6211\u4eec\u4e0d\u7528docker\uff0c\u800c\u662f\u4f7f\u7528containerd\u4f5c\u4e3aCRI\u4e86\u3002\u6ca1\u60f3\u5230\uff0c\u8fde\u76d1\u63a7\u544a\u8b66\u8fd9\u4e00\u5757\u4e5f\u6362\u4e86\u3002\u4ee5\u524d\u6211\u4eec\u4f7f\u7528\u7684prometheus\u8fdb\u884c\u76d1\u63a7\u6570\u636e\u7684\u91c7\u96c6\u3001\u5b58\u50a8\u548c\u63d0\u4f9b\u67e5\u8be2\uff0calertmanager\u8fdb\u884c\u544a\u8b66\u63a8\u9001\uff0c\u540c\u65f6\u4f7f\u7528\u4e86grafana\u505a\u6570\u636e\u5c55\u793a\u3002\u90a3\u4e48\u73b0\u5728\u5462\uff0c\u6211\u4eec\u9009\u62e9\u4f7f\u7528OpenTelemetry\u548cVictoriaMetrics\u3002\u90a3\u4e48\u8fd9\u4e24\u8005\u7a76\u7adf\u662f\u4f55\u65b9\u795e\u5723\u5462?\u8bf7\u5141\u8bb8\u6211\u6162\u6162\u9053\u6765\u3002\u8003\u8651\u5230\u6211\u4e5f\u662f\u521a\u63a5\u89e6\uff0c\u6240\u4ee5\u4eca\u5929\u5148\u7ed9\u5927\u5bb6\u4ecb\u7ecd\u4e00\u4e0bVictoriaMetrics\u3002OpenTelemetry\u540e\u7eed\u518d\u505a\u4ecb\u7ecd\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u4e0a\u6b21\u8bf4\u5230\u6211\u4eec\u4e0d\u7528docker\uff0c\u800c\u662f\u4f7f\u7528containerd\u4f5c\u4e3aCRI\u4e86\u3002\u6ca1\u60f3\u5230\uff0c\u8fde\u76d1\u63a7\u544a\u8b66\u8fd9\u4e00\u5757\u4e5f\u6362\u4e86\u3002\u4ee5\u524d\u6211\u4eec\u4f7f\u7528\u7684prometheus\u8fdb\u884c\u76d1\u63a7\u6570\u636e\u7684\u91c7\u96c6\u3001\u5b58\u50a8\u548c\u63d0\u4f9b\u67e5\u8be2\uff0calertmanager\u8fdb\u884c\u544a\u8b66\u63a8\u9001\uff0c\u540c\u65f6\u4f7f\u7528\u4e86grafana\u505a\u6570\u636e\u5c55\u793a\u3002\u90a3\u4e48\u73b0\u5728\u5462\uff0c\u6211\u4eec\u9009\u62e9\u4f7f\u7528OpenTelemetry\u548cVictoriaMetrics\u3002\u90a3\u4e48\u8fd9\u4e24\u8005\u7a76\u7adf\u662f\u4f55\u65b9\u795e\u5723\u5462?\u8bf7\u5141\u8bb8\u6211\u6162\u6162\u9053\u6765\u3002\u8003\u8651\u5230\u6211\u4e5f\u662f\u521a\u63a5\u89e6\uff0c\u6240\u4ee5\u4eca\u5929\u5148\u7ed9\u5927\u5bb6\u4ecb\u7ecd\u4e00\u4e0bVictoriaMetrics\u3002OpenTelemetry\u540e\u7eed\u518d\u505a\u4ecb\u7ecd\u3002<\/p>\n

\u6ce8\uff1a\u540e\u7eedVictoriaMetrics\u7b80\u79f0\u4e3avm<\/p>\n

\u4ec0\u4e48\u662fVM<\/strong><\/div>\n

\u8fd9\u91cc\u6211\u4eec\u770b\u5b98\u7f51\u7684\u63cf\u8ff0\u3002\u5982\u4e0b\uff1a<\/p>\n

    \n
  1. VictoriaMetrics\u00a0is<\/span>\u00a0a\u00a0fast,\u00a0cost-effective\u00a0and<\/span>\u00a0scalable\u00a0monitoring\u00a0solution<\/li>\n
  2. and<\/span>\u00a0time<\/span>\u00a0series\u00a0database<\/span><\/li>\n<\/ol>\n

    \u7ffb\u8bd1\u8fc7\u6765\u5c31\u662f\u8bf4\uff0cvm\u662f\u4e00\u4e2a\u5feb\u901f\u3001\u5b9e\u7528\u548c\u53ef\u6269\u5c55\u7684\u76d1\u63a7\u65b9\u6848\u548c\u65f6\u5e8f\u6570\u636e\u5e93\u3002\u601d\u8003\u4e00\u4e0b\uff1aprometheus\u4e5f\u662f\u65f6\u5e8f\u6570\u636e\u5e93\uff0c\u4e24\u8005\u4f1a\u4e0d\u4f1a\u6709\u4ec0\u4e48\u4e0d\u4e00\u6837\u5462?<\/p>\n

    VM\u7279\u6027<\/strong><\/div>\n

    \u8981\u8bf4vm\u7684\u7279\u6027\uff0c\u53ef\u592a\u591a\u4e86\u3002\u4e3e\u51e0\u4e2a\u4f8b\u5b50\uff1a<\/p>\n

      \n
    1. \u53ef\u4ee5\u4f5c\u4e3aprometheus\u957f\u671f\u5b58\u50a8\u7684\u4e00\u4e2a\u65b9\u6848\u3002\u6211\u4eec\u77e5\u9053prometheus\u9ed8\u8ba4\u53ea\u4f1a\u4fdd\u7559\u6700\u8fd115\u5929\u7684\u6570\u636e\uff0c\u5982\u679c\u8981\u4fdd\u7559\u66f4\u957f\u65f6\u95f4\u7684\u6570\u636e\uff0c\u9700\u8981\u628a\u6570\u636e\u5199\u5230\u8fdc\u7aef\u5b58\u50a8\u4e2d\u53bb<\/li>\n
    2. \u5f53\u4f7f\u7528grafana\u65f6\uff0c\u53ef\u4ee5\u628a\u5176\u6570\u636e\u6e90prometheus\u53ef\u4ee5\u88ab\u66ff\u6362\u4e3avm\uff0c\u56e0\u4e3avm\u4e5f\u652f\u6301prometheus\u67e5\u8be2APi<\/li>\n
    3. \u5b83\u5b9e\u73b0\u4e86\u57fa\u4e8ePromQL\u7684\u67e5\u8be2\u8bed\u8a00\uff0c\u5373MetricsQL\uff0c\u5e76\u4e14\u5728PromQL\u57fa\u7840\u4e0a\u505a\u4e86\u6539\u8fdb<\/li>\n
    4. \u5728\u5904\u7406\u767e\u4e07\u6bd4\u522b\u6570\u636e\u65f6\uff0c\u4f7f\u7528\u5185\u5b58\u8d44\u6e90\u6bd4Thanos\u3001Promtheus\u66f4\u5c11<\/li>\n
    5. ...<\/li>\n<\/ol>\n
      VM\u7ec4\u4ef6<\/strong><\/div>\n

      \u90a3\u4e48vm\u6709\u54ea\u4e9b\u7ec4\u4ef6\u5462\uff0c(cluster)\u67b6\u6784\u53c8\u662f\u600e\u4e48\u6837\u7684\u5462?<\/p>\n

      \"\"<\/p>\n

      \u4e3b\u8981\u7ec4\u4ef6\u8bf4\u660e\uff1a<\/p>\n

        \n
      • vmstorage\u8d1f\u8d23\u5b58\u50a8\u65f6\u5e8f\u6570\u636e\u4ee5\u53ca\u63d0\u4f9b\u67e5\u8be2<\/li>\n
      • vmselect\u4ecevmstorage\u83b7\u53d6\u6570\u636e\u8fd4\u56de\u7ed9\u67e5\u8be2\u6570\u636e\u7684\u5ba2\u6237\u7aef\uff0c\u652f\u6301PromeQL<\/li>\n
      • vminsert\u901a\u8fc7remote write API\u5c06\u6570\u636e\u5b58\u50a8\u5230vmstorage<\/li>\n<\/ul>\n

        \u5176\u4ed6\u7ec4\u4ef6\u8bf4\u660e\uff1a<\/p>\n

          \n
        • vmui\u63d0\u4f9b\u4e86\u4e00\u4e2aUI\u4f9b\u67e5\u8be2\u6570\u636e\u548c\u95ee\u9898\u6392\u67e5<\/li>\n
        • vmalert\u7528\u6237\u544a\u8b66<\/li>\n
        • vmagent\u7528\u6237\u6570\u636e\u91c7\u96c6<\/li>\n
        • vmbackup\u7528\u4e8e\u6570\u636e\u5907\u4efd<\/li>\n
        • vmrestore\u7528\u4e8e\u6570\u636e\u6062\u590d<\/li>\n
        • ...<\/li>\n<\/ul>\n
          VM\u5b89\u88c5\u6ce8\u610f\u4e8b\u9879<\/strong><\/div>\n

          vm\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u5f0f\u5b89\u88c5\uff0c\u5982\u4e8c\u8fdb\u5236\u3001docker\u955c\u50cf\u4ee5\u53ca\u6e90\u7801\u3002\u53ef\u6839\u636e\u573a\u666f\u8fdb\u884c\u9009\u62e9\u3002\u5982\u679c\u5728k8s\u4e2d\u8fdb\u884c\u5b89\u88c5\uff0c\u6211\u4eec\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528operator\u6765\u8fdb\u884c\u5b89\u88c5\u3002\u4e0b\u9762\u91cd\u70b9\u8bf4\u4e00\u4e0b\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u7684\u4e00\u4e9b\u6ce8\u610f\u4e8b\u9879\u3002<\/p>\n

          \u4e00\u4e2a\u6700\u5c0f\u7684\u96c6\u7fa4\u5fc5\u987b\u5305\u542b\u4ee5\u4e0b\u8282\u70b9\uff1a<\/p>\n

            \n
          • \u4e00\u4e2avmstorage\u5355\u8282\u70b9\uff0c\u53e6\u5916\u8981\u6307\u5b9a-retentionPeriod\u548c-storageDataPath\u4e24\u4e2a\u53c2\u6570<\/li>\n
          • \u4e00\u4e2avminsert\u5355\u8282\u70b9\uff0c\u8981\u6307\u5b9a-storageNode=<\/li>\n
          • \u4e00\u4e2avmselect\u5355\u8282\u70b9\uff0c\u8981\u6307\u5b9a-storageNode=<\/li>\n<\/ul>\n

            \u6ce8\uff1a\u9ad8\u53ef\u7528\u60c5\u51b5\u4e0b\uff0c\u5efa\u8bae\u6bcf\u4e2a\u670d\u52a1\u81f3\u5c11\u6709\u4e2a\u4e24\u4e2a\u8282\u70b9<\/p>\n

            \u5728vmselect\u548cvminsert\u524d\u9762\u9700\u8981\u4e00\u4e2a\u8d1f\u8f7d\u5747\u8861\uff0c\u6bd4\u5982vmauth\u3001nginx\uff0c\u540c\u65f6\u8981\u6c42\uff1a<\/p>\n

              \n
            • \u4ee5\/insert\u5f00\u5934\u7684\u8bf7\u6c42\u5fc5\u987b\u8981\u88ab\u8def\u7531\u5230vminsert\u8282\u70b9\u76848480\u7aef\u53e3<\/li>\n
            • \u4ee5\/select\u5f00\u5934\u7684\u8bf7\u6c42\u5fc5\u987b\u8981\u88ab\u8def\u7531\u5230vmselect\u8282\u70b9\u76848481\u7aef\u53e3<\/li>\n<\/ul>\n

              \u6ce8\uff1a\u5404\u670d\u52a1\u7684\u7aef\u53e3\u53ef\u4ee5\u901a\u8fc7-httpListenAddr\u8fdb\u884c\u6307\u5b9a<\/p>\n

              \u5efa\u8bae\u4e3a\u96c6\u7fa4\u5b89\u88c5\u76d1\u63a7<\/p>\n

              \u5982\u679c\u662f\u5728\u4e00\u4e2a\u4e3b\u673a\u4e0a\u8fdb\u884c\u5b89\u88c5\u6d4b\u8bd5\u96c6\u7fa4\uff0cvminsert\u3001vmselect\u548cvmstorage\u5404\u81ea\u7684-httpListenAddr\u53c2\u6570\u5fc5\u987b\u552f\u4e00\uff0cvmstorage\u7684-storageDataPath\u3001-vminsertAddr\u3001-vmselectAddr\u8fd9\u51e0\u4e2a\u53c2\u6570\u5fc5\u987b\u6709\u552f\u4e00\u7684\u503c\u3002<\/p>\n

              \u5f53vmstorage\u901a\u8fc7-storageDataPath\u76ee\u5f55\u5927\u5c0f\u5c0f\u4e8e\u901a\u8fc7-storage.minFreeDiskSpaceBytes\u6307\u5b9a\u7684\u53ef\u7528\u7a7a\u95f4\u65f6\uff0c\u4f1a\u5207\u6362\u5230\u53ea\u8bfb\u6a21\u5f0f;vminsert\u505c\u6b62\u5411\u8fd9\u7c7b\u8282\u70b9\u53d1\u9001\u6570\u636e\uff0c\u8f6c\u800c\u5c06\u6570\u636e\u53d1\u9001\u5230\u5176\u4ed6\u53ef\u7528vmstorage\u8282\u70b9\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

              \u4e0a\u6b21\u8bf4\u5230\u6211\u4eec\u4e0d\u7528docker\uff0c\u800c\u662f\u4f7f\u7528containerd\u4f5c\u4e3aCRI\u4e86\u3002\u6ca1\u60f3\u5230\uff0c\u8fde\u76d1\u63a7\u544a\u8b66\u8fd9\u4e00\u5757\u4e5f\u6362\u4e86\u3002\u4ee5\u524d\u6211 […]<\/p>\n","protected":false},"author":323,"featured_media":225922,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-234022","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/234022","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/users\/323"}],"replies":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/comments?post=234022"}],"version-history":[{"count":5,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/234022\/revisions"}],"predecessor-version":[{"id":234034,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/234022\/revisions\/234034"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media\/225922"}],"wp:attachment":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media?parent=234022"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/categories?post=234022"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/tags?post=234022"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}