Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Mount Points: 3 Types of Data Sharing With Jelastic Containers

DZone's Guide to

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.

· Cloud Zone
Free Resource

Deploy and scale data-rich applications in minutes and with ease. Mesosphere DC/OS includes everything you need to elastically run containerized apps and data services in production.

Jelastic Mount Points

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 Containers.

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:Switch to Jelastic Mount Points

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 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 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.Jelastic Master Container

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.

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.Jelastic Data Container

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.

Note: If no 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.Navigate to directory in Jelastic

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.Directories Mount Points

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.code

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.Jelastic External Server

And specify the following data:

  • Mount Point: path to the local folder the mounted content will be displayed in.

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: 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.Jelastic mount data

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.

Discover new technologies simplifying running containers and data services in production with this free eBook by O'Reilly. Courtesy of Mesosphere.

Topics:
container ,server ,external ,storage ,data ,nfs ,point ,master

Published at DZone with permission of Tetiana Markova, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}