All Products
Search
Document Center

Alibaba Cloud Linux:Use Alibaba Cloud Linux 2

Last Updated:Dec 16, 2024

This topic describes how to view or modify system or kernel parameters, enable or disable kdump, and install the Debuginfo packages, source code packages, and experimental software packages on 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-related system 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 enabled.

    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 enabled.

  • 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

Alibaba Cloud Linux 2 provides the kdump service. After this service is enabled, kernel errors can be captured to help you analyze kernel failures.

Note

If the memory of the selected instance type does not exceed 2 GiB, the kdump service cannot be used.

  • 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.

Install the Debuginfo package and the source code package

  • Run the following commands in sequence to install 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 package that you want to install.
    sudo debuginfo-install -y <packageName>
  • Run the following commands in sequence to install 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 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

    • Golang 1.12

    • Golang 1.13

    Run the following commands in sequence to install an experimental software package:

    # Enable support for Yellowdog Updater Modified (YUM) repositories.
    sudo yum install -y alinux-release-experimentals
    # 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.
    sudo yum install -y <packageName>
  • 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

    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 require 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

    After 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'

FAQ

What do I do if the Debuginfo package fails to be installed?

If you cannot install the Debuginfo package by running the sudo debuginfo-install -y <packageName> command as described in the Install the Debuginfo package and the source code package section of this topic, run the following command to install the Debuginfo package.

Replace <packageName> with the name of the package that you want to install. Example: kernel-debuginfo.

sudo yum install --enablerepo=*-debug <packageName>