diff --git a/docs/en/server/_toc.yaml b/docs/en/server/_toc.yaml index 9ecb6d553752433367f6e776c75d6c8644226d0c..b6e6b174b0c156da3aca883dc9de848b2577be6d 100644 --- a/docs/en/server/_toc.yaml +++ b/docs/en/server/_toc.yaml @@ -19,7 +19,9 @@ sections: - href: ./maintenance/gala/_toc.yaml - href: ./maintenance/sysmonitor/_toc.yaml - href: ./maintenance/kernel_live_upgrade/_toc.yaml - - href: ./maintenance/syscare/_toc.yaml + - href: + upstream: https://gitee.com/openeuler/syscare/blob/openEuler-24.03-LTS-SP2/docs/en/_toc.yaml + path: ./syscare - href: ./maintenance/common_skills/_toc.yaml - href: ./maintenance/common_tools/_toc.yaml - href: ./maintenance/troubleshooting/_toc.yaml @@ -55,18 +57,22 @@ sections: sections: - href: upstream: https://gitee.com/openeuler/oeAware-manager/blob/master/docs/en/2403_lts_sp2/_toc.yaml + path: ./performance/tuning_framework/oeaware - label: CPU Optimization sections: - href: ./performance/cpu_optimization/sysboost/_toc.yaml - href: ./performance/cpu_optimization/kae/_toc.yaml - label: System Optimization sections: - - href: ./performance/system_optimzation/atune/_toc.yaml + - href: + upstream: https://gitee.com/openeuler/A-Tune/blob/master/docs/en/24.03_LTS_SP2/_toc.yaml + path: ./performance/system_optimization/atune - label: Application Development sections: - href: ./development/application_dev/_toc.yaml - href: upstream: https://gitee.com/openeuler/compiler-docs/blob/openEuler-24.03-LTS-SP2/docs/en/gcc/_toc.yaml + path: ./compiler - label: High Availability sections: - href: ./high_availability/ha/_toc.yaml diff --git a/docs/en/server/maintenance/syscare/_toc.yaml b/docs/en/server/maintenance/syscare/_toc.yaml deleted file mode 100644 index c1a1b9545af2480b9e61b79900263954192929b3..0000000000000000000000000000000000000000 --- a/docs/en/server/maintenance/syscare/_toc.yaml +++ /dev/null @@ -1,17 +0,0 @@ -label: SysCare User Guide -isManual: true -description: Online hot patching -sections: - - label: SysCare User Guide - href: ./syscare_user_guide.md - sections: - - label: SysCare Introduction - href: ./syscare_introduction.md - - label: SysCare Installation - href: ./installing_syscare.md - - label: SysCare Usage - href: ./using_syscare.md - - label: Constraints - href: ./constraints.md - - label: Common Issues and Solutions - href: ./faqs_and_solutions.md diff --git a/docs/en/server/maintenance/syscare/constraints.md b/docs/en/server/maintenance/syscare/constraints.md deleted file mode 100644 index c97ca8e954b7139fbb9f0b8f1ffa0174e2a452b1..0000000000000000000000000000000000000000 --- a/docs/en/server/maintenance/syscare/constraints.md +++ /dev/null @@ -1,37 +0,0 @@ -# Constraints - -## Version Constraints - -OS version: openEuler openEuler 22.03 LTS SP1 -Architecture: x86 or AArch64 - -## Application Constraints - -Currently, user-mode patches support only Redis and Nginx. - -Note: - -1. Currently, each software needs to be adapted to process the LINE macro. Currently, only Redis and Nginx are adapted. Other software that is not adapted may cause the patch size to be too large. (Parameters will be introduced in the future to support user adaptation.) -2. Each user-mode live patch can contain only one ELF file. To fix multiple bugs, you can pass the patch files of multiple bug fixes to the patch making parameters to make a live patch for multiple bugs. - -## Language Constraints - -Theoretically, patches are compared at the object file level, which is irrelevant to the programming language. Currently, only the C and C++ languages are tested. - -## Others - -- Only 64-bit OSs are supported. -- Only the ELF format can be hot-patched. Interpreted languages are not supported. -- Only GCC and G++ compilers are supported. -- The compiler must support the `-gdwarf`, `-ffunction-sections`, and `-fdata-sections` parameters. -- The debug information must be in the DWARF format. -- Cross compilation is not supported. -- Source files that are in different paths but have the same file name, same global variables, and same functions cannot be recognized. -- Assembly code, including **.S** files and inline assembly code, cannot be modified. -- External symbols (dynamic library dependencies) cannot be added. -- Multiple patches cannot be applied to the same binary file. -- Mixed compilation of C and C++ is not supported. -- C++ exceptions cannot be modified. -- The `-g3` group section compilation option, specific compilation optimization options, and specific GCC plugins are not supported. -- ifunc cannot be added by using `__attribute__((ifunc("foo")))`. -- TLS variables cannot be added by using `__thread int foo`. diff --git a/docs/en/server/maintenance/syscare/faqs_and_solutions.md b/docs/en/server/maintenance/syscare/faqs_and_solutions.md deleted file mode 100644 index 0203440f4d006419efe239298ca85ce3a09edf81..0000000000000000000000000000000000000000 --- a/docs/en/server/maintenance/syscare/faqs_and_solutions.md +++ /dev/null @@ -1,19 +0,0 @@ -# Common Issues and Solutions - -## Issue 1: "alloc upatch module memory failed" - -Possible cause: The SELinux constraint is triggered. - -Solution: Manually add policies according to the error. The policies to be added vary according to the actual situation. For details, see . - -## Issue 2: "patch file error 2" - -Possible cause: The patch cannot be detected. - -Solution: Use another patch. - -## Issue 3: "build project error 11" - -Possible cause: The source package fails to be compiled. - -Solution: Run `rpmbuild -ra *.src.rpm` to check if the source package can be compiled and the compilation dependencies are satisfied. diff --git a/docs/en/server/maintenance/syscare/figures/syscare_arch.png b/docs/en/server/maintenance/syscare/figures/syscare_arch.png deleted file mode 100644 index e8c931ad3ba6743224ffa133808f8b66239ce486..0000000000000000000000000000000000000000 Binary files a/docs/en/server/maintenance/syscare/figures/syscare_arch.png and /dev/null differ diff --git a/docs/en/server/maintenance/syscare/installing_syscare.md b/docs/en/server/maintenance/syscare/installing_syscare.md deleted file mode 100644 index 65ea6ed23e22b30b599589aa8c00bbb42170f281..0000000000000000000000000000000000000000 --- a/docs/en/server/maintenance/syscare/installing_syscare.md +++ /dev/null @@ -1,51 +0,0 @@ -# Installing SysCare - -This chapter describes how to install SysCare on openEuler. - -## Installing SysCare Core Components - -### Minimum Hardware Requirements - -* 2 CPUs (x86_64 or AArch64) -* 4 GB memory -* 100 GB drive - -### Prerequisites - -1. openEuler 24.03 LTS SP1 has been installed. - -### Installing from Source - -Clone the SysCare source code and then compile and install SysCare. - -Before compilation, install dependencies: - -```shell -dnf install cmake make rust cargo kernel-devel elfutils-libelf-devel llvm clang bpftool libbpf libbpf-devel libbpf-static -``` - -Compile and install SysCare: - -```shell -git clone https://gitee.com/openeuler/syscare.git -cd syscare -mkdir build -cd build -cmake -DCMAKE_INSTALL_PREFIX=/usr -DKERNEL_VERSION=$(uname -r) .. -make -make install -``` - -### Installing SysCare from a Repository - -If the repository source contains SysCare packages, you can use the `dnf` or `yum` command to download and install them. - -```shell -dnf/yum install syscare syscare-kmod syscare-build syscare-build-ebpf -``` - -### Uninstalling SysCare - -```shell -dnf/yum erase syscare syscare-kmod syscare-build syscare-build-ebpf -``` diff --git a/docs/en/server/maintenance/syscare/syscare_introduction.md b/docs/en/server/maintenance/syscare/syscare_introduction.md deleted file mode 100644 index 17c05d1368dda9dd18380122ac23d1d1cd3c15b0..0000000000000000000000000000000000000000 --- a/docs/en/server/maintenance/syscare/syscare_introduction.md +++ /dev/null @@ -1,22 +0,0 @@ -# Introduction to SysCare - -## Overview - -SysCare is an online live patching tool that automatically fixes bugs and vulnerabilities in OS components, such as kernels, user-mode services, and dynamic libraries. - -![img](./figures/syscare_arch.png) - -## SysCare Functions - -SysCare supports live patching for kernels and user-mode services: - -1. One-click creation - SysCare is a unified environment for both kernel- and user-mode live patches that ignores differences between patches, ensuring they can be created with just one click. -2. Patch lifecycle operations - SysCare provides a unified patch management interface for users to install, activate, uninstall, and query patches. - -## SysCare Technologies - -1. Unified patches: SysCare masks differences in detail when creating patches, providing a unified management tool to improve O&M efficiency. -2. User-mode live patching: SysCare supports live patching of multi-process and multi-thread services in user mode, which takes effect when a process or thread is started or restarted. -3. Lazy mechanism: SysCare fixes the ptrace defect (all kernel calls are ended) and improves the fix success rate. diff --git a/docs/en/server/maintenance/syscare/syscare_user_guide.md b/docs/en/server/maintenance/syscare/syscare_user_guide.md deleted file mode 100644 index f16dbf170ce949d9af6db5e57c032f7c98d957fe..0000000000000000000000000000000000000000 --- a/docs/en/server/maintenance/syscare/syscare_user_guide.md +++ /dev/null @@ -1,11 +0,0 @@ -# SysCare User Guide - -This document describes how to install and use SysCare on openEuler. - -## Intended Audience - -This document is intended for openEuler users who need to use hot patches. Users must: - -* Know basic Linux operations. -* Understand core software compilation concepts. -* Have working knowledge of RPM packages and their build processes. diff --git a/docs/en/server/maintenance/syscare/using_syscare.md b/docs/en/server/maintenance/syscare/using_syscare.md deleted file mode 100644 index 3fe274a103c62c7b1c07a560edf74ce073a16f72..0000000000000000000000000000000000000000 --- a/docs/en/server/maintenance/syscare/using_syscare.md +++ /dev/null @@ -1,359 +0,0 @@ -# Using SysCare - -This chapter describes how to use SysCare on openEuler. - -## Prerequisites - -openEuler 24.03 LTS SP1 has been installed. - -## SysCare Usage - -This chapter describes how to use SysCare, covering both hot patch creation and management. - -### Hot Patch Creation - -Users can create hot patches using the `sycare build` command. This command is a pure CLI tool that generates hot patch packages from RPM packages. The hot patch packages are packaged and maintained as RPM packages and support the creation of both kernel and user-space hot patches. - -#### Hot Patch Creation Process - -1. Prepare the source RPM package and the debuginfo RPM package for the target software. - - Example: - - ```shell - yumdownloader kernel --source --debuginfo - ``` - -2. Ensure that the necessary compilation dependencies for the corresponding software are met. - - Example: - - ```shell - dnf install make gcc bison flex openssl-devel dwarves python3-devel elfutils-libelf-devel - ``` - -3. Execute the `syscare build` command to build the hot patch. - - Example: - - ```shell - syscare build \ - --patch_name HP001 \ - --source kernel-5.10.0-60.66.0.91.oe2203.src.rpm \ - --debuginfo kernel-debuginfo-5.10.0-60.66.0.91.oe2203.x86_64.rpm \ - --output output \ - --patch 001-kernel-patch-test.patch - ``` - - During the hot patch creation process, a temporary folder starting with `syscare-build` will be created in the directory specified by the `--workdir` parameter (defaulting to the current directory). This folder will store temporary files and compilation logs. - - Example: - - ```shell - dev@openeuler-dev:[~]$ ls -l syscare-build.111602/ - total 100 - -rw-r--r--. 1 dev dev 92303 Nov 12 00:00 build.log - drwxr-xr-x. 6 dev dev 4096 Nov 12 00:00 package - drwxr-xr-x. 4 dev dev 4096 Nov 12 00:00 patch - ``` - - The compilation log, named `build.log`, will be generated within the temporary folder. - - ```shell - dev@openeuler-dev:[~]$ cat syscare-build.111602/build.log | less - ``` - - If the patch is successfully created and the `--skip-compiler-check` parameter is not used, the temporary folder will be automatically removed. - -4. Check the build results. - - Example: - - ```shell - dev@openeuler-dev:[~]$ ls -l - total 189680 - -rw-r--r--. 1 dev dev 194218767 Nov 12 00:00 kernel-5.10.0-60.91.0.115.oe2203-HP001-1-1.x86_64.src.rpm - -rw-r--r--. 1 dev dev 10937 Nov 12 00:00 patch-kernel-5.10.0-60.91.0.115.oe2203-HP001-1-1.x86_64.rpm - ``` - - Here: - - - `patch-kernel-5.10.0-60.91.0.115.oe2203-HP001-1-1.x86_64.rpm` is the patch package. - - `kernel-5.10.0-60.91.0.115.oe2203-HP001-1-1.x86_64.src.rpm` is the source RPM package. - -#### Hot Patch Creation Tool - -```shell -USAGE: - syscare build [OPTIONS] --patch_name --source --debuginfo ... --patch ... - -OPTIONS: - -n, --patch_name Patch name - --patch_arch Patch architecture [default: x86_64] - --patch_version Patch version [default: 1] - --patch_release Patch release [default: 1] - --patch_description Patch description [default: (none)] - -s, --source Source package - -d, --debuginfo ... Debuginfo package(s) - --workdir Working directory [default: .] - -o, --output Output directory [default: .] - -j, --jobs Parllel build jobs [default: 96] - --skip_compiler_check Skip compiler version check (not recommended) - --skip_cleanup Skip post-build cleanup - -v, --verbose Provide more detailed info - -p, --patch ... Patch file(s) - -h, --help Prints help information - -V, --version Prints version information -``` - -| Name | Description | Type | Notes | -| ----------------------------------------- | ------------------------------------------------------ | ------ | ------------------------------------------------------------------------------ | -| -n, --patch_name `` | Patch name | String | Required parameter; must comply with RPM naming conventions. | -| --patch_arch `` | Patch architecture | String | Defaults to the current architecture; must comply with RPM naming conventions. | -| --patch_version `` | Patch version number | String | Default value is 1; must comply with RPM naming conventions. | -| --patch_release `` | Patch release | Number | Default value is 1; must comply with RPM naming conventions. | -| --patch_description `` | Patch description | String | Defaults to (none). | -| -s, --source `` | Path to the target software's src.rpm source package. | String | Required parameter; must be a valid path. | -| -d, --debuginfo `...` | Path(s) to the target software's debuginfo package(s). | String | Required parameter; multiple can be specified; must be a valid path. | -| --workdir `` | Path to the temporary working directory. | String | Defaults to the current execution directory; must be a valid path. | -| -o, --output `` | Output folder for the generated patch. | String | Defaults to the current execution directory; must be a valid path. | -| -j, --jobs `` | Number of parallel compilation threads. | Number | Defaults to the number of CPU threads. | -| --skip-compiler-check | Skip the compiler version check (not recommended). | Flag | - | -| --skip-cleanup | Skip the cleanup of temporary files after the build. | Flag | - | -| -v, --verbose | Print detailed information. | Flag | - | -| -p, --patch `...` | Path(s) to the patch file(s). | String | Required parameter; multiple can be specified; must be a valid path. | -| -h, --help | Print help information. | Flag | - | -| -V, --version | Print version information. | Flag | - | -| | | | | - -Example: - -```shell -syscare build \ - --patch_name \"HP001\" \\ - --patch_description \"CVE-2021-32675 - When parsing an incoming Redis Standard Protocol (RESP) request, Redis allocates memory according to user-specified values which determine the number of elements (in the multi-bulk header) and size of each element (in the bulk header). An attacker delivering specially crafted requests over multiple connections can cause the server to allocate significant amount of memory. Because the same parsing mechanism is used to handle authentication requests, this vulnerability can also be exploited by unauthenticated users.\" \\ - --source ./redis-6.2.5-1.src.rpm \\ - --debuginfo ./redis-debuginfo-6.2.5-1.x86_64.rpm \\ - --output ./output \\ - --patch ./0001-Prevent-unauthenticated-client-from-easily-consuming.patch -``` - -#### Hot Patch Package Naming Convention - -- Hot patch package: `patch----..rpm` -- Hot patch source package: `---..src.rpm` - -#### Package Contents - -- Hot patch package: Contains SysCare hot patch binaries and metadata for patch installation -- Hot patch source package: Includes target software source code and additional patch files for creating new hot patch versions - -#### Troubleshooting - -If errors occur during hot patch creation, check the compilation log named `build.log` in the working directory. - -Example: - -```shell -Building patch, this may take a while -- Preparing build requirements -- Building patch -Error: UserPatchBuilder: Failed to build patch - -Caused by: - Process "/usr/libexec/syscare/upatch-build" exited unsuccessfully, exit_code=253 -For more information, please check "/home/dev/syscare-build.345549/build.log" -``` - -### Hot Patch Package Management - -Installing or uninstalling hot patches requires specifying the corresponding RPM package name, denoted here as `$patch_package`. - -1. Installing a hot patch package - - ```shell - dnf install $patch_package.rpm - ``` - - After installation, hot patch files are stored in: - /usr/lib/syscare/patches - -2. Uninstalling a hot patch package - - ```shell - dnf remove $patch_package - ``` - - Note: Hot patches in `ACTIVED` state or higher will be automatically uninstalled. - -### Hot Patch Management - -The `syscare` command is used to manage hot patches. - -To operate on a specific hot patch, users must provide a search string (denoted as `$patch_identifier`). - -Search follows these rules: `/`. The `/` prefix can be omitted if the patch name is unique. UUID can also be used for management. - -- Target package name: Name of the software package to be patched -- Patch name: Name of the hot patch - -#### Patch Metadata - -Patch metadata includes the following fields: - -| Field | Description | -| ----------- | ------------------------- | -| uuid | Unique patch identifier | -| name | Patch name | -| version | Version number | -| release | Release number | -| arch | Architecture | -| type | Patch type | -| target | Target software name | -| entities | Executable files affected | -| digest | Cryptographic fingerprint | -| license | Software license | -| description | Patch details | -| patch | List of patch files | - -### Hot Patch Package Management - -Installing or uninstalling hot patches requires specifying the corresponding RPM package name, denoted here as `$patch_package`. - -1. Installing a hot patch package - - ```shell - dnf install $patch_package.rpm - ``` - - After installation, hot patch files are stored in: - /usr/lib/syscare/patches - -2. Uninstalling a hot patch package - - ```shell - dnf remove $patch_package - ``` - - Note: Hot patches in `ACTIVED` state or higher will be automatically uninstalled. - -### Hot Patch Management - -The `syscare` command is used to manage hot patches. - -To operate on a specific hot patch, users must provide a search string (denoted as `$patch_identifier`). - -Search follows these rules: `/`. The `/` prefix can be omitted if the patch name is unique. UUID can also be used for management. - -- Target package name: Name of the software package to be patched -- Patch name: Name of the hot patch - -#### Patch Metadata - -Patch metadata includes the following fields: - -| Field | Description | -| ----------- | ------------------------- | -| uuid | Unique patch identifier | -| name | Patch name | -| version | Version number | -| release | Release number | -| arch | Architecture | -| type | Patch type | -| target | Target software name | -| entities | Executable files affected | -| digest | Cryptographic fingerprint | -| license | Software license | -| description | Patch details | -| patch | List of patch files | - -Example: - -```shell -sudo syscare info redis-6.2.5-1/HP002-1-1 -uuid: 980fa0d0-e753-447c-8494-01de595f35d0 -name: HP002 -version: 1 -release: 1 -arch: x86_64 -type: UserPatch -target: redis-6.2.5-1 -target_elf: redis-server, redis-benchmark, redis-cli -license: BSD and MIT -description: CVE-2021-32675 - When parsing an incoming Redis Standard Protocol (RESP) request, Redis allocates memory according to user-specified values which determine the number of elements (in the multi-bulk header) and size of each element (in the bulk header). An attacker delivering specially crafted requests over multiple connections can cause the server to allocate significant amount of memory. Because the same parsing mechanism is used to handle authentication requests, this vulnerability can also be exploited by unauthenticated users. -patch: -0001-Prevent-unauthenticated-client-from-easily-consuming.patch -``` - -#### Hot Patch States - -SysCare categorizes the hot patch lifecycle into these states: - -- Unloaded: `NOT-APPLIED` -- Inactive: `DEACTIVED` -- Active: `ACTIVED` -- Accepted: `ACCEPTED` - -#### Patch Information Queries - -1. View basic patch information: - - ```shell - syscare info $patch_identifier - ``` - -2. Check patch status: - - ```shell - syscare status $patch_identifier - ``` - -3. List all patch statuses: - - ```shell - syscare list - ``` - -#### Hot Patch State Management - -1. Load a patch: - - ```shell - syscare apply $patch_identifier - ``` - -2. Unload a patch: - - ```shell - syscare remove $patch_identifier - ``` - -3. Activate a patch: - - ```shell - syscare active $patch_identifier - ``` - -4. Deactivate a patch: - - ```shell - syscare deactive $patch_identifier - ``` - -5. Accept a patch: - - ```shell - syscare accept $patch_identifier - ``` - -6. Save all patch states: - - ```shell - syscare save - ``` - -7. Restore all patch states: - - ```shell - syscare restore - ``` diff --git a/docs/en/server/performance/system_optimzation/atune/_toc.yaml b/docs/en/server/performance/system_optimzation/atune/_toc.yaml deleted file mode 100644 index 571a4d42a188db5071ab40f63511a0e5df89c59a..0000000000000000000000000000000000000000 --- a/docs/en/server/performance/system_optimzation/atune/_toc.yaml +++ /dev/null @@ -1,19 +0,0 @@ -label: A-Tune User Guide -isManual: true -description: Optimized openEuler performance through AI-powered, automated tuning -sections: - - label: A-Tune User Guide - href: ./a_tune.md - sections: - - label: Getting to Know A-Tune - href: ./getting_to_know_a_tune.md - - label: Installation and Deployment - href: ./installation_and_deployment.md - - label: Usage Instructions - href: ./usage_instructions.md - - label: Native-Turbo - href: ./native_turbo.md - - label: Appendix - href: ./appendix.md - - label: Common Issues and Solutions - href: ./faqs_and_solutions.md diff --git a/docs/en/server/performance/system_optimzation/atune/a_tune.md b/docs/en/server/performance/system_optimzation/atune/a_tune.md deleted file mode 100644 index b481797f5c97d2c5e477fe1a0c7a4b92f646d7b3..0000000000000000000000000000000000000000 --- a/docs/en/server/performance/system_optimzation/atune/a_tune.md +++ /dev/null @@ -1,5 +0,0 @@ -# A-Tune User Guide - -This document describes how to install and use A-Tune, which is a performance self-optimization software for openEuler. - -This document is intended for developers, open-source enthusiasts, and partners who use the openEuler system and want to know and use A-Tune. You need to have basic knowledge of the Linux OS. diff --git a/docs/en/server/performance/system_optimzation/atune/appendix.md b/docs/en/server/performance/system_optimzation/atune/appendix.md deleted file mode 100644 index 2561f9c60de35954665977265d48718cdf802de4..0000000000000000000000000000000000000000 --- a/docs/en/server/performance/system_optimzation/atune/appendix.md +++ /dev/null @@ -1,19 +0,0 @@ -# Appendix - -## Acronyms and Abbreviations - -**Table 1** Terminology - - - - - - - - - -

