Setting up an NFS mount in DataStage
You can set up an NFS mount in DataStage pods by using a persistent volume (PV).
You can use a Network File System (NFS) mount to pass data files such as CSV and XML between DataStage and source or target systems. You can set up an NFS mount in DataStage pods by using a PV. You can also set up supplemental groups to configure access control for the NFS mount.
For better performance, use the Sequential file connector with mounted volumes instead of storage volume connectors. The persistent volume claim (PVC) from the storage volume can be mounted to a PX runtime instance via step 3.
- Log in to the
cluster:
oc login <OpenShift_URL>:port
- Create a persistent volume claim (PVC).
- Create the PV:
cat <<EOF |oc apply -f - apiVersion: v1 kind: PersistentVolume metadata: name: sample-nfs-pv spec: capacity: storage: 100Gi accessModes: - ReadWriteMany nfs: path: /data/sample-pv # all worker nodes on the cluster should be allowed server: <NFS server IP> # to mount the path specified on the NFS server persistentVolumeReclaimPolicy: Retain EOF
- Create the PVC:
cat <<EOF |oc apply -f - apiVersion: v1 kind: PersistentVolumeClaim metadata: name: sample-nfs-pvc spec: accessModes: - ReadWriteMany resources: requests: storage: 100Gi volumeName: sample-nfs-pv EOF
Storage volume connector may experience intermittent failure as a target. For better performance, you need to mount the persistent volume to the PX runtime and replace storage volume connectors with sequential file connectors in your flows. To mount the volume:
- Create the PV:
- Edit the PX runtime custom resource with the following
command:
oc edit pxruntime ds-px-default
- Add the PVC to the PX runtime custom resource (CR) under
additional_storage
:spec: additional_storage: # mount additional persistent volumes - mount_path: /data1 # the path to mount the persistent volume pvc_name: <pvc-1-name> # the name of the associated persistent volume claim - mount_path: /data2 pvc_name: <pvc-2-name> description: The default DataStage runtime instance license: accept: true parameters: scaleConfig: small storageClass: nfs-client storageSize: 10Gi supplementalGroup: 6666,5555 #comma separated list of groupID if required to access nfs mount
If the mounted PVC requires a specific group ID to access,
supplementalGroup
underparameters
can be used to specify one or more group IDs. The supplementalGroup parameter corresponds to the group ID that is required to access resources on the NFS mount. The same PVC can be mounted by multiple DataStage runtime instances with different sets of supplemental group IDs to control what each instance can access.You can also create and mount storage volumes by using the UI in IBM Cloud Pak for Data. For more information, see Managing storage volumes.