gs_checkos
Background
gs_checkos helps you check information about the OS version, control parameters, and disk configurations, and configure control parameters, I/O parameters, network parameters, and THP services.
Prerequisites
The hardware and network are working properly.
The trust relationship of user root among the hosts is normal.
Only user root is authorized to run the gs_checkos command.
NOTE:
This tool cannot be invoked independently. For security purposes, it will be automatically deleted after the preinstallation is complete in enterprise-edition installation mode.
Syntax
Check OS information.
gs_checkos -i ITEM [-f HOSTFILE] [-h HOSTNAME] [-X XMLFILE] [--detail] [-o OUTPUT] [-l LOGFILE]
Display help information.
gs_checkos -? | --help
Display the version number.
gs_checkos -V | --version
Parameter Description
-i
Specifies the number of a check item. The format is -i A, -i B1, and -i A1 -i A2 or -i A1,A2.
Value range: A1 to A14 and B1 to B8
NOTE:
Items from A1 to A14 indicate that OS parameters need to be checked but not to be set. Items from B1 to B8 indicate that system parameters need to be set to expected values. Items A and items B cannot be simultaneously set.
Table 1 lists the check items.
-f
Specifies the file of a host name list.
NOTE: -The -f and -h parameters cannot be used together.
Value range: a host name list
-h
Specifies the name of a host to be checked. You can specify multiple hosts and separate the host names with commas (,).
Value range: openGauss host name. If no host is specified, the current host is checked.
-X
Specifies the openGauss XML configuration file.
--detail
Displays detailed check results.
-o
Specifies the file for saving OS check reports.
If this parameter is not specified, OS check results are displayed on the screen.
-l
Specifies a log file and its storage path.
Default value: /tmp/gs_checkos/gs_checkos-YYYY-MM-DD_hhmmss.log
-?, --help
Display the help information.
-V, --version
Displays version information.
Table 1 OS check items
Check the OS version. Ensure that the host platform supports openEuler or CentOS. In addition, you need to ensure that the all host platforms of openGauss belong to the same hybrid range. | ||
Check the character set. Ensure that the character sets of openGauss hosts are consistent. | ||
Checks the time zone setting. Ensure that the time zones of openGauss hosts are consistent. | ||
Check the | Check the swap partition. Ensure that the swap partition size of each host is less than or equals to the total memory size of the host. | |
Check the kernel parameter. Ensure that the parameter value of the current kernel is consistent with the default value. For details, see OS Parameters. | ||
Check the system file handle. Ensure that the parameter value of the system file handle is greater than or equal to 1,000,000. Check the thread stack size. Ensure that the size is greater than or equal to 3072 KB. Check the maximum available virtual memory of processes. Ensure that the maximum available virtual memory of system processes is unlimited. | ||
Check the hard disk mounting parameter. Ensure that the disk format is XFS and its mounting mode is rw,noatime,inode64,allocsize=16m. | ||
Checks the pre-read parameter. Ensure that the expected value of the pre-read parameter is 16384. | ||
The | Checks the I/O scheduling policy. Ensure that the I/O scheduling policy is deadline. | |
Check the NIC smaller than 10GE.
Check the NIC larger than or equal to 10GE.
| ||
Check the time consistency status. Ensure that the NTP service is started and the system time deviation of each host does not exceed 60s. | ||
Check the firewall status. Ensure that the firewall is disabled. | ||
Check the THP service status. Ensure that the THP service is disabled. | ||
Set the kernel parameter. When the actual value does not meet check requirements, reset the parameter whose result is **Abnormal**. Do not set the **Warning** parameter here. You can set the value of **Warning** as needed. | ||
Sets the system file handle. When the parameter value of the system file handle is less than 1000000, reset the parameter. Set the thread stack size. Ensure that the size is greater than or equal to 3072 KB. Set the maximum available virtual memory of processes: If the maximum available virtual memory of system processes is not unlimited, change it to unlimited. | ||
Set the hard disk pre-read parameter: When the actual value is less than 16384, reset the parameter. | ||
Set the I/O configuration item. If the actual value of the system is not deadline, reset the parameter. | ||
Sets the 10GE NIC parameters. Set the rx and tx parameters that do not meet 10GE NIC requirements. Do not set the mtu parameter. | ||
Set the THP service. If the THP service is enabled, disable it. | ||
Check EulerOS attributes. Set the value of RemoveIPC in files /usr/lib/systemd/system/systemd-logind.service and /etc/systemd/logind.conf to no. | ||
Set a remote device to inherit default system resources. Modify the /etc/pam.d/sshd service file and add the session required pam_limits.so configuration item to control resources used by users. |
NOTE:
A6 is checked based on the [/etc/sysctl.conf] and [SUGGEST:/etc/sysctl.conf] domains in the check_list.conf configuration file. If the parameter value in [/etc/sysctl.conf] differs from the actual value, An Abnormal message is displayed during the check of A6. You can set the parameter by using B1. If the parameter value in [SUGGEST:/etc/sysctl.conf] differs from the actual value, a Warning message is displayed during the check of A6. B1 does not set the parameter. You need to manually set the parameter as needed.
A7 is checked based on the open file parameter in the [/etc/security/limits.conf] domain in the check_list.conf configuration file. You can set the parameter using B2.
The mtu, rx, and tx parameters of item A11 need to be checked based on the [/sbin/ifconfig] domain in the check_list.conf configuration file. You can set the rx and tx parameters using item B5 and set the mtu parameter manually.
Use configured gs_checkos kernel parameter value and file handles parameter value to restart the new session.
OS Parameters
Table 2 OS parameters
File System Parameters
soft nofile
Indicates the soft limit. The number of file handles used by a user can exceed this value, but an alarm message will be sent if the value is exceeded.
Recommended value: 1000000
hard nofile
Indicates the hard limit. The number of file handles used by a user cannot exceed this value.
Recommended value: 1000000
stack size
Specifies the thread stack size.
Recommended value: 3072
Examples
Run the following commands to check the OS parameters:
gs_checkos -i A -h plat1 -X /opt/software/openGauss/clusterconfig.xml --detail -o /var/log/checkos
Performing operation system check/set. Output the result to the file /var/log/checkos.
Operation system check/set is completed.
Total numbers:14. Abnormal numbers:0. Warning number:1.
Query check results.
vim /var/log/checkos
Checking items:
A1. [ OS version status ] : Normal
A2. [ openGauss 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