Mount Points: 3 Types of Data Sharing With Jelastic Containers
Using Jelastic containers? Learn more about mount points and how they can help you store and share your data across containers.
Join the DZone community and get the full member experience.
Join For Free
in our previous articles, we’ve already started discovering key possibilities of data storage container , shared 5 ways of storing data with containers and dived a little bit deeper, talking about jelastic dedicated storage container s.
this time, we are going to describe how to mount data to a container in a fast and easy way.
mount points are intended for managing connections to server data storage containers. in the same-named section of the inbuilt configuration manager , you can define the directories that are physically located on other, remote node(s) but should be accessible at a current container.
as storage for your data, they can use any of the containers within your account or external nfs server. upon choosing a jelastic container, all the needed configurations (i.e. installation of the dependent nfs software and setting export parameters for specified files) are applied automatically, without any manual manipulations required.
note :
- mount point functionality is provided for all jelastic nodes; however, if operating with docker-based containers, you can also use the volumes section to manage your mounts, where the additional option of local storing is available. in this case, the data will remain unaffected during container’s lifecycle even being stored in the same container
- docker containers, based on alpine or ubuntu<14.04 os distributions, can only be used as a data storage client (i.e. can only use the remote data but not share their own one) due to the nfs server functionality being unsupported
so, in order to mount data to a container, click the
config
button next to the chosen container or layer. in the opened
configuration manager
tab, switch to the
mount points
section within menu to the left:
then select the mount button at the top pane and choose one of the following mount types:
- master container.
- data container.
- external server.
and below, we’ll investigate the abovementioned operation types more thoroughly and what types of sharing each of them is best suited for.
mount master container
the master container mount option is devoted to sharing content among the same-typed nodes of a single layer. here, the initially created container, so-called “master node,” will handle the defined data for all other nodes on a layer.
1. within the
add mount point
form, you’ll see the required
master container
tab being opened by default.
here, you need to specify:
- mount point : path to the folder on master container, which will be shared among all nodes of a layer (it will be also automatically used as a remote path on clients).
- read only : turn the switcher on to restrict the mounted data editing in client nodes (by default, the read & write rights are provided).
the rest of data will be fetched and substituted automatically, so just click add .
please be aware that if creating an environment with several same-type nodes at a time (i.e. but not adding them subsequently), the master container of a layer is selected randomly. thus, it won’t be assigned the lowest node id — consider this while performing any manual management operations. the exact master node identifier can be seen within the nfs server field of the above-shown frame.
2. in a moment, the corresponding record will appear in the list of your mount points at client nodes and within the exports section of the master container.
now, you can start utilizing the connected folder as your data storage for the layer — for example, try to create a few files/directories inside it and check their availability on all of the other nodes.
mount data container
the most common example of data mounting is when both client and server are located within the same jelastic platform.
1. in the add mount point frame, switch to the
data container
tab and fill in the required fields.
here, the following parameters should be defined:
- mount point : path to local folder the mounted content will be displayed at.
note: if the specified directory doesn’t exist, it will be created automatically. also, a path can’t start with /proc, /dev, /sys, /run or be equal to the following: /, /bin, /lib, /lib64, /lib32, /usr, /usr/bin,/usr/sbin, /usr/lib or /usr/lib64 (this list may vary based on your provider’s settings).
-
nfs server : expandable list of nodes on your account which can be used as data storage container
note : you cannot mount data from the same node you’ve exported it from, i.e. to create cross-mounts. this also includes a restriction on building the closed circle of mounts by means of intermediate nodes.
- remote path : the required directory location at a remote container (you can either type it manually or choose one of the favorite paths on that node from the automatically fetched drop-down list)
- mount to all nodes : switcher to set the same mounts to be added for all nodes within a layer (including those that could be added further as a result of horizontal scaling )
- read only : turn the switcher on to restrict the mounted data editing at client nodes (by default, the read & write rights are provided)
click add to proceed.
2. in a moment, your mount point will be created and added to the list. so, you can either
navigate to directory
(double click on the corresponding record) or
unmount
it (with the same-named button at the tool pane) when it becomes unnecessary.
also, both of these actions are available by means of the additionally list for every mount.
3. upon navigating inside, you’ll see the same content as on your storage.
due to the configurations stated in this example (namely — the enabled mount to all nodes option and disabled read only one), the mounted content should be available and editable at all containers of the layer. you can check this via switching among nodes using the drop-down list at the left-hand menu (circled above).
take into consideration that in order to be editable (i.e. if clients are granted rw rights to it), the mounted from a storage folder should have the same permissions for the same user as on a client node (since the default user names may vary for different servers – e.g. root and jelastic).
if needed, execute the following command on your storage server while being connected to it via ssh to adjust the rights:
chown {uid}:{gid} {path}
here:
- {uid} : user id, which can be found in the /etc/passwd file.
- {gid} : group identifier, which is shown within the /etc/group file.
-
{path}
: path to the directory or file you’d like to change the permissions for.
mount data from external server
jelastic allows you to mount data from outside of the platform (i.e from the external nfs server — your custom one or a container at another jelastic installation).
note : a special adjustment may be required to be applied to your custom storage instance before mounting in order to make data available for client (it this has not been done before)..
if you are already familiar with nfs server configurations , just proceed below to mounting itself; otherwise, follow the link to check our example.
1. within the
add mount point
section, switch to the
external server
tab.
and specify the following data:
- mount point : path to the local folder the mounted content will be displayed in.
note: i f the specified directory doesn’t exist, it will be created automatically. also, a path can’t start with /proc, /dev, /sys, /run or be equal to the following: /, /bin, /lib, /lib64, /lib32, /usr, /usr/bin,/usr/sbin, /usr/lib or /usr/lib64 (this list may vary based on your provider’s settings).
- nfs server : external ip of the data storage server or its custom domain name.
- remote path : exported files location on nfs server.
- mount to all nodes : switcher to set the same mounts to be added for all nodes within the layer.
- read only : turn the switcher on to restrict the mounted data editing at client nodes (by default, the read & write rights are provided).
confirm with add button.
2. in a while, your data will be mounted and the appropriate record will appear in the list.
now, you can start using the exported data based on the specified permissions.
go ahead and try to mount data for free — just choose your hosting provider (with jelastic version 4.7 or higher) to experience a great amount of scenarios and possibilities for the advanced data management and control.
Published at DZone with permission of Tetiana Markova, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Comments