输出:mount.nfs:不支持请求的NFS版本或传输协议

时间:2016-02-26 11:48:44

标签: vagrant kubernetes nfs vagrantfile

我正在复制控制器示例[1]中尝试Kubernetes NFS卷声明。

我已经设置了NFS服务器,PV和PVC。我的复制控制器看起来像这样

apiVersion: v1
kind: ReplicationController
metadata:
  name: node-manager
  labels:
    name: node-manager
spec:
  replicas: 1
  selector:
    name: node-manager
  template:
    metadata:
      labels:
        name: node-manager
    spec:
      containers:
      -
        name: node-manager
        image: org/node-manager-1.0.0:1.0.0
        ports:
        -
          containerPort: 9763
          protocol: "TCP"
        -
          containerPort: 9443
          protocol: "TCP"
        volumeMounts:
          - name: nfs
            mountPath: "/mnt/data"
      volumes:
      - name: nfs
        persistentVolumeClaim:
          claimName: nfs

当我尝试部署复制控制器时,容器处于ContainerCreating状态,我可以在minion的日志中看到以下错误

Feb 26 11:39:41 node-01 kubelet[1529]: Mounting arguments: 172.17.8.102:/ /var/lib/kubelet/pods/0e66affa-dc79-11e5-89b3-080027f84891/volumes/kubernetes.io~nfs/nfs nfs []
Feb 26 11:39:41 node-01 kubelet[1529]: Output: mount.nfs: requested NFS version or transport protocol is not supported
Feb 26 11:39:41 node-01 kubelet[1529]: E0226 11:39:41.908756    1529 kubelet.go:1383] Unable to mount volumes for pod "node-manager-eemi2_default": exit status 32; skipping pod
Feb 26 11:39:41 node-01 kubelet[1529]: E0226 11:39:41.923297    1529 pod_workers.go:112] Error syncing pod 0e66affa-dc79-11e5-89b3-080027f84891, skipping: exit status 32
Feb 26 11:39:51 node-01 kubelet[1529]: E0226 11:39:51.904931    1529 mount_linux.go:103] Mount failed: exit status 32

使用[2] Kubernetes-cluster-vagrant-cluster来设置我的Kubernetes集群。

我的仆从细节:

core@node-01 ~ $ cat /etc/lsb-release
DISTRIB_ID=CoreOS
DISTRIB_RELEASE=969.0.0
DISTRIB_CODENAME="Coeur Rouge"
DISTRIB_DESCRIPTION="CoreOS 969.0.0 (Coeur Rouge)"

[1] - https://github.com/kubernetes/kubernetes/tree/master/examples/nfs

[2] - https://github.com/pires/kubernetes-vagrant-coreos-cluster

2 个答案:

答案 0 :(得分:1)

我遇到了同样的问题,然后意识到 nfs-server.service 状态已禁用。激活后问题就解决了。

答案 1 :(得分:-1)

因此,为了解决此nfs挂载版本问题,请在NFS服务器的/etc/nfsmount.conf中在NFS服务器中使用Defaultvers = 4进行输入。这将解决!!