This topic describes how to view system or kernel parameters, enable or disable kdump, and obtain the Debuginfo packages, source code packages, and experimental software packages in Alibaba Cloud Linux 2 operating systems.
View or modify parameters
- View or modify system parameters
You can run the sysctl command to view or modify the runtime system parameters of Alibaba Cloud Linux 2. Alibaba Cloud Linux 2 has the following kernel configuration parameters updated in the /etc/sysctl.d/50-aliyun.conf file.
System parameter Description kernel.hung_task_timeout_secs = 240
Increases the kernel hung_task timeout period in seconds to prevent frequent hung_task prompts. kernel.panic_on_oops = 1
Throws the kernel panic exception when an Oops error occurs in the kernel. System failure details are automatically captured if kdump is configured. kernel.watchdog_thresh = 50
Sets the thresholds for events such as high resolution timer (hrtimer), non-maskable interrupt (NMI), soft lockup, and hard lockup to prevent potential kernel false positives. kernel.hardlockup_panic = 1
Throws the kernel panic exception when a hard lockup error occurs in the kernel. System failure details are automatically captured if kdump is configured. - View kernel parameters
You can run the
cat /proc/cmdline
command to view the runtime kernel parameters of Alibaba Cloud Linux 2. Alibaba Cloud Linux 2 has the following kernel parameters updated.Kernel parameter Description crashkernel=0M-2G:0M,2G-8G:192M,8G-:256M
Reserves memory space for kdump. cryptomgr.notests
Disables crypto self-check during kernel startup to accelerate system startup. cgroup.memory=nokmem
Disables the kernel memory statistics feature of the memory cgroup to prevent potential kernel instability. rcupdate.rcu_cpu_stall_timeout=300
Increases the timeout threshold of RCU CPU Stall Detector to 300 seconds to prevent kernel false positives.
Enable or disable kdump
- Run the following commands in sequence to enable the kdump service:
# Enable the kdump service. sudo systemctl enable kdump.service # Restart the kdump service. sudo systemctl restart kdump.service
- Run the following commands in sequence to return the memory address space reserved by the kdump service to the operating system and disable the kdump service:
# Change the configurations in the /sys/kernel/kexec_crash_size file. sudo sh -c 'echo 0 > /sys/kernel/kexec_crash_size' # Disable the kdump service. sudo systemctl disable kdump.service # Stop the kdump service. sudo systemctl stop kdump.service
Note After the memory address space reserved by the kdump service is returned to the operating system, you must restart the operating system before you can re-enable the kdump service.
Obtain the Debuginfo package and the source code package
- Run the following commands in sequence to obtain the Debuginfo package:
# Install yum-utils. sudo yum install -y yum-utils # Install the Debuginfo package. In the command, packageName specifies the name of the software package that you want to install. sudo debuginfo-install -y <packageName>
- Run the following commands in sequence to obtain the source code package:
# Install the source code. sudo yum install -y alinux-release-source # Install yum-utils. sudo yum install -y yum-utils # Install the source code package. In the command, sourcePackageName specifies the name of the software package that you want to install. sudo yumdownloader --source <sourcePackageName>
Use experimental software packages
Experimental software packages are provided by Alibaba Cloud, but are not fully tested. Alibaba Cloud does not guarantee the quality of these packages. Alibaba Cloud Linux 2 provides the following types of experimental packages:
- Experimental software packages that serve regular purposes. Examples:
Golang 1.12
Golang 1.13
Run the following commands in sequence to install an experimental software package:
# Enable support for the YUM repository. sudo yum install -y alinux-release-experimentals # Query the name and version of an experimental software package that serves regular purposes. Example:
golang
. sudo yum list <packageName> --showduplicates # Install an experimental software package that serves regular purposes. In the command, <packageName>-specifies the name of the software package that you want to install. <pacakgeVersion> specifies the version of the software package that you want to install. Example:golang-1.13.6
. sudo yum install -y <packageName>-<pacakgeVersion> - Development kits that support SCL plug-ins
- Development kit based on
GCC-7.3.1
: devtoolset-7 - Development kit based on
GCC-8.2.1
: devtoolset-8 - Development kit based on
GCC-9.1.1
: devtoolset-9 - Development kit based on
GCC-10.2.1
: devtoolset-10 - Development kit based on
GCC-11.2.1
: devtoolset-11
Run the following commands in sequence to install an experimental software package:
# Install
scl-utils
. sudo yum install -y scl-utils # Enable support for the YUM repository. sudo yum install -y alinux-release-experimentals # Install the software packages that you need from the YUM repository. The following sample commands are run to install all development kits that support SCL plug-ins: sudo yum install -y devtoolset-7-gcc devtoolset-7-gdb devtoolset-7-binutils devtoolset-7-make sudo yum install -y devtoolset-8-gcc devtoolset-8-gdb devtoolset-8-binutils devtoolset-8-make sudo yum install -y devtoolset-9-gcc devtoolset-9-gdb devtoolset-9-binutils devtoolset-9-make sudo yum install -y devtoolset-10-gcc devtoolset-10-gdb devtoolset-10-binutils devtoolset-10-make sudo yum install -y devtoolset-11-gcc devtoolset-11-gdb devtoolset-11-binutils devtoolset-11-makeAfter the software packages are installed, you can use the later versions of GNU Compiler Collection (GCC) and related tools. Sample commands:# Specify a repository name to view an existing SCL. In this example, the devtoolset-7 repository is used. scl -l devtoolset-7 # Run the related SCL software. scl enable devtoolset-7 'gcc --version'
- Development kit based on