From 6e70e99d341a38548f1bb24aa2ddc0c33c90aee2 Mon Sep 17 00:00:00 2001 From: yongchao Date: Tue, 19 Jul 2022 15:44:41 +0800 Subject: [PATCH 1/4] add readme Signed-off-by: yongchao --- README.md | 164 ++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 140 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 4758376..a009525 100644 --- a/README.md +++ b/README.md @@ -1,37 +1,153 @@ # anolis-lab-courses + +龙蜥实验室为社区用户提供全方位的产品体验方式,主要有两种形式: +1. 资源服务:通过为社区用户免费提供机器资源的方式去体验 Anolis OS ,用户可以随时创建一台独立的机器进行实际体验。 +2. 龙蜥课程以及解决方案:通过在线操作练习的方式去体验和学习龙蜥的生态;包括基础设施,云原生,操作系统等课程和解决方案等等。 -#### 介绍 -龙蜥实验室-课程 +`anolis-lab-courses` 是存放龙蜥社区课程的仓库,社区参与者可以通过此仓库接入课程资源。 -#### 软件架构 -软件架构说明 +## 接入方式 +社区参与者可以通过提交** PR **的方式(gitee 仓库:[anolis-lab-courses ](https://gitee.com/anolis/anolis-lab-courses))接入**龙蜥实验室课程和解决方案**等内容资源,PR 提交后会由龙蜥实验室的 maintainer 进行审核,审核通过后课程会自动同步到[龙蜥实验室网站](https://lab.openanolis.cn/#/apply/home)上。 -#### 安装教程 +## 接入说明 -1. xxxx -2. xxxx -3. xxxx +### 目录结构 -#### 使用说明 +anolis-lab-courses 课程仓库的目录结构定义: +1. `anolis-courses` 目录存放的是课程资源。 +2. `anolis-solutions` 目录里存放的是解决方案的内容。 -1. xxxx -2. xxxx -3. xxxx +具体目录结构参考下面示例: -#### 参与贡献 +```bash -1. Fork 本仓库 -2. 新建 Feat_xxx 分支 -3. 提交代码 -4. 新建 Pull Request +├── README.md +├── LICENSE +├── anolis-courses +│ ├── git-dev +│ │ ├── index.yaml +│ │ ├── assets +│ │ │   ├── poster.png +│ │ │   └── cover.png +│ │ ├── committing-code +│ │ │ ├── assets +│ │ │   │ ├── centos_to_anolis_migrations.avi +│ │ │   │ └── cover.png +│ │ │   ├── index.yaml +│ │ │   ├── start.md +│ │ │   ├── finish.md +│ │ │   ├── step1.md +│ │ │   ├── step2.md +│ │ │   └── step3.md +│ │ ├── working-remotely +│ │ │ ├── assets +│ │ │   │ ├── centos_to_anolis_migrations.avi +│ │ │   │ └── cover.png +│ │ │   ├── index.yaml +│ │ │   ├── start.md +│ │ │   ├── finish.md +│ │ │   ├── step1.md +│ │ │   ├── step2.md +│ │ │   ├── step3.md +│ │ │   └── step4.md +├── anolis-solution +│ ├── centos2anolis +│ │ ├── index.yaml +│ │ ├── assets +│ │ │   ├── poster.png +│ │ │   └── cover.png +│ │ ├── centos7_to_anolisos7 +│ │ │ ├── assets +│ │ │   │ ├── centos_to_anolis_migrations.avi +│ │ │   │ └── cover.png +│ │ │   ├── index.yaml +│ │ │   ├── start.md +│ │ │   ├── finish.md +│ │ │   ├── step1.md +│ │ │   ├── step2.md +│ │ │   ├── step3.md +│ │ │   ├── step4.md +│ │ │   └── step5.md +│ │ ├── centos8_to_anolisos8 +│ │ │ ├── assets +│ │ │   │ ├── centos_to_anolis_migrations.avi +│ │ │   │ └── cover.png +│ │ │   ├── index.yaml +│ │ │   ├── start.md +│ │ │   ├── finish.md +│ │ │   ├── step1.md +│ │ │   ├── step2.md +│ │ │   └── step3.md +``` +### 格式定义 +#### 1. 课程和章节配置 + +- 课程及解决方案index.yaml 中的 type 字段选项有:course,solution ;分别对应页面上的课程和解决方案 +- 章节中:details 与 video 可以选填,两者必须填一个,根据情况展示。 +- 机器审请规则:根据 chapter/scen 中的 image, live_time, machine 等字段去资源服务中审请相应机器。 + - 超出 live_time 时长,则自动释放机器。 +- poster、cover 等非必填,若不填则使用默认配图。 +- level 选项: advanced(高级)、intermediate(中级)、beginner(初级) + +```yaml +# course/solution index.yaml +name: Centos 迁移 Anolis OS +desc: 学习如何从 Centos 迁移到 Anolis OS 。 +type: solution # course +poster: "./assets/poster.png" # 不填则使用默认 +cover: "./assets/cover.png" # 不填则使用默认 +total_time: "60 min" +level: "medium" # beginner、intermediate、advanced +chapters: + - name: "Centos 7 迁移到 Anolis OS 7" + desc: "学习如何从 Centos 7 迁移到 Anolis OS 7" + content: "centos7_to_anolisos7" + live_time: "30 min" + - name: "Centos 8 迁移到 Anolis OS 8" + desc: "学习如何从 Centos 8 迁移到 Anolis OS 8" + content: "centos8_to_anolisos8" + live_time: "30 min" + +# chapter/scen index.yaml +name: Centos 7 迁移到 Anolis OS 7 +desc: 学习如何从 Centos 7 迁移到 Anolis OS 7 +cover: "./assets/cover.png" # 不填则使用默认 +video: ../../assets/centos_to_anolis_migrations.avi +image: "Anolis OS 8.4 ANCK 64 位" +live_time: "30 min" +machine: x86_64-2c4g # cpu架构-机器规格,该字段为空,默认 x86_64-2c4g +max_clients: 5 # 最大并发使用数,不填则默认不限制 +details: + steps: + start: start.md + finish: finish.md + - name: 审请 Centos 7 的机器 + content: step1.md + - name: 登陆机器 + content: step2.md + - name: 下载迁移脚本 + content: step3.md + - name: 执行迁移脚本 + content: step4.md + - name: 验证迁移结果 + content: step5.md + + +``` + +#### 2. Step定义 + +step 采用 markdown 格式定义,课程中的每个步骤可以根据课程情况进行拆分成若干步骤。 + +命令双击自动录入占位符:[[ this is the command ]] + +## 敬请期待 + +现在我们已经上线了一批课程资源,更多的课程也在设计接入中,敬请期待~ + +1. 目前课程的设计和开发主要由龙蜥社区各领域参与者主导,社区参与者也可以提交自己擅长的课程。 +1. 对于课程的接入,我们后续会提供更简化的方式;另外也会有课程接入的实验环境进行测试。 -#### 特技 -1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md -2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) -3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 -4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 -5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) -6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) -- Gitee From 3d58ca313ba5b54a958568ea6fe4cc91405d9d41 Mon Sep 17 00:00:00 2001 From: yongchao Date: Tue, 19 Jul 2022 15:46:33 +0800 Subject: [PATCH 2/4] update doc Signed-off-by: yongchao --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a009525..6af6961 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ ## 接入方式 -社区参与者可以通过提交** PR **的方式(gitee 仓库:[anolis-lab-courses ](https://gitee.com/anolis/anolis-lab-courses))接入**龙蜥实验室课程和解决方案**等内容资源,PR 提交后会由龙蜥实验室的 maintainer 进行审核,审核通过后课程会自动同步到[龙蜥实验室网站](https://lab.openanolis.cn/#/apply/home)上。 +社区参与者可以通过提交** PR 的方式(gitee 仓库:[anolis-lab-courses ](https://gitee.com/anolis/anolis-lab-courses))接入龙蜥实验室课程和解决方案等内容资源,PR 提交后会由龙蜥实验室的 maintainer 进行审核,审核通过后课程会自动同步到[龙蜥实验室网站](https://lab.openanolis.cn/#/apply/home)上。 ## 接入说明 @@ -99,7 +99,7 @@ type: solution # course poster: "./assets/poster.png" # 不填则使用默认 cover: "./assets/cover.png" # 不填则使用默认 total_time: "60 min" -level: "medium" # beginner、intermediate、advanced +level: "medium" # beginner、intermediate、advanced chapters: - name: "Centos 7 迁移到 Anolis OS 7" desc: "学习如何从 Centos 7 迁移到 Anolis OS 7" -- Gitee From 5fbbf9539c073abac76671086e5412123fabf6f3 Mon Sep 17 00:00:00 2001 From: yongchao Date: Tue, 19 Jul 2022 15:48:51 +0800 Subject: [PATCH 3/4] update doC Signed-off-by: yongchao --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6af6961..39d379b 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ ## 接入方式 -社区参与者可以通过提交** PR 的方式(gitee 仓库:[anolis-lab-courses ](https://gitee.com/anolis/anolis-lab-courses))接入龙蜥实验室课程和解决方案等内容资源,PR 提交后会由龙蜥实验室的 maintainer 进行审核,审核通过后课程会自动同步到[龙蜥实验室网站](https://lab.openanolis.cn/#/apply/home)上。 +社区参与者可以通过提交 PR 的方式(gitee 仓库:[anolis-lab-courses ](https://gitee.com/anolis/anolis-lab-courses))接入龙蜥实验室课程和解决方案等内容资源,PR 提交后会由龙蜥实验室的 maintainer 进行审核,审核通过后课程会自动同步到[龙蜥实验室网站](https://lab.openanolis.cn/#/apply/home)上。 ## 接入说明 @@ -99,7 +99,7 @@ type: solution # course poster: "./assets/poster.png" # 不填则使用默认 cover: "./assets/cover.png" # 不填则使用默认 total_time: "60 min" -level: "medium" # beginner、intermediate、advanced +level: "medium" # beginner、intermediate、advanced chapters: - name: "Centos 7 迁移到 Anolis OS 7" desc: "学习如何从 Centos 7 迁移到 Anolis OS 7" -- Gitee From 624bae4c770e904598d0056fe48246ea0da867bf Mon Sep 17 00:00:00 2001 From: yongchao Date: Tue, 19 Jul 2022 20:08:23 +0800 Subject: [PATCH 4/4] add centos2anolis course Signed-off-by: yongchao --- .../centos2anolis/centos8_to_anolisos8/end.md | 1 + .../centos8_to_anolisos8/index.yaml | 20 ++++++++++ .../centos8_to_anolisos8/start.md | 2 + .../centos8_to_anolisos8/step1.md | 32 ++++++++++++++++ .../centos8_to_anolisos8/step2.md | 12 ++++++ .../centos8_to_anolisos8/step3.md | 6 +++ .../centos8_to_anolisos8/step4.md | 37 +++++++++++++++++++ .../centos8_to_anolisos8/step5.md | 13 +++++++ anolis-courses/centos2anolis/index.yaml | 18 +++++++++ 9 files changed, 141 insertions(+) create mode 100644 anolis-courses/centos2anolis/centos8_to_anolisos8/end.md create mode 100644 anolis-courses/centos2anolis/centos8_to_anolisos8/index.yaml create mode 100644 anolis-courses/centos2anolis/centos8_to_anolisos8/start.md create mode 100644 anolis-courses/centos2anolis/centos8_to_anolisos8/step1.md create mode 100644 anolis-courses/centos2anolis/centos8_to_anolisos8/step2.md create mode 100644 anolis-courses/centos2anolis/centos8_to_anolisos8/step3.md create mode 100644 anolis-courses/centos2anolis/centos8_to_anolisos8/step4.md create mode 100644 anolis-courses/centos2anolis/centos8_to_anolisos8/step5.md create mode 100644 anolis-courses/centos2anolis/index.yaml diff --git a/anolis-courses/centos2anolis/centos8_to_anolisos8/end.md b/anolis-courses/centos2anolis/centos8_to_anolisos8/end.md new file mode 100644 index 0000000..33ea594 --- /dev/null +++ b/anolis-courses/centos2anolis/centos8_to_anolisos8/end.md @@ -0,0 +1 @@ +恭喜您完成了本场景实验 diff --git a/anolis-courses/centos2anolis/centos8_to_anolisos8/index.yaml b/anolis-courses/centos2anolis/centos8_to_anolisos8/index.yaml new file mode 100644 index 0000000..f7c0593 --- /dev/null +++ b/anolis-courses/centos2anolis/centos8_to_anolisos8/index.yaml @@ -0,0 +1,20 @@ +name: Centos 8 迁移到 Anolis OS 8 +desc: 本课程将介绍如何通过 AOMS 迁移工具实现 CentOS 8.x 到 Anolis OS 8 的迁移。 +image: "Centos 8.5 64位" +live_time: "30 min" +machine: x86_64-2c4g # cpu架构-机器规格,该字段为空,默认 x86_64-2c4g +max_clients: 5 # 最大并发使用数,不填则默认不限制 +details: + steps: + start: start.md + finish: finish.md + - name: Centos8切换yum源 + content: step1.md + - name: 部署迁移工具并迁移 + content: step2.md + - name: 重启进入Anolis OS系统 + content: step3.md + - name: 迁移后配置检查并验证 + content: step4.md + - name: 验证迁移结果 + content: step5.md \ No newline at end of file diff --git a/anolis-courses/centos2anolis/centos8_to_anolisos8/start.md b/anolis-courses/centos2anolis/centos8_to_anolisos8/start.md new file mode 100644 index 0000000..525f539 --- /dev/null +++ b/anolis-courses/centos2anolis/centos8_to_anolisos8/start.md @@ -0,0 +1,2 @@ +本场景将提供一台配置了 CentOS 8.5 操作系统的云服务器作为迁移环境,CentOS 8.x 迁移使用 Anolis OS release 相关的包替代 CentOS release,通过yum distro-sync 重装当前系统中所有的系统软件包。软件重装的过程并不会修改当前系统基础配置,所以系统配置,业务配置,业务数据都不会被清除,迁移完成后这些数据无需重新设置,实现CentOS 8.5到Anolis OS 8的迁移。 + diff --git a/anolis-courses/centos2anolis/centos8_to_anolisos8/step1.md b/anolis-courses/centos2anolis/centos8_to_anolisos8/step1.md new file mode 100644 index 0000000..e0bda7a --- /dev/null +++ b/anolis-courses/centos2anolis/centos8_to_anolisos8/step1.md @@ -0,0 +1,32 @@ +说明:CentOS 8操作系统版本结束了生命周期(EOL),Linux社区已不再维护该操作系统版本。建议您切换到Anolis或Alinux。如果您的业务过渡期仍需要使用CentOS 8系统中的一些安装包,请根据下文切换CentOS 8的源。 + +1. 运行以下命令备份之前的repo文件。 + +[[ rename '.repo' '.repo.bak' /etc/yum.repos.d/*.repo ]] + +2. 运行以下命令下载最新的repo文件。 + +[[ wget https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo -O /etc/yum.repos.d/Centos-vault-8.5.2111.repo ]] + +[[ wget https://mirrors.aliyun.com/repo/epel-archive-8.repo -O /etc/yum.repos.d/epel-archive-8.repo ]] + +3. 运行以下命令替换repo文件中的链接。 + +[[ sed -i 's/mirrors.cloud.aliyuncs.com/url_tmp/g' /etc/yum.repos.d/Centos-vault-8.5.2111.repo && sed -i 's/mirrors.aliyun.com/mirrors.cloud.aliyuncs.com/g' /etc/yum.repos.d/Centos-vault-8.5.2111.repo && sed -i 's/url_tmp/mirrors.aliyun.com/g' /etc/yum.repos.d/Centos-vault-8.5.2111.repo ]] + +[[ sed -i 's/mirrors.aliyun.com/mirrors.cloud.aliyuncs.com/g' /etc/yum.repos.d/epel-archive-8.repo ]] + +4. 运行以下命令重新创建缓存。 + +[[ yum clean all && yum makecache ]] + +5. 查看 repo 文件。 + +[[ ls -l /etc/yum.repos.d/ ]] + +6. 删除之前备份的repo文件。 + +说明:后续步骤中我们将为切换后的 CentOS 8 的repo文件进行重命名,以防冲突需将其删除。如果只有两个repo文件则不需要进行删除 + +[[ rm -rf /etc/yum.repos.d/!(*.repo) ]] +删除之后,在用ls -l /etc/yum.repos.d/命令进行查询。 \ No newline at end of file diff --git a/anolis-courses/centos2anolis/centos8_to_anolisos8/step2.md b/anolis-courses/centos2anolis/centos8_to_anolisos8/step2.md new file mode 100644 index 0000000..05f9cab --- /dev/null +++ b/anolis-courses/centos2anolis/centos8_to_anolisos8/step2.md @@ -0,0 +1,12 @@ +1. 下载迁移脚本。 + +[[ wget https://gitee.com/anolis/centos2anolis/raw/master/centos2anolis.py ]] + +2. 安装迁移脚本运行依赖。 +[[ yum -y install python3 ]] + +3. 迁移执行。 + +[[ python3 centos2anolis.py ]] + + diff --git a/anolis-courses/centos2anolis/centos8_to_anolisos8/step3.md b/anolis-courses/centos2anolis/centos8_to_anolisos8/step3.md new file mode 100644 index 0000000..6f98e10 --- /dev/null +++ b/anolis-courses/centos2anolis/centos8_to_anolisos8/step3.md @@ -0,0 +1,6 @@ +1. 迁移成功,重启即可进入Anolis OS系统。 + +[[ reboot ]] + +2. 重新连接并进入系统。 + diff --git a/anolis-courses/centos2anolis/centos8_to_anolisos8/step4.md b/anolis-courses/centos2anolis/centos8_to_anolisos8/step4.md new file mode 100644 index 0000000..78be131 --- /dev/null +++ b/anolis-courses/centos2anolis/centos8_to_anolisos8/step4.md @@ -0,0 +1,37 @@ +说明 CentOS在2021年12月31号停止维护,相应的CentOS源在2022年1月31号从官网删除,导致CentOS实例无法正常使用repo, + +如果您按照该指导切换使用CentOS Vault源或者自行配置使用Vault源,然后实施迁移Anolis OS,迁移完成后,需要检查当前系统中是否残留CentOS Vault源。 + +1. 通过命令进行检查。 + +[[ yum repolist ]] + +2. 如上述结果所示,“CentOS-8.5.2111 - Base - mirrors.aliyun.com”就是残留的CentOS repo,需要删除,否则会出现Anolis OS和CentOS源共存的问题,一旦执行yum update可能会错误地安装CentOS的包。 + +2.1 查找提供CentOS repo的配置文件。 + +[[ grep -rn "CentOS-8.5.2111" /etc/yum.repos.d/*.repo ]] + +2.2 重命名上述步骤中找到的配置文件。 + +[[ mv /etc/yum.repos.d/Centos-vault-8.5.2111.repo /etc/yum.repos.d/Centos-vault-8.5.2111.repo.bak ]] + + + +3. 迁移后验证。 + +3.1 查看OS版本。 + +[[ cat /etc/os-release ]] + +3.2 通过命令查看当前系统中是否有残留CentOS软件包,如果残留kernel包,为正常现象,kernel包支持多版本共存。 + +[[ rpm -qa --qf "%{NAME} %{VENDOR}\n" | grep CentOS ]] + + + + + + + + diff --git a/anolis-courses/centos2anolis/centos8_to_anolisos8/step5.md b/anolis-courses/centos2anolis/centos8_to_anolisos8/step5.md new file mode 100644 index 0000000..d00f186 --- /dev/null +++ b/anolis-courses/centos2anolis/centos8_to_anolisos8/step5.md @@ -0,0 +1,13 @@ +7. FAQ + +如果您在正式环境中迁移出现疑问,请参考如下: + +就地迁移失败是否可回滚? +1.1 迁移工具不支持回滚,迁移失败无法恢复到迁移初始状态,迁移前务必做好系统备份。 + +迁移出现问题怎么办? +2.1 先在龙蜥社区知识库查看是否有同样的问题。 + +2.2 如果问题无法解决,请前往龙蜥社区提交issue,或者加入钉钉交流群(33311793)获取帮助。您需要先保存迁移工具执行报错信息,并提供初始系统信息(系统版本,内核,软件包列表等等),附上迁移日志文件/var/log/centos2anolis.log。 + +说明 更多FAQ,请参见迁移FAQ。 \ No newline at end of file diff --git a/anolis-courses/centos2anolis/index.yaml b/anolis-courses/centos2anolis/index.yaml new file mode 100644 index 0000000..31feabf --- /dev/null +++ b/anolis-courses/centos2anolis/index.yaml @@ -0,0 +1,18 @@ +name: CentOS 迁移 Anolis OS +desc: CentOS 8操作系统版本结束了生命周期(EOL),Linux社区已不再维护该操作系统版本。Anolis OS 生态上和依赖管理上保持跟 CentOS 兼容,龙蜥社区提供一键式迁移脚本 centos2anolis.py;本课程将为您介绍如何通过 AOMS 迁移工具实现 CentOS 到 Anolis OS 的迁移。 +type: course +total_time: "60 min" +level: "medium" # beginner、intermediate、advanced +chapters: + - name: "Centos 7 迁移到 Anolis OS 7" + desc: "学习如何从 Centos 7 迁移到 Anolis OS 7" + content: "centos7_to_anolisos7" + live_time: "60 min" + - name: "Centos 8 迁移到 Anolis OS 8" + desc: "学习如何从 Centos 8 迁移到 Anolis OS 8" + content: "centos8_to_anolisos8" + live_time: "60 min" + - name: "Centos 7 迁移到 Anolis OS 8" + desc: "学习如何从 Centos 7 迁移到 Anolis OS 8" + content: "centos7_to_anolisos8" + live_time: "60 min" -- Gitee