openGauss routine maintenance: check operating system parameters
Tags: opengauss
Published: 2023-03-25 09:45:37

Check operating system parameters
Inspection method
The operating system status check can be completed through the gs_checkos tool provided by openGauss.

prerequisite

The current hardware and network environment are normal.
The root mutual trust status among hosts is normal.
Only the root user can execute the gs_checkos command.
Steps

Log in to any server as the root user.

Run the following command to check the OS parameters of the openGauss node server.

gs_checkos -i A
The purpose of checking the OS parameters of the node server is to ensure that openGauss passes the pre-installation normally and can run safely and efficiently after the installation is successful. For detailed check items, see the chapter "Server Tools > gs_checkos" in "openGauss Tool Reference".

example

Before executing gs_checkos, you need to use the gs_preinstall tool to execute the pre-script to prepare the environment. Take parameter "A" as an example.

gs_checkos -i A
Checking items:
    A1. [ OS version status ]                                   : Normal
    A2. [ Kernel version status ]                               : Normal
    A3. [ Unicode status ]                                      : Normal
    A4. [ Time zone status ]                                    : Normal
    A5. [ Swap memory status ]                                  : Normal
    A6. [ System control parameters status ]                    : Normal
    A7. [ File system configuration status ]                    : Normal
    A8. [ Disk configuration status ]                           : Normal
    A9. [ Pre-read block size status ]                          : Normal
    A10.[ IO scheduler status ]                                 : Normal
    A11.[ Network card configuration status ]                   : Normal
    A12.[ Time consistency status ]                             : Warning
    A13.[ Firewall service status ]                             : Normal
    A14.[ THP service status ]                                  : Normal
Total numbers:14. Abnormal numbers:0. Warning number:1.
Take the parameter "B" as an example.

gs_checkos -i B
Setting items:
    B1. [ Set system control parameters ]                       : Normal
    B2. [ Set file system configuration value ]                 : Normal
    B3. [ Set pre-read block size value ]                       : Normal
    B4. [ Set IO scheduler value ]                              : Normal
    B5. [ Set network card configuration value ]                : Normal
    B6. [ Set THP service ]                                     : Normal
    B7. [ Set RemoveIPC value ]                                 : Normal
    B8. [ Set Session Process ]                                 : Normal
Total numbers:6. Abnormal numbers:0. Warning number:0. 
exception handling
Use gs_checkos to check the openGauss status, and you can use the following command to view detailed error information.

gs_checkos -i A --detail
Among them, Abnormal is an item that must be processed and affects the installation of openGauss. Warning can be ignored and will not affect the installation of openGauss.

If the operating system version (A1) check item check result is Abnormal, you need to replace the operating system version that does not belong to the mixed compilation range with the operating system version that is in the mixed compilation range.

If the check result of the kernel version (A2) check item is Warning, it means that the kernel versions of the operating system platforms in the openGauss cluster are inconsistent.

If the Unicode status (A3) check item check result is Abnormal, you need to set the character set of each host to the same character set, you can add "export LANG=XXX" (XXX is Unicode encoding) to the /etc/profile file.

vim /etc/profile
If the time zone status (A4) check item check result is Abnormal, you need to set the time zone of each host to the same time zone, you can copy the time zone file in the /usr/share/zoneinfo/ directory to the /etc/localtime file.

cp /usr/share/zoneinfo/$主时区/$次时区 /etc/localtime
If the swap memory status (A5) check item check result is Abnormal, it may be because the Swap space is larger than the Mem space, which can be solved by reducing the Swap or increasing the Mem space.

If the result of the system control parameter (A6) check item is Abnormal, you can use the following two methods to set it.

You can use the following commands to set it.

gs_checkos -i B1
According to the error message, set it in the /etc/sysctl.conf file. Then execute sysctl -p to make it take effect.

vim /etc/sysctl.conf
If the file system configuration status (A7) check item is Abnormal, you can use the following command to set it.

gs_checkos -i B2
If the disk configuration status (A8) check item check result is Abnormal, you need to modify the disk mount format to: "rw,noatime,inode64,allocsize=16m".

Use the man mount command of linux to mount the XFS option:

rw,noatime,inode64,allocsize=16m
You can also set XFS options in the /etc/fstab file. For example:

/dev/data /data xfs rw,noatime,inode64,allocsize=16m 0 0
If the preread block size (A9) check item is Abnormal, you can use the following command to set it.

gs_checkos -i B3
If the result of the IO scheduling status (A10) check item is Abnormal, you can use the following command to set it.

gs_checkos -i B4
If the check result of the NIC configuration status (A11) check item is Warning, you can use the following command to set it.

gs_checkos -i B5
If the time consistency (A12) check item check result is Abnormal, check whether the ntp service is installed and started; and synchronize with the ntp clock source.

If the firewall status (A13) check item check result is Abnormal, you need to shut down the firewall service. Use the following commands to configure.

SuSE:

SuSEfirewall2 stop
RedHat7:

systemctl disable firewalld
systemctl stop firewalld
RedHat6:

service iptables stop
If the check result of the THP service (A14) check item is Abnormal, you can use the following command to set it.

gs_checkos -i B6