在Kubernetes中使用命令复制已挂载的文件很慢

时间:2018-10-19 11:00:13

标签: kubernetes orientdb volume minikube

我正在使用Kubernetes(在Minikube中)创建OrientDB集群,并且我使用状态集来创建Pod。我正在尝试将所有OrientDB集群配置装载到名为configs的文件夹中。安装后,使用命令我将文件复制到标准/ orientdb / config文件夹中。但是,添加完此功能后,pod的创建速度会变慢,有时会出现如下异常:

Unable to connect to the server: net/http: TLS handshake timeout

在此之前,我尝试将配置直接挂载到/ orientdb / config文件夹中。但是我的权限出现错误,因此我研究了禁止挂载到根文件夹。

我该如何解决此类问题?我可以找到一些解决方法吗?

状态集如下:

kind: StatefulSet
apiVersion: apps/v1
metadata:
  name: orientdbservice
spec:
  serviceName: orientdbservice
  replicas: 3
  selector:
    matchLabels:
      service: orientdb
      type: container-deployment
  template:
    metadata:
      labels:
        service: orientdb
        type: container-deployment
    spec:
      containers:
      - name: orientdbservice
        image: orientdb:2.2.36
        command: ["/bin/sh","-c", "cp /configs/* /orientdb/config/ ; /orientdb/bin/server.sh -Ddistributed=true" ]
        env:
        - name: ORIENTDB_ROOT_PASSWORD
          valueFrom:
            secretKeyRef:
              name: orientdb-password
              key: password.txt
        - name: POD_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        ports:
        - containerPort: 2424
          name: port-binary
        - containerPort: 2480
          name: port-http
        volumeMounts:
        - name: config
          mountPath: /orientdb/config
        - name: orientdb-config-backups
          mountPath: /configs/backups.json
          subPath: backups.json
        - name: orientdb-config-events
          mountPath: /configs/events.json
          subPath: events.json
        - name: orientdb-config-distributed
          mountPath: /configs/default-distributed-db-config.json
          subPath: default-distributed-db-config.json
        - name: orientdb-config-hazelcast
          mountPath: /configs/hazelcast.xml
          subPath: hazelcast.xml
        - name: orientdb-config-server
          mountPath: /configs/orientdb-server-config.xml
          subPath: orientdb-server-config.xml
        - name: orientdb-config-client-logs
          mountPath: /configs/orientdb-client-log.properties
          subPath: orientdb-client-log.properties
        - name: orientdb-config-server-logs
          mountPath: /configs/orientdb-server-log.properties
          subPath: orientdb-server-log.properties
        - name: orientdb-config-plugin
          mountPath: /configs/pom.xml
          subPath: pom.xml
        - name: orientdb-databases
          mountPath: /orientdb/databases
        - name: orientdb-backup
          mountPath: /orientdb/backup
        - name: orientdb-data
          mountPath: /orientdb/bin/data
      volumes:
      - name: config
        emptyDir: {}
      - name: orientdb-config-backups
        configMap:
          name: orientdb-configmap-backups
      - name: orientdb-config-events
        configMap:
          name: orientdb-configmap-events
      - name: orientdb-config-distributed
        configMap:
          name: orientdb-configmap-distributed
      - name: orientdb-config-hazelcast
        configMap:
          name: orientdb-configmap-hazelcast
      - name: orientdb-config-server
        configMap:
          name: orientdb-configmap-server
      - name: orientdb-config-client-logs
        configMap:
          name: orientdb-configmap-client-logs
      - name: orientdb-config-server-logs
        configMap:
          name: orientdb-configmap-server-logs
      - name: orientdb-config-plugin
        configMap:
          name: orientdb-configmap-plugin
      - name: orientdb-data
        hostPath:
          path: /import_data
          type: Directory
  volumeClaimTemplates:
  - metadata:
      name: orientdb-databases
      labels:
        service: orientdb
        type: pv-claim
    spec:
      accessModes: [ "ReadWriteOnce" ]
      resources:
        requests:
          storage: 20Gi
  - metadata:
      name: orientdb-backup
      labels:
        service: orientdb
        type: pv-claim
    spec:
      accessModes: [ "ReadWriteOnce" ]
      resources:
        requests:
          storage: 10Gi

0 个答案:

没有答案