CLI Tutorial: Mount Points
Mount Points are used to manage connection between data storage server and client, allowing you can work with the shared remote files as easy as with the local ones. With platform CLI it’s possible to configure such mounts via terminal and to include them into specialized scripts for automation.
Below, we’ll observe all of the available commands for the mount points management.
- First of all, you can get the list of existing mount points with the corresponding GetMountPoints CLI command:
|
|
where
- {env_name} - domain name of environment, where you want to check for mount points
- {node_ID} - unique identifier of the node to be checkedNote: Also, it is possible to use “nodeGroup” instead of “nodeId” to select the environment layer and show all mount points on it (e.g. cp, bl, storage, etc.).
- In a similar way, you can check exports list by using the appropriate GetExportedList method with the same parameters as for the previous command:
|
|
- In order to add mount point to a single node the following AddMountPointById CLI method is used:
|
|
where
- {env_name} - domain name of environment, where you want to add mount point
- {node_ID} - unique identifier of the node within the selected environment data will be mounted to
- {local_path} - path to folder on client node data will be shown at
- {protocol} - protocol to be used (the nfs one is required)
- {source_path} - path to the files on your data storage server
- {source_node_ID} - identifier of the source nodeNote: Alternatively, a sourceHost parameter can be used in order to point to the data storage server via IP or domain name.
- {true/false} - read only or read & write rights for the mounted data on the client node correspondingly (false by default)
Tip: In case you are not sure if mount points are allowed between nodes (due to the possible cross mounts issues), you can pelimitarly perform a check up:
1
~/jelastic/environment/file/checkcrossmount --envName {env_name} --nodeId {env_name} --sourceNodeId {source_node_ID}
As you can see in the image above, there will be cross mount (i.e. true value), if we try to mount from our storage (111109) to 128994 node, because data is already shared in opposite direction (from 128994 to 111109). But if your received value is false, mount point between nodes can be added.
- The mount points removal process (RemoveMountPointById) do not use any new parameters compared to the addition method:
|
|
- Also, it is possible to add mount points to the whole environment layer, without the necessity to call separate command for each node:
|
|
where
- {env_name} - domain name of environment, where you want to add mount point
- {env_layer} - name of the environment layer, data will be mounted to
- {local_path} - path to folder on a client node, where data will be displayed
- {protocol} - protocol to be used (the nfs one is required)
- {source_path} - path to the files on data storage server
- {source_node_ID} - identifier of the source nodeNote: Alternatively, a sourceHost parameter can be used in order to point to the data storage server via IP or domain name.
- {true/false} - read only or read & write rights for the mounted data on the client node correspondingly (false by default)
- Similarly, you can unmount data from all of the layer’s nodes with the appropriate RemoveMountPointByGroup method:
|
|
That’s all! Now, you know how to manage your mount points via platform CLI.
What’s next?
Learn how to perform some other operations via platform CLI: