首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >在Azure AKS集群中部署带有预留存储帐户的influxDB 2

在Azure AKS集群中部署带有预留存储帐户的influxDB 2
EN

Stack Overflow用户
提问于 2022-05-30 20:36:25
回答 1查看 200关注 0票数 0

我很难将Influxdb2部署到我的Azure集群中。我正在使用一个简单的存储帐户作为存储。查看进水舱:

** ts=2021-11-26T00:43:44.126091Z lvl=error msg=“未能应用”log_id=0Y2Q~wH0000 error=“数据库被锁定”**错误:数据库已锁定

EN

回答 1

Stack Overflow用户

发布于 2022-05-30 20:36:25

我将我的PVC改为使用CSI:

代码语言:javascript
运行
复制
---
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

在我的values.yml中,我将我的持久性定义为:

代码语言:javascript
运行
复制
## 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

为了安装,我运行了:

代码语言:javascript
运行
复制
helm upgrade --install influxdb influxdata/influxdb2 -n influxdb -f values.yml
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72439795

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档