Term

-

Description

-

profile

-

Set of optimization items and optimal parameter configuration.

-
diff --git a/docs/en/server/performance/system_optimzation/atune/faqs_and_solutions.md b/docs/en/server/performance/system_optimzation/atune/faqs_and_solutions.md deleted file mode 100644 index 38a9d93493919182e8bcc05f45740b3f50aae64f..0000000000000000000000000000000000000000 --- a/docs/en/server/performance/system_optimzation/atune/faqs_and_solutions.md +++ /dev/null @@ -1,52 +0,0 @@ -# Common Issues and Solutions - -## Issue 1: An error occurs when the **train** command is used to train a model, and the message "training data failed" is displayed - -Cause: Only one type of data is collected by using the **collection**command. - -Solution: Collect data of at least two data types for training. - -## Issue 2: atune-adm cannot connect to the atuned service - -Possible cause: - -1. Check whether the atuned service is started and check the atuned listening address. - - ```shell - systemctl status atuned - netstat -nap | grep atuned - ``` - -2. The firewall blocks the atuned listening port. -3. The HTTP proxy is configured in the system. As a result, the connection fails. - -Solution: - -1. If the atuned service is not started, run the following command to start the service: - - ```shell - systemctl start atuned - ``` - -2. Run the following command on the atuned and atune-adm servers to allow the listening port to receive network packets. In the command, **60001** is the listening port number of the atuned server. - - ```shell - iptables -I INPUT -p tcp --dport 60001 -j ACCEPT - iptables -I INPUT -p tcp --sport 60001 -j ACCEPT - ``` - -3. Run the following command to delete the HTTP proxy or disable the HTTP proxy for the listening IP address without affecting services: - - ```shell - no_proxy=$no_proxy, Listening_IP_address - ``` - -## Issue 3: The atuned service cannot be started, and the message "Job for atuned.service failed because a timeout was exceeded." is displayed - -Cause: The hosts file does not contain the localhost information. - -Solution: Add localhost to the line starting with **127.0.0.1** in the **/etc/hosts** file. - -```text -127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 -``` diff --git a/docs/en/server/performance/system_optimzation/atune/figures/picture1.png b/docs/en/server/performance/system_optimzation/atune/figures/picture1.png deleted file mode 100644 index 52d496e95f06ef8636730dbbc1aa84d88aea6a34..0000000000000000000000000000000000000000 Binary files a/docs/en/server/performance/system_optimzation/atune/figures/picture1.png and /dev/null differ diff --git a/docs/en/server/performance/system_optimzation/atune/figures/picture4.png b/docs/en/server/performance/system_optimzation/atune/figures/picture4.png deleted file mode 100644 index 85d57aa2024615a6f0fbff5a7d2a207941eb3085..0000000000000000000000000000000000000000 Binary files a/docs/en/server/performance/system_optimzation/atune/figures/picture4.png and /dev/null differ diff --git a/docs/en/server/performance/system_optimzation/atune/figures/zh-cn_image_0213178479.png b/docs/en/server/performance/system_optimzation/atune/figures/zh-cn_image_0213178479.png deleted file mode 100644 index d245d48dc07e2b01734e21ec1952e89fa9269bdb..0000000000000000000000000000000000000000 Binary files a/docs/en/server/performance/system_optimzation/atune/figures/zh-cn_image_0213178479.png and /dev/null differ diff --git a/docs/en/server/performance/system_optimzation/atune/figures/zh-cn_image_0213178480.png b/docs/en/server/performance/system_optimzation/atune/figures/zh-cn_image_0213178480.png deleted file mode 100644 index a32856aa08e459ed0f51f8fcf4c2f51511c12095..0000000000000000000000000000000000000000 Binary files a/docs/en/server/performance/system_optimzation/atune/figures/zh-cn_image_0213178480.png and /dev/null differ diff --git a/docs/en/server/performance/system_optimzation/atune/figures/zh-cn_image_0214540398.png b/docs/en/server/performance/system_optimzation/atune/figures/zh-cn_image_0214540398.png deleted file mode 100644 index cea2292307b57854aa629ec102a5bc1b16d244a0..0000000000000000000000000000000000000000 Binary files a/docs/en/server/performance/system_optimzation/atune/figures/zh-cn_image_0214540398.png and /dev/null differ diff --git a/docs/en/server/performance/system_optimzation/atune/figures/zh-cn_image_0227497000.png b/docs/en/server/performance/system_optimzation/atune/figures/zh-cn_image_0227497000.png deleted file mode 100644 index db9b5ce8b6d211d54ea36930504cca415ddfb8ca..0000000000000000000000000000000000000000 Binary files a/docs/en/server/performance/system_optimzation/atune/figures/zh-cn_image_0227497000.png and /dev/null differ diff --git a/docs/en/server/performance/system_optimzation/atune/figures/zh-cn_image_0227497343.png b/docs/en/server/performance/system_optimzation/atune/figures/zh-cn_image_0227497343.png deleted file mode 100644 index aecf293846ebd12f15b9a3fb5fdc2618d9d527dc..0000000000000000000000000000000000000000 Binary files a/docs/en/server/performance/system_optimzation/atune/figures/zh-cn_image_0227497343.png and /dev/null differ diff --git a/docs/en/server/performance/system_optimzation/atune/figures/zh-cn_image_0231122163.png b/docs/en/server/performance/system_optimzation/atune/figures/zh-cn_image_0231122163.png deleted file mode 100644 index 66bf082a6537ad70c84e4e8f07de745f973482b9..0000000000000000000000000000000000000000 Binary files a/docs/en/server/performance/system_optimzation/atune/figures/zh-cn_image_0231122163.png and /dev/null differ diff --git a/docs/en/server/performance/system_optimzation/atune/figures/zh-cn_image_0245342444.png b/docs/en/server/performance/system_optimzation/atune/figures/zh-cn_image_0245342444.png deleted file mode 100644 index 10f0fceb42c00c80ef49decdc0c480eb04c2ca6d..0000000000000000000000000000000000000000 Binary files a/docs/en/server/performance/system_optimzation/atune/figures/zh-cn_image_0245342444.png and /dev/null differ diff --git a/docs/en/server/performance/system_optimzation/atune/getting_to_know_a_tune.md b/docs/en/server/performance/system_optimzation/atune/getting_to_know_a_tune.md deleted file mode 100644 index 0fbc0788071300c8daa2e88da06d230ed32cfa18..0000000000000000000000000000000000000000 --- a/docs/en/server/performance/system_optimzation/atune/getting_to_know_a_tune.md +++ /dev/null @@ -1,63 +0,0 @@ -# Getting to Know A-Tune - -## Introduction - -An operating system \(OS\) is basic software that connects applications and hardware. It is critical for users to adjust OS and application configurations and make full use of software and hardware capabilities to achieve optimal service performance. However, numerous workload types and varied applications run on the OS, and the requirements on resources are different. Currently, the application environment composed of hardware and software involves more than 7000 configuration objects. As the service complexity and optimization objects increase, the time cost for optimization increases exponentially. As a result, optimization efficiency decreases sharply. Optimization becomes complex and brings great challenges to users. - -Second, as infrastructure software, the OS provides a large number of software and hardware management capabilities. The capability required varies in different scenarios. Therefore, capabilities need to be enabled or disabled depending on scenarios, and a combination of capabilities will maximize the optimal performance of applications. - -In addition, the actual business embraces hundreds and thousands of scenarios, and each scenario involves a wide variety of hardware configurations for computing, network, and storage. The lab cannot list all applications, business scenarios, and hardware combinations. - -To address the preceding challenges, openEuler launches A-Tune. - -A-Tune is an AI-based engine that optimizes system performance. It uses AI technologies to precisely profile business scenarios, discover and infer business characteristics, so as to make intelligent decisions, match with the optimal system parameter configuration combination, and give recommendations, ensuring the optimal business running status. - -![](figures/zh-cn_image_0227497000.png) - -## Architecture - -The following figure shows the A-Tune core technical architecture, which consists of intelligent decision-making, system profile, and interaction system. - -- Intelligent decision-making layer: consists of the awareness and decision-making subsystems, which implements intelligent awareness of applications and system optimization decision-making, respectively. -- System profile layer: consists of the feature engineering and two-layer classification model. The feature engineering is used to automatically select service features, and the two-layer classification model is used to learn and classify service models. -- Interaction system layer: monitors and configures various system resources and executes optimization policies. - -![](figures/zh-cn_image_0227497343.png) - -## Supported Features and Service Models - -### Supported Features - -[Table 1](#table1919220557576) describes the main features supported by A-Tune, feature maturity, and usage suggestions. - -**Table 1** Feature maturity - - - -| Feature | Maturity | Usage Suggestion | -| --------------------------------------------------------- | -------- | ---------------- | -| Auto optimization of 15 applications in 11 workload types | Tested | Pilot | -| User-defined profile and service models | Tested | Pilot | -| Automatic parameter optimization | Tested | Pilot | - -### Supported Service Models - -Based on the workload characteristics of applications, A-Tune classifies services into 11 types. For details about the bottleneck of each type and the applications supported by A-Tune, see [Table 2](#table2819164611311). - -**Table 2** Supported workload types and applications - - - -| Service category | Type | Bottleneck | Supported Application | -| ------------------ | -------------------- | ------------------------------------------------------------ | ----------------------------------- | -| default | Default type | Low resource usage in terms of cpu, memory, network, and I/O | N/A | -| webserver | Web application | Bottlenecks of cpu and network | Nginx, Apache Traffic Server | -| database | Database | Bottlenecks of cpu, memory, and I/O | Mongodb, Mysql, Postgresql, Mariadb | -| big_data | Big data | Bottlenecks of cpu and memory | Hadoop-hdfs, Hadoop-spark | -| middleware | Middleware framework | Bottlenecks of cpu and network | Dubbo | -| in-memory_database | Memory database | Bottlenecks of memory and I/O | Redis | -| basic-test-suite | Basic test suite | Bottlenecks of cpu and memory | SPECCPU2006, SPECjbb2015 | -| hpc | Human genome | Bottlenecks of cpu, memory, and I/O | Gatk4 | -| storage | Storage | Bottlenecks of network, and I/O | Ceph | -| virtualization | Virtualization | Bottlenecks of cpu, memory, and I/O | Consumer-cloud, Mariadb | -| docker | Docker | Bottlenecks of cpu, memory, and I/O | Mariadb | diff --git a/docs/en/server/performance/system_optimzation/atune/installation_and_deployment.md b/docs/en/server/performance/system_optimzation/atune/installation_and_deployment.md deleted file mode 100644 index 10730ff9e840d03a7e39c4d4e88259fe1a04b0e7..0000000000000000000000000000000000000000 --- a/docs/en/server/performance/system_optimzation/atune/installation_and_deployment.md +++ /dev/null @@ -1,509 +0,0 @@ -# Installation and Deployment - -This chapter describes how to install and deploy A-Tune. - -## Software and Hardware Requirements - -### Hardware Requirement - -- Huawei Kunpeng 920 processor - -### Software Requirement - -- OS: openEuler 22.03 - -## Environment Preparation - -For details about installing an openEuler OS, see the [_openEuler Installation Guide_](../../../installation_upgrade/installation/installation_on_servers.md). - -## A-Tune Installation - -This section describes the installation modes and methods of the A-Tune. - -### Installation Modes - -A-Tune can be installed in single-node, distributed, and cluster modes. - -- Single-node mode - - The client and server are installed on the same system. - -- Distributed mode - - The client and server are installed on different systems. - -- Cluster mode - A cluster consists of a client and more than one servers. - -The installation modes are as follows: - -![](./figures/zh-cn_image_0231122163.png) - -### Installation Procedure - -To install the A-Tune, perform the following steps: - -1. Mount an openEuler ISO image. - - ```shell - mount openEuler-22.03-LTS-everything-x86_64-dvd.iso /mnt - ``` - - > Use the **everything** ISO image. - -2. Configure the local Yum source. - - ```shell - vim /etc/yum.repos.d/local.repo - ``` - - The configured contents are as follows: - - ```conf - [local] - name=local - baseurl=file:///mnt - gpgcheck=1 - enabled=1 - ``` - -3. Import the GPG public key of the RPM digital signature to the system. - - ```shell - rpm --import /mnt/RPM-GPG-KEY-openEuler - ``` - -4. Install an A-Tune server. - - > [!NOTE]NOTE - > In this step, both the server and client software packages are installed. For the single-node deployment, skip **Step 5**. - - ```shell - yum install atune -y - yum install atune-engine -y - ``` - -5. For a distributed mode, install an A-Tune client on associated server. - - ```shell - yum install atune-client -y - ``` - -6. Check whether the installation is successful. - - ```shell - $ rpm -qa | grep atune - atune-client-xxx - atune-db-xxx - atune-xxx - atune-engine-xxx - ``` - - If the preceding information is displayed, the installation is successful. - -## A-Tune Deployment - -This section describes how to deploy A-Tune. - -### Overview - -The configuration items in the A-Tune configuration file **/etc/atuned/atuned.cnf** are described as follows: - -- A-Tune service startup configuration (modify the parameter values as required). - - - **protocol**: Protocol used by the gRPC service. The value can be **unix** or **tcp**. **unix** indicates the local socket communication mode, and **tcp** indicates the socket listening port mode. The default value is **unix**. - - **address**: Listening IP address of the gRPC service. The default value is **unix socket**. If the gRPC service is deployed in distributed mode, change the value to the listening IP address. - - **port**: Listening port of the gRPC server. The value ranges from 0 to 65535. If **protocol** is set to **unix**, you do not need to set this parameter. - - **connect**: IP address list of the nodes where the A-Tune is located when the A-Tune is deployed in a cluster. IP addresses are separated by commas (,). - - **rest_host**: Listening address of the REST service. The default value is localhost. - - **rest_port**: Listening port of the REST service. The value ranges from 0 to 65535. The default value is 8383. - - **engine_host**: IP address for connecting to the A-Tune engine service of the system. - - **engine_port**: Port for connecting to the A-Tune engine service of the system. - - **sample_num**: Number of samples collected when the system executes the analysis process. The default value is 20. - - **interval**: Interval for collecting samples when the system executes the analysis process. The default value is 5s. - - **grpc_tls**: Indicates whether to enable SSL/TLS certificate verification for the gRPC service. By default, this function is disabled. After grpc_tls is enabled, you need to set the following environment variables before running the **atune-adm** command to communicate with the server: - - export ATUNE_TLS=yes - - export ATUNED_CACERT=\ - - export ATUNED_CLIENTCERT=\ - - export ATUNED_CLIENTKEY=\ - - export ATUNED_SERVERCN=server - - **tlsservercafile**: Path of the gPRC server's CA certificate. - - **tlsservercertfile**: Path of the gPRC server certificate. - - **tlsserverkeyfile**: Path of the gPRC server key. - - **rest_tls**: Indicates whether to enable SSL/TLS certificate verification for the REST service. This function is enabled by default. - - **tlsrestcacertfile**: Path of the server's CA certificate of the REST service. - - **tlsrestservercertfile**: Path of the server certificate of the REST service. - - **tlsrestserverkeyfile**: Indicates the key path of the REST service. - - **engine_tls**: Indicates whether to enable SSL/TLS certificate verification for the A-Tune engine service. This function is enabled by default.. - - **tlsenginecacertfile**: Path of the client CA certificate of the A-Tune engine service. - - **tlsengineclientcertfile**: Client certificate path of the A-Tune engine service. - - **tlsengineclientkeyfile**: Client key path of the A-Tune engine service. - -- System information - - System is the parameter information required for system optimization. You must modify the parameter information according to the actual situation. - - - **disk**: Disk information to be collected during the analysis process or specified disk during disk optimization. - - **network**: NIC information to be collected during the analysis process or specified NIC during NIC optimization. - - **user**: User name used for ulimit optimization. Currently, only the user **root** is supported. - -- Log information - - Change the log level as required. The default log level is info. Log information is recorded in the **/var/log/messages** file. - -- Monitor information - - Hardware information that is collected by default when the system is started. - -- Tuning information - - Tuning is the parameter information required for offline tuning. - - - **noise**: Evaluation value of Gaussian noise. - - **sel_feature**: Indicates whether to enable the function of generating the importance ranking of offline tuning parameters. By default, this function is disabled. - -#### Example - -```conf -#################################### server ############################### - # atuned config - [server] - # the protocol grpc server running on - # ranges: unix or tcp - protocol = unix - - # the address that the grpc server to bind to - # default is unix socket /var/run/atuned/atuned.sock - # ranges: /var/run/atuned/atuned.sock or ip address - address = /var/run/atuned/atuned.sock - - # the atune nodes in cluster mode, separated by commas - # it is valid when protocol is tcp - # connect = ip01,ip02,ip03 - - # the atuned grpc listening port - # the port can be set between 0 to 65535 which not be used - # port = 60001 - - # the rest service listening port, default is 8383 - # the port can be set between 0 to 65535 which not be used - rest_host = localhost - rest_port = 8383 - - # the tuning optimizer host and port, start by engine.service - # if engine_host is same as rest_host, two ports cannot be same - # the port can be set between 0 to 65535 which not be used - engine_host = localhost - engine_port = 3838 - - # when run analysis command, the numbers of collected data. - # default is 20 - sample_num = 20 - - # interval for collecting data, default is 5s - interval = 5 - - # enable gRPC authentication SSL/TLS - # default is false - # grpc_tls = false - # tlsservercafile = /etc/atuned/grpc_certs/ca.crt - # tlsservercertfile = /etc/atuned/grpc_certs/server.crt - # tlsserverkeyfile = /etc/atuned/grpc_certs/server.key - - # enable rest server authentication SSL/TLS - # default is true - rest_tls = true - tlsrestcacertfile = /etc/atuned/rest_certs/ca.crt - tlsrestservercertfile = /etc/atuned/rest_certs/server.crt - tlsrestserverkeyfile = /etc/atuned/rest_certs/server.key - - # enable engine server authentication SSL/TLS - # default is true - engine_tls = true - tlsenginecacertfile = /etc/atuned/engine_certs/ca.crt - tlsengineclientcertfile = /etc/atuned/engine_certs/client.crt - tlsengineclientkeyfile = /etc/atuned/engine_certs/client.key - - - #################################### log ############################### - [log] - # either "debug", "info", "warn", "error", "critical", default is "info" - level = info - - #################################### monitor ############################### - [monitor] - # with the module and format of the MPI, the format is {module}_{purpose} - # the module is Either "mem", "net", "cpu", "storage" - # the purpose is "topo" - module = mem_topo, cpu_topo - - #################################### system ############################### - # you can add arbitrary key-value here, just like key = value - # you can use the key in the profile - [system] - # the disk to be analysis - disk = sda - - # the network to be analysis - network = enp189s0f0 - - user = root - - #################################### tuning ############################### - # tuning configs - [tuning] - noise = 0.000000001 - sel_feature = false -``` - -The configuration items in the configuration file **/etc/atuned/engine.cnf** of the A-Tune engine are described as follows: - -- Startup configuration of the A-Tune engine service (modify the parameter values as required). - - - **engine_host**: Listening address of the A-Tune engine service. The default value is localhost. - - **engine_port**: Listening port of the A-Tune engine service. The value ranges from 0 to 65535. The default value is 3838. - - **engine_tls**: Indicates whether to enable SSL/TLS certificate verification for the A-Tune engine service. This function is enabled by default. - - **tlsenginecacertfile**: Path of the server CA certificate of the A-Tune engine service. - - **tlsengineservercertfile**: Path of the server certificate of the A-Tune engine service. - - **tlsengineserverkeyfile**: Server key path of the A-Tune engine service. - -- Log information - - Change the log level as required. The default log level is info. Log information is recorded in the **/var/log/messages** file. - -#### Example - -```conf -#################################### engine ############################### - [server] - # the tuning optimizer host and port, start by engine.service - # if engine_host is same as rest_host, two ports cannot be same - # the port can be set between 0 to 65535 which not be used - engine_host = localhost - engine_port = 3838 - - # enable engine server authentication SSL/TLS - # default is true - engine_tls = true - tlsenginecacertfile = /etc/atuned/engine_certs/ca.crt - tlsengineservercertfile = /etc/atuned/engine_certs/server.crt - tlsengineserverkeyfile = /etc/atuned/engine_certs/server.key - - #################################### log ############################### - [log] - # either "debug", "info", "warn", "error", "critical", default is "info" - level = info -``` - -## Starting A-Tune - -After A-Tune is installed, you need to configure the A-Tune service before starting it. - -- Configure the A-Tune service. - Modify the network adapter and drive information in the **atuned.cnf** configuration file. - > Note: - > - > If atuned is installed through `make install`, the network adapter and drive information in the configuration file is automatically updated to the default devices on the machine. To collect data from other devices, perform the following steps to configure atuned. - - Run the following command to search for the network adapter that needs to be specified for optimization or data collection, and change the value of **network** in the **/etc/atuned/atuned.cnf** file to the specified network adapter: - - ```shell - ip addr - ``` - - Run the following command to search for the drive that need to be specified for optimization or data collection, and change the value of **disk** in the **/etc/atuned/atuned.cnf** file to the specified drive: - - ```shell - fdisk -l | grep dev - ``` - -- About the certificate: - The A-Tune engine and client use the gRPC communication protocol. Therefore, you need to configure a certificate to ensure system security. For information security purposes, A-Tune does not provide a certificate generation method. You need to configure a system certificate by yourself. - If security is not considered, set **rest_tls** and **engine_tls** in the **/etc/atuned/atuned.cnf** file to **false**, set **engine_tls** in the **/etc/atuned/engine.cnf** file to **false**. - A-Tune is not liable for any consequences incurred if no security certificate is configured. - -- Start the atuned service. - - ```shell - systemctl start atuned - ``` - -- Query the atuned service status. - - ```shell - systemctl status atuned - ``` - - If the following command output is displayed, the service is started successfully: - - ![](./figures/zh-cn_image_0214540398.png) - -## Starting A-Tune Engine - -To use AI functions, you need to start the A-Tune engine service. - -- Start the atune-engine service. - - ```shell - systemctl start atune-engine - ``` - -- Query the atune-engine service status. - - ```shell - systemctl status atune-engine - ``` - - If the following command output is displayed, the service is started successfully: - - ![](./figures/zh-cn_image_0245342444.png) - -## Distributed Deployment - -### Purpose of Distributed Deployment - -A-Tune supports distributed deployment to implement distributed architecture and on-demand deployment. The components of A-Tune can be deployed separately. Lightweight component deployment has little impact on services and avoids installing too many dependencies to reduce the system load. - -This document describes only a common deployment mode: deploying the client and server on the same node and deploying the engine module on another node. For details about other deployment modes, contact A-Tune developers. - -**Deployment relationship** -![](figures/picture1.png) - -### Configuration File - -In distributed deployment mode, you need to configure the write the IP address and port number of the engine in the configuration file so that other components can access the engine component through the IP address. - -1. Modify the **/etc/atuned/atuned.cnf** file on the server node. - - - Change the values of **engine_host** and **engine_port** in line 34 to the IP address and port number of the engine node. For the deployment in the preceding figure, the values are **engine_host = 192.168.0.1 engine_port = 3838**. - - Change the values of **rest_tls** and **engine_tls** in lines 49 and 55 to **false**. Otherwise, you need to apply for and configure certificates. You do not need to configure SSL certificates in the test environment. However, you need to configure SSL certificates in the production environment to prevent security risks. - -2. Modify the**/etc/atuned/engine.cnf** file on the engine node. - - - Change the values of **engine_host** and **engine_port** in lines 17 and 18 to the IP address and port number of the engine node. For the deployment in the preceding figure, the value are **engine_host = 192.168.0.1 engine_port = 3838**. - - Change the value of **engine_tls** in line 22 to **false**. - -3. After modifying the configuration file, restart the service for the modification to take effect. - - - Run the `systemctl restart atuned command` on the server node. - - Run the `systemctl restart atune-engine` command on the engine node. - -4. (Optional) Run the `tuning` command in the **A-Tune/examples/tuning/compress** folder. - - - For details, see **A-Tune/examples/tuning/compress/README**. - - Run the `atune-adm tuning --project compress --detail compress_client.yaml` command. - - This step is to check whether the distributed deployment is successful. - -### Precautions - -1. This document does not describe how to configure the authentication certificates. You can set **rest_tls** or **engine_tls** in the **atuned.cnf** and **engine.cnf** files to **false** if necessary. -2. After modifying the configuration file, restart the service. Otherwise, the modification does not take effect. -3. Do not enable the proxy when using A-Tune. -4. The **disk** and **network** items of the **\[system]** section in the **atuned.cnf** file need to be modified. For details about how to modify the items, see the [A-Tune User Guide](https://gitee.com/gaoruoshu/A-Tune/blob/master/Documentation/UserGuide/A-Tune%E7%94%A8%E6%88%B7%E6%8C%87%E5%8D%97.md). - -### Example - -#### atuned.cnf - -```conf -# ...... - -# the tuning optimizer host and port, start by engine.service -# if engine_host is same as rest_host, two ports cannot be same -# the port can be set between 0 to 65535 which not be used -engine_host = 192.168.0.1 -engine_port = 3838 - -# ...... -``` - -#### engine.cnf - -```bash -[server] -# the tuning optimizer host and port, start by engine.service -# if engine_host is same as rest_host, two ports cannot be same -# the port can be set between 0 to 65535 which not be used -engine_host = 192.168.0.1 -engine_port = 3838 -``` - -## Cluster Deployment - -### Purpose of Cluster Deployment - -To support fast tuning in multi-node scenarios, A-Tune supports dynamic tuning of parameter settings on multiple nodes at the same time. In this way, you do not need to tune each node separately, improving tuning efficiency. -Cluster deployment mode consists of one master node and several agent nodes. The client and server are deployed on the master node to receive commands and interact with the engine. Other nodes receive instructions from the master node and configure the parameters of the current node. - -**Deployment relationship** - ![](figures/picture4.png) - -In the preceding figure, the client and server are deployed on the node whose IP address is 192.168.0.0. Project files are stored on this node. Other nodes do not contain project files. -The master node communicates with the agent nodes through TCP. Therefore, you need to modify the configuration file. - -### Modifications to atuned.cnf - -1. Set the value of **protocol** to **tcp**. -2. Set the value of **address** to the IP address of the current node. -3. Set the value of **connect** to the IP addresses of all nodes. The first IP address is the IP address of the master node, and the subsequent IP addresses are the IP addresses of agent nodes. Use commas (,) to separate the IP addresses. -4. During debugging, you can set **rest_tls** and **engine_tls** to **false**. -5. Perform the same modification on the **atuned.cnf** files of all the master and agent nodes. - -### Precautions - -1. The values of **engine_host** and **engine_port** must be consistent in the **engine.cnf** file and the **atuned.cnf** file on the server. -2. This document does not describe how to configure the authentication certificates. You can set **rest_tls** or **engine_tls** in the **atuned.cnf** and **engine.cnf** files to **false** if necessary. -3. After modifying the configuration file, restart the service. Otherwise, the modification does not take effect. -4. Do not enable the proxy when using A-Tune. - -### Example - -#### atuned.cnf - -```conf -# ...... - -[server] -# the protocol grpc server running on -# ranges: unix or tcp -protocol = tcp - -# the address that the grpc server to bind to -# default is unix socket /var/run/atuned/atuned.sock -# ranges: /var/run/atuned/atuned.sock or ip address -address = 192.168.0.0 - -# the atune nodes in cluster mode, separated by commas -# it is valid when protocol is tcp -connect = 192.168.0.0,192.168.0.1,192.168.0.2,192.168.0.3 - -# the atuned grpc listening port -# the port can be set between 0 to 65535 which not be used -port = 60001 - -# the rest service listening port, default is 8383 -# the port can be set between 0 to 65535 which not be used -rest_host = localhost -rest_port = 8383 - -# the tuning optimizer host and port, start by engine.service -# if engine_host is same as rest_host, two ports cannot be same -# the port can be set between 0 to 65535 which not be used -engine_host = 192.168.1.1 -engine_port = 3838 - -# ...... -``` - -#### engine.cnf - -```bash -[server] -# the tuning optimizer host and port, start by engine.service -# if engine_host is same as rest_host, two ports cannot be same -# the port can be set between 0 to 65535 which not be used -engine_host = 192.168.1.1 -engine_port = 3838 -``` - -Note: For details about the **engine.cnf** file, see the configuration file for distributed deployment. diff --git a/docs/en/server/performance/system_optimzation/atune/native_turbo.md b/docs/en/server/performance/system_optimzation/atune/native_turbo.md deleted file mode 100644 index 0abd1b3e503143f89e99faedd06cd0ac17a42110..0000000000000000000000000000000000000000 --- a/docs/en/server/performance/system_optimzation/atune/native_turbo.md +++ /dev/null @@ -1,54 +0,0 @@ -# Native-Turbo - -## Overview - -The code segment and data segment of a large program can reach hundreds of MB, and the TLB miss rate of key service processes is high. The size of the kernel page table affects the performance. - -To facilitate the use of huge pages, the Native-Turbo feature enables the system to automatically use huge pages when loading programs. Huge pages can be used for code segments and data segments. - -## How to Use - -1. Enable the feature. - - This feature has two levels of switches. `sysctl fs.exec-use-hugetlb` determines whether to enable this feature in the system. (This command can only be run by the **root** user. The value `0` indicates that this feature is disabled, and the value `1` indicates that this feature is enabled. Other values are invalid.) - - If not enabled, this feature will not be used even if users set environment variables because the kernel will ignore related processes. - - After this feature is enabled, common users can use the environment variable `HUGEPAGE_PROBE` to determine whether to use huge pages for running programs. If the value is `1`, huge pages are used. If the value is not set, huge pages are not used. - - ```shell - sysctl fs.exec-use-hugetlb=1 # The main program uses huge pages. - export HUGEPAGE_PROBE=1 # The dynamic library uses huge pages. - ``` - - You can also configure the environment variable `LD_HUGEPAGE_LIB=1` to force all segments to use huge pages. - -2. Mark the segments that need to use huge pages. By default, all segments are marked. `-x` only marks code segments. `-d` clears existing marks. - - ```shell - hugepageedit [-x] [-d] app - ``` - - This tool is provided by the glibc-devel package. - -3. Run the application. - - ./app - -## Restrictions - -1. The program and dynamic library must be compiled in 2 MB alignment mode by adding the following GCC compilation parameters: - - ```shell - -zcommon-page-size=0x200000 -zmax-page-size=0x200000 - ``` - -2. Sufficient huge pages must be reserved before use. Otherwise, the program will fail to be executed. - - If the cgroup is used, pay attention to the `hugetlb` limit. If the limit is less than the number of required huge pages, the system may break down during running. - -3. The size of the process page table is changed to 2 MB. Therefore, the parameters invoked by the system such as `mprotect` must be aligned by 2 MB. Otherwise, the execution will fail. - -4. The LibcarePlus hot patch mechanism is not supported. - -5. Huge pages cannot be shared among multiple processes because they will consume multiple times of memory. diff --git a/docs/en/server/performance/system_optimzation/atune/public_sys-resources/icon-caution.gif b/docs/en/server/performance/system_optimzation/atune/public_sys-resources/icon-caution.gif deleted file mode 100644 index 6e90d7cfc2193e39e10bb58c38d01a23f045d571..0000000000000000000000000000000000000000 Binary files a/docs/en/server/performance/system_optimzation/atune/public_sys-resources/icon-caution.gif and /dev/null differ diff --git a/docs/en/server/performance/system_optimzation/atune/public_sys-resources/icon-danger.gif b/docs/en/server/performance/system_optimzation/atune/public_sys-resources/icon-danger.gif deleted file mode 100644 index 6e90d7cfc2193e39e10bb58c38d01a23f045d571..0000000000000000000000000000000000000000 Binary files a/docs/en/server/performance/system_optimzation/atune/public_sys-resources/icon-danger.gif and /dev/null differ diff --git a/docs/en/server/performance/system_optimzation/atune/public_sys-resources/icon-note.gif b/docs/en/server/performance/system_optimzation/atune/public_sys-resources/icon-note.gif deleted file mode 100644 index 6314297e45c1de184204098efd4814d6dc8b1cda..0000000000000000000000000000000000000000 Binary files a/docs/en/server/performance/system_optimzation/atune/public_sys-resources/icon-note.gif and /dev/null differ diff --git a/docs/en/server/performance/system_optimzation/atune/public_sys-resources/icon-notice.gif b/docs/en/server/performance/system_optimzation/atune/public_sys-resources/icon-notice.gif deleted file mode 100644 index 86024f61b691400bea99e5b1f506d9d9aef36e27..0000000000000000000000000000000000000000 Binary files a/docs/en/server/performance/system_optimzation/atune/public_sys-resources/icon-notice.gif and /dev/null differ diff --git a/docs/en/server/performance/system_optimzation/atune/public_sys-resources/icon-tip.gif b/docs/en/server/performance/system_optimzation/atune/public_sys-resources/icon-tip.gif deleted file mode 100644 index 93aa72053b510e456b149f36a0972703ea9999b7..0000000000000000000000000000000000000000 Binary files a/docs/en/server/performance/system_optimzation/atune/public_sys-resources/icon-tip.gif and /dev/null differ diff --git a/docs/en/server/performance/system_optimzation/atune/public_sys-resources/icon-warning.gif b/docs/en/server/performance/system_optimzation/atune/public_sys-resources/icon-warning.gif deleted file mode 100644 index 6e90d7cfc2193e39e10bb58c38d01a23f045d571..0000000000000000000000000000000000000000 Binary files a/docs/en/server/performance/system_optimzation/atune/public_sys-resources/icon-warning.gif and /dev/null differ diff --git a/docs/en/server/performance/system_optimzation/atune/usage_instructions.md b/docs/en/server/performance/system_optimzation/atune/usage_instructions.md deleted file mode 100644 index 96c30420a11002a5b6e4f78391944c697531118b..0000000000000000000000000000000000000000 --- a/docs/en/server/performance/system_optimzation/atune/usage_instructions.md +++ /dev/null @@ -1,731 +0,0 @@ -# Usage Instructions - -You can use functions provided by A-Tune through the CLI client atune-adm. This chapter describes the functions and usage of the A-Tune client. - -## Overview - -- You can run the **atune-adm help/--help/-h** command to query commands supported by atune-adm. -- The **define**, **update**, **undefine**, **collection**, **train**, and **upgrade**commands do not support remote execution. -- In the command format, brackets \(\[\]\) indicate that the parameter is optional, and angle brackets \(<\>\) indicate that the parameter is mandatory. The actual parameters prevail. - -## Querying Workload Types - -### list - -#### Function - -Query the supported profiles, and the values of Active. - -#### Format - -**atune-adm list** - -#### Example - -```shell -# atune-adm list - -Support profiles: -+------------------------------------------------+-----------+ -| ProfileName | Active | -+================================================+===========+ -| arm-native-android-container-robox | false | -+------------------------------------------------+-----------+ -| basic-test-suite-euleros-baseline-fio | false | -+------------------------------------------------+-----------+ -| basic-test-suite-euleros-baseline-lmbench | false | -+------------------------------------------------+-----------+ -| basic-test-suite-euleros-baseline-netperf | false | -+------------------------------------------------+-----------+ -| basic-test-suite-euleros-baseline-stream | false | -+------------------------------------------------+-----------+ -| basic-test-suite-euleros-baseline-unixbench | false | -+------------------------------------------------+-----------+ -| basic-test-suite-speccpu-speccpu2006 | false | -+------------------------------------------------+-----------+ -| basic-test-suite-specjbb-specjbb2015 | false | -+------------------------------------------------+-----------+ -| big-data-hadoop-hdfs-dfsio-hdd | false | -+------------------------------------------------+-----------+ -| big-data-hadoop-hdfs-dfsio-ssd | false | -+------------------------------------------------+-----------+ -| big-data-hadoop-spark-bayesian | false | -+------------------------------------------------+-----------+ -| big-data-hadoop-spark-kmeans | false | -+------------------------------------------------+-----------+ -| big-data-hadoop-spark-sql1 | false | -+------------------------------------------------+-----------+ -| big-data-hadoop-spark-sql10 | false | -+------------------------------------------------+-----------+ -| big-data-hadoop-spark-sql2 | false | -+------------------------------------------------+-----------+ -| big-data-hadoop-spark-sql3 | false | -+------------------------------------------------+-----------+ -| big-data-hadoop-spark-sql4 | false | -+------------------------------------------------+-----------+ -| big-data-hadoop-spark-sql5 | false | -+------------------------------------------------+-----------+ -| big-data-hadoop-spark-sql6 | false | -+------------------------------------------------+-----------+ -| big-data-hadoop-spark-sql7 | false | -+------------------------------------------------+-----------+ -| big-data-hadoop-spark-sql8 | false | -+------------------------------------------------+-----------+ -| big-data-hadoop-spark-sql9 | false | -+------------------------------------------------+-----------+ -| big-data-hadoop-spark-tersort | false | -+------------------------------------------------+-----------+ -| big-data-hadoop-spark-wordcount | false | -+------------------------------------------------+-----------+ -| cloud-compute-kvm-host | false | -+------------------------------------------------+-----------+ -| database-mariadb-2p-tpcc-c3 | false | -+------------------------------------------------+-----------+ -| database-mariadb-4p-tpcc-c3 | false | -+------------------------------------------------+-----------+ -| database-mongodb-2p-sysbench | false | -+------------------------------------------------+-----------+ -| database-mysql-2p-sysbench-hdd | false | -+------------------------------------------------+-----------+ -| database-mysql-2p-sysbench-ssd | false | -+------------------------------------------------+-----------+ -| database-postgresql-2p-sysbench-hdd | false | -+------------------------------------------------+-----------+ -| database-postgresql-2p-sysbench-ssd | false | -+------------------------------------------------+-----------+ -| default-default | false | -+------------------------------------------------+-----------+ -| docker-mariadb-2p-tpcc-c3 | false | -+------------------------------------------------+-----------+ -| docker-mariadb-4p-tpcc-c3 | false | -+------------------------------------------------+-----------+ -| hpc-gatk4-human-genome | false | -+------------------------------------------------+-----------+ -| in-memory-database-redis-redis-benchmark | false | -+------------------------------------------------+-----------+ -| middleware-dubbo-dubbo-benchmark | false | -+------------------------------------------------+-----------+ -| storage-ceph-vdbench-hdd | false | -+------------------------------------------------+-----------+ -| storage-ceph-vdbench-ssd | false | -+------------------------------------------------+-----------+ -| virtualization-consumer-cloud-olc | false | -+------------------------------------------------+-----------+ -| virtualization-mariadb-2p-tpcc-c3 | false | -+------------------------------------------------+-----------+ -| virtualization-mariadb-4p-tpcc-c3 | false | -+------------------------------------------------+-----------+ -| web-apache-traffic-server-spirent-pingpo | false | -+------------------------------------------------+-----------+ -| web-nginx-http-long-connection | true | -+------------------------------------------------+-----------+ -| web-nginx-https-short-connection | false | -+------------------------------------------------+-----------+ -``` - -> [!NOTE]NOTE -> If the value of Active is **true**, the profile is activated. In the example, the profile of web-nginx-http-long-connection is activated. - -## Workload Type Analysis and Auto Optimization - -### analysis - -#### Function - -Collect real-time statistics from the system to identify and automatically optimize workload types. - -#### Format - -**atune-adm analysis** \[OPTIONS\] - -#### Parameter Description - -- OPTIONS - -| Parameter | Description | -| ------------------------ | ---------------------------------------------------------------------------------------------- | -| --model, -m | New model generated after user self-training | -| --characterization, -c | Use the default model for application identification and do not perform automatic optimization | -| --times value, -t value | Time duration for data collection | -| --script value, -s value | File to be executed | - -#### Example - -- Use the default model for application identification. - - ```shell - # atune-adm analysis --characterization - ``` - -- Use the default model to identify applications and perform automatic tuning. - - ```shell - # atune-adm analysis - ``` - -- Use the user-defined training model for recognition. - - ```shell - # atune-adm analysis --model /usr/libexec/atuned/analysis/models/new-model.m - ``` - -## User-defined Model - -A-Tune allows users to define and learn new models. To define a new model, perform the following steps: - -1. Run the **define** command to define a new profile. -2. Run the **collection** command to collect the system data corresponding to the application. -3. Run the **train** command to train the model. - -### define - -#### Function - -Add a user-defined application scenarios and the corresponding profile tuning items. - -#### Format - -**atune-adm define** \ \ \ \ - -#### Example - -Add a profile whose service_type is **test_service**, application_name is **test_app**, scenario_name is **test_scenario**, and tuning item configuration file is **example.conf**. - -```shell -# atune-adm define test_service test_app test_scenario ./example.conf -``` - -The **example.conf** file can be written as follows (the following optimization items are optional and are for reference only). You can also run the **atune-adm info** command to view how the existing profile is written. - -```ini - [main] - # list its parent profile - [kernel_config] - # to change the kernel config - [bios] - # to change the bios config - [bootloader.grub2] - # to change the grub2 config - [sysfs] - # to change the /sys/* config - [systemctl] - # to change the system service status - [sysctl] - # to change the /proc/sys/* config - [script] - # the script extension of cpi - [ulimit] - # to change the resources limit of user - [schedule_policy] - # to change the schedule policy - [check] - # check the environment - [tip] - # the recommended optimization, which should be performed manunaly -``` - -### collection - -#### Function - -Collect the global resource usage and OS status information during service running, and save the collected information to a CSV output file as the input dataset for model training. - -> [!NOTE]NOTE -> -> - This command depends on the sampling tools such as perf, mpstat, vmstat, iostat, and sar. -> - Currently, only the Kunpeng 920 CPU is supported. You can run the **dmidecode -t processor** command to check the CPU model. - -#### Format - -**atune-adm collection** - -#### Parameter Description - -- OPTIONS - -| Parameter | Description | -| ----------------- | ----------------------------------------------------------------------------------------------------- | -| --filename, -f | Name of the generated CSV file used for training: *name*-*timestamp*.csv | -| --output_path, -o | Path for storing the generated CSV file. The absolute path is required. | -| --disk, -b | Disk used during service running, for example, /dev/sda. | -| --network, -n | Network port used during service running, for example, eth0. | -| --app_type, -t | Mark the application type of the service as a label for training. | -| --duration, -d | Data collection time during service running, in seconds. The default collection time is 1200 seconds. | -| --interval, -i | Interval for collecting data, in seconds. The default interval is 5 seconds. | - -#### Example - -```shell -# atune-adm collection --filename name --interval 5 --duration 1200 --output_path /home/data --disk sda --network eth0 --app_type test_service-test_app-test_scenario -``` - -> Note: -> -> In the example, data is collected every 5 seconds for a duration of 1200 seconds. The collected data is stored as the *name* file in the **/home/data** directory. The application type of the service is defined by the `atune-adm define` command, which is **test_service-test_app-test_scenario** in this example. -> The data collection interval and duration can be specified using the preceding command options. - -### train - -#### Function - -Use the collected data to train the model. Collect data of at least two application types during training. Otherwise, an error is reported. - -#### Format - -**atune-adm train** - -#### Parameter Description - -- OPTIONS - - | Parameter | Description | - | ----------------- | ------------------------------------------------------ | - | --data_path, -d | Path for storing CSV files required for model training | - | --output_file, -o | Model generated through training | - -#### Example - -Use the CSV file in the **data** directory as the training input. The generated model **new-model.m** is stored in the **model** directory. - -```shell -# atune-adm train --data_path /home/data --output_file /usr/libexec/atuned/analysis/models/new-model.m -``` - -### undefine - -#### Function - -Delete a user-defined profile. - -#### Format - -**atune-adm undefine** - -#### Example - -Delete the user-defined profile. - -```shell -# atune-adm undefine test_service-test_app-test_scenario -``` - -## Querying Profiles - -### info - -#### Function - -View the profile content. - -#### Format - -**atune-adm info** - -#### Example - -View the profile content of web-nginx-http-long-connection. - -```shell -# atune-adm info web-nginx-http-long-connection - -*** web-nginx-http-long-connection: - -# -# nginx http long connection A-Tune configuration -# -[main] -include = default-default - -[kernel_config] -#TODO CONFIG - -[bios] -#TODO CONFIG - -[bootloader.grub2] -iommu.passthrough = 1 - -[sysfs] -#TODO CONFIG - -[systemctl] -sysmonitor = stop -irqbalance = stop - -[sysctl] -fs.file-max = 6553600 -fs.suid_dumpable = 1 -fs.aio-max-nr = 1048576 -kernel.shmmax = 68719476736 -kernel.shmall = 4294967296 -kernel.shmmni = 4096 -kernel.sem = 250 32000 100 128 -net.ipv4.tcp_tw_reuse = 1 -net.ipv4.tcp_syncookies = 1 -net.ipv4.ip_local_port_range = 1024 65500 -net.ipv4.tcp_max_tw_buckets = 5000 -net.core.somaxconn = 65535 -net.core.netdev_max_backlog = 262144 -net.ipv4.tcp_max_orphans = 262144 -net.ipv4.tcp_max_syn_backlog = 262144 -net.ipv4.tcp_timestamps = 0 -net.ipv4.tcp_synack_retries = 1 -net.ipv4.tcp_syn_retries = 1 -net.ipv4.tcp_fin_timeout = 1 -net.ipv4.tcp_keepalive_time = 60 -net.ipv4.tcp_mem = 362619 483495 725238 -net.ipv4.tcp_rmem = 4096 87380 6291456 -net.ipv4.tcp_wmem = 4096 16384 4194304 -net.core.wmem_default = 8388608 -net.core.rmem_default = 8388608 -net.core.rmem_max = 16777216 -net.core.wmem_max = 16777216 - -[script] -prefetch = off -ethtool = -X {network} hfunc toeplitz - -[ulimit] -{user}.hard.nofile = 102400 -{user}.soft.nofile = 102400 - -[schedule_policy] -#TODO CONFIG - -[check] -#TODO CONFIG - -[tip] -SELinux provides extra control and security features to linux kernel. Disabling SELinux will improve the performance but may cause security risks. = kernel -disable the nginx log = application -``` - -## Updating a Profile - -You can update the existing profile as required. - -### update - -#### Function - -Update the original tuning items in the existing profile to the content in the **new.conf** file. - -#### Format - -**atune-adm update** - -#### Example - -Change the tuning item of the profile named **test_service-test_app-test_scenario** to **new.conf**. - -```shell -# atune-adm update test_service-test_app-test_scenario ./new.conf -``` - -## Activating a Profile - -### profile - -#### Function - -Manually activate the profile to make it in the active state. - -#### Format - -**atune-adm profile** - -#### Parameter Description - -For details about the profile name, see the query result of the list command. - -#### Example - -Activate the profile corresponding to the web-nginx-http-long-connection. - -```shell -# atune-adm profile web-nginx-http-long-connection -``` - -## Rolling Back Profiles - -### rollback - -#### Functions - -Roll back the current configuration to the initial configuration of the system. - -#### Format - -**atune-adm rollback** - -#### Example - -```shell -# atune-adm rollback -``` - -## Updating Database - -### upgrade - -#### Function - -Update the system database. - -#### Format - -**atune-adm upgrade** - -#### Parameter Description - -- DB\_FILE - - New database file path. - -#### Example - -The database is updated to **new\_sqlite.db**. - -```shell -# atune-adm upgrade ./new_sqlite.db -``` - -## Querying System Information - -### check - -#### Function - -Check the CPU, BIOS, OS, and NIC information. - -#### Format - -**atune-adm check** - -#### Example - -```shell -# atune-adm check - cpu information: - cpu:0 version: Kunpeng 920-6426 speed: 2600000000 HZ cores: 64 - cpu:1 version: Kunpeng 920-6426 speed: 2600000000 HZ cores: 64 - system information: - DMIBIOSVersion: 0.59 - OSRelease: 4.19.36-vhulk1906.3.0.h356.eulerosv2r8.aarch64 - network information: - name: eth0 product: HNS GE/10GE/25GE RDMA Network Controller - name: eth1 product: HNS GE/10GE/25GE Network Controller - name: eth2 product: HNS GE/10GE/25GE RDMA Network Controller - name: eth3 product: HNS GE/10GE/25GE Network Controller - name: eth4 product: HNS GE/10GE/25GE RDMA Network Controller - name: eth5 product: HNS GE/10GE/25GE Network Controller - name: eth6 product: HNS GE/10GE/25GE RDMA Network Controller - name: eth7 product: HNS GE/10GE/25GE Network Controller - name: docker0 product: -``` - -## Automatic Parameter Optimization - -A-Tune provides the automatic search capability with the optimal configuration, saving the trouble of manually configuring parameters and performance evaluation. This greatly improves the search efficiency of optimal configurations. - -### Tuning - -#### Function - -Use the specified project file to search the dynamic space for parameters and find the optimal solution under the current environment configuration. - -#### Format - -**atune-adm tuning** \[OPTIONS\] - -> [!NOTE]NOTE -Before running the command, ensure that the following conditions are met: - -1. The YAML configuration file on the server has been edited and stored in the **/etc/atuned/tuning/** directory of the atuned service. -2. The YAML configuration file of the client has been edited and stored on the atuned client. - -#### Parameter Description - -- OPTIONS - -| Parameter | Description | -| ------------- | ----------------------------------------------------------- | -| --restore, -r | Restores the initial configuration before tuning. | -| --project, -p | Specifies the project name in the YAML file to be restored. | -| --restart, -c | Perform tuning based on historical tuning results. | -| --detail, -d | Print detailed information about the tuning process. | - -> [!NOTE]NOTE -> If this parameter is used, the -p parameter must be followed by a specific project name and the YAML file of the project must be specified. - -- **PROJECT\_YAML**: YAML configuration file of the client. - -#### Configuration Description - -**Table 1** YAML file on the server - -| Name | Description | Type | Value Range | -| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- | ----------- | -| project | Project name. | Character string | - | -| startworkload | Script for starting the service to be optimized. | Character string | - | -| stopworkload | Script for stopping the service to be optimized. | Character string | - | -| maxiterations | Maximum number of optimization iterations, which is used to limit the number of iterations on the client. Generally, the more optimization iterations, the better the optimization effect, but the longer the time required. Set this parameter based on the site requirements. | Integer | >10 | -| object | Parameters to be optimized and related information.
For details about the object configuration items, see Table 2. | | | - -**Table 2** Description of object configuration items - -| Name | Description | Type | Value Range | -| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- | ------------------------------------------------------------------------------- | -| name | Parameter to be optimized. | Character string | - | -| desc | Description of parameters to be optimized. | Character string | - | -| get | Script for querying parameter values. | - | - | -| set | Script for setting parameter values. | - | - | -| needrestart | Specifies whether to restart the service for the parameter to take effect. | Enumeration | **true** or **false** | -| type | Parameter type. Currently, the **discrete** and **continuous** types are supported. | Enumeration | **discrete** or **continuous** | -| dtype | This parameter is available only when type is set to **discrete**. Currently, **int**, **float** and **string** are supported. | Enumeration | int, float, string | -| scope | Parameter setting range. This parameter is valid only when type is set to discrete and **dtype** is set to **int** or **float**, or **type** is set to **continuous**. | Integer/Float | The value is user-defined and must be within the valid range of this parameter. | -| step | Parameter value step, which is used when **dtype** is set to **int** or **float**. | Integer/Float | This value is user-defined. | -| items | Enumerated value of which the parameter value is not within the scope. This is used when **dtype** is set to **int** or **float**. | Integer/Float | The value is user-defined and must be within the valid range of this parameter. | -| options | Enumerated value range of the parameter value, which is used when **dtype** is set to **string**. | Character string | The value is user-defined and must be within the valid range of this parameter. | - -**Table 3** Description of configuration items of a YAML file on the client - -| Name | Description | Type | Value Range | -| --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- | ------------------------------------------------- | -| project | Project name, which must be the same as that in the configuration file on the server. | Character string | - | -| engine | Tuning algorithm. | Character string | "random", "forest", "gbrt", "bayes", "extraTrees" | -| iterations | Number of optimization iterations. | Integer | ≥ 10 | -| random_starts | Number of random iterations. | Integer | < iterations | -| feature_filter_engine | Parameter search algorithm, which is used to select important parameters. This parameter is optional. | Character string | "lhs" | -| feature_filter_cycle | Parameter search cycles, which is used to select important parameters. This parameter is used together with feature_filter_engine. | Integer | - | -| feature_filter_iters | Number of iterations for each cycle of parameter search, which is used to select important parameters. This parameter is used together with feature_filter_engine. | Integer | - | -| split_count | Number of evenly selected parameters in the value range of tuning parameters, which is used to select important parameters. This parameter is used together with feature_filter_engine. | Integer | - | -| benchmark | Performance test script. | - | - | -| evaluations | Performance test evaluation index.
For details about the evaluations configuration items, see Table 4. | - | - | - -**Table 4** Description of evaluations configuration item - -| Name | Description | Type | Value Range | -| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- | ---------------------------- | -| name | Evaluation index name. | Character string | - | -| get | Script for obtaining performance evaluation results. | - | - | -| type | Specifies a **positive** or **negative** type of the evaluation result. The value **positive** indicates that the performance value is minimized, and the value **negative** indicates that the performance value is maximized. | Enumeration | **positive** or **negative** | -| weight | Weight of the index. The value ranges from 0 to 100. | Integer | 0-100 | -| threshold | Minimum performance requirement of the index. | Integer | User-defined | - -#### Example - -The following is an example of the YAML file configuration on a server: - -```yaml -project: "compress" -maxiterations: 500 -startworkload: "" -stopworkload: "" -object : - - - name : "compressLevel" - info : - desc : "The compresslevel parameter is an integer from 1 to 9 controlling the level of compression" - get : "cat /root/A-Tune/examples/tuning/compress/compress.py | grep 'compressLevel=' | awk -F '=' '{print $2}'" - set : "sed -i 's/compressLevel=\\s*[0-9]*/compressLevel=$value/g' /root/A-Tune/examples/tuning/compress/compress.py" - needrestart : "false" - type : "continuous" - scope : - - 1 - - 9 - dtype : "int" - - - name : "compressMethod" - info : - desc : "The compressMethod parameter is a string controlling the compression method" - get : "cat /root/A-Tune/examples/tuning/compress/compress.py | grep 'compressMethod=' | awk -F '=' '{print $2}' | sed 's/\"//g'" - set : "sed -i 's/compressMethod=\\s*[0-9,a-z,\"]*/compressMethod=\"$value\"/g' /root/A-Tune/examples/tuning/compress/compress.py" - needrestart : "false" - type : "discrete" - options : - - "bz2" - - "zlib" - - "gzip" - dtype : "string" -``` - -The following is an example of the YAML file configuration on a client: - -```yaml -project: "compress" -engine : "gbrt" -iterations : 20 -random_starts : 10 - -benchmark : "python3 /root/A-Tune/examples/tuning/compress/compress.py" -evaluations : - - - name: "time" - info: - get: "echo '$out' | grep 'time' | awk '{print $3}'" - type: "positive" - weight: 20 - - - name: "compress_ratio" - info: - get: "echo '$out' | grep 'compress_ratio' | awk '{print $3}'" - type: "negative" - weight: 80 -``` - -#### Example - -- Download test data. - - ```shell - wget http://cs.fit.edu/~mmahoney/compression/enwik8.zip - ``` - -- Prepare the tuning environment. - - Example of **prepare.sh**: - - ```shell - #!/usr/bin/bash - if [ "$#" -ne 1 ]; then - echo "USAGE: $0 the path of enwik8.zip" - exit 1 - fi - - path=$( - cd "$(dirname "$0")" - pwd - ) - - echo "unzip enwik8.zip" - unzip "$path"/enwik8.zip - - echo "set FILE_PATH to the path of enwik8 in compress.py" - sed -i "s#compress/enwik8#$path/enwik8#g" "$path"/compress.py - - echo "update the client and server yaml files" - sed -i "s#python3 .*compress.py#python3 $path/compress.py#g" "$path"/compress_client.yaml - sed -i "s# compress/compress.py# $path/compress.py#g" "$path"/compress_server.yaml - - echo "copy the server yaml file to /etc/atuned/tuning/" - cp "$path"/compress_server.yaml /etc/atuned/tuning/ - ``` - - Run the script. - - ```shell - sh prepare.sh enwik8.zip - ``` - -- Run the `tuning` command to tune the parameters. - - ```shell - atune-adm tuning --project compress --detail compress_client.yaml - ``` - -- Restore the configuration before running `tuning`. **compress** indicates the project name in the YAML file. - - ```shell - atune-adm tuning --restore --project compress - ``` diff --git a/docs/en/tools/community_tools/_toc.yaml b/docs/en/tools/community_tools/_toc.yaml index d45d3b54a36acefa7e053e23c7bde194040d4b09..fb775febc0e2469f816b38f2b0fc9b8cfe7be247 100644 --- a/docs/en/tools/community_tools/_toc.yaml +++ b/docs/en/tools/community_tools/_toc.yaml @@ -4,6 +4,19 @@ sections: sections: - href: ./isocut/_toc.yaml - href: ./image_tailor/_toc.yaml + - label: GCC User Guide + sections: + - href: + upstream: https://gitee.com/openeuler/compiler-docs/blob/openEuler-24.03-LTS-SP2/docs/en/gcc/_toc.yaml + path: ./compiler + - label: Performance Optimization + sections: + - href: + upstream: https://gitee.com/openeuler/A-Tune/blob/master/docs/en/24.03_LTS_SP2/_toc.yaml + path: ./performance/system_optimization/atune + - href: + upstream: https://gitee.com/openeuler/oeAware-manager/blob/master/docs/en/2403_lts_sp2/_toc.yaml + path: ./performance/tuning_framework/oeaware - label: Migration sections: - href: ./migration_tools/_toc.yaml diff --git a/docs/en/tools/maintenance/_toc.yaml b/docs/en/tools/maintenance/_toc.yaml index 421eba7ff2ce320be80968ce6f5ecaf3ada7fdc4..9f71880e9a26f352dfb6d1948f3f1ae6c9da2f72 100644 --- a/docs/en/tools/maintenance/_toc.yaml +++ b/docs/en/tools/maintenance/_toc.yaml @@ -2,7 +2,9 @@ label: O&M sections: - label: Hot Patch Creation sections: - - href: ../../server/maintenance/syscare/_toc.yaml + - href: + upstream: https://gitee.com/openeuler/syscare/blob/openEuler-24.03-LTS-SP2/docs/en/_toc.yaml + path: ./syscare - label: System Monitoring sections: - href: ../../server/maintenance/sysmonitor/_toc.yaml diff --git a/docs/zh/server/_toc.yaml b/docs/zh/server/_toc.yaml index d2464308e5ba9b2e6a7ab175c796379a815dd294..b5315ce12b95cd2a568f3920b37a43fa59b01505 100644 --- a/docs/zh/server/_toc.yaml +++ b/docs/zh/server/_toc.yaml @@ -21,7 +21,6 @@ sections: - href: upstream: https://gitee.com/openeuler/syscare/blob/openEuler-24.03-LTS-SP2/docs/zh/_toc.yaml path: ./syscare - - href: https://gitee.com/openeuler/syscare/blob/openEuler-24.03-LTS-SP2/docs/zh/_toc.yaml - href: ./maintenance/common_skills/_toc.yaml - href: ./maintenance/common_tools/_toc.yaml - href: ./maintenance/troubleshooting/_toc.yaml @@ -58,6 +57,7 @@ sections: sections: - href: upstream: https://gitee.com/openeuler/oeAware-manager/blob/master/docs/zh/2403_lts_sp2/_toc.yaml + path: ./performance/tuning_framework/oeaware - label: CPU调优 sections: - href: ./performance/cpu_optimization/sysboost/_toc.yaml @@ -72,10 +72,13 @@ sections: - href: ./development/application_dev/_toc.yaml - href: upstream: https://gitee.com/openeuler/compiler-docs/blob/openEuler-24.03-LTS-SP2/docs/zh/gcc/_toc.yaml + path: ./compiler - href: upstream: https://gitee.com/openeuler/compiler-docs/blob/openEuler-24.03-LTS-SP2/docs/zh/llvm/_toc.yaml + path: ./compiler - href: upstream: https://gitee.com/openeuler/compiler-docs/blob/openEuler-24.03-LTS-SP2/docs/zh/bisheng_autotuner/_toc.yaml + path: ./compiler - href: ./development/ai4c/_toc.yaml - href: ./development/fangtian/_toc.yaml - href: ./development/annc/_toc.yaml diff --git a/docs/zh/server/maintenance/syscare/_toc.yaml b/docs/zh/server/maintenance/syscare/_toc.yaml deleted file mode 100644 index e98293e7554dd7f5851328c215a82a1a3d57214e..0000000000000000000000000000000000000000 --- a/docs/zh/server/maintenance/syscare/_toc.yaml +++ /dev/null @@ -1,12 +0,0 @@ -label: SysCare用户指南 -isManual: true -description: 提供在线的热补丁修复能力 -sections: - - label: 认识SysCare - href: ./syscare_introduction.md - - label: 安装SysCare - href: ./installing_syscare.md - - label: 使用SysCare - href: ./using_syscare.md - - label: 约束限制 - href: ./constraints.md diff --git a/docs/zh/server/maintenance/syscare/constraints.md b/docs/zh/server/maintenance/syscare/constraints.md deleted file mode 100644 index fe0170609184aa82479b1c7773eb9839ce03ceb2..0000000000000000000000000000000000000000 --- a/docs/zh/server/maintenance/syscare/constraints.md +++ /dev/null @@ -1,35 +0,0 @@ -# 约束限制 - -## 版本约束 - - 操作系统版本:当前SysCare仅支持openEuler 22.03 LTS SP1版本。 - - 硬件架构:x86_64 / aarch64。 - -## 应用约束 - - 1. 当前对LINE宏的处理需要对每个软件进行适配,当前仅考虑适配redis、nginx,其他未适配的软件可能会造成patch的size过大。后续会考虑引入参数支持用户自行适配。 - 2. 用户态热补丁对于一个ELF文件,只支持一个补丁,如需修复多个bug,可将多个bugfix的patch文件同时传入补丁制作参数中,可制作出修复多个bug的热补丁。 - -## 语言约束 - - 原理上补丁制作在object file一级进行比较,与编程语言无关。 - 当前仅测试了C / C++语言。 - -## 其他约束 - - -前仅支持64位系统; - -当前仅支持ELF格式的热修复,暂不支持解释型语言; - -当前仅支持gcc / g++编译器; - -编译器需要支持`-gdwarf`、`-ffunction-sections`、`-fdata-sections`参数; - -仅支持DWARF格式的调试信息; - -暂不支持交叉编译; - -暂无法识别文件名相同,并且局部变量和函数名称完全一致的不同路径源码文件; - -暂不支持汇编修改(包括`.S`文件及内联汇编); - -不支持新增外部符号(动态库依赖); - -暂不支持对同一个二进制打多个补丁; - -暂不支持C & C++ 混合编译; - -暂不支持C++ exception修改; - -暂不支持group section: ```-g3```编译选项,特定编译优化选项,特定gcc plugin等; - -暂不支持新增ifunc: ```__attribute__((ifunc("foo")))```; - -暂不支持新增TLS变量: ```__thread int foo```。 diff --git a/docs/zh/server/maintenance/syscare/faqs_and_solutions.md b/docs/zh/server/maintenance/syscare/faqs_and_solutions.md deleted file mode 100644 index 899209ac7b943a5da3ef65feeaa81b441135309d..0000000000000000000000000000000000000000 --- a/docs/zh/server/maintenance/syscare/faqs_and_solutions.md +++ /dev/null @@ -1,16 +0,0 @@ -# 常见问题与解决方法 - -## 问题1:报错:“alloc upatch module memory failed” - -- 原因:触发selinux约束。 -- 解决方法:按照报错建议命令操作,手动添加策略,由于不同情况添加策略不同,无法穷尽枚举,参考该issue: 。 - -## 问题2:报错: “patch file error 2” - -- 原因:补丁检测失败。 -- 解决方法:补丁无法正常打入,更换补丁。 - -## 问题3:报错: “build project error 11” - -- 原因:源码包编译失败。 -- 解决方法:尝试使用```rpmbuild -ra *.src.rpm```命令测试源码包是否可正常编译并满足其编译依赖。 diff --git "a/docs/zh/server/maintenance/syscare/figures/syscare\351\200\273\350\276\221\346\236\266\346\236\204.png" "b/docs/zh/server/maintenance/syscare/figures/syscare\351\200\273\350\276\221\346\236\266\346\236\204.png" deleted file mode 100644 index 4ed8b88331695d295351dd57bd570251c18d9502..0000000000000000000000000000000000000000 Binary files "a/docs/zh/server/maintenance/syscare/figures/syscare\351\200\273\350\276\221\346\236\266\346\236\204.png" and /dev/null differ diff --git a/docs/zh/server/maintenance/syscare/installing_syscare.md b/docs/zh/server/maintenance/syscare/installing_syscare.md deleted file mode 100644 index 22e081f5a306d3bf35962a1e8fa8b81b3ea04166..0000000000000000000000000000000000000000 --- a/docs/zh/server/maintenance/syscare/installing_syscare.md +++ /dev/null @@ -1,55 +0,0 @@ -# 安装SysCare - -本章介绍在openEuler中安装SysCare的方法。 - -## 安装SysCare核心组件 - -### 最低硬件要求 - -* 2 CPU (x86_64 / aarch64) -* 4GB RAM -* 100GB 硬盘 - -### 前提条件 - -安装openEuler 24.03 LTS SP1版本。 - -### 源码编译安装SysCare - -SysCare源码已经归档至代码仓,用户可自行下载并编译安装。 - -SysCare在编译前需要安装依赖包,相关命令如下: - -```shell -dnf install cmake make rust cargo kernel-devel elfutils-libelf-devel llvm clang bpftool libbpf libbpf-devel libbpf-static -``` - -示例如下: - -```shell -git clone https://gitee.com/openeuler/syscare.git -cd syscare -mkdir build -cd build -cmake -DCMAKE_INSTALL_PREFIX=/usr -DKERNEL_VERSION=$(uname -r) .. -make -make install -``` - -### repo安装SysCare - -如果repo源中有SysCare相关的包,则可以通过dnf或yum命令进行下载、安装。 - -相关命令如下: - -```shell -dnf/yum install syscare syscare-kmod syscare-build syscare-build-ebpf -``` - -### 卸载SysCare - -相关命令如下: - -```shell -dnf/yum erase syscare syscare-kmod syscare-build syscare-build-ebpf -``` diff --git a/docs/zh/server/maintenance/syscare/syscare_introduction.md b/docs/zh/server/maintenance/syscare/syscare_introduction.md deleted file mode 100644 index 3598b95243363797bd52549b036d87566bb905ff..0000000000000000000000000000000000000000 --- a/docs/zh/server/maintenance/syscare/syscare_introduction.md +++ /dev/null @@ -1,23 +0,0 @@ -# 认识SysCare - -## 简介 - - SysCare是一个操作系统热补丁服务,统一了操作系统内核态、用户态热补丁服务。为操作系统提供在线的热补丁修复能力,可以自动化、无感知地在线修复内核、用户态服务、动态库等系统基础组件bug和漏洞。 - -![img](./figures/syscare逻辑架构.png) - -## SysCare系统功能 - - SysCare提供补丁制作、补丁激活和补丁卸载等功能,支持内核热补丁、用户态热补丁制作和管理: - - 1. 一键式补丁制作能力 - 目前SysCare统一内核热补丁和用户态热补丁的制作流程,提供一键制作补丁能力,对用户屏蔽制作补丁细节及用户态、内核态补丁制作差异。 - - 2. 补丁安装、激活、卸载 - SysCare提供统一补丁管理接口,方便用户在补丁安装、激活、卸载查询使用。 - -## SysCare系统技术 - - 1. SysCare归一化补丁制作,对用户屏蔽补丁制作的细节及差异,提供统一的补丁管理工具,提升运维效率。 - 2. SysCare提供的用户态热补丁支持用户态多进程/多线程业务热修复,修复简单、提升运维效率;对进程/线程新拉起、重启均生效。 - 3. 热补丁lazy机制,克服`ptrace`缺陷(需全部退出内核调用),提升修复成功率。 diff --git a/docs/zh/server/maintenance/syscare/syscare_user_guide.md b/docs/zh/server/maintenance/syscare/syscare_user_guide.md deleted file mode 100644 index aaa3da5576bbaa21fbdc047806f33145df88c90a..0000000000000000000000000000000000000000 --- a/docs/zh/server/maintenance/syscare/syscare_user_guide.md +++ /dev/null @@ -1,11 +0,0 @@ -# SysCare用户使用手册 - -本文档给出SysCare介绍,并给出基于openEuler的SysCare安装方法以及如何使用SysCare,让用户了解SysCare,并指导用户安装和使用SysCare。 - -## 读者对象 - -本文档主要适用于使用openEuler并需要使用热补丁的用户。用户需要具备以下经验和技能: - -* 熟悉Linux基本操作 -* 熟悉软件编译相关基本概念 -* 对rpm软件包以及其制作过程有一定了解 diff --git a/docs/zh/server/maintenance/syscare/using_syscare.md b/docs/zh/server/maintenance/syscare/using_syscare.md deleted file mode 100644 index b5a07c42b45490ba778ccee9afff70a9c9b45468..0000000000000000000000000000000000000000 --- a/docs/zh/server/maintenance/syscare/using_syscare.md +++ /dev/null @@ -1,308 +0,0 @@ -# 使用SysCare - -本章介绍在openEuler中使用SysCare的方法。 - -## 前提条件 - -安装openEuler 24.03 LTS SP1版本。 - -## SysCare使用 - -本章节将介绍 SysCare 的使用方法,包含热补丁制作及热补丁管理。 - -### 热补丁制作 - -用户可以使用`sycare build`命令制作热补丁,该命令为纯CLI工具,提供从RPM包生成热补丁包的功能,热补丁包以RPM包的形式封装维护,支持制作内核热补丁及用户态热补丁。 - -#### 热补丁制作流程 - -1. 准备热补丁目标软件源码包(source rpm)及软件调试信息包(debuginfo rpm) - - 示例: - - ```shell - yumdownloader kernel --source --debuginfo - ``` - -2. 确认满足对应软件编译依赖 - - 示例: - - ```shell - dnf install make gcc bison flex openssl-devel dwarves python3-devel elfutils-libelf-devel - ``` - -3. 执行`syscare build`命令构建热补丁 - - 示例: - - ```shell - syscare build \ - --patch_name HP001 \ - --source kernel-5.10.0-60.66.0.91.oe2203.src.rpm \ - --debuginfo kernel-debuginfo-5.10.0-60.66.0.91.oe2203.x86_64.rpm \ - --output output \ - --patch 001-kernel-patch-test.patch - ``` - - 热补丁制作过程将会在由`--workdir`参数所指定的目录中(默认为当前目录)创建以`syscare-build`开头的临时文件夹,用于存放临时文件及编译日志。 - - 示例: - - ```shell - dev@openeuler-dev:[~]$ ls -l syscare-build.111602/ - total 100 - -rw-r--r--. 1 dev dev 92303 Nov 12 00:00 build.log - drwxr-xr-x. 6 dev dev 4096 Nov 12 00:00 package - drwxr-xr-x. 4 dev dev 4096 Nov 12 00:00 patch - ``` - - 编译日志将会生成在临时文件夹中,名称为`build.log`。 - - ```shell - dev@openeuler-dev:[~]$ cat syscare-build.111602/build.log | less - ``` - - 若补丁制作成功,且未指定`--skip-compiler-check`参数,将自动删除该临时文件夹。 - -4. 检查编译结果 - - 示例: - - ```shell - dev@openeuler-dev:[~]$ ls -l - total 189680 - -rw-r--r--. 1 dev dev 194218767 Nov 12 00:00 kernel-5.10.0-60.91.0.115.oe2203-HP001-1-1.x86_64.src.rpm - -rw-r--r--. 1 dev dev 10937 Nov 12 00:00 patch-kernel-5.10.0-60.91.0.115.oe2203-HP001-1-1.x86_64.rpm - ``` - - 其中 - - - `patch-kernel-5.10.0-60.91.0.115.oe2203-HP001-1-1.x86_64.rpm`为补丁包 - - `kernel-5.10.0-60.91.0.115.oe2203-HP001-1-1.x86_64.src.rpm`为二进制包 - -#### 热补丁制作工具 - -```shell -USAGE: - syscare build [OPTIONS] --patch_name --source --debuginfo ... --patch ... - -OPTIONS: - -n, --patch_name Patch name - --patch_arch Patch architecture [default: x86_64] - --patch_version Patch version [default: 1] - --patch_release Patch release [default: 1] - --patch_description Patch description [default: (none)] - -s, --source Source package - -d, --debuginfo ... Debuginfo package(s) - --workdir Working directory [default: .] - -o, --output Output directory [default: .] - -j, --jobs Parllel build jobs [default: 96] - --skip_compiler_check Skip compiler version check (not recommended) - --skip_cleanup Skip post-build cleanup - -v, --verbose Provide more detailed info - -p, --patch ... Patch file(s) - -h, --help Prints help information - -V, --version Prints version information -``` - -|名称|描述|类型|备注| -| ---- | ---- | ---- | ---- | -|-n, --patch_name ``|补丁名称|字符串|必选参数,需符合RPM命名规范| -|--patch_arch ``|补丁架构|字符串|默认为当前架构,需符合RPM命名规范| -|--patch_version ``|补丁版本号|字符串|默认值为1,需符合RPM命名规范| -|--patch_release ``|补丁release|数字|默认值为1,需符合RPM命名规范| -|--patch_description ``|补丁描述|字符串|默认为(none)| -|-s, --source ``|目标软件src.rpm源码包路径|字符串|必选参数,需为合法路径| -|-d, --debuginfo `...`|目标软件debuginfo包路径|字符串|必选参数,可指定多个,需为合法路径| -|--workdir ``|临时文件夹路径|字符串|默认为当前执行目录,需为合法路径| -|-o, --output ``|补丁输出文件夹|字符串|默认为当前执行目录,需为合法路径| -|-j, --jobs ``|并行编译线程数|数字|默认为cpu线程数| -|--skip-compiler-check|跳过编译器检查|标识|-| -|--skip-cleanup|跳过临时文件清理|标识|-| -|-v, --verbose|打印详细信息|标识|-| -|-p, --patch `...`|补丁文件路径|字符串|必选参数,可指定多个,需为合法路径| -|-h, --help|打印帮助信息|标识|-| -|-V, --version|打印版本信息|标识|-| - -示例: - -```shell -syscare build \ - --patch_name "HP001" \ - --patch_description "CVE-2021-32675 - When parsing an incoming Redis Standard Protocol (RESP) request, Redis allocates memory according to user-specified values which determine the number of elements (in the multi-bulk header) and size of each element (in the bulk header). An attacker delivering specially crafted requests over multiple connections can cause the server to allocate significant amount of memory. Because the same parsing mechanism is used to handle authentication requests, this vulnerability can also be exploited by unauthenticated users." \ - --source ./redis-6.2.5-1.src.rpm \ - --debuginfo ./redis-debuginfo-6.2.5-1.x86_64.rpm \ - --output ./output \ - --patch ./0001-Prevent-unauthenticated-client-from-easily-consuming.patch -``` - -#### 热补丁包命名规则 - -- 热补丁包:patch-目标软件全名-补丁名称-补丁版本-补丁release.架构名.rpm -- 热补丁源码包:目标软件全名-补丁名称-补丁版本-补丁release.架构名.src.rpm - -#### 输出 - -- 热补丁包:包含SysCare热补丁的二进制及元信息,用于热补丁安装。 -- 热补丁源码包:包含目标软件源码及新增补丁文件,用于新版本热补丁制作。 - -#### 错误定位 - -如果热补丁制作过程出现错误,请参考位于工作目录下名称为`build.log`的编译日志。 - -示例: - -```shell -Building patch, this may take a while -- Preparing build requirements -- Building patch -Error: UserPatchBuilder: Failed to build patch - -Caused by: - Process "/usr/libexec/syscare/upatch-build" exited unsuccessfully, exit_code=253 -For more information, please check "/home/dev/syscare-build.345549/build.log" -``` - -### 热补丁包管理 - -热补丁的安装以及卸载需要提供对应rpm包的名称,下面使用`$patch_package`来指代rpm包名称。 - -1. 热补丁包安装 - - ```shell - dnf install $patch_package.rpm - ``` - - 热补丁包安装后,热补丁相关文件存放在如下路径: - - /usr/lib/syscare/patches - -2. 热补丁包卸载 - - ```shell - dnf remove $patch_package - ``` - - 注:若热补丁处于`ACTIVED`以上状态时,热补丁将会被自动卸载。 - -### 热补丁管理 - -使用`syscare`命令可以对热补丁进行管理。 - -对单一热补丁操作前,用户需要提供一个字符串来搜索热补丁,后续使用`$patch_identifier`来指代这个字符串。 - -热补丁管理搜索规则为:目标包名/补丁名,其中“目标包名/”在补丁名唯一的情况下可以省略,也可使用UUID来进行管理。 - -*目标包名:待打入补丁的目标软件的软件包名称; -*补丁名:热补丁名称。 - -#### 补丁元信息 - -补丁元信息中包含以下字段: - -| 字段名称 | 字段描述 | -| ----------- | ---------------------- | -| uuid | 补丁ID | -| name | 补丁名称 | -| version | 补丁版本 | -| release | 补丁Release | -| arch | 补丁架构 | -| type | 补丁类型 | -| target | 目标软件名 | -| entities | 目标软件可执行文件名称 | -| digest | 补丁指纹 | -| license | 目标软件许可证 | -| description | 补丁描述 | -| patch| 补丁文件列表 | - -示例: - -```shell -sudo syscare info redis-6.2.5-1/HP002-1-1 -uuid: 980fa0d0-e753-447c-8494-01de595f35d0 -name: HP002 -version: 1 -release: 1 -arch: x86_64 -type: UserPatch -target: redis-6.2.5-1 -target_elf: redis-server, redis-benchmark, redis-cli -license: BSD and MIT -description: CVE-2021-32675 - When parsing an incoming Redis Standard Protocol (RESP) request, Redis allocates memory according to user-specified values which determine the number of elements (in the multi-bulk header) and size of each element (in the bulk header). An attacker delivering specially crafted requests over multiple connections can cause the server to allocate significant amount of memory. Because the same parsing mechanism is used to handle authentication requests, this vulnerability can also be exploited by unauthenticated users. -patch: -0001-Prevent-unauthenticated-client-from-easily-consuming.patch -``` - -#### 热补丁状态 - -SysCare将热补丁的生命周期分成如下状态: - -*未加载:`NOT-APPLIED` -*未激活:`DEACTIVED` -*已激活:`ACTIVED` -*已接受:`ACCEPTED` - -#### 补丁信息查询 - -1. 补丁基本信息查询: - - ```shell - syscare info $patch_identifier - ``` - -2. 补丁状态查询: - - ```shell - syscare status $patch_identifier - ``` - -3. 查询所有补丁状态: - - ```shell - syscare list - ``` - -#### 热补丁状态管理 - -1. 加载热补丁: - - ```shell - syscare apply $patch_identifier - ``` - -2. 卸载热补丁: - - ```shell - syscare remove $patch_identifier - ``` - -3. 激活热补丁: - - ```shell - syscare active $patch_identifier - ``` - -4. 反激活热补丁: - - ```shell - syscare deactive $patch_identifier - ``` - -5. 接受热补丁: - - ```shell - syscare accept $patch_identifier - ``` - -6. 保存所有补丁状态: - - ```shell - syscare save - ``` - -7. 恢复所有补丁状态: - - ```shell - syscare restore - ``` diff --git a/docs/zh/tools/community_tools/_toc.yaml b/docs/zh/tools/community_tools/_toc.yaml index 44feffbde578d7897c4b92d10deca18a51cb4a8e..b59799ccbbdd960959fbdeef498e83c239be28b9 100644 --- a/docs/zh/tools/community_tools/_toc.yaml +++ b/docs/zh/tools/community_tools/_toc.yaml @@ -4,6 +4,19 @@ sections: sections: - href: ./isocut/_toc.yaml - href: ./image_tailor/_toc.yaml + - label: 编译 + sections: + - href: + upstream: https://gitee.com/openeuler/compiler-docs/blob/openEuler-24.03-LTS-SP2/docs/zh/gcc/_toc.yaml + path: ./compiler + - label: 性能优化 + sections: + - href: + upstream: https://gitee.com/openeuler/A-Tune/blob/master/docs/zh/24.03_LTS_SP2/_toc.yaml + path: ./performance/system_optimization/atune + - href: + upstream: https://gitee.com/openeuler/oeAware-manager/blob/master/docs/zh/2403_lts_sp2/_toc.yaml + path: ./performance/tuning_framework/oeaware - label: 迁移 sections: - href: ./migration_tools/_toc.yaml diff --git a/docs/zh/tools/maintenance/_toc.yaml b/docs/zh/tools/maintenance/_toc.yaml index 6240136944adf8430bbd09b71555904fc6fe8324..66839f3dbbe609ef0ecc7d5a18cc168ead0dde4d 100644 --- a/docs/zh/tools/maintenance/_toc.yaml +++ b/docs/zh/tools/maintenance/_toc.yaml @@ -2,7 +2,9 @@ label: 系统运维 sections: - label: 热补丁制作 sections: - - href: ../../server/maintenance/syscare/_toc.yaml + - href: + upstream: https://gitee.com/openeuler/syscare/blob/openEuler-24.03-LTS-SP2/docs/zh/_toc.yaml + path: ./syscare - label: 系统监控 sections: - href: ../../server/maintenance/sysmonitor/_toc.yaml