OpenShift Container Storage is now OpenShift Data Foundation starting with version 4.9.
Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
Chapter 2. Operations on a Red Hat Gluster Storage Pod in an OpenShift Environment
This chapter lists out the various operations that can be performed on a Red Hat Gluster Storage pod (gluster pod):
To list the pods, execute the following command :
oc get pods -n <storage_project_name>
# oc get pods -n <storage_project_name>Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Following are the gluster pods from the above example:
glusterfs-dc-node1.example.com glusterfs-dc-node2.example.com glusterfs-dc-node3.example.com
glusterfs-dc-node1.example.com glusterfs-dc-node2.example.com glusterfs-dc-node3.example.comCopy to Clipboard Copied! Toggle word wrap Toggle overflow NoteThe topology.json file will provide the details of the nodes in a given Trusted Storage Pool (TSP) . In the above example all the 3 Red Hat Gluster Storage nodes are from the same TSP.
To enter the gluster pod shell, execute the following command:
oc rsh <gluster_pod_name> -n <storage_project_name>
# oc rsh <gluster_pod_name> -n <storage_project_name>Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example:
oc rsh glusterfs-dc-node1.example.com -n storage-project
# oc rsh glusterfs-dc-node1.example.com -n storage-project sh-4.2#Copy to Clipboard Copied! Toggle word wrap Toggle overflow To get the peer status, execute the following command:
gluster peer status
# gluster peer statusCopy to Clipboard Copied! Toggle word wrap Toggle overflow For example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow To list the gluster volumes on the Trusted Storage Pool, execute the following command:
gluster volume info
# gluster volume infoCopy to Clipboard Copied! Toggle word wrap Toggle overflow For example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow To get the volume status, execute the following command:
gluster volume status <volname>
# gluster volume status <volname>Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow To use the snapshot feature, load the snapshot module using the following command on one of the nodes:
modprobe dm_snapshot
# modprobe dm_snapshotCopy to Clipboard Copied! Toggle word wrap Toggle overflow ImportantRestrictions for using Snapshot
- After a snapshot is created, it must be accessed through the user-serviceable snapshots feature only. This can be used to copy the old versions of files into the required location.
- Reverting the volume to a snapshot state is not supported and should never be done as it might damage the consistency of the data.
- On a volume with snapshots, volume changing operations, such as volume expansion, must not be performed.
- Taking consistent snapshots of gluster-block based PVs is not possible.
To take the snapshot of the gluster volume, execute the following command:
gluster snapshot create <snapname> <volname>
# gluster snapshot create <snapname> <volname>Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example:
gluster snapshot create snap1 vol_9e86c0493f6b1be648c9deee1dc226a6
# gluster snapshot create snap1 vol_9e86c0493f6b1be648c9deee1dc226a6 snapshot create: success: Snap snap1_GMT-2016.07.29-13.05.46 created successfullyCopy to Clipboard Copied! Toggle word wrap Toggle overflow To list the snapshots, execute the following command:
gluster snapshot list
# gluster snapshot listCopy to Clipboard Copied! Toggle word wrap Toggle overflow For example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow To delete a snapshot, execute the following command:
gluster snap delete <snapname>
# gluster snap delete <snapname>Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example:
gluster snap delete snap1_GMT-2016.07.29-13.05.46
# gluster snap delete snap1_GMT-2016.07.29-13.05.46 Deleting snap will erase all the information about the snap. Do you still want to continue? (y/n) y snapshot delete: snap1_GMT-2016.07.29-13.05.46: snap removed successfullyCopy to Clipboard Copied! Toggle word wrap Toggle overflow For more information about managing snapshots, see https://access.redhat.com/documentation/en-us/red_hat_gluster_storage/3.5/html-single/administration_guide/index#chap-Managing_Snapshots.
You can set up Red Hat Openshift Container Storage volumes for geo-replication to a non-Red Hat Openshift Container Storage remote site. Geo-replication uses a master–slave model. Here, the Red Hat Openshift Container Storage volume acts as the master volume. To set up geo-replication, you must run the geo-replication commands on gluster pods. To enter the gluster pod shell, execute the following command:
oc rsh <gluster_pod_name> -n <storage_project_name>
# oc rsh <gluster_pod_name> -n <storage_project_name>Copy to Clipboard Copied! Toggle word wrap Toggle overflow For more information about setting up geo-replication, see https://access.redhat.com/documentation/en-us/red_hat_gluster_storage/3.5/html/administration_guide/chap-managing_geo-replication.
Brick multiplexing is a feature that allows including multiple bricks into one process. This reduces resource consumption, allowing you to run more bricks than earlier with the same memory consumption.
Brick multiplexing is enabled by default from Container-Native Storage 3.6. If you want to turn it off, execute the following command:
gluster volume set all cluster.brick-multiplex off
# gluster volume set all cluster.brick-multiplex offCopy to Clipboard Copied! Toggle word wrap Toggle overflow The
auto_unmountoption in glusterfs libfuse, when enabled, ensures that the file system is unmounted at FUSE server termination by running a separate monitor process that performs the unmount.The GlusterFS plugin in Openshift enables the
auto_unmountoption for gluster mounts.
2.1. Maintenance on nodes Link kopierenLink in die Zwischenablage kopiert!
2.1.1. Necessary steps to be followed before maintenance Link kopierenLink in die Zwischenablage kopiert!
Remove the label glusterfs or equivalent one which is the selector for the
glusterfs daemonset. Wait for the pod to terminate.Run the following command to get the
node selector.oc get ds
# oc get dsCopy to Clipboard Copied! Toggle word wrap Toggle overflow For example:
oc get ds
# oc get ds NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE glusterfs-storage 3 3 3 3 3 NODE SELECTOR AGE glusterfs=storage-host 12dCopy to Clipboard Copied! Toggle word wrap Toggle overflow Remove the glusterfs label using the following command.
oc label node <storge_node1> glusterfs-
# oc label node <storge_node1> glusterfs-Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example:
oc label node <storge_node1> glusterfs-
# oc label node <storge_node1> glusterfs- node/<storage_node1> labeledCopy to Clipboard Copied! Toggle word wrap Toggle overflow Wait for glusterfs pod to be terminated. Verify using the below command.
oc get pods -l glusterfs
# oc get pods -l glusterfsCopy to Clipboard Copied! Toggle word wrap Toggle overflow For example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Make the node unschedulable using the below command.
oc adm manage-node --schedulable=false <storage_node1>
# oc adm manage-node --schedulable=false <storage_node1>Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example:
oc adm manage-node --schedulable=false <storage_node1>
# oc adm manage-node --schedulable=false <storage_node1> NAME STATUS ROLES AGE VERSION storage_node1 Ready,SchedulingDisabled compute 12d v1.11.0+d4cacc0Copy to Clipboard Copied! Toggle word wrap Toggle overflow Drain the node using the below command.
oc adm drain --ignore-daemonsets <storage_node1>
# oc adm drain --ignore-daemonsets <storage_node1>Copy to Clipboard Copied! Toggle word wrap Toggle overflow NotePerform the maintenance and reboot if required
2.1.2. Necessary steps to be followed after maintenance Link kopierenLink in die Zwischenablage kopiert!
Make the node schedulable using the below command.
oc adm manage-node --schedulable=true <storage_node1>
# oc adm manage-node --schedulable=true <storage_node1>Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example:
oc adm manage-node --schedulable=true <storage_node1>
# oc adm manage-node --schedulable=true <storage_node1> NAME STATUS ROLES AGE VERSION node1 Ready compute 12d v1.11.0+d4cacc0Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add the label glusterfs or equivalent which is the selector for the
glusterfs daemonset. Wait for the pod to be ready.Run the following command to get the
node selector.oc get ds
# oc get dsCopy to Clipboard Copied! Toggle word wrap Toggle overflow For example:
oc get ds
# oc get ds NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE glusterfs-storage 3 3 3 3 3 NODE SELECTOR AGE glusterfs=storage-host 12dCopy to Clipboard Copied! Toggle word wrap Toggle overflow Label the glusterfs node using the above node selector and the below command.
oc label node <storage_node1> glusterfs=storage-host
# oc label node <storage_node1> glusterfs=storage-hostCopy to Clipboard Copied! Toggle word wrap Toggle overflow For example:
oc label node <storage_node1> glusterfs=storage-host
# oc label node <storage_node1> glusterfs=storage-host node/<storage_node1> labeledCopy to Clipboard Copied! Toggle word wrap Toggle overflow Wait for the pod to come up to Ready State.
oc get pods
# oc get podsCopy to Clipboard Copied! Toggle word wrap Toggle overflow For example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Wait for the pod to be in 1/1 Ready State.
For example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Wait for heal to complete, use oc rsh to obtain shell of glusterfs pod and monitor heal using the below command, and wait for Number of entries to be zero(0).
for each_volume in gluster volume list; do gluster volume heal $each_volume info ; done
# for each_volume in gluster volume list; do gluster volume heal $each_volume info ; doneCopy to Clipboard Copied! Toggle word wrap Toggle overflow For example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow