背景:生产环境客户要求操作系统国产化
操作系统:Centos7.9
内核:5.4.108文章来源:https://www.toymoban.com/news/detail-645413.html
服务器可以联网,进行在线迁移:
# 下载迁移工具软件源
wget https://mirrors.openanolis.cn/anolis/migration/anolis-migration.repo -O /etc/yum.repos.d/anolis-migration.repo
# 安装迁移工具
yum install -y python-pip
yum remove -y python-requests python-urllib3; /usr/bin/pip2 uninstall requests urllib3 -y 2>/dev/null || echo "not installed"
yum -y install leapp
# 迁移前评估
leapp preupgrade --no-rhsm
上述命令是默认评估迁移到带 ANCK 内核的龙蜥OS,如果你想评估迁移到带 RHCK 内核的龙蜥OS请执行下面的命令:
leapp preupgrade --no-rhsm --disablerepo=anolis_plus
# 查看评估报告
cat /var/log/leapp/leapp-report.txt
备注:
迁移评估报告中一旦遇到影响到就地迁移的因素,会禁止做迁移实施,将这些影响因素都解决后才能够继续实施迁移
常见影响到就地迁移的因素:
Upgrade has been inhibited due to the following problems:
1. Inhibitor: Not enough space on /boot #将boot目录下多不用的文件移动至opt下
2. Inhibitor: Newest installed kernel not in use #切换到3.10.0的内核
3. Inhibitor: Possible problems with remote login using root account #sed -i 's/#PermitRootLogin yes/PermitRootLogin yes/' /etc/ssh/sshd_config
#echo PermitRootLogin yes | tee -a /etc/ssh/sshd_config
4. Inhibitor: Newest installed kernel not in use #https://www.yuque.com/anolis-docs/kbase/wo6msd
5. Inhibitor: TCP Wrappers configuration affects some installed packages #https://www.yuque.com/anolis-docs/kbase/vgxd1i3izs51vbcq
Consult the pre-upgrade report for details and possible remediation.
# 开始迁移
leapp upgrade --no-rhsm
上述命令是默认迁移到带 ANCK 内核的龙蜥OS,如果你想迁移到带 RHCK 内核的龙蜥OS请执行下面的命令
leapp upgrade --no-rhsm --disablerepo=anolis_plus
上述命令执行成功后,还可以通过/var/log/leapp/leapp-report.txt查看迁移报告
迁移完成后reboot,重启时间过长请耐心等待!
# 验证
cat /etc/os-release # 查看当前操作系统
uname -r # 查看内核版本
常见问题总结:
1、安装 python-pip 失败
yum install -y python-pip
Loaded plugins: fastestmirror, langpacks
Determining fastest mirrors
* base: mirror.nyist.edu.cn
* extras: mirrors.bfsu.edu.cn
* updates: mirror.nyist.edu.cn
base | 3.6 kB 00:00:00
extras | 2.9 kB 00:00:00
updates | 2.9 kB 00:00:00
(1/2): extras/7/x86_64/primary_db | 250 kB 00:00:00
(2/2): updates/7/x86_64/primary_db | 22 MB 00:00:01
No package python-pip available.
Error: Nothing to do
解决:
# 安装epel-release,该软件包会自动配置yum的软件仓库
yum -y install epel-release
# 再次安装
yum -y install python-pip
此文档根据龙蜥社区相关文档总结
相关链接:
1、https://openanolis.cn/sig/migration/doc/447499505912234337?preview=true&no=328402126342047346
2、https://help.aliyun.com/document_detail/2391249.html?spm=a2c4g.2391250.0.0.6c713037jx2TlH
3、https://www.yuque.com/anolis-docs/kbase/be1rmzsg2cscq6ia文章来源地址https://www.toymoban.com/news/detail-645413.html
到了这里,关于CentOS 7迁移Anolis OS 8的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!