在Azure AKS群集中部署InfluxDB 2带有配置存储帐户

发布于 2025-02-03 00:13:57 字数 209 浏览 4 评论 0原文

我很难将InfluxDB2部署到我的Azure AKS群集中。我正在使用一个简单的存储帐户作为存储。查找influxdb豆荚:

** TS = 2021-11-26T00:43:44.126091Z lvl =错误msg =“失败应用SQL迁移” log_id = 0y2q〜WH0000错误=“数据库已锁定” **错误:数据库已锁定

I'm having trouble to deploy Influxdb2 into my Azure AKS Cluster. I'm using a simple storage account to serve as storage. Looking the influxdb pod:

** ts=2021-11-26T00:43:44.126091Z lvl=error msg=“Failed to apply SQL migrations” log_id=0Y2Q~wH0000 error=“database is locked”
** Error: database is locked

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不醒的梦 2025-02-10 00:13:57

我将PVC更改为使用CSI:

---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: sc-influxdb
  namespace: #{NAMESPACE}#
provisioner: file.csi.azure.com
allowVolumeExpansion: true
parameters:
  storageAccount: #{STORAGE_ACCOUNT_NAME}#
  location: #{STORAGE_ACCOUNT_LOCATION}#
  # Check driver parameters here:
  # https://github.com/kubernetes-sigs/azurefile-csi-driver/blob/master/docs/driver-parameters.md
reclaimPolicy: Delete
volumeBindingMode: Immediate
mountOptions:
  - dir_mode=0777
  - file_mode=0777
  - uid=0
  - gid=0
  - mfsymlinks
  - cache=strict  # https://linux.die.net/man/8/mount.cifs
  - nosharesock  # reduce probability of reconnect race
  - actimeo=30  # reduce latency for metadata-heavy workload
---
# Create a Secret to hold the name and key of the Storage Account
# Remember: values are base64 encoded
apiVersion: v1
kind: Secret
metadata:
  name: #{STORAGE_ACCOUNT_NAME}#
  namespace: #{NAMESPACE}#
type: Opaque
data:
  azurestorageaccountname: #{STORAGE_ACCOUNT_NAME_B64}#
  azurestorageaccountkey: #{STORAGE_ACCOUNT_KEY_B64}#

---
# Create a persistent volume, with the corresponding StorageClass and the reference to the Azure File secret.
# Remember: Create the share in the storage account otherwise the pods will fail with a "No such file or directory"
apiVersion: v1
kind: PersistentVolume
metadata:
  name: influxdb-pv
spec:
  capacity:
    storage: 5Ti
  accessModes:
  - ReadWriteMany
  persistentVolumeReclaimPolicy: Retain
  storageClassName: sc-influxdb
  claimRef:
    name: influxdb-pvc
    namespace: #{NAMESPACE}#
  azureFile:
    secretName: #{STORAGE_ACCOUNT_NAME}#
    secretNamespace: #{NAMESPACE}#
    shareName: influxdb
    readOnly: false
  mountOptions:
  - dir_mode=0777
  - file_mode=0777
  - uid=0
  - gid=0
  - mfsymlinks
  - cache=strict
  - nosharesock
  - nobrl

---
# Create a PersistentVolumeClaim referencing the StorageClass and the volume
# Remember: this is a static scenario. The volume was created in the previous step.
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: influxdb-pvc
  namespace: #{NAMESPACE}#
spec:
  accessModes:
    - ReadWriteMany  
  resources:
    requests:
      storage: 5Ti
  storageClassName: sc-influxdb
  volumeName: influxdb-pv

在我的值中,我将持久性定义为:

