16.24.1 Preparing for synonym search operations
This subsection describes the preparatory tasks required before performing synonym searches. The information in this subsection assumes that the multi-node function is enabled.
- Organization of this subsection
(2) Estimating the size required for the directory for storing synonym dictionary files
(5) Creating the directory for storing synonym dictionary files
(6) Creating the multi-node synonym dictionary storage directory
(7) Changing the specification of the HA Monitor servers file
(9) Starting the HADB servers in the multi-node configuration
(1) Considering defining text indexes
When you perform synonym search operations, performance improvement is expected if you use text indexes. Therefore, we recommend that you define text indexes for the columns in which text data (document data) is stored. For details, see (1) Considering defining text indexes under 11.16.1 Preparing for synonym search operations.
(2) Estimating the size required for the directory for storing synonym dictionary files
If you intend to perform synonym searches in environments that use the multi-node function, you need to create the directory for storing synonym dictionary files on a file system that must be inherited when node switchover occurs. Before preparing the file system, you need to perform the following tasks:
- Estimate the size of the directory for storing synonym dictionary files
-
Estimate the size of the directory for storing synonym dictionary files, and keep the results of this estimation in mind when preparing the file system. For details about how to estimate the size of the storage directory for synonym dictionary files, see (3) Estimating the size required for the directory for storing synonym dictionary files in 11.16.1 Preparing for synonym search operations.
- Important
-
If there is insufficient free space for the directory for storing synonym dictionary files, you need to change to a new directory for storing synonym dictionary files. If you change the storage directory for synonym dictionary files, you will need to re-register the contents of all synonym dictionaries. Therefore, take care to estimate the size of the directory so that the disk on which the directory is created will have sufficient free space.
- Note
-
The directory for storing synonym dictionary files is the directory specified for the adb_syndict_storage_path operand in the server definition.
(3) Preparing the file system where the directory that stores synonym dictionary files is to be created
You must create the directory for storing synonym dictionary files on a file system that must be inherited when node switchover occurs. Create file systems that must be inherited when node switchover occurs on an LV in a VG that consists of disks that can be referenced from all nodes. For details about shared disks, see Shared disk configuration in the manual HA Monitor for Linux(R) (x86).
(4) Initializing the file system where the directory that stores synonym dictionary files is to be created
Initialize the file system where the directory that stores synonym dictionary files is to be created. The following execution example initializes /dev/vg_hadb02/hadb_syndict, which was created as the LV where the directory for storing synonym dictionary files is to be created, as an ext4 file system.
mkfs -t ext4 /dev/vg_hadb02/hadb_syndict
(5) Creating the directory for storing synonym dictionary files
After you have finished preparing the file system, create the directory for storing synonym dictionary files and assign the appropriate permissions to the directory you created. For details, see (4) Creating the directory for storing synonym dictionary files to (5) Assigning permissions to the directory for storing synonym dictionary files in 11.16.1 Preparing for synonym search operations.
- Important
-
-
Do not delete the storage directory for synonym dictionary files. Also, do not use any method other than the adbsyndict command to delete files under the storage directory for synonym dictionary files. If you delete the directory or use another method to delete files, an error will occur when you execute a synonym search.
-
Do not use any method other than the adbsyndict command to update files under the storage directory for synonym dictionary files. If you use another method to update files, the results of subsequent synonym searches might be invalid, or an error might occur when you execute a synonym search.
-
- Note
-
Include the directory for storing synonym dictionary files when taking a full backup. For details, see (2) Backup procedure under 10.3.1 Backup acquisition method.
(6) Creating the multi-node synonym dictionary storage directory
If you will perform synonym searches in an environment that uses the multi-node function, create the multi-node synonym dictionary storage directory on a node-local file system. You must create the multi-node synonym dictionary storage directory on all nodes.
- Note
-
The multi-node synonym dictionary storage directory is the directory specified for the adb_syndict_node_storage_path operand in the server definition.
When SQL statements that perform synonym searches are executed on the slave node, these SQL statements use the synonym dictionary files in the directory you create. When you use the adbsyndict command to register, modify, or delete a synonym dictionary file, the synonym dictionary file on the master node is automatically copied to the slave node and stored in the directory you create.
- Important
-
You can still perform synonym searches when there are no synonym dictionary files stored on the slave node or the synonym dictionary files on the slave node are not the latest files. However, in this case, when execution processing for SQL statements that perform synonym searches is assigned to such a slave node, that slave node will not execute the SQL statements. Execution of the SQL statements will take place on the master node. If this state continues, it can lead to an increased load on the master node. Ensure that you synchronize the synonym dictionary files so that the latest synonym dictionary files are always stored on the slave node. For details about how to synchronize synonym dictionary files, see 16.24.5 Synchronizing synonym dictionary files.
The following shows the procedure for creating the multi-node synonym dictionary storage directory.
Procedure:
- 1. Estimate the size of the multi-node synonym dictionary storage directory.
-
Estimate the size of the multi-node synonym dictionary storage directory, and consider the results of this estimation when creating the directory. For details about the how to estimate the size of the multi-node synonym dictionary storage directory, see 6.17 Estimating the size of the multi-node synonym dictionary storage directory.
- Important
-
If there is insufficient free space available for the multi-node synonym dictionary storage directory, you need to change to a new directory for storing synonym dictionary files. If you change the multi-node synonym dictionary storage directory, you will need to synchronize the synonym dictionary files. Therefore, take care to estimate the size of the directory so that the disk on which the directory is created will have sufficient free space.
- 2. Create the multi-node synonym dictionary storage directory.
-
Create the multi-node synonym dictionary storage directory. Note the following when creating this directory:
-
You cannot use the following directories as the multi-node synonym dictionary storage directory:
-
Server directory
-
Subdirectories of the server directory
-
Directories of which the server directory is subordinate
-
DB directory
-
Subdirectories of the DB directory
-
Directories of which the DB directory is subordinate
-
Root directory
-
Directory specified in the adb_syndict_storage_path operand
-
Subordinate directory of the directory specified in the adb_syndict_storage_path operand
-
Directory to which the directory specified in the adb_syndict_storage_path operand is subordinate
The following table shows examples of directories that can and cannot be used as the multi-node synonym dictionary storage directory when the DB directory is /HADB/db.
Examples of multi-node synonym dictionary storage directories
Reason
Example of directory that can be used as multi-node synonym dictionary storage directory
/HADB/syndict
None.
Examples of directories that cannot be used as multi-node synonym dictionary storage directory
/HADB/db
This directory cannot serve as the multi-node synonym dictionary storage directory because it is also the DB directory.
/HADB/db/synonym
This directory cannot serve as the multi-node synonym dictionary storage directory because it is a subordinate directory of the DB directory.
/HADB
This directory cannot serve as the multi-node synonym dictionary storage directory because the DB directory is one of its subordinate directories.
-
-
Do not specify the directory in which you stored the installation data when installing the HADB server as the multi-node synonym dictionary storage directory.
-
- 3. Assign permissions for the multi-node synonym dictionary storage directory.
-
The following shows the procedure for assigning the necessary permissions in relation to the multi-node synonym dictionary storage directory.
Procedure:
-
Assign read, write, and execution permissions to the HADB administrator for the multi-node synonym dictionary storage directory.
-
Assign execution permission to the HADB administrator for all directories that are included in the path of the multi-node synonym dictionary storage directory.
Example: When the multi-node synonym dictionary storage directory is /HADB/syndict
-
Read, write, and execution permissions must be assigned to /HADB/syndict.
-
Execution permission must be assigned to / and /HADB.
-
- Important
-
-
If you change the multi-node synonym dictionary storage directory, you must execute the adbsyndict command to synchronize the synonym dictionary files. If you do not synchronize the files, the node on which SQL statements that perform synonym searches are executed will change from the slave node to the master node. This can increase the load on the master node and introduce overhead associated with switching the execution nodes, potentially leading to a drop in performance.
-
Do not delete the multi-node synonym dictionary storage directory. Also, do not use any method other than the adbsyndict command to delete files under the multi-node synonym dictionary storage directory. If you delete the directory, the node on which SQL statements that perform synonym searches are executed will change from the slave node to the master node. This can increase the load on the master node and introduce overhead associated with switching the execution nodes, potentially leading to a drop in performance.
-
Do not use any method other than the adbsyndict command to update files under the multi-node synonym dictionary storage directory. If you use another method to update files, the results of subsequent synonym searches might be invalid, or an error might occur when you execute a synonym search.
-
(7) Changing the specification of the HA Monitor servers file
Terminate the HADB servers in the multi-node configuration before changing the specification of the HA Monitor servers file.
In the example in Figure 16‒1: Example of a system configuration using the multi-node function, FS002 is the file system in which the storage directory for synonym dictionary files is to be created. The name of the VG is vg_hadb02, and the name of the LV is hadb_syndict.
Change the values specified for the following operands:
-
disk
Add the absolute path of the VG that contains the file system where the directory that stores synonym dictionary files is to be created. For the example in Figure 16‒1: Example of a system configuration using the multi-node function, you add /dev/vg_hadb02.
-
fs_name
Add the absolute path of the logical volume that corresponds to the file system where the directory that stores synonym dictionary files is to be created. For the example in Figure 16‒1: Example of a system configuration using the multi-node function, you add /dev/vg_hadb02/hadb_syndict.
-
fs_mount_dir
Add the mount directory path of the file system where the directory that stores synonym dictionary files is to be created. As the mount directory path of the file system where the directory that stores the synonym dictionary files is to be created, specify the same path on each node.
-
fs_mount_opt
Add the mount option for mounting the file system where the directory that stores synonym dictionary files is to be created.
-
vg_neck
Add a use specification.
-
fs_neck
Add a use specification.
-
scsi_device
In this operand, specify the absolute paths of the device names of the file systems that store the synonym dictionary files (the device names that are to be subject to SCSI reservation).
When using host reset, you do not need to specify this operand.
Specify this operand when you are using SCSI reservation for shared disk and the shared disk meets any of the following conditions:
-
The shared disk is in a single-path configuration.
-
The shared disk is in a VMware ESXi virtual environment (excluding situations where DMMP is used).
-
The shared disk is in a redundant configuration realized using multipath software (HDLM).
-
-
dmmp_device
In this operand, specify the device names of the file systems that store the synonym dictionary files (the device names that are to be subject to SCSI reservation) as the absolute paths of the logical devices in DMMP.
When using host reset, you do not need to specify this operand.
Specify this operand when you are using SCSI reservation for shared disk, and the shared disk is in a redundant configuration based on multipath software (DMMP).
For examples of specifying the servers file, see the following sections:
-
When using host reset
See (b) servers file specification examples in (5) File specification examples (when using host reset) under 16.3.4 Setting up an HA Monitor environment.
-
When using SCSI reservation for shared disk
For a single-path configuration, see (b) Specification example of a servers file (when using a single-path configuration) in (6) File specification examples (when using SCSI reservation for shared disk) under 16.3.4 Setting up an HA Monitor environment.
For a redundant configuration realized by multipath software, see (c) Specification example of a servers file (when using a redundant configuration realized by multipath software) in (6) File specification examples (when using SCSI reservation for shared disk) under 16.3.4 Setting up an HA Monitor environment.
For details about the operands in the servers file, see Server environment definition (servers) in the manual HA Monitor for Linux(R) (x86).
(8) Amending the server definition
Specify the following operands in the server definition:
-
adb_syndict_storage_path
In the adb_syndict_storage_path operand in the server definition, specify the name of the directory for storing synonym dictionary files. Specify this operand in the server definitions of all nodes.
For details about the adb_syndict_storage_path operand, see the explanation of the adb_syndict_storage_path operand in 7.2.8 Operands related to synonym search (set format).
If you specify a symbolic link to the storage directory for synonym dictionary files in the adb_syndict_storage_path operand, a check is performed to determine whether the absolute path name generated after the symbolic link is resolved conforms to the rules explained in (4) Creating the directory for storing synonym dictionary files under 11.16.1 Preparing for synonym search operations.
-
adb_syndict_node_storage_path
In the adb_syndict_node_storage_path operand in the server definition, specify the name of the multi-node synonym dictionary storage directory. Specify this operand in the server definitions of all nodes.
For details about the adb_syndict_node_storage_path operand, see the explanation of the adb_syndict_node_storage_path operand in 7.2.8 Operands related to synonym search (set format).
If you specify a symbolic link to the multi-node synonym dictionary storage directory in the adb_syndict_node_storage_path operand, a check is performed to determine whether the absolute path name generated after the symbolic link is resolved conforms to the rules explained in 2. Create the multi-node synonym dictionary storage directory. under (6) Creating the multi-node synonym dictionary storage directory.
- Note
-
For details about the procedure for changing the server definition, see 8.5.2 Modifying the server definition.
(9) Starting the HADB servers in the multi-node configuration
Start the HADB servers in the multi-node configuration.
For details about how to start the HADB servers in the multi-node configuration, see 16.4.1 Starting the HADB servers in the multi-node configuration.
(10) Defining text indexes
If you decide to define text indexes after reading (1) Considering defining text indexes, use the following procedure to define the text indexes:
Procedure:
-
Define text indexes by executing CREATE INDEX statements.
-
Create the index data for the text indexes by executing the adbidxrebuild command.
(11) Registering synonym dictionaries
To register synonym dictionaries, perform the tasks in (7) Creating a synonym list definition file to (10) Making a backup of the directory for storing synonym dictionary files in 11.16.1 Preparing for synonym search operations.
- Important
-
We recommend that you create synonym list definition files, dictionary creation files, and dictionary deletion files on a file system that is accessible from the master node. You could create these files on a file system that is inherited when node switchover occurs, like the storage directory for synonym dictionary files. Alternatively, you might create the files on a disk that is accessible from all nodes and whose mount directory is the same on all nodes.
When you register synonym dictionaries by executing the adbsyndict command on the master node, the synonym dictionary files are automatically synchronized. This means that you do not need to specify the -s option when executing the adbsyndict command.