自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

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

開發(fā) 前端 其他數(shù)據(jù)庫
我想著怎么給 GreptimeDB 弄一個(gè)自定義的存儲(chǔ),因?yàn)樗倪@個(gè) 控制器 創(chuàng)建完成后,就會(huì)自動(dòng)創(chuàng)建?PV?和?PVC?然后掛載,10G?的存儲(chǔ),但是我想要自定義,如下?YAML。

引言

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

圖片圖片

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

圖片圖片

圖片圖片

隨后,我們進(jìn)入群聊

圖片圖片

圖片圖片

以下的這部分算是 get 到了終點(diǎn),但是當(dāng)時(shí)并沒有立刻采取行動(dòng)

圖片圖片

圖片圖片

圖片圖片

圖片圖片

圖片圖片

到了后面,我想著怎么給 GreptimeDB 弄一個(gè)自定義的存儲(chǔ),因?yàn)樗倪@個(gè) 控制器 創(chuàng)建完成后,就會(huì)自動(dòng)創(chuàng)建 PV 和 PVC 然后掛載,10G 的存儲(chǔ),但是我想要自定義,如下 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 個(gè) CPU
     #     memory: "1Gi"  # 最大可使用 4GB 內(nèi)存
     #   requests:
     #     cpu: "1"       # 最少需要 1 個(gè) CPU
     #     memory: "1Gi"  # 最少需要 2GB 內(nèi)存
  datanodeStorage:   # 我這里沒有定義 StorageClassName 是因?yàn)樗鼤?huì)去使用 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,并沒有我們上面說的那個(gè)問題,原來是我搞錯(cuò)了,我們下面這個(gè)關(guān)于存儲(chǔ)的問題就解決了。

圖片圖片

圖片圖片

這邊當(dāng)時(shí)也挺搞笑的,哈哈!

圖片圖片

圖片圖片

圖片圖片

圖片圖片

圖片圖片

圖片圖片

圖片圖片

圖片圖片

圖片圖片

圖片圖片

圖片圖片

我們這里添加下:

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

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

圖片圖片

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

圖片圖片

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

圖片圖片

我們添加下就可以了。

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

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

可以看下我們最終的 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é)語

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

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

引用鏈接

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

責(zé)任編輯:武曉燕 來源: 云原生運(yùn)維圈
相關(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ù)管理

2024-11-25 09:10:03

2023-04-06 08:01:30

RustMutex

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運(yùn)維Linux學(xué)習(xí)Linux入門

2021-08-07 21:51:17

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

2023-01-12 22:00:48

2013-11-26 17:38:03

ArrayFusionCube

2024-04-26 08:17:09

GoGoogle項(xiàng)目

2022-02-13 23:00:48

前端微前端qiankun

2024-06-12 09:06:48

2021-06-30 07:51:09

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

2025-04-02 07:30:37

LLMDify應(yīng)用

2023-12-28 08:16:32

Spring容器管理

2024-07-03 10:09:29

點(diǎn)贊
收藏

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