EmergencyEMERGENCY? Get 24/7 Help Now!

TokuDB and PerconaFT Data Files: Database File Management Part 2 of 2

 | October 24, 2016 |  Posted In: TokuDB

PREVIOUS POST
NEXT POST

TokuDB and PerconaFT data filesThis is the second installment of the blog series on TokuDB and PerconaFT data files. You can find my previous post here. In this post we will discuss some common file maintenance operations and how to safely execute these operations.


Moving TokuDB data (table/index) files to another location outside of the default MySQL datadir

TokuDB uses the location specified by the tokudb_data_dir variable for all of its data files. If you don’t explicitly set the tokudb_data_dir variable, TokuDB uses the location specified by the servers datadir for these files.

The the __tokudb_lock_dont_delete_me_data file, located in the same directory as the TokuDB data files, protects TokuDB data files from concurrent process access.

TokuDB data files can be moved to other locations, and symlinks left behind in their place. If those symlinks refer to files on other physical data volumes, the tokudb_fs_reserve_percent monitor will not traverse the symlink and monitor the real location for adequate space in the file system.

To safely move your TokuDB data files:

  1. Shut down the server cleanly.
  2. Change the tokudb_data_dir in your my.cnf to the location where you wish to store your TokuDB data files.
  3. Create your new target directory.
  4. Move your *.tokudb files and your __tokudb_lock_dont_delete_me_data from the current location to the new location.
  5. Restart your server.

Moving the TokuDB temporary files to another location outside of the default MySQL datadir

TokuDB uses the location specified by the tokudb_tmp_dir variable for all of its temporary files. If you don’t explicitly set the tokudb_tmp_dir variable, TokuDB uses the location specified by the tokudb_data_dir. If you don’t explicitly set the tokudb_data_dir variable, TokuDB uses the location specified by the servers datadir for these files.

The __tokudb_lock_dont_delete_me_temp file, located in the same directory as the TokuDB temporary files, protects the TokuDB temporary files from concurrent process access.

If you locate your TokuDB temporary files on a physical volume that is different from where your TokuDB data files or recovery log files are located, the tokudb_fs_reserve_percent monitor will not monitor their location for adequate space in the file system.

To safely move your TokuDB temporary files:

  1. Shut the server down cleanly. A clean shutdown will ensure that there are no temporary files that need to be relocated.
  2. Change the tokudb_tmp_dir in your my.cnf to the location where you wish to store your new TokuDB temporary files.
  3. Create your new target directory.
  4. Move your __tokudb_lock_dont_delete_me_temp file from the current location to the new location.
  5. Restart your server.

Moving TokuDB recovery log files to another location outside of the default MySQL datadir

TokuDB uses the location specified by the tokudb_log_dir variable for all of its recovery log files. If the tokudb_log_dir variable is not explicitly set, TokuDB uses the location specified by the servers datadir for these files.

The __tokudb_lock_dont_delete_me_logs file, located in the same directory as the TokuDB recovery log files, protects TokuDB recovery log files from concurrent process access.

TokuDB recovery log files can be moved to another location and a symlinks left behind in place of the tokudb_log_dir. If that symlink refers to a directory on another physical data volume, the tokudb_fs_reserve_percent monitor will not traverse the symlink and monitor the real location for adequate space in the file system.

To safely move your TokuDB recovery log files:

  1. Shut the server down cleanly.
  2. Change the tokudb_log_dir in your my.cnf to the location where you wish to store your TokuDB recovery log files.
  3. Create your new target directory.
  4. Move your log*.tokulog* files and your __tokudb_lock_dont_delete_me_logs file from the current location to the new location.
  5. Restart your server.

I hope this blog series is helpful. Another post discussing a long-awaited new feature to help you manage and organize your TokuDB data files is coming soon.

PREVIOUS POST
NEXT POST
George O. Lorch III

George joined the Percona development team in April 2012. George has over 20 years of experience in software support, development, architecture and project management. Prior to joining Percona, George was focused on Windows based enterprise application server development and network protocol classification and optimization with heavy doses of database schema design, architecture and tuning.

Leave a Reply