kubernetes 无法创建卷:此IO配置文件要求最小复制因子为2个节点

lhcgjxsq  于 12个月前  发布在  Kubernetes
关注(0)|答案(2)|浏览(74)

安装statefulset时卷创建失败。
事件:

9s          Warning   ProvisioningFailed   persistentvolumeclaim/kafka-vol-kafka-0                     Failed to provision volume with StorageClass "hello-sc": rpc error: code = Internal desc = Failed to create volume: This IO profile requires a minimum replication factor of 2 nodes

字符串
PVC

kubectl get pvc -n hello
NAME                STATUS    VOLUME   CAPACITY   ACCESS MODES   STORAGECLASS   AGE
hello-vol-hello-0     Pending                                      hell-sc     44m


存储类定义:

Name:            hello-sc
IsDefaultClass:  Yes
Annotations:     kubectl.kubernetes.io/last-applied-configuration={"allowVolumeExpansion":true,"apiVersion":"storage.k8s.io/v1","kind":"StorageClass","metadata":{"annotations":{"storageclass.kubernetes.io/is-default-class":"true"},"name":"hello-sc"},"parameters":{"cow_ondemand":"true","disable_io_profile_protection":"true","fs":"ext4","io_profile":"db_remote","priority_io":"high","repl":"1"},"provisioner":"kubernetes.io/portworx-volume","reclaimPolicy":"Delete","volumeBindingMode":"Immediate"}
,storageclass.kubernetes.io/is-default-class=true
Provisioner:           kubernetes.io/portworx-volume
Parameters:            cow_ondemand=true,disable_io_profile_protection=true,fs=ext4,io_profile=db_remote,priority_io=high,repl=1
AllowVolumeExpansion:  True
MountOptions:          <none>
ReclaimPolicy:         Delete
VolumeBindingMode:     Immediate
Events:                <none>


使用PVC安装statefulset。即使使用复制因子1,也应该创建卷。

xfb7svmp

xfb7svmp1#

错误创建卷失败:此IO配置文件需要至少2个节点的最小复制因子表示要创建卷IO配置文件,需要至少2个节点的复制因子。
正如document关于在kubernetes上使用portworx运行的Apache Kafka的最佳配置中所提到的:
Kafka被设计为分布式和水平可扩展的流系统,依赖于主题分区的复制因子,以在代理必须失败时实现更高的数据可用性。因此,对于生产就绪性,即使您使用Portworx在Kubernetes上运行应用程序,也不应该使用默认的复制因子1运行Kafka。一般建议使用2或3复制因子,允许1个或2个代理失败,但仍然可以访问数据。
Portworx通过存储级别的复制实现应用程序数据的高可用性。Portworx允许您将复制设置为1到3,其中3提供最高级别的数据保护和可用性。
你也可以参考这个github link和这个document来获取更多信息。

eiee3dmh

eiee3dmh2#

显式指定io_profile是导致问题的原因。


的数据
有问题的定义:

allowVolumeExpansion: true
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"allowVolumeExpansion":true,"apiVersion":"storage.k8s.io/v1","kind":"StorageClass","metadata":{"annotations":{"storagecla
ss.kubernetes.io/is-default-class":"true"},"name":"hello-sc"},"parameters":{"cow_ondemand":"true","disable_io_profile_protecti
on":"true","fs":"ext4","io_profile":"db_remote","priority_io":"high","repl":"1"},"provisioner":"kubernetes.io/portworx-volume","
reclaimPolicy":"Delete","volumeBindingMode":"Immediate"}
    storageclass.kubernetes.io/is-default-class: "true"
  creationTimestamp: "2022-12-07T08:15:45Z"
  name: hello-sc
  resourceVersion: "256593028"
  uid: 557e55db-3440-4c2b-a5ee-842d09c1e7d2
parameters:
  cow_ondemand: "true"
  disable_io_profile_protection: "true"
  fs: ext4
  io_profile: db_remote
  priority_io: high
  repl: "1"
provisioner: kubernetes.io/portworx-volume
reclaimPolicy: Delete
volumeBindingMode: Immediate

字符串
工作定义:

allowVolumeExpansion: true
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"allowVolumeExpansion":true,"apiVersion":"storage.k8s.io/v1beta1","kind":"StorageClass","metadata":{"annotations":{"stora
geclass.kubernetes.io/is-default-class":"true"},"name":"hello-sc"},"parameters":{"fs":"ext4","repl":"1"},"provisioner":"kubern
etes.io/portworx-volume"}
    storageclass.kubernetes.io/is-default-class: "true"
  creationTimestamp: "2022-04-08T11:32:23Z"
  name: hello-sc
  resourceVersion: "36880"
  uid: db05d65c-33ae-4feb-986d-b7e92b3c077a
parameters:
  fs: ext4
  repl: "1"
provisioner: kubernetes.io/portworx-volume
reclaimPolicy: Delete
volumeBindingMode: Immediate

相关问题