Mount Points: 3 Types of Data Sharing within Jelastic Containers

Datetime:2016-08-23 01:40:41          Topic:          Share

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 .

This time, we are going to describe how to mount data to a container in a fast-n-easy way.

Mount points functionality is intended for managing connected to a server data storage containers. At 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 a storage for your data can be used any of the containers within your account or external NFS server. Herewith, upon choosing 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 points 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

Tip : Beside of that, within the Exports section (one item down in the left-hand menu) you can manage the list of folders and review files, which are shared by current server (i.e. data the other nodes have access to)

And below we’ll investigate the abovementioned operation types more thoroughly and what types of sharing each of them suit the best.

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, that 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 at 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), master container of a layer is selected randomly. Thus, it won’t be obligatory 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 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 rest nodes.

Mount Data Container

The most common example of data mounting is when both client and server are located within the same Jelastic platform.

Tip : In case you need to mount data from a container, that is run at another Jelastic installation, you have to preliminary configure it as an external NFS server .

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
  • 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 : It is not allowed to mount data from the same node you’ve exported it to the current container, 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.

Note : If not a Dedicated Storage Container has been chosen as a data container, a brief one-time delay (up to a few minutes) may take place due to the required NFS software installation.

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, that 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 to mount data from outside of the Platform (i.e from the external NFS server – your custom one or container at another Jelastic installation) as simple as within its confines.

Note that 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 at

Note:

  • if the specified directory doesn’t exist, it will be created automatically
  • 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.

Related Articles

Storing and Sharing Data Across Containers

5 Ways to Store Data with Containers

Dedicated Storage Container