成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

從零到一:GreptimeDB 與 Grafana 的無縫集成指南

開發(fā) 前端 其他數(shù)據(jù)庫
我想著怎么給 GreptimeDB 弄一個自定義的存儲,因為它的這個 控制器 創(chuàng)建完成后,就會自動創(chuàng)建?PV?和?PVC?然后掛載,10G?的存儲,但是我想要自定義,如下?YAML。

引言

我們的上一篇文章中講解到了 Prometheus-Agent + GreptimeDB,當時最大的問題是使用 GreptimeDB 作為 Grafana 的數(shù)據(jù)源,然后去看 Dashboard 有很多的都沒有數(shù)據(jù),如下圖所示

圖片圖片

當時文章一經(jīng)發(fā)出,就收到了來自 GreptimeDB[1] 官方人員的注意,隨后,我們經(jīng)過進一步的交流,如下圖所示

圖片圖片

圖片圖片

隨后,我們進入群聊

圖片圖片

圖片圖片

以下的這部分算是 get 到了終點,但是當時并沒有立刻采取行動

圖片圖片

圖片圖片

圖片圖片

圖片圖片

圖片圖片

到了后面,我想著怎么給 GreptimeDB 弄一個自定義的存儲,因為它的這個 控制器 創(chuàng)建完成后,就會自動創(chuàng)建 PV 和 PVC 然后掛載,10G 的存儲,但是我想要自定義,如下 YAML。

apiVersion: greptime.io/v1alpha1
kind: GreptimeDBStandalone
metadata:
  name: greptimedb
  namespace: greptimedb-admin
spec:
  base:
    main:
      image: greptime/greptimedb:v0.11.2
     # resources:
     #   limits:
     #     cpu: "1"       # 最大可使用的 2 個 CPU
     #     memory: "1Gi"  # 最大可使用 4GB 內(nèi)存
     #   requests:
     #     cpu: "1"       # 最少需要 1 個 CPU
     #     memory: "1Gi"  # 最少需要 2GB 內(nèi)存
  datanodeStorage:   # 我這里沒有定義 StorageClassName 是因為它會去使用 default 的
    fs:
      mountPath: "/data/greptimedb"
      name: "greptimedb-storage"
      storageRetainPolicy: "Retain" # 數(shù)據(jù)卷策略
      storageSize: "30Gi"

然后我們部署看看;

jacobleo@Jacobs-MacBook-Air greptimedb % kg pvc -A
NAMESPACE          NAME                                         STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS   VOLUMEATTRIBUTESCLASS   AGE
greptimedb-admin   greptimedb-storage-greptimedb-standalone-0   Bound    pvc-160dd148-b272-439f-b8e1-f480def01bfc   30Gi       RWO            local-path     <unset>                 36s
monitoring         grafana-pvc                                  Bound    pvc-5cd3dc87-bda9-45aa-b02c-f54112b49a2b   30Gi       RWO            local-path     <unset>                 5h3m
monitoring         prometheus-k8s-db-prometheus-k8s-0           Bound    pvc-e6daef05-4ff1-42bf-b4f0-2b459d3a6f12   1Gi        RWO            local-path     <unset>                 5h2m
monitoring         prometheus-k8s-db-prometheus-k8s-1           Bound    pvc-e294d11d-4099-4ba8-ade8-24eed34f79de   1Gi        RWO            local-path     <unset>                 5h2m

可以看到是 30G,并沒有我們上面說的那個問題,原來是我搞錯了,我們下面這個關(guān)于存儲的問題就解決了。

圖片圖片

圖片圖片

這邊當時也挺搞笑的,哈哈!

圖片圖片

圖片圖片

圖片圖片

圖片圖片

圖片圖片

圖片圖片

圖片圖片

圖片圖片

圖片圖片

圖片圖片

圖片圖片

我們這里添加下:

這里添加就 work 了,然后如果還有更多的,就繼續(xù)添加就可以了。

·····
  externalLabels:
    cluster: "cluster-test"
·····

圖片圖片

可以看到,終于有數(shù)據(jù)了。

圖片圖片

但是這又有一個問題,其實還有很多像這樣類似的問題,大致解決,和上面的是一樣的思路。

圖片圖片

我們添加下就可以了。

·····
  externalLabels:
    cluster: "cluster-test"
    workload_type: "deployment, stateful"
·····

弄了半天,還是不行,在此希望有大佬出主意,非常感謝,作為回報,我會把你記在心里!

可以看下我們最終的 YAML 文件;

