diff --git a/docs/zh/server/_toc.yaml b/docs/zh/server/_toc.yaml index ee70eb69d777e625c0036ba9e230bb1597751806..e487329def25e4211b54a948f3cf4ddf8b6a538e 100644 --- a/docs/zh/server/_toc.yaml +++ b/docs/zh/server/_toc.yaml @@ -1,243 +1,63 @@ -isManual: true -label: '' +label: 服务器 sections: - - label: 管理员指南 - href: ./administration/administrator/administration.md - - label: 基础配置 - href: ./administration/administrator/basic_configuration.md - - label: 搭建FTP服务器 - href: ./administration/administrator/configuring_the_ftp_server.md - - label: 搭建repo服务器 - href: ./administration/administrator/configuring_the_repo_server.md - - label: 搭建web服务器 - href: ./administration/administrator/configuring_the_web_server.md - - label: 管理进程 - href: ./administration/administrator/process_management.md - - label: 管理服务 - href: ./administration/administrator/service_management.md - - label: 搭建数据库服务器 - href: ./administration/administrator/setting_up_the_database_server.md - - label: 管理用户 - href: ./administration/administrator/user_and_user_group_management.md - - label: 使用DNF管理软件包 - href: ./administration/administrator/using_dnf_to_manage_software_packages.md - - label: 查看系统信息 - href: ./administration/administrator/viewing_system_infortmation.md - - label: 兼容性命令 - href: ./administration/compa_command/overview.md - - label: utshell 用户手册 - href: ./administration/compa_command/utshell_guide.md - - label: utsudo 使用指南 - href: ./administration/compa_command/utsudo_user_guide.md - - label: 设备管理 - href: ./administration/sysmaster/device_management.md - - label: 安装与部署 - href: ./administration/sysmaster/devmaster_install_deploy.md - - label: 使用说明 - href: ./administration/sysmaster/devmaster_usage.md - - label: sysMaster用户指南 - href: ./administration/sysmaster/overview.md - - label: 服务管理 - href: ./administration/sysmaster/service_management.md - - label: 安装与部署 - href: ./administration/sysmaster/sysmaster_install_deploy.md - - label: sysmaster使用说明 - href: ./administration/sysmaster/sysmaster_usage.md - - label: AI4C使用手册 - href: ./development/ai4c/ai4c_user_manual.md - - label: 应用开发指南 - href: ./development/application_dev/application_development.md - - label: 构建RPM包 - href: ./development/application_dev/building_an_rpm_package.md - - label: FAQ - href: ./development/application_dev/faq.md - - label: 安装obs工具 - href: ./development/application_dev/Installing_obs.md - - label: 开发环境准备 - href: ./development/application_dev/perparations_for_development_environment.md - - label: 使用GCC编译 - href: ./development/application_dev/using_gcc_for_compilation.md - - label: 使用JDK编译 - href: ./development/application_dev/using_jdk_for_compilation.md - - label: 使用make编译 - href: ./development/application_dev/using_make_for_compilation.md - - label: 安装与部署 - href: ./development/fangtian/fangtian_environment_configuration.md - - label: Linux Wayland 应用及鸿蒙应用的支持 - href: >- - ./development/fangtian/fangtian_for_linux_waylan_and_openharmony_applications.md - - label: FangTian 视窗引擎指南 - href: ./development/fangtian/overview.md - - label: '**1** 容器管理面无感卸载' - href: >- - ./diversified_computing/dpu_offload/container_management_plane_direct_connection_aggregation_environment_establishment.md - - label: '**1** 硬件准备' - href: >- - ./diversified_computing/dpu_offload/libvirt_direct_connection_aggregation_environment_establishment.md - - label: qtfs - href: ./diversified_computing/dpu_offload/qtfs_architecture_and_usage.md - - label: HA的安装与部署 - href: ./high_availability/ha/ha_installation_and_deployment.md - - label: HA使用实例 - href: ./high_availability/ha/ha_usecase_examples.md - - label: FAQ - href: ./installation_upgrade/installation/faq.md - - label: FAQ - href: ./installation_upgrade/installation/faq_1.md - - label: 安装指南 - href: ./installation_upgrade/installation/installation.md - - label: 安装指导 - href: ./installation_upgrade/installation/installation_guide.md - - label: 安装指导 - href: ./installation_upgrade/installation/installation_guide_1.md - - label: 安装方式介绍 - href: ./installation_upgrade/installation/installation_modes.md - - label: 安装方式介绍 - href: ./installation_upgrade/installation/installation_modes_1.md - - label: 安装在服务器 - href: ./installation_upgrade/installation/installation_on_servers.md - - label: 安装准备 - href: ./installation_upgrade/installation/installation_preparations.md - - label: 安装准备 - href: ./installation_upgrade/installation/installation_preparations_1.md - - label: 安装在树莓派 - href: ./installation_upgrade/installation/install_pi.md - - label: 参考资料 - href: ./installation_upgrade/installation/more_resources.md - - label: 使用kickstart自动化安装 - href: >- - ./installation_upgrade/installation/using_kickstart_for_automatic_installation.md - - label: 常用技能 - href: ./maintenance/common_skills/common_configurations.md - - label: 信息收集 - href: ./maintenance/common_skills/information_collection.md - - label: 常用工具 - href: ./maintenance/common_tools/commonly_used_tools.md - - label: gala-anteater使用手册 - href: ./maintenance/gala/using_gala_anteater.md - - label: '**gala-gopher使用手册**' - href: ./maintenance/gala/using_gala_gopher.md - - label: gala-spider使用手册 - href: ./maintenance/gala/using_gala_spider.md - - label: 安装与部署 - href: ./maintenance/kernel_live_upgrade/installation_and_deployment.md - - label: 内核热升级用户指南 - href: ./maintenance/kernel_live_upgrade/kernel_live_upgrade.md - - label: 使用方法 - href: ./maintenance/kernel_live_upgrade/usage_guide.md - - label: sysmonitor - href: ./maintenance/sysmonitor/sysmonitor_user_guide.md - - label: 故障应急处理 - href: ./maintenance/troubleshooting/troubleshooting.md - - label: etmem - href: ./menmory_storage/etmem/etmem_user_guide.md - - label: 使用LVM管理硬盘 - href: ./menmory_storage/lvm/managing_drives_through_lvm.md - - label: Gazelle 加速openGauss使用说明 - href: ./network/gazelle/Gazelle_for_opengauss_acceleration.md - - label: Gazelle加速redis - href: ./network/gazelle/Gazelle_for_redis_acceleration.md - - label: Gazelle单网卡功能使用说明 - href: ./network/gazelle/Gazelle_single_nic_user_guide.md - - label: 用户态协议栈Gazelle用户指南 - href: ./network/gazelle/gazelle_user_guide.md - - label: 配置网络 - href: ./network/network_config/network_configuration.md - - label: FUSE fastpath特性说明和使用指南 - href: ./performance/cpu_optimization/fuse_acceleration_feature_guide.md - - label: 使用KAE加速引擎 - href: ./performance/cpu_optimization/using_the_kae.md - - label: 系统资源与性能 - href: ./performance/overall/system_resource/system_resources_and_performance.md - - label: 附录 - href: ./performance/system_optimization/atune/appendix.md - - label: 认识A-Tune - href: ./performance/system_optimization/atune/getting_to_know_a_tune.md - - label: 安装与部署 - href: ./performance/system_optimization/atune/installation_and_deloyment.md - - label: 使用方法 - href: ./performance/system_optimization/atune/usage_instructions.md - - label: 快速入门 - href: ./quickstart/quick_start.md - - label: openEuler账号清单 - href: ./releasenotes/account_list.md - - label: 致谢 - href: ./releasenotes/acknowledgment.md - - label: 参与贡献 - href: ./releasenotes/contribution.md - - label: CVE漏洞 - href: ./releasenotes/cve.md - - label: 简介 - href: ./releasenotes/introduction.md - - label: 关键特性 - href: ./releasenotes/key_features.md - - label: 已知问题 - href: ./releasenotes/known_issues.md - - label: 系统安装 - href: ./releasenotes/os_installation.md - - label: 组件分类 - href: ./releasenotes/README.md - - label: 发行说明 - href: ./releasenotes/release_notes.md - - label: 已修复问题 - href: ./releasenotes/resoluved_issues.md - - label: 源代码 - href: ./releasenotes/source_code.md - - label: 法律声明 - href: ./releasenotes/terms_of_use.md - - label: 用户须知 - href: ./releasenotes/user_notice.md - - label: 版本发行说明 - href: ./releasenotes/zh-cn_bookmap_0225720059.md - - label: 证书签名使用指南 - href: ./security/cert_signature/certsignature.md - - label: 认识证书和签名 - href: ./security/cert_signature/overview_of_certificates_and_signatures.md - - label: 安全启动 - href: ./security/cert_signature/secure_boot.md - - label: 1. SBOM介绍 - href: ./security/sbom/sbom.md - - label: 接口说明 - href: ./security/secdetector/api_reference.md - - label: 安装 secDetector - href: ./security/secdetector/install_secdetector.md - - label: 认识secDetector - href: ./security/secdetector/introduction_to_secdetector.md - - label: secDetector 使用指南 - href: ./security/secdetector/secDetector.md - - label: 使用 secDetector - href: ./security/secdetector/using_secdetector.md - - label: 接口说明 - href: ./security/secgear/api_reference.md - - label: 认识secGear - href: ./security/secgear/introduction_to_secgear.md - - label: secGear 开发指南 - href: ./security/secgear/secGear.md - - label: 安装 secGear - href: ./security/secgear/secgear_installation.md - - label: 帐户口令 - href: ./security/secharden/account_passwords.md - - label: 附录 - href: ./security/secharden/appendix.md - - label: 授权认证 - href: ./security/secharden/authentication_and_authenticationu.md - - label: 文件权限 - href: ./security/secharden/file_permissions.md - - label: 内核参数 - href: ./security/secharden/kernel_parameters.md - - label: 操作系统加固概述 - href: ./security/secharden/os_hardening_overview.md - - label: 安全加固指南 - href: ./security/secharden/secharden.md - - label: openEuler安全配置说明 - href: ./security/secharden/security_configuration_benchmark.md - - label: 安全加固工具 - href: ./security/secharden/security_configuration_hardening_tool.md - - label: 加固指导 - href: ./security/secharden/security_hardening_guide.md - - label: SELinux配置 - href: ./security/secharden/selinux_configuration.md - - label: 系统服务 - href: ./security/secharden/system_services.md - - label: 可信计算 - href: ./security/trusted_computing/trusted_computing.md + - label: 从这里开始 + sections: + - href: ./releasenotes/_toc.yaml + - href: ./quickstart/_toc.yaml + - label: 安装升级 + sections: + - href: ./installation_upgrade/installation/_toc.yaml + - label: 系统管理 + sections: + - href: ./administration/administrator/_toc.yaml + - href: ./administration/sysmaster/_toc.yaml + - href: ./administration/compa_command/_toc.yaml + - label: 系统运维 + sections: + - href: ./maintenance/gala/_toc.yaml + - href: ./maintenance/sysmonitor/_toc.yaml + - href: ./maintenance/kernel_live_upgrade/_toc.yaml + - href: ./maintenance/common_skills/_toc.yaml + - href: ./maintenance/common_tools/_toc.yaml + - href: ./maintenance/troubleshooting/_toc.yaml + - label: 安全 + sections: + - href: ./security/secharden/_toc.yaml + - href: ./security/trusted_computing/_toc.yaml + - href: ./security/secgear/_toc.yaml + - href: ./security/cert_signature/_toc.yaml + - href: ./security/sbom/_toc.yaml + - label: 内存与存储 + sections: + - href: ./memory_storage/lvm/_toc.yaml + - href: ./memory_storage/etmem/_toc.yaml + - label: 网络 + sections: + - href: ./network/network_config/_toc.yaml + - href: ./network/gazelle/_toc.yaml + - label: 性能调优 + sections: + - label: 概述 + sections: + - href: ./performance/overall/system_resource/_toc.yaml + - label: CPU调优 + sections: + - href: ./performance/cpu_optimization/_toc.yaml + - label: 系统调优 + sections: + - href: ./performance/system_optimization/atune/_toc.yaml + - label: 应用开发 + sections: + - href: ./development/application_dev/_toc.yaml + - href: ./development/ai4c/_toc.yaml + - href: ./development/fangtian/_toc.yaml + - href: ./development/distributed/_toc.yaml + - href: ./development/driver_development_specifications/_toc.yaml + - href: ./development/gcc/_toc.yaml + - href: ./development/lustre/_toc.yaml + - label: HA高可用 + sections: + - href: ./high_availability/ha/_toc.yaml + - label: 多样性算力 + sections: + - href: ./diversified_computing/dpu_offload/_toc.yaml diff --git a/docs/zh/server/administration/administrator/_toc.yaml b/docs/zh/server/administration/administrator/_toc.yaml index 5b2785601d10b6500a84c6e553ff0e1f99b0b835..f6c765f294cf89a21920da4419344010a229d706 100644 --- a/docs/zh/server/administration/administrator/_toc.yaml +++ b/docs/zh/server/administration/administrator/_toc.yaml @@ -1,25 +1,26 @@ +label: 管理员指南 isManual: true -label: '' +description: openEuler 系统常用的管理员操作 sections: - - label: 管理员指南 - href: ./administration.md + - label: 查看系统信息 + href: ./viewing_system_information.md - label: 基础配置 href: ./basic_configuration.md - - label: 搭建FTP服务器 - href: ./configuring_the_ftp_server.md - - label: 搭建repo服务器 - href: ./configuring_the_repo_server.md - - label: 搭建web服务器 - href: ./configuring_the_web_server.md - - label: 管理进程 - href: ./process_management.md - - label: 管理服务 - href: ./service_management.md - - label: 搭建数据库服务器 - href: ./setting_up_the_database_server.md - - label: 管理用户 + - label: 管理用户和用户组 href: ./user_and_user_group_management.md - label: 使用DNF管理软件包 href: ./using_dnf_to_manage_software_packages.md - - label: 查看系统信息 - href: ./viewing_system_infortmation.md + - label: 管理服务 + href: ./service_management.md + - label: 管理进程 + href: ./process_management.md + - label: 搭建服务 + sections: + - label: 搭建repo服务器 + href: ./configuring_the_repo_server.md + - label: 搭建FTP服务器 + href: ./configuring_the_ftp_server.md + - label: 搭建web服务器 + href: ./configuring_the_web_server.md + - label: 搭建数据库服务器 + href: ./setting_up_the_database_server.md diff --git a/docs/zh/server/administration/administrator/administration.md b/docs/zh/server/administration/administrator/administration.md deleted file mode 100644 index 89dd0f1865325203c28439b9e89e44b99839d526..0000000000000000000000000000000000000000 --- a/docs/zh/server/administration/administrator/administration.md +++ /dev/null @@ -1,4 +0,0 @@ -# 管理员指南 - -本文档提供了openEuler系统常用的管理员操作,方便管理员更好地使用openEuler。 -本文档适用于所有使用openEuler系统的管理员。 diff --git a/docs/zh/server/administration/administrator/basic_configuration.md b/docs/zh/server/administration/administrator/basic_configuration.md index b82c56eaf7a883843dc433b17eae35acb7a7865f..e55c8310947d1f21812bba95e9246c17aa2579fe 100644 --- a/docs/zh/server/administration/administrator/basic_configuration.md +++ b/docs/zh/server/administration/administrator/basic_configuration.md @@ -1,28 +1,4 @@ # 基础配置 - - -- [基础配置](#基础配置) - - [设置语言环境](#设置语言环境) - - [显示当前语言环境状态](#显示当前语言环境状态) - - [列出可用的语言环境](#列出可用的语言环境) - - [设置语言环境](#设置语言环境-1) - - [设置键盘](#设置键盘) - - [显示当前设置](#显示当前设置) - - [列出可用的键盘布局](#列出可用的键盘布局) - - [设置键盘布局](#设置键盘布局) - - [设置日期和时间](#设置日期和时间) - - [使用timedatectl命令设置](#使用timedatectl命令设置) - - [使用date命令设置](#使用date命令设置) - - [使用hwclock命令设置](#使用hwclock命令设置) - - [设置kdump](#设置kdump) - - [设置kdump预留内存](#设置kdump预留内存) - - [预留内存推荐值](#预留内存推荐值) - - [禁用网络相关驱动](#禁用网络相关驱动) - - [设置磁盘调度算法](#设置磁盘调度算法) - - [临时修改调度策略](#临时修改调度策略) - - [永久设置调度策略](#永久设置调度策略) - - ## 设置语言环境 @@ -102,13 +78,13 @@ $ localectl status 显示当前可用的键盘布局,命令如下: -``` +```shell $ localectl list-keymaps ``` 例如显示系统当前的中文键盘布局,命令和输出如下: -``` +```shell $ localectl list-keymaps | grep cn cn ``` @@ -117,7 +93,7 @@ cn 设置键盘布局,在root权限下执行如下命令,其中 _map_ 是您想要设置的键盘类型,取值范围可通过**localectl list-keymaps**获取,请根据实际情况修改: -``` +```shell # localectl set-keymap map ``` @@ -125,7 +101,7 @@ cn 设置完成后,查看当前状态: -``` +```shell $ localectl status System Locale: LANG=zh_CN.UTF-8 VC Keymap: cn @@ -142,13 +118,13 @@ $ localectl status 显示当前的日期和时间,命令如下: -``` +```shell $ timedatectl ``` 例如显示系统当前的日期和时间,命令和输出如下: -``` +```shell $ timedatectl Local time: Mon 2023-05-20 04:05:00 EDT Universal time: Mon 2023-05-20 08:05:00 UTC @@ -166,13 +142,13 @@ System clock synchronized: no >![](./public_sys-resources/icon-note.gif) **说明:** >若启用了NTP远程服务器进行系统时钟自动同步,则不能手动修改日期和时间。若需要手动修改日期或时间,则需确保已经关闭NTP系统时钟自动同步。可执行**timedatectl set-ntp no** 命令进行关闭。 -``` +```shell # timedatectl set-ntp boolean ``` 例如开启自动远程时间同步,命令如下: -``` +```shell # timedatectl set-ntp yes ``` @@ -183,13 +159,13 @@ System clock synchronized: no 修改当前的日期,在root权限下执行如下命令,其中 _YYYY_ 代表年份,_MM_ 代表月份,_DD_ 代表某天,请根据实际情况修改: -``` +```shell # timedatectl set-time YYYY-MM-DD ``` 例如修改当前的日期为2019年8月14号,命令如下: -``` +```shell # timedatectl set-time '2019-08-14' ``` @@ -197,25 +173,25 @@ System clock synchronized: no 修改时间前,请确保已经关闭NTP系统时钟自动同步。查看NTP服务是否运行,命令如下: -``` +```shell systemctl status ntpd ``` 关闭NTP服务,命令如下: -``` +```shell systemctl disable ntpd ``` 修改当前的时间,在root权限下执行如下命令,其中 _HH_ 代表小时,_MM_ 代表分钟,_SS_ 代表秒,请根据实际情况修改: -``` +```shell # timedatectl set-time HH:MM:SS ``` 例如修改当前的时间为15点57分24秒,命令如下: -``` +```shell # timedatectl set-time 15:57:24 ``` @@ -223,19 +199,19 @@ systemctl disable ntpd 显示当前可用时区,命令如下: -``` +```shell $ timedatectl list-timezones ``` 要修改当前的时区,在root权限下执行如下命令,其中 _time\_zone_ 是您想要设置的时区,请根据实际情况修改: -``` +```shell # timedatectl set-timezone time_zone ``` 例如修改当前的时区,首先查询所在地域的可用时区,此处以Asia为例: -``` +```shell # timedatectl list-timezones | grep Asia Asia/Aden Asia/Almaty @@ -262,7 +238,7 @@ Asia/Tokyo 然后修改当前的时区为“Asia/Shanghai”,命令如下: -``` +```shell # timedatectl set-timezone Asia/Shanghai ``` @@ -272,19 +248,19 @@ Asia/Tokyo 显示当前的日期和时间,命令如下: -``` +```shell $ date ``` 默认情况下,date命令显示本地时间。要显示UTC时间,添加\-\-utc或-u参数: -``` +```shell $ date --utc ``` 要自定义对应的输出信息格式,添加 +"format" 参数: -``` +```shell $ date +"format" ``` @@ -349,21 +325,21 @@ $ date +"format" - 显示当前的日期和本地时间。 - ``` + ```shell $ date 2023年 05月 20日 星期六 17:26:34 CST ``` - 显示当前的日期和UTC时间。 - ``` + ```shell $ date --utc 2023年 05月 20日 星期六 09:26:18 UTC ``` - 自定义date命令的输出。 - ``` + ```shell $ date +"%Y-%m-%d %H:%M" 2023-05-20 17:24 ``` @@ -372,19 +348,19 @@ $ date +"format" 要修改当前的时间,请添加\-\-set或者-s参数。在root权限下执行如下命令,其中 _HH_ 代表小时,_MM_ 代表分钟,_SS_ 代表秒,请根据实际情况修改: -``` +```shell # date --set HH:MM:SS ``` 默认情况下, date命令设置本地时间。要设置UTC时间,添加\-\-utc或-u参数: -``` +```shell # date --set HH:MM:SS --utc ``` 例如修改当前的时间为23点26分00秒,在root权限下执行如下命令: -``` +```shell # date --set 23:26:00 ``` @@ -392,13 +368,13 @@ $ date +"format" 修改当前的日期,添加\-\-set或者-s参数。在root权限下执行如下命令,其中 _YYYY_ 代表年份,_MM_ 代表月份,_DD_ 代表某天,请根据实际情况修改:(注意,执行修改日期操作后,相应的时间会重置为00:00:00) -``` +```shell # date --set YYYY-MM-DD ``` 例如修改当前的日期为2019年11月2日,命令如下: -``` +```shell # date --set 2019-11-02 ``` @@ -419,13 +395,13 @@ Linux 将时钟分为: 显示当前硬件的日期和时间,在root权限下执行如下命令: -``` +```shell # hwclock ``` 例如显示当前硬件的日期和时间,命令和输出如下: -``` +```shell # hwclock 2023-05-26 10:18:42.528948+08:00 ``` @@ -434,13 +410,13 @@ Linux 将时钟分为: 修改当前硬件的日期和时间,在root权限下执行如下命令,其中 _dd_ 表示日,_mm_ 表示月份,_yyyy_ 表示年份,_HH_ 表示小时,_MM_ 表示分钟,请根据实际情况修改: -``` +```shell # hwclock --set --date "dd mm yyyy HH:MM" ``` 例如修改当前的时间为2023年05月21日21点17分,命令如下: -``` +```shell # hwclock --set --date "21 May 2023 21:17" --utc ``` @@ -474,7 +450,7 @@ kdump预留内存参数必须添加到内核启动参数中,配置文件为/bo kdump配置文件(/etc/kdump.conf)中,dracut参数可以设置裁剪的驱动模块,可以将网络驱动配置到裁剪驱动列表中,让kdump文件系统中不加载该驱动,修改配置文件后,重启kdump服务生效。dracut参数配置如下所示: -``` +```Conf dracut_args --omit-drivers "mdio-gpi usb_8dev et1011c rt2x00usb bcm-phy-lib mac80211_hwsim rtl8723be rndis_host hns3_cae amd vrf rtl8192cu mt76x02-lib int51x1 ppp_deflate team_mode_loadbalance smsc911x aweth bonding mwifiex_usb hnae dnet rt2x00pci vaser_pci hdlc_ppp marvell rtl8xxxu mlxsw_i2c ath9k_htc rtl8150 smc91x cortina at803x rockchip cxgb4 spi_ks8995 mt76x2u smsc9420 mdio-cavium bnxt_en ch9200 dummy macsec ice mt7601u rtl8188ee ixgbevf net1080 liquidio_vf be2net mlxsw_switchx2 gl620a xilinx_gmii2rgmii ppp_generic rtl8192de sja1000_platform ath10k_core cc770_platform realte igb c_can_platform c_can ethoc dm9601 smsc95xx lg-vl600 ifb enic ath9 mdio-octeon ppp_mppe ath10k_pci cc770 team_mode_activebackup marvell10g hinic rt2x00lib mlx4_en iavf broadcom igc c_can_pci alx rtl8192se rtl8723ae microchip lan78xx atl1c rtl8192c-common almia ax88179_178a qed netxen_nic brcmsmac rt2800usb e1000 qla3xxx mdio-bitbang qsemi mdio-mscc-miim plx_pci ipvlan r8152 cx82310_eth slhc mt76x02-usb ems_pci xen-netfront usbnet pppoe mlxsw_minimal mlxsw_spectrum cdc_ncm rt2800lib rtl_usb hnae3 ath9k_common ath9k_hw catc mt76 hns_enet_drv ppp_async huawei_cdc_ncm i40e rtl8192ce dl2 qmi_wwan mii peak_usb plusb can-dev slcan amd-xgbe team_mode_roundrobin ste10Xp thunder_xcv pptp thunder_bgx ixgbe davicom icplus tap tun smsc75xx smsc dlci hns_dsaf mlxsw_core rt2800mmi softing uPD60620 vaser_usb dp83867 brcmfmac mwifiex_pcie mlx4_core micrel team macvlan bnx2 virtio_net rtl_pci zaurus hns_mdi libcxgb hv_netvsc nicvf mt76x0u teranetics mlxfw cdc_eem qcom-emac pppox mt76-usb sierra_net i40evf bcm87xx mwifiex pegasus rt2x00mmi sja1000 ena hclgevf cnic cxgb4vf ppp_synctty iwlmvm team_mode_broadcast vxlan vsockmon hdlc_cisc rtl8723-common bsd_comp fakelb dp83822 dp83tc811 cicada fm10 8139t sfc hs geneve hclge xgene-enet-v2 cdc_mbim hdlc asix netdevsim rt2800pci team_mode_random lxt ems_usb mlxsw_pci sr9700 mdio-thunder mlxsw_switchib macvtap atlantic cdc_ether mcs7830 nicpf mdi peak_pci atl1e cdc_subset ipvtap btcoexist mt76x0-common veth slip iwldvm bcm7xxx vitesse netconsole epic100 myri10ge r8169 qede microchip_t1 liquidi bnx2x brcmutil mwifiex_sdi mlx5_core rtlwifi vmxnet3 nlmon hns3 hdlc_raw esd_usb2 atl2 mt76x2-common iwlwifi mdio-bcm-unimac national ath rtwpci rtw88 nfp rtl8821ae fjes thunderbolt-net 8139cp atl1 mscc vcan dp83848 dp83640 hdlc_fr e1000e ipheth net_failover aquantia rtl8192ee igbvf rocker intel-xway tg3" --omit "ramdisk network ifcfg qemu-net" --install "chmod" --nofscks ``` @@ -486,7 +462,7 @@ dracut_args --omit-drivers "mdio-gpi usb_8dev et1011c rt2x00usb bcm-phy-lib mac8 例如将所有IO调度算法修改为mq-deadline,此修改重启后会失效。 -``` +```shell echo mq-deadline > /sys/block/sd*/queue/scheduler ``` @@ -494,6 +470,6 @@ echo mq-deadline > /sys/block/sd*/queue/scheduler 可以通过在内核启动配置文件grub.cfg中的kernel行追加:elevator=mq-deadline,重启后生效。 -``` +```text linux /vmlinuz-5.10.0-153.12.0.89.oe2203SP4.x86_64 root=/dev/mapper/openeuler-root ro resume=/dev/mapper/openeuler-swap rd.lvm.lv=openeuler/root rd.lvm.lv=openeuler/swap quiet crashkernel=512M elevator=mq-deadline ``` diff --git a/docs/zh/server/administration/administrator/configuring_the_repo_server.md b/docs/zh/server/administration/administrator/configuring_the_repo_server.md index cbc8b77eafbf94a12d8ed49c554550d4c02e6140..67a73b607a11059102c0ab996d66eae89d440abc 100644 --- a/docs/zh/server/administration/administrator/configuring_the_repo_server.md +++ b/docs/zh/server/administration/administrator/configuring_the_repo_server.md @@ -1,27 +1,7 @@ # 搭建repo服务器 >![](./public_sys-resources/icon-note.gif) **说明:** ->openEuler提供了多种repo源供用户在线使用,各repo源含义可参考[系统安装](./../Releasenotes/系统安装.md)。若用户无法在线获取openEuler repo源,则可使用openEuler提供的ISO发布包创建为本地openEuler repo源。本章节中以openEuler-22.03-LTS-SP4-aarch64-dvd.iso发布包为例,请根据实际需要的ISO发布包进行修改。 - - - -- [搭建repo服务器](#搭建repo服务器) - - [概述](#概述) - - [创建/更新本地repo源](#创建更新本地repo源) - - [获取ISO发布包](#获取iso发布包) - - [挂载ISO创建repo源](#挂载iso创建repo源) - - [创建本地repo源](#创建本地repo源) - - [更新repo源](#更新repo源) - - [部署远端repo源](#部署远端repo源) - - [nginx安装与配置](#nginx安装与配置) - - [启动nginx服务](#启动nginx服务) - - [repo源部署](#repo源部署) - - [使用repo源](#使用repo源) - - [repo配置为yum源(软件源)](#repo配置为yum源软件源) - - [repo优先级](#repo优先级) - - [dnf相关命令](#dnf相关命令) - - +>openEuler提供了多种repo源供用户在线使用,各repo源含义可参考[系统安装](./../../releasenotes/os_installation.md)。若用户无法在线获取openEuler repo源,则可使用openEuler提供的ISO发布包创建为本地openEuler repo源。本章节中以openEuler-22.03-LTS-SP4-aarch64-dvd.iso发布包为例,请根据实际需要的ISO发布包进行修改。 ## 概述 @@ -30,6 +10,7 @@ ## 创建/更新本地repo源 使用mount挂载,将openEuler的ISO发布包openEuler-22.03-LTS-SP4-aarch64-dvd.iso创建为repo源,并能够对repo源进行更新。 + ### 获取ISO发布包 请从如下网址获取openEuler的ISO发布包: @@ -42,13 +23,13 @@ 示例如下: -``` +```shell # mount /home/openEuler/openEuler-22.03-LTS-SP4-aarch64-dvd.iso /mnt/ ``` 挂载好的mnt目录如下: -``` +```text . │── boot.catalog │── docs @@ -66,7 +47,7 @@ 可以拷贝ISO发布包中相关文件至本地目录以创建本地repo源,示例如下: -``` +```shell # mount /home/openEuler/openEuler-22.03-LTS-SP4-aarch64-dvd.iso /mnt/ $ mkdir -p ~/srv/repo/ $ cp -r /mnt/Packages ~/srv/repo/ @@ -76,7 +57,7 @@ $ cp -r /mnt/RPM-GPG-KEY-openEuler ~/srv/repo/ 本地repo目录如下: -``` +```text . │── Packages │── repodata @@ -89,11 +70,11 @@ Packages为rpm包所在的目录,repodata为repo源元数据所在的目录, 更新repo源有两种方式: -- 通过新版本的ISO更新已有的repo源,与创建repo源的方式相同,即挂载ISO发布包或重新拷贝ISO发布包至本地目录。 +- 通过新版本的ISO更新已有的repo源,与创建repo源的方式相同,即挂载ISO发布包或重新拷贝ISO发布包至本地目录。 -- 在repo源的Packages目录下添加rpm包,然后通过createrepo命令更新repo源。 +- 在repo源的Packages目录下添加rpm包,然后通过createrepo命令更新repo源。 - ``` + ```shell # createrepo --update --workers=10 ~/srv/repo ``` @@ -102,19 +83,19 @@ Packages为rpm包所在的目录,repodata为repo源元数据所在的目录, >![](./public_sys-resources/icon-note.gif) **说明:** >若命令打印信息为“createrepo:未找到命令”,则表示未安装createrepo软件,可在root权限下执行**dnf install createrepo**进行安装。 - ## 部署远端repo源 安装openEuler操作系统,在openEuler上通过nginx部署repo源。 + ### nginx安装与配置 -1. 请自行下载nginx工具并在root权限下安装nginx。 -2. 安装nginx之后,在root权限下配置/etc/nginx/nginx.conf。 +1. 请自行下载nginx工具并在root权限下安装nginx。 +2. 安装nginx之后,在root权限下配置/etc/nginx/nginx.conf。 >![](./public_sys-resources/icon-note.gif) **说明:** >文档中的配置内容仅供参考,请用户根据实际情况(例如安全加固需要)进行配置。 - ``` + ```text user nginx; worker_processes auto; # 建议设置为core-1 error_log /var/log/nginx/error.log warn; # log存放位置 @@ -153,19 +134,18 @@ Packages为rpm包所在的目录,repodata为repo源元数据所在的目录, } ``` - ### 启动nginx服务 -1. 在root权限下通过systemd启动nginx服务: +1. 在root权限下通过systemd启动nginx服务: - ``` + ```shell # systemctl enable nginx # systemctl start nginx ``` -2. nginx是否启动成功可通过下面命令查看: +2. nginx是否启动成功可通过下面命令查看: - ``` + ```shell # systemctl status nginx ``` @@ -176,7 +156,7 @@ Packages为rpm包所在的目录,repodata为repo源元数据所在的目录, - 若nginx服务启动失败,查看错误信息: - ``` + ```shell # systemctl status nginx.service --full ``` @@ -185,7 +165,7 @@ Packages为rpm包所在的目录,repodata为repo源元数据所在的目录, 如[图2](#zh-cn_topic_0151920971_f1f9f3d086e454b9cba29a7cae96a4c54)所示nginx服务创建失败,是由于目录/var/spool/nginx/tmp/client\_body创建失败,在root权限下手动进行创建,类似的问题也这样处理: - ``` + ```shell # mkdir -p /var/spool/nginx/tmp/client_body # mkdir -p /var/spool/nginx/tmp/proxy # mkdir -p /var/spool/nginx/tmp/fastcgi @@ -193,80 +173,78 @@ Packages为rpm包所在的目录,repodata为repo源元数据所在的目录, # mkdir -p /usr/share/nginx/scgi_temp ``` - ### repo源部署 -1. 在root权限下创建nginx配置文件/etc/nginx/nginx.conf中指定的目录/usr/share/nginx/repo: +1. 在root权限下创建nginx配置文件/etc/nginx/nginx.conf中指定的目录/usr/share/nginx/repo: - ``` + ```shell # mkdir -p /usr/share/nginx/repo ``` -2. 在root权限下修改目录/usr/share/nginx/repo的权限: +2. 在root权限下修改目录/usr/share/nginx/repo的权限: - ``` + ```shell # chmod -R 755 /usr/share/nginx/repo ``` -3. 设置防火墙规则,开启nginx设置的端口(此处为80端口),在root权限下通过firewall设置端口开启: +3. 设置防火墙规则,开启nginx设置的端口(此处为80端口),在root权限下通过firewall设置端口开启: - ``` + ```shell # firewall-cmd --add-port=80/tcp --permanent # firewall-cmd --reload ``` 在root权限下查询80端口是否开启成功,输出为yes则表示80端口开启成功: - ``` + ```shell # firewall-cmd --query-port=80/tcp ``` 也可在root权限下通过iptables来设置80端口开启: - ``` + ```shell # iptables -I INPUT -p tcp --dport 80 -j ACCEPT ``` -4. nginx服务设置好之后,即可通过ip直接访问网页,如[图3](#zh-cn_topic_0151921017_fig1880404110396): +4. nginx服务设置好之后,即可通过ip直接访问网页,如[图3](#zh-cn_topic_0151921017_fig1880404110396): **图 3** nginx部署成功 ![](./figures/nginx_deployed_success.png) -5. 通过下面几种方式将repo源放入到/usr/share/nginx/repo下: +5. 通过下面几种方式将repo源放入到/usr/share/nginx/repo下: - 在root权限下拷贝镜像中相关文件至/usr/share/nginx/repo下,并修改目录权限。 - ``` - # mount /home/openEuler/openEuler-22.03-LTS-SP4-aarch64-dvd.iso /mnt/ - # cp -r /mnt/Packages /usr/share/nginx/repo - # cp -r /mnt/repodata /usr/share/nginx/repo - # cp -r /mnt/RPM-GPG-KEY-openEuler /usr/share/nginx/repo - # chmod -R 755 /usr/share/nginx/repo - ``` - - openEuler-22.03-LTS-SP4-aarch64-dvd.iso存放在/home/openEuler目录下。 + ```shell + # mount /home/openEuler/openEuler-22.03-LTS-SP4-aarch64-dvd.iso /mnt/ + # cp -r /mnt/Packages /usr/share/nginx/repo + # cp -r /mnt/repodata /usr/share/nginx/repo + # cp -r /mnt/RPM-GPG-KEY-openEuler /usr/share/nginx/repo + # chmod -R 755 /usr/share/nginx/repo + ``` + + openEuler-22.03-LTS-SP4-aarch64-dvd.iso存放在/home/openEuler目录下。 - 使用root在/usr/share/nginx/repo下创建repo源的软链接。 - - ``` - # ln -s /mnt /usr/share/nginx/repo/os - ``` - - /mnt为已经创建好的repo源,/usr/share/nginx/repo/os将指向/mnt。 + ```shell + # ln -s /mnt /usr/share/nginx/repo/os + ``` + /mnt为已经创建好的repo源,/usr/share/nginx/repo/os将指向/mnt。 ## 使用repo源 repo可配置为yum源,yum(全称为 Yellow dog Updater, Modified)是一个Shell前端软件包管理器。基于RPM包管理,能够从指定的服务器自动下载RPM包并且安装,可以自动处理依赖性关系,并且一次安装所有依赖的软件包,无须繁琐地一次次下载和安装。 + ### repo配置为yum源(软件源) 构建好的repo可以配置为yum源使用,在/etc/yum.repos.d/目录下使用root权限创建\*\*\*.repo的配置文件(必须以.repo为扩展名),分为本地和http服务器配置yum源两种方式: -- 配置本地yum源 +- 配置本地yum源 在/etc/yum.repos.d目录下创建openEuler.repo文件,使用构建的本地repo源作为yum源,openEuler.repo的内容如下: - ``` + ```text [base] name=base baseurl=file:///home/openEuler/srv/repo @@ -283,13 +261,13 @@ repo可配置为yum源,yum(全称为 Yellow dog Updater, Modified)是一 > - gpgcheck可设置为1或0,1表示进行gpg(GNU Private Guard)校验,0表示不进行gpg校验,gpgcheck可以确定rpm包的来源是有效和安全的。 > - gpgkey为验证签名用的公钥。 -- 配置http服务器yum源 +- 配置http服务器yum源 在/etc/yum.repos.d目录下创建openEuler.repo文件。 - - - 若使用用户部署的http服务端的repo源作为yum源,openEuler.repo的内容如下: - ``` + - 若使用用户部署的http服务端的repo源作为yum源,openEuler.repo的内容如下: + + ```text [base] name=base baseurl=http://192.168.139.209/ @@ -301,9 +279,9 @@ repo可配置为yum源,yum(全称为 Yellow dog Updater, Modified)是一 >![](./public_sys-resources/icon-note.gif) **说明:** >“192.168.139.209”为示例地址,请用户根据实际情况进行配置。 - - 若使用openEuler提供的openEuler repo源作为yum源,以AArch64架构的OS repo源为例,openEuler.repo的内容如下: - - ``` + - 若使用openEuler提供的openEuler repo源作为yum源,以AArch64架构的OS repo源为例,openEuler.repo的内容如下: + + ```text [base] name=base baseurl=http://repo.openeuler.org/openEuler-22.03-LTS-SP4/OS/aarch64/ @@ -312,13 +290,11 @@ repo可配置为yum源,yum(全称为 Yellow dog Updater, Modified)是一 gpgkey=http://repo.openeuler.org/openEuler-22.03-LTS-SP4/OS/aarch64/RPM-GPG-KEY-openEuler ``` - - ### repo优先级 当有多个repo源时,可通过在.repo文件的priority参数设置repo的优先级(如果不设置,默认优先级是99,当相同优先级的源中存在相同rpm包时,会安装最新的版本)。其中,1为最高优先级,99为最低优先级,如给openEuler.repo配置优先级为2: -``` +```text [base] name=base baseurl=http://192.168.139.209/ @@ -332,69 +308,68 @@ gpgkey=http://192.168.139.209/RPM-GPG-KEY-openEuler dnf命令在安装升级时能够自动解析包的依赖关系,一般的使用方式如下: -``` +```shell dnf ``` 常用的命令如下: -- 安装,需要在root权限下执行。 +- 安装,需要在root权限下执行。 - ``` + ```shell # dnf install ``` -- 升级,需要在root权限下执行。 +- 升级,需要在root权限下执行。 - ``` + ```shell # dnf update ``` -- 回退,需要在root权限下执行。 +- 回退,需要在root权限下执行。 - ``` + ```shell # dnf downgrade ``` -- 检查更新 +- 检查更新 - ``` + ```shell # dnf check-update ``` -- 卸载,需要在root权限下执行。 +- 卸载,需要在root权限下执行。 - ``` + ```shell # dnf remove ``` -- 查询 +- 查询 - ``` + ```shell # dnf search ``` -- 本地安装,需要在root权限下执行。 +- 本地安装,需要在root权限下执行。 - ``` + ```shell # dnf localinstall ``` -- 查看历史记录 +- 查看历史记录 - ``` + ```shell # dnf history ``` -- 清除缓存目录 +- 清除缓存目录 - ``` + ```shell # dnf clean all ``` -- 更新缓存 +- 更新缓存 - ``` + ```shell # dnf makecache ``` - diff --git a/docs/zh/server/administration/administrator/configuring_the_web_server.md b/docs/zh/server/administration/administrator/configuring_the_web_server.md index f331822af6f0279cc01138e06e43954489342ee6..4ee7efa47de32a3708de8418dfc58e635156572d 100644 --- a/docs/zh/server/administration/administrator/configuring_the_web_server.md +++ b/docs/zh/server/administration/administrator/configuring_the_web_server.md @@ -1,24 +1,7 @@ # 搭建web服务器 - - -- [搭建web服务器](#搭建web服务器) - - [Apache服务器](#apache服务器) - - [概述](#概述) - - [管理httpd](#管理httpd) - - [配置文件说明](#配置文件说明) - - [管理模块和SSL](#管理模块和ssl) - - [验证web服务是否搭建成功](#验证web服务是否搭建成功) - - [Nginx服务器](#nginx服务器) - - [概述](#概述-1) - - [安装](#安装) - - [管理nginx](#管理nginx) - - [配置文件说明](#配置文件说明-1) - - [管理模块](#管理模块) - - [验证web服务是否搭建成功](#验证web服务是否搭建成功-1) - - ## Apache服务器 + ### 概述 Web(World Wide Web)是目前最常用的Internet协议之一。目前在Unix-Like系统中的web服务器主要通过Apache服务器软件实现。为了实现运营动态网站,产生了LAMP(Linux + Apache +MySQL + PHP)。web服务可以结合文字、图形、影像以及声音等多媒体,并支持超链接(Hyperlink)的方式传输信息。 @@ -33,86 +16,82 @@ openEuler系统中的web服务器版本是Apache HTTP服务器2.4版本,即htt #### 前提条件 -- 为了能够使用Apache HTTP服务,请确保您的系统中已经安装httpd服务的rpm包。在root权限下执行如下命令进行安装: +- 为了能够使用Apache HTTP服务,请确保您的系统中已经安装httpd服务的rpm包。在root权限下执行如下命令进行安装: - ``` + ```shell # dnf install httpd ``` - 更多关于管理服务的内容,请参见[管理服务](./管理服务.html)。 + 更多关于管理服务的内容,请参见[管理服务](./service_management.md)。 -- 启动、停止和重启httpd服务,需要使用root权限。 +- 启动、停止和重启httpd服务,需要使用root权限。 #### 启动服务 -- 启动并运行httpd服务,命令如下: +- 启动并运行httpd服务,命令如下: - ``` + ```shell # systemctl start httpd ``` +- 假如希望在系统启动时,httpd服务自动启动,则命令和回显如下: -- 假如希望在系统启动时,httpd服务自动启动,则命令和回显如下: - - ``` + ```shell # systemctl enable httpd Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service → /usr/lib/systemd/system/httpd.service. ``` - >![](./public_sys-resources/icon-note.gif) **说明:** >假如正在运行的Apache HTTP服务器作为一个安全服务器,系统开机启动后需要密码,这个密码使用的是加密的私有SSL密钥。 #### 停止服务 -- 停止运行的httpd服务,命令如下: +- 停止运行的httpd服务,命令如下: - ``` + ```shell # systemctl stop httpd ``` -- 如果希望防止服务在系统开机阶段自动开启,命令和回显如下: +- 如果希望防止服务在系统开机阶段自动开启,命令和回显如下: - ``` + ```shell # systemctl disable httpd Removed /etc/systemd/system/multi-user.target.wants/httpd.service. ``` - #### 重启服务 重启服务有三种方式: -- 完全重启服务 +- 完全重启服务 - ``` + ```shell # systemctl restart httpd ``` 该命令会停止运行的httpd服务并且立即重新启动它。一般在服务安装以后或者去除一个动态加载的模块(例如PHP)时使用这个命令。 -- 重新加载配置 +- 重新加载配置 - ``` + ```shell # systemctl reload httpd ``` 该命令会使运行的httpd服务重新加载它的配置文件。任何当前正在处理的请求将会被中断,从而造成客户端浏览器显示一个错误消息或者重新渲染部分页面。 -- 重新加载配置而不影响激活的请求 +- 重新加载配置而不影响激活的请求 - ``` + ```shell # apachectl graceful ``` 该命令会使运行的httpd服务重新加载它的配置文件。任何当前正在处理的请求将会继续使用旧的配置文件。 - #### 验证服务状态 验证httpd服务是否正在运行 -``` +```shell $ systemctl is-active httpd ``` @@ -147,19 +126,20 @@ $ systemctl is-active httpd 虽然默认配置可以适用于多数情况,但是用户至少需要熟悉里面的一些重要配置项。配置文件修改完成后,可以在root权限下使用如下命令检查配置文件可能出现的语法错误。 -``` +```shell # apachectl configtest ``` 如果回显如下,说明配置文件语法正确。 -``` +```text Syntax OK ``` ->![](./public_sys-resources/icon-note.gif) **说明:** ->- 在修改配置文件之前,请先备份原始文件,以便出现问题时能够快速恢复配置文件。 ->- 需要重启web服务,才能使修改后的配置文件生效。 +>![](./public_sys-resources/icon-note.gif) **说明:** +> +>- 在修改配置文件之前,请先备份原始文件,以便出现问题时能够快速恢复配置文件。 +>- 需要重启web服务,才能使修改后的配置文件生效。 ### 管理模块和SSL @@ -173,80 +153,78 @@ httpd服务是一个模块化的应用,它和许多动态共享对象DSO(Dyn 例如,加载asis DSO模块的操作步骤如下: -1. 在/etc/httpd/conf.modules.d/00-optional.conf文件中,使用root权限取消注释如下配置行。 +1. 在/etc/httpd/conf.modules.d/00-optional.conf文件中,使用root权限取消注释如下配置行。 - ``` + ```shell LoadModule asis_module modules/mod_asis.so ``` -2. 加载完成后,请使用root权限重启httpd服务以便于重新加载配置文件。 +2. 加载完成后,请使用root权限重启httpd服务以便于重新加载配置文件。 - ``` + ```shell # systemctl restart httpd ``` -3. 加载完成后,在root权限下使用httpd -M的命令查看是否已经加载了asis DSO模块。 +3. 加载完成后,在root权限下使用httpd -M的命令查看是否已经加载了asis DSO模块。 - ``` + ```shell # httpd -M | grep asis ``` 回显如下,说明asis DSO模块加载成功。 - ``` + ```text asis_module (shared) ``` - >![](./public_sys-resources/icon-note.gif) **说明:** >**httpd 的常用命令** > ->- httpd -v : 查看httpd的版本号。 ->- httpd -l:查看编译进httpd程序的静态模块。 ->- httpd -M:查看已经编译进httpd程序的静态模块和已经加载的动态模块。 +>- httpd -v : 查看httpd的版本号。 +>- httpd -l:查看编译进httpd程序的静态模块。 +>- httpd -M:查看已经编译进httpd程序的静态模块和已经加载的动态模块。 #### SSL介绍 安全套接层SSL(Secure Sockets Layer)是一个允许服务端和客户端之间进行安全通信的加密协议。其中,传输层安全性协议TLS(Transport Layer Security)为网络通信提供了安全性和数据完整性保障。openEuler支持Mozilla NSS(Network Security Services)作为安全性协议TLS进行配置。加载SSL的操作步骤如下: -1. 在root权限下安装mod\_ssl的rpm包。 +1. 在root权限下安装mod\_ssl的rpm包。 - ``` + ```shell # dnf install mod_ssl ``` -2. 安装完成后,请在root权限下重启httpd服务以便于重新加载配置文件。 +2. 安装完成后,请在root权限下重启httpd服务以便于重新加载配置文件。 - ``` + ```shell # systemctl restart httpd ``` -3. 加载完成后,在root权限下使用httpd -M的命令查看是否已经加载了SSL。 +3. 加载完成后,在root权限下使用httpd -M的命令查看是否已经加载了SSL。 - ``` + ```shell # httpd -M | grep ssl ``` 回显如下,说明SSL已加载成功。 - ``` + ```shell ssl_module (shared) ``` - ### 验证web服务是否搭建成功 Web服务器搭建完成后,可以通过如下方式验证是否搭建成功。 -1. 在root权限下查看服务器的IP地址,命令如下: +1. 在root权限下查看服务器的IP地址,命令如下: - ``` + ```shell # ifconfig ``` 回显信息如下,说明服务器IP为 192.168.1.60。 - ``` + ```text enp3s0: flags=4163 mtu 1500 inet 192.168.1.60 netmask 255.255.255.0 broadcast 192.168.1.255 inet6 fe80::5054:ff:fe95:499f prefixlen 64 scopeid 0x20 @@ -273,75 +251,74 @@ Web服务器搭建完成后,可以通过如下方式验证是否搭建成功 TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 ``` -2. 在root权限下配置防火墙: +2. 在root权限下配置防火墙: - ``` + ```shell # firewall-cmd --add-service=http --permanent success # firewall-cmd --reload success ``` -3. 验证web服务器是否搭建成功,用户可选择Linux或Windows系统进行验证。 - - 使用Linux系统验证 +3. 验证web服务器是否搭建成功,用户可选择Linux或Windows系统进行验证。 + + - 使用Linux系统验证 执行如下命令,查看是否可以访问网页信息,服务搭建成功时,该网页可以正常访问。 - ``` + ```shell $ curl http://192.168.1.60 ``` 执行如下命令,查看命令返回值是否为0,返回值为0,说明httpd服务器搭建成功。 - ``` + ```shell $ echo $? ``` - - 使用Windows系统验证 + - 使用Windows系统验证 打开浏览器,在地址栏输入如下地址,如果能正常访问网页,说明httpd服务器搭建成功。 - http://192.168.1.60 + 如果修改了端口号,输入地址格式如下: - http://192.168.1.60:端口号 - - + ## Nginx服务器 + ### 概述 Nginx 是一款轻量级的 Web 服务器/反向代理服务器及电子邮件(IMAP/POP3)代理服务器,其特点是占用内存少,并发能力强,支持FastCGI、SSL、Virtual Host、URL Rewrite、Gzip等功能,并且支持很多第三方的模块扩展。 ### 安装 -1. 配置本地yum源,详细信息请参考[搭建repo服务器](./搭建repo服务器.html)。 -2. 清除缓存。 +1. 配置本地yum源,详细信息请参考[搭建repo服务器](./configuring_the_repo_server.md)。 +2. 清除缓存。 - ``` + ```shell $ dnf clean all ``` -3. 创建缓存。 +3. 创建缓存。 - ``` + ```shell $ dnf makecache ``` -4. 在root权限下安装nginx服务。 +4. 在root权限下安装nginx服务。 - ``` + ```shell # dnf install nginx ``` -5. 查看安装后的rpm包。 +5. 查看安装后的rpm包。 - ``` + ```shell $ dnf list all | grep nginx ``` - ### 管理nginx #### 概述 @@ -350,82 +327,78 @@ Nginx 是一款轻量级的 Web 服务器/反向代理服务器及电子邮件 #### 前提条件 -- 为了能够使用nginx服务,请确保您的系统中已经安装nginx服务。若未安装,可参考[安装](#安装)进行安装。 +- 为了能够使用nginx服务,请确保您的系统中已经安装nginx服务。若未安装,可参考[安装](#安装)进行安装。 - 更多关于管理服务的内容,请参见[管理服务](./管理服务.html)。 + 更多关于管理服务的内容,请参见[管理服务](./service_management.md)。 -- 启动、停止和重启nginx服务,需要使用root权限。 +- 启动、停止和重启nginx服务,需要使用root权限。 #### 启动服务 -- 启动并运行nginx服务,命令如下: +- 启动并运行nginx服务,命令如下: - ``` + ```shell # systemctl start nginx ``` +- 假如希望在系统启动时,nginx服务自动启动,则命令和回显如下: -- 假如希望在系统启动时,nginx服务自动启动,则命令和回显如下: - - ``` + ```text # systemctl enable nginx Created symlink /etc/systemd/system/multi-user.target.wants/nginx.service → /usr/lib/systemd/system/nginx.service. ``` - >![](./public_sys-resources/icon-note.gif) **说明:** >假如正在运行的nginx服务器作为一个安全服务器,系统开机启动后需要密码,这个密码使用的是加密的私有SSL密钥。 #### 停止服务 -- 停止运行的nginx服务,命令如下: +- 停止运行的nginx服务,命令如下: - ``` + ```shell # systemctl stop nginx ``` -- 如果希望防止服务在系统开机阶段自动开启,命令和回显如下: +- 如果希望防止服务在系统开机阶段自动开启,命令和回显如下: - ``` + ```text # systemctl disable nginx Removed /etc/systemd/system/multi-user.target.wants/nginx.service. ``` - #### 重启服务 重启服务有三种方式: -- 完全重启服务 +- 完全重启服务 - ``` + ```shell # systemctl restart nginx ``` 该命令会停止运行的nginx服务并且立即重新启动它。一般在服务安装以后或者去除一个动态加载的模块(例如PHP)时使用这个命令。 -- 重新加载配置 +- 重新加载配置 - ``` + ```shell # systemctl reload nginx ``` 该命令会使运行的nginx服务重新加载它的配置文件。任何当前正在处理的请求将会被中断,从而造成客户端浏览器显示一个错误消息或者重新渲染部分页面。 -- 平滑重启nginx +- 平滑重启nginx - ``` + ```shell # kill -HUP 主进程ID ``` 该命令会使运行的nginx服务重新加载它的配置文件。任何当前正在处理的请求将会继续使用旧的配置文件。 - #### 验证服务状态 验证nginx服务是否正在运行 -``` +```shell $ systemctl is-active nginx ``` @@ -460,15 +433,16 @@ $ systemctl is-active nginx 虽然默认配置可以适用于多数情况,但是用户至少需要熟悉里面的一些重要配置项。配置文件修改完成后,可以在root权限下使用如下命令检查配置文件可能出现的语法错误。 -``` +```text # nginx -t ``` 如果回显信息中有“syntax is ok”,说明配置文件语法正确。 ->![](./public_sys-resources/icon-note.gif) **说明:** ->- 在修改配置文件之前,请先备份原始文件,以便出现问题时能够快速恢复配置文件。 ->- 需要重启web服务,才能使修改后的配置文件生效。 +>![](./public_sys-resources/icon-note.gif) **说明:** +> +>- 在修改配置文件之前,请先备份原始文件,以便出现问题时能够快速恢复配置文件。 +>- 需要重启web服务,才能使修改后的配置文件生效。 ### 管理模块 @@ -486,15 +460,15 @@ openEuler操作系统中使用dnf install nginx安装nginx时会自动加载DSO Web服务器搭建完成后,可以通过如下方式验证是否搭建成功。 -1. 在root权限下查看服务器的IP地址,命令如下: +1. 在root权限下查看服务器的IP地址,命令如下: - ``` + ```shell # ifconfig ``` 回显信息如下,说明服务器IP为 192.168.1.60。 - ``` + ```text enp3s0: flags=4163 mtu 1500 inet 192.168.1.60 netmask 255.255.255.0 broadcast 192.168.1.255 inet6 fe80::5054:ff:fe95:499f prefixlen 64 scopeid 0x20 @@ -521,38 +495,36 @@ Web服务器搭建完成后,可以通过如下方式验证是否搭建成功 TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 ``` -2. 在root权限下配置防火墙: +2. 在root权限下配置防火墙: - ``` + ```shell # firewall-cmd --add-service=http --permanent success # firewall-cmd --reload success ``` -3. 验证web服务器是否搭建成功,用户可选择Linux或Windows系统进行验证。 - - 使用Linux系统验证 +3. 验证web服务器是否搭建成功,用户可选择Linux或Windows系统进行验证。 + - 使用Linux系统验证 执行如下命令,查看是否可以访问网页信息,服务搭建成功时,该网页可以正常访问。 - ``` + ```shell $ curl http://192.168.1.60 ``` 执行如下命令,查看命令返回值是否为0,返回值为0,说明nginx服务器搭建成功。 - ``` + ```shell $ echo $? ``` - - 使用Windows系统验证 + - 使用Windows系统验证 打开浏览器,在地址栏输入如下地址,如果能正常访问网页,说明nginx服务器搭建成功。 - http://192.168.1.60 + 如果修改了端口号,输入地址格式如下: - http://192.168.1.60:端口号 - - + diff --git a/docs/zh/server/administration/administrator/process_management.md b/docs/zh/server/administration/administrator/process_management.md index c876f9dc12183d7b63c33df737c24374731c479b..20ead010fcd9b6418f2c409b0f8c5e18a1d7a96a 100644 --- a/docs/zh/server/administration/administrator/process_management.md +++ b/docs/zh/server/administration/administrator/process_management.md @@ -1,20 +1,7 @@ # 管理进程 操作系统管理多个用户的请求和多个任务。大多数系统都只有一个CPU和一个主要存储,但一个系统可能有多个二级存储磁盘和多个输入/输出设备。操作系统管理这些资源并在多个用户间共享资源,当用户提出一个请求时,造成好像系统被用户独占的假象。实际上操作系统监控着一个等待执行的任务队列,这些任务包括用户任务、操作系统任务、邮件和打印任务等。本章节将从用户的角度讲述如何控制进程。 - - -- [管理进程](#管理进程) - - [查看进程](#查看进程) - - [who命令](#who命令) - - [ps命令](#ps命令) - - [top命令](#top命令) - - [kill命令](#kill命令) - - [调度启动进程](#调度启动进程) - - [定时运行一批程序(at)](#定时运行一批程序at) - - [周期性运行一批程序(cron)](#周期性运行一批程序cron) - - [挂起/恢复进程](#挂起恢复进程) - - + ## 查看进程 Linux是一个多任务系统,经常需要对这些进程进行一些调配和管理。要进行管理,首先就要知道现在的进程情况:有哪些进程、进程的状态如何等。Linux提供了多种命令来了解进程的状况。 @@ -25,7 +12,7 @@ who命令主要用于查看当前系统中的用户情况。如果用户想和 例如查看系统中的用户及其状态。使用如下: -``` +```shell $ who admin tty1 2023-07-28 15:55 admin pts/0 2023-08-05 15:46 (192.168.0.110) @@ -97,7 +84,7 @@ ps命令最常用的还是用来监控后台进程的工作情况,因为后台 例如显示系统中终端上的所有进程。命令如下: -``` +```shell $ ps -a PID TTY TIME CMD 12175 pts/6 00:00:00 bash @@ -123,7 +110,7 @@ kill命令是通过向进程发送指定的信号来结束进程的。如果没 kill命令的浯法格式有以下两种方式: -``` +```shell kill [-s 信号 | -p] [-a] 进程号… kill -l [信号] ``` @@ -132,13 +119,13 @@ kill -l [信号] 杀死pid为1409的进程,在root权限下执行如下命令: -``` +```shell # kill -9 1409 ``` 显示所有的信号及其编号对应关系,示例如下: -``` +```shell $ kill -l 1) SIGHUP 2) SIGINT 3) SIGQUIT 4) SIGILL 5) SIGTRAP 6) SIGABRT 7) SIGBUS 8) SIGFPE 9) SIGKILL 10) SIGUSR1 @@ -159,8 +146,6 @@ $ kill -l 有时候需要对系统进行一些比较费时而且占用资源的维护工作,这些工作适合在深夜进行,这时候用户就可以事先进行调度安排,指定任务运行的时间或者场合,到时候系统会自动完成这些任务。要使用自动启动进程的功能,就需要掌握以下几个启动命令。 - - ### 定时运行一批程序(at) #### at命令 @@ -169,7 +154,7 @@ $ kill -l at命令的语法格式如下: -``` +```shell at [-V] [-q 队列] [-f 文件名] [-mldbv] 时间 at -c 作业 [作业…] ``` @@ -178,16 +163,16 @@ at命令的语法格式如下: at允许使用一套相当复杂的时间指定方法,比如: -- 接受在当天的hh:mm(小时:分钟)式的时间指定。如果该时间已经过去,那么就放在第二天执行。 -- 使用midnight(深夜)、noon(中午)、teatime(饮茶时间,一般是下午4点)等比较模糊的词语来指定时间。 -- 采用12小时计时制,即在时间后面加上AM(上午)或者PM(下午)来说明是上午还是下午。 -- 指定命令执行的具体日期,指定格式为month day(月日)或者mm/dd/yy(月/日/年)或者dd.mm.yy(日.月.年)。指定的日期必须跟在指定时间的后面。 +- 接受在当天的hh:mm(小时:分钟)式的时间指定。如果该时间已经过去,那么就放在第二天执行。 +- 使用midnight(深夜)、noon(中午)、teatime(饮茶时间,一般是下午4点)等比较模糊的词语来指定时间。 +- 采用12小时计时制,即在时间后面加上AM(上午)或者PM(下午)来说明是上午还是下午。 +- 指定命令执行的具体日期,指定格式为month day(月日)或者mm/dd/yy(月/日/年)或者dd.mm.yy(日.月.年)。指定的日期必须跟在指定时间的后面。 上面介绍的都是绝对计时法,其实还可以使用相对计时法,这对于安排不久就要执行的命令是很有好处的。指定格式为now+count time-units,now就是当前时间,time-units是时间单位,这里可以是minutes(分钟)、hours(小时)、days(天)、weeks(星期)。count是时间的数量,究竟是几天,还是几小时等。还有一种计时方法就是直接使用today(今天)、tomorrow(明天)来指定完成命令的时间。下面通过一些例子来说明具体用法。 例如指定在今天下午4:30执行某个命令。假设现在时间是中午12:30,2019年6月7日,可用命令格式如下: -``` +```shell at 4:30pm at 16:30 at 16:30 today @@ -206,7 +191,7 @@ at允许使用一套相当复杂的时间指定方法,比如: 例如在6月8日上午10点执行slocate -u命令。在root权限下执行命令如下: -``` +```shell # at 10:00 6/8/19 at> slocate -u at> @@ -235,14 +220,14 @@ crontab命令用于安装、删除或者显示用于驱动cron后台进程的表 crontab命令的常用方法如下: -- crontab -u:设置某个用户的cron服务,root用户在执行crontab时需要此参数。 -- crontab -l:列出当前用户cron服务的详细内容。 -- crontab -r:删除当前用户的cron服务。 -- crontab -e:编辑当前用户的cron服务。 +- crontab -u:设置某个用户的cron服务,root用户在执行crontab时需要此参数。 +- crontab -l:列出当前用户cron服务的详细内容。 +- crontab -r:删除当前用户的cron服务。 +- crontab -e:编辑当前用户的cron服务。 例如root查看自己的cron设置。命令如下: -``` +```shell # crontab -u root -l ``` @@ -250,7 +235,7 @@ crontab命令的常用方法如下: 在crontab文件中输入需要执行的命令和时间。该文件中每行都包括6个域,其中前5个域是指定命令被执行的时间,最后一个域是要被执行的命令。每个域之间使用空格或者制表符分隔。格式如下: -``` +```shell minute hour day-of-month month-of-year day-of-week commands ``` @@ -302,7 +287,7 @@ minute hour day-of-month month-of-year day-of-week commands 例如每天18点到22点之间每两个小时,在/tmp/test.txt文件中加入sleepy文本。在crontab文件中对应的行如下: -``` +```shell * 18-22/2 * * * echo "sleepy" >> /tmp/test.txt ``` @@ -310,14 +295,13 @@ minute hour day-of-month month-of-year day-of-week commands 假设有个用户名为userexample,他需要为自己创建一个crontab文件。步骤如下: -1. 首先可以使用任何文本编辑器建立一个新文件,并向该文件加入需要运行的命令和要定期执行的时间,假设该文件为 \~/userexample.cron。 -2. 然后在root权限下使用crontab命令安装这个文件,使之成为该用户的crontab文件。命令如下: +1. 首先可以使用任何文本编辑器建立一个新文件,并向该文件加入需要运行的命令和要定期执行的时间,假设该文件为 \~/userexample.cron。 +2. 然后在root权限下使用crontab命令安装这个文件,使之成为该用户的crontab文件。命令如下: - ``` + ```shell # crontab -u userexample ~/userexample.cron ``` - 这样crontab文件就建立好了,可以转到/var/spool/cron目录下面查看,发现多了一个userexample文件。这个文件就是所需的crontab文件。 >![](./public_sys-resources/icon-note.gif) **说明:** @@ -327,7 +311,7 @@ minute hour day-of-month month-of-year day-of-week commands cron服务每分钟不仅要读一次/var/spool/cron内的所有文件,还需要读一次/etc/crontab,因此通过配置这个文件也能得到cron的服务。用crontab配置是针对某个用户的,而编辑/etc/crontab是针对系统的任务。此文件的文件格式如下: -``` +```text SHELL=/bin/sh PATH=/usr/bin:/usr/sbin:/sbin:/bin:/usr/lib/news/bin MAILTO=root //如果出现错误,或者有数据输出,数据作为邮件发给这个帐号 @@ -347,4 +331,3 @@ HOME=/ 作业控制允许进程挂起并可以在需要时恢复进程的运行,被挂起的作业恢复后将从中止处开始继续运行。只要在键盘上按“Ctrl+Z”键,即可挂起当前的前台作业。在键盘上按“Ctrl+Z”键后,将挂起当前执行的命令cat。使用jobs命令可以显示shell的作业清单,包括具体的作业、作业号以及作业当前所处的状态。 恢复进程执行时,有两种选择:用fg命令将挂起的作业放回到前台执行;用bg命令将挂起的作业放到后台执行。灵活使用上述命令,将给自己带来很大的方便。 - diff --git a/docs/zh/server/administration/administrator/service_management.md b/docs/zh/server/administration/administrator/service_management.md index f9f5349ee37742881939a9b8dfb3f3024534d4df..0db1c77e6617c264eba0d59686b09f12a6b59552 100644 --- a/docs/zh/server/administration/administrator/service_management.md +++ b/docs/zh/server/administration/administrator/service_management.md @@ -1,44 +1,6 @@ # 管理服务 本章介绍如何使用systemd进行系统和服务管理。 - - -- [管理服务](#管理服务) - - [简介](#简介) - - [概念介绍](#概念介绍) - - [特性说明](#特性说明) - - [更快的启动速度](#更快的启动速度) - - [提供按需启动能力](#提供按需启动能力) - - [采用cgroup特性跟踪和管理进程的生命周期](#采用cgroup特性跟踪和管理进程的生命周期) - - [启动挂载点和自动挂载的管理](#启动挂载点和自动挂载的管理) - - [实现事务性依赖关系管理](#实现事务性依赖关系管理) - - [与SysV初始化脚本兼容](#与sysv初始化脚本兼容) - - [能够对系统进行快照和恢复](#能够对系统进行快照和恢复) - - [管理系统服务](#管理系统服务) - - [sysvinit命令和systemd命令](#sysvinit命令和systemd命令) - - [显示所有当前服务](#显示所有当前服务) - - [显示服务状态](#显示服务状态) - - [运行服务](#运行服务) - - [关闭服务](#关闭服务) - - [重启服务](#重启服务) - - [启用服务](#启用服务) - - [禁用服务](#禁用服务) - - [改变运行级别](#改变运行级别) - - [Target和运行级别](#target和运行级别) - - [查看系统默认启动目标](#查看系统默认启动目标) - - [查看当前系统所有的启动目标](#查看当前系统所有的启动目标) - - [改变默认目标](#改变默认目标) - - [改变当前目标](#改变当前目标) - - [切换到救援模式](#切换到救援模式) - - [切换到紧急模式](#切换到紧急模式) - - [关闭、暂停和休眠系统](#关闭暂停和休眠系统) - - [systemctl命令](#systemctl命令) - - [关闭系统](#关闭系统) - - [重启系统](#重启系统) - - [使系统待机](#使系统待机) - - [使系统休眠](#使系统休眠) - - ## 简介 @@ -176,8 +138,8 @@ systemd提供了比UpStart更激进的并行启动能力,采用了socket/D-Bus 为了减少系统启动时间,systemd的目标是: -- 尽可能启动更少的进程。 -- 尽可能将更多进程并行启动。 +- 尽可能启动更少的进程。 +- 尽可能将更多进程并行启动。 ### 提供按需启动能力 @@ -329,19 +291,19 @@ systemd提供systemctl命令与sysvinit命令的功能类似。当前版本中 如果您需要显示当前正在运行的服务,使用命令如下: -``` +```shell systemctl list-units --type service ``` 如果您需要显示所有的服务(包括未运行的服务),需要添加-all参数,使用命令如下: -``` +```shell systemctl list-units --type service --all ``` 例如显示当前正在运行的服务,命令如下: -``` +```shell $ systemctl list-units --type service UNIT LOAD ACTIVE SUB DESCRIPTION atd.service loaded active running Deferred execution scheduler @@ -361,7 +323,7 @@ gssproxy.service loaded active running GSSAPI Proxy Daemon 如果您需要显示某个服务的状态,可执行如下命令: -``` +```shell systemctl status name.service ``` @@ -401,7 +363,7 @@ systemctl status name.service 如果您需要鉴别某个服务是否运行,可执行如下命令: -``` +```shell systemctl is-active name.service ``` @@ -441,7 +403,7 @@ is-active命令的返回结果如下: 同样,如果您需要判断某个服务是否被启用,可执行如下命令: -``` +```shell systemctl is-enabled name.service ``` @@ -521,7 +483,7 @@ is-enabled命令的返回结果如下: 例如查看gdm.service服务状态,命令如下: -``` +```shell # systemctl status gdm.service gdm.service - GNOME Display Manager Loaded: loaded (/usr/lib/systemd/system/gdm.service; enabled) @@ -537,13 +499,13 @@ gdm.service - GNOME Display Manager 如果您需要运行某个服务,请在root权限下执行如下命令: -``` +```shell systemctl start name.service ``` 例如运行httpd服务,命令如下: -``` +```shell # systemctl start httpd.service ``` @@ -551,13 +513,13 @@ systemctl start name.service 如果您需要关闭某个服务,请在root权限下执行如下命令: -``` +```shell systemctl stop name.service ``` 例如关闭蓝牙服务,命令如下: -``` +```shell # systemctl stop bluetooth.service ``` @@ -565,7 +527,7 @@ systemctl stop name.service 如果您需要重启某个服务,请在root权限下执行如下命令: -``` +```shell systemctl restart name.service ``` @@ -573,7 +535,7 @@ systemctl restart name.service 例如重启蓝牙服务,命令如下: -``` +```shell # systemctl restart bluetooth.service ``` @@ -581,13 +543,13 @@ systemctl restart name.service 如果您需要在开机时启用某个服务,请在root权限下执行如下命令: -``` +```shell systemctl enable name.service ``` 例如设置httpd服务开机时启动,命令如下: -``` +```shell # systemctl enable httpd.service ln -s '/usr/lib/systemd/system/httpd.service' '/etc/systemd/system/multi-user.target.wants/httpd.service' ``` @@ -596,13 +558,13 @@ ln -s '/usr/lib/systemd/system/httpd.service' '/etc/systemd/system/multi-user.ta 如果您需要在开机时禁用某个服务,请在root权限下执行如下命令: -``` +```shell systemctl disable name.service ``` 例如在开机时禁用蓝牙服务启动,命令如下: -``` +```shell # systemctl disable bluetooth.service Removed /etc/systemd/system/bluetooth.target.wants/bluetooth.service. Removed /etc/systemd/system/dbus-org.bluez.service. @@ -681,7 +643,7 @@ systemd用目标(target)替代了运行级别的概念,提供了更大的 查看当前系统默认的启动目标,命令如下: -``` +```shell systemctl get-default ``` @@ -689,7 +651,7 @@ systemctl get-default 查看当前系统所有的启动目标,命令如下: -``` +```shell systemctl list-units --type=target ``` @@ -697,7 +659,7 @@ systemctl list-units --type=target 改变系统默认的目标,在root权限下执行如下命令: -``` +```shell systemctl set-default name.target ``` @@ -705,7 +667,7 @@ systemctl set-default name.target 改变当前系统的目标,在root权限下执行如下命令: -``` +```shell systemctl isolate name.target ``` @@ -713,13 +675,13 @@ systemctl isolate name.target 改变当前系统为救援模式,在root权限下执行如下命令: -``` +```shell systemctl rescue ``` 这条命令和“systemctl isolate rescue.target”类似。命令执行后会在串口有如下打印信息: -``` +```shell You are in rescue mode. After logging in, type "journalctl -xb" to viewsystem logs, "systemctl reboot" to reboot, "systemctl default" or "exit"to boot into default mode. Give root password for maintenance (or press Control-D to continue): @@ -732,13 +694,13 @@ Give root password for maintenance 改变当前系统为紧急模式,在root权限下执行如下命令: -``` +```shell systemctl emergency ``` 这条命令和“systemctl isolate emergency.target”类似。命令执行后会在串口有如下打印信息: -``` +```shell You are in emergency mode. After logging in, type "journalctl -xb" to viewsystem logs, "systemctl reboot" to reboot, "systemctl default" or "exit"to boot into default mode. Give root password for maintenance (or press Control-D to continue): @@ -792,19 +754,19 @@ systemd通过systemctl命令可以对系统进行关机、重启、休眠等一 关闭系统并下电,在root权限下执行如下命令: -``` +```shell systemctl poweroff ``` 关闭系统但不下电机器,在root权限下执行如下命令: -``` +```shell systemctl halt ``` 执行上述命令会给当前所有的登录用户发送一条提示消息。如果不想让systemd发送该消息,您可以添加“\-\-no\-wall”参数。具体命令如下: -``` +```shell systemctl --no-wall poweroff ``` @@ -812,13 +774,13 @@ systemctl --no-wall poweroff 重启系统,在root权限下执行如下命令: -``` +```shell systemctl reboot ``` 执行上述命令会给当前所有的登录用户发送一条提示消息。如果不想让systemd发送该消息,您可以添加“\-\-no\-wall”参数。具体命令如下: -``` +```shell systemctl --no-wall reboot ``` @@ -826,7 +788,7 @@ systemctl --no-wall reboot 使系统待机,在root权限下执行如下命令: -``` +```shell systemctl suspend ``` @@ -834,12 +796,12 @@ systemctl suspend 使系统休眠,在root权限下执行如下命令: -``` +```shell systemctl hibernate ``` 使系统待机且处于休眠状态,在root权限下执行如下命令: -``` +```shell systemctl hybrid-sleep ``` diff --git a/docs/zh/server/administration/administrator/setting_up_the_database_server.md b/docs/zh/server/administration/administrator/setting_up_the_database_server.md index 753cab1337ae8a13596228ef13b6084507b68814..4042f76d794d7866a451094eaf6c7f7322027858 100644 --- a/docs/zh/server/administration/administrator/setting_up_the_database_server.md +++ b/docs/zh/server/administration/administrator/setting_up_the_database_server.md @@ -1,34 +1,5 @@ # 搭建数据库服务器 - - -- [搭建数据库服务器](#搭建数据库服务器) - - [PostgreSql服务器](#postgresql服务器) - - [软件介绍](#软件介绍) - - [配置环境](#配置环境) - - [安装、运行和卸载](#安装运行和卸载) - - [管理数据库角色](#管理数据库角色) - - [管理数据库](#管理数据库) - - [Mariadb服务器](#mariadb服务器) - - [软件介绍](#软件介绍-1) - - [配置环境](#配置环境-1) - - [安装、运行和卸载](#安装运行和卸载-1) - - [管理数据库用户](#管理数据库用户) - - [管理数据库](#管理数据库-1) - - [MySQL服务器](#mysql服务器) - - [软件介绍](#软件介绍-2) - - [配置环境](#配置环境-2) - - [安装、运行和卸载](#安装运行和卸载-2) - - [管理数据库用户](#管理数据库用户-1) - - [管理数据库](#管理数据库-2) - - [openGauss服务器](#openGauss服务器) - - [软件介绍](#软件介绍-3) - - [安装](#安装-3) - - [管理数据库角色](#管理数据库角色-1) - - [管理数据库](#管理数据库-3) - - - ## PostgreSql服务器 ### 软件介绍 @@ -165,6 +136,7 @@ sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config #### 搭建数据盘 >![](./public_sys-resources/icon-note.gif) **说明:** +> >- 测试极限性能时,建议单独挂载IO性能更优的NVME SSD存储介质创建PostgreSQL测试实例,避免磁盘IO对性能测试结果的影响,本文以单独挂载NVME SSD为例,参考步骤1\~步骤4。 >- 非性能测试时,在root权限下执行以下命令,创建数据目录即可。然后跳过本小节: > mkdir /data @@ -199,7 +171,7 @@ sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config #### 安装 -1. 配置本地yum源,详细信息请参考[搭建repo服务器](./搭建repo服务器.md)。 +1. 配置本地yum源,详细信息请参考[搭建repo服务器](./configuring_the_repo_server.md)。 2. 清除缓存。 ```shell @@ -871,6 +843,7 @@ MariaDB的架构如[图2](#fig13492418164520)所示。 #### 搭建数据盘 >![](./public_sys-resources/icon-note.gif) **说明:** +> >- 进行性能测试时,数据目录使用单独硬盘,需要对硬盘进行格式化并挂载,参考方法一或者方法二。 >- 非性能测试时,在root权限下执行`mkdir /data`创建数据目录即可。然后跳过本小节。 @@ -913,9 +886,10 @@ MariaDB的架构如[图2](#fig13492418164520)所示。 ##### 方法二:在root权限下使用LVM进行磁盘管理 >![](./public_sys-resources/icon-note.gif) **说明:** ->此步骤需要安装镜像中的lvm2相关包,步骤如下: ->1. 配置本地yum源,详细信息请参考[搭建repo服务器](./搭建repo服务器.md)。如果已经执行,则可跳过此步。 ->2. 在root权限下执行`yum install lvm2`命令安装lvm2。 +>此步骤需要安装镜像中的lvm2相关包,步骤如下: +> +>- 配置本地yum源,详细信息请参考[搭建repo服务器](./configuring_the_repo_server.md)。如果已经执行,则可跳过此步。 +>- 在root权限下执行`yum install lvm2`命令安装lvm2。 1. 创建物理卷(sdb为硬盘名称,具体名字以实际为准)。 @@ -969,7 +943,7 @@ MariaDB的架构如[图2](#fig13492418164520)所示。 #### 安装 -1. 配置本地yum源,详细信息请参考[搭建repo服务器](./搭建repo服务器.md)。 +1. 配置本地yum源,详细信息请参考[搭建repo服务器](./configuring_the_repo_server.md)。 2. 清除缓存。 ```shell @@ -1491,6 +1465,7 @@ MySQL所使用的SQL语言是用于访问数据库的最常用标准化语言。 #### 搭建数据盘 >![](./public_sys-resources/icon-note.gif) **说明:** +> >- 进行性能测试时,数据目录使用单独硬盘,需要对硬盘进行格式化并挂载,参考方法一或者方法二。 >- 非性能测试时,在root权限下执行`mkdir /data`创建数据目录即可。然后跳过本小节: @@ -1533,9 +1508,10 @@ MySQL所使用的SQL语言是用于访问数据库的最常用标准化语言。 ##### 方法二:在root权限下使用LVM进行磁盘管理 >![](./public_sys-resources/icon-note.gif) **说明:** ->此步骤需要安装镜像中的lvm2相关包,步骤如下: ->1. 配置本地yum源,详细信息请参考[搭建repo服务器](./搭建repo服务器.md)。如果已经执行,则可跳过此步。 ->2. 执行`yum install lvm2`安装lvm2。 +>此步骤需要安装镜像中的lvm2相关包,步骤如下: +> +>- 配置本地yum源,详细信息请参考[搭建repo服务器](./configuring_the_repo_server.md。如果已经执行,则可跳过此步。 +>- 执行`yum install lvm2`安装lvm2。 1. 创建物理卷(sdb为硬盘名称,具体名字以实际为准)。 @@ -1592,7 +1568,7 @@ MySQL所使用的SQL语言是用于访问数据库的最常用标准化语言。 #### 安装 -1. 配置本地yum源,详细信息请参考[搭建repo服务器](./搭建repo服务器.md)章节。 +1. 配置本地yum源,详细信息请参考[搭建repo服务器](./configuring_the_repo_server.md)章节。 2. 清除缓存。 ```shell diff --git a/docs/zh/server/administration/administrator/user_and_user_group_management.md b/docs/zh/server/administration/administrator/user_and_user_group_management.md index 1bfd9d422f60d038bb60c493d8148906dbc1ffd9..97443fd814c118516a672697d9ead07f5e76efb6 100644 --- a/docs/zh/server/administration/administrator/user_and_user_group_management.md +++ b/docs/zh/server/administration/administrator/user_and_user_group_management.md @@ -4,23 +4,6 @@ 用户和用户组管理是系统安全管理的重要组成部分,本章主要介绍openEuler提供的用户管理和组管理命令,以及为普通用户分配特权的方法。 - - -- [管理用户](#管理用户) - - [管理用户](#管理用户-1) - - [增加用户](#增加用户) - - [修改用户帐号](#修改用户帐号) - - [删除用户](#删除用户) - - [管理员帐户授权](#管理员帐户授权) - - [管理用户组](#管理用户组) - - [增加用户组](#增加用户组) - - [修改用户组](#修改用户组) - - [删除用户组](#删除用户组) - - [将用户加入用户组或从用户组中移除](#将用户加入用户组或从用户组中移除) - - [切换用户组](#切换用户组) - - - ## 管理用户 ### 增加用户 @@ -29,7 +12,7 @@ 在root权限下,通过useradd命令可以为系统添加新用户信息,其中 _options_ 为相关参数, _username_ 为用户名称。 -``` +```shell useradd [options] username ``` @@ -37,63 +20,66 @@ useradd [options] username 与用户帐号信息有关的文件如下: -- /etc/passwd:用户帐号信息文件。 -- /etc/shadow:用户帐号信息加密文件。 -- /etc/group:组信息文件。 -- /etc/default/useradd:定义默认设置文件。 -- /etc/login.defs:系统广义设置文件。 -- /etc/skel:默认的初始配置文件目录。 +- /etc/passwd:用户帐号信息文件。 +- /etc/shadow:用户帐号信息加密文件。 +- /etc/group:组信息文件。 +- /etc/default/useradd:定义默认设置文件。 +- /etc/login.defs:系统广义设置文件。 +- /etc/skel:默认的初始配置文件目录。 #### 创建用户示例 例如新建一个用户名为userexample的用户,在root权限下执行如下命令: -``` +```shell # useradd userexample ``` >![](./public_sys-resources/icon-note.gif) **说明:** >没有任何提示,表明用户建立成功。这时请使用passwd命令设置用户的密码,没有设置密码的新帐号不能登录系统。 - 使用id命令查看新建的用户信息,命令如下: -``` +```shell # id userexample uid=1000(userexample) gid=1000(userexample) groups=1000(userexample) ``` 修改用户userexample的密码: -``` +```shell # passwd userexample ``` 建议在修改用户密码时满足密码复杂度要求,密码的复杂度的要求如下: -1. 口令长度至少8个字符。 -2. 口令至少包含大写字母、小写字母、数字和特殊字符中的任意3种。 -3. 口令不能和帐号一样。 -4. 口令不能使用字典词汇。 - - 查询字典 +1. 口令长度至少8个字符。 +2. 口令至少包含大写字母、小写字母、数字和特殊字符中的任意3种。 +3. 口令不能和帐号一样。 +4. 口令不能使用字典词汇。 + - 查询字典 在已装好的openEuler环境中,可以通过如下命令导出字典库文件dictionary.txt,用户可以查询密码是否在该字典中。 - ``` + + ```shell cracklib-unpacker /usr/share/cracklib/pw_dict > dictionary.txt ``` - - 修改字典 - 1. 修改上面导出的字典文件,执行如下命令更新系统字典库。 - ``` + + - 修改字典 + 1. 修改上面导出的字典文件,执行如下命令更新系统字典库。 + + ```shell # create-cracklib-dict dictionary.txt ``` - 2. 在原字典库基础上新增其他字典内容custom.txt。 - ``` + + 2. 在原字典库基础上新增其他字典内容custom.txt。 + + ```shell # create-cracklib-dict dictionary.txt custom.txt ``` - 根据提示两次输入新用户的密码,完成密码更改。过程如下: -``` +```shell # passwd userexample Changing password for user userexample. New password: @@ -102,7 +88,7 @@ passwd: all authentication tokens updated successfully. ``` >![](./public_sys-resources/icon-note.gif) **说明:** ->若打印信息中出现“BAD PASSWORD: The password fails the dictionary check - it is too simplistic/sytematic”,表示设置的密码过于简单,建议设置复杂度较高的密码。 +>若打印信息中出现“BAD PASSWORD: The password fails the dictionary check - it is too simplistic/systematic”,表示设置的密码过于简单,建议设置复杂度较高的密码。 ### 修改用户帐号 @@ -116,36 +102,35 @@ passwd: all authentication tokens updated successfully. 用户也可以使用usermod命令修改shell信息,在root权限下执行如下命令,其中 _new\_shell\_path_ 为目标shell路径,_username_ 为要修改用户的用户名,请根据实际情况修改: -``` +```shell usermod -s new_shell_path username ``` 例如,将用户userexample的shell改为csh,命令如下: -``` +```shell # usermod -s /bin/csh userexample ``` #### 修改主目录 -- 修改主目录,可以在root权限下执行如下命令,其中 _new\_home\_directory_ 为已创建的目标主目录的路径,_username_ 为要修改用户的用户名,请根据实际情况修改: +- 修改主目录,可以在root权限下执行如下命令,其中 _new\_home\_directory_ 为已创建的目标主目录的路径,_username_ 为要修改用户的用户名,请根据实际情况修改: - ``` + ```shell usermod -d new_home_directory username ``` -- 如果想将现有主目录的内容转移到新的目录,应该使用-m选项,命令如下: +- 如果想将现有主目录的内容转移到新的目录,应该使用-m选项,命令如下: - ``` + ```shell usermod -d new_home_directory -m username ``` - #### 修改UID 修改用户ID,在root权限下执行如下命令,其中 _UID_ 代表目标用户ID,_username_ 代表用户名,请根据实际情况修改: -``` +```shell usermod -u UID username ``` @@ -155,7 +140,7 @@ usermod -u UID username 如果使用了影子口令,则可以在root权限下,执行如下命令来修改一个帐号的有效期,其中 _MM_ 代表月份,_DD_ 代表某天,_YY_ 代表年份,_username_ 代表用户名,请根据实际情况修改: -``` +```shell usermod -e MM/DD/YY username ``` @@ -165,7 +150,7 @@ usermod -e MM/DD/YY username 例如,删除用户Test,命令如下: -``` +```shell # userdel Test ``` @@ -180,7 +165,7 @@ usermod -e MM/DD/YY username sudo命令允许已经在/etc/sudoers文件中指定的用户运行管理员帐户命令。例如,一个已经获得许可的普通用户可以运行如下命令: -``` +```shell sudo /usr/sbin/useradd newuserl ``` @@ -188,51 +173,49 @@ sudo /usr/sbin/useradd newuserl /etc/sudoers的配置行如下所示。 -- 空行或注释行(以\#字符打头):无具体功能的行。 -- 可选的主机别名行:用来创建主机列表的简称。必须以Host\_Alias关键词开头,列表中的主机必须用逗号(,)隔开,如: +- 空行或注释行(以\#字符打头):无具体功能的行。 +- 可选的主机别名行:用来创建主机列表的简称。必须以Host\_Alias关键词开头,列表中的主机必须用逗号(,)隔开,如: - ``` + ```shell Host_Alias linux=ted1,ted2 ``` 其中ted1和ted2是两个主机名,可使用linux(别名)称呼它们。 - -- 可选的用户别名行:用来创建用户列表的简称。用户别名行必须以User\_Alias关键词开头,列表中的用户名必须以逗号(,)隔开。其格式同主机别名行。 -- 可选的命令别名行:用来创建命令列表的简称。必须以Cmnd\_Alias开头,列表中的命令必须用逗号(,)隔开。 -- 可选的运行方式别名行:用来创建用户列表的简称。不同的是,使用这样的别名可以告诉sudo程序以列表中某一用户的身份来运行程序。 -- 必要的用户访问说明行。 +- 可选的用户别名行:用来创建用户列表的简称。用户别名行必须以User\_Alias关键词开头,列表中的用户名必须以逗号(,)隔开。其格式同主机别名行。 +- 可选的命令别名行:用来创建命令列表的简称。必须以Cmnd\_Alias开头,列表中的命令必须用逗号(,)隔开。 +- 可选的运行方式别名行:用来创建用户列表的简称。不同的是,使用这样的别名可以告诉sudo程序以列表中某一用户的身份来运行程序。 +- 必要的用户访问说明行。 用户访问的说明语法如下: - ``` + ```text user host = [ run as user ] command list ``` 在user处指定一个真正的用户名或定义过的别名,host也可以是一个真正的主机名或者定义过的主机别名。默认情况下,sudo执行的所有命令都是以root身份执行。如果您想使用其他身份可以指定。command list可以是以逗号(,)分隔的命令列表,也可以是一个已经定义过的别名,如: - ``` + ```text ted1 ted2=/sbin/shutdown ``` 这一句说明ted1可以在ted2主机上运行关机命令。 - ``` + ```text newuser1 ted1=(root) /usr/sbin/useradd,/usr/sbin/userdel ``` 这一句说明ted1主机上的newuser1可以以root用户权限执行useradd,userdel命令。 >![](./public_sys-resources/icon-note.gif) **说明:** - >- 可以在一行定义多个别名,中间用冒号 \(:\) 隔开。 - >- 可在命令或命令别名之前加上感叹号 \(!\),使该命令或命令别名无效。 - >- 有两个关键词:ALL和NOPASSWD。ALL意味着“所有”(所有文件、所有主机或所有命令),NOPASSWD意味着不用密码。 - >- 通过修改用户访问,将普通用户的访问权限修改为同root一样,则可以给普通用户分配特权。 - + >- 可以在一行定义多个别名,中间用冒号 \(:\) 隔开。 + >- 可在命令或命令别名之前加上感叹号 \(!\),使该命令或命令别名无效。 + >- 有两个关键词:ALL和NOPASSWD。ALL意味着“所有”(所有文件、所有主机或所有命令),NOPASSWD意味着不用密码。 + >- 通过修改用户访问,将普通用户的访问权限修改为同root一样,则可以给普通用户分配特权。 下面是一个sudoers文件的例子: -``` +```text #sudoers files #User alias specification User_Alias ADMIN=ted1:POWERUSER=globus,ted2 @@ -243,15 +226,15 @@ POWERUSER ALL=ALL,!/bin/su 其中: -- User\_Alias ADMIN=ted1:POWERUSER=globus,ted2 +- User\_Alias ADMIN=ted1:POWERUSER=globus,ted2 定义了两个别名ADMIN和POWERUSER -- ADMIN ALL=ALL +- ADMIN ALL=ALL 说明在所有主机上,ADMIN用户都可以以root身份执行所有命令 -- POWERUSER ALL=ALL,!/bin/su +- POWERUSER ALL=ALL,!/bin/su 给POWERUSER用户除了运行su命令外等同ADMIN的权限 @@ -263,24 +246,23 @@ POWERUSER ALL=ALL,!/bin/su 在root权限下,通过groupadd命令可以为系统添加新用户组信息,其中 _options_ 为相关参数, _groupname_ 为用户组名称。 -``` +```shell groupadd [options] groupname ``` + 例如新建一个用户组名为groupexample的用户,在root权限下执行如下命令: -``` +```shell # groupadd groupexample ``` - #### 用户组信息文件 与用户组信息有关的文件如下: -- /etc/gshadow:用户组信息加密文件。 -- /etc/group:组信息文件。 -- /etc/login.defs:系统广义设置文件。 - +- /etc/gshadow:用户组信息加密文件。 +- /etc/group:组信息文件。 +- /etc/login.defs:系统广义设置文件。 ### 修改用户组 @@ -288,16 +270,15 @@ groupadd [options] groupname 修改用户组ID,在root权限下执行如下命令,其中 _GID_ 代表目标用户组ID, _groupname_ 代表用户组,请根据实际情况修改: -``` +```shell groupmod -g GID groupname ``` - #### 修改用户组名 修改用户组名,在root权限下执行如下命令,其中 _newgroupname_ 代表新用户组名, _oldgroupname_ 代表已经存在的待修改的用户组名,请根据实际情况修改: -``` +```shell groupmod -n newgroupname oldgroupname ``` @@ -307,7 +288,7 @@ groupmod -n newgroupname oldgroupname 例如,删除用户组Test,命令如下: -``` +```shell # groupdel Test ``` @@ -320,12 +301,13 @@ groupmod -n newgroupname oldgroupname 例如,将用户 _userexample_ 加入用户组 _Test_ ,命令如下: -``` +```shell # gpasswd -a userexample Test ``` + 例如,将用户 _userexample_ 从 _Test_ 用户组中移除,命令如下: -``` +```shell # gpasswd -d userexample Test ``` @@ -335,8 +317,6 @@ groupmod -n newgroupname oldgroupname 例如,将用户 _userexample_ 切换到 _Test_ 用户组,命令如下: -``` +```shell $ newgrp Test ``` - - diff --git a/docs/zh/server/administration/administrator/using_dnf_to_manage_software_packages.md b/docs/zh/server/administration/administrator/using_dnf_to_manage_software_packages.md index ff6b4e22f99de83345538a2e5c4bbb809b3a63b5..7f866b243fbb05ad8ab2afbc1efe00c76ba45436 100644 --- a/docs/zh/server/administration/administrator/using_dnf_to_manage_software_packages.md +++ b/docs/zh/server/administration/administrator/using_dnf_to_manage_software_packages.md @@ -6,31 +6,6 @@ DNF是一款Linux软件包管理工具,用于管理RPM软件包。DNF可以查 > >- DNF与YUM完全兼容,提供了YUM兼容的命令行以及为扩展和插件提供的API。 >- 使用DNF需要管理员权限,本章所有命令需要在管理员权限下执行。 - - -- [使用DNF管理软件包](#使用dnf管理软件包) - - [配置DNF](#配置dnf) - - [DNF配置文件](#dnf配置文件) - - [创建本地软件源仓库](#创建本地软件源仓库) - - [添加、启用和禁用软件源](#添加启用和禁用软件源) - - [管理软件包](#管理软件包) - - [搜索软件包](#搜索软件包) - - [列出软件包清单](#列出软件包清单) - - [显示RPM包信息](#显示rpm包信息) - - [安装RPM包](#安装rpm包) - - [下载软件包](#下载软件包) - - [删除软件包](#删除软件包) - - [管理软件包组](#管理软件包组) - - [列出软件包组清单](#列出软件包组清单) - - [显示软件包组信息](#显示软件包组信息) - - [安装软件包组](#安装软件包组) - - [删除软件包组](#删除软件包组) - - [检查并更新](#检查并更新) - - [检查更新](#检查更新) - - [升级](#升级) - - [更新所有的包和它们的依赖](#更新所有的包和它们的依赖) - - ## 配置DNF @@ -152,7 +127,7 @@ repository部分允许您定义定制化的openEuler软件源仓库,各个仓

baseurl=repository_url

软件仓库(repository )的地址。

-
  • 使用http协议的网络位置:例如 http://path/to/repo
  • 使用ftp协议的网络位置:例如 ftp://path/to/repo
  • 本地位置:例如 file:///path/to/local/repo
+
  • 使用http协议的网络位置:例如 `http://path/to/repo`
  • 使用ftp协议的网络位置:例如 ftp://path/to/repo
  • 本地位置:例如 file:///path/to/local/repo
@@ -360,9 +335,9 @@ dnf install package_name package_name... --setopt=strict=0 >![](./public_sys-resources/icon-note.gif) **说明:** > ->- 安装RPM包过程中,若出现安装失败,可参考[安装时出现软件包冲突、文件冲突或缺少软件包导致安装失败](./faq_54.md#安装时出现软件包冲突文件冲突或缺少软件包导致安装失败)。 +>- 安装RPM包过程中,若出现安装失败,可参考[安装时出现软件包冲突、文件冲突或缺少软件包导致安装失败](https://docs.openeuler.openatom.cn/zh/docs/common/faq/server/administration_faqs.html#%E9%97%AE%E9%A2%985-%E5%AE%89%E8%A3%85%E6%97%B6%E5%87%BA%E7%8E%B0%E8%BD%AF%E4%BB%B6%E5%8C%85%E5%86%B2%E7%AA%81%E3%80%81%E6%96%87%E4%BB%B6%E5%86%B2%E7%AA%81%E6%88%96%E7%BC%BA%E5%B0%91%E8%BD%AF%E4%BB%B6%E5%8C%85%E5%AF%BC%E8%87%B4%E5%AE%89%E8%A3%85%E5%A4%B1%E8%B4%A5)。 >- 请勿安装install-scripts软件包,该包仅用于imageTailor工具裁剪ISO时使用,若在openEuler系统上安装该软件包会导致系统无法启动。 - + ### 下载软件包 使用dnf下载软件包,请在root权限下输入如下命令: diff --git a/docs/zh/server/administration/administrator/viewing_system_infortmation.md b/docs/zh/server/administration/administrator/viewing_system_information.md similarity index 77% rename from docs/zh/server/administration/administrator/viewing_system_infortmation.md rename to docs/zh/server/administration/administrator/viewing_system_information.md index be88212480663b19f6093883b1bf2af63391b6cc..d241f6b3ccb65400025f7f2c75c6b3210b4719bd 100644 --- a/docs/zh/server/administration/administrator/viewing_system_infortmation.md +++ b/docs/zh/server/administration/administrator/viewing_system_information.md @@ -1,14 +1,14 @@ # 查看系统信息 -- 查看系统信息,命令如下: +- 查看系统信息,命令如下: - ``` + ```shell $ cat /etc/os-release ``` 命令输出如下: - ``` + ```shell $ cat /etc/os-release NAME="openEuler" VERSION="22.03 (LTS SP4)" @@ -18,29 +18,28 @@ ANSI_COLOR="0;31" ``` - -- 查看系统相关的资源信息。 +- 查看系统相关的资源信息。 查看CPU信息,命令如下: - ``` + ```shell $ lscpu ``` 查看内存信息,命令如下: - ``` + ```shell $ free ``` 查看磁盘信息,命令如下: - ``` + ```shell $ fdisk -l ``` 查看系统资源实时信息,命令如下: - ``` + ```shell $ top ``` diff --git a/docs/zh/server/administration/compa_command/_toc.yaml b/docs/zh/server/administration/compa_command/_toc.yaml index 416c39d25bdf65bb76adacc7c49c641f4c775aa8..3d2cae5e5b88e9bfcf7379fcd9629002e5f235c0 100644 --- a/docs/zh/server/administration/compa_command/_toc.yaml +++ b/docs/zh/server/administration/compa_command/_toc.yaml @@ -1,9 +1,11 @@ +label: 兼容性命令 isManual: true -label: '' +description: 基于 Rust 语言重构的 shell 及 Linux 命令,与 Linux 原生命令兼容 sections: - label: 兼容性命令 href: ./overview.md - - label: utshell 用户手册 - href: ./utshell_guide.md - - label: utsudo 使用指南 - href: ./utsudo_user_guide.md + sections: + - label: utshell用户指南 + href: ./utshell_guide.md + - label: utsudo用户指南 + href: ./utsudo_user_guide.md diff --git a/docs/zh/server/administration/sysmaster/_toc.yaml b/docs/zh/server/administration/sysmaster/_toc.yaml index 5fad8bbe2548ee66e87175dba232270a15dbb631..662686fd4d1893cc53de27d48765242232e29a13 100644 --- a/docs/zh/server/administration/sysmaster/_toc.yaml +++ b/docs/zh/server/administration/sysmaster/_toc.yaml @@ -1,17 +1,20 @@ +label: sysMaster 用户指南 isManual: true -label: '' +description: 使用 sysMaster 管理服务器和设备 sections: - - label: 设备管理 - href: ./device_management.md - - label: 安装与部署 - href: ./devmaster_install_deploy.md - - label: 使用说明 - href: ./devmaster_usage.md - - label: sysMaster用户指南 + - label: 概述 href: ./overview.md - label: 服务管理 href: ./service_management.md - - label: 安装与部署 - href: ./sysmaster_install_deploy.md - - label: sysmaster使用说明 - href: ./sysmaster_usage.md + sections: + - label: 安装与部署 + href: ./sysmaster_install_deploy.md + - label: 使用说明 + href: ./sysmaster_usage.md + - label: 设备管理 + href: ./device_management.md + sections: + - label: 安装与部署 + href: ./devmaster_install_deploy.md + - label: 使用说明 + href: ./devmaster_usage.md diff --git a/docs/zh/server/development/ai4c/_toc.yaml b/docs/zh/server/development/ai4c/_toc.yaml index cd81f1238285544d40d2ddc135de9d3294d3e947..92f85bbb16356411f5b7d18c223fc797e5fbd71f 100644 --- a/docs/zh/server/development/ai4c/_toc.yaml +++ b/docs/zh/server/development/ai4c/_toc.yaml @@ -1,5 +1,6 @@ +label: AI4C 使用手册 isManual: true -label: '' +description: AI4C 代表 AI 辅助编译器的套件,是一个使编译器能够集成机器学习驱动编译优化的框架 sections: - - label: AI4C使用手册 + - label: AI4C 使用手册 href: ./ai4c_user_manual.md diff --git a/docs/zh/server/development/application_dev/_toc.yaml b/docs/zh/server/development/application_dev/_toc.yaml index dca364752a5326ea9190d1e6c9875e5327a3e259..28560243483bdab4e8bb0e15b831eb7ae99074e4 100644 --- a/docs/zh/server/development/application_dev/_toc.yaml +++ b/docs/zh/server/development/application_dev/_toc.yaml @@ -1,19 +1,18 @@ +label: 应用开发指南 isManual: true -label: '' +description: 基于 openEuler 开发应用程序 sections: - - label: 应用开发指南 + - label: 概述 href: ./application_development.md - - label: 构建RPM包 - href: ./building_an_rpm_package.md - - label: FAQ - href: ./faq.md - - label: 安装obs工具 - href: ./Installing_obs.md - label: 开发环境准备 - href: ./perparations_for_development_environment.md + href: ./preparations_for_development_environment.md - label: 使用GCC编译 href: ./using_gcc_for_compilation.md - - label: 使用JDK编译 - href: ./using_jdk_for_compilation.md - label: 使用make编译 href: ./using_make_for_compilation.md + - label: 使用JDK编译 + href: ./using_jdk_for_compilation.md + - label: 构建RPM包 + href: ./building_an_rpm_package.md + - label: 安装obs工具 + href: ./installing_obs.md diff --git a/docs/zh/server/development/application_dev/faq.md b/docs/zh/server/development/application_dev/faq.md deleted file mode 100644 index d37b0523cacd2d9bb2c9ac0b75358cda70ae7e90..0000000000000000000000000000000000000000 --- a/docs/zh/server/development/application_dev/faq.md +++ /dev/null @@ -1,26 +0,0 @@ -# FAQ - - -- [FAQ](#faq) - - [部分依赖java-devel的应用程序自编译失败](#部分依赖java-devel的应用程序自编译失败) - - - -## 部分依赖java-devel的应用程序自编译失败 - -### 问题描述 - -部分依赖java-devel的应用程序会出现使用rpmbuild命令自编译失败的问题。 - -### 原因分析 - -为了提供更新的openjdk特性和对广大java应用程序的兼容,openEuler同时提供了openjdk-1.8.0、openjdk-11等多个版本的openjdk。部分应用程序在编译时需要依赖java-devel包,安装java-devel包时系统会默认安装更高版本的java-11-openjdk,从而导致这些应用的编译失败。 - -### 解决方法 - -用户需手动使用如下命令安装java-1.8.0-openjdk后再使用rpmbuild命令进行自编译。 - -```jdk -# yum install java-1.8.0-openjdk - -``` diff --git a/docs/zh/server/development/application_dev/Installing_obs.md b/docs/zh/server/development/application_dev/installing_obs.md similarity index 91% rename from docs/zh/server/development/application_dev/Installing_obs.md rename to docs/zh/server/development/application_dev/installing_obs.md index ea83f1162ee8bff91963dfafc645713f9c94c803..800ef8644d99f409692895e4f8723f6590438070 100644 --- a/docs/zh/server/development/application_dev/Installing_obs.md +++ b/docs/zh/server/development/application_dev/installing_obs.md @@ -15,14 +15,14 @@ obs-server 是 OBS 对应的软件包。 1. 确认设备已安装操作系统 openEuler 22.03 LTS SP4。 - ``` shell script + ```shell $ cat /etc/openEuler-release openEuler release 22.03 LTS SP4 ``` 2. 配置 yum 源。yum 源配置内容参考如下: - ``` shell script + ```shell [everything] name=everything baseurl=https://repo.openeuler.org/openEuler-22.03-LTS-SP4/everything/aarch64/ @@ -32,26 +32,26 @@ obs-server 是 OBS 对应的软件包。 执行下述命令拷贝上述文本到 repo 源中: - ``` shell script + ```shell sudo vi /etc/yum.repos.d/xxx.repo ``` 3. 使 yum 源生效。 - ``` shell script + ```shell sudo yum clean all sudo yum makecache ``` 4. 检查是否已安装其他版本的软件包。 - ``` shell script + ```shell sudo rpm -qa obs-server obs-common obs-api mod_passenger obs-api-deps obs-bundled-gems passenger ruby ruby-help ruby-irb rubygem-bundler rubygem-io-console rubygem-json rubygem-openssl rubygem-psych rubygem-rake rubygem-rdoc rubygems rubygem-bigdecimal rubygem-did_you_mean ``` 5. (可选)如果有其他版本的软件包,请卸载软件包防止安装冲突。 - ``` shell script + ```shell sudo yum remove -y obs-server obs-common obs-api mod_passenger obs-api-deps obs-bundled-gems passenger ruby ruby-help ruby-irb rubygem-bundler rubygem-io-console rubygem-json rubygem-openssl rubygem-psych rubygem-rake rubygem-rdoc rubygems rubygem-bigdecimal rubygem-did_you_mean ``` @@ -62,13 +62,13 @@ obs-server 是 OBS 对应的软件包。 6. 安装 obs-server 相关软件包。 - ``` shell script + ```shell sudo yum install -y obs-api obs-server ``` 7. 检查 obs-server 软件包安装成功。 - ``` shell script + ```shell $ rpm -qa | grep obs-server obs-server-2.10.15-7.oe2203SP4.noarch $ rpm -qa | grep obs-api @@ -78,7 +78,7 @@ obs-server 是 OBS 对应的软件包。 ## 部署 1. 获取部署脚本,具体请参见获取链接: -https://gitee.com/openeuler/infrastructure/tree/master/obs/tf/startup + 2. 执行 restart_service.sh 脚本部署 OBS 工具。 diff --git a/docs/zh/server/development/application_dev/perparations_for_development_environment.md b/docs/zh/server/development/application_dev/preparations_for_development_environment.md similarity index 95% rename from docs/zh/server/development/application_dev/perparations_for_development_environment.md rename to docs/zh/server/development/application_dev/preparations_for_development_environment.md index 6b37c8b5b20b52280cabd16c1b6f7f46b41d74ee..f548478943a21e7510c5c13ac169a7e5edb70f7f 100644 --- a/docs/zh/server/development/application_dev/perparations_for_development_environment.md +++ b/docs/zh/server/development/application_dev/preparations_for_development_environment.md @@ -1,24 +1,4 @@ # 开发环境准备 - - -- [开发环境准备](#开发环境准备) - - [环境要求](#环境要求) - - [操作系统要求](#操作系统要求) - - [配置openEuler yum源](#配置openeuler-yum源) - - [通过直接获取在线的openEuler repo源配置在线yum源](#通过直接获取在线的openeuler-repo源配置在线yum源) - - [通过挂载ISO创建本地openEuler repo源配置本地yum源](#通过挂载iso创建本地openeuler-repo源配置本地yum源) - - [安装软件包](#安装软件包) - - [安装JDK软件包](#安装jdk软件包) - - [安装rpm-build软件包](#安装rpm-build软件包) - - [使用IDE进行Java开发](#使用ide进行java开发) - - [简介](#简介) - - [使用MobaXterm登录服务器](#使用mobaxterm登录服务器) - - [设置JDK环境](#设置jdk环境) - - [下载安装GTK库](#下载安装gtk库) - - [设置X11 Forwarding](#设置x11-forwarding) - - [下载并运行IntelliJ IDEA](#下载并运行intellij-idea) - - ## 环境要求 @@ -231,7 +211,7 @@ openEuler操作系统具体安装方法请参考[安装指南](./../../installat ``` 11. 使用**wget**命令远程下载发布包,命令中的 _ipaddriso_ 为openEuler发布包地址。 - + ```shell $ wget ipaddriso ``` diff --git a/docs/zh/server/development/application_dev/using_gcc_for_compilation.md b/docs/zh/server/development/application_dev/using_gcc_for_compilation.md index 7d0f35847bc8fbe79e991c642be24b190d4c5c27..84f2c20f3d569fa227328678287f24fe400368eb 100644 --- a/docs/zh/server/development/application_dev/using_gcc_for_compilation.md +++ b/docs/zh/server/development/application_dev/using_gcc_for_compilation.md @@ -1,24 +1,6 @@ # 使用GCC编译 本章介绍GCC编译的一些基本知识,并通过示例进行实际演示。更多的GCC知识请通过**man gcc**命令查询。 - - -- [使用GCC编译](#使用gcc编译) - - [简介](#简介) - - [基本规则](#基本规则) - - [文件类型](#文件类型) - - [编译流程](#编译流程) - - [编译选项](#编译选项) - - [多源文件编译](#多源文件编译) - - [库](#库) - - [动态链接库](#动态链接库) - - [静态链接库](#静态链接库) - - [示例](#示例) - - [使用GCC编译C程序示例](#使用gcc编译c程序示例) - - [使用GCC创建和使用动态链接库示例](#使用gcc创建和使用动态链接库示例) - - [使用GCC创建和使用静态链接库示例](#使用gcc创建和使用静态链接库示例) - - ## 简介 diff --git a/docs/zh/server/development/application_dev/using_jdk_for_compilation.md b/docs/zh/server/development/application_dev/using_jdk_for_compilation.md index 968855d78a2c6c09578f61195a04f20ddf3b6041..4f9ba5c844b6388a40f74298a0f937e4e11a5497 100644 --- a/docs/zh/server/development/application_dev/using_jdk_for_compilation.md +++ b/docs/zh/server/development/application_dev/using_jdk_for_compilation.md @@ -1,20 +1,4 @@ # 使用JDK编译 - - -- [使用JDK编译](#使用jdk编译) - - [简介](#简介) - - [基本规则](#基本规则) - - [文件类型及工具](#文件类型及工具) - - [java程序生成流程](#java程序生成流程) - - [JDK常用工具选项](#jdk常用工具选项) - - [类库](#类库) - - [包的声明](#包的声明) - - [包的引用](#包的引用) - - [示例](#示例) - - [编译不带包的java程序示例](#编译不带包的java程序示例) - - [编译带包的java程序示例](#编译带包的java程序示例) - - ## 简介 diff --git a/docs/zh/server/development/application_dev/using_make_for_compilation.md b/docs/zh/server/development/application_dev/using_make_for_compilation.md index d072f21d2fbd31df5fb5eb1c3262b29061f42fef..1f5dbd48e4a5f74841ed0854750603a721844a08 100644 --- a/docs/zh/server/development/application_dev/using_make_for_compilation.md +++ b/docs/zh/server/development/application_dev/using_make_for_compilation.md @@ -1,21 +1,6 @@ # 使用make编译 本章介绍make编译的一些基本知识,并通过示例进行实际演示。更多的make选项请通过**man make**命令查询。 - - -- [使用make编译](#使用make编译) - - [简介](#简介) - - [基本规则](#基本规则) - - [文件类型](#文件类型) - - [make工作流程](#make工作流程) - - [make选项](#make选项) - - [Makefile](#makefile) - - [Makefile结构](#makefile结构) - - [Makefile主要内容](#makefile主要内容) - - [示例](#示例) - - [使用Makefile实现编译的示例](#使用makefile实现编译的示例) - - ## 简介 diff --git a/docs/zh/server/development/distributed/_toc.yaml b/docs/zh/server/development/distributed/_toc.yaml new file mode 100644 index 0000000000000000000000000000000000000000..7729d8d262e0e323788785958a2fbb6ca69e4372 --- /dev/null +++ b/docs/zh/server/development/distributed/_toc.yaml @@ -0,0 +1,14 @@ +label: 分布式中间件用户指南 +isManual: true +description: 分布式中间件用户指南 +sections: + - label: 分布式数据管理 + href: ./distributed_data_management.md + - label: 基于容器的软总线应用指南 + href: ./dsoftbus_application_based_on_containers.md + - label: 基于分布式软总线扩展生态互联 + href: ./expanding_the_ecosystem_through_distributed_soft_bus.md + - label: hmdfs 分布式文件系统概述 + href: ./hmdfs_distributed_file_system_overview.md + - label: 分布式中间件用户指南 + href: ./overview.md diff --git a/docs/zh/server/development/distributed/distributed_data_management.md b/docs/zh/server/development/distributed/distributed_data_management.md new file mode 100644 index 0000000000000000000000000000000000000000..362c353598dbb321a27d0988b99e4c33e3b69b80 --- /dev/null +++ b/docs/zh/server/development/distributed/distributed_data_management.md @@ -0,0 +1,83 @@ +# 分布式数据管理 + +分布式数据管理基于分布式软总线,实现了应用程序数据和用户数据的分布式管理。用户数据不再与单一物理设备绑定,业务逻辑与数据存储分离,应用跨设备运行时数据无缝衔接。 + +分布式数据管理由上游 `OpenHarmony 3.2 Release` 版本移植而来,目前包含四个组件: + +| 组件 | 对应openEuler软件包 | 功能介绍 | +| --- | --- | --- | +| 分布式数据服务(Distributed Data Service) | distributeddatamgr_datamgr_service | 提供不同设备间数据库数据分布式的能力 | +| 键值对数据库(KV store) | distributeddatamgr_kv_store | 为设备应用提供键值对数据管理能力 | +| 关系型数据库(Relational store) | distributeddatamgr_relational_store | 基于关系模型来管理数据的数据库 | +| 分布式数据对象部件(Data object) | distributeddatamgr_data_object | 具备多设备数据同步的面向对象的内存数据管理框架 | + +更多分布式数据管理介绍,可参考[上游 OpenHarmony 文档 “数据管理” 相关章节](https://docs.openharmony.cn/pages/v3.2/zh-cn/application-dev/database/data-mgmt-overview.md/)。 + +## 安装 + +分布式数据管理在 openEuler-22.03-LTS-SP4 版本已经默认集成,直接安装即可: + +```shell +dnf install distributeddatamgr_kv_store distributeddatamgr_relational_store distributeddatamgr_datamgr_service distributeddatamgr_data_object +``` + +## 启动服务 + +1. 分布式数据服务可以通过 start_services.sh 脚本来启动。 + + ```shell + /system/bin/start_services.sh datamgr + ``` + +2. 可以通过 ps 命令查看分布式数据管理服务是否拉起。 + + ```shell + ps -ef | grep distributeddata + ``` + +## 使用分布式数据功能 + +1. 新建demo运行需要的/data目录。因为OpenHarmony下app运行有指定的目录,需要在openEuler下先新增。 + + ```shell + mkdir -p /data/app/el0/0/database/com.example.distributed.rdb/rdb + mkdir -p /data/app/el1/0/database/distributeddata/kvdb + mkdir -p /data/service/el1/public/database/distributeddata/meta + mkdir -p /data/service/el1/public/database/distributeddata/kvdb + mkdir -p /data/service/el1/public/database/distributeddata/meta/backup + ``` + +2. 编写三个数据库`kv_store/data_object/relational_store`的客户端程序,使用分布式数据功能。 + + 客户端程序编写可参考[仓库](https://gitee.com/heppen/distributed-data-files)每个数据库的 demo 源代码,demo 在这个仓库每个数据库同名目录下的 demo目录下,如`kv_store/demo`,可使用对应目录下的 build.sh 脚本进行编译。 + + > **注意** + > + > demo 指定的数据 db 路径等,请最好保持和所给示例 demo 的路径一致,否则可能会存在路径不存在或者权限不足问题。 + +3. 暂停分布式管理服务 datamgr_service。 + + ```shell + ./stop_services.sh all # 停止所有服务 + ./stop_services.sh datamgr # 停止datamgr一个服务 + ``` + +## 常见问题 + +* 启动各个服务日志一直在报错 `Binder Driver died`。 + + 原因:说明系统未开启 binder,可以查看 `/dev/binder` 文件是否存在,如果不存在则说明未开启 binder。 + + 解决方法:启动binder功能,参考[communication_ipc仓库说明](https://gitee.com/src-openeuler/communication_ipc/blob/46d83ed1462e521ce356aec48ef980dbf84cff80/README.md)开启binder功能。 + +* `softbus_server` 服务未成功起来,报错 `GetNetworkIfIp ifName:eth0 fail`。 + + 原因:使用命令 `ip a` 查看当前系统的网卡名称,查看是否有 `eth0` 有线网卡名。 因为 `softbus_server` 是通过 `eth0` 这个有线网卡名来获取 ip 等信息,如果没有 `eth0` 网卡则无法启动 `softbus_server`。 + + 解决方法一:修改网卡名称为 `eth0`。 + + 解决方法二:修改 `softbus_server` 源码,将依赖的有线网卡名称改成当前系统的网卡名。 + +## 参考 + +[分布式文件系统架构](https://docs.openeuler.org/zh/docs/22.03_LTS_SP4/docs/Distributed/%E5%88%86%E5%B8%83%E5%BC%8F%E6%96%87%E4%BB%B6%E7%B3%BB%E7%BB%9F%E6%9E%B6%E6%9E%84.html) diff --git a/docs/zh/server/development/distributed/dsoftbus_application_based_on_containers.md b/docs/zh/server/development/distributed/dsoftbus_application_based_on_containers.md new file mode 100644 index 0000000000000000000000000000000000000000..f07ef8927dbc4376bd318e6f16d90681399d34e9 --- /dev/null +++ b/docs/zh/server/development/distributed/dsoftbus_application_based_on_containers.md @@ -0,0 +1,140 @@ +# 基于容器的软总线应用指南 + +## 背景简介 + +当前用户软件迁向容器化已经是大势所趋。本文档介绍了基于容器部署软总线的使用指导,简化软总线客户端的安装部署,以及方便地与业务软件兼容。 + +## 环境准备 + +**硬件设备**: + +| 设备名称 | 操作系统 | 说明 | 数量 | +| -------------------- | ----------------------- | ------------------------------- | --- | +| 树莓派 4B | openEuler 22.03-LTS-SP4 | 安装 openEuler 操作系统的树莓派 | 2 | + +## 代码获取 + + + +## 说明 + +### 服务安装 + +以下步骤在设备 A/B 上都需要操作。 + +1. 物理机环境安装 openEuler 22.03 LTS SP2 以上版本,环境需要准备好 binder 驱动 [binder驱动安装指导](https://gitee.com/src-openeuler/communication_ipc/blob/openEuler-22.03-LTS-SP2/README.md "binder")。 + +2. 编译 softbus_client。 + + ```sh + bash distributed-codelabs/build-repo/demo/dsoftbus/build.sh + ``` + +3. 安装 softbus_server。 + + ```sh + dnf install dsoftbus -y + ``` + +4. 启动 softbus_server。 + + ```sh + /system/bin/start_services.sh all + ``` + +### 容器多 client 场景测试 + +1. 执行脚本在物理机A打包加载容器镜像。 + + ```sh + bash distributed-codelabs/build-repo/demo/dsoftbus/docker_img_build.sh + ``` + +2. 在物理机A启动容器镜像 softbus_client,并将相关SDK、binder驱动映射到容器中。 + + ```sh + docker run -it --privileged --net=host --name=softbus -v /dev/binderfs/binder:/dev/binder -v /system:/system -v /usr/lib64:/usr/lib64 -p 5684:5684/udp softbus_client_image bash + ``` + +3. 镜像中写`/etc/SI`文件,作为该容器中 softclient 的标志,注意需要和组网中其他 client 的不一致,避免冲突。 + + ```sh + echo 123 > /etc/SI + ``` + +4. 容器中启动 softbus_client。 + + ```sh + ./home/softbus_client + ``` + +5. 在本节点上可重复步骤2-3启动不同的 client 容器。 + +6. 在物理机B启动 softbus。 + + ```sh + ./build-repo/demo/dsoftbus/softbus_client + ``` + +7. 在设备A中的各个中 client 分别执行命令打开所有连接。 + + ```sh + openA + ``` + +8. 在设备B中 client 查看所有已经打开的 session。 + + ```sh + conDevices + ``` + + 回显说明,已经打开了两个 session,id 分别是4、3,此 sessionid 是本机的 softbus_server 分配的,后续发送消息需要用到该 id。 + + ```sh + conDevices + 12-11 20:18:58.350 2780335 2780335 I A0fffe/SOFTBUS_DEMO: [SOFTBUS_DEMO]::PrintConnectedDevicesInfo: sessionId:4, networkId: 3c95f61941b81c48ecd73fef881262b82fcbc58e9b1f545e2097b0dc6fecea37 + 12-11 20:18:58.350 2780335 2780335 I A0fffe/SOFTBUS_DEMO: [SOFTBUS_DEMO]::PrintConnectedDevicesInfo: sessionId:3, networkId: 3c95f61941b81c48ecd73fef881262b82fcbc58e9b1f545e2097b0dc6fecea37 + ``` + +9. 设备B发送使用“session 4”消息至设备A的 client。 + + ```sh + send 4 "hello4" + 12-11 20:19:14.975 2780335 2780335 I C015c0/dsoftbus: [TRAN]SendBytes: sessionId=4 + ``` + + 观察设备A中哪个 client 有回显,说明设备B使用 session 4与该 client 通信,同理可以使用 session 3 发送消息至另一个 client。 + +10. 设备A容器中 client 发送使用消息至设备B的 client,查看打开的 session id。 + + ```sh + conDevices + 12-11 20:25:48.995 344047 344047 I A0fffe/SOFTBUS_DEMO: [SOFTBUS_DEMO]::PrintConnectedDevicesInfo: sessionId:1, networkId: e69eab4e2d657264dfbb2006fdfa15524f4a27edeff0baa26d5d2a2b9502f300 + ``` + + 说明使用 session 1 通信。 + +11. 发送消息测试,在设备B中接受到该字段说明消息接收成功。 + + ```sh + send 1 "hello1" + ``` + +12. 设备A物理机上 client 发送使用消息至设备B的 client,查看打开的 session id。 + + ```sh + conDevices + 12-11 20:37:24.823 3512580 3512580 I A0fffe/SOFTBUS_DEMO: [SOFTBUS_DEMO]::PrintConnectedDevicesInfo: sessionId:1, networkId: e69eab4e2d657264dfbb2006fdfa15524f4a27edeff0baa26d5d2a2b9502f300 + ``` + + 说明使用 session 1 通信。 + +13. 发送消息测试,在设备B中接受到该字段说明消息接收成功。 + + ```sh + send 1 "hello1" + ``` + +### session id 说明 + +在上个章节的测试中,发现两个 client 之间通信使用的 session id 不一样。原因是 session id 是本机 server 分配的,只需要在本机范围内互斥。同样容器与虚机也做了 session name,group name 的隔离,所以本机容器与虚机上 client 的 session id 是一致的。 diff --git a/docs/zh/server/development/distributed/expanding_the_ecosystem_through_distributed_soft_bus.md b/docs/zh/server/development/distributed/expanding_the_ecosystem_through_distributed_soft_bus.md new file mode 100644 index 0000000000000000000000000000000000000000..67c2fab103afb348f284c127309d071ff54eeff6 --- /dev/null +++ b/docs/zh/server/development/distributed/expanding_the_ecosystem_through_distributed_soft_bus.md @@ -0,0 +1,242 @@ +# 基于分布式软总线扩展生态互联 + +## 背景简介 + +openEuler秉承着打造“数字化基础设施操作系统”的愿景,为促进与OpenHarmony生态的合作与互通,实现端边领域的互通和协同,首次在嵌入式领域引入分布式软总线技术。 + +分布式软总线是OpenHarmony社区开源的分布式设备通信基座,为设备之间的互通互联提供统一的分布式协同能力,实现设备无感发现和高效传输。OpenHarmony主要面向有强交互需求的智能终端、物联网终端和工业终端。openEuler主要面向有高可靠、高性能等需求的服务器、边缘计算、云和嵌入式设备,二者各有侧重。通过以分布式软总线为代表的技术进行生态互通,一起实现“1+1>2”的效果,支撑社区用户开拓更广阔的行业空间。 + +分布式软总线工作原理和流程介绍可参考:[openEuler分布式软总线](https://openeuler.gitee.io/yocto-meta-openeuler/master/features/distributed_softbus.html) + +## 环境准备 + +**硬件设备**: + +| 设备名称 | 操作系统 | 说明 | +| -------------------- | ----------------------- | ------------------------------- | +| 树莓派 4B | openEuler22.03-LTS-SP4 | 安装openEuler操作系统的树莓派 | +| DAYU200 rk3568开发板 | OpenHarmony 3.1 Release | 安装OpenHarmony操作系统的开发板 | + +**软件环境**: + +| 配置项 | 下载路径 | 使用说明 | +| ----------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | +| openEuler22.03-LTS-SP4 | https://www.openeuler.org/zh/download/ | openEuler操作系统,下载raspi_img路径中对应的image,用于烧录到树莓派,烧录可参考:[树莓派openEuler的安装](https://www.cnblogs.com/rocedu/p/14615565.html)。 | +| OpenHarmony 3.1 Release | https://gitee.com/openharmony/manifest.git | OpenHarmony操作系统,下载、编译、烧录指导:[标准系统入门](https://docs.openharmony.cn/pages/v3.1/zh-cn/device-dev/quick-start/quickstart-ide-standard-overview.md/) 。| +| HUAWEI DevEco Studio | https://developer.harmonyos.com/cn/develop/deveco-studio#download | OpenHarmony应用开发编辑器,使用指导:[DevEco Studio使用指南(OpenHarmony)](https://developer.harmonyos.com/cn/docs/documentation/doc-guides-V3/ohos-deveco-studio-overview-0000001263280421-V3?catalogVersion=V3),本文档中代码需使用OpenHarmony SDK 9。 | + +## 代码获取 + +该文档使用两台设备进行生态互联演示:一台树莓派(openEuler)和一台RK3568开发板(OpenHarmony)。 + +**openEuler侧(树莓派)代码获取**: + +```shell +# openEuler侧(树莓派)操作均在树莓派中进行,下同。 + +# 服务端软件包已集成至openEuler22.03-LTS-SP4系统中,所以可直接使用如下命令进行安装: + +dnf install dsoftbus -y + +# 客户端代码可使用“项目简介”中“openEuler分布式软总线”中的“softbus_client_main.c” +``` + +**OpenHarmony侧(RK3568开发板)代码获取**: + +```shell +# OpenHarmony侧(RK3568开发板)操作均在windows机器上进行,下同。 + +# 分布式软总线服务端能力已集成到OpenHarmony 3.1 Release镜像中,所以无需手动获取服务端代码。 + +# 客户端代码使用“Native C++”工程编写,可使用git命令下载参考代码。代码说明在仓库的README.md中。 + +git clone https://gitee.com/liheavy/softbus_client_app.git +``` + +## 代码编译 + +**openEuler侧(树莓派)代码编译**: + +```shell +# 安装dsoftbus后,将softbus_client_main.c保存到任意路径下,使用如下gcc命令进行编译,编译成功后会在路径下生成softbus_client_main可执行文件,添加执行权限: + +gcc softbus_client_main.c -I/usr/include/dsoftbus/ -L /usr/lib64 -lsoftbus_client.z -lboundscheck -o softbus_client_main + +chmod u+x softbus_client_main +``` + +**OpenHarmony侧(RK3568开发板)代码编译**: + +- 首先需要根据“环境准备”中 HUAWEI DevEco Studio 配置指导将 IDE 环境配置完成。 + +- 使用 DevEco 将下载的"softbus_client_app/softbus_client_sample"参考代码打开,DevEco 将会根据配置文件自动完成项目初始化。 + + 初始化完成后需要生成项目的签名文件:File -->Project Structure --> Project --> Signing Configs -->Automatically generate signature。 + + ![image-20221201101959764](figures/image-20221201101959764.png) + +- 由于 OpenHarmony SDK 9 暂未提供分布式软总线的应用 API,所以该项目直接在应用中使用分布式软总线服务的 API ,需要将依赖的 so文件(libsoftbus_client.z.so、libsec_shared.z.so)拷贝到本地OpenHarmony SDK 的动态库路径中。so 文件会随源码一起下载到本地(required_so文件夹中);也可通过hdc_std工具拷贝RK3568中的两个 so 文件,so 文件路径/lib/xxx.so。 + + 本地OpenHarmony SDK安装路径可通过File --> Settings --> OpenHarmony SDK查看。 + + ![image-20221201103709581](figures/image-20221201103709581.png) + + 将libsoftbus_client.z.so、libsec_shared.z.so拷贝到 “OpenHarmony SDK安装路径/native/x.x.x.x/sysroot/usr/lib/arm-linux-ohos/"路径中。 + + 完成后便可在DevEco中进行代码编译 Build --> Build Hap(s)/App(s) --> Build Hap(s) 。 + + ![image-20221201111227158](figures/image-20221201111227158.png) + +## 代码运行 + +### 前置准备 + +**配置设备ID** + +**openEuler侧(树莓派)**: + +由于当前openEuler版本的分布式软总线暂时去除了对设备管理模块的依赖,为适配和简化获取设备ID的代码,采用了读取/etc/SN文件中内容作为设备ID的方式,所以在启动分布式软总线服务侧之前需要将设备ID(自定义数字)写入/etc/SN,注意多个设备的ID不要设置成同一个值,否则可能造成认证和通信失败问题。 + +```shell +# 举例设置该设备ID为1 +echo "1" >>/etc/SN +``` + +**连接网络** + +两台设备需要在同一局域网内,两台设备的 ip可以相互 ping 通,可在各自操作系统中使用ifconfig查看ip。 + +**openEuler侧(树莓派)**: + +- 启动分布式软总线服务 + + ```shell + # dsoftbus会提供softbus_server_main命令,可直接执行 + + softbus_server_main + ``` + +**OpenHarmony侧(RK3568开发板)**: + +- 电脑连接 RK3568 开发板 + + 使用 USB 线一端连接 RK3568 开发板的 “OTG” 类型的 USB 接口,一端连接电脑的 USB 接口。打开 DevEco,界面右上方设备列表识别到开发板即为连接成功。 + + ![image-20221201115003525](figures/image-20221201115003525.png) + +- 修改分布式软总线权限配置文件 + + 由于 OpenHarmony 分布式软总线服务对使用其功能的应用有权限限制。故运行 demo 需要修改分布式软总线权限配置文件。 + + ```shell + # 可使用hdc_std工具进行权限配置文件替换,hdc_std工具会在OpenHarmony SDK安装时一起安装,安装路径为: + + OpenHarmony SDK安装路径(可根据上一章指导,通过DevEco查看)/toolchains/x.x.x.x/hdc_std.exe + + # 由于RK3568中分布式软总线权限配置文件为只读模式,所以需要使用如下命令将系统文件修改为可读可写模式: + + hdc_std.exe shell "mount -o remount,rw /" + + # 如下使用softbus_client_app仓库中softbus_trans_permission.json替换RK3568中对应的文件。 + + hdc_std.exe file send softbus_trans_permission.json /system/etc/communication/softbus/ + ``` + +- 重启分布式软总线服务 + + ```shell + # 使用如下命令重启分布式软总线服务,使修改的权限配置文件生效。 + + ps -ef | grep softbus_server | grep -v grep + + kill -9 上面查询到的进程号 + ``` + +### 设备认证 + +OpenHarmony 设备和 openEuler 设备在组网过程中,需要两台设备提前将对方添加为可信设备。所以在两台设备互联互通之前,需要通过 Hichain 模块进行认证。详情请参考[可信设备添加](https://openeuler.gitee.io/yocto-meta-openeuler/master/features/distributed_softbus.html#id4),如下使用“pin码弹窗”方式认证的demo演示,以下操作均在树莓派中进行操作。 + +- 依赖动态库软链接 + + ```shell + # 该方式需要依赖libsec_shared.z.so,该动态库在openEuler的dsoftbus中被替换为libboundscheck.so,所以需要通过建立软链接的方式使用libsec_shared.z.so。 + ln -s /usr/lib64/libboundscheck.so /usr/lib64/libsec_shared.z.so + + # 在ARM环境下该方法还需要依赖/lib64/1d-linux-aarch64.so.1,否则会出现no such file的报错。 + ln -s /lib/ld-linux-aarch64.so.1 /lib64/ld-linux-aarch64.so.1 + ``` + +- 运行认证客户端 + + ```shell + # 认证客户端demo可执行文件同样在softbus_client_app仓库中,hichain_sample—>devicemanager + + chmod u+x devicemanager + ./devicemanager + ``` + + 根据提示输入“l”列出同一局域网内设备。 + + ![image-20221201145904897](figures/image-20221201145904897.png) + + 根据提示输入 OpenHarmony 设备编号进行认证,输入后在 RK3568 开发板中会弹出手动确认弹窗“是否允许对端设备连接”,点击“允许”,在树莓派侧再输入“l”,会发现设备的状态从“discovery”变成了“online”,表示认证成功。 + + ![image-20221201150148988](figures/image-20221201150148988.png) + +### 设备通信 + +- OpenHarmony侧(RK3568开发板)客户端烧录、运行。 + + 电脑连接 RK3568 开发板,点击 DevEco 上方的“Run”按钮。 + + ![image-20221201151951393](figures/image-20221201151951393.png) + + 烧录结束后 RK3568 将直接运行 APP。 + + ![image-20221130193253259](figures/image-20221130193253259.png) + +- openEuler侧(树莓派)发送数据 + + ```shell + # 直接运行“代码编译”阶段编译出的softbus_client_main可执行文件 + + ./softbus_client_main + ``` + + 运行后会显示组网设备: + + ![image-20221201162316137](figures/image-20221201162316137.png) + + 根据提示输入“c”: + + ![image-20221201163115659](figures/image-20221201163115659.png) + + 根据提示输入OpenHarmony设备的编号: + + ![image-20221201163310745](figures/image-20221201163310745.png) + +​ 此时在 RK3568 开发板屏幕上方将显示接收到的字符串: + +![](figures/接收数据.png) + +- OpenHarmony侧(RK3568开发板)展示终端信息: + + 点击app页面中的“刷新”图标,会显示与该设备连接的终端设备,点击终端图标将会显示设备基本信息。 + + ![终端信息](figures/终端信息.png) + +- OpenHarmony侧(RK3568开发板)发送数据: + + 点击app页面“发送数据”按钮,将会向openEuler设备发送一条数据。 + +![发送数据](figures/发送数据.png) + +​在openEuler侧(树莓派),将会展示接收到的信息。 + +![image-20221201165948378](figures/image-20221201165948378.png) + +​至此,openEuler和OpenHarmony通过分布式软总线互联互通demo演示完成。 + +## 六、总结 + +该文档主要演示了 OpenHarmony 设备和 openEuler 设备如何通过分布式软总线进行互联互通。服务端代码正在持续优化,以支持更多分布式场景;客户端所用代码均属于 demo,仍需优化:如OpenHarmony APP调用分布式软总线的方式,标准流程为开发 System Ability 来调用分布式软总线服务端 API,集成到 SDK 中并提供 API 给APP 进行调用,由于时间关系采用 APP 直接调用分布式软总线 API 的方式,欢迎各位开发爱好者参与,一起丰富openEuler的嵌入式能力。 diff --git "a/docs/zh/server/development/distributed/figures/hmdfs\347\233\256\345\275\225\346\240\221.png" "b/docs/zh/server/development/distributed/figures/hmdfs\347\233\256\345\275\225\346\240\221.png" new file mode 100644 index 0000000000000000000000000000000000000000..52ff849452d43a0d5717fdf0c7242d4f2e59f21b Binary files /dev/null and "b/docs/zh/server/development/distributed/figures/hmdfs\347\233\256\345\275\225\346\240\221.png" differ diff --git a/docs/zh/server/development/distributed/figures/image-20221130193253259.png b/docs/zh/server/development/distributed/figures/image-20221130193253259.png new file mode 100644 index 0000000000000000000000000000000000000000..9d43820821d9009a81ca72a5aa55ebe48a94fae0 Binary files /dev/null and b/docs/zh/server/development/distributed/figures/image-20221130193253259.png differ diff --git a/docs/zh/server/development/distributed/figures/image-20221201101959764.png b/docs/zh/server/development/distributed/figures/image-20221201101959764.png new file mode 100644 index 0000000000000000000000000000000000000000..3f71db5e1024f1c02268a91e885966c83cb18d75 Binary files /dev/null and b/docs/zh/server/development/distributed/figures/image-20221201101959764.png differ diff --git a/docs/zh/server/development/distributed/figures/image-20221201103709581.png b/docs/zh/server/development/distributed/figures/image-20221201103709581.png new file mode 100644 index 0000000000000000000000000000000000000000..116a16690df4e959fdf62e2238c3f5bc198b161d Binary files /dev/null and b/docs/zh/server/development/distributed/figures/image-20221201103709581.png differ diff --git a/docs/zh/server/development/distributed/figures/image-20221201111227158.png b/docs/zh/server/development/distributed/figures/image-20221201111227158.png new file mode 100644 index 0000000000000000000000000000000000000000..33d16024f6be949edd8ab689cd83ff8d909086de Binary files /dev/null and b/docs/zh/server/development/distributed/figures/image-20221201111227158.png differ diff --git a/docs/zh/server/development/distributed/figures/image-20221201115003525.png b/docs/zh/server/development/distributed/figures/image-20221201115003525.png new file mode 100644 index 0000000000000000000000000000000000000000..8246847c2982dc6c7d4bda07226d3cb9f397fbe3 Binary files /dev/null and b/docs/zh/server/development/distributed/figures/image-20221201115003525.png differ diff --git a/docs/zh/server/development/distributed/figures/image-20221201145904897.png b/docs/zh/server/development/distributed/figures/image-20221201145904897.png new file mode 100644 index 0000000000000000000000000000000000000000..06bb03e7c6bad67e9a8ebf8ac017f89f910a23fb Binary files /dev/null and b/docs/zh/server/development/distributed/figures/image-20221201145904897.png differ diff --git a/docs/zh/server/development/distributed/figures/image-20221201150148988.png b/docs/zh/server/development/distributed/figures/image-20221201150148988.png new file mode 100644 index 0000000000000000000000000000000000000000..b181cf33a2f492cec4ec95babf7f7c0f2a1b2f13 Binary files /dev/null and b/docs/zh/server/development/distributed/figures/image-20221201150148988.png differ diff --git a/docs/zh/server/development/distributed/figures/image-20221201151951393.png b/docs/zh/server/development/distributed/figures/image-20221201151951393.png new file mode 100644 index 0000000000000000000000000000000000000000..28251fd311e820d8d7ad306fe0c9de30556b59a6 Binary files /dev/null and b/docs/zh/server/development/distributed/figures/image-20221201151951393.png differ diff --git a/docs/zh/server/development/distributed/figures/image-20221201162316137.png b/docs/zh/server/development/distributed/figures/image-20221201162316137.png new file mode 100644 index 0000000000000000000000000000000000000000..3068d1845ded464b0ba3932599f7fb2f0f4db550 Binary files /dev/null and b/docs/zh/server/development/distributed/figures/image-20221201162316137.png differ diff --git a/docs/zh/server/development/distributed/figures/image-20221201163115659.png b/docs/zh/server/development/distributed/figures/image-20221201163115659.png new file mode 100644 index 0000000000000000000000000000000000000000..7f691d52612709834b5d495b5909bff57f32f4e3 Binary files /dev/null and b/docs/zh/server/development/distributed/figures/image-20221201163115659.png differ diff --git a/docs/zh/server/development/distributed/figures/image-20221201163310745.png b/docs/zh/server/development/distributed/figures/image-20221201163310745.png new file mode 100644 index 0000000000000000000000000000000000000000..a549f803d39ec746ba9cca91709e8ddd173f61cf Binary files /dev/null and b/docs/zh/server/development/distributed/figures/image-20221201163310745.png differ diff --git a/docs/zh/server/development/distributed/figures/image-20221201165948378.png b/docs/zh/server/development/distributed/figures/image-20221201165948378.png new file mode 100644 index 0000000000000000000000000000000000000000..1f042cceb30d43d3056892a90c3d11ac909e5704 Binary files /dev/null and b/docs/zh/server/development/distributed/figures/image-20221201165948378.png differ diff --git "a/docs/zh/server/development/distributed/figures/\345\217\221\351\200\201\346\225\260\346\215\256.png" "b/docs/zh/server/development/distributed/figures/\345\217\221\351\200\201\346\225\260\346\215\256.png" new file mode 100644 index 0000000000000000000000000000000000000000..d6d8da09d48c884040729135298b9a453c4f577c Binary files /dev/null and "b/docs/zh/server/development/distributed/figures/\345\217\221\351\200\201\346\225\260\346\215\256.png" differ diff --git "a/docs/zh/server/development/distributed/figures/\346\216\245\346\224\266\346\225\260\346\215\256.png" "b/docs/zh/server/development/distributed/figures/\346\216\245\346\224\266\346\225\260\346\215\256.png" new file mode 100644 index 0000000000000000000000000000000000000000..05af0c2f4f649025453b70a331c71f28f1ac69a1 Binary files /dev/null and "b/docs/zh/server/development/distributed/figures/\346\216\245\346\224\266\346\225\260\346\215\256.png" differ diff --git "a/docs/zh/server/development/distributed/figures/\347\273\210\347\253\257\344\277\241\346\201\257.png" "b/docs/zh/server/development/distributed/figures/\347\273\210\347\253\257\344\277\241\346\201\257.png" new file mode 100644 index 0000000000000000000000000000000000000000..4ab47b3b83fd88635e258663bef1c7a56651f465 Binary files /dev/null and "b/docs/zh/server/development/distributed/figures/\347\273\210\347\253\257\344\277\241\346\201\257.png" differ diff --git a/docs/zh/server/development/distributed/hmdfs_distributed_file_system_overview.md b/docs/zh/server/development/distributed/hmdfs_distributed_file_system_overview.md new file mode 100644 index 0000000000000000000000000000000000000000..6153c67baf7997992bb1065469a7e617c9bfd703 --- /dev/null +++ b/docs/zh/server/development/distributed/hmdfs_distributed_file_system_overview.md @@ -0,0 +1,177 @@ +# hmdfs 分布式文件系统概述 + +分布式文件系统提供跨设备的文件访问能力,适用于如下场景: + +- 两台设备组网,A 设备可以无感读取和修改 B 设备的文件。 + +- 边缘服务器可以自动同步组网中多个嵌入式设备中的文件数据。 + +hmdfs 在分布式软总线动态组网的基础上,为网络上各个设备结点提供一个全局一致的访问视图,支持开发者通过基础文件系统接口进行读写访问,具有高性能、低延时等优点。 + +其包括如下几个核心模块: + +- distributed_file_daemon:分布式文件管理常驻用户态服务,负责接入设备组网、数据传输能力,并负责挂载 hmdfs。 + +- hmdfs(Harmony Distributed File System):分布式文件系统核心模块,是一种面向移动分布式场景的、高性能的、基于内核实现的、堆叠式文件系统。 + +## 约束 + +### 接口支持情况 + +分布式文件管理当前不支持或有限支持如下 VFS 系统调用: + +- symlink:不支持。 +- mmap:仅支持读。 +- rename:仅支持同目录操作。 + +### 规格 + +- 最大目录层级 + + 与被堆叠文件系统,即 data 分区所用文件系统,如 ext4、f2fs 等保持一致。 +- 最大文件名长度 + + 取决于 680B 与被堆叠文件支持长度的最小值。f2fs 和 ext4 均为 255B。 +- 最大单文件大小 + + 取决于 $2^{64}$B 与被堆叠文件系统支持最大单文件大小的最小值。ext4 单文件最大为 16TB,f2fs 单文件最大为 3.94TB。 + +### 环境约束 + +- 运行环境的有线网卡名称必须是 `eth0` ,无线网卡的名称必须是 `wlan0` 。可使用 `ip a` 命令查看当前环境的网卡名称,如果没有 `eth0` 或者 `wlan0` 的网卡,那么 softbus_server 会启动失败,功能失效。解决方案参考 [常见问题](#常见问题)。 + +- openEuler 的内核版本需要是 5.10.x,可以通过使用 `uname -r` 查看内核版本。 + +- openEuler 各个设备在同一个网段中,并且设备之间网络通畅,防火墙未拦截 softbus 的数据包。 + +## 说明 + +### 安装 + +说明:如果碰到步骤未成功执行,可参考后面 [常见问题](#常见问题) 进行解决。 + +1. 完整地使用分布式文件系统,需要安装 `hmdfs` 和 `filemanagement_dfs_service` 两个软件包。使用以下命令安装: + + ```shell + sudo dnf install hmdfs filemanagement_dfs_service + ``` + +2. 安装 hmdfs 文件系统。安装 hmdfs 之后会提供一个 `hmdfs.ko``文件,其存放在`/lib/modules/$(uname -r)/hmdfs` 目录下,需要插入该 ko 来安装 hmdfs 文件系统: + + ```shell + cd /lib/modules/$(uname -r)/hmdfs + insmod hmdfs.ko + ``` + + > **注意** + > + > - 如果`/lib/modules/$(uname -r)/hmdfs/`目录下没有`hmdfs.ko`文件,是因为 hmdfs 工程构建时依赖的内核版本和当前运行环境内核版本不一致,可以在`/lib/modules`其他内核版本目录下查找`hmdfs.ko`文件。 + > - 如果是树莓派环境,请直接使用 [基于 22.03-LTS-SP4 raspberry-pi kernel 编译出来的 hmdfs.ko](https://gitee.com/heppen/hmdfs_test/blob/dev/out/hmdfs_SP4_rasp.ko)。 + +### 配置 + +1. 后续有服务启动依赖 `libsec_shared.z.so` 这个动态库,而在 openEuler 下这个动态库叫做 `libboundscheck.so`(由 `libboundscheck` 软件包提供),因此需要在 `/usr/lib64` 下软链接出一个 `libsec_shared.z.so`: + + ```shell + ln -s /usr/lib64/libboundscheck.so /usr/lib64/libsec_shared.z.so + ``` + +2. 配置每个设备的 SN 号。目前 `softbus_sever` 等服务获取设备的 `udid` 还是使用 `/etc/SN` 文件中设置的 SN 号,因此需要在每台 openEuler 设置 **不同的 SN 号**。 + + ```shell + echo "111" > /etc/SN # 注意:不同设备设置不同的数值 + ``` + +### 使用 + +分布式文件系统的使用分为两块:`挂载 hmdfs 目录` 和 `启动 distributed_file_daemon 服务`。 +> **注意** +> +> 以下步骤需要在每台 openEuler 设备下执行。 + +#### 挂载 hmdfs 目录 + +1. 挂载 hmdfs 目录,可以直接使用 `mount` 命令进行挂载,保持 OpenHarmony 的目录结构一样,挂载 `/data/service/el2/100/non_account` 到 `/mnt/hmdfs/100/non_account`。 + + ```shell + mkdir -p /data/service/el2/100/non_account + mkdir -p /mnt/hmdfs/100/non_account + sudo mount -t hmdfs -o merge,local_dst="/mnt/hmdfs/100/non_account" "/data/service/el2/100//non_account" "/mnt/hmdfs/100/non_account" + ``` + + 挂载之后,可以使用 `df -h` 命令查看新增了挂载的目录,并且挂载目录下会有 `device_view` 和 `merge_view` 两个目录。 + + ```txt + ├── device_view + │   └── local + └── merge_view + ``` + +#### 启动 dfs_service 服务 + +安装 `filemanagement_dfs_service` 及其依赖的软件包后,相关的可执行二进制会存放在 `/system/bin/` 目录下,库文件会存放在 `/system/lib64` 下。 + +1. 启动 `dfs_service` 分布式文件服务: + + ```shell + cd /system/bin + ./start_services.sh dfs + ``` + +2. 停止 `dfs_service` 分布式文件服务: + + ```shell + cd /system/bin + ./stop_service.sh dfs + ``` + +### 功能使用 + +每台 openEuler 设备启动完 distributed_file_daemon 之后,可以在挂载的 `/mnt/hmdfs/100/non_account` 下看到远端设备的目录(示例是只有两台 openEuler 设备互联): + +```txt +├── device_view +│   ├── fceda1e26c36d1dd0ba65c00d71c1ab619fcf088ad2adf33cd1e2f396dc70ee2 +│   └── local +└── merge_view +``` + +⽬录下会有两个⽂件视图:device_view 是分设备的视图,local 是本地⽂件视图,另外⼀个是远端设备的⽂件视图;merge_view 是合并视图,多个设备的⽂件都在这⼀个⽬录。 + +后续需要跨设备进行⽂件操作,只需要操作 device_view 下⾯远端设备⽬录下的⽂件即可。 + +## 常见问题 + +- 启动各个服务日志一直在报错 `Binder Driver died`。 + + 原因:说明系统未开启 binder,可以查看 `/dev/binder` 文件是否存在,如果不存在则说明未开启 binder。 + + 解决办法:参考 [communication_ipc 仓 openEuler-22.03-LTS-SP4 分支的 README](https://gitee.com/src-openeuler/communication_ipc/blob/openEuler-22.03-LTS-SP4/README.md) 开启 binder。 + +- 无法插入 `hmdfs.ko` 文件,报错 `insmod: ERROR: could not insert module hmdfs.ko: Invalid parameters`。 + + 原因:hmdfs 编译时依赖的 kernel 版本和现在运行环境不一致或者当前系统未开启。 + + 解决方法一:编译一个和运行环境内核匹配的 `hmdfs.ko`,然后插入该 ko 文件使用。 + + 解决方法二:更换和 SP4 的 kernel 版本一致的 openEuler 版本。 + +- 树莓派 22.03-LTS-SP4 openEuler版本下,无法插入 `hmdfs.ko` 文件,报错 `insmod: ERROR: could not insert module hmdfs.ko: Invalid module format`. + + 原因:树莓派使用的 kernel 版本是树莓派特有版本,而 repo 源中 hmdfs 软件在工程构建时依赖的是服务器 22.03-LTS-SP4 版本的内核,所以无法插入。 + + 解决方法:使用 [基于 22.03-LTS-SP4 raspberry-pi kernel 编译出来的 hmdfs.ko](https://gitee.com/heppen/hmdfs_test/blob/dev/out/hmdfs_SP4_rasp.ko)。 + +- `softbus_server` 服务未成功起来,报错 `GetNetworkIfIp ifName:eth0 fail`。 + + 原因:使用命令 `ip a` 查看当前系统的网卡名称,查看是否有 `eth0` 有线网卡名。 因为 `softbus_server` 是通过 `eth0` 这个有线网卡名来获取 ip 等信息,如果没有 `eth0` 网卡则无法启动 `softbus_server`。 + + 解决方法一:修改网卡名称为 `eth0`。 + + 解决方法二:修改 `softbus_server` 源码,将依赖的有线网卡名称改成当前系统的网卡名。 + +- 多台 openEuler 设备拉起 `softbus_server` 服务之后,但是在 `distributed_file_daemon` 服务的日志显示未发现上线设备。 + + 原因:设备之间的网络不通,或者开启了防火墙把 `softbus` 的数据拦截了。 + + 解决:检查网络是否通畅。(如果不影响业务,可通过 `systemctl stop firewalld.service` 暂时关闭防火墙进行测试)。 diff --git a/docs/zh/server/development/distributed/overview.md b/docs/zh/server/development/distributed/overview.md new file mode 100644 index 0000000000000000000000000000000000000000..311024a499136845614e96fc595831931cfaba32 --- /dev/null +++ b/docs/zh/server/development/distributed/overview.md @@ -0,0 +1,13 @@ +# 分布式中间件用户指南 + +本章节介绍了openEuler上多设备通信连接的软总线应用开发使用指南,以及基于软总线生态衍生的分布式文件的相关介绍。 + +通过这些文章可以了解到openEuler边缘服务器、嵌入式设备级OpenHarmony设备之间原生的发现连接方式,以及相关的拓展应用。 + +使用人员需要具备以下经验和技能: + +- 熟悉Linux基本操作。 + +- 了解OpenHarmony及openEuler的相关开发测试流程。 + +- 熟悉IPC及PRC的相关背景知识,对分布式架构中的数据同步相关知识有一定的了解。 diff --git a/docs/zh/server/development/driver_development_specifications/_toc.yaml b/docs/zh/server/development/driver_development_specifications/_toc.yaml new file mode 100644 index 0000000000000000000000000000000000000000..c4128157f399f48cb0d455b5321b7913deea2524 --- /dev/null +++ b/docs/zh/server/development/driver_development_specifications/_toc.yaml @@ -0,0 +1,6 @@ +label: openEuler驱动开发规范 +isManual: true +description: openEuler驱动开发规范 +sections: + - label: openEuler驱动开发规范 + href: ./openEuler_driver_development_specifications.md diff --git a/docs/zh/server/development/driver_development_specifications/openEuler_driver_development_specifications.md b/docs/zh/server/development/driver_development_specifications/openEuler_driver_development_specifications.md new file mode 100644 index 0000000000000000000000000000000000000000..e933083d99038f70ddf0d7f9bdf8a2cf3c67821b --- /dev/null +++ b/docs/zh/server/development/driver_development_specifications/openEuler_driver_development_specifications.md @@ -0,0 +1,41 @@ +# openEuler驱动开发规范 + +## 目的 + +为规范和统一 openEuler 驱动开发的提交流程及方式,使驱动在 openEuler上使能,特制定 openEuler 驱动开发规范。 + +## 适用范围 + +openEuler 驱动开发规范适用于 openEuler 在开发以及已发布的所有版本的开发过程。 + +## 对驱动的基本要求 + +openEuler的目标: + +- 成为技术创新的平台,加速技术创新、成熟及落地应用。 +- 维护安全稳定、可靠、性能领先以及生态丰富的稳定内核,方便产业界快速应用。 + +因此,满足以上原则的驱动可以提交至openEuler。 + +### 签署贡献者协议 (CLA) + +贡献者贡献openEuler社区前,需签署贡献者协议[CLA](https://openeuler.org/zh/community/contribution/)。 + +>**说明** :CLA签署后大约需要一周时间生效。 + +### 驱动要求 + +驱动需满足如下要求: + +1. 名称不能与系统已有名称发生冲突。 +2. 对照openEuler社区KABI检测。 +3. 正确的驱动版本信息。 +4. 驱动模块参数需要解释说明。 +5. 如有配套工具一并提供。 +6. 声明 license 信息。 +7. 建议增加驱动与操作系统发行版耦合方式的规范,如直接检查 /etc/openEuler-release 文件或者其他作为技术路线的判断,不再与具体的发行版信息耦合。 +8. 在社区建仓开发时同步提供驱动安装指导。 + +## 参考资料 + +- [如何参与 openEuler 内核开发](https://mp.weixin.qq.com/s?__biz=MzkyMjYzNjU0Ng==&mid=2247506938&idx=1&sn=28dd447090d9d3ddeef3970975df3210&source=41#wechat_redirect) diff --git a/docs/zh/server/development/fangtian/_toc.yaml b/docs/zh/server/development/fangtian/_toc.yaml index 166c8c4e4016ad732d95b42bf7d715c965802033..1c42439e8cf76516d9086b6954cd3e05043c3d02 100644 --- a/docs/zh/server/development/fangtian/_toc.yaml +++ b/docs/zh/server/development/fangtian/_toc.yaml @@ -1,9 +1,10 @@ +label: FangTian 视窗引擎 isManual: true -label: '' +description: FangTian 视窗引擎的安装及开发使用指南。 sections: - - label: 安装与部署 + - label: FangTian 视窗引擎 + href: ./overview.md + - label: FangTian 环境配置 href: ./fangtian_environment_configuration.md - - label: Linux Wayland 应用及鸿蒙应用的支持 + - label: FangTian 支持 Wayland 应用及鸿蒙应用 href: ./fangtian_for_linux_waylan_and_openharmony_applications.md - - label: FangTian 视窗引擎指南 - href: ./overview.md diff --git a/docs/zh/server/development/gcc/_toc.yaml b/docs/zh/server/development/gcc/_toc.yaml new file mode 100644 index 0000000000000000000000000000000000000000..6fdaea263671b0e36164d57705619a15d5ad1afe --- /dev/null +++ b/docs/zh/server/development/gcc/_toc.yaml @@ -0,0 +1,14 @@ +label: GCC用户指南 +isManual: true +description: GCC for openEuler 编译器基于开源 GCC 开发,聚焦于C、C++、Fortran语言的优化 +sections: + - label: 动态反馈优化框架用户指南 + href: ./dfot_user_guide.md + - label: GCC 基础性能优化用户指南 + href: ./gcc_basic_performance_optimization_user_guide.md + - label: GCC 多版本支持用户指南 + href: ./gcc_toolset_user_guide.md + - label: GCC用户使用指南 + href: ./gcc_user_guide.md + - label: 内核反馈优化特性 + href: ./kernel_fdo_user_guide.md diff --git a/docs/zh/server/development/gcc/dfot_user_guide.md b/docs/zh/server/development/gcc/dfot_user_guide.md new file mode 100644 index 0000000000000000000000000000000000000000..ad89ba1316e06bef764bba1115899bf858f21b13 --- /dev/null +++ b/docs/zh/server/development/gcc/dfot_user_guide.md @@ -0,0 +1,155 @@ +# 动态反馈优化框架用户指南 + +## 介绍 + +D-FOT是动态反馈优化框架(**D**ynamic **F**eedback-oirected **O**ptimization **T**ool),目标是实现应用全自动、无感知使能反馈优化特性,全面提高反馈优化特性的易用性和性能表现。 +本框架计划实现两类动态优化特性:启动时优化和运行时优化,当前已实现基于oeAware在线调优框架的启动时优化功能。 +启动时优化:应用运行时自动执行采样和反馈优化,完成优化后自动接管下一次启动,不需要用户修改启动流程,应用重启后自动拉起优化版本。 +运行时优化:应用运行时自动执行采样和反馈优化,不需要用户操作重启,整个过程无用户介入,仅少量中断后即可使能优化版本。 + +## 软件架构说明 + +本框架包含以下几个模块: + +- 基于libkperf的采样数据处理 +- 基于sysboost的启动接管和二进制优化特性使能 +- 基于llvm-bolt的二进制反馈优化 +- oeAware调优插件dfot_tuner_sysboost实现 + +## 依赖项 + +系统OS要求:当前仅支持openEuler-22.03-LTS-SP4 +以下依赖组件均可通过yum安装 + +| 组件 | 代码仓 | 分支或版本 | 说明 | +| --------------- | ------------------------------------------------------------------------------------------ | --------------------------------- | ----------- | +| oeAware-manager | [https://gitee.com/openeuler/oeAware-manager](https://gitee.com/openeuler/oeAware-manager) | openEuler-22.03-LTS-SP4 v2.0.0-3 | 业务在线无感调优框架 | +| libkperf | [https://gitee.com/openeuler/libkperf](https://gitee.com/openeuler/libkperf) | openEuler-22.03-LTS-SP4 v1.2-2 | 轻量级全内存化采集工具 | +| sysboost | [https://gitee.com/openeuler/sysboost](https://gitee.com/openeuler/sysboost) | openEuler-22.03-LTS-SP4 | 微架构优化工具 | +| llvm-bolt | https://gitee.com/src-openeuler/llvm-bolt | openEuler-22.03-LTS-SP4 17.0.6-12 | 二进制优化器 | + +## 使用流程 + +### 被优化应用的必要条件 + +1. 被优化二进制需要带有重定位信息。使用自编译的软件:需要在编译时增加`-Wl,-q`链接选项,如MySQL:`cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DBUILD_CONFIG=mysql_release -DWITH_BOOST=../boost -DCMAKE_C_LINK_FLAGS="-Wl,-q" -DCMAKE_CXX_LINK_FLAGS="-Wl,-q"`;使用oe软件包的场景:后续会提供对应应用的relocation包,直接安装即可。 +2. 如何判断目标二进制是否带有重定位信息:`-Wl,-q`生效后,二进制会增加RELA段,可以通过`readelf -SW /path/to/bin`来判断,如MySQL加选项之前,仅有`.rela.dyn`和`.rela.plt`段,增加后会出现`.rela.text`、`.rela.eh_frame`等10+ RELA段;如果`-Wl,-q`未生效,则在手动perf采样并执行`perf2bolt`时,或者执行`llvm-bolt`优化时(无论是否通过sysboost机制)会有告警:`BOLT-WARNING: non-relocation mode for AArch64 is not fully supported`。 + +### D-FOT准备 + +yum安装D-FOT或通过以下命令源码构建(注意如果libkperf或oeAware-manager也是源码构建,执行cmake时需要额外指定lib和include路径)。 + +```shell +# 依赖包安装 +yum install boost-devel log4cplus-devel numactl-devel libkperf-devel oeAware-manager-devel +# 下载源码并编译 +git clone https://gitee.com/openeuler/D-FOT.git +cd D-FOT +mkdir build && cd build +cmake ../ -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_SKIP_RPATH=TRUE +make -j`nproc` +cd .. + +cp build/libdfot.so /lib64/oeAware-plugin/ +chmod 440 /lib64/oeAware-plugin/libdfot.so +mkdir -p /etc/dfot/ +cp configs/dfot.ini /etc/dfot/ +``` + +### 配置修改 + +修改`/etc/dfot/dfot/ini`,内容项参考如下描述: +公共配置: [general] + +| 配置项 | 值范围 | 是否可用 | 说明 | +| ----------------------------- | ----------------------------------- | ---- | -------------------------------------------------------------------------------------- | +| LOG_LEVEL | `` | 可用 | 优化服务日志级别,级别依次递减,默认为INFO,注意级别越低打印的日志越多 | +| COLLECTOR_SAMPLING_STRATEGY | `0` | 不可用 | 采样策略
0表示插件enable后即持续低频采样
1表示enable时启动监控线程,只有负载达到阈值场景才采样
当前由oeaware控制采样流程,仅支持0 | +| COLLECTOR_HIGH_LOAD_THRESHOLD | `[0, cpus*100]` | 不可用 | 仅在采样策略1场景下生效,使用HIGH_LOAD_THRESHOLD作为触发采样的应用CPU使用率阈值,当前不支持 | +| COLLECTOR_SAMPLING_PERIOD | `100` | 不可用 | collector执行run间隔,每隔COLLECTOR_SAMPLING_PERIOD ms执行一次,当前统一由oeaware配置 | +| COLLECTOR_SAMPLING_FREQ | `100` | 不可用 | 采样频率,每秒采样COLLECTOR_SAMPLING_FREQ次,当前统一由oeaware配置 | +| COLLECTOR_DATA_AGING_TIME | 按实际需要确定 | 可用 | 采样数据老化时间,当前数据与最老数据时间差值达到阈值时,丢弃累积采样数据,单位ms | +| TUNER_TOOL | `["sysboost"]` | 不可用 | 二进制优化器,当前仅支持sysboost | +| TUNER_CHECK_PERIOD | `[10, max]` | 可用 | 优化插件检查时间间隔,每隔一段时间判断内部收集数据是否满足新一轮优化条件,单位ms,无上限,但尽量不要太大,以免优化不及时,默认1000 | +| TUNER_PROFILE_DIR | 按实际需要确定 | 可用 | 采样数据存放位置,profile文件被命名为`[app_name]_[full_path_hash]_[threshold].profile` | +| TUNER_OPTIMIZING_STRATEGY | `[0, 1]` | 可用 | 优化策略,0表示只优化一次,1表示只要采样信息在刷新,可以持续多次优化 | +| TUNER_OPTIMIZING_CONDITION | `0` | 不可用 | 触发优化的条件,0表示应用退出后即开始优化,1表示低负载时优化,2表示应用退出且低负载时优化,当前仅支持0 | +应用配置: [app] + +| 配置项 | 值范围 | 是否可用 | 说明 | +| ----------------------------- | -------------- | ---- | ------------------------------------------------------------------------------------------ | +| FULL_PATH | 按实际需要确定 | 可用 | 应用二进制文件绝对路径 | +| DEFAULT_PROFILE | 按实际需要确定 | 可用 | 应用的开箱profile文件,用于冷启动时使能二进制优化,没有则留空 | +| COLLECTOR_DUMP_DATA_THRESHOLD | `[10000, max]` | 可用 | 采样数据达到该阈值行数时触发数据导出到profile,数值越大需要的采集的samples越多,该值需要依据实际应用和测试场景确定,mysql参考值:65000 | +| BOLT_DIR | `/usr/bin` | 不可用 | BOLT工具路径,留空则默认/usr/bin,内部会调用`${BOLT_DIR}/perf2bolt和${BOLT_DIR}/llvm-bolt`
当前由sysboost确定 | +| BOLT_OPTIONS | 按实际需要确定 | 可用 | BOLT优化选项,配置该项可以覆盖内置的默认选项,用于针对性的选项调优 | +| UPDATE_DEBUG_INFO | `[0, 1]` | 可用 | 优化时是否同步更新调试信息,1表示更新,0表示不更新,注意更新调试信息会有额外耗时 | + +### 插件使用 + +参考 + +yum安装D-FOT的场景,可以直接执行以下命令来使能插件实例: + +```shell +# 重启oeaware服务 +systemctl restart oeaware +# enable采集插件 +oeawarectl -e pmu_sampling_collector +# enable反馈优化调优插件 +oeawarectl -e dfot_tuner_sysboost + +# disable两个插件 +oeawarectl -d pmu_sampling_collector +oeawarectl -d dfot_tuner_sysboost +``` + +源码构建D-FOT场景,需要将libdfot.so拷贝至oeaware的默认插件目录`/lib64/oeAware-plugin/`,然后加载激活插件实例,注意插件权限得是440: + +```shell +# 可以重启oeaware服务(自动触发/lib64/oeAware-plugin/下的插件加载) +systemctl restart oeaware +# 或者不重启服务,手动调用oeawarectl加载插件 +oeawarectl -l libdfot.so +# 后续可以进行上述enable操作 +``` + +其他操作步骤可以查阅oeAware用户手册。 + +### 使用举例 + +以 mysql-8.0.25 测试tpcc场景为例: + +```shell +# 1. 环境准备 +yum install libkperf oeaware-manager sysboost llvm-bolt D-FOT + +# 2. 构建mysql +# -Wl,-q是优化必要条件;-fPIE和-Wl,-zmax-page-size=0x200000 -Wl,-zcommon-page-size=0x200000可选,如果需要sysboost大页预加载优化则必选 +cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DBUILD_CONFIG=mysql_release -DWITH_BOOST=../boost -DCMAKE_C_FLAGS="-fPIE" -DCMAKE_CXX_FLAGS="-fPIE" -DCMAKE_C_LINK_FLAGS="-Wl,-q -Wl,-zmax-page-size=0x200000 -Wl,-zcommon-page-size=0x200000 -pie" -DCMAKE_CXX_LINK_FLAGS="-Wl,-q -Wl,-zmax-page-size=0x200000 -Wl,-zcommon-page-size=0x200000 -pie" + +# 3. 启动oeaware和优化插件 +# 需按应用实际信息填写/etc/dfot/dfot.ini,再执行以下命令 +systemctl start sysboost +systemctl start oeaware +oeawarectl -e pmu_sampling_collector +oeawarectl -e dfot_tuner_sysboost + +# 4. 执行TPCC测试 +... + +# 5. 重启mysql +# 可提前通过/etc/dfot/dfot.log确认是否已经执行优化,应用重启后即是优化版本 +``` + +## 约束限制 + +1. 受限于sysboost的实现,暂不支持在虚拟化场景下使用D-FOT(KVM虚拟机:支持使用但不支持热迁移;docker容器:不支持)。 +2. 待优化的目标应用需要具备重定位信息。 +3. 作为oeAware调优插件使用D-FOT时,当前对应的oeAware采集插件pmu_sampling_collector固定采样频率为100,可能会导致采样时间较久(作为参考:perf默认采样频率为4000)。 + +## 未来规划 + +- [ ] 虚拟化场景支持 +- [ ] 运行时优化支持 +- [ ] 进一步提升二进制优化效果 diff --git a/docs/zh/server/development/gcc/figures/p1.png b/docs/zh/server/development/gcc/figures/p1.png new file mode 100644 index 0000000000000000000000000000000000000000..a63ce99be404c7d5b91da404d6a7629e8ee88b95 Binary files /dev/null and b/docs/zh/server/development/gcc/figures/p1.png differ diff --git a/docs/zh/server/development/gcc/figures/p2.png b/docs/zh/server/development/gcc/figures/p2.png new file mode 100644 index 0000000000000000000000000000000000000000..281ce392b00aa206af57e9069374dcef8e83bdbb Binary files /dev/null and b/docs/zh/server/development/gcc/figures/p2.png differ diff --git a/docs/zh/server/development/gcc/figures/p3.png b/docs/zh/server/development/gcc/figures/p3.png new file mode 100644 index 0000000000000000000000000000000000000000..1eeda0e3f0ce064ae15437d4627b27c62023d34b Binary files /dev/null and b/docs/zh/server/development/gcc/figures/p3.png differ diff --git a/docs/zh/server/development/gcc/figures/p4.png b/docs/zh/server/development/gcc/figures/p4.png new file mode 100644 index 0000000000000000000000000000000000000000..b7960fd8604e8ee027adde5ac678b79baf86b076 Binary files /dev/null and b/docs/zh/server/development/gcc/figures/p4.png differ diff --git a/docs/zh/server/development/gcc/gcc_basic_performance_optimization_user_guide.md b/docs/zh/server/development/gcc/gcc_basic_performance_optimization_user_guide.md new file mode 100644 index 0000000000000000000000000000000000000000..74b37095e2747f6e6cc94288226131f79dbb6f86 --- /dev/null +++ b/docs/zh/server/development/gcc/gcc_basic_performance_optimization_user_guide.md @@ -0,0 +1,173 @@ +# GCC 基础性能优化用户指南 + +## 简介 + +编译器基础性能优化对于提高应用程序的开发效率、运行性能和可维护性都非常重要。它是计算机科学领域的一个重要研究方向,也是软件开发过程中的重要环节之一。GCC for openEuler 在通用编译优化能力的基础上,对中后端性能优化技术进行了增强,包括指令优化、向量化增强、预取增强、数据流分析增强等优化。 + +## 安装与部署 + +### 软件要求 + +操作系统:openEuler 22.03 LTS SP4 + +### 硬件要求 + +aarch64 架构 + +### 安装软件 + +按需安装 GCC 和相关组件即可,以 GCC 为例。 + +```shell +yum install gcc +``` + +## 使用方法 + +### CRC优化 + +#### 说明 + +识别CRC软件循环代码,生成高效硬件指令。 + +#### 使用方法 + +在编译时增加 -floop-crc 选项。 + +注:`-floop-crc`选项需要和`-O3 -march=armv8.1-a`一起使用。 + +### If-conversion 增强 + +#### 说明 + +增强 If conversion 优化,使用更多的寄存器以减少冲突。 + +#### 使用方法 + +本优化是 RTL 优化 if-conversion 的一部分,使用如下编译选项控制优化启用。 + +`-fifcvt-allow-complicated-cmps` + +`-param=ifcvt-allow-register-renaming=[0,1,2]`默认为0,数字用于控制优化范围。 + +注:此优化依赖`-O2`优化等级,以及与`--param=max-rtl-if-conversion-unpredictable-cost=48`、`--param=max-rtl-if-conversion-predictable-cost=48`共同使用。 + +### 乘法计算优化 + +#### 说明 + +Arm 相关指令合并优化,实现32位复杂组合的64位整形乘法逻辑的识别,并以高效的64位指令数输出。 + +#### 使用方法 + +使用`-fuaddsub-overflow-match-all`和`-fif-conversion-gimple`选项使能优化。 + +注:此优化需要`-O3`及以上优化等级以及`-ftree-fold-phiopt`选项共同使用。 + +### cmlt 指令生成优化 + +#### 说明 + +对一些四则运算生成`cmlt`指令,减少指令数。 + +#### 使用方法 + +使用选项`-mcmlt-arith`使能优化。 + +注:此优化需要`-O3`以上优化等级使用。 + +### 向量化优化增强 + +#### 说明 + +识别并简化向量化过程中生成的冗余指令,允许更短的循环进入向量化。 + +#### 使用方法 + +使用参数`--param=tree-forwprop-perm=1`和`--param=vect-alias-flexible-segment-len=1`使能,默认均为0。 + +注:此优化需要`-O3`及以上优化等级。 + +### min max 和 uzp1/uzp2 指令联合优化 + +#### 说明 + +识别 min max 和 uzp1/uzp2 指令联合优化机会,减少指令数从而提升性能。 + +#### 使用方法 + +使用`-fconvert-minmax`选项使能`min max`优化,`uzp1/uzp2`指令优化在`-O3`以上等级默认使能。 + +注:依赖`-O3`及以上优化等级。 + +### ldp/stp 优化 + +#### 说明 + +识别某些性能表现差的 ldp/stp,将其拆分成2个 ldr 和 str。 + +#### 使用方法 + +使用`-fsplit-ldp-stp`选项使能优化,使用参数`--param=param-ldp-dependency-search-range=[1,32]`控制搜索范围,默认16。 + +注:依赖`-O1`及以上优化等级。 + +### AES指令优化 + +#### 说明 + +识别 AES 软件算法指令序列,使用硬件指令加速。 + +#### 使用方法 + +使用`-fcrypto-accel-aes`选项使能优化。 + +注:依赖`-O3`及以上优化等级。 + +### 间接调用提升 + +#### 说明 + +识别和分析程序中的间接调用,尝试将其优化为直接调用。 + +#### 使用方法 + +使用选项`-ficp -ficp-speculatively`使能优化。 + +注:此优化需要和-O2 -flto -flto-partition=one共同使用。 + +### IPA-prefetch + +#### 说明 + +识别循环中的间接访存,插入预取指令,从而减少间接访存的延迟。 + +#### 使用方法 + +通过选项-fipa-prefetch -fipa-ic使能优化。 + +注:此优化需要和-O3 -flto共同使用。 + +### LLC-prefetch + +#### 说明 + +通过分析程序中主要的执行路径,对主路径上的循环进行访存的复用分析,计算排序出 TOP 的热数据,并插入预取指令将数据先分配至 LLC 中,减少 LLC miss。 + +#### 使用方法 + +使能 LLC 特性,需开启 -O2 及以上优化等级,同时使用编译选项 -fllc-allocate。 + +其他相关接口: + +| 选项 | 默认值 | 说明 | +| ---- | ---- | ---- | +| -param=mem-access-ratio=[0,100] | 20 | 循环内访存数对指令数的占比。| +| -param=mem-access-num=unsigned | 3 | 循环内访存数量。 | +| -param=outer-loop-nums=[1,10] | 1 | 允许扩展的外层循环的最大层数。 | +| -param=filter-kernels=[0,1] | 1 | 是否针对循环做路径串联筛选。 | +| -param=branch-prob-threshold=[50,100] | 80 | 高概率执行分支的概率阈值。 | +| -param=prefetch-offset=[1,999999] | 1024 | 预取偏移距离,一般为2的次幂。 | +| -param=issue-topn=unsigned | 1 | 预取指令个数。 | +| -param=force-issue=[0,1] | 0 | 是否执行强制预取,即静态模式。 | +| -param=llc-capacity-per-core=[0,999999] | 114 | 多分支预取下每个核平均分配的 LLC 容量。 | diff --git a/docs/zh/server/development/gcc/gcc_toolset_user_guide.md b/docs/zh/server/development/gcc/gcc_toolset_user_guide.md new file mode 100644 index 0000000000000000000000000000000000000000..365c9d0298795704e1a6a153f20d92f2e514d91d --- /dev/null +++ b/docs/zh/server/development/gcc/gcc_toolset_user_guide.md @@ -0,0 +1,48 @@ +# GCC 多版本支持用户指南 + +## 简介 + +为了保障操作系统的稳定性,一般在进行基础软件选型时不会选用最新的版本,而是倾向于使用相对稳定的版本,因此当前 openEuler 22.03 LTS 使用 GCC 10.3.1 作为基线进行开发。然而GCC 10.3.1 只能支持部分 Fortran OpenMP 4.5 规范和较少的 C/C++ OpenMP 5.0 语言规范。为了支持全部 Fortran OpenMP 4.5 规范,设计双版本 GCC,对于需要使用 GCC 10.3.1 不支持的 OpenMP 4.5 规范的应用,可以使用多版本编译器 gcc-12 来支持编译构建。 + +## 安装与部署 + +### 软件要求 + +操作系统:openEuler 22.03 LTS SP4 + +### 硬件要求 + +aarch64 架构 + +### 安装软件 + +为了和默认 GCC 安装做出区分,防止多版本 GCC 的安装和默认 GCC 的安装依赖库冲突,gcc-12 的多版本软件包名以 “gcc-toolset-12-” 为前缀,后面接上原有 GCC 软件包名。 + +默认编译器 gcc-10.3.1,安装路径为 `/usr/`: + +```shell +yum install -y gcc gcc-c++ gcc-gfortran +``` + +多版本编译器 gcc-12,安装路径为`/opt/openEuler/gcc-toolset-12/root/usr/`: + +```shell +yum install -y gcc-toolset-12-gcc* +``` + +## 使用方法 + +gcc-12 多版本编译器软件包安装在`/opt/openEuler/gcc-toolset-12/root/usr/`下,因此可使用如下命令使用软件包: + +```shell +export PATH=/opt/openEuler/gcc-toolset-12/root/usr/bin/:$PATH +export LD_LIBRARY_PATH=/opt/openEuler/gcc-toolset-12/root/usr/lib64/:$LD_LIBRARY_PATH +``` + +**注意:多版本编译器 gcc-12 仅用于支持 GCC 10.3.1 不支持的 OpenMP 4.5 规范,其他特性建议使用默认 gcc-10.3.1 防止发生未知编译错误。** + +## 兼容性说明 + +此节主要列出当前一些特殊场景下的兼容性问题。本项目持续迭代中,会尽快进行修复,也欢迎广大开发者加入。 + +* 当前 GCC 多版本方案仅适配 OpenMP 4.5 语言规范场景。 diff --git a/docs/zh/server/development/gcc/gcc_user_guide.md b/docs/zh/server/development/gcc/gcc_user_guide.md new file mode 100644 index 0000000000000000000000000000000000000000..8c1ac6208002a8cbbf4c8c29bdaba6c2e51e591e --- /dev/null +++ b/docs/zh/server/development/gcc/gcc_user_guide.md @@ -0,0 +1,882 @@ +# 1 CFGO反馈优化 + +## 1.1 特性描述 + +- 概念:CFGO (Continuous Feature Guided Optimization)是多模态(源代码、二进制)、全生命周期(编译、链接、链接后、运行时、OS、库)的持续反馈优化。 +- 核心思想:在保证程序功能不变的前提下,通过收集程序运行时信息,指导各种编译优化技术进行更准确的,获得性能更优的目标程序。 +- 主要优化点: + - 代码布局优化:通过基本块重排、函数重排、冷热分区等技术,优化目标程序的二进制布局,提升i-cache和i-TLB命中率。 + - 高级编译器优化:内联、循环展开、向量化、间接调用等提升编译优化技术受益于反馈信息,能够使编译器执行更精确的优化决策。 + +## 1.2 BOLTUSE + +### 1.2.1 选项介绍 + +#### 选项-fbolt-use + +此选项用于直接使用指定的BOLT profile完成链接后优化。使用时需要提前准备好BOLT优化所需要的profile文件,可以使用AutoBOLT模式获取,也可以使用perf采样并执行perf2bolt转换生成。 + +### 1.2.2 常见应用使能方式 + +1. Mysql + + ```bash + cmake .. -DCMAKE_INSTALL_PREFIX=/home/install/mysql-8.0.25 -DBUILD_CONFIG=mysql_release -DWITH_BOOST=../boost -DCMAKE_C_FLAGS="-Wl,-q" -DCMAKE_CXX_FLAGS="-Wl,-q" -DCMAKE_C_LINK_FLAGS="-Wl,-q" -DCMAKE_CXX_LINK_FLAGS="-Wl,-q -fbolt-use=/path/to/mysqld.profile -fbolt-target=mysqld" -DCMAKE_EXE_LINKER_FLAGS="-Wl,-q" + ``` + +2. MongoDB + + ```bash + # 带重定位信息的基线版本构建 + python3 buildscripts/scons.py MONGO_VERSION=6.1.0 DESTDIR=/usr/local/mongo install-all-meta CFLAGS="-march=armv8-a+crc -mtune=generic -Wl,-q" CXXFLAGS="-march=armv8-a+crc -mtune=generic -Wl,-q" LINKFLAGS="-Wl,-q" -j 128 --disable-warnings-as-errors + # perf采样 + perf2bolt生成bolt profile + # 使用boltuse构建优化版本,注意如果使用的llvm-bolt版本不支持pie,需要手动在SConstruct中删掉pie选项 + python3 buildscripts/scons.py MONGO_VERSION=6.1.0 DESTDIR=/usr/local/mongo install-devcore CFLAGS="-march=armv8-a+crc -mtune=generic -Wl,-q" CXXFLAGS="-march=armv8-a+crc -mtune=generic -Wl,-q" LINKFLAGS="-Wl,-q -fbolt-use=./mongod.profile -fbolt-target=mongod" -j 128 --disable-warnings-as-errors + ``` + +3. Redis + + ```bash + make CFLAGS="-Wl,-q" LDFLAGS="-fbolt-use=/path/to/redis.profile -fbolt-target=redis-server" + ``` + + **说明** + + - 默认使用当前路径下文件名为data.fdata的profile完成优化,可以使用-fbolt-use=FILE指定使用的profile,如-fbolt-use=/tmp/a.fdata。 + - 可以和-fbolt-target、-fbolt-option=\共用。 + +## 1.3 AutoBOLT + +### 1.3.1 选项介绍 + +插桩反馈优化场景下,需要经过两次编译,第一次带编译选项-fprofile-generate[=path],经过一系列典型场景测试后生成profile数据,第二次带编译选项-fprofile-use[=path]编译优化版本,AutoBOLT会将插桩数据转换成BOLT profile,并自动使能链接后优化。 + +#### 适用场景 + +不介意插桩阶段性能损耗,对构建和测试时间不敏感,追求极致性能等情况 + +#### 使用方式 + +```bash +# 插桩,生成gcno +gcc -O3 -fprofile-generate[=path] -fprofile-update=atomic -o test test.c +# 执行测试,获得gcda./test# 使用生成的gcda数据编译生成新的可执行文件 +gcc -O3 -fprofile-use[=path] -fprofile-correction -Wno-error=coverage-mismatch -Wno-error=missing-profile -fauto-bolt -fbolt-target=test_pgoed -o test_pgoed test.c +``` + +### 1.3.2 自动(采样)反馈优化场景 + +与插桩式反馈优化不同,自动反馈优化使用perf收集程序的运行信息,然后使用create_gcov工具解析来自perf的采样信息为编译器所需profile,最后使用选项-fauto-profile读取profile完成优化。选项-fprofile-correction用于使能mcf算法,平滑由于采样导致的基本块计数不均衡。 + +#### 适用场景 + +频繁发布版本,需要在生产环境部署整套系统等情况。 + +#### 使用方式 + +```bash +# 编译带调试信息的可执行文件 +gcc -O3 -g -o test_prof test.c +# 使用perf采集性能数据 +perf record -e br_retired -- ./test_prof +# 使用create_gcov将perf.data解析为gcov文件 +create_gcov --binary=./test_prof --profile=perf.data --gcov=test.gcov -gcov_version=2 +# 利用gcov性能数据编译生成新的可执行文件 +gcc -O3 -fauto-profile=test.gcov test.c -o test_autofdo +``` + +#### 补充说明 + +1. 转换后的profile默认保存在当前路径,可以使用-fauto-bolt=PATH指定BOLT profile的保存路径,如-fauto-bolt=/tmp。 +2. 当前插桩反馈优化在内核反馈优化的场景下,支持使用gcov-tool工具合并插桩反馈优化文件以生成对多种场景具有性能提升的高性能内核。 +3. 使用插桩反馈优化技术优化多线程应用场景下使用-fprofile-generate[=path]时可以加上-fprofile-update=atomic,可以生成更精准的数据。 +4. 使用插桩反馈优化技术优化应用的场景,使用-fprofile-correction可以自动修正部分profile数据,使用-Wno-error=coverage-mismatch -Wno-error=missing-profile可以屏蔽profile无法对应或不存在的情况下的报错。 + +#### 典型应用使能方式 + +1. MySQL/RocksDB等通过Cmake构建的应用 + + ```bash + # 带重定位信息的基线版本构建 + cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DBUILD_CONFIG=mysql_release -DWITH_BOOST=../boost -DCMAKE_C_FLAGS="-Wl,-q" -DCMAKE_CXX_FLAGS="-Wl,-q" -DCMAKE_C_LINK_FLAGS="-Wl,-q" -DCMAKE_CXX_LINK_FLAGS="-Wl,-q" -DCMAKE_EXE_LINKER_FLAGS="-Wl,-q" + # 使用autobolt构建优化版本 + ``` + +2. Redis/Memcached等通过Make构建的应用 + + ```bash + # 带重定位信息的基线版本构建 + make CFLAGS="-Wl,-q" CXXFLAGS="-Wl,-q" + # 优化版本构建 + make CFLAGS="-fprofile-use=./profile -fauto-bolt -fbolt-target=redis-server -Wl,-q -Wno-missing-profile" LDFLAGS="-Wl,-q" + ``` + +#### 典型应用效果 + +| MySQL | openGauss | Nginx | Ceph | Redis | kernel | +| ----- | --------- | ----- | ---- | ----- | ------ | +| +15% | +5% | +15% | +7% | +5% | +5% | + +#### 常见使用问题 + +1. 使用-fauto-bolt和-fbolt-target时出现打印信息: The linker[2] is not for exec, just skip.22.03sp3,之前的gcc版本不支持对pie或so优化,可以使用sp4及之后版本。 + +#### AutoBOLT和BOLTUSE的通用选项 + +- -fbolt-target=NAME用于指定BOLT的优化对象,使用该选项后除了NAME之外的二进制和动态库都不会优化。使用该选项,必须指定NAME。 +- -fbolt-option=PARAM用于指定BOLT的优化选项,不同选项以逗号分隔,如-fbolt-option="-reorder-blocks=cache+,-reorder-functions=hfsort+"。使用该选项,必须指定PARAM,优化选项详情可使用llvm-bolt --help查询。 + +## 1.4 PGO + +### 特性说明 + +该优化通过插桩形式收集程序运行时信息(profile)进行优化决策,编译器更换这些运行时信息知道各种编译优化以进行更准确的优化决策,生成目标程序。 + +该有化主要包括两种优化方式: + +1. Edge Profile:在函数CFG(Control Flow Graph)的边上插入计数器,获取程序的运行计数信息。 +2. Value Profile:由于编译器的优化编希望知道一些表达式变量的取值,该优化在插桩过程中插入代码统计表达式变量经常的取值。程序运行后,将profile文件读回编译器,指导对应的优化编执行更佳的优化决策。当前GCC支持多种value profile计数功能,包括变量常用取值、是否是2的幂次、经常的间接调用地址、函数首次运行编号等。 + +### 1.4.1 选项介绍 + +#### 选项-fprofile-generate[=path] + +此选项打开了-fprofile-arcs和-fprofile-values。-fprofile-generate可以传入参数path,用来指定profile反馈数据文件的存储文件,同-fprofile-dir。 + +#### 选项-fprofile-correction + +此选项会使用启发性纠错或者平滑得中和profile反馈数据不一致的情况。 + +#### 选项-Wno-coverage-mismatch + +缺省情况下,当profile不匹配源代码时会被作为错误处理。此选项可以用来将错误转换为警告,仅建议在较少改动并且改动部分为冷代码的情况下适用。 + +#### 选项-fprofile-use[=path] + +此选项适用存储在path下的profile指导编译器进行优化。 + +### 1.4.2 内核反馈优化 + +#### 背景 + +当今大多数服务器只运行单个或少数的特定应用,因此根据特定的运行程序对操作系统进行优化,将获得更多的性能收益。 + +#### DEMO + +1. 下载内核源码。 + + ```bash + yum install -y kernel-source + ``` + +2. 编译插装代码。 + + 进入内核源码目录,进行内核选项配置,这里以openEuler 5.10内核为例。 + + ```bash + cd /usr/src/linux-5.10.0*** + make openeuler_defconfig + make menuconfig + 在菜单中,进入General setup,选择Local Version-append to kernel release,填入合适的后缀名,例如-test-going双击esc回到上一级目录,进入General architecture-dependent options > GCOV-based kernel profiling,双击esc回到主目录,进入kernel hacking > Compile-time checks and compiler options profiling,关闭Compile the kernel debug,保存并退出。 + ``` + +3. 编译rpm包(96可替换为机器最大核数)。 + + ```bash + make binrpm-pkg -j 96 + ``` + +4. 使用插桩内核。 + + 在服务器端安装插桩内核,设置为默认内核并重启。 + + ```bash + rpm -ivh kernel*** --forcegrub2-set-default 0 reboot + ``` + +5. 执行目标优化的应用测试,这里以Nginx的wrk测试套为例。 + + 在服务器端开Nginx 服务器。 + + ```bash + nginx -c nginx.conf + ``` + + 在客户端运行Nginx wrk测试套。 + + ```bash + wrk -c 2000 -d 60s -t 20 --latency --timeout 5s -H "Connection: close" http://192.168.1.10:10000/index.html + ``` + +6. 执行profile收集脚本,将profile信息从内存写入磁盘中。 + +7. (可选)如果需要针对多个应用编译优化内核,可以尝试合并多个应用的profile,这里以应用A和应用B为例。 + + ```bash + gcov-tool merge a/gcovdata b/gcovdata + ``` + +8. 编译优化后的内核,进入内核源码目录,进行内核选项配置。 + + ```bash + make openeuler_defconfig + make menuconfig + 在菜单中,进入General Setup.选在Local version-append to kernel release,填写合适的后缀名,例如-test-pgoed,双击回到主目录,关闭Compile the kernel with debug info,保存并退出。 + ``` + +9. 编译rpm包(96可替换为机器最大核数)。 + + ```bash + make binrpm-pkg -j 96 KCFLAGS="-fprofile-use -fprofile-correction -Wno-error=coverage-mismatch -Wno-error=missing-profile -fprofile-dir=gcovdata" + ``` + + **说明** + + -fprofile-dir参数为[6](#li14537447145110)生成的gcovdata的绝对路径。 + +#### 常见使用问题 + +#### 须知 + +**Profile** **文件没有正常生成** + +- 可能原因一:于-fprofile-generate生成profile的目录下没有写入权限。可以使用chmod 777 [生成目录的绝对路径方式]解决。 +- 可能原因二:程序没有正常退出。在应用退出时会调用**__gcov_exit()**刷新profile信息。可以使用gdb attach 应用,手动调用__gcov_exit()解决。 + +## 1.5 LTO + +### 1.5.1 特性介绍 + +**背景** + +在传统编译流程中,gcc 将单个源文件(称谓一个编译单元)直接进行编译优化生成包含汇编代码的.o目标对象文件,并由链接器对这些.o文件进行符号表解析与重定位,链接成可执行文件。在这个过程中,拥有跨文件函数调用信息的链接器由于操作的是汇编代码,难以进行编译优化,而可以执行编译优化的环节,却没有跨文件的全局信息。这样的编译框架,虽然提高了编译效率,每次重新编译只需要编译修改过的少量编译单元,但也丢失了许多跨文件的优化机会。 + +**LTO流程** + +LTO 设计的初衷就是希望能够在链接时,拥有跨编译单元的调用信息的时候,进行编译优化,提供更多的优化机会。为了达到这个目的,LTO 需要将编译优化所需的 IR 信息保留到链接时。在链接时,链接器会调用 LTO 插件,执行全程序分析,生成更加有效的优化决策,再经由编译优化生成更高效的IR,进一步转成包含汇编代码的目标对象文件,最后由链接器完成常规的链接工作。 + +**分区与并行** + +由于需要处理全局的调用图,在执行LTO时往往需要更长的编译时间,有些时候,LTO的编译时间会达到非LTO的数倍。为了使 LTO 能够并行,以加快编译速度,分区模式出现了。在分区模式下,全局调用图会根据模块之间的关联性被拆分成若干个分区,各分区之间独立并行优化,是一种在编译时间和优化效果之间的平衡。 + +### 1.5.2 使用方式 + +#### 选项-flto= + +编译选项中加入此选项开启LTO。可通过-flto=n指定LTO的并发数,如使用auto可以指定与GNU make一致(如果可以获取)或是与当前机器线程数一致的并发数。 + +#### 选项-ffat-lto-objects + +该选项将生成同时包含汇编信息和LTO信息的目标文件。并且在-ffat-lto-objects开启的情况下,允许通过-fno-lto选项,使用目标对象文件的汇编信息,来完成常规的链接,而不执行链接时优化。 + +#### 选项-flto-partion=1to1|balanced|max|one|none + +该选项可以通过引入不同的分区策略从而加快编译速度。1to1意味着分区与源文件一一对应;balanced控制每个分区在规模上相等;max会为每一个符号创建一个分区;one会尽量生成一个分区;none会直接调过全程序分以及分区的环节。 + +#### 选项-flto-compresson-level=n + +该选项用以控制LTO对性文件中IR信息的压缩等级。 + +**DEMO** + +```bash +// four.cint four() { return 4;} +// five.cint five() { return 5;} +// test.cextern int four();extern int five();int main() { return four() + five();} +gcc -O2 -flto test.c four.c five.c +# 或者 +gcc -O2 -flto -c test.cgcc -O2 -flto -c four.cgcc -O2 -flto -c five.cgcc test.o four.o five.o +``` + +**说明** + +对于上面这个案例,在使用 LTO 生成的可执行文件中,four() + five()会被内敛+常量折叠优化为立即数9,省略了函数调用与计算的步骤,这在非 LTO 模式下是无法实现的。 如果仅对four.c和test.c生成了 LTO 对象文件,最终结果便成了4 + five(),仅部分lto对象文件参与了局部范围内的链接时优化。 + +### 1.5.3 常见使用问题 + +- plugin needed to handle lto object + + 链接器或者相关工具链在处理 lto 对象文件时,需要调用 lto 插件来解析对应 section 的信息。这类报错一般是由于 ar/ranlib/nm 没有调用 lto 插件导致的,可以通过更换为 gcc-ar/gcc-ranlib/gcc-nm 来解决。 + +- undefined symbol + + 这类问题有许多个比较原因,以下举例比较常见的三种: + + 一是符号版本控制相关的情况。由于 gcc 不支持 __asm__ 形式的符号版本控制,需要在应用源码层面替换为__attribute__(.symver) 形式的符号版本控制。 + + 二是由于编译过程依赖了 objcopy 等工具,此类工具不支持处理lto对象文件,会导致需要重命名重定义的符号没有重命名,引起符号未定义的问题。 + + 三是涉及到了链接时插桩(-Wl,--wrap=foo),在lto下会出现 __wrap_foo 的符号未定义的问题,该问题上游社区正在解决中。 + +- multi-defined symbol + + 一般是由于编译过程依赖了 objcopy 等工具,此类工具不支持处理lto对象文件,会导致需要隐藏的符号没有隐藏,引起重复定义的问题。 + +## 1.6 静态编译 + +### 1.6.1 选项 -fipa-struct-reorg + +内存空间布局优化,将结构体成员在内存中的排布进行新的排列组合,来提高cache的命中率。 + +- 结构体拆分:将结构体的冷热成员单独拆分成一个结构体类型 + + **图1** 结构体拆分优化原理示意图 + + ![Figure Name:unnaming.png CAD Name:zh-cn_image_0000002008223880.png](./figures/p1.png) + + 将以下结构体: + + ```bash + struct S + { + type1 field1; + // Hot field + type2 field2; + };S *v; + ``` + + 转化为: + + ```bash + struct S_hot + { + type1 field1; + }; + struct S_cold + { + type2 field2; + }; + S_hot *v_hot; + S_cold *v_cold; + ``` + +- 结构体数组优化:将结构体的数组转化为数组的结构体。 + + **图1** 结构体数组优化原理示意图 + + ![Figure Name:unnaming.png CAD Name:zh-cn_image_0000002008224188.png](./figures/p2.png) + + 将以下结构体: + + ```bash + struct + { + type1 field1; + type2 field2; + type3 field3; + } arr[N]; + ``` + + 转化为: + + ```bash + struct + { + type1 field1[N]; + type2 field2[N]; + type3 field3[N]; + } arr; + ``` + +#### 使用方法 + +在编译选项中加入: + +```bash +-O3 -flto -flto-partition=one -fipa-struct-reorg +``` + +**须知** + +-fipa-struct-reorg选项,需要在-O3 -flto -flto-partition=one全局同时开启的基础上才使能。 + +SPEC性能提升效果:SPECCPU2017 intrate 505.mcf子项性能提升20%。 + +### 1.6.2 选项 -fipa-reorder-fields + +内存空间布局优化之结构体重排优化,根据结构体中成员的占用空间大小,将成员从大到小排列,以减少边界对齐引入的padding,来减少结构体整体占用的内存大小,以提高cache的命中率。 将以下结构体 + +```bash +struct S + { + double a; + int b;double c; + double d; + short e; + double f; + double g; + double h; + double i; + }; +``` + +经过重排后转化为: + +```bash +struct S.reorder + { + double a; + double i; + double c; + double d; + double f; + double g; + double h; + int b; + short e; + } +``` + +#### 适用方法 + +```bash +在选项中加入-O3 -flto -flto-partition=one -fipa-reorder-fields +``` + +**须知** + +-fipa-reorder-fields选项,需要在-O3 -flto -flto-partition=one全局同时开启的基础上才使能。 + +SPEC性能提升效果:SPECCPU2017 intrate 505.mcf子项性能提升20%。 + +### 1.6.3 选项 -fipa-struct-reorg=n + +使用该选项控制内存空间布局优化系列优化。 + +- -fipa-struct-reorg=**0** 不启用任何优化。 + +- -fipa-struct-reorg=**1** 启用结构体拆分和结构体数组优化,等同使用-fipa-struct-reorg + +- -fipa-struct-reorg=**2** 在 -fipa-struct-reorg=1 的基础上,新增结构体成员重排-fipa-reorder-fields + +- -fipa-struct-reorg=**3** 在-fipa-struct-reorg=2 的基础上,新增**结构体冗余成员消除优化**。结构体冗余成员消除,消除结构体中从不读取的结构体成员,同时删除冗余的写语句。 将以下结构体: + + ```bash + struct S + { + type1 field1; + // Never read in whole program + type2 field2;}; + ``` + + 转化为 + + ```bash + struct S.layout + { + type2 field2; + }; + ``` + +- -fipa-struct-reorg=**4** 在-fipa-struct-reorg=3的基础上,新增**安全结构体指针压缩优化**。 + + 结构体指针压缩将结构体域成员中的结构体指针压缩至可选的8、16和32 bits,缩小结构体占用内存大小,降低从内存中读写数据时的带宽压力,从而提升性能。 + + - 安全的结构体指针压缩仅支持结构体数组大小在编译期间已知的场景。 + - 使用--param compressed-pointer-size=[8,16,32]控制压缩目标大小,默认取值为32。 + + 将以下结构体: + + ```bash + struct S + { + struct S* field1; + type2 field2; + }; + ``` + + 转化为: + + ```bash + struct S.layout + { + uint32_t field1.pc; + type2 field2; + }; + ``` + +- -fipa-struct-reorg=**5** 在-fipa-struct-reorg=4的基础上,**放宽了结构体指针压缩优化的应用场景**。 + + 该等级支持结构体数组大小在编译期间未知的场景,用户需自行确认压缩等级合法,不同等级支持的最大结构体数组大小如下表所示。 + + | **指针大小** | **最大支持数组范围** | + | ------------ | -------------------------- | + | 8 | 254(0xff-1) | + | 16 | 65534(0xffff-1) | + | 32 | 4294967294(0xffffffff-1) | + +- -fipa-struct-reorg=**6** 在-fipa-struct-reorg=5的基础上,新增**结构体数组semi-relayout优化**。* + + semi-relayout在一定范围内,将结构体数组中各结构体的成员打包后重排,提高数据空间局部性,从而提升性能。 + + - 通过参数--param semi-relayout-level=[11,12,13,14,15]控制semi-relayout的重排规模,默认值为13,即semi-relayout将每1024个结构体作为一组进行重排,不足1024的情况下以padding的形式补齐1024个结构体空间;计算方式:(1 << semi-relayout-level) / 8。 + + - 将以下结构体数组在内存中的排布形式从连续的结构体按照如下图形式转换。 + + **图1** semi-relayout优化原理示意图 + + ![Figure Name:unnaming.png CAD Name:zh-cn_image_0000002008224188.png](./figures/p3.png) + + ```bash + struct S + { + long a, + int b, + short c + }; + ``` + +#### 使用方法 + +在选项中加入: + +```bash +-O3 -flto -flto-partition=one -fipa-struct-reorg=n +``` + +其中n取值范围为[0,6]。 + +**须知** + +**-fipa-struct-reorg=n**选项,需要在-O3 -flto -flto-partition=one全局同时开启的基础上才使能。 + +### 1.6.4 选项 -ftree-slp-transpose-vectorize + +该选项在循环拆分阶段,增强对存在连续访存读的循环的数据流分析能力,通过插入临时数组拆分循环;SLP矢量化阶段,新增对grouped_stores进行转置的SLP分析。 + +```bash +int foo (unsigned char *oxa, int ia, unsigned char *oxb, int ib) + { + unsigned tmp[4][4]; + unsigned a0, a1, a2, a3;int sum = 0; + for (int i = 0; i < 4; i++, oxa += ia, oxb += ib) + { + a0 = (oxa[0] - oxb[0]) + ((oxa[4] - oxb[4]) << 16); + a1 = (oxa[1] - oxb[1]) + ((oxa[5] - oxb[5]) << 16); + a2 = (oxa[2] - oxb[2]) + ((oxa[6] - oxb[6]) << 16); + a3 = (oxa[3] - oxb[3]) + ((oxa[7] - oxb[7]) << 16); + int t0 = a0 + a1;int t1 = a0 - a1;int t2 = a2 + a3; + int t3 = a2 - a3;tmp[i][0] = t0 + t2; + tmp[i][2] = t0 - t2;tmp[i][1] = t1 + t3; + tmp[i][3] = t1 - t3; + } + for (int i = 0; i < 4; i++) + { + int t0 = tmp[0][i] + tmp[1][i]; + int t1 = tmp[0][i] - tmp[1][i]; + int t2 = tmp[2][i] + tmp[3][i]; + int t3 = tmp[2][i] - tmp[3][i]; + a0 = t0 + t2; + a2 = t0 - t2; + a1 = t1 + t3; + a3 = t1 - t3; + sum += a0 + a1 + a2 + a3; + } + return sum; + } +``` + +对于如上所示的用例,针对第一个for循环,可以拆分为如下形式 + +```bash +for (int i = 0; i < 4; i++, oxa += ia, oxb += ib) + { + a00[i] = (oxa[0] - oxb[0]) + ((oxa[4] - oxb[4]) << 16); + a11[i] = (oxa[1] - oxb[1]) + ((oxa[5] - oxb[5]) << 16); + a22[i] = (oxa[2] - oxb[2]) + ((oxa[6] - oxb[6]) << 16); + a33[i] = (oxa[3] - oxb[3]) + ((oxa[7] - oxb[7]) << 16); + } +for (int i = 0; i < 4; i++) + { + int t0 = a00[i] + a11[i]; + int t1 = a00[i] - a11[i]; + int t2 = a22[i] + a33[i]; + int t3 = a22[i] - a33[i]; + tmp[i][0] = t0 + t2; + tmp[i][2] = t0 - t2; + tmp[i][1] = t1 + t3; + tmp[i][3] = t1 - t3; + } +``` + +再针对于拆分所得的第一个循环,等号右边的计算同构且为连续load可以矢量化,但是由于左边a00[i]、a11[i]、a22[i]、a33[i]的内存地址不连续,无法作为矢量化SLP树的根节点,因此失去这种场景的矢量化机会。 在a00[i]、a11[i]、a22[i]、a33[i]写入内存时,期望寄存器中的内容为: + +| **register** | **values** | +| ------------ | --------------------------- | +| vec0 | a00[0] a00[1] a00[2] a00[3] | +| vec1 | a11[0] a11[1] a11[2] a11[3] | +| vec2 | a22[0] a22[1] a22[2] a22[3] | +| vec3 | a33[0] a33[1] a33[2] a33[3] | + +而每次迭代内可以计算得到寄存器的内容为: + +| **register** | **values** | +| ------------ | --------------------------- | +| vec0 | a00[0] a11[0] a22[0] a33[0] | +| vec1 | a00[1] a11[1] a22[1] a33[1] | +| vec2 | a00[2] a11[2] a22[2] a33[2] | +| vec3 | a00[3] a11[3] a22[3] a33[3] | + +将grouped_store进行转置,即可得到预期的SLP树根节点。再利用SLP原有的能力,进行后续的矢量化分析。 + +此外,针对拆分所得的第二个循环以及示例中的最后一个循环,tmp二维数组存在写入内存后立刻读取的行为,针对这种场景,将访存行为优化为寄存器之间的permutation行为。该访存优化默认开启。 + +#### 使用方法 + +在选项中加入: + +```bash +-O3 -ftree-slp-transpose-vectorize +``` + +**须知** + +**-ftree-slp-transpose-vectorize**选项,需要在-O3开启的基础上才使能。 + +### 1.6.5 选项 -fccmp2 + +该选项是Arm相关指令优化:增强ccmp指令使用场景,简化指令流水 + +针对如下代码场景: + +```bash +int f(int a, int b, int c) { while(1) { if (a--==0||b>=c){ return 1; } }} +``` + +成功使能ccmp指令,可以生成如下汇编代码: + +**图1** 汇编包含ccmp指令示意图 + +![Figure Name:unnaming.png CAD Name:zh-cn_image_0000002044503909.png](./figures/p4.png) + +#### 使用方法 + +增加编译选项 -fccmp2 + +**须知** + +SPEC性能提升效果:SPECCPU2017 intrate 557.xz_r子项性能提升约1% + +### 1.6.6 选项 -farray-widen-compare + +数组宽比较优化:支持使用宽数据类型对原数组指针(指向的数组元素为窄类型)解引用,达到一次比较多个元素的效果,从而提高程序性能。 + +针对如下代码场景: + +```bash +#define my_min(x, y) ((x) < (y) ? (x) : (y)) +uint32_t func (uint32_t n0, uint32_t n1, const uint32_t limit, const uint8_t * a, const uint8_t * b) + { + uint32_t n = my_min(n0, n1); + while (++n != limit) + if (a[n] != b[n]) + break; + return n;} +``` + +添加选项后,可以优化为如下代码: + +```bash +#define my_min(x, y) ((x) < (y) ? (x) : (y)) +uint32_t func (uint32_t n0, uint32_t n1, const uint32_t limit, const uint8_t * a, const uint8_t * b) + { + uint32_t n = my_min(n0, n1); + for (++n; n + sizeof(uint64_t) <= limit; n += sizeof(uint64_t)) + { + uint64_t k1 = *((uint64_t*)(a+n)); + uint64_t k2 = *((uint64_t*)(b+n)); + if(k1 != k2) + { + int lz = __builtin_ctzll(k1 ^ k2); + n += lz/8; + return n; + } + } + for (;n != limit; ++n) + { + if (a[n] != b[n]) + break; + } + return n; + } +``` + +#### 使用方法 + +增加编译选项-O3 -farray-widen-compare + +# 2 AI For Compiler + +## 2.1 采样反馈优化能力增强 + +### 2.1.1 特性描述 + +AI4Compiler通过相关算法及构建框架,可以在进一步增强采样反馈优化能力特性,更准确的预估编译优化过程中的关键数值,辅助编译器做出更合理的优化决策,提升编译优化效果。AI4Compiler通过代码表征学习等AI4Compiler算法,训练BOLT采样的基本块精度修正模型,构建框架集成至GCC for OpenEuler,实现性能提升。 + +BOLT通过改进二进制文件中的代码和数据布局来减少CPU的缓存未命中率和分支预测错误,从而在编译器在应用了链接时优化(LTO)以及反馈驱动优化(FDO)后提供进一步的优化。BOLT在利用动态profiling数据提高程序的运行性能时有两种不同的方式:即插桩和采样。插桩方式性能开销大但精度较高,采样方式性能开销微乎其微但精度不及插桩。而BOLT采样的基本块精度修正模型则力图通过挖掘一个BB块的内含指令/变量、所处函数/文件等多粒度代码信息来对其Count值进行预测,从而提高CFG的准确性,使采样BOLT达到接近插装BOLT的优化效果。 + +### 2.1.2 下载安装步骤 + +1. 使用root权限,安装rpmbuild、rpmdevtools + + ```bash + ## 安装rpmbuild + yum install rpm-build + ## 安装rpmdevtools + yum install rpmdevtools + ``` + +2. 从目标仓库拉取代码 + + ```bash + git clone https://gitee.com/src-openeuler/AI4C.git + ``` + +3. 生成rpmbuild文件夹 + + ```bash + rpmbuild-setuptree将拉取代码中的AI4C-v0.2.0-alpha.tar.gz和相关patch文件放入rpmbuild中的SOURCES文件夹中,将AI4C.spec放入rpmbuild中的SPECS目录下。 + ``` + +4. 安装AI4C + + ```bash + rpm -ivh \<成功构建的rpm> + ``` + + (若系统因存有旧版本安装包而导致的文件冲突,可以在rpm -ivh \<成功构建的rpm>命令中添加一行--force选项,强制安装新版本;或者通过rpm -Uvh \<成功构建的rpm>命令更新安装包)。 + +5. 待安装完成后,可在/usr/lib64下找到相关动态库,在/usr/lib64/AI4C目录下找到相关模型。 + +### 2.1.3 使用步骤 + +AI4C支持用户调用API使用自定义模型进行推理,也支持借助编译选项使用预设模型使用采样反馈优化能力增强特性和优化选项调优特性。 + +使用自定义模型推理: + +1. 开发者首先需要构建自己的模型并借助onnxruntime保存成一个ONNX模型。 + +2. 用户需要在目标优化遍的适配层里调用AI4C提供的API,进行模型的推理,如下表所示。下表的接口存在动态库libONNXRunner.so中,用于模型的推理配置阶段、推理运行阶段和模型推理结束后的资源清理阶段。 + + | API名 | 说明 | + | ------------------------------------------------------------ | ------------------------------------------------------------ | + | extern ONNXRunner* createONNXRunner(const char* model_path) | 参数为模型存放的路径,并创建session对本次推理进行初始化和配置 | + | extern void deleteONNXRunner(ONNXRunner* instance) | 删除ONNXRunner对象 | + | extern float runONNXModel(ONNXRunner* instance, std::vector<std::string> input_string, std::vector<int64_t>input_int64, std::vector<float> input_float) | 参数为模型的输入,将输入传入模型进行推理得到相应结果 | + +### 2.1.4 常用应用提升效果 + +本次测试使用MySQL应用程序作为测试程序。MySQL是一种流行的开源关系型数据库管理系统(RDBMS),广泛应用于各种应用中。通过AI4Compiler算法及框架,可以在BOLT优化阶段更准确的预估编译优化过程中的关键数值,辅助编译器做出更合理的优化决策,提升编译优化效果,从而实现MySQL性能提升。根据对MySQL的运行tpmC吞吐量测试结果,AI4Compiler框架结合调优选项可以帮助MySQL性能提升5%。 + +# 3 插件框架 + +## 3.1 特性描述 + +编译器插件框架致力于让开发者减少开发成本,即基于编译能力的相关工具开发者只需要做一次开发,便可在多个不同编译器框架落地。同时编译器插件框架作为开发平台,也提供对公共能力的支持与维护。编译器插件框架采用代理模式,由服务端和客户端两个关键组件构成。插件服务端专注于承载插件逻辑,允许开发者基于相对中立的MLIR和我们提供的一系列插件API进行开发,使开发者能够将关注点聚焦于工具的设计逻辑上。服务端与不同编译器的客户端对接,通过跨进程通信传递IR数据与操作,将插件逻辑转换映射,并最终在客户端编译器上执行,从而实现了一份代码可以在多个编译器上落地的目的。 + +插件使用者只需要下载所需插件的库文件和校验文件,通过框架的配置文件即可与编译器客户端联合使能。插件客户端将作为GCC/LLVM Plugin进行加载,具有不需要修改GCC编译器源代码即可实现新功能的优势,使得用户能够更加灵活和便捷地使用插件,同时享受框架支持与维护的各种公共能力。 + +## 3.2 下载安装步骤 + +1. 安装依赖软件 + + ```bash + ## 安装GCC客户端依赖软件: + yum install -y gityum install -y makeyum install -y cmakeyum install -y grpcyum install -y grpc-develyum install -y grpc-pluginsyum install -y protobuf-develyum install -y jsoncppyum install -y jsoncpp-develyum install -y gcc-plugin-develyum install -y llvm-mliryum install -y llvm-mlir-develyum install -y llvm-devel + ## 安装插件框架服务端依赖软件 + yum install -y gityum install -y makeyum install -y cmakeyum install -y grpcyum install -y grpc-develyum install -y grpc-pluginsyum install -y protobuf-develyum install -y jsoncppyum install -y jsoncpp-develyum install -y llvm-mliryum install -y llvm-mlir-develyum install -y llvm-devel + ``` + +2. 安装/构建插件框架,可以采用以下两种方式进行 + + 1. 编译构建 + + ```bash + ## 构建插件框架GCC客户端 + git clone https://gitee.com/openeuler/pin-gcc-client.gitcd pin-gcc-clientmkdir buildcd buildcmake ../ -DMLIR_DIR=${MLIR_PATH} -DLLVM_DIR=${LLVM_PATH}make + ## 构建插件框架服务端 + git clone https://gitee.com/openeuler/pin-server.gitcd pin-servermkdir buildcd buildcmake ../ -DMLIR_DIR=${MLIR_PATH} -DLLVM_DIR=${LLVM_PATH}make + ``` + + 2. yum安装 + + ```bash + ## yum安装插件框架GCC客户端 + yum install -y pin-gcc-client + ## yum安装插件框架服务端 + yum install -y pin-server + ``` + +# 4 多版本GCC + +## 4.1 特性描述 + +为确保操作系统的稳健性,基础软件的选型策略通常倾向于采用经过时间验证、相对稳定的版本,而非最新发布版本。这一策略旨在避免版本更迭带来的潜在不稳定因素,确保在整个长期支持(LTS)周期内,系统版本保持相对稳定。因此,当前 openEuler 在 24.03 LTS 版本整个生命周期都是选择使用 GCC 12.3.1 作为基线进行开发。 + +这样的选择会带来如下问题。首先,许多的硬件特性需要基础 GCC 工具链的支持,选择非最新版本的 GCC 会导致新特性无法及时在新发布的操作系统上使能。另外,某些用户倾向使用最新版本的编译器使能最新特性,这些特性相较于低版本编译器会带来部分性能提升。 + +因此,为了使能多样算例新特性,满足不同用户对不同硬件特性支持的需求,在 openEuler 24.09 版本推出 openEuler GCC Toolset 工具链,这是一个专为 openEuler 系统设计的 GCC 多版本编译工具链,该工具链提供一个高于系统主 GCC 版本的副版本 GCC 编译工具链,为用户提供了更加灵活且高效的编译环境选择。通过使用 openEuler GCC Toolset 多版本编译工具链,用户可以轻松地在不同版本的 GCC 之间进行切换,以便充分利用新硬件特性,同时享受到 GCC 最新优化所带来的性能提升。 + +## 4.2 使用约束 + +在默认 GCC 版本为 GCC 12.3.1 的 openEuler24.09 版本中,提供 gcc-toolset-14 的副版本编译工具链,形成主编译器版本为 GCC 12,副版本编译器为 GCC 14 的搭配; + +- 操作系统:openEuler 24.09 +- 硬件架构:Aarch64 / X86_64 + +## 4.3 下载安装步骤 + +### 4.3.1 安装scl + +```bash +yum install scl-utils scl-utils-build +``` + +### 4.3.2 安装多版本工具链 + +副版本编译工具链 gcc-toolset-14 安装路径为 /opt/openEuler/gcc-toolset-14/: + +```bash +yum install -y gcc-toolset-14-gcc* +yum install -y gcc-toolset-14-binutils* +``` + +## 4.4 使用方式 + +本方案引入 SCL(Software Collections)工具进行不同版本编译工具链的管理。 + +### 4.4.1 注册 gcc-toolset-14 + +```bash +## 注册gcc-toolset-14 +scl register /opt/openEuler/gcc-toolset-14/ +##取消注册 gcc-toolset-14 +scl deregister gcc-toolset-14 +使用scl list-collections显示 gcc-toolset-14 表明已经在 scl 中注册成功; +``` + +### 4.4.2 切换 gcc-toolset-14 + +启动一个新的bash shell会话,其中使用 gcc-toolset-14 内的工具版本,而不是系统默认版本。在新的bash shell会话中,无需显式使用scl命令。 + +```bash +scl enable gcc-toolset-14 bash +``` + +如果需要退出 gcc-toolset-14 的编译环境,输入exit退出bash shell会话,此时gcc的版本切换成系统默认版本。 + +SCL工具的本质就是自动设置不同工具版本的环境变量,具体可以参考 /opt/openEuler/gcc-toolset-14/enable 文档,gcc-toolset-14 的环境变量均在该文件中设置。若用户系统没有 SCL 工具,则可以使用以下方式进行工具链版本切换: + +```bash +## 方案一:无 SCL 工具,使用脚本切换编译工具链 +source /opt/openEuler/gcc-toolset-14/enable + +## 方案二:有 SCL 工具,使用 SCL 工具切换编译工具链并激活运行环境 +scl enable gcc-toolset-14 bash +``` + +## 4.5 使用场景 + +主版本场景:正常编译使用系统默认的 gcc-12.3.1; + +副版本场景:需要使用 GCC-14 高版本特性构建相关应用,使用 SCL 工具将 bash 环境切换为 gcc-toolset-14 编译工具链的编译环境。 diff --git a/docs/zh/server/development/gcc/kernel_fdo_user_guide.md b/docs/zh/server/development/gcc/kernel_fdo_user_guide.md new file mode 100644 index 0000000000000000000000000000000000000000..d46d748fbe59202a81ce2582f56bb5d71bb1fe0c --- /dev/null +++ b/docs/zh/server/development/gcc/kernel_fdo_user_guide.md @@ -0,0 +1,73 @@ +# 简介 + +内核反馈优化(PGO kernel)特性为内核提供了反馈优化能力的支持,使用户可以为不同的应用程序构建针对性优化的内核,在单应用场景下提高目标应用的性能。同时,该特性一并在openEuler GCC内提供了相应的编译支持,以及在A-FOT中提供了自动优化的功能,使用户能够便捷地使能内核反馈优化特性。 + +# 安装与部署 + +## 软件要求 + +* 操作系统:openEuler 22.03 LTS SP4 + +## 硬件要求 + +* aarch64架构 +* x86_64架构 + +## 安装软件 + +### 安装内核源码 + +```shell +yum install -y kernel-source +cp -r /usr/src/linux-5.10.0-153.12.0.89.oe2203SP4.aarch64 . +``` + +**注意:具体的版本号可能会有变化。** + +### 安装GCC(可选) + +openEuler 22.03 LTS SP4的系统GCC已经集成对PGO kernel的编译支持,但用户也可以通过如下步骤手动构建定制的GCC从而使用其他版本(需要GCC 10及以上的GCC源码),关键点是需要添加`--disable-tls --disable-libsanitizer`。 + +```shell +cd ${GCC_DIR} +mkdir build +cd build +../configure --prefix=${GCC_INSTALL_PREFIX} --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,fortran,lto --enable-plugin --enable-initfini-array --disable-libgcj --without-isl --without-cloog --enable-gnu-indirect-function --build=aarch64-linux-gnu --with-stage1-ldflags='-Wl,-z,relro,-z,now' --with-boot-ldflags='-Wl,-z,relro,-z,now' --disable-bootstrap --with-multilib-list=lp64 --enable-bolt --disable-tls --disable-libsanitizer +make -j 96 && make install -j 96 +``` + +### 安装A-FOT + +```shell +git clone https://gitee.com/openeuler/A-FOT.git +``` + +# 使用方法 + +用户可以通过A-FOT工具使能内核反馈优化,一键得到优化内核。将opt_mode指定Auto_kernel_PGO则为PGO kernel模式。所有配置选项也可以通过命令行指定,例如:./a-fot --pgo_phase 1,另外-s、-n选项只能在命令行指定。PGO kernel相关的选项说明如下表所示。 + +| 序号 | 选项名称(配置文件) | 选项说明 | 默认值 | +| ---- | -------------------- | ------------------------------------------------------------ | ------------------------ | +| 1 | config_file | 配置文件路径;根据此文件内容读取用户的选项配置。 | ${afot_path}/a-fot.ini | +| 2 | opt_mode | 优化模式;工具将执行的优化模式,必须为AutoFDO、AutoPrefetch、AutoBOLT、Auto_kernel_PGO四者之一。 | AutoPrefetch | +| 3 | pgo_mode | PGO模式;内核的反馈优化模式,GCOV或完整的PGO。 | all | +| 4 | pgo_phase | 内核反馈优化的执行阶段;工具根据阶段执行不同的操作。 | 1 | +| 5 | kernel_src | 内核源码目录;指定则工具进入编译内核,否则工具自动下载源码。 | 无(可选) | +| 6 | kernel_name | 内核构建的本地名;工具将根据阶段添加"-pgoing"或"-pgoed"后缀。 | kernel | +| 7 | work_path | 脚本工作目录;此目录用于存放日志文件、wrapper和profile。 | /opt(不能在/tmp目录下) | +| 8 | run_script | 应用执行脚本路径;此脚本为目标应用的执行脚本,需要用户完成编写;工具将后台运行此脚本以执行目标应用。 | /root/run.sh | +| 9 | gcc_path | GCC路径;工具调用真正编译器GCC的路径。 | /usr | + +配置完编译选项后,可以使用如下命令进行A-FOT自动化优化内核: + +```shell +a-fot --config_file ./a-fot.ini -s +``` + +**注意:-s选项会让A-FOT工具自动重启机器切换内核,如果用户不希望自动进行这一项敏感操作,请去掉这一选项。但用户需要在重启后手动执行第二阶段(--pgo_phase 2)。** + +# 兼容性说明 + +此节主要列出当前一些特殊场景下的兼容性问题。本项目持续迭代中,会尽快进行修复,也欢迎广大开发者加入。 + +* 由于GCC中反馈优化的具体实现在不同版本中不一致,本特性暂时需要GCC版本大于等于10。 diff --git a/docs/zh/server/development/lustre/_toc.yaml b/docs/zh/server/development/lustre/_toc.yaml new file mode 100644 index 0000000000000000000000000000000000000000..18b3cf89d20bb2d126c0b9a89aae2d173022a180 --- /dev/null +++ b/docs/zh/server/development/lustre/_toc.yaml @@ -0,0 +1,6 @@ +label: Lustre用户指南 +isManual: true +description: Lustre是一个开源的分布式并行文件系统 +sections: + - label: 简介 + href: ./user_guide.md diff --git a/docs/zh/server/development/lustre/figures/lustre-architecture.png b/docs/zh/server/development/lustre/figures/lustre-architecture.png new file mode 100644 index 0000000000000000000000000000000000000000..cad3c0d14edac396fcaedf0c77d7fdc1c9fcc13a Binary files /dev/null and b/docs/zh/server/development/lustre/figures/lustre-architecture.png differ diff --git a/docs/zh/server/development/lustre/user_guide.md b/docs/zh/server/development/lustre/user_guide.md new file mode 100644 index 0000000000000000000000000000000000000000..a645f2ddf53aac0928e33f848e4b45a926c59b56 --- /dev/null +++ b/docs/zh/server/development/lustre/user_guide.md @@ -0,0 +1,203 @@ +# 简介 + +Lustre 是一个开源的分布式并行文件系统,具有高可扩展、高性能、高可用等特点。Lustre 运行于 Linux 系统之上提供符合 POSIX 标准的 UNIX 文件系统接口。 + +一个部署好的 Lustre 集群系统包含包括4个主要组件: + +- Management Server (MGS): 存储Lustre文件系统的配置信息。 +- Metadata Server (MDS): 为文件系统提供元数据服务。 +- Object Storage Server (OSS): 以对象方式存储文件数据。 +- Lustre clients: 挂着 Lustre 文件系统的主机。 + +这些组件通过 Lustre 网络(LNet)互联起来。如下图所示。 + +![](./figures/lustre-architecture.png) + +图片来源[Lustre manual](http://lustrefs.cn/manual/) 1.2章节。 + +# 环境要求 + +**服务器配置** + +- 安装 openEuler 22.03 LTS SP4 的 x86/ARM 服务器一台或多台。 +- 服务器除了系统盘外,还需要配置额外的盘给 Luste 使用。 +- 插有以太网或者 IB 网卡。 + +>**须知:** +> +> 如是生产环境,请详细参阅[Lustre manual](http://lustrefs.cn/manual/) 第五和第六章 Lustre 硬件配置和存储组RAID要求。 + +# 安装 + +在所有节点上执行以下命令安装 lustre。 + +1. 安装 Lustre rpm repo 包。 + + ```sh + sudo dnf install lustre-release + ``` + +2. 安装 Lustre 相关 rpm 包。 + + ```sh + sudo dnf install lustre lustre-tests + ``` + +>**须知:** +> +>目前的 Lustre rpm 包是基于内核 in-tree IB 驱动编译, 而且只编译了`ldiskfs`后端,如需基于第三方IB驱动编译(例如MLX IB网卡驱动),或者编译`zfs`后端支持,请重新编译 lustre src rpm 包。 +> +> lustre src rpm 下载路径: +> +> 目录:`openEuler-22.03-LTS-SP4/EPOL/[update/]multi_version/lustre/2.15/source/` +> +> **安装编译依赖** +> +> ```sh +> sudo dnf builddep --srpm lustre-2.15.3-2.oe2203SP4.src.rpm +> ``` +> +> **基于MLX IB驱动重新编译** +> +> 需要先安装好 MLX IB 驱动。 +> +> ```sh +> rpmbuild --rebuild --with mofed lustre-2.15.3-2.oe2203SP4.src.rpm +> ``` +> +> **支持zfs后端重新编译** +> +> 请使用验证分支[zfs-2.1-release](https://github.com/openzfs/zfs/tree/zfs-2.1-release)来编译zfs。 +> +> ```sh +> git clone -b zfs-2.1-release https://github.com/openzfs/zfs +> +> cd zfs && sh autogen.sh && ./configure --with-spec=redhat && make rpms +> +> sudo dnf install ./*$(arch).rpm +> +> rpmbuild --rebuild --with zfs lustre-2.15.3-2.oe2203SP4.src.rpm +> ``` + +# 部署 + +> **须知:** +> +> 以下是简单的部署步骤,如是生产环境,建议按照[Lustre manual](http://lustrefs.cn/manual/) 第四章“安装概述”的详细步骤进行部署。 + +**配置网络** + +如有多块网卡或者 IB 网卡,需要配置指定哪块为 Lustre 使用,例如指定一块以太网和 IB 网卡给 lustre 使用。 + +```bash +$ cat /etc/modprobe.d/lustre.conf +options lnet networks="tcp(enp125s0f0),o2ib(enp133s0f0) +``` + +**加载lustre模块** + +并检查lnet网络是否ok。 + +```bash +$ sudo modproe lustre +$ sudo lctl list_nids +175.200.20.14@tcp +10.20.20.14@o2ib +``` + +**单机快速部署** + +如需要快速拉起测试验证单机环境,可以执行以下命令。 + +```bash +$ sudo /lib64/lustre/tests/llmount.sh +$ mount +... +192.168.1.203@tcp:/lustre on /mnt/lustre type lustre (rw,checksum,flock,user_xattr,lruresize,lazystatfs,nouser_fid2path,verbose,encrypt) +$ lfs df -h +UUID bytes Used Available Use% Mounted on +lustre-MDT0000_UUID 95.8M 3.2M 90.5M 4% /mnt/lustre[MDT:0] +lustre-OST0000_UUID 239.0M 3.0M 234.0M 2% /mnt/lustre[OST:0] +lustre-OST0001_UUID 239.0M 3.0M 234.0M 2% /mnt/lustre[OST:1] + +filesystem_summary: 478.0M 6.0M 468.0M 2% /mnt/lustre +``` + +**多机集群部署** + +在 MGS/MDS 节点上,增加一个 MDT, lustre 文件系统名为 temp。 + +```bash +$ sudo mkfs.lustre --fsname=temp --mgs --mdt --index=0 /dev/vdb + Permanent disk data: +Target: temp:MDT0000 +Index: 0 +Lustre FS: temp +Mount type: ldiskfs +Flags: 0x65 + (MDT MGS first_time update ) +Persistent mount opts: user_xattr,errors=remount-ro +Parameters: + +device size = 81920MB +formatting backing filesystem ldiskfs on /dev/vdb + target name temp:MDT0000 + kilobytes 83886080 + options -J size=3276 -I 1024 -i 2560 -q -O dirdata,uninit_bg,^extents,dir_nlink,quota,project,huge_file,ea_inode,large_dir,^fast_commit,flex_bg -E lazy_journal_init="0",lazy_itable_init="0" -F +mkfs_cmd = mke2fs -j -b 4096 -L temp:MDT0000 -J size=3276 -I 1024 -i 2560 -q -O dirdata,uninit_bg,^extents,dir_nlink,quota,project,huge_file,ea_inode,large_dir,^fast_commit,flex_bg -E lazy_journal_init="0",lazy_itable_init="0" -F /dev/vdb 83886080k +Writing CONFIGS/mountdata + +$ sudo mkdir /mnt/lustre-mdt1 +$ sudo mount -t lustre /dev/vdb /mnt/lustre-mdt1 +``` + +可以按照同样的方法增加多块 MDT, `--index`递增。 + +在OSS节点上,增加一块 OST。 + +```bash +$ sudo lctl list_nids +192.168.1.203@tcp +]$ sudo mkfs.lustre --fsname=temp --mgsnode=192.168.1.203@tcp --ost --index=0 /dev/vdc + Permanent disk data: +Target: temp:OST0000 +Index: 0 +Lustre FS: temp +Mount type: ldiskfs +Flags: 0x62 + (OST first_time update ) +Persistent mount opts: ,errors=remount-ro +Parameters: mgsnode=192.168.1.203@tcp + +device size = 51200MB +formatting backing filesystem ldiskfs on /dev/vdc + target name temp:OST0000 + kilobytes 52428800 + options -J size=1024 -I 512 -i 69905 -q -O extents,uninit_bg,dir_nlink,quota,project,huge_file,^fast_commit,flex_bg -G 256 -E resize="4290772992",lazy_journal_init="0",lazy_itable_init="0" -F +mkfs_cmd = mke2fs -j -b 4096 -L temp:OST0000 -J size=1024 -I 512 -i 69905 -q -O extents,uninit_bg,dir_nlink,quota,project,huge_file,^fast_commit,flex_bg -G 256 -E resize="4290772992",lazy_journal_init="0",lazy_itable_init="0" -F /dev/vdc 52428800k +Writing CONFIGS/mountdata +$ sudo mkdir /mnt/lustre-ost1 +$ sudo mount -t lustre /dev/vdc /mnt/lustre-ost1 +``` + +可以按照同样的方法增加多块 OST, `--index`递增。 + +在 client 节点上,挂着 lustre 文件系统, 测试文件读写。 + +```bash +$ sudo mount -t lustre 192.168.1.203@tcp:/temp /mnt/lustre +$ mount +... +192.168.1.203@tcp:/temp on /mnt/lustre type lustre (rw,checksum,flock,nouser_xattr,lruresize,lazystatfs,nouser_fid2path,verbose,encrypt) +$ lfs df -h +UUID bytes Used Available Use% Mounted on +temp-MDT0000_UUID 44.4G 4.8M 40.4G 1% /mnt/lustre[MDT:0] +temp-OST0000_UUID 48.2G 1.2M 45.7G 1% /mnt/lustre[OST:0] + +filesystem_summary: 48.2G 1.2M 45.7G 1% /mnt/lustre + +$ echo "1234asdf"|sudo tee /mnt/lustre/testfile +1234asdf +$ cat /mnt/lustre/testfile +1234asdf +``` diff --git a/docs/zh/server/diversified_computing/dpu_offload/_toc.yaml b/docs/zh/server/diversified_computing/dpu_offload/_toc.yaml index 4c7e4732f1b09097d3ec38f8a4ec4bcb5ce2daf8..c15a55fc23a2c797aa6cc6aa7e50df4e850b3efa 100644 --- a/docs/zh/server/diversified_computing/dpu_offload/_toc.yaml +++ b/docs/zh/server/diversified_computing/dpu_offload/_toc.yaml @@ -1,10 +1,10 @@ +label: 直连聚合用户指南 isManual: true -label: '' +description: 介绍基于 openEuler 操作系统的容器管理面DPU无感卸载功能特性及安装部署方法 sections: - - label: '**1** 容器管理面无感卸载' - href: >- - ./container_management_plane_direct_connection_aggregation_environment_establishment.md - - label: '**1** 硬件准备' + - label: 直连聚合环境搭建 href: ./libvirt_direct_connection_aggregation_environment_establishment.md - - label: qtfs + - label: qtfs共享文件系统架构 href: ./qtfs_architecture_and_usage.md + - label: 容器管理面 DPU 无感卸载 + href: ./container_management_plane_direct_connection_aggregation_environment_establishment.md diff --git a/docs/zh/server/diversified_computing/dpu_offload/container_management_plane_direct_connection_aggregation_environment_establishment.md b/docs/zh/server/diversified_computing/dpu_offload/container_management_plane_direct_connection_aggregation_environment_establishment.md index 2bffc55992344b933451021e0d5d8c5e415e7909..c7712cd5da2c3c1d75a583b880ea91e102a09080 100644 --- a/docs/zh/server/diversified_computing/dpu_offload/container_management_plane_direct_connection_aggregation_environment_establishment.md +++ b/docs/zh/server/diversified_computing/dpu_offload/container_management_plane_direct_connection_aggregation_environment_establishment.md @@ -50,6 +50,7 @@ cd qtfs/ipc make -j UDS_TEST_MODE=1 && make install ``` + >![](./public_sys-resources/icon-note.gif) **说明:** >如果使用vsock模式,编译时不需要设置UDS_TEST_MODE @@ -103,27 +104,32 @@ nohup /usr/bin/udsproxyd 1 192.168.10.11 12121 192.168.10.10 12121 2>&1 & make role=client make install ``` + 在qtfs的server端执行 ```bash make role=server make install ``` + 配置工具将会自动安装,然后使用qtcfg命令配置白名单,假设需要增加的白名单为"/var/lib/docker",输入: ```bash qtcfg -w udsconnect -x /var/lib/docker ``` + 查询白名单为: ```bash qtcfg -w udsconnect -z ``` + 删除白名单为: ```bash qtcfg -w udsconnect -y 0 ``` + 删除白名单时,参数为查询白名单时列出来的index序号。 * 通过配置文件增加,这需要在qtfs或qtfs_server内核模块加载前配置,通过内核模块初始化时读取该文件进行白名单配置。 @@ -163,6 +169,7 @@ mkdir /var/run/rexec ``` rexec服务运行时底层通信使用unix socket,因此跨主机的rexec和rexec_server通信依赖上述udsproxyd服务,并且需要在udsproxy中添加相关白名单: + ```bash qtcfg -w udsconnect -x /var/run/rexec ``` @@ -171,7 +178,8 @@ qtcfg -w udsconnect -x /var/run/rexec server端可以通过两种方式拉起rexec_server服务。 -- 方式1: +* 方式1: + 配置systemd服务 在/usr/lib/systemd/system/下增加rexec.service文件,内容如下: @@ -194,7 +202,8 @@ systemctl stop rexec systemctl start rexec ``` -- 方式2: +* 方式2: + 手动后台拉起 ```bash @@ -221,9 +230,9 @@ nohup /usr/bin/rexec_server 2>&1 & >![](./public_sys-resources/icon-note.gif) **说明:** > -> 1. 在HOST端和DPU端,都要拉起rexec_server; -> 2. HOST端拉起rexec_server,主要是用于DPU创建容器时用rexec拉起containerd-shim; -> 3. DPU拉起rexec_server,则是为了执行containerd-shim对dockerd和containerd的调用。 +>1) 在HOST端和DPU端,都要拉起rexec_server; +>2) HOST端拉起rexec_server,主要是用于DPU创建容器时用rexec拉起containerd-shim; +>3) DPU拉起rexec_server,则是为了执行containerd-shim对dockerd和containerd的调用。 ## **4.1** 准备dockerd和containerd运行的rootfs @@ -249,11 +258,12 @@ yum install xz kpartx qemu-img #### 4.1.1.3 解压qcow2镜像 -使用xz -d解压为openEuler-22.03-LTS-.qcow2文件, 以x86镜像为例 +使用xz -d解压为openEuler-22.03-LTS-\.qcow2文件, 以x86镜像为例 ``` bash xz -d openEuler-22.03-LTS-x86_64.qcow2.xz ``` + #### 4.1.1.4 挂载qcow2镜像并拷贝文件 1. 使用`modprobe nbd maxpart=<任意数字>`来加载nbd模块 @@ -284,7 +294,7 @@ qemu-nbd -d /dev/nbd0 2. 清空`/another_rootfs/etc/yum.repos.d`中的文件,并将`/etc/yum.repos.d/`中的文件拷贝到`/another_rootfs/etc/yum.repos.d` 3. 使用`yum install <软件包> --installroot=/another_rootfs`来安装软件包 -``` +```bash yum install --installroot=/another_rootfs iptables ``` @@ -308,6 +318,7 @@ yum install --installroot=/another_rootfs iptables #!/bin/bash rexec /usr/bin/dockerd $* ``` + /usr/bin/containerd: ``` bash @@ -330,7 +341,7 @@ chmod +x /usr/bin/dockerd DPU根目录中(another_rootfs之外):安装iptables和libtool、libcgroup、tar,可以通过yum直接直接安装。 -``` +```bash yum install iptables libtool libcgroup tar ``` @@ -345,60 +356,60 @@ rpm -ivh iptables-1.8.7-5.oe2203.x86_64.rpm libtool-2.4.6-34.oe2203.x86_64.rpm e #### 4.3.2.2 another_rootfs环境配置 1. 在`/another_rootfs`中,需要安装iptables,这个是dockerd启动所必须的依赖 - -使用`yum install <软件包> --installroot=/another_rootfs`来安装软件包 + 使用`yum install <软件包> --installroot=/another_rootfs`来安装软件包 2. 并需要将rexec拷贝到`/another_rootfs/usr/bin`下面,并对其添加可执行权限 -``` bash -cp rexec /another_rootfs/usr/bin -chmod +x /another_rootfs/usr/bin/rexec -``` + ```bash + cp rexec /another_rootfs/usr/bin + chmod +x /another_rootfs/usr/bin/rexec + ``` 3. 另外,将根据社区docker源码与前述patch编译出来的containerd和dockerd拷贝到`/another_rootfs/usr/bin`下面, 将docker拷贝到`/usr/bin`下 -``` bash -cp {YOUR_PATH}/dockerd /another_rootfs/usr/bin -cp {YOUR_PATH}/containerd /another_rootfs/usr/bin -cp {YOUR_PATH}/docker /usr/bin -``` + ```bash + cp {YOUR_PATH}/dockerd /another_rootfs/usr/bin + cp {YOUR_PATH}/containerd /another_rootfs/usr/bin + cp {YOUR_PATH}/docker /usr/bin + ``` 4. 在`/another_rootfs`中删除/another_rootfs/usr/sbin/modprobe -``` bash -rm -f /another_rootfs/usr/sbin/modprobe -``` + ```bash + rm -f /another_rootfs/usr/sbin/modprobe + ``` 5. 在`/another_rootfs`中创建如下三个脚本 -containerd-shim创建路径:`/another_rootfs/usr/local/bin/containerd-shim` + containerd-shim创建路径:`/another_rootfs/usr/local/bin/containerd-shim` -``` bash -#!/bin/bash -/usr/bin/rexec /usr/bin/containerd-shim $* -``` + ```bash + #!/bin/bash + /usr/bin/rexec /usr/bin/containerd-shim $* + ``` -remote_kill创建路径:`/another_rootfs/usr/bin/remote_kill` + remote_kill创建路径:`/another_rootfs/usr/bin/remote_kill` -``` bash -#!/bin/bash -/usr/bin/rexec /usr/bin/kill $* -``` + ``` bash + #!/bin/bash + /usr/bin/rexec /usr/bin/kill $* + ``` -modprobe创建路径:`/another_rootfs/usr/sbin/modprobe` + modprobe创建路径:`/another_rootfs/usr/sbin/modprobe` -``` bash -#!/bin/bash -/usr/bin/rexec /usr/sbin/modprobe $* -``` + ``` bash + #!/bin/bash + /usr/bin/rexec /usr/sbin/modprobe $* + ``` -在创建完成后,为其赋予执行权限 + 在创建完成后,为其赋予执行权限 + + ``` bash + chmod +x /another_rootfs/usr/local/bin/containerd-shim + chmod +x /another_rootfs/usr/bin/remote_kill + chmod +x /another_rootfs/usr/sbin/modprobe + ``` -``` bash -chmod +x /another_rootfs/usr/local/bin/containerd-shim -chmod +x /another_rootfs/usr/bin/remote_kill -chmod +x /another_rootfs/usr/sbin/modprobe -``` #### 4.3.2.3 目录挂载 在DPU上执行此脚本[prepare.sh](./config/prepare.sh) ,将dockerd、containerd所需要的HOST目录挂载到DPU。 @@ -409,20 +420,22 @@ chmod +x /another_rootfs/usr/sbin/modprobe 在DPU上,打开两个窗口,并且都chroot到dockerd和containerd运行所需的/another_rootfs。 -``` bash +```bash chroot /another_rootfs ``` 在两个窗口中用如下的命令先拉起containerd,后拉起dockerd。 **containerd** -``` bash + +```bash #!/bin/bash SHIM_HOST=${YOUR_SERVER_IP} containerd --config /var/run/docker/containerd/containerd.toml --address /var/run/containerd/containerd.sock ``` **dockerd** -``` bash + +```bash #!/bin/bash # this need to be done once /usr/bin/rexec mount -t qtfs /var/lib/docker/overlay2 /another_rootfs/var/lib/docker/overlay2/ @@ -435,7 +448,7 @@ SHIM_HOST=${YOUR_SERVER_IP} /usr/bin/dockerd --containerd /var/run/containerd/co 如果需要卸载相关的目录,需要先删除已有容器,再关掉containerd、dockerd,并执行如下指令: -``` bash +```bash for i in `lsof | grep v1.linux | awk '{print $2}'` do kill -9 $i diff --git a/docs/zh/server/diversified_computing/dpu_offload/libvirt_direct_connection_aggregation_environment_establishment.md b/docs/zh/server/diversified_computing/dpu_offload/libvirt_direct_connection_aggregation_environment_establishment.md index fc8f61bb50d268abfaf81d9f69140e96d438794d..dcf064b6117536a4c62eee85055e6b066c889e2a 100644 --- a/docs/zh/server/diversified_computing/dpu_offload/libvirt_direct_connection_aggregation_environment_establishment.md +++ b/docs/zh/server/diversified_computing/dpu_offload/libvirt_direct_connection_aggregation_environment_establishment.md @@ -43,6 +43,7 @@ cd qtfs/ipc make -j UDS_TEST_MODE=1 && make install ``` + >如果使用vsock模式,编译时不需要设置UDS_TEST_MODE。 当前最新版本下,qtfs server侧的engine服务已经整合了udsproxyd的能力,所以server侧若部署了qtfs后不需要再额外启动udsproxyd。client侧则单独拉起udsproxyd服务: @@ -95,27 +96,32 @@ nohup /usr/bin/udsproxyd 1 192.168.10.11 12121 192.168.10.10 12121 2>&1 & make role=client make install ``` + 在qtfs的server端执行 ```bash make role=server make install ``` + 配置工具将会自动安装,然后使用qtcfg命令配置白名单,假设需要增加的白名单为"/var/lib/libvirt/",输入: ```bash qtcfg -w udsconnect -x /var/lib/libvirt/ ``` + 查询白名单为: ```bash qtcfg -w udsconnect -z ``` + 删除白名单为: ```bash qtcfg -w udsconnect -y 0 ``` + 删除白名单时,参数为查询白名单时列出来的index序号。 * 通过配置文件增加,这需要在qtfs或qtfs_server内核模块加载前配置,通过内核模块初始化时读取该文件进行白名单配置。 @@ -138,6 +144,7 @@ rexec是一个用c语言开发的远程执行组件,分为rexec client和rexec ```bash chmod 400 /etc/rexec/whitelist ``` + 如果想仅用于测试,可以不进行白名单配置,删除此文件重启rexec_server进程后则没有白名单限制。 下载dpu-utilities代码后,进入qtfs/rexec主目录下,执行:`make && make install`即可安装rexec所需全部二进制到/usr/bin目录下,包括了:`rexec、rexec_server`两个二进制可执行文件。 @@ -149,6 +156,7 @@ mkdir /var/run/rexec ``` rexec服务运行时底层通信使用unix socket,因此跨主机的rexec和rexec_server通信依赖上述udsproxyd服务,并且需要在udsproxy中添加相关白名单: + ```bash qtcfg -w udsconnect -x /var/run/rexec ``` @@ -157,7 +165,8 @@ qtcfg -w udsconnect -x /var/run/rexec server端可以通过两种方式拉起rexec_server服务。 -- 方式1: +* 方式1: + 配置systemd服务 在/usr/lib/systemd/system/下增加rexec.service文件,内容如下: @@ -174,7 +183,6 @@ systemctl daemon-reload systemctl enable --now rexec ``` - 后续重启新启动服务: ```bash @@ -183,7 +191,8 @@ systemctl stop rexec systemctl start rexec ``` -- 方式2: +* 方式2: + 手动后台拉起 ```bash @@ -235,6 +244,7 @@ mount --bind /root/new_root_origin /root/new_root ``` #### 3.4.2.2 安装libvirt + 此处介绍patch方式源码编译,如果计算提供rpm包则参考计算提供的安装方法。 a) 进入chroot环境,安装编译环境和常用工具: @@ -243,6 +253,7 @@ a) 进入chroot环境,安装编译环境和常用工具: yum groupinstall "Development tools" -y yum install -y vim meson qemu qemu-img strace edk2-aarch64 tar ``` + 其中edk2-aarch64是arm环境下虚拟机启动需要的。 b) 安装libvirt编译需要的依赖包: @@ -271,7 +282,7 @@ g) 安装成功。 ninja -C build install ``` -#### 3.4.2.3 启动libvirtd服务。 +#### 3.4.2.3 启动libvirtd服务 libvirt直连聚合卸载模式,需要从chroot内启动libvirtd服务,首先需要把chroot之外的libvirtd服务停掉。 @@ -283,9 +294,10 @@ b) 将udsproxyd编译时附带产生的libudsproxy.so拷贝到本chroot目录下 c) 将前面rexec编译产生的rexec二进制放置到本chroot的/usr/bin/目录下。 -d) 配置chroot的挂载环境,需要挂载一些目录,使用如下配置脚本: -- [virt_start.sh](./scripts/virt_start.sh)为配置脚本,virt_start.sh脚本中需要手动修改qtfs ko dir为编译的ko位置,HOST ip address为正确的HOST地址。 -- [virt_umount.sh](./scripts/virt_umount.sh)为消除配置脚本。 +d) 配置chroot的挂载环境,需要挂载一些目录,使用如下配置脚本: + +* [virt_start.sh](./scripts/virt_start.sh)为配置脚本,virt_start.sh脚本中需要手动修改qtfs ko dir为编译的ko位置,HOST ip address为正确的HOST地址。 +* [virt_umount.sh](./scripts/virt_umount.sh)为消除配置脚本。 e) 脚本中挂载目录位置都是按照本文档前文创建目录位置与名称为准,如果有修改需要同步适配修改脚本。 @@ -296,7 +308,8 @@ f) 配置好chroot环境后,进入chroot环境,手动拉起libvirtd。 ```bash LD_PRELOAD=/usr/lib64/libudsproxy.so virtlogd -d LD_PRELOAD=/usr/lib64/libudsproxy.so libvirtd -d -```` +``` + 如果已配置qtfs使用udsproxyd白名单,则不需要增加LD_PRELOAD前缀: ```bash @@ -332,7 +345,7 @@ mount -t qtfs /home/VMs /home/VMs c) xml中使用`/home/VMs/Domain_name`作为启动镜像,这样在DPU和HOST侧看到的都是同一个镜像文件(Domain_name是虚拟机domain的名字)。 -d) 检查xml中是否指向了跳板脚本。 +d) 检查xml中\是否指向了跳板脚本。 e) 执行。 @@ -342,16 +355,14 @@ virsh define xxx.xml ### 3.5.2 虚拟机start -``` +```bash virsh start domain ``` - # **4** 环境重置 由于libvirt在DPU和HOST之间共享了部分目录,卸载环境时需要先将这部分目录全部umount。一般先停掉libvirtd和virtlogd进程,调用virt_umount脚本即可。如果HOST还有虚拟机运行,也需要先杀掉才能umount。 - # **5** 部分问题定位思路 1. libvirt编译失败:检查依赖包安装是否完全,如果chroot挂载了外部目录或者HOST目录,也可能导致编译失败,需先解除挂载。 diff --git a/docs/zh/server/diversified_computing/dpu_offload/qtfs_architecture_and_usage.md b/docs/zh/server/diversified_computing/dpu_offload/qtfs_architecture_and_usage.md index a1a177539459102cb3088908f973aef7945a4301..5de656e9f0def5be5a524b93ed58148a1d588e1c 100644 --- a/docs/zh/server/diversified_computing/dpu_offload/qtfs_architecture_and_usage.md +++ b/docs/zh/server/diversified_computing/dpu_offload/qtfs_architecture_and_usage.md @@ -54,23 +54,22 @@ qtfs的特性: 启动vm时为vm配置vsock通道,vm可参考如下配置,增加vsock段置: -``` - - ... - - - -
- - ... +```text + + ... + + + +
+ + ... ``` 其他依赖: - 1. 要求内核版本在5.10或更高版本。 - - 2. 安装内核开发包:yum install kernel-devel json-c-devel。 +1. 要求内核版本在5.10或更高版本。 +2. 安装内核开发包:yum install kernel-devel json-c-devel。 服务端编译安装: @@ -100,8 +99,8 @@ qtfs的特性: 其他注意事项: - 1. udsproxyd目前也支持vsock和测试模式两种,使用vsock模式时,不能带UDS_TEST_MODE=1进行编译。 - 2. 如果vsock不通,需要检查host是否插入了vhost_vsock内核模块:modprobe vhost_vsock。 +1. udsproxyd目前也支持vsock和测试模式两种,使用vsock模式时,不能带UDS_TEST_MODE=1进行编译。 +2. 如果vsock不通,需要检查host是否插入了vhost_vsock内核模块:modprobe vhost_vsock。 ### 测试模式 - 网络通信通道 @@ -124,7 +123,7 @@ qtfs的特性: 7. engine参数解释:engine ${number_of_threads} ${uds_proxy_thread_number} ${server_cid_or_ip} ${server_uds_proxy_port} ${client_cid_or_ip} ${client_uds_proxy_port} ``` - Tips: 该模式暴露网络端口,有可能造成安全隐患,仅能用于功能验证测试,勿用于实际生产环境。 +Tips: 该模式暴露网络端口,有可能造成安全隐患,仅能用于功能验证测试,勿用于实际生产环境。 客户端安装: @@ -137,10 +136,10 @@ qtfs的特性: 5. make clean && make UDS_TEST_MODE=1 && make install 6. nohup udsproxyd 1 192.168.10.11 12121 192.168.10.10 12121 2>&1 & 7. udsproxyd参数解释:udsproxyd ${uds_proxy_thread_number} ${client_cid_or_ip} ${client_uds_proxy_port} ${server_cid_or_ip} ${server_uds_proxy_port} - Tips:这里插入ko的cid和port配置为与server端一致即可,udsproxyd的cid + port与server端交换位置。 +Tips:这里插入ko的cid和port配置为与server端一致即可,udsproxyd的cid + port与server端交换位置。 ``` - Tips: 该模式暴露网络端口,有可能造成安全隐患,仅能用于功能验证测试,勿用于实际生产环境。 +Tips: 该模式暴露网络端口,有可能造成安全隐患,仅能用于功能验证测试,勿用于实际生产环境。 ## 使用说明 @@ -152,7 +151,7 @@ qtfs的特性: 客户端进入"/root/mnt"后便可查看到server端/目录下的所有文件,以及对其进行相关操作。此操作受到白名单的控制,需要挂载路径在server端白名单的Mount列表,或者在其子目录下,且后续的查看或读写操作都需要开放对应的白名单项才能进行。 - Tips:若完成测试环境的配置后,无法通过客户端访问所挂载的客户端文件,可检查是否由防火墙的阻断导致。 +Tips:若完成测试环境的配置后,无法通过客户端访问所挂载的客户端文件,可检查是否由防火墙的阻断导致。 ## qtfs查询及控制工具 @@ -192,8 +191,8 @@ qtfs提供的协同文件系统、协同IPC等能力尽可能做到系统通用 通过这种方案可大幅提升管理面卸载的兼容性,方便后续版本升级;另外该方案具备一定通用性,可适配虚拟化管理面卸载和容器管理面卸载等场景。 - Tips:不同场景管理面进程使用qtfs进行无感卸载时,仍需要进行代码适配,用户需要具备场景专业知识,对管理代码工具进行适配,并使用合适的qtfs配置。 +Tips:不同场景管理面进程使用qtfs进行无感卸载时,仍需要进行代码适配,用户需要具备场景专业知识,对管理代码工具进行适配,并使用合适的qtfs配置。 -本文档后续章节介绍两个管理面工具无感卸载的推荐场景:[虚拟化管理面DPU无感卸载](libvirt直连聚合环境搭建.md)及[容器管理面DPU无感卸载](./容器管理面直连聚合环境搭建.md)。 +本文档后续章节介绍两个管理面工具无感卸载的推荐场景:[虚拟化管理面DPU无感卸载](./libvirt_direct_connection_aggregation_environment_establishment.md)及[容器管理面DPU无感卸载](./container_management_plane_direct_connection_aggregation_environment_establishment.md)。 - Tips:上述无感卸载指导文档中提供的libvirt及docker适配patch仅供参考,不可用于商用环境;用户应基于自己的实际场景进行对应代码修改适配。 +Tips:上述无感卸载指导文档中提供的libvirt及docker适配patch仅供参考,不可用于商用环境;用户应基于自己的实际场景进行对应代码修改适配。 diff --git a/docs/zh/server/high_availability/ha/_toc.yaml b/docs/zh/server/high_availability/ha/_toc.yaml index 5821242eb4d1069a1aefe2a03ff150d5130b807d..86f55cef013a1d7a7fb12b829756b32bd6ed4e76 100644 --- a/docs/zh/server/high_availability/ha/_toc.yaml +++ b/docs/zh/server/high_availability/ha/_toc.yaml @@ -1,7 +1,8 @@ +label: HA 用户指南 isManual: true -label: '' +description: 安装和使用 HA 高可用集群 sections: - - label: HA的安装与部署 + - label: HA 安装与部署 href: ./ha_installation_and_deployment.md - - label: HA使用实例 + - label: HA 使用实例 href: ./ha_usecase_examples.md diff --git a/docs/zh/server/high_availability/ha/ha_installation_and_deployment.md b/docs/zh/server/high_availability/ha/ha_installation_and_deployment.md index 60b60ad88fd35b4198b7386d2785d9ae2598ff32..6a83428820ae1987ef53412fe9510d37fa2310fc 100644 --- a/docs/zh/server/high_availability/ha/ha_installation_and_deployment.md +++ b/docs/zh/server/high_availability/ha/ha_installation_and_deployment.md @@ -2,23 +2,6 @@ 本章介绍如何安装和部署HA高可用集群。 - -- [HA的安装与部署](#ha的安装与部署) - - [安装与部署](#安装与部署) - - [修改主机名称及/etc/hosts文件](#修改主机名称及etchosts文件) - - [配置yum源](#配置yum源) - - [安装HA软件包组件](#安装ha软件包组件) - - [设置hacluster用户密码](#设置hacluster用户密码) - - [修改`/etc/corosync/corosync.conf`文件](#修改etccorosynccorosyncconf文件) - - [管理服务](#管理服务) - - [关闭防火墙](#关闭防火墙) - - [管理pcs服务](#管理pcs服务) - - [管理pacemaker服务](#管理pacemaker服务) - - [管理corosync服务](#管理corosync服务) - - [节点鉴权](#节点鉴权) - - [访问前端管理平台](#访问前端管理平台) - - ## 安装与部署 - 环境准备:需要至少两台安装了openEuler 22.03 LTS SP4的物理机/虚拟机(现以两台为例),安装方法参考《openEuler 22.03 LTS SP4 安装指南》。 @@ -211,4 +194,4 @@ nodelist { ![](./figures/HA-api.png) -- 下一章将介绍如何快速使用HA高可用集群,以及添加一个实例。请参考[HA的使用实例文档](./HA的使用实例.md\)。 +- 下一章将介绍如何快速使用HA高可用集群,以及添加一个实例。请参考[HA的使用实例文档](./ha_usecase_examples.md)。 diff --git a/docs/zh/server/high_availability/ha/ha_usecase_examples.md b/docs/zh/server/high_availability/ha/ha_usecase_examples.md index 4cca7b2fdbde127e25d0f2414ec5ae45f4470dd7..99423a382233f750e0757960310305078950bc40 100644 --- a/docs/zh/server/high_availability/ha/ha_usecase_examples.md +++ b/docs/zh/server/high_availability/ha/ha_usecase_examples.md @@ -1,40 +1,19 @@ # HA使用实例 -本章介绍如何快速使用HA高可用集群,以及添加一个实例。若不了解怎么安装,请参考[HA的安装与部署文档](./HA的安装与部署.md\)。 - - - - [HA使用实例](#HA使用与实例) - - [快速使用指南](#快速使用指南) - - [登录页面](#登录页面) - - [主页面](#主页面) - - [导航栏](#导航栏) - - [顶部操作区](#顶部操作区) - - [资源节点列表区](#资源节点列表区) - - [节点操作浮动区](#节点操作浮动区) - - [首选项配置](#首选项配置) - - [添加资源](#添加资源) - - [添加普通资源](#添加普通资源) - - [添加组资源](#添加组资源) - - [添加克隆资源](#添加克隆资源) - - [编辑资源](#编辑资源) - - [设置资源关系](#设置资源关系) - - [高可用mysql实例配置](#高可用mysql实例配置) - - [配置虚拟IP](#配置虚拟ip) - - [配置NFS存储](#配置nfs存储) - - [配置mysql](#配置mysql) - - [添加上述资源为组资源](#添加上述资源为组资源) - +本章介绍如何快速使用HA高可用集群,以及添加一个实例。若不了解怎么安装,请参考《[HA的安装与部署文档](./ha_installation_and_deployment.md)》。 ## 快速使用指南 - 以下操作均以社区新开发的管理平台为例。 ### 登录页面 + 用户名为`hacluster`,密码为该用户在主机上设置的密码。 ![](./figures/HA-api.png) ### 主页面 + 登录系统后显示主页面,主页面由四部分组成:侧边导航栏、顶部操作区、资源节点列表区以及节点操作浮动区。 以下将详细介绍这四部分的特点与使用方法。 @@ -42,63 +21,77 @@ ![](./figures/HA-home-page.png) #### 导航栏 + 侧边导航栏由两部分组成:高可用集群软件名称和 logo 以及系统导航。系统导航由三项组成:【系统】、【集群配置】和【工具】。【系统】是默认选项,也是主页面的对应项,主要展示系统中所有资源的相关信息以及操作入口;【集群配置】下设【首选项配置】和【心跳配置】两项;【工具】下设【日志下载】和【集群快捷操作】两项,点击后以弹出框的形式出现。 #### 顶部操作区 + 登录用户是静态显示,鼠标滑过用户图标,出现操作菜单项,包括【刷新设置】和【退出登录】两项,点击【刷新设置】,弹出【刷新设置】对话框,包含【刷新设置】选项,可以设置系统的自动刷新模式,包括【不自动刷新】、【每 5 秒刷新】和【每 10 秒刷新】三种选择,默认选择【不自动刷新】、【退出登录】即可注销本次登录,系统将自动跳到登录页面,此时,如果希望继续访问系统,则需要重新进行登录。 ![](./figures/HA-refresh.png) #### 资源节点列表区 + 资源节点列表集中展现系统中所有资源的【资源名】、【状态】、【资源类型】、【服务】、【运行节点】等资源信息,以及系统中所有的节点和节点的运行情况等节点信息。同时提供资源的【添加】、【编辑】、【启动】、【停止】、【清理】、【迁移】、【回迁】、【删除】和【关系】操作。 #### 节点操作浮动区 + 节点操作浮动区域默认是收起的状态,每当点击资源节点列表表头中的节点时,右侧会弹出节点操作扩展区域,如图所示,该区域由收起按钮、节点名称、停止和备用四个部分组成,提供节点的【停止】和【备用】操作。点击区域左上角的箭头,该区域收起。 ### 首选项配置 + 以下操作均可用命令行配置,现只做简单示例,若想使用更多命令可以使用``pcs --help``进行查询。 -``` +```sh # pcs property set stonith-enabled=false # pcs property set no-quorum-policy=ignore ``` + ``pcs property``查看全部设置 ![](./figures/HA-firstchoice-cmd.png) -- 点击侧边导航栏中的【首选项配置】按钮,弹出【首选项配置】对话框。将No Quorum Policy和Stonith Enabled由默认状态改为如下对应状态;修改完成后,点击【确定】按钮完成配置。 +- 点击侧边导航栏中的【首选项配置】按钮,弹出【首选项配置】对话框。将No Quorum Policy和Stonith Enabled由默认状态改为如下对应状态;修改完成后,点击【确定】按钮完成配置。 ![](./figures/HA-firstchoice.png) #### 添加资源 + ##### 添加普通资源 + 鼠标点击【添加普通资源】,弹出【创建资源】对话框,其中资源的所有必填配置项均在【基本】页面内,选择【基本】页面内的【资源类型】后会进一步给出该类资源的其他必填配置项以及选填配置项。填写资源配置信息时,对话框右侧会出现灰色文字区域,对当前的配置项进行解释说明。全部必填项配置完毕后,点击【确定】按钮即可创建普通资源,点击【取消】按钮,取消本次添加动作。【实例属性】、【元属性】或者【操作属性】页面中的选填配置项为选填项,不配置不会影响资源的创建过程,可以根据场景需要可选择修改,否则将按照系统默认值处理。 下面以apache为例,添加apache资源 -``` + +```sh # pcs resource create httpd ocf:heartbeat:apache ``` + 查看资源运行状态 -``` + +```sh # pcs status ``` ![](./figures/HA-pcs-status.png) -- 添加apache资源 +- 添加apache资源 ![](./figures/HA-add-resource.png) -- 若回显为如下,则资源添加成功 + +- 若回显为如下,则资源添加成功 ![](./figures/HA-apache-suc.png) -- 资源创建成功并启动,运行于其中一个节点上,例如ha1;成功访问apache界面。 + +- 资源创建成功并启动,运行于其中一个节点上,例如ha1;成功访问apache界面。 ![](./figures/HA-apache-show.png) ##### 添加组资源 + 添加组资源时,集群中需要至少存在一个普通资源。鼠标点击【添加组资源】,弹出【创建资源】对话框。【基本】页面内均为必填项,填写完毕后,点击【确定】按钮,即可完成资源的添加,点击【取消】按钮,取消本次添加动作。 -- **注:组资源的启动是按照子资源的顺序启动的,所以选择子资源时需要注意按照顺序选择。** +- **注:组资源的启动是按照子资源的顺序启动的,所以选择子资源时需要注意按照顺序选择。** ![](./figures/HA-group.png) @@ -107,6 +100,7 @@ ![](./figures/HA-group-suc.png) ##### 添加克隆资源 + 鼠标点击【添加克隆资源】,弹出【创建资源】对话框。【基本】页面内填写克隆对象,资源名称会自动生成,填写完毕后,点击【确定】按钮,即可完成资源的添加,点击【取消】按钮,取消本次添加动作。 ![](./figures/HA-clone.png) @@ -114,101 +108,124 @@ 若回显为如下,则资源添加成功 ![](./figures/HA-clone-suc.png) + #### 编辑资源 -- 启动资源:资源节点列表中选中一个目标资源,要求:该资源处于非运行状态。对该资源执行启动动作。 -- 停止资源:资源节点列表中选中一个目标资源,要求:该资源处于运行状态。对该资源执行停止操作。 -- 清理资源:资源节点列表中选中一个目标资源,对该资源执行清理操作。 -- 迁移资源:资源节点列表中选中一个目标资源,要求:该资源为处于运行状态的普通资源或者组资源,执行迁移操作可以将资源迁移到指定节点上运行。 -- 回迁资源:资源节点列表中选中一个目标资源,要求:该资源已经完成迁移动作,执行回迁操作,可以清除该资源的迁移设置,资源重新迁回到原来的节点上运行。 -点击按钮后,列表中该资源项的变化状态与启动资源时一致。 -- 删除资源:资源节点列表中选中一个目标资源,对该资源执行删除操作。 + +- 启动资源:资源节点列表中选中一个目标资源,要求:该资源处于非运行状态。对该资源执行启动动作。 +- 停止资源:资源节点列表中选中一个目标资源,要求:该资源处于运行状态。对该资源执行停止操作。 +- 清理资源:资源节点列表中选中一个目标资源,对该资源执行清理操作。 +- 迁移资源:资源节点列表中选中一个目标资源,要求:该资源为处于运行状态的普通资源或者组资源,执行迁移操作可以将资源迁移到指定节点上运行。 +- 回迁资源:资源节点列表中选中一个目标资源,要求:该资源已经完成迁移动作,执行回迁操作,可以清除该资源的迁移设置,资源重新迁回到原来的节点上运行。点击按钮后,列表中该资源项的变化状态与启动资源时一致。 +- 删除资源:资源节点列表中选中一个目标资源,对该资源执行删除操作。 #### 设置资源关系 + 资源关系即为目标资源设定限制条件,资源的限制条件分为三种:资源位置、资源协同和资源顺序。 -- 资源位置:设置集群中的节点对于该资源的运行级别,由此确定启动或者切换时资源在哪个节点上运行,运行级别按照从高到低的顺序依次为:Master Node、Slave 1。 -- 资源协同:设置目标资源与集群中的其他资源是否运行在同一节点上,同节点资源表示该资源与目标资源必须运行在相同节点上,互斥节点资源表示该资源与目标资源不能运行在相同的节点上。 -- 资源顺序:设置目标资源与集群中的其他资源启动时的先后顺序,前置资源是指目标资源运行之前,该资源必须已经运行;后置资源是指目标资源运行之后,该资源才能运行。 + +- 资源位置:设置集群中的节点对于该资源的运行级别,由此确定启动或者切换时资源在哪个节点上运行,运行级别按照从高到低的顺序依次为:Master Node、Slave 1。 +- 资源协同:设置目标资源与集群中的其他资源是否运行在同一节点上,同节点资源表示该资源与目标资源必须运行在相同节点上,互斥节点资源表示该资源与目标资源不能运行在相同的节点上。 +- 资源顺序:设置目标资源与集群中的其他资源启动时的先后顺序,前置资源是指目标资源运行之前,该资源必须已经运行;后置资源是指目标资源运行之后,该资源才能运行。 ## 高可用mysql实例配置 + - 先单独配置三个普通资源,待成功后添加为组资源。 + ### 配置虚拟IP + 在首页中点击添加-->添加普通资源,并按如下进行配置。 ![](./figures/HA-vip.png) -- 资源创建成功并启动,运行于其中一个节点上,例如ha1;可以ping通并连接,登录后可正常执行各种操作;资源切换到ha2运行;能够正常访问。 -- 若回显为如下,则资源添加成功 +- 资源创建成功并启动,运行于其中一个节点上,例如ha1;可以ping通并连接,登录后可正常执行各种操作;资源切换到ha2运行;能够正常访问。 +- 若回显为如下,则资源添加成功。 ![](./figures/HA-vip-suc.png) ### 配置NFS存储 -- 另外找一台机器作为nfs服务端进行配置 + +- 另外找一台机器作为nfs服务端进行配置。 安装软件包 -``` +```sh # yum install -y nfs-utils rpcbind ``` + 关闭防火墙 -``` + +```sh # systemctl stop firewalld && systemctl disable firewalld ``` + 修改/etc/selinux/config文件中SELINUX状态为disabled -``` + +```sh # SELINUX=disabled ``` + 启动服务 -``` + +```sh # systemctl start rpcbind && systemctl enable rpcbind # systemctl start nfs-server && systemctl enable nfs-server ``` + 服务端创建一个共享目录 -``` + +```sh # mkdir -p /test ``` + 修改NFS配置文件 -``` + +```sh # vim /etc/exports # /test *(rw,no_root_squash) ``` + 重新加载服务 -``` + +```sh # systemctl reload nfs ``` 客户端安装软件包,先把mysql安装上,为了把下面nfs挂载到mysql数据路径 -``` + +```sh # yum install -y nfs-utils mariadb-server ``` + 在首页中点击添加-->添加普通资源,并按如下进行配置NFS资源。 ![](./figures/HA-nfs.png) -- 资源创建成功并启动,运行于其中一个节点上,例如ha1;nfs成功挂载到/var/lib/mysql路径下。资源切换到ha2运行;nfs从ha1节点取消挂载,并自动在ha2节点上挂载成功。 -- 若回显为如下,则资源添加成功 +- 资源创建成功并启动,运行于其中一个节点上,例如ha1;nfs成功挂载到/var/lib/mysql路径下。资源切换到ha2运行;nfs从ha1节点取消挂载,并自动在ha2节点上挂载成功。 +- 若回显为如下,则资源添加成功。 ![](./figures/HA-nfs-suc.png) ### 配置mysql + 在首页中点击添加-->添加普通资源,并按如下进行配置mysql资源。 ![](./figures/HA-mariadb.png) -- 若回显为如下,则资源添加成功 +- 若回显为如下,则资源添加成功 ![](./figures/HA-mariadb-suc.png) ### 添加上述资源为组资源 -- 按资源启动顺序添加三个资源 + +- 按资源启动顺序添加三个资源 在首页中点击添加-->添加组资源,并按如下进行配置组资源。 ![](./figures/HA-group-new.png) -- 组资源创建成功并启动,若回显与上述三个普通资源成功现象一致,则资源添加成功 +- 组资源创建成功并启动,若回显与上述三个普通资源成功现象一致,则资源添加成功 ![](./figures/HA-group-new-suc.png) -- 将ha1节点备用,成功迁移到ha2节点,运行正常 +- 将ha1节点备用,成功迁移到ha2节点,运行正常 -![](./figures/HA-group-new-suc2.png) \ No newline at end of file +![](./figures/HA-group-new-suc2.png) diff --git a/docs/zh/server/installation_upgrade/installation/_toc.yaml b/docs/zh/server/installation_upgrade/installation/_toc.yaml index 8985d1195e70fdbfb7d3b8406ee029c12745c6d2..4673d04456b8df88823d640c6c13087660845d21 100644 --- a/docs/zh/server/installation_upgrade/installation/_toc.yaml +++ b/docs/zh/server/installation_upgrade/installation/_toc.yaml @@ -1,29 +1,27 @@ +label: 安装指南 isManual: true -label: '' +description: 安装 openEuler 操作系统 sections: - - label: FAQ - href: ./faq.md - - label: FAQ - href: ./faq_1.md - - label: 安装指南 - href: ./installation.md - - label: 安装指导 - href: ./installation_guide.md - - label: 安装指导 - href: ./installation_guide_1.md - - label: 安装方式介绍 - href: ./installation_modes.md - - label: 安装方式介绍 - href: ./installation_modes_1.md - label: 安装在服务器 href: ./installation_on_servers.md - - label: 安装准备 - href: ./installation_preparations.md - - label: 安装准备 - href: ./installation_preparations_1.md + sections: + - label: 安装准备 + href: ./installation_preparations.md + - label: 安装方式介绍 + href: ./installation_modes.md + - label: 安装指导 + href: ./installation_guide.md + - label: 使用kickstart自动化安装 + href: ./using_kickstart_for_automatic_installation.md - label: 安装在树莓派 href: ./install_pi.md - - label: 参考资料 - href: ./more_resources.md - - label: 使用kickstart自动化安装 - href: ./using_kickstart_for_automatic_installation.md + sections: + - label: 安装准备 + href: ./installation_preparations_1.md + - label: 安装方式介绍 + href: ./installation_modes_1.md + - label: 安装指导 + href: ./installation_guide_1.md + - label: 更多资源 + href: ./more_resources.md + diff --git a/docs/zh/server/installation_upgrade/installation/installation.md b/docs/zh/server/installation_upgrade/installation/installation.md deleted file mode 100644 index 73d369e0dabf5156dd4b7d120a8d93331981a7c6..0000000000000000000000000000000000000000 --- a/docs/zh/server/installation_upgrade/installation/installation.md +++ /dev/null @@ -1,5 +0,0 @@ -# 安装指南 - -本文档主要介绍openEuler操作系统安装方法,以指导用户顺利完成openEuler操作系统安装。 - -本文档适用于所有使用openEuler操作系统的用户,特别是初次使用或想了解openEuler的用户,包括系统工程师、管理员及维护人员等。使用本手册的用户需要具备基础的Linux系统管理知识。 diff --git a/docs/zh/server/installation_upgrade/installation/installation_guide_1.md b/docs/zh/server/installation_upgrade/installation/installation_guide_1.md index 670010ca8f69368492a80913c7d1fc1427415abc..104340c6a0726f4513037124146f1326ce486f1c 100644 --- a/docs/zh/server/installation_upgrade/installation/installation_guide_1.md +++ b/docs/zh/server/installation_upgrade/installation/installation_guide_1.md @@ -1,16 +1,6 @@ # 安装指导 -本章介绍将“[树莓派镜像刷写入 SD 卡](./安装方式介绍-1.html)”后,启用树莓派的主要过程。 - - -- [安装指导](#安装指导) - - [启动系统](#启动系统) - - [登录系统](#登录系统) - - [配置系统](#配置系统) - - [扩展根目录分区](#扩展根目录分区) - - [连接 WIFI](#连接-wifi) - - +本章介绍将“[树莓派镜像刷写入 SD 卡](./installation_modes_1.md)”后,启用树莓派的主要过程。 ## 启动系统 @@ -22,11 +12,11 @@ 登录树莓派有以下两种方式: -1. 本地登录 +1. 本地登录 树莓派连接显示器(树莓派视频输出接口为 Micro HDMI)、键盘、鼠标后,启动树莓派,可以看到树莓派启动日志输出到显示器上。待树莓派启动成功,输入用户名(root)和密码(openeuler)登录。 -2. ssh 远程登录 +2. ssh 远程登录 树莓派默认采用 DHCP 的方式自动获取 IP。如果树莓派连接已知路由器,可登录路由器查看,新增的 IP 即为树莓派 IP。例如,树莓派对应 IP 为:192.168.31.109,使用命令 `ssh root@192.168.31.109` 后输入密码 `openeuler`,即可远程登录树莓派。 @@ -38,9 +28,9 @@ 请按照以下步骤扩展根目录分区: -1. 在 root 权限下执行 `fdisk -l` 命令查看磁盘分区信息。命令和回显如下: +1. 在 root 权限下执行 `fdisk -l` 命令查看磁盘分区信息。命令和回显如下: - ``` + ```sh # fdisk -l Disk /dev/mmcblk0: 14.86 GiB, 15931539456 bytes, 31116288 sectors Units: sectors of 1 * 512 = 512 bytes @@ -48,13 +38,13 @@ I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0xf2dc3842 - + Device Boot Start End Sectors Size Id Type /dev/mmcblk0p1 * 8192 593919 585728 286M c W95 FAT32 (LBA) /dev/mmcblk0p2 593920 1593343 999424 488M 82 Linux swap / Solaris /dev/mmcblk0p3 1593344 5044223 3450880 1.7G 83 Linux ``` - + SD 卡对应盘符为 /dev/mmcblk0,包括 3 个分区,分别为: - /dev/mmcblk0p1:引导分区 @@ -63,32 +53,32 @@ 这里我们需要将根目录分区 `/dev/mmcblk0p3` 进行扩容。 -2. 在 root 权限下执行 `fdisk /dev/mmcblk0` 命令进入到交互式命令行界面,按照以下步骤扩展分区,如[图 1](#zh-cn_topic_0151920806_f6ff7658b349942ea87f4521c0256c315)所示。 +2. 在 root 权限下执行 `fdisk /dev/mmcblk0` 命令进入到交互式命令行界面,按照以下步骤扩展分区,如[图 1](#zh-cn_topic_0151920806_f6ff7658b349942ea87f4521c0256c315)所示。 - 1. 输入 `p`,查看分区信息。 + 1. 输入 `p`,查看分区信息。 记录分区 `/dev/mmcblk0p3` 的起始扇区号,即 `/dev/mmcblk0p3` 分区信息中 `Start` 列的值,示例中为 `1593344`。 - 2. 输入 `d`,删除分区。 - 3. 输入 `3` 或直接按 `Enter`,删除序号为 `3` 的分区,即 `/dev/mmcblk0p3` 分区。 - 4. 输入 `n`,创建新的分区。 - 5. 输入 `p` 或直接按 `Enter`,创建 `Primary` 类型的分区。 - 6. 输入 `3` 或直接按 `Enter`,创建序号为 `3` 的分区,即 `/dev/mmcblk0p3` 分区。 - 7. 输入新分区的起始扇区号,即第 `1` 步中记录的起始扇区号,示例中为 `1593344`。 + 2. 输入 `d`,删除分区。 + 3. 输入 `3` 或直接按 `Enter`,删除序号为 `3` 的分区,即 `/dev/mmcblk0p3` 分区。 + 4. 输入 `n`,创建新的分区。 + 5. 输入 `p` 或直接按 `Enter`,创建 `Primary` 类型的分区。 + 6. 输入 `3` 或直接按 `Enter`,创建序号为 `3` 的分区,即 `/dev/mmcblk0p3` 分区。 + 7. 输入新分区的起始扇区号,即第 `1` 步中记录的起始扇区号,示例中为 `1593344`。 >![](./public_sys-resources/icon-notice.gif) **须知:** >请勿直接按“Enter”或使用默认参数。 - 8. 按 `Enter`,使用默认的最后一个扇区号作为新分区的终止扇区号。 - 9. 输入 `N`,不修改扇区标记。 + 8. 按 `Enter`,使用默认的最后一个扇区号作为新分区的终止扇区号。 + 9. 输入 `N`,不修改扇区标记。 10. 输入 `w`,保存分区设置并退出交互式命令行界面。 **图 1** 分区扩容 ![](./figures/Partition_expansion.png) -3. 在 root 权限下执行 `fdisk -l` 命令查看磁盘分区信息,以确保磁盘分区正确。命令和回显如下: - - ``` +3. 在 root 权限下执行 `fdisk -l` 命令查看磁盘分区信息,以确保磁盘分区正确。命令和回显如下: + + ```sh # fdisk -l Disk /dev/mmcblk0: 14.86 GiB, 15931539456 bytes, 31116288 sectors Units: sectors of 1 * 512 = 512 bytes @@ -96,15 +86,15 @@ I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0xf2dc3842 - + Device Boot Start End Sectors Size Id Type /dev/mmcblk0p1 * 8192 593919 585728 286M c W95 FAT32 (LBA) /dev/mmcblk0p2 593920 1593343 999424 488M 82 Linux swap / Solaris /dev/mmcblk0p3 1593344 31116287 29522944 14.1G 83 Linux ``` -4. 在 root 权限下执行 `resize2fs /dev/mmcblk0p3`,增大未加载的文件系统大小。 -5. 执行 `df -lh` 命令查看磁盘空间信息,以确保根目录分区已扩展。 +4. 在 root 权限下执行 `resize2fs /dev/mmcblk0p3`,增大未加载的文件系统大小。 +5. 执行 `df -lh` 命令查看磁盘空间信息,以确保根目录分区已扩展。 >![](./public_sys-resources/icon-notice.gif) **须知:** >如果根目录分区未扩展,可执行 `reboot` 命令重启树莓派之后再在 root 权限下执行 `resize2fs /dev/mmcblk0p3`。 @@ -113,13 +103,13 @@ 请按照以下步骤连接 WIFI: -1. 查看 IP 和网卡信息。 - +1. 查看 IP 和网卡信息。 + `ip a` 获取无线网卡 wlan0 信息: - - ``` + + ```sh 1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo @@ -136,25 +126,25 @@ link/ether e2:e6:99:89:47:0c brd ff:ff:ff:ff:ff:ff ``` -2. 扫描可以连接的 WIFI 信息。 +2. 扫描可以连接的 WIFI 信息。 `nmcli dev wifi` -3. 连接 WIFI。 +3. 连接 WIFI。 在 root 权限下执行 `nmcli dev wifi connect SSID password PWD` 命令连接 WIFI。 其中,`SSID` 为上一步扫描到的可供连接的 WIFI 的 SSID,`PWD` 为对应 WIFI 的密码。例如,`SSID` 为 `openEuler-wifi`,密码为 `12345678`,则连接该 WIFI 命令为:`nmcli dev wifi connect openEuler-wifi password 12345678`,连接成功: - ``` + ```sh Device 'wlan0' successfully activated with '26becaab-4adc-4c8e-9bf0-1d63cf5fa3f1'. ``` -4. 查看 IP 和无线网卡信息。 +4. 查看 IP 和无线网卡信息。 `ip a` - ``` + ```sh 1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo diff --git a/docs/zh/server/installation_upgrade/installation/installation_modes.md b/docs/zh/server/installation_upgrade/installation/installation_modes.md index 878e7339179c66cecadb5a406c59a3484bfab775..4b4f618adf6a5d44f66e1b114a207b7ae510222b 100644 --- a/docs/zh/server/installation_upgrade/installation/installation_modes.md +++ b/docs/zh/server/installation_upgrade/installation/installation_modes.md @@ -1,26 +1,9 @@ # 安装方式介绍 ->![](./public_sys-resources/icon-notice.gif) **须知:** ->- 硬件服务器仅支持Taishan 200服务器和FusionServer Pro 机架服务器,具体支持的服务器型号可参考“[硬件兼容支持](./安装准备.html#硬件兼容支持)”;虚拟化平台仅支持openEuler自有的虚拟化组件(HostOS为openEuler,虚拟化组件为发布包中的qemu、KVM)创建的虚拟化平台和华为公有云的x86虚拟化平台。 ->- 安装方式当前仅支持光盘、USB盘安装、网络安装、qcow2镜像安装和私有镜像安装。其中仅华为公有云的x86虚拟化平台支持私有镜像安装。 - - -- [安装方式介绍](#安装方式介绍) - - [通过光盘安装](#通过光盘安装) - - [准备安装源](#准备安装源) - - [启动安装](#启动安装) - - [通过USB盘安装](#通过usb盘安装) - - [准备安装源](#准备安装源-1) - - [启动安装](#启动安装-1) - - [使用PXE通过网络安装](#使用pxe通过网络安装) - - [通过qcow2镜像安装](#通过qcow2镜像安装) - - [制作qcow2镜像](#制作qcow2镜像) - - [启动安装](#启动安装-2) - - [通过私有镜像安装](#通过私有镜像安装) - - [制作私有镜像](#制作私有镜像) - - [启动安装](#启动安装-3) - - +>![](./public_sys-resources/icon-notice.gif) **须知:** +> +>- 硬件服务器仅支持Taishan 200服务器和FusionServer Pro 机架服务器,具体支持的服务器型号可参考“[硬件兼容支持](./安装准备.html#硬件兼容支持)”;虚拟化平台仅支持openEuler自有的虚拟化组件(HostOS为openEuler,虚拟化组件为发布包中的qemu、KVM)创建的虚拟化平台和华为公有云的x86虚拟化平台。 +>- 安装方式当前仅支持光盘、USB盘安装、网络安装、qcow2镜像安装和私有镜像安装。其中仅华为公有云的x86虚拟化平台支持私有镜像安装。 ## 通过光盘安装 @@ -37,10 +20,10 @@ >![](./public_sys-resources/icon-note.gif) **说明:** >您需要先设置您的系统优先从光盘进行启动引导。以BIOS为例,您需要将“Boot Type Order”中的“CD/DVD-ROM Drive”选项调整到首位。 -1. 断开所有安装不需要的驱动器(非必须),比如USB。 -2. 启动您的计算机系统。 -3. 在计算机中插入安装光盘。 -4. 重启计算机系统。 +1. 断开所有安装不需要的驱动器(非必须),比如USB。 +2. 启动您的计算机系统。 +3. 在计算机中插入安装光盘。 +4. 重启计算机系统。 在短暂的延迟后会出现图形化引导界面,该界面包含不同引导选项。如果您在一分钟内未进行任何操作,安装程序将自动以默认选项开始运行。 @@ -52,24 +35,24 @@ 您需要注意USB盘容量的大小,它必须有足够的空间放下整个镜像,建议USB盘空间大于16G。 -1. 将USB盘连接到该系统中,并执行 dmesg 命令查看相关的日志信息。在该日志的最后可以看到刚刚连接的USB盘所生成的一组信息,应类似如下: +1. 将USB盘连接到该系统中,并执行 dmesg 命令查看相关的日志信息。在该日志的最后可以看到刚刚连接的USB盘所生成的一组信息,应类似如下: - ``` + ```sh [ 170.171135] sd 5:0:0:0: [sdb] Attached SCSI removable disk ``` >![](./public_sys-resources/icon-note.gif) **说明:** >连接的USB盘名称以sdb进行举例。 -2. 切换为root用户。使用su命令,需要输入相应的密码。 +2. 切换为root用户。使用su命令,需要输入相应的密码。 - ``` + ```sh $ su - root ``` -3. 确保USB盘没有被挂载。使用如下命令进行查询: +3. 确保USB盘没有被挂载。使用如下命令进行查询: - ``` + ```sh # findmnt /dev/sdb ``` @@ -77,7 +60,7 @@ - 如果输出以下信息,表明USB盘已经自动挂载。 - ``` + ```sh # findmnt /dev/sdb TARGET SOURCE FSTYPE OPTIONS /mnt/iso /dev/sdb iso9660 ro,relatime @@ -85,15 +68,16 @@ 此时,您需要使用umount命令卸载该设备。 - ``` + ```sh # umount /mnt/iso ``` -4. 使用dd命令将ISO安装镜像直接写入USB盘: ->![](./public_sys-resources/icon-note.gif) **说明:** ->如isolinux描述,由mkisofs命令创建的ISO 9660 文件系统会通过BIOS固件启动,但只能从CD、DVD和BD等介质启动。所以在使用dd命令制作x86的启动U盘前需要使用 isohybrid -u your.iso 对iso进行处理,然后正常使用dd命令将iso写入u盘即可。(该问题仅影响x86)。 +4. 使用dd命令将ISO安装镜像直接写入USB盘: - ``` + >![](./public_sys-resources/icon-note.gif) **说明:** + >如isolinux描述,由mkisofs命令创建的ISO 9660 文件系统会通过BIOS固件启动,但只能从CD、DVD和BD等介质启动。所以在使用dd命令制作x86的启动U盘前需要使用 isohybrid -u your.iso 对iso进行处理,然后正常使用dd命令将iso写入u盘即可。(该问题仅影响x86)。 + + ```sh # dd if=/path/to/image.iso of=/dev/device bs=blocksize ``` @@ -101,20 +85,16 @@ 例如:如果该ISO镜像文件位于 /home/testuser/Downloads/openEuler-21.09-aarch64-dvd.iso,同时探测到的设备名称为sdb,则该命令如下: - ``` + ```sh # dd if=/home/testuser/Downloads/openEuler-21.09-aarch64-dvd.iso of=/dev/sdb bs=512k ``` -5. 等待镜像写入完成,安全退出USB盘并拔掉。 - +5. 等待镜像写入完成,安全退出USB盘并拔掉。 镜像写入过程中不会有进度显示,当\#号再次出现时,执行如下命令将数据同步写入磁盘。退出root帐户,拔掉USB盘。此时,您可以使用该USB盘作为系统的安装源。 - + ```bash # sync ``` - - - ### 启动安装 @@ -123,10 +103,10 @@ >![](./public_sys-resources/icon-note.gif) **说明:** >您需要先设置您的系统优先从USB进行启动引导。以BIOS为例,您需要将“Boot Type Order”中的USB选项调整到首位。 -1. 断开所有安装不需要的驱动器。 -2. 打开您的计算机系统。 -3. 在计算机中插入USB盘。 -4. 重启计算机系统。 +1. 断开所有安装不需要的驱动器。 +2. 打开您的计算机系统。 +3. 在计算机中插入USB盘。 +4. 重启计算机系统。 在短暂的延迟后会出现图形化引导页面,该页面包含不同引导选项。如果您在一分钟内未进行任何操作,安装程序将自动开始安装。 @@ -139,7 +119,7 @@ 对于PXE网络安装,客户机通过支持PXE的网卡,向网络发送请求DHCP信息的广播,请求IP地址等信息。DHCP服务器给客户机提供一个IP地址和其他网络信息如域名服务器、ftp服务器(它提供启动安装程序所必需的文件)的IP地址或主机名,以及服务器上文件的位置。 >![](./public_sys-resources/icon-note.gif) **说明:** ->此处不详细讨论tftp、DHCP、http等服务器配置,相关详细配置请参考“[全自动化安装指导](./使用kickstart自动化安装.html#全自动化安装指导)”。 +>此处不详细讨论tftp、DHCP、http等服务器配置,相关详细配置请参考“[全自动化安装指导](./using_kickstart_for_automatic_installation.md#全自动化安装指导)”。 ## 通过qcow2镜像安装 @@ -147,45 +127,44 @@ ### 制作qcow2镜像 -1. 安装qemu-img软件包。 +1. 安装qemu-img软件包。 - ``` + ```sh # dnf install -y qemu-img ``` -2. 使用qemu-img工具的create命令,创建镜像文件,命令格式为: +2. 使用qemu-img工具的create命令,创建镜像文件,命令格式为: - ``` + ```sh $ qemu-img create -f -o ``` 其中,各参数含义如下: - - _imgFormat_ :镜像格式,取值为raw, qcow2等。 - - _fileOption_ :文件选项,用于设置镜像文件的特性,如指定后端镜像文件、压缩、加密等特性。 - - _fileName_ :文件名称。 - - _diskSize_ :磁盘大小,用于指定块磁盘设备的大小,支持的单位有K、M、G、T,分别代表KiB、MiB、GiB、TiB。 + - _imgFormat_ :镜像格式,取值为raw, qcow2等。 + - _fileOption_ :文件选项,用于设置镜像文件的特性,如指定后端镜像文件、压缩、加密等特性。 + - _fileName_ :文件名称。 + - _diskSize_ :磁盘大小,用于指定块磁盘设备的大小,支持的单位有K、M、G、T,分别代表KiB、MiB、GiB、TiB。 例如,创建一个磁盘设备大小为32GB、格式为qcow2的镜像文件openEuler-image.qcow2,命令和回显如下: - ``` + ```sh $ qemu-img create -f qcow2 openEuler-image.qcow2 32G Formatting 'openEuler-image.qcow2', fmt=qcow2 size=34359738368 cluster_size=65536 lazy_refcounts=off refcount_bits=16 ``` - ### 启动安装 根据以下步骤启动安装程序: -1. 准备qcow2镜像文件。 -2. 准备虚拟机网络。 -3. 准备UEFI引导工具集EDK II。 -4. 准备虚拟机XML配置文件。 -5. 创建虚拟机。 -6. 启动虚拟机。 +1. 准备qcow2镜像文件。 +2. 准备虚拟机网络。 +3. 准备UEFI引导工具集EDK II。 +4. 准备虚拟机XML配置文件。 +5. 创建虚拟机。 +6. 启动虚拟机。 -各步骤详细的操作请参考《[虚拟化用户指南](./../Virtualization/virtualization.html)》。 +各步骤详细的操作请参考《[虚拟化用户指南](./../virtualization/virtualization.html)》。 ## 通过私有镜像安装 @@ -198,20 +177,3 @@ ### 启动安装 华为公有云的x86虚拟化平台的启动请参见《[弹性云服务器 ECS的用户指南](https://support.huaweicloud.com/wtsnew-ecs/index.html)》。 - - - - - - - - - - - - - - - - - diff --git a/docs/zh/server/installation_upgrade/installation/installation_modes_1.md b/docs/zh/server/installation_upgrade/installation/installation_modes_1.md index 2a6ef847feb20e9111d722f2caa88537e870f899..31fde44308a400ead6cb42d9b5fb3c4af76fe02e 100644 --- a/docs/zh/server/installation_upgrade/installation/installation_modes_1.md +++ b/docs/zh/server/installation_upgrade/installation/installation_modes_1.md @@ -1,26 +1,10 @@ # 安装方式介绍 ->![](./public_sys-resources/icon-notice.gif) **须知:** ->- 硬件仅支持树莓派 3B/3B+/4B/400。 ->- 采用刷写镜像到 SD 卡方式安装。本章节提供 Windows/Linux/Mac 上刷写镜像的操作方法。 ->- 本章节使用的镜像是参考“[安装准备](./安装准备-1.html)”获取 openEuler 的树莓派版本镜像。 - - - -- [安装方式介绍](#安装方式介绍) - - [Windows 下刷写镜像](#windows-下刷写镜像) - - [格式化 SD 卡](#格式化-sd-卡) - - [写入 SD 卡](#写入-sd-卡) - - [Linux 下刷写镜像](#linux-下刷写镜像) - - [查看磁盘分区信息](#查看磁盘分区信息) - - [卸载 SD 卡挂载点](#卸载-sd-卡挂载点) - - [写入 SD 卡](#写入-sd-卡-1) - - [Mac 下刷写镜像](#mac-下刷写镜像) - - [查看磁盘分区信息](#查看磁盘分区信息-1) - - [卸载 SD 卡挂载点](#卸载-sd-卡挂载点-1) - - [写入 SD 卡](#写入-sd-卡-2) - - +>![](./public_sys-resources/icon-notice.gif) **须知:** +> +>- 硬件仅支持树莓派 3B/3B+/4B/400。 +>- 采用刷写镜像到 SD 卡方式安装。本章节提供 Windows/Linux/Mac 上刷写镜像的操作方法。 +>- 本章节使用的镜像是参考“[安装准备](./installation_preparations_1.md)”获取 openEuler 的树莓派版本镜像。 ## Windows 下刷写镜像 @@ -30,16 +14,16 @@ 请按照以下步骤格式化 SD 卡: -1. 下载并安装格式化 SD 卡工具,以下操作以 SD Card Formatter 格式化工具为例。 -2. 打开 SD Card Formatter,在 “Select card” 中选择需要格式化的 SD 卡的盘符。 +1. 下载并安装格式化 SD 卡工具,以下操作以 SD Card Formatter 格式化工具为例。 +2. 打开 SD Card Formatter,在 “Select card” 中选择需要格式化的 SD 卡的盘符。 若 SD 卡之前未安装过镜像,盘符只有一个。在 “Select card” 中选择需要格式化的 SD 卡对应盘符。 若 SD 卡之前安装过镜像,盘符会有一个或多个。例如,SD 卡对应三个盘符:E、G、H。在 “Select card” 中选择需要格式化的 SD 卡对应 boot 分区盘符 E。 -3. 在 “Formatting options” 中选择格式化方式。默认为 “Quick format”。 -4. 单击“Format”开始格式化。界面通过进度条显示格式化进度。 -5. 格式化完成后会弹出 “Formatting was successfully completed” 的提示框,单击“OK”完成格式化。 +3. 在 “Formatting options” 中选择格式化方式。默认为 “Quick format”。 +4. 单击“Format”开始格式化。界面通过进度条显示格式化进度。 +5. 格式化完成后会弹出 “Formatting was successfully completed” 的提示框,单击“OK”完成格式化。 ### 写入 SD 卡 @@ -48,12 +32,12 @@ 请按照以下步骤将“openEuler-22.03-LTS-SP4-raspi-aarch64.img”镜像文件写入 SD 卡: -1. 下载并安装刷写镜像的工具,以下操作以 Win32 Disk Imager 工具为例。 -2. 右键选择“以管理员身份运行”,打开 Win32 Disk Imager。 -3. 在“映像文件”中选择 img 格式的镜像文件路径。 -4. 在“设备”中选择待写入的 SD 卡盘符。 -5. 单击“写入”。界面通过任务进度条显示写入 SD 卡的进度。 -6. 写入完成后会弹出 “写入成功” 的提示框,单击“OK”完成写入。 +1. 下载并安装刷写镜像的工具,以下操作以 Win32 Disk Imager 工具为例。 +2. 右键选择“以管理员身份运行”,打开 Win32 Disk Imager。 +3. 在“映像文件”中选择 img 格式的镜像文件路径。 +4. 在“设备”中选择待写入的 SD 卡盘符。 +5. 单击“写入”。界面通过任务进度条显示写入 SD 卡的进度。 +6. 写入完成后会弹出 “写入成功” 的提示框,单击“OK”完成写入。 ## Linux 下刷写镜像 @@ -65,8 +49,8 @@ ### 卸载 SD 卡挂载点 -1. 执行 `df -lh` 命令查看当前已挂载的卷。 -2. 如果 SD 卡对应的分区未挂载,则跳过该步骤;如果 SD 卡对应分区已挂载,如 SD 卡对应的两个分区 /dev/sdb1 和 /dev/sdb3 已挂载,则需要卸载对应分区,在 root 权限下执行以下命令: +1. 执行 `df -lh` 命令查看当前已挂载的卷。 +2. 如果 SD 卡对应的分区未挂载,则跳过该步骤;如果 SD 卡对应分区已挂载,如 SD 卡对应的两个分区 /dev/sdb1 和 /dev/sdb3 已挂载,则需要卸载对应分区,在 root 权限下执行以下命令: `umount /dev/sdb1` @@ -74,8 +58,8 @@ ### 写入 SD 卡 -1. 如果获取的是压缩后的镜像,需要先执行 `xz -d openEuler-22.03-LTS-SP4-raspi-aarch64.img.xz` 命令将压缩文件解压得到“openEuler-22.03-LTS-SP4-raspi-aarch64.img”镜像文件;否则,跳过该步骤。 -2. 将镜像 `openEuler-22.03-LTS-SP4-raspi-aarch64.img` 刷写入 SD 卡,在 root 权限下执行以下命令: +1. 如果获取的是压缩后的镜像,需要先执行 `xz -d openEuler-22.03-LTS-SP4-raspi-aarch64.img.xz` 命令将压缩文件解压得到“openEuler-22.03-LTS-SP4-raspi-aarch64.img”镜像文件;否则,跳过该步骤。 +2. 将镜像 `openEuler-22.03-LTS-SP4-raspi-aarch64.img` 刷写入 SD 卡,在 root 权限下执行以下命令: `dd bs=4M if=openEuler-22.03-LTS-SP4-raspi-aarch64.img of=/dev/sdb` @@ -92,8 +76,8 @@ ### 卸载 SD 卡挂载点 -1. 执行 `df -lh` 命令查看当前已挂载的卷。 -2. 如果 SD 卡对应的分区未挂载,则跳过该步骤;如果 SD 卡对应分区已挂载,如 SD 卡对应的两个分区 /dev/disk3s1 和 /dev/disk3s3 已挂载,则需要卸载对应分区,在 root 权限下执行以下命令: +1. 执行 `df -lh` 命令查看当前已挂载的卷。 +2. 如果 SD 卡对应的分区未挂载,则跳过该步骤;如果 SD 卡对应分区已挂载,如 SD 卡对应的两个分区 /dev/disk3s1 和 /dev/disk3s3 已挂载,则需要卸载对应分区,在 root 权限下执行以下命令: `diskutil umount /dev/disk3s1` @@ -101,8 +85,8 @@ ### 写入 SD 卡 -1. 如果获取的是压缩后的镜像,需要先执行 `xz -d openEuler-22.03-LTS-SP4-raspi-aarch64.img.xz` 命令将压缩文件解压得到“openEuler-22.03-LTS-SP4-raspi-aarch64.img”镜像文件;否则,跳过该步骤。 -2. 将镜像 `openEuler-22.03-LTS-SP4-raspi-aarch64.img` 刷入 SD 卡,在 root 权限下执行以下命令: +1. 如果获取的是压缩后的镜像,需要先执行 `xz -d openEuler-22.03-LTS-SP4-raspi-aarch64.img.xz` 命令将压缩文件解压得到“openEuler-22.03-LTS-SP4-raspi-aarch64.img”镜像文件;否则,跳过该步骤。 +2. 将镜像 `openEuler-22.03-LTS-SP4-raspi-aarch64.img` 刷入 SD 卡,在 root 权限下执行以下命令: `dd bs=4m if=openEuler-22.03-LTS-SP4-raspi-aarch64.img of=/dev/sdb` diff --git a/docs/zh/server/installation_upgrade/installation/installation_preparations.md b/docs/zh/server/installation_upgrade/installation/installation_preparations.md index b8eb893ce43218ac92aa55ad8fe205bfddb83311..9593915c66f4d64e61c862366afdf33ac5f1aac3 100644 --- a/docs/zh/server/installation_upgrade/installation/installation_preparations.md +++ b/docs/zh/server/installation_upgrade/installation/installation_preparations.md @@ -2,7 +2,6 @@ 介绍安装前需要考虑软硬件兼容性状况,以及相关的配置和准备工作。 - ## 获取安装源 在安装开始前,您需要获取openEuler的发布包和校验文件。 @@ -23,9 +22,10 @@ 2. 若选择本地安装,选择“Offline Standard ISO”或者“Offline Everything ISO”对应的“立即下载”将发布包 “openEuler-22.03-LTS-SP4-x86_64-dvd.iso”下载到本地。 3. 若选择网络安装,选择“Network Install ISO”将发布包 “openEuler-22.03-LTS-SP4-netinst-x86_64-dvd.iso ”下载到本地。 ->![](./public_sys-resources/icon-note.gif) **说明:** -> - 网络安装方式的 ISO 发布包较小,在有网络的安装环境可以选择网络安装方式。 -> - AArch64架构的发布包支持UEFI模式,x86\_64架构的发布包支持UEFI模式和Legacy模式。 +>![](./public_sys-resources/icon-note.gif) **说明:** +> +>- 网络安装方式的 ISO 发布包较小,在有网络的安装环境可以选择网络安装方式。 +>- AArch64架构的发布包支持UEFI模式,x86\_64架构的发布包支持UEFI模式和Legacy模式。 ## 发布包完整性校验 @@ -50,15 +50,15 @@ iso文件:openEuler-22.03-LTS-SP4-aarch64-dvd.iso。 文件完整性校验操作步骤如下: -1. 计算文件的sha256校验值。执行命令如下: +1. 计算文件的sha256校验值。执行命令如下: - ``` + ```shell $ sha256sum openEuler-22.03-LTS-SP4-aarch64-dvd.iso ``` 命令执行完成后,输出校验值。 -2. 判断步骤1计算的校验值与刚刚复制的SHA256的值是否一致。 +2. 判断步骤1计算的校验值与刚刚复制的SHA256的值是否一致。 如果校验值一致说明iso文件完整性没有破坏,如果校验值不一致则可以确认文件完整性已被破坏,需要重新获取。 @@ -91,8 +91,8 @@ openEuler所需的最小硬件要求如[表2](#tff48b99c9bf24b84bb602c53229e2541 openEuler安装时,应注意虚拟化平台兼容性的问题,当前已支持的虚拟化平台为: -- openEuler自有的虚拟化组件(HostOS为openEuler,虚拟化组件为发布包中的qemu、KVM)创建的虚拟化平台。 -- 华为公有云的x86虚拟化平台。 +- openEuler自有的虚拟化组件(HostOS为openEuler,虚拟化组件为发布包中的qemu、KVM)创建的虚拟化平台。 +- 华为公有云的x86虚拟化平台。 ### 最小虚拟化空间要求 diff --git a/docs/zh/server/installation_upgrade/installation/installation_preparations_1.md b/docs/zh/server/installation_upgrade/installation/installation_preparations_1.md index 1c33bcf771767376562a7fbd0ac9bf5d055157a4..ef6b2904a7651bd353020447185a2aa5c5da7d50 100644 --- a/docs/zh/server/installation_upgrade/installation/installation_preparations_1.md +++ b/docs/zh/server/installation_upgrade/installation/installation_preparations_1.md @@ -1,29 +1,16 @@ # 安装准备 介绍安装前需要考虑软硬件兼容性状况,以及相关的配置和准备工作。 - - -- [安装准备](#安装准备) - - [获取安装源](#获取安装源) - - [镜像完整性校验](#镜像完整性校验) - - [简介](#简介) - - [前提条件](#前提条件) - - [操作指导](#操作指导) - - [安装要求](#安装要求) - - [硬件兼容支持](#硬件兼容支持) - - [最小硬件要求](#最小硬件要求) - - ## 获取安装源 在安装开始前,您需要获取 openEuler 发布的树莓派镜像及其校验文件。 -1. 登录[openEuler Repo](https://repo.openeuler.org/)网站。 -2. 单击选择 openEuler 22.03 LTS SP4 版本。 -3. 单击“raspi_img”,进入树莓派镜像的下载列表。 -4. 单击“openEuler-22.03-LTS-SP4-raspi-aarch64.img.xz”,将 openEuler 发布的树莓派镜像下载到本地。 -5. 单击“openEuler-22.03-LTS-SP4-raspi-aarch64.img.xz.sha256sum”,将 openEuler 发布的树莓派镜像的校验文件下载到本地。 +1. 登录[openEuler Repo](https://repo.openeuler.org/)网站。 +2. 单击选择 openEuler 22.03 LTS SP4 版本。 +3. 单击“raspi_img”,进入树莓派镜像的下载列表。 +4. 单击“openEuler-22.03-LTS-SP4-raspi-aarch64.img.xz”,将 openEuler 发布的树莓派镜像下载到本地。 +5. 单击“openEuler-22.03-LTS-SP4-raspi-aarch64.img.xz.sha256sum”,将 openEuler 发布的树莓派镜像的校验文件下载到本地。 ## 镜像完整性校验 @@ -45,21 +32,21 @@ 文件完整性校验操作步骤如下: -1. 获取校验文件中的校验值。执行命令如下: +1. 获取校验文件中的校验值。执行命令如下: - ``` + ```shell $ cat openEuler-22.03-LTS-SP4-raspi-aarch64.img.xz.sha256sum ``` -2. 计算文件的 sha256 校验值。执行命令如下: +2. 计算文件的 sha256 校验值。执行命令如下: - ``` + ```shell $ sha256sum openEuler-22.03-LTS-SP4-raspi-aarch64.img.xz ``` - + 命令执行完成后,输出校验值。 -3. 对比步骤 1 和步骤 2 计算的校验值是否一致。 +3. 对比步骤 1 和步骤 2 计算的校验值是否一致。 如果校验值一致说明下载的文件完整性没有破坏,如果校验值不一致则可以确认文件完整性已被破坏,需要重新获取。 diff --git a/docs/zh/server/installation_upgrade/installation/more_resources.md b/docs/zh/server/installation_upgrade/installation/more_resources.md index 88fcb77473ace2fcc598ab5e29a547436d7bda6e..5c2d1f65d4c616d2dfe3048de4d3567d2e56e5c8 100644 --- a/docs/zh/server/installation_upgrade/installation/more_resources.md +++ b/docs/zh/server/installation_upgrade/installation/more_resources.md @@ -1,4 +1,4 @@ # 参考资料 - 如何构建树莓派镜像文件 -- 如何使用树莓派 \ No newline at end of file +- 如何使用树莓派 diff --git a/docs/zh/server/installation_upgrade/installation/using_kickstart_for_automatic_installation.md b/docs/zh/server/installation_upgrade/installation/using_kickstart_for_automatic_installation.md index da90c41c2c9c851eca6262d952263d376c89f7e3..3701be0147f3ad030dc2b2ce0eda047ff9da1152 100644 --- a/docs/zh/server/installation_upgrade/installation/using_kickstart_for_automatic_installation.md +++ b/docs/zh/server/installation_upgrade/installation/using_kickstart_for_automatic_installation.md @@ -1,21 +1,5 @@ # 使用kickstart自动化安装 - - -- [使用kickstart自动化安装](#使用kickstart自动化安装) - - [总体介绍](#总体介绍) - - [概述](#概述) - - [优缺点对比](#优缺点对比) - - [背景知识](#背景知识) - - [半自动化安装指导](#半自动化安装指导) - - [环境要求](#环境要求) - - [操作步骤](#操作步骤) - - [全自动化安装指导](#全自动化安装指导) - - [环境要求](#环境要求-1) - - [操作步骤](#操作步骤-1) - - - ## 总体介绍 ### 概述 diff --git a/docs/zh/server/maintenance/common_skills/_toc.yaml b/docs/zh/server/maintenance/common_skills/_toc.yaml index 0a2e4a36306c1d69405ddfe5e20790c79efa82ee..f8e86be91d888dededb470d98e3a8d8fa0f4ddad 100644 --- a/docs/zh/server/maintenance/common_skills/_toc.yaml +++ b/docs/zh/server/maintenance/common_skills/_toc.yaml @@ -1,7 +1,8 @@ +label: 常用技能 isManual: true -label: '' +description: 运维常用配置及命令 sections: - - label: 常用技能 - href: ./common_configurations.md - label: 信息收集 href: ./information_collection.md + - label: 常用配置 + href: ./common_configurations.md diff --git a/docs/zh/server/maintenance/common_skills/common_configurations.md b/docs/zh/server/maintenance/common_skills/common_configurations.md index 62e256d598dc6048794fdf0992cf8a135da08474..63609e376e6b2238cddcd0863011aa06d072895f 100644 --- a/docs/zh/server/maintenance/common_skills/common_configurations.md +++ b/docs/zh/server/maintenance/common_skills/common_configurations.md @@ -1,10 +1,5 @@ # 常用技能 -- [常用技能](#常用技能) - - [配置网络](#配置网络) - - [管理RPM包](#管理rpm包) - - [配置SSH](#配置ssh) - ## 配置网络 1. 配置IP地址 diff --git a/docs/zh/server/maintenance/common_skills/information_collection.md b/docs/zh/server/maintenance/common_skills/information_collection.md index 5df97181b7f3d74b655dc23461f64f8e39290521..ce603080acdfd16d3a2ac067e6586d2a3a9ba79a 100644 --- a/docs/zh/server/maintenance/common_skills/information_collection.md +++ b/docs/zh/server/maintenance/common_skills/information_collection.md @@ -1,11 +1,5 @@ # 信息收集 -- [信息收集](#信息收集) - - [查看OS信息](#查看os信息) - - [查看硬件信息](#查看硬件信息) - - [查看软件信息](#查看软件信息) - - [查看OS日志](#查看os日志) - ## 查看OS信息 (1)查看操作系统版本信息,可用下面3个命令进行查询: diff --git a/docs/zh/server/maintenance/common_tools/_toc.yaml b/docs/zh/server/maintenance/common_tools/_toc.yaml index 02a8223f32ea5e73b2bee724412d3c547842a88b..984c9a3739a9e1ff7983365a9cb2d555a7576697 100644 --- a/docs/zh/server/maintenance/common_tools/_toc.yaml +++ b/docs/zh/server/maintenance/common_tools/_toc.yaml @@ -1,5 +1,6 @@ +label: 常用定位定界工具 isManual: true -label: '' +description: 常用定位定界工具,包括 ftrace,strace 和 kdump sections: - - label: 常用工具 + - label: 常用定位定界工具 href: ./commonly_used_tools.md diff --git a/docs/zh/server/maintenance/common_tools/commonly_used_tools.md b/docs/zh/server/maintenance/common_tools/commonly_used_tools.md index e33e4b8094e3e15779a4854d6af7bfe18ea56233..d0484dae0a1fba795eecee56b0b003d46f16df50 100644 --- a/docs/zh/server/maintenance/common_tools/commonly_used_tools.md +++ b/docs/zh/server/maintenance/common_tools/commonly_used_tools.md @@ -1,10 +1,5 @@ # 常用工具 -- [常用工具](#常用工具) - - [ftrace](#ftrace) - - [strace](#strace) - - [kdump](#kdump) - ## ftrace 1. ftrace:是一个针对linux kernel内核空间的debug工具,内核中会提供trace events供用户追踪。而ftrace则可以将events抓取出来,让用户能够直观地看到这些事件,同时也可以追踪内核的函数。 diff --git a/docs/zh/server/maintenance/gala/_toc.yaml b/docs/zh/server/maintenance/gala/_toc.yaml index 2ab11dbb2c2a6ed9b7e53c960164514ee58dc415..8e64642efcd770b6b745b94c7e6bfb5eeea53ae3 100644 --- a/docs/zh/server/maintenance/gala/_toc.yaml +++ b/docs/zh/server/maintenance/gala/_toc.yaml @@ -1,9 +1,10 @@ +label: gala 用户指南 isManual: true -label: '' +description: 故障智能检测、性能数据采集分析以及资源监测管理 sections: - - label: gala-anteater使用手册 + - label: 使用 gala-anteater href: ./using_gala_anteater.md - - label: '**gala-gopher使用手册**' + - label: 使用 gala_gopher href: ./using_gala_gopher.md - - label: gala-spider使用手册 + - label: 使用 gala-spider href: ./using_gala_spider.md diff --git a/docs/zh/server/maintenance/gala/using_gala_spider.md b/docs/zh/server/maintenance/gala/using_gala_spider.md index 71b416d578a014d89273af0797d2f6516e282e34..438066c2db3beb5eb98330ec53c05d38de8bf124 100644 --- a/docs/zh/server/maintenance/gala/using_gala_spider.md +++ b/docs/zh/server/maintenance/gala/using_gala_spider.md @@ -147,7 +147,7 @@ gala-spider 项目中的 2 个功能组件会作为独立的软件包分别发 ​ **gala-inference** 组件对应 gala-inference 软件包。 -gala-gopher软件的部署参见[gala-gopher使用手册](gala-gopher使用手册.md),此处只介绍 arangodb 的部署。 +gala-gopher软件的部署参见[gala-gopher使用手册](./using_gala_gopher.md),此处只介绍 arangodb 的部署。 当前使用的 arangodb 版本是 3.8.7 ,该版本对运行环境有如下要求: @@ -404,7 +404,7 @@ prometheus: #### 依赖软件部署 -gala-inference 的运行依赖和 gala-spider一样,请参见[外部依赖软件部署](#外部依赖软件部署)。此外,gala-inference 还间接依赖 [gala-spider](#gala-spider) 和 [gala-anteater](gala-anteater使用手册.md) 软件的运行,请提前部署gala-spider和gala-anteater软件。 +gala-inference 的运行依赖和 gala-spider一样,请参见[外部依赖软件部署](#外部依赖软件部署)。此外,gala-inference 还间接依赖 [gala-spider](#gala-spider) 和 [gala-anteater](./using_gala_anteater.md) 软件的运行,请提前部署gala-spider和gala-anteater软件。 #### 配置项修改 @@ -469,7 +469,7 @@ arangodb: { "Timestamp": 1661853360000, "event_id": "1661853360000_1fd37742xxxx_sli_12154_19", - "Atrributes": { + "Attributes": { "event_id": "1661853360000_1fd37742xxxx_sli_12154_19" }, "Resource": { diff --git a/docs/zh/server/maintenance/kernel_live_upgrade/_toc.yaml b/docs/zh/server/maintenance/kernel_live_upgrade/_toc.yaml index 8c65b644551f71d478d526716413add4c7b9334f..84f6de83ebfd8f64a64ab6621dfa8a7d2bc190e2 100644 --- a/docs/zh/server/maintenance/kernel_live_upgrade/_toc.yaml +++ b/docs/zh/server/maintenance/kernel_live_upgrade/_toc.yaml @@ -1,9 +1,8 @@ +label: 内核热升级指南 isManual: true -label: '' +description: 使用用户态自动化工具快速重启内核和程序热迁移实现内核热替换特性 sections: - label: 安装与部署 href: ./installation_and_deployment.md - - label: 内核热升级用户指南 - href: ./kernel_live_upgrade.md - label: 使用方法 href: ./usage_guide.md diff --git a/docs/zh/server/maintenance/kernel_live_upgrade/faq.md b/docs/zh/server/maintenance/kernel_live_upgrade/faq.md deleted file mode 100644 index d031344810332c60b4ae7ff2327693e76ab397b6..0000000000000000000000000000000000000000 --- a/docs/zh/server/maintenance/kernel_live_upgrade/faq.md +++ /dev/null @@ -1,27 +0,0 @@ -1. 执行nvwa update后未升级 - - 原因:保留现场或者内核替换过程中出现错误。 - - 解决方法:查看日志,找出错误原因。 - -2. 开启加速特性后,nvwa执行命令失败 - - 原因:nvwa提供了诸多加速特性,包括quick kexec,pin memory,cpu park等等。这些特性都涉及到cmdline的配置和内存的分配,在选取内存时,通过cat /proc/iomemory确保选取的内存没有与其他程序冲突。必要时,通过dmesg查看使能特性后是否存在错误日志。 - -3. 热升级后,相关现场未被恢复 - - 原因:首先检查nvwa服务是否运行,运行情况下,可能存在两种情况,一种是服务恢复失败,一种是进程恢复失败。 - - 解决方法:通过service nvwa status查看nvwa的日志,如果是服务启动失败,首先确认是否使能了该服务,再通过systemd查看对应服务的日志。进一步的日志,去criu_dir指定的路径对应命名的进程/服务文件夹中。其中dump.log为保存现场产生的日志,restore.log为恢复现场产生的。 - -4. 恢复失败,日志显示Can't fork for 948: File exists - - 原因:内核热升级工具在恢复程序过程中,发现程序的pid已经被占用。 - - 解决方法:当前内核没有提供保留pid的机制,相关策略正在开发,预计会在将来的内核版本中解决这一限制,当前仅能手动重启相关进程。 - -5. 使用nvwa去保存和恢复简单程序(hello world),显示失败或者程序未在执行 - - 原因: criu使用存在诸多限制。 - - 解决办法:查看nvwa的日志,如果显示是criu相关的错误,去相应的目录下检查dump.log或者restore.log,criu相关的使用限制,可以参考[wiki](https://criu.org/What_cannot_be_checkpointed)。 \ No newline at end of file diff --git a/docs/zh/server/maintenance/kernel_live_upgrade/installation_and_deployment.md b/docs/zh/server/maintenance/kernel_live_upgrade/installation_and_deployment.md index b18f12e5771bfe313f4ee54b1c8db136a9c29469..9652c3078d2dc90956932088b0c027044b94a893 100644 --- a/docs/zh/server/maintenance/kernel_live_upgrade/installation_and_deployment.md +++ b/docs/zh/server/maintenance/kernel_live_upgrade/installation_and_deployment.md @@ -2,20 +2,6 @@ 本章介绍如何安装和部署内核热升级工具。 - - -- [安装与部署](#安装与部署) - - [软硬件要求](#软硬件要求) - - [硬件要求](#硬件要求) - - [软件要求](#软件要求) - - [环境准备](#环境准备) - - [安装内核热升级工具](#安装内核热升级工具) - - [部署内核热升级工具](#部署内核热升级工具) - - [配置介绍](#配置介绍) - - [使能内核热升级工具](#使能内核热升级工具) - - - ## 软硬件要求 ### 硬件要求 diff --git a/docs/zh/server/maintenance/kernel_live_upgrade/usage_guide.md b/docs/zh/server/maintenance/kernel_live_upgrade/usage_guide.md index 73c7b85aa79818c30dc9210e579b32a54859c07d..fe67cea14033d42214a6428e44f6d431a2d39786 100644 --- a/docs/zh/server/maintenance/kernel_live_upgrade/usage_guide.md +++ b/docs/zh/server/maintenance/kernel_live_upgrade/usage_guide.md @@ -1,14 +1,5 @@ # 使用方法 - - -- [命令用法](#命令用法) -- [使用限制](#使用限制) -- [加速特性说明及使用](#加速特性说明及使用) -- [产生的日志信息](#产生的日志信息) - - - ## 命令用法 - nvwa help diff --git a/docs/zh/server/maintenance/sysmonitor/_toc.yaml b/docs/zh/server/maintenance/sysmonitor/_toc.yaml index 088f65ac09aa7bb977d157e1adf170a31cf45608..7d85bf618cb328aac3201efce9c96994c8390df6 100644 --- a/docs/zh/server/maintenance/sysmonitor/_toc.yaml +++ b/docs/zh/server/maintenance/sysmonitor/_toc.yaml @@ -1,5 +1,6 @@ +label: sysmonitor 用户指南 isManual: true -label: '' +description: 使用 sysmonitor 服务监控 OS 系统运行过程中的异常 sections: - - label: sysmonitor + - label: sysmonitor 用户指南 href: ./sysmonitor_user_guide.md diff --git a/docs/zh/server/maintenance/sysmonitor/sysmonitor_user_guide.md b/docs/zh/server/maintenance/sysmonitor/sysmonitor_user_guide.md index bc5cb0da066acd2d1fb602915fe10dc707380443..aaba6de348aea690eebfcc02e2516f4c0e57546c 100644 --- a/docs/zh/server/maintenance/sysmonitor/sysmonitor_user_guide.md +++ b/docs/zh/server/maintenance/sysmonitor/sysmonitor_user_guide.md @@ -338,6 +338,7 @@ eth1 UP ``` 各配置项说明如下表 + | 配置项 | 配置项说明 | 是否必配 | 默认值 | | ------ | ------------------------------------------------------------ | -------- | ------------------------------------------------- | | dev | 网卡名 | 是 | 无 | @@ -441,7 +442,7 @@ REPORT_COMMAND="" ```sh info|sysmonitor[127]: CPU usage alarm: 91.3% -info|sysmonitor[127]: cpu monitor: execute REPORT_COMMAND[sysmoniotrcpu] sucessfully +info|sysmonitor[127]: cpu monitor: execute REPORT_COMMAND[sysmoniotrcpu] successfully info|sysmonitor[127]: CPU usage resume 70.1% ``` @@ -449,7 +450,7 @@ info|sysmonitor[127]: CPU usage resume 70.1% ```sh info|sysmonitor[127]: CPU 1,2,3 usage alarm: 91.3% -info|sysmonitor[127]: cpu monitor: execute REPORT_COMMAND[sysmoniotrcpu] sucessfully +info|sysmonitor[127]: cpu monitor: execute REPORT_COMMAND[sysmoniotrcpu] successfully info|sysmonitor[127]: CPU 1,2,3 usage resume 70.1% ``` diff --git a/docs/zh/server/maintenance/troubleshooting/_toc.yaml b/docs/zh/server/maintenance/troubleshooting/_toc.yaml index e29f50bc462469cb81a770b4c892097ec365456a..fe9fd182f027439ca159e3481b14b3f54ae4eb04 100644 --- a/docs/zh/server/maintenance/troubleshooting/_toc.yaml +++ b/docs/zh/server/maintenance/troubleshooting/_toc.yaml @@ -1,5 +1,6 @@ +label: 故障应急处理 isManual: true -label: '' +description: 常见的故障应急处理方法 sections: - label: 故障应急处理 href: ./troubleshooting.md diff --git a/docs/zh/server/maintenance/troubleshooting/troubleshooting.md b/docs/zh/server/maintenance/troubleshooting/troubleshooting.md index a16a2d3b6cc5ae815c7011a3cb43ffa3bc6befa0..7abc28c35cef26c8b846be81d1686a339a49af75 100644 --- a/docs/zh/server/maintenance/troubleshooting/troubleshooting.md +++ b/docs/zh/server/maintenance/troubleshooting/troubleshooting.md @@ -1,13 +1,5 @@ # 故障应急处理 -- [故障应急处理](#故障应急处理) - - [触发kdump重启](#触发kdump重启) - - [强制重启](#强制重启) - - [重启网络](#重启网络) - - [修复文件系统](#修复文件系统) - - [手动dropcache](#手动dropcache) - - [救援模式和单用户模式](#救援模式和单用户模式) - ## 触发kdump重启 ```shell diff --git a/docs/zh/server/menmory_storage/etmem/_toc.yaml b/docs/zh/server/memory_storage/etmem/_toc.yaml similarity index 32% rename from docs/zh/server/menmory_storage/etmem/_toc.yaml rename to docs/zh/server/memory_storage/etmem/_toc.yaml index 4a77be4e1281cba5070928ee860a42295a9dc374..dbbc8c5748e6f0b98d32c6e466ae02eec9f72f84 100644 --- a/docs/zh/server/menmory_storage/etmem/_toc.yaml +++ b/docs/zh/server/memory_storage/etmem/_toc.yaml @@ -1,5 +1,6 @@ +label: etmem 用户指南 isManual: true -label: '' +description: 使用内存分级扩展技术 etmem 扩展内存容量 sections: - - label: etmem + - label: 使用 etmem href: ./etmem_user_guide.md diff --git a/docs/zh/server/menmory_storage/etmem/etmem_user_guide.md b/docs/zh/server/memory_storage/etmem/etmem_user_guide.md similarity index 96% rename from docs/zh/server/menmory_storage/etmem/etmem_user_guide.md rename to docs/zh/server/memory_storage/etmem/etmem_user_guide.md index a30657e9300c2d5e27b24f63dd491027140088d2..d555271984d1774f17c0df3735a2a670c3caea17 100644 --- a/docs/zh/server/menmory_storage/etmem/etmem_user_guide.md +++ b/docs/zh/server/memory_storage/etmem/etmem_user_guide.md @@ -170,7 +170,7 @@ task_private_key=task_private_value | swapcache_low_wmark| slide engine的配置项,swacache可以占用系统内存的比例,低水线 | 否 | 是 | [1~swapcache_high_wmark) | swapcache_low_wmark=3 //触发swapcache回收后,系统会将swapcache内存占用量回收到低于3%| | [engine] | engine公用配置段起始标识 | 否 | 否 | NA | engine参数的开头标识,表示下面的参数直到另外的[xxx]或文件结尾为止的范围内均为engine section的参数 | | project | 声明所在的project | 是 | 是 | 64个字以内的字符串 | 已经存在名字为test的project,则可以写为project=test | -| engine | 声明所在的engine | 是 | 是 | slide/cslide/thridparty | 声明使用的是slide或cslide或thirdparty策略 | +| engine | 声明所在的engine | 是 | 是 | slide/cslide/thirdparty | 声明使用的是slide或cslide或thirdparty策略 | | node_pair | cslide engine的配置项,声明系统中AEP和DRAM的node pair | engine为cslide时必须配置 | 是 | 成对配置AEP和DRAM的node号,AEP和DRAM之间用逗号隔开,每对pair之间用分号隔开 | node_pair=2,0;3,1 | | hot_threshold | cslide engine的配置项,声明内存冷热水线的阈值 | engine为cslide时必须配置 | 是 | 大于等于0,小于等于INT_MAX的整数 | hot_threshold=3 //访问次数小于3的内存会被识别为冷内存 | |node_mig_quota|cslide engine的配置项,流控,声明每次DRAM和AEP互相迁移时单向最大流量|engine为cslide时必须配置|是|大于等于0,小于等于INT_MAX的整数|node_mig_quota=1024 //单位为MB,AEP到DRAM或DRAM到AEP搬迁一次最大1024M| @@ -220,7 +220,7 @@ etmemd --log-level 0 --socket etmemd_socket | --------------- | ---------------------------------- | -------- | ---------- | --------------------- | ------------------------------------------------------------ | | -l或\-\-log-level | etmemd日志级别 | 否 | 是 | 0~3 | 0:debug级别
1:info级别
2:warning级别
3:error级别
只有大于等于配置的级别才会打印到/var/log/message文件中 | | -s或\-\-socket | etmemd监听的名称,用于与客户端交互 | 是 | 是 | 107个字符之内的字符串 | 指定服务端监听的名称 | -| -m或\-\-mode-systemctl| 指定通过systemctl方式来拉起stmemd服务| 否| 否| NA| service文件中需要指定-m参数| +| -m或\-\-mode-systemctl| 指定通过systemctl方式来拉起stmemd服务| 否| 否| NA| service文件中需要指定-m参数| | -h或\-\-help | 帮助信息 | 否 | 否 | NA | 执行时带有此参数会打印后退出 | ### 通过etmem客户端添加或者删除工程/引擎/任务 @@ -552,10 +552,10 @@ etmem engine showhostpages -n proj_name -e cslide -s etmemd_socket | 参数 | 参数含义 | 是否必须 | 是否有参数 | 示例说明 | |----|------|------|-------|------| -|-n或\-\-proj_name| 指定project的名字| 是| 是| 指定已经存在,所需要执行的project的名字| -|-s或\-\-socket| 与etmemd服务端通信的socket名称,需要与etmemd启动时指定的保持一致| 是| 是| 必须配置,在有多个etmemd时,由管理员选择与哪个etmemd通信| -|-e或\-\-engine| 指定执行的引擎的名字| 是| 是| 指定已经存在的,所需要执行的引擎的名字| -|-t或\-\-task_name| 指定执行的任务的名字| 否| 是| 指定已经存在的,所需要执行的任务的名字| +|-n或\-\-proj_name| 指定project的名字| 是| 是| 指定已经存在,所需要执行的project的名字| +|-s或\-\-socket| 与etmemd服务端通信的socket名称,需要与etmemd启动时指定的保持一致| 是| 是| 必须配置,在有多个etmemd时,由管理员选择与哪个etmemd通信| +|-e或\-\-engine| 指定执行的引擎的名字| 是| 是| 指定已经存在的,所需要执行的引擎的名字| +|-t或\-\-task_name| 指定执行的任务的名字| 否| 是| 指定已经存在的,所需要执行的任务的名字| ### 支持kernel swap功能开启与关闭 @@ -597,9 +597,9 @@ etmemd -l 0 -s etmemd_socket -m | 参数 | 参数含义 | 是否必须 | 是否有参数 | 参数范围 | 示例说明 | |----------------|------------|------|-------|------|-----------| | -l或\-\-log-level | etmemd日志级别 | 否 | 是 | 0~3 | 0:debug级别;1:info级别;2:warning级别;3:error级别;只有大于等于配置的级别才会打印到/var/log/message文件中| -| -s或\-\-socket |etmemd监听的名称,用于与客户端交互 | 是 | 是| 107个字符之内的字符串| 指定服务端监听的名称| -|-m或\-\-mode-systemctl | etmemd作为service被拉起时,命令中需要指定此参数来支持 | 否 | 否 | NA | NA | -| -h或\-\-help | 帮助信息 | 否 |否 |NA |执行时带有此参数会打印后退出| +| -s或\-\-socket | etmemd监听的名称,用于与客户端交互 | 是 | 是 | 107个字符之内的字符串 | 指定服务端监听的名称 | +| -m或\-\-mode-systemctl| 指定通过systemctl方式来拉起stmemd服务| 否| 否| NA| service文件中需要指定-m参数| +| -h或\-\-help | 帮助信息 | 否 | 否 | NA | 执行时带有此参数会打印后退出 | ### etmem支持第三方内存扩展策略 diff --git a/docs/zh/server/menmory_storage/lvm/_toc.yaml b/docs/zh/server/memory_storage/lvm/_toc.yaml similarity index 39% rename from docs/zh/server/menmory_storage/lvm/_toc.yaml rename to docs/zh/server/memory_storage/lvm/_toc.yaml index 52c3f8b31122b79e9257f1a13a6d6de97d2e1828..f2bc64b8e377d43a654a6dd108e6a2b65f43fd62 100644 --- a/docs/zh/server/menmory_storage/lvm/_toc.yaml +++ b/docs/zh/server/memory_storage/lvm/_toc.yaml @@ -1,5 +1,6 @@ +label: 配置和管理逻辑卷 isManual: true -label: '' +description: 使用 LVM 管理硬盘 sections: - - label: 使用LVM管理硬盘 + - label: 使用 LVM 管理硬盘 href: ./managing_drives_through_lvm.md diff --git a/docs/zh/server/menmory_storage/lvm/managing_drives_through_lvm.md b/docs/zh/server/memory_storage/lvm/managing_drives_through_lvm.md similarity index 92% rename from docs/zh/server/menmory_storage/lvm/managing_drives_through_lvm.md rename to docs/zh/server/memory_storage/lvm/managing_drives_through_lvm.md index 737d9ff87810c3df02c6c9deb6c0f3e1313c80d3..b627e82623fe24570e1a4d5dd9a3dc6f41b56463 100644 --- a/docs/zh/server/menmory_storage/lvm/managing_drives_through_lvm.md +++ b/docs/zh/server/memory_storage/lvm/managing_drives_through_lvm.md @@ -1,37 +1,5 @@ # 使用LVM管理硬盘 - - -- [使用LVM管理硬盘](#使用lvm管理硬盘) - - [LVM简介](#lvm简介) - - [基本概念](#基本概念) - - [安装](#安装) - - [管理物理卷](#管理物理卷) - - [创建物理卷](#创建物理卷) - - [查看物理卷](#查看物理卷) - - [修改物理卷属性](#修改物理卷属性) - - [删除物理卷](#删除物理卷) - - [管理卷组](#管理卷组) - - [创建卷组](#创建卷组) - - [查看卷组](#查看卷组) - - [修改卷组属性](#修改卷组属性) - - [扩展卷组](#扩展卷组) - - [收缩卷组](#收缩卷组) - - [删除卷组](#删除卷组) - - [管理逻辑卷](#管理逻辑卷) - - [创建逻辑卷](#创建逻辑卷) - - [查看逻辑卷](#查看逻辑卷) - - [调整逻辑卷大小](#调整逻辑卷大小) - - [扩展逻辑卷](#扩展逻辑卷) - - [收缩逻辑卷](#收缩逻辑卷) - - [删除逻辑卷](#删除逻辑卷) - - [创建并挂载文件系统](#创建并挂载文件系统) - - [创建文件系统](#创建文件系统) - - [手动挂载文件系统](#手动挂载文件系统) - - [自动挂载文件系统](#自动挂载文件系统) - - - ## LVM简介 LVM是逻辑卷管理(Logical Volume Manager)的简称,它是Linux环境下对磁盘分区进行管理的一种机制。LVM通过在硬盘和文件系统之间添加一个逻辑层,来为文件系统屏蔽下层硬盘分区布局,提高硬盘分区管理的灵活性。 diff --git a/docs/zh/server/menmory_storage/lvm/public_sys-resources/icon-caution.gif b/docs/zh/server/memory_storage/lvm/public_sys-resources/icon-caution.gif similarity index 100% rename from docs/zh/server/menmory_storage/lvm/public_sys-resources/icon-caution.gif rename to docs/zh/server/memory_storage/lvm/public_sys-resources/icon-caution.gif diff --git a/docs/zh/server/menmory_storage/lvm/public_sys-resources/icon-danger.gif b/docs/zh/server/memory_storage/lvm/public_sys-resources/icon-danger.gif similarity index 100% rename from docs/zh/server/menmory_storage/lvm/public_sys-resources/icon-danger.gif rename to docs/zh/server/memory_storage/lvm/public_sys-resources/icon-danger.gif diff --git a/docs/zh/server/menmory_storage/lvm/public_sys-resources/icon-note.gif b/docs/zh/server/memory_storage/lvm/public_sys-resources/icon-note.gif similarity index 100% rename from docs/zh/server/menmory_storage/lvm/public_sys-resources/icon-note.gif rename to docs/zh/server/memory_storage/lvm/public_sys-resources/icon-note.gif diff --git a/docs/zh/server/menmory_storage/lvm/public_sys-resources/icon-notice.gif b/docs/zh/server/memory_storage/lvm/public_sys-resources/icon-notice.gif similarity index 100% rename from docs/zh/server/menmory_storage/lvm/public_sys-resources/icon-notice.gif rename to docs/zh/server/memory_storage/lvm/public_sys-resources/icon-notice.gif diff --git a/docs/zh/server/menmory_storage/lvm/public_sys-resources/icon-tip.gif b/docs/zh/server/memory_storage/lvm/public_sys-resources/icon-tip.gif similarity index 100% rename from docs/zh/server/menmory_storage/lvm/public_sys-resources/icon-tip.gif rename to docs/zh/server/memory_storage/lvm/public_sys-resources/icon-tip.gif diff --git a/docs/zh/server/menmory_storage/lvm/public_sys-resources/icon-warning.gif b/docs/zh/server/memory_storage/lvm/public_sys-resources/icon-warning.gif similarity index 100% rename from docs/zh/server/menmory_storage/lvm/public_sys-resources/icon-warning.gif rename to docs/zh/server/memory_storage/lvm/public_sys-resources/icon-warning.gif diff --git a/docs/zh/server/menmory_storage/public_sys-resources/icon-caution.gif b/docs/zh/server/memory_storage/public_sys-resources/icon-caution.gif similarity index 100% rename from docs/zh/server/menmory_storage/public_sys-resources/icon-caution.gif rename to docs/zh/server/memory_storage/public_sys-resources/icon-caution.gif diff --git a/docs/zh/server/menmory_storage/public_sys-resources/icon-danger.gif b/docs/zh/server/memory_storage/public_sys-resources/icon-danger.gif similarity index 100% rename from docs/zh/server/menmory_storage/public_sys-resources/icon-danger.gif rename to docs/zh/server/memory_storage/public_sys-resources/icon-danger.gif diff --git a/docs/zh/server/menmory_storage/public_sys-resources/icon-note.gif b/docs/zh/server/memory_storage/public_sys-resources/icon-note.gif similarity index 100% rename from docs/zh/server/menmory_storage/public_sys-resources/icon-note.gif rename to docs/zh/server/memory_storage/public_sys-resources/icon-note.gif diff --git a/docs/zh/server/menmory_storage/public_sys-resources/icon-notice.gif b/docs/zh/server/memory_storage/public_sys-resources/icon-notice.gif similarity index 100% rename from docs/zh/server/menmory_storage/public_sys-resources/icon-notice.gif rename to docs/zh/server/memory_storage/public_sys-resources/icon-notice.gif diff --git a/docs/zh/server/menmory_storage/public_sys-resources/icon-tip.gif b/docs/zh/server/memory_storage/public_sys-resources/icon-tip.gif similarity index 100% rename from docs/zh/server/menmory_storage/public_sys-resources/icon-tip.gif rename to docs/zh/server/memory_storage/public_sys-resources/icon-tip.gif diff --git a/docs/zh/server/menmory_storage/public_sys-resources/icon-warning.gif b/docs/zh/server/memory_storage/public_sys-resources/icon-warning.gif similarity index 100% rename from docs/zh/server/menmory_storage/public_sys-resources/icon-warning.gif rename to docs/zh/server/memory_storage/public_sys-resources/icon-warning.gif diff --git a/docs/zh/server/network/gazelle/_toc.yaml b/docs/zh/server/network/gazelle/_toc.yaml index 43468248fc0aa6ba4f5e6a428d6ba581d4e7c29a..dca3f7fa60018db84af0204523f0c4b2800e0af4 100644 --- a/docs/zh/server/network/gazelle/_toc.yaml +++ b/docs/zh/server/network/gazelle/_toc.yaml @@ -1,11 +1,12 @@ +label: Gazelle 用户指南 isManual: true -label: '' +description: 提高应用的网络 I/O 吞吐能力 sections: + - label: Gazelle 用户指南 + href: ./gazelle_user_guide.md - label: Gazelle 加速openGauss使用说明 href: ./Gazelle_for_opengauss_acceleration.md - label: Gazelle加速redis href: ./Gazelle_for_redis_acceleration.md - label: Gazelle单网卡功能使用说明 href: ./Gazelle_single_nic_user_guide.md - - label: 用户态协议栈Gazelle用户指南 - href: ./gazelle_user_guide.md diff --git a/docs/zh/server/network/network_config/_toc.yaml b/docs/zh/server/network/network_config/_toc.yaml index 80d1eeff1b0dbacd476da2a684ef84d3edd9b664..b0148614220f817a11410ec8e8f0bd3a99bd4c32 100644 --- a/docs/zh/server/network/network_config/_toc.yaml +++ b/docs/zh/server/network/network_config/_toc.yaml @@ -1,5 +1,6 @@ +label: 配置网络 isManual: true -label: '' +description: 配置ip,主机名,网络绑定等 sections: - label: 配置网络 href: ./network_configuration.md diff --git a/docs/zh/server/network/network_config/network_configuration.md b/docs/zh/server/network/network_config/network_configuration.md index c59e4ac518bfe3c5693d3635f210be4dfd8e1c7a..3273c583aac8a91101be097dc828014c563c4c6f 100644 --- a/docs/zh/server/network/network_config/network_configuration.md +++ b/docs/zh/server/network/network_config/network_configuration.md @@ -1,26 +1,5 @@ # 配置网络 - - -- [配置网络](#配置网络) - - [配置 IP](#配置-ip) - - [使用nmcli命令](#使用nmcli命令) - - [使用ip命令](#使用ip命令) - - [通过ifcfg文件配置网络](#通过ifcfg文件配置网络) - - [配置主机名](#配置主机名) - - [简介](#简介) - - [使用hostnamectl配置主机名](#使用hostnamectl配置主机名) - - [使用nmcli配置主机名](#使用nmcli配置主机名) - - [配置网络绑定](#配置网络绑定) - - [使用nmcli](#使用nmcli) - - [使用命令行](#使用命令行) - - [IPv6使用差异说明(vs IPv4)](#ipv6使用差异说明vs-ipv4) - - [约束限制](#约束限制) - - [配置说明](#配置说明) - - [FAQ](#faq) - - - ## 配置 IP ### 使用nmcli命令 diff --git a/docs/zh/server/performance/cpu_optimization/_toc.yaml b/docs/zh/server/performance/cpu_optimization/_toc.yaml index f799e01e59b5a9d76c8a380c50f37b3ba257ec8c..7dff82f5080940f93caaf77f9cff0c084cbaa478 100644 --- a/docs/zh/server/performance/cpu_optimization/_toc.yaml +++ b/docs/zh/server/performance/cpu_optimization/_toc.yaml @@ -1,7 +1,8 @@ +label: 使用 KAE 加速引擎 isManual: true -label: '' +description: 使用 KAE 加速引擎降低处理器消耗,提高处理器效率 sections: + - label: 使用 KAE 加速引擎 + href: ./using_the_kae.md - label: FUSE fastpath特性说明和使用指南 href: ./fuse_acceleration_feature_guide.md - - label: 使用KAE加速引擎 - href: ./using_the_kae.md diff --git a/docs/zh/server/performance/overall/system_resource/_toc.yaml b/docs/zh/server/performance/overall/system_resource/_toc.yaml index 8efe54c11470d2423173e953703b86d6ab2b55bb..ea85bbe0467bdf4cbb8b2f9d70367d4cd3a86abf 100644 --- a/docs/zh/server/performance/overall/system_resource/_toc.yaml +++ b/docs/zh/server/performance/overall/system_resource/_toc.yaml @@ -1,5 +1,6 @@ +label: 系统资源与性能 isManual: true -label: '' +description: 介绍CPU,内存,I/O 及常用性能分析工具 sections: - label: 系统资源与性能 href: ./system_resources_and_performance.md diff --git a/docs/zh/server/performance/overall/system_resource/system_resources_and_performance.md b/docs/zh/server/performance/overall/system_resource/system_resources_and_performance.md index 552190781cf4e732059c6965cfa2edde7a9b631d..76bf9734fe40a6999d7a0d104abe529b98a83859 100644 --- a/docs/zh/server/performance/overall/system_resource/system_resources_and_performance.md +++ b/docs/zh/server/performance/overall/system_resource/system_resources_and_performance.md @@ -1,16 +1,7 @@ # 系统资源与性能 -- [系统资源与性能](#系统资源与性能) - - [CPU](#cpu) - - [内存](#内存) - - [I/O](#io) - ## CPU -- [基本概念](#基本概念) -- [定界定位思路](#定界定位思路) -- [常用CPU性能分析工具](#常用cpu性能分析工具) - ### 基本概念 中央处理器(Central Processing Unit,简称CPU)是计算机的主要设备之一,其功能是解释计算机指令以及处理计算机软件中的数据。 @@ -112,10 +103,6 @@ ## 内存 -- [基本概念](#基本概念) -- [定位定界思路](#定位定界思路) -- [常用内存分析工具/方式](#常用内存分析工具方式) - ### 基本概念 **内存**是计算机的重要组成部件,用于暂时存放CPU中的运算数据,以及与硬件等外部存储器交换的数据。特别地,**非统一内存访问架构**(non-uniform memory access,简称NUMA)是一种为多处理器的电脑设计的内存架构,**内存访问时间取决于内存相对于处理器的位置**。在NUMA下,处理器访问本地内存的速度比非本地内存速度(内存位于另一个处理器,或者是处理器之间共享的内存)快。 @@ -230,10 +217,6 @@ ## I/O -- [基本概念](#基本概念) -- [定位定界思路](#定位定界思路) -- [常用I/O性能分析工具](#常用io性能分析工具) - ### 基本概念 **I/O**表示输入(Input)/输出(Output),输入指系统接收信号或数据的操作,输出指从系统发出信号或数据的操作。对于CPU 和主存储器的组合,**任何信息传入或传出 CPU/内存组合,就会被认为是 I/O**。 diff --git a/docs/zh/server/performance/system_optimization/atune/_toc.yaml b/docs/zh/server/performance/system_optimization/atune/_toc.yaml index 10648873f40e2b7350de1ac077bda592fbfea14a..8b901ea82671dd7d84257501d13183c6554f9c21 100644 --- a/docs/zh/server/performance/system_optimization/atune/_toc.yaml +++ b/docs/zh/server/performance/system_optimization/atune/_toc.yaml @@ -1,11 +1,12 @@ +label: A-Tune 用户指南 isManual: true -label: '' +description: 利用人工智能技术,实现对 openEuler 系统性能的智能化、自动化调优 sections: - - label: 附录 - href: ./appendix.md - - label: 认识A-Tune + - label: 认识 A-Tune href: ./getting_to_know_a_tune.md - label: 安装与部署 - href: ./installation_and_deloyment.md + href: ./installation_and_deployment.md - label: 使用方法 href: ./usage_instructions.md + - label: 附录 + href: ./appendix.md diff --git a/docs/zh/server/performance/system_optimization/atune/appendix.md b/docs/zh/server/performance/system_optimization/atune/appendix.md index e2823caa826e4ca030bcf93ba656b6fe97ff9842..f727df6cf049b4ac41b4ebb0317a4e2c2be4ed29 100644 --- a/docs/zh/server/performance/system_optimization/atune/appendix.md +++ b/docs/zh/server/performance/system_optimization/atune/appendix.md @@ -1,11 +1,5 @@ # 附录 - -- [附录](#附录) - - [术语和缩略语](#术语和缩略语) - - - ## 术语和缩略语 **表 1** 术语表 diff --git a/docs/zh/server/performance/system_optimization/atune/getting_to_know_a_tune.md b/docs/zh/server/performance/system_optimization/atune/getting_to_know_a_tune.md index 66aad780f633ce1f160ec252c16d14d7a4f2f3d7..2d68b75b0cfcdc65ceb0f56ce6de1bda6a40076a 100644 --- a/docs/zh/server/performance/system_optimization/atune/getting_to_know_a_tune.md +++ b/docs/zh/server/performance/system_optimization/atune/getting_to_know_a_tune.md @@ -1,14 +1,5 @@ # 认识A-Tune - - -- [认识A-Tune](#认识A-Tune) - - [简介](#简介) - - [架构](#架构) - - [支持特性与业务模型](#支持特性与业务模型) - - - ## 简介 操作系统作为衔接应用和硬件的基础软件,如何调整系统和应用配置,充分发挥软硬件能力,从而使业务性能达到最优,对用户至关重要。然而,运行在操作系统上的业务类型成百上千,应用形态千差万别,对资源的要求各不相同。当前硬件和基础软件组成的应用环境涉及高达7000多个配置对象,随着业务复杂度和调优对象的增加,调优所需的时间成本呈指数级增长,导致调优效率急剧下降,调优成为了一项极其复杂的工程,给用户带来巨大挑战。 diff --git a/docs/zh/server/performance/system_optimization/atune/installation_and_deloyment.md b/docs/zh/server/performance/system_optimization/atune/installation_and_deployment.md similarity index 94% rename from docs/zh/server/performance/system_optimization/atune/installation_and_deloyment.md rename to docs/zh/server/performance/system_optimization/atune/installation_and_deployment.md index 86ef6623e15b3ece51a5419bda680d151f41f450..90286f01df843f3cfd80c1eb54411011e7e21ab9 100644 --- a/docs/zh/server/performance/system_optimization/atune/installation_and_deloyment.md +++ b/docs/zh/server/performance/system_optimization/atune/installation_and_deployment.md @@ -2,21 +2,6 @@ 本章介绍如何安装和部署A-Tune。 - - -- [安装与部署](#安装与部署) - - [软硬件要求](#软硬件要求) - - [环境准备](#环境准备) - - [安装A-Tune](#安装a-tune) - - [安装模式介绍](#安装模式介绍) - - [安装操作](#安装操作) - - [部署A-Tune](#部署a-tune) - - [配置介绍](#配置介绍) - - [启动A-Tune](#启动a-tune) - - [启动A-Tune engine](#启动a-tune-engine) - - - ## 软硬件要求 ### 硬件要求 @@ -135,9 +120,9 @@ A-Tune配置文件/etc/atuned/atuned.cnf的配置项说明如下: - interval:系统执行analysis流程时采集样本的间隔时间,默认为5s。 - grpc_tls:系统gRPC的SSL/TLS证书校验开关,默认不开启。开启grpc_tls后,atune-adm命令在使用前需要设置以下环境变量方可与服务端进行通讯: - export ATUNE_TLS=yes - - export ATUNED_CACERT=<客户端CA证书路径> - - export ATUNED_CLIENTCERT=<客户端证书路径> - - export ATUNED_CLIENTKEY=<客户端密钥路径> + - export ATUNED_CACERT=\<客户端CA证书路径> + - export ATUNED_CLIENTCERT=\<客户端证书路径> + - export ATUNED_CLIENTKEY=\<客户端密钥路径> - export ATUNED_SERVERCN=server - tlsservercafile:gRPC服务端CA证书路径。 - tlsservercertfile:gRPC服务端证书路径。 diff --git a/docs/zh/server/performance/system_optimization/atune/usage_instructions.md b/docs/zh/server/performance/system_optimization/atune/usage_instructions.md index d51d61c2fa3816e8d97986c4a0a34535630ba4f1..706f016115a10d9903088d0664f34191823eaf16 100644 --- a/docs/zh/server/performance/system_optimization/atune/usage_instructions.md +++ b/docs/zh/server/performance/system_optimization/atune/usage_instructions.md @@ -2,36 +2,6 @@ 用户可以通过命令行客户端atune-adm使用A-Tune提供的功能。本章介绍A-Tune客户端包含的功能和使用方法。 - - -- [使用方法](#使用方法) - - [总体说明](#总体说明) - - [查询负载类型](#查询负载类型) - - [list](#list) - - [分析负载类型并自优化](#分析负载类型并自优化) - - [analysis](#analysis) - - [自定义模型](#自定义模型) - - [define](#define) - - [collection](#collection) - - [train](#train) - - [undefine](#undefine) - - [查询profile](#查询profile) - - [info](#info) - - [更新profile](#更新profile) - - [update](#update) - - [激活profile](#激活profile) - - [profile](#profile) - - [回滚profile](#回滚profile) - - [rollback](#rollback) - - [更新数据库](#更新数据库) - - [upgrade](#upgrade) - - [系统信息查询](#系统信息查询) - - [check](#check) - - [参数自调优](#参数自调优) - - [tuning](#tuning) - - - ## 总体说明 - 使用A-Tune需要使用root权限。 diff --git a/docs/zh/server/quickstart/_toc.yaml b/docs/zh/server/quickstart/_toc.yaml index 6e7effa7c03eaa8dc0c2acdf0bf148fd379b20c6..3eafbb9e48784703fce6e084076432c0bbd90db7 100644 --- a/docs/zh/server/quickstart/_toc.yaml +++ b/docs/zh/server/quickstart/_toc.yaml @@ -1,5 +1,6 @@ +label: 快速入门 isManual: true -label: '' +description: 快速地安装和使用 openEuler 操作系统 sections: - label: 快速入门 href: ./quick_start.md diff --git a/docs/zh/server/quickstart/quick_start.md b/docs/zh/server/quickstart/quick_start.md index 91f12d92b379df47d5caf91cd59b595be5288b63..1cd0794a47bfd7525dd372a2f41a350cff2beaa0 100644 --- a/docs/zh/server/quickstart/quick_start.md +++ b/docs/zh/server/quickstart/quick_start.md @@ -1,17 +1,6 @@ # 快速入门 -本文档以TaiShan 200服务器上安装openEuler 22.03_LTS_SP4 为例,旨在指导用户快速地安装和使用openEuler操作系统,更详细的安装要求和安装方法请参考《[安装指南](./../Installation/installation.html)》。 - - -- [快速入门](#快速入门) - - [安装要求](#安装要求) - - [获取安装源](#获取安装源) - - [发布包完整性校验](#发布包完整性校验) - - [启动安装](#启动安装) - - [安装](#安装) - - [查看系统信息](#查看系统信息) - - +本文档以TaiShan 200服务器上安装openEuler 22.03_LTS_SP4 为例,旨在指导用户快速地安装和使用openEuler操作系统,更详细的安装要求和安装方法请参考《[安装指南](./../installation_upgrade/installation/installation_guide.md)》。 ## 安装要求 @@ -19,14 +8,17 @@ 支持的服务器类型如[表1](#table14948632047)所示。 **表 1** 支持的服务器类型 + | 服务器形态 | 服务器名称 | 服务器型号 | | :---- | :---- |:---- | | 机架服务器| TaiShan 200 | 2280均衡型 | | 机架服务器 | FusionServer Pro 机架服务器 | FusionServer Pro 2288H V5

说明:
服务器要求配置Avago 3508 RAID控制卡和启用LOM-X722网卡。| + - 最小硬件要求 最小硬件要求如[表2](#tff48b99c9bf24b84bb602c53229e2541)所示。 **表 2** 最小硬件要求 + | 部件名称 | 最小硬件要求 | 说明 | | :---- | :---- |:---- | | 架构 |
  • AArch64
  • x86_64
|
  • 支持Arm的64位架构。
  • 支持Intel的x86 64位架构。
| diff --git a/docs/zh/server/releasenotes/_toc.yaml b/docs/zh/server/releasenotes/_toc.yaml index 08098194df84210c6f0fad9125ce3ebab9730a3f..2125decb4da06f1f8b9123c969e68b93675083b5 100644 --- a/docs/zh/server/releasenotes/_toc.yaml +++ b/docs/zh/server/releasenotes/_toc.yaml @@ -1,33 +1,28 @@ +label: 发行说明 isManual: true -label: '' +description: openEuler 24.03 LTS SP1 版本的发行说明 sections: - - label: openEuler账号清单 - href: ./account_list.md - - label: 致谢 - href: ./acknowledgment.md - - label: 参与贡献 - href: ./contribution.md - - label: CVE漏洞 - href: ./cve.md - - label: 简介 + - label: 简介 href: ./introduction.md + - label: 法律声明 + href: ./terms_of_use.md + - label: 用户须知 + href: ./user_notice.md + - label: 帐号清单 + href: ./account_list.md + - label: 系统安装 + href: ./os_installation.md - label: 关键特性 href: ./key_features.md - label: 已知问题 href: ./known_issues.md - - label: 系统安装 - href: ./os_installation.md - - label: 组件分类 - href: ./README.md - - label: 发行说明 - href: ./release_notes.md - - label: 已修复问题 - href: ./resoluved_issues.md - - label: 源代码 + - label: 已修复问题 + href: ./resolved_issues.md + - label: CVE漏洞 + href: ./cve.md + - label: 源代码 href: ./source_code.md - - label: 法律声明 - href: ./terms_of_use.md - - label: 用户须知 - href: ./user_notice.md - - label: 版本发行说明 - href: ./zh-cn_bookmap_0225720059.md + - label: 参与贡献 + href: ./contribution.md + - label: 致谢 + href: ./acknowledgment.md diff --git a/docs/zh/server/releasenotes/release_notes.md b/docs/zh/server/releasenotes/release_notes.md deleted file mode 100644 index 9cdea7135e5aa86fa0928320deaf086b947560c4..0000000000000000000000000000000000000000 --- a/docs/zh/server/releasenotes/release_notes.md +++ /dev/null @@ -1,3 +0,0 @@ -# 发行说明 - -本文档是 openEuler 22.03 LTS SP4版本的发行说明。 diff --git a/docs/zh/server/releasenotes/resoluved_issues.md b/docs/zh/server/releasenotes/resolved_issues.md similarity index 100% rename from docs/zh/server/releasenotes/resoluved_issues.md rename to docs/zh/server/releasenotes/resolved_issues.md diff --git a/docs/zh/server/security/cert_signature/_toc.yaml b/docs/zh/server/security/cert_signature/_toc.yaml index 1d22cad66bbc838aa089deaf5b76bde76adfdf25..7eca5f90166716b4564fe91e8530c4e801aa1934 100644 --- a/docs/zh/server/security/cert_signature/_toc.yaml +++ b/docs/zh/server/security/cert_signature/_toc.yaml @@ -1,8 +1,7 @@ +label: 证书签名 isManual: true -label: '' +description: openEuler 签名平台提供签名服务,保护系统文件的完整性 sections: - - label: 证书签名使用指南 - href: ./certsignature.md - label: 认识证书和签名 href: ./overview_of_certificates_and_signatures.md - label: 安全启动 diff --git a/docs/zh/server/security/cert_signature/certsignature.md b/docs/zh/server/security/cert_signature/certsignature.md deleted file mode 100644 index 2b87409f668f76e548ce40adcf8971b1e04ecdbd..0000000000000000000000000000000000000000 --- a/docs/zh/server/security/cert_signature/certsignature.md +++ /dev/null @@ -1,3 +0,0 @@ -# 证书签名使用指南 - -由openEuler签名平台提供签名服务,突破开源社区签名私钥管理困难问题,解决了社区安全启动组件长期无签名的问题,实现社区秘钥的统一管理和安全启动功能,达到了增强系统完整性保护和秘钥规范性管理效果。 diff --git a/docs/zh/server/security/cert_signature/overview_of_certificates_and_signatures.md b/docs/zh/server/security/cert_signature/overview_of_certificates_and_signatures.md index f3650cd60563f7cfdd9df3c6d551725c7368e2b2..220934e8fceafdc9c2288cff2f7fa672b3af14d0 100644 --- a/docs/zh/server/security/cert_signature/overview_of_certificates_and_signatures.md +++ b/docs/zh/server/security/cert_signature/overview_of_certificates_and_signatures.md @@ -1,19 +1,23 @@ # 认识证书和签名 ## 概述 + 为了保护系统文件的完整性,需要使用密码学上的数字签名技术。 文件使用前,通常在软件构建或者发布阶段,使用私钥对文件进行签名。在运行软件时,使用证书中的公钥对签名进行验证。验证通过则说明文件没有被篡改,验证不通过则说明文件已损坏或者被篡改。 在上述验证过程中,私钥需要被安全妥善地管理和保存,一旦私钥泄露,则可能被用于恶意文件的签名,无法达到保护原始原始文件完整性的目的。 对文件签名进行校验的证书,通常预置在系统中,或者在软件运行时,由管理员将证书导入到系统中。 ## 背景 + 开源社区普遍存在私钥难以管理的特点,所以社区相应的组件通常缺少签名。要使用签名验签功能需要OSV厂商或者用户自己对文件进行签名后,才可以使用,这样增加了功能的使用成本并降低了易用性。 社区中RPM软件包等部分组件目前已有签名,但是通常私钥被公开或者由社区构建工程进行管理,存在泄漏和滥用风险。 ## 解决方案 + 从当前版本开始,openEuler使用社区签名平台进行公私钥对的生成和管理,并对社区文件提供签名服务。这样通过签名平台解决了社区秘钥管理的难点。 当前社区签名平台支持签名的文件类型有:安全启动功能相关的EFI启动文件类型和RPM软件包类型。后续可以进一步支持内核驱动文件ko, 应用程序,虚机镜像,容器镜像,ISO等类型的签名。 22.03-LTS-SP4版本中的工程发布件支持RPM软件包通过签名平台进行签名的能力,后续在部署使用22.03-LTS-SP4版本的工程发布件后,则可以使用签名平台对RPM进行签名。 ## 约束限制 + 当前社区签名平台功能只支持对openEuler社区内部构建的组件进行签名,暂不支持对外部工程构建的文件及客户文件进行签名。 -对外提供签名服务功能正在规划中。 \ No newline at end of file +对外提供签名服务功能正在规划中。 diff --git a/docs/zh/server/security/sbom/_toc.yaml b/docs/zh/server/security/sbom/_toc.yaml index 66470ab084d69415ede6801fed25a525da84c90e..92ad2c26a8368585187be474ff7503bf96a1d4aa 100644 --- a/docs/zh/server/security/sbom/_toc.yaml +++ b/docs/zh/server/security/sbom/_toc.yaml @@ -1,5 +1,6 @@ +label: SBOM用户指南 isManual: true -label: '' +description: SBOM 唯一标识软件组件及其内容 sections: - label: SBOM介绍 href: ./sbom.md diff --git a/docs/zh/server/security/secdetector/_toc.yaml b/docs/zh/server/security/secdetector/_toc.yaml index e461d6da752f8650573b7e26d43486b32f73c1bd..e414ce5b4dad42e48717ff8fa0410da9cd995d57 100644 --- a/docs/zh/server/security/secdetector/_toc.yaml +++ b/docs/zh/server/security/secdetector/_toc.yaml @@ -1,13 +1,12 @@ +label: secDetector 使用指南 isManual: true -label: '' +description: secDetector 是 OS 内构入侵检测系统,为关键信息基础设施提供入侵检测及响应能力 sections: - - label: 接口说明 - href: ./api_reference.md - - label: 安装 secDetector - href: ./install_secdetector.md - - label: 认识secDetector + - label: 认识 secDetector href: ./introduction_to_secdetector.md - - label: secDetector 使用指南 - href: ./secDetector.md + - label: 安装与部署 + href: ./install_secdetector.md + - label: 接口参考 + href: ./api_reference.md - label: 使用 secDetector href: ./using_secdetector.md diff --git a/docs/zh/server/security/secdetector/install_secdetector.md b/docs/zh/server/security/secdetector/install_secdetector.md index e62a2b95bb5dadc12d4a32a8fe7c445a623a7156..a00644b225734065bd78795e02991faffbd013f8 100644 --- a/docs/zh/server/security/secdetector/install_secdetector.md +++ b/docs/zh/server/security/secdetector/install_secdetector.md @@ -14,7 +14,7 @@ openEuler 22.03 LTS SP4 及以上。 ### 环境准备 -安装 openEuler 系统,安装方法参考《[安装指南](../Installation/installation.md)》。 +安装 openEuler 系统,安装方法参考《[安装指南](./../../installation_upgrade/installation/installation_guide.md)》。 ## 安装secDetector diff --git a/docs/zh/server/security/secdetector/secDetector.md b/docs/zh/server/security/secdetector/secDetector.md deleted file mode 100644 index e20d3fc09effae2c13b7125bad2a0ba932716600..0000000000000000000000000000000000000000 --- a/docs/zh/server/security/secdetector/secDetector.md +++ /dev/null @@ -1,5 +0,0 @@ -# secDetector 使用指南 - -本文档介绍 openEuler 操作系统内构入侵检测系统 secDetector 的架构、特性、安装、开发指导、落地应用场景等,帮助用户快速了解并使用 secDetector。 - -本文档适用于使用 openEuler 系统并希望了解和使用 secDetector 的社区开发者、开源爱好者以及相关合作伙伴。使用人员需要具备基本的Linux操作系统知识。 diff --git a/docs/zh/server/security/secdetector/using_secdetector.md b/docs/zh/server/security/secdetector/using_secdetector.md index cde169aab3aeb6a1bae29f1985bb49cd478fc424..20bb411d7b5bde7cdab914f3dcb401f76d92efd1 100644 --- a/docs/zh/server/security/secdetector/using_secdetector.md +++ b/docs/zh/server/security/secdetector/using_secdetector.md @@ -4,7 +4,7 @@ secDetector 提供了SDK,一个so库,用户可以在自己的应用程序中 ## 基本用法 -用户按照指南《[安装secDetector](./安装secDetector.md)》安装完secDetector之后,libsecDetectorsdk.so、secDetector_sdk.h、secDetector_topic.h就已经被部署到系统用户库默认路径中。 +用户按照指南《[安装secDetector](./install_secdetector.md)》安装完secDetector之后,libsecDetectorsdk.so、secDetector_sdk.h、secDetector_topic.h就已经被部署到系统用户库默认路径中。 1. 使用 C 或 C++ 开发的应用程序确保include路径包含后,可以首先在程序中引用这两个头文件。 @@ -13,7 +13,7 @@ secDetector 提供了SDK,一个so库,用户可以在自己的应用程序中 #include ``` -2. 参考指南《[接口参考](./接口参考.md)》调用SDK提供的接口访问secDetector。 +2. 参考指南《[接口参考](./api_reference.md)》调用SDK提供的接口访问secDetector。 1. 首先调用订阅接口secSub,订阅所需的主题。 2. 然后在独立线程中调用消息读取接口secReadFrom阻塞式的读取被订阅主题产生的信息。 diff --git a/docs/zh/server/security/secgear/_toc.yaml b/docs/zh/server/security/secgear/_toc.yaml index 26e0c80a2c9f7b46761e5a867529ea645c6259fa..b13acfe8570d827a4a53ecf94f38078e5efc5b80 100644 --- a/docs/zh/server/security/secgear/_toc.yaml +++ b/docs/zh/server/security/secgear/_toc.yaml @@ -1,11 +1,10 @@ +label: secGear 开发指南 isManual: true -label: '' +description: 使用 secGear 统一机密计算编程框架开发应用程序,保障云端数据运行时的安全性 sections: - - label: 接口说明 - href: ./api_reference.md - - label: 认识secGear + - label: 认识 secGear href: ./introduction_to_secgear.md - - label: secGear 开发指南 - href: ./secGear.md - - label: 安装 secGear + - label: 安装与部署 href: ./secgear_installation.md + - label: 接口说明 + href: ./api_reference.md diff --git a/docs/zh/server/security/secgear/secGear.md b/docs/zh/server/security/secgear/secGear.md deleted file mode 100644 index edfe5ba23cdc9e523420aa477528afc6108b85fa..0000000000000000000000000000000000000000 --- a/docs/zh/server/security/secgear/secGear.md +++ /dev/null @@ -1,4 +0,0 @@ -# secGear 开发指南 - -本文档介绍openEuler机密计算统一开发框架secGear的架构、特性、安装、开发指导等,帮助用户快速了解并使用secGear。 -本文档适用于使用openEuler系统并希望了解和使用secGear的社区开发者、开源爱好者以及相关合作伙伴。使用人员需要具备基本的Linux操作系统知识。 diff --git a/docs/zh/server/security/secgear/secgear_installation.md b/docs/zh/server/security/secgear/secgear_installation.md index cf83d50e832a04060e2c8bb502ad8dee7fe9715b..ce30412659e6d7e44e15888ca40479870c7bdd9a 100644 --- a/docs/zh/server/security/secgear/secgear_installation.md +++ b/docs/zh/server/security/secgear/secgear_installation.md @@ -28,11 +28,11 @@ openEuler 22.09 openEuler 22.03 LTS及以上 -### 环境准备 +### 环境准备 参考鲲鹏官网[环境要求](https://www.hikunpeng.com/document/detail/zh/kunpengcctrustzone/fg-tz/kunpengtrustzone_04_0006.html)和[搭建步骤](https://www.hikunpeng.com/document/detail/zh/kunpengcctrustzone/fg-tz/kunpengtrustzone_04_0007.html)。 -### 安装操作 +### 安装操作 1. 配置openEuler yum源,在线yum源或通过ISO挂载配置本地yum源,配置在线源如下(仅以22.03-LTS-SP4举例,其他版本需要使用版本对应的yum源)。 @@ -124,6 +124,3 @@ openEuler 22.03 LTS及以上 linux-sgx-driver-xxx libsgx-launch-xxx ``` - - - diff --git a/docs/zh/server/security/secharden/_toc.yaml b/docs/zh/server/security/secharden/_toc.yaml index 70a59f79b15ef6d83e460f866ed637d8c4cce3d0..a01a319ce34823c1503050c026139a8ad9c2a45b 100644 --- a/docs/zh/server/security/secharden/_toc.yaml +++ b/docs/zh/server/security/secharden/_toc.yaml @@ -1,27 +1,27 @@ +label: 安全加固指南 isManual: true -label: '' +description: 指导用户进行安全加固 sections: - - label: 帐户口令 - href: ./account_passwords.md - - label: 附录 - href: ./appendix.md - - label: 授权认证 - href: ./authentication_and_authenticationu.md - - label: 文件权限 - href: ./file_permissions.md - - label: 内核参数 - href: ./kernel_parameters.md - label: 操作系统加固概述 href: ./os_hardening_overview.md - - label: 安全加固指南 - href: ./secharden.md - - label: openEuler安全配置说明 + - label: 安全配置说明 href: ./security_configuration_benchmark.md - - label: 安全加固工具 - href: ./security_configuration_hardening_tool.md - label: 加固指导 - href: ./security_hardening_guide.md - - label: SELinux配置 - href: ./selinux_configuration.md - - label: 系统服务 - href: ./system_services.md + href: ./secharden.md + sections: + - label: 帐户口令 + href: ./account_passwords.md + - label: 授权认证 + href: ./authentication_and_authorization.md + - label: 系统服务 + href: ./system_services.md + - label: 文件权限 + href: ./file_permissions.md + - label: 内核参数 + href: ./kernel_parameters.md + - label: SELinux配置 + href: ./selinux_configuration.md + - label: 安全配置加固工具 + href: ./security_hardening_tool.md + - label: 附录 + href: ./appendix.md diff --git a/docs/zh/server/security/secharden/account_passwords.md b/docs/zh/server/security/secharden/account_passwords.md index c18d267ee02638a78a5c0f35dc95777f1afd1c55..c81b022878408c799ed02f9551461c8bfae9de89 100644 --- a/docs/zh/server/security/secharden/account_passwords.md +++ b/docs/zh/server/security/secharden/account_passwords.md @@ -1,14 +1,5 @@ # 帐户口令 -- [帐户口令](#帐户口令) - - [屏蔽系统帐户](#屏蔽系统帐户) - - [限制使用su命令的帐户](#限制使用su命令的帐户) - - [设置口令复杂度](#设置口令复杂度) - - [设置口令有效期](#设置口令有效期) - - [设置口令的加密算法](#设置口令的加密算法) - - [登录失败超过三次后锁定](#登录失败超过三次后锁定) - - [加固su命令](#加固su命令) - ## 屏蔽系统帐户 ### 说明 diff --git a/docs/zh/server/security/secharden/appendix.md b/docs/zh/server/security/secharden/appendix.md index 4f3eff1715b09bc701dd552a5d2f58a6d3b1125b..777aca0869a9a155e9366724c4037f06ce9f74a9 100644 --- a/docs/zh/server/security/secharden/appendix.md +++ b/docs/zh/server/security/secharden/appendix.md @@ -2,14 +2,6 @@ 介绍文件权限的含义和umask值的含义。 - - -- [附录](#附录) - - [文件和目录权限含义](#文件和目录权限含义) - - [umask值含义](#umask值含义) - - - ## 文件和目录权限含义 Linux系统中文件和目录权限用于限定谁能通过何种方式对文件和目录进行访问和操作。文件和目录的访问权限分为只读,只写和可执行三种。 diff --git a/docs/zh/server/security/secharden/authentication_and_authenticationu.md b/docs/zh/server/security/secharden/authentication_and_authorization.md similarity index 92% rename from docs/zh/server/security/secharden/authentication_and_authenticationu.md rename to docs/zh/server/security/secharden/authentication_and_authorization.md index 9df9492b9c1021be9bfbf757f8e2dee70c23f92a..39e40ead9675382be2ce6330aec73e807a0be707 100644 --- a/docs/zh/server/security/secharden/authentication_and_authenticationu.md +++ b/docs/zh/server/security/secharden/authentication_and_authorization.md @@ -1,14 +1,5 @@ # 授权认证 -- [授权认证](#授权认证) - - [设置网络远程登录的警告信息](#设置网络远程登录的警告信息) - - [禁止通过“Ctrl+Alt+Del”重启系统](#禁止通过ctrlaltdel重启系统) - - [设置终端的自动退出时间](#设置终端的自动退出时间) - - [设置用户的默认umask值为077](#设置用户的默认umask值为077) - - [设置GRUB2加密口令](#设置grub2加密口令) - - [安全单用户模式](#安全单用户模式) - - [禁止交互式启动](#禁止交互式启动) - ## 设置网络远程登录的警告信息 ### 说明 diff --git a/docs/zh/server/security/secharden/file_permissions.md b/docs/zh/server/security/secharden/file_permissions.md index 673dae429ab737a3c42074357b06c4b2c755146d..64057e693944a1147f7d23b9d8ea1abf70cd7182 100644 --- a/docs/zh/server/security/secharden/file_permissions.md +++ b/docs/zh/server/security/secharden/file_permissions.md @@ -1,16 +1,5 @@ # 文件权限 -- [文件权限](#文件权限) - - [设置文件的权限和属主](#设置文件的权限和属主) - - [删除无主文件](#删除无主文件) - - [处理空链接文件](#处理空链接文件) - - [设置守护进程的umask值](#设置守护进程的umask值) - - [为全局可写目录添加粘滞位属性](#为全局可写目录添加粘滞位属性) - - [删除非授权文件的全局可写属性](#删除非授权文件的全局可写属性) - - [限制at命令的使用权限](#限制at命令的使用权限) - - [限制cron命令的使用权限](#限制cron命令的使用权限) - - [限制sudo命令的使用权限](#限制sudo命令的使用权限) - ## 设置文件的权限和属主 ### 说明 diff --git a/docs/zh/server/security/secharden/kernel_parameters.md b/docs/zh/server/security/secharden/kernel_parameters.md index 601af0fda82d08d070ad24b14a0285c52f39b1df..a0e308fe32351a40ab2c068e6d1f1b66959d94c3 100644 --- a/docs/zh/server/security/secharden/kernel_parameters.md +++ b/docs/zh/server/security/secharden/kernel_parameters.md @@ -1,8 +1,5 @@ # 内核参数 -- [内核参数](#内核参数) - - [加固内核参数](#加固内核参数) - ## 加固内核参数 ### 说明 diff --git a/docs/zh/server/security/secharden/os_hardening_overview.md b/docs/zh/server/security/secharden/os_hardening_overview.md index 57519b7ab801b8877e8d7837406934b05f76ddad..b0abf2aa01bf5a1c48f18d984c0781c8a1fe634f 100644 --- a/docs/zh/server/security/secharden/os_hardening_overview.md +++ b/docs/zh/server/security/secharden/os_hardening_overview.md @@ -1,15 +1,6 @@ - # 操作系统加固概述 介绍对openEuler系统进行加固的目的和加固方案。 - - -- [操作系统加固概述](#操作系统加固概述) - - [加固目的](#加固目的) - - [加固方案](#加固方案) - - [加固影响](#加固影响) - - ## 须知 diff --git a/docs/zh/server/security/secharden/security_configuration_benchmark.md b/docs/zh/server/security/secharden/security_configuration_benchmark.md index 1f12011defdaf8af964a937023d798d6b08302b1..642d6480f44fe0e7b4ef51515c455192fc4e9bb5 100644 --- a/docs/zh/server/security/secharden/security_configuration_benchmark.md +++ b/docs/zh/server/security/secharden/security_configuration_benchmark.md @@ -1,3 +1,3 @@ # openEuler安全配置说明 -详细内容请参考[openEuler安全配置说明](https://gitee.com/openeuler/security-committee/tree/master/secure-configuration-benchmark)。 +详细内容请参考[openEuler安全配置说明](https://gitee.com/openeuler/security-committee/tree/master/sub-projects/secure-configuration-benchmark)。 diff --git a/docs/zh/server/security/secharden/security_hardening_guide.md b/docs/zh/server/security/secharden/security_hardening_guide.md deleted file mode 100644 index d8f4f7cd5b1e0c5d07d9c7c33b62a4cfac5965ab..0000000000000000000000000000000000000000 --- a/docs/zh/server/security/secharden/security_hardening_guide.md +++ /dev/null @@ -1,3 +0,0 @@ -# 加固指导 - -用户可以通过修改加固策略配置文件或加固脚本进行系统加固。本节介绍各加固项的含义以及openEuler是否已默认加固,并给出加固方法,指导用户进行安全加固。 diff --git a/docs/zh/server/security/secharden/security_configuration_hardening_tool.md b/docs/zh/server/security/secharden/security_hardening_tool.md similarity index 94% rename from docs/zh/server/security/secharden/security_configuration_hardening_tool.md rename to docs/zh/server/security/secharden/security_hardening_tool.md index d02ea2cfd5a5d49dcea2c4cf24f75983cefb48de..f7de0b75905821ee8e917089daa5047732ee62a4 100644 --- a/docs/zh/server/security/secharden/security_configuration_hardening_tool.md +++ b/docs/zh/server/security/secharden/security_hardening_tool.md @@ -1,16 +1,10 @@ # 安全加固工具 - -- [安全加固工具](#安全加固工具) - - [加固操作](#加固操作) - - [加固生效](#加固生效) - - ## 加固操作 ### 概述 -安全加固工具会根据usr-security.conf设置加固策略,使用加固工具设置加固策略需要用户修改usr-security.conf。本节介绍usr-security.conf的修改规则。用户可配置的加固项请参见[加固指导](./%E5%8A%A0%E5%9B%BA%E6%8C%87%E5%AF%BC.html)对应内容。 +安全加固工具会根据usr-security.conf设置加固策略,使用加固工具设置加固策略需要用户修改usr-security.conf。本节介绍usr-security.conf的修改规则。用户可配置的加固项请参见[加固指导](./secharden.md)对应内容。 ### 注意事项 diff --git a/docs/zh/server/security/secharden/system_services.md b/docs/zh/server/security/secharden/system_services.md index 1480dc60492460a4758385fd973d255bcce42a77..47845755aaabb8ce3fba295947692df856bde62b 100644 --- a/docs/zh/server/security/secharden/system_services.md +++ b/docs/zh/server/security/secharden/system_services.md @@ -1,8 +1,5 @@ # 系统服务 -- [系统服务](#系统服务) - - [加固SSH服务](#加固SSH服务) - ## 加固SSH服务 ### 说明 diff --git a/docs/zh/server/security/trusted_computing/_toc.yaml b/docs/zh/server/security/trusted_computing/_toc.yaml new file mode 100644 index 0000000000000000000000000000000000000000..67bc13596dffb9b3aaab282a273bc0d91ab5aed4 --- /dev/null +++ b/docs/zh/server/security/trusted_computing/_toc.yaml @@ -0,0 +1,6 @@ +label: 可信计算 +isManual: true +description: 介绍可信计算的定义和相关概念 +sections: + - label: 可信计算定义 + href: ./trusted_computing.md diff --git a/docs/zh/server/security/trusted_computing/trusted_computing.md b/docs/zh/server/security/trusted_computing/trusted_computing.md index a6c921ab9edae672e570b0cf9d8b37c1aa18e0c6..e655133c36005f5e0068bdd48f4770c8faeb872d 100644 --- a/docs/zh/server/security/trusted_computing/trusted_computing.md +++ b/docs/zh/server/security/trusted_computing/trusted_computing.md @@ -1,27 +1,5 @@ # 可信计算 - - -- [可信计算](#可信计算) - - [可信计算基础](#可信计算基础) - - [可信计算](#可信计算-1) - - [内核完整性度量(IMA)](#内核完整性度量ima) - - [概述](#概述) - - [约束限制](#约束限制) - - [使用场景](#使用场景) - - [操作指导](#操作指导) - - [FAQ](#faq) - - [附录](#附录) - - [远程证明(鲲鹏安全库)](#远程证明鲲鹏安全库) - - [介绍](#介绍) - - [软件架构](#软件架构) - - [安装配置](#安装配置) - - [相关参数](#相关参数) - - [接口定义](#接口定义) - - [FAQ](#faq-1) - - - ## 可信计算基础 ### 可信计算