No cache version.

Caching disabled. Default setting for this page:enabled (code DEF204)
If the display is too slow, you can disable the user mode to view the cached version.

Rechercher dans le manuel MySQL

22.5.13.2 Using Symbolic Links with Disk Data Objects

The performance of an NDB Cluster that uses Disk Data storage can be greatly improved by separating the data node file system from any tablespace files (undo log files and data files), and placing these on different disks. In early versions of NDB Cluster, there was no direct support for this in NDB Cluster, but it was possible to achieve this separation using symbolic links as described in this section. NDB Cluster supports the data node configuration parameters FileSystemPathDD, FileSystemPathDataFiles, and FileSystemPathUndoFiles, which make the use of symbolic links for this purpose unnecessary. For more information about these parameters, see Disk Data file system parameters.

Each data node in the cluster creates a file system in the directory named ndb_node_id_fs under the data node's DataDir as defined in the config.ini file. In this example, we assume that each data node host has 3 disks, aliased as /data0, /data1, and /data2, and that the cluster's config.ini includes the following:

[ndbd default]
DataDir= /data0

Our objective is to place all Disk Data log files in /data1, and all Disk Data data files in /data2, on each data node host.

Note

In this example, we assume that the cluster's data node hosts are all using Linux operating systems. For other platforms, you may need to substitute you operating system's commands for those shown here.

To accomplish this, perform the following steps:

  • Under the data node file system create symbolic links pointing to the other drives:

    shell> cd /data0/ndb_2_fs
    shell> ls
    D1  D10  D11  D2  D8  D9  LCP
    shell> ln -s /data0 dnlogs
    shell> ln -s /data1 dndata

    You should now have two symbolic links:

    shell> ls -l --hide=D*
    lrwxrwxrwx 1 user group   30 2007-03-19 13:58 dndata -> /data1
    lrwxrwxrwx 1 user group   30 2007-03-19 13:59 dnlogs -> /data2

    We show this only for the data node with node ID 2; however, you must do this for each data node.

  • Now, in the mysql client, create a log file group and tablespace using the symbolic links, as shown here:

    1. mysql> CREATE LOGFILE GROUP lg1
    2.     ->    ADD UNDOFILE 'dnlogs/undo1.log'
    3.     ->    INITIAL_SIZE 150M
    4.     ->    UNDO_BUFFER_SIZE = 1M
    5.     ->    ENGINE=NDBCLUSTER;
    6.  
    7. mysql> CREATE TABLESPACE ts1
    8.     ->    ADD DATAFILE 'dndata/data1.log'
    9.     ->    USE LOGFILE GROUP lg1
    10.     ->    INITIAL_SIZE 1G
    11.     ->    ENGINE=NDBCLUSTER;

    Verify that the files were created and placed correctly as shown here:

    shell> cd /data1
    shell> ls -l
    total 2099304
    -rw-rw-r--  1 user group 157286400 2007-03-19 14:02 undo1.dat
    
    shell> cd /data2
    shell> ls -l
    total 2099304
    -rw-rw-r--  1 user group 1073741824 2007-03-19 14:02 data1.dat
  • If you are running multiple data nodes on one host, you must take care to avoid having them try to use the same space for Disk Data files. You can make this easier by creating a symbolic link in each data node file system. Suppose you are using /data0 for both data node file systems, but you wish to have the Disk Data files for both nodes on /data1. In this case, you can do something similar to what is shown here:

    shell> cd /data0
    shell> ln -s /data1/dn2 ndb_2_fs/dd
    shell> ln -s /data1/dn3 ndb_3_fs/dd
    shell> ls -l --hide=D* ndb_2_fs
    lrwxrwxrwx 1 user group   30 2007-03-19 14:22 dd -> /data1/dn2
    shell> ls -l --hide=D* ndb_3_fs
    lrwxrwxrwx 1 user group   30 2007-03-19 14:22 dd -> /data1/dn3
  • Now you can create a logfile group and tablespace using the symbolic link, like this:

    1. mysql> CREATE LOGFILE GROUP lg1
    2.     ->    ADD UNDOFILE 'dd/undo1.log'
    3.     ->    INITIAL_SIZE 150M
    4.     ->    UNDO_BUFFER_SIZE = 1M
    5.     ->    ENGINE=NDBCLUSTER;
    6.  
    7. mysql> CREATE TABLESPACE ts1
    8.     ->    ADD DATAFILE 'dd/data1.log'
    9.     ->    USE LOGFILE GROUP lg1
    10.     ->    INITIAL_SIZE 1G
    11.     ->    ENGINE=NDBCLUSTER;

    Verify that the files were created and placed correctly as shown here:

    shell> cd /data1
    shell> ls
    dn2        dn3
    shell> ls dn2
    undo1.log        data1.log
    shell> ls dn3
    undo1.log        data1.log

Find a PHP function

Document created the 26/06/2006, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/mysql-rf-mysql-cluster-disk-data-symlinks.html

The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.

References

  1. View the html document Language of the document:en Manuel MySQL : https://dev.mysql.com/

These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.

Contents Haut