apiVersion: v1
kind: ServiceAccount
metadata:
  name: prometheus-agent
  namespace: greptimedb-admin
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: prometheus-agent
rules:
  - apiGroups: [""]
    resources:
      - namespaces
      - secrets
      - persistentvolumeclaims
    verbs: ["get", "list", "watch"]
  - apiGroups: ["monitoring.coreos.com"]
    resources: ["servicemonitors", "podmonitors", "prometheuses"]
    verbs: ["get", "list", "watch"]
  - apiGroups: [""]
    resources:
      - nodes
      - nodes/metrics
      - services
      - endpoints
      - pods
    verbs: ["get", "list", "watch"]
  - apiGroups: [""]
    resources:
      - configmaps
    verbs: ["get"]
  - apiGroups:
      - discovery.k8s.io
    resources:
      - endpointslices
    verbs: ["get", "list", "watch"]
  - apiGroups:
      - networking.k8s.io
    resources:
      - ingresses
    verbs: ["get", "list", "watch"]
  - nonResourceURLs: ["/metrics"]
    verbs: ["get"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: prometheus-agent
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: prometheus-agent
subjects:
  - kind: ServiceAccount
    name: prometheus-agent
    namespace: greptimedb-admin
---
apiVersion: monitoring.coreos.com/v1alpha1
kind: PrometheusAgent
metadata:
  name: prometheus-agent
  namespace: greptimedb-admin
spec:
  image: quay.io/prometheus/prometheus:v3.0.1
  replicas: 1
  serviceAccountName: prometheus-agent
  enableFeatures: 
    - agent
  remoteWrite:
    - url: "http://greptimedb.kubernetes.click/v1/prometheus/write?db=public"
      queueConfig:
        capacity: 5000
        maxSamplesPerSend: 10000
        batchSendDeadline: 5s
  serviceMonitorSelector: {}
  serviceMonitorNamespaceSelector: {}
  podMonitorNamespaceSelector: {}
  podMonitorSelector: {}
  resources:
    limits:
      cpu: "2"
      memory: "4Gi"
    requests:
      cpu: "1"
      memory: "2Gi"
  externalLabels:
    cluster: "cluster-test"
    workload_type: "deployment, stateful"

結(jié)語

這個問題,還可以,不算是特別過分吧,還是跌虧有 GreptimeDB 的相關(guān)人員,不然,這個問題怎么解決?

那么我們的 Prometheus-Agent + GreptimeDB 算是不是很圓滿地結(jié)束了,但是后面大概還會又些小問題,不過都是小事了。

引用鏈接

[1] GreptimeDB: https://greptime.com/

責任編輯:武曉燕 來源: 云原生運維圈
相關(guān)推薦

2021-10-28 07:10:21

rollupPlugin插件編寫

2020-09-08 18:37:49

TypeScript開發(fā)前端

2023-11-17 12:11:26

GORMGo Web

2021-07-12 07:33:31

Nacos微服務(wù)管理

2023-04-06 08:01:30

RustMutex

2024-11-25 09:10:03

2023-12-08 09:00:00

2023-08-01 09:00:00

高并發(fā)性能優(yōu)化

2024-02-26 07:31:26

WindowsLinuxmacOS

2013-12-18 13:30:19

Linux運維Linux學(xué)習(xí)Linux入門

2021-08-07 21:51:17

服務(wù)器網(wǎng)站部署

2023-01-12 22:00:48

2024-04-26 08:17:09

GoGoogle項目

2025-06-23 10:20:00

開源機器學(xué)習(xí)PyTorch

2024-06-12 09:06:48

2021-06-30 07:51:09

新項目領(lǐng)域建模

2025-04-02 07:30:37

LLMDify應(yīng)用

2022-02-13 23:00:48

前端微前端qiankun

2013-11-26 17:38:03

ArrayFusionCube

2023-12-28 08:16:32

Spring容器管理
點贊
收藏

51CTO技術(shù)棧公眾號

主站蜘蛛池模板: 亚洲色图综合 | 99亚洲精品视频 | a级黄色片视频 | 亚洲成人毛片 | 一区二区影视 | 免费日韩av网站 | 99在线播放 | 黄网站在线播放 | 爱草在线 | 欧美一a一片一级一片 | www.亚洲成人网 | 亚洲欧美日韩在线 | 国产福利在线小视频 | 欧产日产国产精品99 | 不卡视频一区 | 一区二区三区成人 | 人人澡人人爱 | 久久综合狠狠综合久久综合88 | 国产成人99久久亚洲综合精品 | 精品国产1区2区3区 一区二区手机在线 | 91精品在线播放 | 91网在线观看 | 一区二区中文字幕 | 国产精品日韩一区二区 | 欧产日产国产精品国产 | 国产视频线观看永久免费 | 国产欧美一区二区三区在线看 | 在线色| 波多野结衣一二三区 | 中文字幕亚洲视频 | 狠狠的操 | 午夜丰满寂寞少妇精品 | 亚洲国产成人久久综合一区,久久久国产99 | 牛牛热在线视频 | 国产综合一区二区 | 亚洲精品乱码久久久久v最新版 | 秋霞电影院午夜伦 | 国产线视频精品免费观看视频 | 欧美日韩综合一区 | 99国产精品久久久久老师 | 欧美日韩成人在线 |