HomeMogDBMogDB StackUqbar
v2.0

Documentation:v2.0

Supported Versions:

Other Versions:

Checking the System

Before installing the database, you need to check the system parameters and software dependencies of the server where the database is to be installed to ensure smooth installation.

During system check, the values provided by PTK are recommended ones in production environment. They may vary in different system versions or hardware configurations. Users need to optimize them according to their environment.

Check Item List

You can run checkos to perform system check. During the check, PTK checks the following modules.

No. Category Check Item Description
A1 System version Check_OS_Version Checks the system version.
A2 Kernel version Check_Kernel_Version Checks the kernel version.
A3 Character set Check_Unicode Check the character set.
A4 Time zone Check_TimeZone Checks the time zone.
A5 Swap memory Check_Swap_Memory_Configure Checks the swap memory configuration.
A6 sysctl parameter Check_SysCtl_Parameter Checks the sysctl parameter.
A7 File system Check_FileSystem_Configure Checks the file system configuration.
A8 Disk Check_Disk_Configure Checks the disk configuration.
A9 Preread block Check_BlockDev_Configure Checks the block configuration.
Check_Logical_Block Checks the logic block.
A10 IO scheduling Check_IO_Request Checks the IO request parameters.
Check_Asynchronous_IO_Request Checks the asynchronous IO request parameters.
Check_IO_Configure Checks the IO configuration.
A11 Network Check_Network_Configure Checks the network configuration.
A12 Clock consistency Check_Time_Consistency Checks the clock consistency.
A13 Firewall Check_Firewall_Service Checks the firewall configuration.
A14 Transparent huge page Check_THP_Service Checks the transparent huge page configuration.
A15 Dependencies Check_Dependent_Package Checks the database system installation dependencies.
A16 CPU command set Check_CPU_Instruction_Set Checks the CPU command set.
A17 Port status Check_Port Checks whether the database port is occupied.
A18 Selinux status Check_Selinux Checks whether system selinux is disabled.
A19 user ulimit status Check_User_Ulimit Checks whether the ulimit value of the database user meets the database requirement (if the system user exists).
A20 Data directory checking Check_Directory If the data directory of the database already exists, check if it is empty.

To perform system check using PTK, you need to specify the cluster configuration file by -f parameter, and PTK will check all the check items in the above table by default. If you want to check a specific check item, you can specify the corresponding check category number through the -i option in the command line, and multiple numbers can be separated by English commas.

Example

# Check all check items.
ptk checkos          

# Display details of error message.
ptk checkos --detail 

# To check multiple check items, enter the item number in the -i A1,A2,A3 format.
ptk checkos -i A1,A2,A3   

Check Result Classification

The PTK check result includes four levels.

  • OK: The check result reaches expectations and meets the installation requirement.
  • Warning: The check result does not reach expectations but meets the installation requirement.
  • Abnormal: The check result does not meet the installation requirement. The installation may fail. The exception needs to be handled manually based on the suggested script by PTK.
  • ExecuteError: PTK failed to execute commands during system check. The reason may be that some tools are not installed in the environment or there is an internal bug. This error needs to be handled based on the actual prompt information.

Before installing the database, make sure that the check result of all check items is OK or Warning. If the check result displays Abnormal, the installation will be interrupted.

System Fixing

After running the checkos command, if there is abnormal check items, PTK will generate a shell script file started with root_fix_os and followed by timestamp.

You can open it to view the content. It includes the fixing suggestions on abnormal check items provided by PTK.

The fixing suggestions are not generated for warning check items by default. If you need it, specify the --gen-warning-fix option in the checkos command.

You can manually perform the fixing command, or automatically execute the script on all servers in a cluster using PTK.

Typically, the fixing command requires the super user permission. Therefore, the SSH user in config.yaml needs to be root or a user who has the sudo permission when the fixing is performed using the exec command.

ptk exec -f config.yaml -s <root_fix_os.xxx.sh>
Copyright © 2011-2024 www.enmotech.com All rights reserved.