gs_checkos
Context
gs_checkos helps you check the OS version information, 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.
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 version information.
gs_checkos -V | --version
Parameter Description
-i
Specifies the number of a check item. The format is -i A, -i B1, -i A1 -i A2, or - i A1,A2.
Value range: A1…A14 and B1…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.For details, see Table 1.
-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 hosts with commas (,).
Value range: a host name of openGauss. If no host is specified, the current host is checked.
-X
Specifies the XML configuration file of openGauss.
--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 save path.
Default value: /tmp/gs_checkos/gs_checkos-YYYY-MM-DD_hhmmss.log
-?, --help
Displays help information.
-V, --version
Displays version information.
Table 1 OS check items
Check the OS version. Ensure that the host platform supports SUSE11, SUSE12, RHEL, 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 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 1000000. Check the thread stack size: Ensure that the thread 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". | ||
Check the pre-read parameter. Ensure that the expected value of the pre-read parameter is 16384. | ||
Check 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 10GE.
| ||
Check the time consistency status. Ensure that the NTP service is started and the system time deviation of each openGauss 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. | ||
Sets 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 parameter of system file handles. Set the number of system file handles if it is less than 1000000. Set the thread stack size. Set the thread stack size if it is less than 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. | ||
Set 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:
- Item A6 needs to be 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 item A6. You can set the parameter in item B1.
If the parameter value in [SUGGEST:/etc/sysctl.conf] differs from the actual value, a Warning message is displayed during the check of item A6. You can manually set the parameter in item B1 as needed.- Item A7 checks items specified by the open file parameter in the [/etc/security/ limits.conf] domain in the check_list.conf configuration file. You can set the parameter in item 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 restriction. The number of file handles used by a user can exceed this setting value, but an alarm message will be sent if the value is exceeded.
Recommended value: 1000000
hard nofile
Indicates the hard restriction. The number of file handles used by a user cannot exceed this setting value.
Recommended value: 1000000
stack size
Indicates 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