Mount points: data sharing for three Jelastic containers

[Editor's Note] how to mount the main container, data containers, external server three types of containers in the data? The author gives a concise illustrative presentation.

In the previous article, we began to tap the key potential of data storage containers , shared five ways to store data with the container , and then further in-depth, talked about the Jelastic dedicated storage containers .

  • How to manage container logs in Rancher
  • Coexistence or love to kill? Container, virtual machine and Docker concept full analysis
  • Container Summit Feel: Container technology for enterprise application scenarios
  • Docker Sidekick and Super Container- [Rancher |
  • The workflow of the container in the production environment
  • DockOne Share (78): Sino-British Life Insurance Co., Ltd. Based on the practice of container technology sharing
  • Below we will describe how to simply use container mount data.

    The mount point was originally used to manage the server data storage container link. In the built-in configuration manager part of the same name, you can define the current container can get to other remote nodes in the directory.

    When storing data, you can use any container in your account or in an external NFS server. If you choose Jelastic container, all the necessary configuration (such as the installation of NFS-related software, set the output parameters for the specified file) can be automatically implemented, the manual operation of zero requirements.

    note:

    • The mount point functionality is provided for the Jelastic node; however, if you use Docker-based container operations, you can also use the data volume to manage the mount, and the locally stored options are also available. In this way, even in the container's life cycle, even the data stored in the same container will not be affected.
    • Docker containers based on alpine or Ubuntu version 14.04 The following operating system distributions can not only be used as data storage clients because the NFS server function is not supported, such as remote data but can not share their own data.

    Load the data into the container, click the Config button of the selected container or layer, and in the Open Configuration Manager tab, switch to the Mount Points section of the left menu.
    Switch-to-Jelastic-Mount-Points.png

    Then select the Mount button in the top pane and select one of the following types:

    • Main container
    • Data container
    • External server

    Tip : In addition, in the Export option (lower left menu item), you can manage the list of folders and review files, which are shared by the current server (that is, data that other nodes can access).

    In the following, we will delve into the types of operations described above and their respective best-of-breed types of sharing.

    Mount the main container

    The main container mounts the content that is suitable for sharing the same level of the same node. The master node, which is the container that was originally created, can define data for other nodes in the same layer.

    1. In the Add Mount Point form, you can see that the required primary container option is on by default.
    Jelastic-Master-Container.png
    Need to specify here:

    • Mount point : The path where the primary container is located, which is shared by all nodes of the same layer (also automatically recognized by the client as a remote path).
    • Read-only : Limits editing access to the mounted data at the client node (read and write permissions are provided by default).

    The rest of the data can be automatically read and replaced, as long as the point add (add) on the line.

    Note that if you create more than one node at the same time (but not add ), the primary container of a layer is randomly selected. Therefore, the node's id is not necessarily the smallest, when the manual operation must pay attention to this point. The master node identification can be seen in the NFS server on the above interface.

    2. The corresponding record is displayed in the list of mount points for the client node and the export section of the main container.

    Now you can start using the linked folder as the data store for that layer – for example, create a new file / directory inside, and then go to other nodes to see if you can get it.

    Mount the data container

    The most common example of a data mount is that the client and server are located on the same Jelastic platform.

    Tip : If you need to mount data from a container that is running on another Jelastic, you must set it to an external NFS server in advance.

    1. In the window where the mount point is added, switch the Data Container tab and fill in the required fields.
    Jelastic-Data-Container.png
    The following parameters need to be defined:

    • Mount Point: Displays the local folder path for the mounted content.

    Note: If the specified directory does not exist, it will be created automatically. At the same time, the path can not start with / proc, / dev, / sys, / run, and can not be repeated with / bin, / lib, / lib64, / lib32, / usr, / usr / bin, / usr / sbin / Usr / lib or / usr / lib64 (these names may be related to user-provided settings)

    • NFS server: An extensible list of nodes in the account that can be used as a data storage container

    Note: You can not mount data from the same node that was exported, for example, to create a cross mount. This restriction also applies to the case where multiple nodes form a closed loop.

    • Remote path: the path location on the remote container (you can also manually enter the drop-down menu can also be selected automatically get the node location)
    • Mount to all nodes: Set all nodes in the same layer to add the same mount.
    • Read-only: restricts edit access to the mount data at the client node (default provides read and write access)

    Click Add to continue.

    Note: If you do not select a dedicated storage container as a data container, there may be a few minutes of delay due to NFS software installation requirements.

    2. After that, the mount points will be created and added to the list. If necessary, you can navigate to the directory (double-click the appropriate record) or uninstall (use the Uninstall button in the tool pane).
    Navigate-to-directory-in-Jelastic.png
    In addition, the above two steps can be implemented through the exception list.

    3. Inside the navigation, you can see the same content as in the store
    Directories-Mount-Points.png
    Because the settings mentioned in the example (open the mount to all node option and turn off the read-only option) mount the contents of the container can be obtained and edited by all the layers. You can check by using the drop-down list on the left menu.

    In view of editing (if the client has read and write rights), the contents mounted from the storage folder should have the same permissions set for the unified user on the unified client node (the default user name may be biased due to a different server) Root and Jelastic).

    If necessary, execute the following command when the storage server is connected via SSH :

      Chown {uid}: {gid} {path} 

    specific,

    • {Uid}: The user ID, which can be found in the file / etc / passwd
    • {Gid}: The group identifier in the file / etc / group
    • {Path}: The path of the directory or file you want to change.
      code.png

    Load data from an external server

    Jelastic allows you to mount data from outside the platform (such as loading data from an external NFS server – custom or another container on Jelastic).

    Note: Before you mount, a custom storage instance requires special adjustments.

    If you are already familiar with the NFS server configuration , just follow the following to continue the mount, otherwise please see the link.

    1. In the " Add Mount Point " section, switch to the External Server tab
    Jelastic-External-Server.png
    Specify the following data

    • Mount Point: Displays the local folder path for the mounted content.

    Note: If the specified directory does not exist, it will be created automatically. At the same time, the path can not start with / proc, / dev, / sys, / run, and can not be repeated with / bin, / lib, / lib64, / lib32, / usr, / usr / bin, / usr / sbin / Usr / lib or / usr / lib64 (these names may be related to user-provided settings).

    • NFS server : The external IP or custom domain name of the datastore server.
    • Remote path : The NFS server where the export file is located.
    • Mount to all nodes : Set all nodes in the same layer to add the same mount.
    • Read-only : Limits editing access to the mounted data at the client node (read and write permissions are provided by default).

    Click Add Confirmation.

    2. Next, the data will be mounted and the record will appear in the list.
    Jelastic-mount-data.png
    You can now use export data based on the specified permission.

    Continue to try to mount data for free – experience a better data management and control solution by selecting a hosting provider (Jelastic4.7 or later).

    Mount Points: 3 Types of Data Sharing With Jelastic Containers (translation: Ma Yuanzheng)

      Heads up! This alert needs your attention, but it's not super important.