From 7e3aefbbe94dd7035c78fde715479b396b000af6 Mon Sep 17 00:00:00 2001 From: "shankailun.skl" Date: Mon, 25 Jul 2022 15:26:45 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E6=A8=A1=E7=89=88=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- anolis-courses/KeenTune/auto-tuning/step1.md | 3 +- anolis-courses/KeenTune/auto-tuning/step2.md | 5 +- anolis-courses/KeenTune/auto-tuning/step3.md | 5 +- anolis-courses/KeenTune/auto-tuning/step4.md | 12 +--- anolis-courses/KeenTune/auto-tuning/step5.md | 4 +- anolis-courses/KeenTune/auto-tuning/step6.md | 4 +- anolis-courses/KeenTune/auto-tuning/step7.md | 3 +- anolis-courses/KeenTune/auto-tuning/step8.md | 5 +- anolis-courses/KeenTune/sensitizing/step4.md | 4 +- anolis-courses/abs/create_package/step5.md | 6 +- .../anolis_install_DDE/install_dde/step1.md | 34 +++++------ .../anolis_install_DDE/install_dde/step2.md | 5 +- .../anolis_install_DDE/install_dde/step3.md | 4 +- .../anolis_install_DDE/install_dde/step4.md | 2 +- .../appliation-devel/java_web/step2.md | 24 ++++---- .../cloud-native/compile_runD/step2.md | 9 +-- .../cloud-native/compile_runD/step4.md | 20 +++---- .../cloud-native/running_runD/step1.md | 4 +- .../cloud-native/running_runD/step2.md | 9 +-- .../cloud-native/running_runD/step3.md | 6 +- .../cloud-native/running_runD/step4.md | 58 +++++++++---------- 21 files changed, 95 insertions(+), 131 deletions(-) diff --git a/anolis-courses/KeenTune/auto-tuning/step1.md b/anolis-courses/KeenTune/auto-tuning/step1.md index a138309..4cceca7 100644 --- a/anolis-courses/KeenTune/auto-tuning/step1.md +++ b/anolis-courses/KeenTune/auto-tuning/step1.md @@ -1,3 +1,2 @@ 1. 运行下面的命令启动KeenTune服务 - - [[ systemctl restart keentuned keentune-target]] \ No newline at end of file +[[ systemctl restart keentuned keentune-target]] \ No newline at end of file diff --git a/anolis-courses/KeenTune/auto-tuning/step2.md b/anolis-courses/KeenTune/auto-tuning/step2.md index d307ab8..544b5f4 100644 --- a/anolis-courses/KeenTune/auto-tuning/step2.md +++ b/anolis-courses/KeenTune/auto-tuning/step2.md @@ -1,3 +1,2 @@ -1. KeenTune提供了wrk的执行脚本,运行该脚本获得性能基准值(baseline) - - [[ python3 /etc/keentune/benchmark/wrk/wrk_http_long.py localhost ]] \ No newline at end of file +1. KeenTune提供了wrk的执行脚本,运行该脚本获得性能基准值(baseline) +[[ python3 /etc/keentune/benchmark/wrk/wrk_http_long.py localhost ]] \ No newline at end of file diff --git a/anolis-courses/KeenTune/auto-tuning/step3.md b/anolis-courses/KeenTune/auto-tuning/step3.md index bf96b89..058df29 100644 --- a/anolis-courses/KeenTune/auto-tuning/step3.md +++ b/anolis-courses/KeenTune/auto-tuning/step3.md @@ -1,3 +1,2 @@ -1. 查询KeenTune内置的可调优的参数配置文件 - - [[ keentune param list ]] \ No newline at end of file +1. 查询KeenTune内置的可调优的参数配置文件 +[[ keentune param list ]] \ No newline at end of file diff --git a/anolis-courses/KeenTune/auto-tuning/step4.md b/anolis-courses/KeenTune/auto-tuning/step4.md index 13485bd..5f1e604 100644 --- a/anolis-courses/KeenTune/auto-tuning/step4.md +++ b/anolis-courses/KeenTune/auto-tuning/step4.md @@ -1,13 +1,7 @@ 我们将会用到sysctl.json和nginx.json两个文件分别对内核参数和nginx参数进行调优 1. 查看要调优的内核参数 - - [[ cat /etc/keentune/parameter/sysctl.json ]] - +[[ cat /etc/keentune/parameter/sysctl.json ]] 2. 查看要调优的nginx配置参数 - - [[ cat /etc/keentune/parameter/nginx.json ]] - +[[ cat /etc/keentune/parameter/nginx.json ]] 3. 这两个参数已经在keentune的配置文件中指定, 可以通过以下命令查看 - - [[ cat /etc/keentune/conf/keentuned.conf ]] - +[[ cat /etc/keentune/conf/keentuned.conf ]] \ No newline at end of file diff --git a/anolis-courses/KeenTune/auto-tuning/step5.md b/anolis-courses/KeenTune/auto-tuning/step5.md index a0b4ea4..2622c91 100644 --- a/anolis-courses/KeenTune/auto-tuning/step5.md +++ b/anolis-courses/KeenTune/auto-tuning/step5.md @@ -1,4 +1,2 @@ 1. 我们直接使用keentune param tune命令发起一次动态调优,使用-i指定调优轮次,--job指定任务名 - - [[ keentune param tune -i 20 --job http_long_test ]] - +[[ keentune param tune -i 20 --job http_long_test ]] \ No newline at end of file diff --git a/anolis-courses/KeenTune/auto-tuning/step6.md b/anolis-courses/KeenTune/auto-tuning/step6.md index 3023aeb..6b2a819 100644 --- a/anolis-courses/KeenTune/auto-tuning/step6.md +++ b/anolis-courses/KeenTune/auto-tuning/step6.md @@ -1,5 +1,3 @@ 1. 调优过程会保存在日志中,我们使用tail命令查看调优过程日志 - - [[ tail -f /var/log/keentune/http_long_test.log ]] - +[[ tail -f /var/log/keentune/http_long_test.log ]] 2. 等待调优结束, 日志中出现``[best] Tuning improvement``数据 \ No newline at end of file diff --git a/anolis-courses/KeenTune/auto-tuning/step7.md b/anolis-courses/KeenTune/auto-tuning/step7.md index d596d75..ff1e629 100644 --- a/anolis-courses/KeenTune/auto-tuning/step7.md +++ b/anolis-courses/KeenTune/auto-tuning/step7.md @@ -1,3 +1,2 @@ 1. 我们再一次执行benchmark来查看调优效果 - - [[ python3 /etc/keentune/benchmark/wrk/wrk_http_long.py localhost ]] \ No newline at end of file +[[ python3 /etc/keentune/benchmark/wrk/wrk_http_long.py localhost ]] \ No newline at end of file diff --git a/anolis-courses/KeenTune/auto-tuning/step8.md b/anolis-courses/KeenTune/auto-tuning/step8.md index b31e2e1..1e61488 100644 --- a/anolis-courses/KeenTune/auto-tuning/step8.md +++ b/anolis-courses/KeenTune/auto-tuning/step8.md @@ -1,3 +1,2 @@ -1. 最后我们使用rollback命令恢复环境默认参数 - - [[ keentune param rollback ]] +1. 最后我们使用rollback命令恢复环境默认参数 +[[ keentune param rollback ]] \ No newline at end of file diff --git a/anolis-courses/KeenTune/sensitizing/step4.md b/anolis-courses/KeenTune/sensitizing/step4.md index ec7e69d..41b8317 100644 --- a/anolis-courses/KeenTune/sensitizing/step4.md +++ b/anolis-courses/KeenTune/sensitizing/step4.md @@ -1,5 +1,3 @@ 1. 使用tail命令查看参数识别过程日志 - - [[ tail -f /var/log/keentune/keentuned-sensitize-train-http_long_train.log ]] - +[[ tail -f /var/log/keentune/keentuned-sensitize-train-http_long_train.log ]] 2. 等待参数识别完成,我们就可以在日志中看到参数敏感性排序 \ No newline at end of file diff --git a/anolis-courses/abs/create_package/step5.md b/anolis-courses/abs/create_package/step5.md index d658462..9153d5c 100644 --- a/anolis-courses/abs/create_package/step5.md +++ b/anolis-courses/abs/create_package/step5.md @@ -4,13 +4,13 @@ 2. 在龙蜥实验室的机器上,进入yum配置目录。 - [[ cd /etc/yum.repos.d ]] +[[ cd /etc/yum.repos.d ]] 3. 新建文件,并将1中的yum源文本复制到新建的文件中,保存退出,文件名可以任意,但是必须以.repo结尾,推荐使用AnolisOS-Build.repo。 - [[ vim AnolisOS-Build.repo ]] +[[ vim AnolisOS-Build.repo ]] -5. 使用命令安装已构建的软件包,图为示例。 +4. 使用命令安装已构建的软件包,图为示例。 [[ yum install dmidecode ]] diff --git a/anolis-courses/anolis_install_DDE/install_dde/step1.md b/anolis-courses/anolis_install_DDE/install_dde/step1.md index ec0494e..003f750 100644 --- a/anolis-courses/anolis_install_DDE/install_dde/step1.md +++ b/anolis-courses/anolis_install_DDE/install_dde/step1.md @@ -2,29 +2,29 @@ 1. 安装软件仓库配置工具。 - [[ sudo yum install yum-utils ]] +[[ sudo yum install yum-utils ]] 2. 开启DDE软件仓库。 - [[ sudo yum-config-manager --enable DDE ]] +[[ sudo yum-config-manager --enable DDE ]] 3. 修改系统软件仓库配置中的仓库地址。 - [[ sed -i "s/\$releasever/8\.4/g" \`find /etc/yum.repos.d/ -name *.repo ]] +[[ sed -i "s/\$releasever/8\.4/g" \`find /etc/yum.repos.d/ -name *.repo ]] 4. 修改Anolis-DDE.repo文件内容。 - [[ - [DDE] - name=AnolisOS-8.4 - DDE - baseurl=http://mirrors.openanolis.cn/anolis/8.4/DDE/$basearch/os - enabled=1 - gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ANOLIS - gpgcheck=1 - [epel] - name=epel - baseurl=https://archives.fedoraproject.org/pub/archive/epel/8.3.2021-05-20/Everything/$basearch/ - enabled=1 - gpgkey=http://mirrors.aliyun.com/epel/RPM-GPG-KEY-EPEL-8 - gpgcheck=0 - ]] +[[ + [DDE] + name=AnolisOS-8.4 - DDE + baseurl=http://mirrors.openanolis.cn/anolis/8.4/DDE/$basearch/os + enabled=1 + gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ANOLIS + gpgcheck=1 + [epel] + name=epel + baseurl=https://archives.fedoraproject.org/pub/archive/epel/8.3.2021-05-20/Everything/$basearch/ + enabled=1 + gpgkey=http://mirrors.aliyun.com/epel/RPM-GPG-KEY-EPEL-8 + gpgcheck=0 + ]] diff --git a/anolis-courses/anolis_install_DDE/install_dde/step2.md b/anolis-courses/anolis_install_DDE/install_dde/step2.md index 10b755e..2a668d0 100644 --- a/anolis-courses/anolis_install_DDE/install_dde/step2.md +++ b/anolis-courses/anolis_install_DDE/install_dde/step2.md @@ -1,8 +1,7 @@ 1. 清除系统软件包缓存。 - [[ sudo yum clean all && yum makecache ]] +[[ sudo yum clean all && yum makecache ]] 2. DDE软件包安装。 - - [[ sudo yum groupinstall dde ]] +[[ sudo yum groupinstall dde ]] diff --git a/anolis-courses/anolis_install_DDE/install_dde/step3.md b/anolis-courses/anolis_install_DDE/install_dde/step3.md index 95cd658..9ce920f 100644 --- a/anolis-courses/anolis_install_DDE/install_dde/step3.md +++ b/anolis-courses/anolis_install_DDE/install_dde/step3.md @@ -1,6 +1,6 @@ 1. 软件包安装完成后进行系统窗口管理器设置。 - [[ sudo systemctl disable gdm ]] +[[ sudo systemctl disable gdm ]] - [[ sudo systemctl enable lightdm ]] +[[ sudo systemctl enable lightdm ]] diff --git a/anolis-courses/anolis_install_DDE/install_dde/step4.md b/anolis-courses/anolis_install_DDE/install_dde/step4.md index 35cc810..5336c67 100644 --- a/anolis-courses/anolis_install_DDE/install_dde/step4.md +++ b/anolis-courses/anolis_install_DDE/install_dde/step4.md @@ -1,6 +1,6 @@ 1. 设置成功,重启即可进入Anolis OS系统 DDE桌面环境。 - [[ reboot ]] +[[ reboot ]] 2. 重新连接并进入系统。 diff --git a/anolis-courses/appliation-devel/java_web/step2.md b/anolis-courses/appliation-devel/java_web/step2.md index d641b62..d8c7c7c 100644 --- a/anolis-courses/appliation-devel/java_web/step2.md +++ b/anolis-courses/appliation-devel/java_web/step2.md @@ -1,34 +1,34 @@ 1. 执行以下命令,下载并安装MySQL官方的Yum Repository。 - [[ wget http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm ]] + [[ wget http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm ]] - [[ yum -y install mysql57-community-release-el7-10.noarch.rpm ]] + [[ yum -y install mysql57-community-release-el7-10.noarch.rpm ]] - [[ yum -y install * --nogpgcheck mysql-community-server ]] + [[ yum -y install * --nogpgcheck mysql-community-server ]] 2. 执行以下命令,启动 MySQL 数据库。 - [[ systemctl start mysqld.service ]] + [[ systemctl start mysqld.service ]] 3. 执行以下命令,查看MySQL初始密码。 - [[ grep "password" /var/log/mysqld.log ]] + [[ grep "password" /var/log/mysqld.log ]] 4. 执行以下命令,输入上条命令中MySQL初始密码,登录数据库。 - [[ mysql -uroot -p ]] + [[ mysql -uroot -p ]] -5. 执行以下命令,修改MySQL默认密码。修改密码安全策略为低(只校验密码长度,至少8位) +5. 执行以下命令,修改MySQL默认密码。#修改密码安全策略为低(只校验密码长度,至少8位) - [[ set global validate_password_policy=0; ]] + [[ set global validate_password_policy=0; ]] - [[ ALTER USER 'root'@'localhost' IDENTIFIED BY '12345678'; ]] + [[ ALTER USER 'root'@'localhost' IDENTIFIED BY '12345678'; ]] -7. 执行以下命令,授予root用户远程管理权限。 +6. 执行以下命令,授予root用户远程管理权限。 - [[ GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '12345678'; ]] + [[ GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '12345678'; ]] -8. 输入exit退出数据库。 +7. 输入exit退出数据库。 diff --git a/anolis-courses/cloud-native/compile_runD/step2.md b/anolis-courses/cloud-native/compile_runD/step2.md index cb479a0..1ef5c91 100644 --- a/anolis-courses/cloud-native/compile_runD/step2.md +++ b/anolis-courses/cloud-native/compile_runD/step2.md @@ -1,9 +1,6 @@ 1. 默认机器上没有安装git,需要先下载git工具 - - [[ yum install git -y ]] +[[ yum install git -y ]] 2. 下载runD的代码 - - [[ git clone https://github.com/openanolis/kata-containers.git ]] - - [[ cd kata-containers && git checkout preview ]] +[[ git clone https://github.com/openanolis/kata-containers.git ]] +[[ cd kata-containers && git checkout preview ]] diff --git a/anolis-courses/cloud-native/compile_runD/step4.md b/anolis-courses/cloud-native/compile_runD/step4.md index ff08f8e..e609ee6 100644 --- a/anolis-courses/cloud-native/compile_runD/step4.md +++ b/anolis-courses/cloud-native/compile_runD/step4.md @@ -1,18 +1,16 @@ 1. 开始编译最新修改的runD代码 +[[ repo-root-dir=/root/kata-containers ]] - [[ repo-root-dir=/root/kata-containers ]] +[[ container-image=cloud-native-registry.cn-shanghai.cr.aliyuncs.com/runtime/rund:shim-builder-latest ]] - [[ container-image=cloud-native-registry.cn-shanghai.cr.aliyuncs.com/runtime/rund:shim-builder-latest ]] - - [[ nerdctl run --rm -i -v "${repo-root-dir}:${repo-root-dir}" \ - -w "${repo-root-dir}/src/runtime-rs" \ - "${container-image}" \ - bash -c "git config --global --add safe.directory ${repo-root-dir} && make -j8" ]] +[[ nerdctl run --rm -i -v "${repo-root-dir}:${repo-root-dir}" \ + -w "${repo-root-dir}/src/runtime-rs" \ + "${container-image}" \ + bash -c "git config --global --add safe.directory ${repo-root-dir} && make -j8" ]] 2. 上面编译需要一段时间,需要等编译完,然后运行下面的命令替换最新的runD,并运行查看日志结果 +[[ cp $repo-root-dir/src/runtime-rs/target/x86_64-unknown-linux-musl/release/containerd-shim-kata-v2 /opt/kata/bin/containerd-shim-rund-v2 ]] - [[ cp $repo-root-dir/src/runtime-rs/target/x86_64-unknown-linux-musl/release/containerd-shim-kata-v2 /opt/kata/bin/containerd-shim-rund-v2 ]] - - [[ time nerdctl run --runtime io.containerd.rund.v2 busybox /bin/sh -c "uname -a" ]] +[[ time nerdctl run --runtime io.containerd.rund.v2 busybox /bin/sh -c "uname -a" ]] - [[ journalctl -t containerd -r | grep "start vm for myself" ]] +[[ journalctl -t containerd -r | grep "start vm for myself" ]] diff --git a/anolis-courses/cloud-native/running_runD/step1.md b/anolis-courses/cloud-native/running_runD/step1.md index b2193cb..3e06263 100644 --- a/anolis-courses/cloud-native/running_runD/step1.md +++ b/anolis-courses/cloud-native/running_runD/step1.md @@ -1,6 +1,4 @@ 1. 物理机环境,或者神龙服务器环境,上面不需要安装docker,containerd,nerdctl,只需要一个干净环境即可 运行下面的命令一键式安装与部署runD - - [[ curl https://cloud-native.oss-cn-shanghai.aliyuncs.com/runtime/install-rund-nerdctl.sh -sSf | sh -s ]] - +[[ curl https://cloud-native.oss-cn-shanghai.aliyuncs.com/runtime/install-rund-nerdctl.sh -sSf | sh -s ]] 需要稍微等一会下载安装包与镜像,以及安装部署 diff --git a/anolis-courses/cloud-native/running_runD/step2.md b/anolis-courses/cloud-native/running_runD/step2.md index a118b26..c578189 100644 --- a/anolis-courses/cloud-native/running_runD/step2.md +++ b/anolis-courses/cloud-native/running_runD/step2.md @@ -1,12 +1,9 @@ 1. 环境已经部署上了nerdctl, 第一步是下载运行容器需要的镜像 - - [[ nerdctl pull busybox ]] +[[ nerdctl pull busybox ]] 2. 直接可以使用runtime为rund来运行下载的busybox镜像,并运行一个命令,现在是uname 同时可以查看当前运行的时间 - - [[ time nerdctl run --runtime io.containerd.rund.v2 busybox /bin/sh -c "uname -a" ]] +[[ time nerdctl run --runtime io.containerd.rund.v2 busybox /bin/sh -c "uname -a" ]] 3. 还可以运行qemu作为安全容器的vmm作为对比,可以看到rund启动时间会快很多 - - [[ time nerdctl run --runtime io.containerd.kata-qemu.v2 busybox /bin/sh -c "uname -a" ]] +[[ time nerdctl run --runtime io.containerd.kata-qemu.v2 busybox /bin/sh -c "uname -a" ]] diff --git a/anolis-courses/cloud-native/running_runD/step3.md b/anolis-courses/cloud-native/running_runD/step3.md index 8251b2d..16572df 100644 --- a/anolis-courses/cloud-native/running_runD/step3.md +++ b/anolis-courses/cloud-native/running_runD/step3.md @@ -1,7 +1,5 @@ 1. 使用ctr命令同样可以run起来runD,直接通过runtime指定使用rund - - [[ time ctr run --runtime "io.containerd.rund.v2" -d docker.io/library/busybox:latest test-rund /bin/sh ]] +[[ time ctr run --runtime "io.containerd.rund.v2" -d docker.io/library/busybox:latest test-rund /bin/sh ]] 2. 同样可以使用qemu做对比 - - [[ time ctr run --runtime "io.containerd.kata-qemu.v2" -d docker.io/library/busybox:latest test-qemu2 /bin/sh ]] +[[ time ctr run --runtime "io.containerd.kata-qemu.v2" -d docker.io/library/busybox:latest test-qemu2 /bin/sh ]] diff --git a/anolis-courses/cloud-native/running_runD/step4.md b/anolis-courses/cloud-native/running_runD/step4.md index 185fd83..899efa1 100644 --- a/anolis-courses/cloud-native/running_runD/step4.md +++ b/anolis-courses/cloud-native/running_runD/step4.md @@ -1,44 +1,38 @@ 1. 下面使用crictl来启动rund,需要先安装crictl命令工具 - - [[ wget https://cloud-native.oss-cn-shanghai.aliyuncs.com/runtime/crictl-v1.24.2-linux-amd64.tar.gz ]] +[[ wget https://cloud-native.oss-cn-shanghai.aliyuncs.com/runtime/crictl-v1.24.2-linux-amd64.tar.gz ]] 2. 解压安装包 - - [[ tar -zxvf crictl-v1.24.2-linux-amd64.tar.gz -C /usr/local/bin/ ]] +[[ tar -zxvf crictl-v1.24.2-linux-amd64.tar.gz -C /usr/local/bin/ ]] 3. 配置crictl命令 - - [[ cat << EOF > /etc/crictl.yaml - runtime-endpoint: unix:///run/containerd/containerd.sock - image-endpoint: unix:///run/containerd/containerd.sock - timeout: 10 - debug: false - EOF ]] +[[ cat << EOF > /etc/crictl.yaml +runtime-endpoint: unix:///run/containerd/containerd.sock +image-endpoint: unix:///run/containerd/containerd.sock +timeout: 10 +debug: false +EOF ]] 4. 使用crictl来pull需要启动的镜像 - - [[ crictl pull busybox ]] +[[ crictl pull busybox ]] 5. 添加运行pod的配置文件 - - [[ cat << EOF > sandbox-config.json - { - "metadata": { - "name": "test-sandbox", - "namespace": "default", - "attempt": 1, - "uid": "95cb1cf47c4abb12d437f3" - }, - "linux": { - "security_context": { - "namespace_options": { - "network" : 2 - } - } - } +[[ cat << EOF > sandbox-config.json +{ + "metadata": { + "name": "test-sandbox", + "namespace": "default", + "attempt": 1, + "uid": "95cb1cf47c4abb12d437f3" + }, + "linux": { + "security_context": { + "namespace_options": { + "network" : 2 + } + } } - EOF ]] +} +EOF ]] 6. 使用rund来运行pod - - [[ crictl runp -r rund sandbox-config.json ]] +[[ crictl runp -r rund sandbox-config.json ]] -- Gitee