## Persist data to a persistent volume
##
persistence:
  enabled: true
  ## If true will use an existing PVC instead of creating one
  useExisting: true
  ## Name of existing PVC to be used in the influx deployment
  name: influxdb-pvc
  ## influxdb data Persistent Volume Storage Class
  ## If defined, storageClassName: <storageClass>
  ## If set to "-", storageClassName: "", which disables dynamic provisioning
  ## If undefined (the default) or set to null, no storageClassName spec is
  ##   set, choosing the default provisioner.  (gp2 on AWS, standard on
  ##   GKE, AWS & OpenStack)
  ##
  # storageClass: sc-influxdb
  size: 5Ti

要安装我:

helm upgrade --install influxdb influxdata/influxdb2 -n influxdb -f values.yml

I change my PVC to use CSI:

---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: sc-influxdb
  namespace: #{NAMESPACE}#
provisioner: file.csi.azure.com
allowVolumeExpansion: true
parameters:
  storageAccount: #{STORAGE_ACCOUNT_NAME}#
  location: #{STORAGE_ACCOUNT_LOCATION}#
  # Check driver parameters here:
  # https://github.com/kubernetes-sigs/azurefile-csi-driver/blob/master/docs/driver-parameters.md
reclaimPolicy: Delete
volumeBindingMode: Immediate
mountOptions:
  - dir_mode=0777
  - file_mode=0777
  - uid=0
  - gid=0
  - mfsymlinks
  - cache=strict  # https://linux.die.net/man/8/mount.cifs
  - nosharesock  # reduce probability of reconnect race
  - actimeo=30  # reduce latency for metadata-heavy workload
---
# Create a Secret to hold the name and key of the Storage Account
# Remember: values are base64 encoded
apiVersion: v1
kind: Secret
metadata:
  name: #{STORAGE_ACCOUNT_NAME}#
  namespace: #{NAMESPACE}#
type: Opaque
data:
  azurestorageaccountname: #{STORAGE_ACCOUNT_NAME_B64}#
  azurestorageaccountkey: #{STORAGE_ACCOUNT_KEY_B64}#

---
# Create a persistent volume, with the corresponding StorageClass and the reference to the Azure File secret.
# Remember: Create the share in the storage account otherwise the pods will fail with a "No such file or directory"
apiVersion: v1
kind: PersistentVolume
metadata:
  name: influxdb-pv
spec:
  capacity:
    storage: 5Ti
  accessModes:
  - ReadWriteMany
  persistentVolumeReclaimPolicy: Retain
  storageClassName: sc-influxdb
  claimRef:
    name: influxdb-pvc
    namespace: #{NAMESPACE}#
  azureFile:
    secretName: #{STORAGE_ACCOUNT_NAME}#
    secretNamespace: #{NAMESPACE}#
    shareName: influxdb
    readOnly: false
  mountOptions:
  - dir_mode=0777
  - file_mode=0777
  - uid=0
  - gid=0
  - mfsymlinks
  - cache=strict
  - nosharesock
  - nobrl

---
# Create a PersistentVolumeClaim referencing the StorageClass and the volume
# Remember: this is a static scenario. The volume was created in the previous step.
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: influxdb-pvc
  namespace: #{NAMESPACE}#
spec:
  accessModes:
    - ReadWriteMany  
  resources:
    requests:
      storage: 5Ti
  storageClassName: sc-influxdb
  volumeName: influxdb-pv

In my values.yml I defined my persistence as:

## Persist data to a persistent volume
##
persistence:
  enabled: true
  ## If true will use an existing PVC instead of creating one
  useExisting: true
  ## Name of existing PVC to be used in the influx deployment
  name: influxdb-pvc
  ## influxdb data Persistent Volume Storage Class
  ## If defined, storageClassName: <storageClass>
  ## If set to "-", storageClassName: "", which disables dynamic provisioning
  ## If undefined (the default) or set to null, no storageClassName spec is
  ##   set, choosing the default provisioner.  (gp2 on AWS, standard on
  ##   GKE, AWS & OpenStack)
  ##
  # storageClass: sc-influxdb
  size: 5Ti

To install I ran:

helm upgrade --install influxdb influxdata/influxdb2 -n influxdb -f values.yml
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文