云服务器内容精选

  • 附录:conf配置文件说明 #rpm lists for os migration [rpm_lists] #origin system must need rpms baserpms_list = "basesystem initscripts hce-logos plymouth grub2 grubby" //系统迁移依赖的RPM包 #old rpm and default conflict rpms //迁移过程中,原系统可能存在的冲突包 oldrpms_list = centos-backgrounds centos-release-cr desktop-backgrounds-basic \ centos-release-advanced-virtualization centos-release-ansible26 centos-release-ansible-27 \ centos-release-ansible-28 centos-release-ansible-29 centos-release-azure \ centos-release-ceph-jewel centos-release-ceph-luminous centos-release-ceph-nautilus \ centos-release-ceph-octopus centos-release-configmanagement centos-release-dotnet centos-release-fdio \ centos-release-gluster40 centos-release-gluster41 centos-release-gluster5 \ centos-release-gluster6 centos-release-gluster7 centos-release-gluster8 \ centos-release-gluster-legacy centos-release-messaging centos-release-nfs-ganesha28 \ centos-release-nfs-ganesha30 centos-release-nfv-common \ centos-release-nfv-openvswitch centos-release-openshift-origin centos-release-openstack-queens \ centos-release-openstack-rocky centos-release-openstack-stein centos-release-openstack-train \ centos-release-openstack-ussuri centos-release-opstools centos-release-ovirt42 centos-release-ovirt43 \ centos-release-ovirt44 centos-release-paas-common centos-release-qemu-ev centos-release-qpid-proton \ centos-release-rabbitmq-38 centos-release-samba411 centos-release-samba412 \ centos-release-scl centos-release-scl-rh centos-release-storage-common \ centos-release-virt-common centos-release-xen centos-release-xen-410 \ centos-release-xen-412 centos-release-xen-46 centos-release-xen-48 centos-release-xen-common \ python3-syspurpose python-oauth sl-logos yum-rhn-plugin centos-indexhtml \ libreport-centos libreport-web libreport-plugin-mantisbt libreport-plugin-rhtsupport \ libreport hunspell-en-US hunspell-en policycoreutils-gui libcanberra-gtk2 cups \ NetworkManager-libreswan-gnome plymouth-graphics-libs avahi cups-lpd pinentry-qt \ librsvg2-devel libcanberra-gtk3 gnome-themes-standard wodim gsettings-desktop-schemas-devel \ avahi-ui-gtk3 freerdp-libs pulseaudio-utils gstreamer1-plugins-bad-free-gtk ghostscript-cups \ setools-console libxkbcommon-x11 cups plymouth-plugin-two-step pulseaudio-module-x11 ImageMagick-c++ \ cups-devel policycoreutils-sandbox PackageKit-gstreamer-plugin gtk3-immodule-xim avahi-glib avahi-autoipd \ mesa-libGLES foomatic libcanberra-devel plymouth-plugin-label PackageKit-gtk3-module colord avahi-gobject \ pinentry-qt4 avahi-ui-gtk3 plymouth-plugin-two-step ghostscript-cups ImageMagick-perl firewall-config \ plymouth-plugin-label redhat-redhat-lsb-corelsb vim-X11 dbus-x11 pulseaudio PackageKit-command-not-found libproxy-mozjs \ pinentry-gtk nm-connection-editor gtk2-immodule-xim wireshark-gnome pulseaudio-module-bluetooth pidgin-sipe freerdp kmod-kvdo \ redhat-lsb-core #The following list contains the same symbol as centos/redhat dstrpms_list = "hce-release hce-repos" [log_conf] # migration tool log common dir migrate_common_dir = "/var/log/migrate-tool/" //日志存放路径 # migration tool classification log dir migrate_classification_dir = %(migrate_common_dir)s/centos2hce1/ #iso as yum source link [repo_info] base_yum_url =https://repo.huaweicloud.com/hce/1.1/os/x86_64/ //基础yum源路径,用于检查网络状态 #iso as yum source repostr_hce1_1 = //提供迁移模式的源路径 [base] name=hceversion baseurl=https://repo.huaweicloud.com/hce/1.1/os/x86_64/ //基础yum源路径,用于获取RPM包 gpgcheck=0 enabled=1 gpgkey= #released updates [updates] name=hce1_updates baseurl= gpgcheck=0 enabled=0 gpgkey= #additional packages that may be useful [extras] name=hce1_extras baseurl= gpgcheck=0 enabled=0 gpgkey= # plus packages provided by Huawei Linux dev team [plus] name=hce1_plus baseurl= gpgcheck=0 enabled=0 gpgkey=
  • 系统迁移 备份操作系统。 系统迁移至HCE1.1不支持回滚,请备份CentOS整体操作系统(包括系统盘和数据盘)。 执行centos2hce1.py命令,进行系统迁移。 系统迁移的耗时受更新的RPM包数量、大小和从repo源下载速度等影响,一般会在20分钟到1个小时左右完成,具体时间视实际环境确定,执行操作时注意预留足够的时间。 [root@localhost home]# centos2hce1.py 有如下回显信息,表示迁移完成。若迁移失败请使用备份数据恢复。 CentOS含有某些HCE 1.1不提供的RPM包,执行centos2hce1.py命令迁移系统后,迁移工具会自动清除这些RPM包。如果您想保留这些RPM包,请使用-s skip参数进行系统迁移。 (可选)删除无用的RPM包。 如下两个RPM包在迁移过程中并没有使用,也不会对系统运行产生任何影响。在此对您可能产生的疑惑进行解释。 执行reboot命令重启操作系统。 执行cat /etc/os-release命令检查是否迁移成功。 显示如下Huawei Cloud EulerOS信息表示迁移成功。 (可选)开启selinux。 系统迁移前关闭了selinux,请根据需要选择是否开启selinux。 修改/etc/selinux/config文件,将config文件中SELINUX的值设置成enforcing SELINUX=enforcing 重启操作系统使selinux配置生效。
  • 安装迁移工具 从华为云开源镜像站下载迁移工具安装包centos2hce1-*.rpm。 *表示迁移工具版本,本节以centos2hce1-1.0.0-0.0.2.x86_64.rpm安装包示例。 [root@localhost test]# wget https://repo.huaweicloud.com/hce/1.1/updates/x86_64/Packages/centos2hce1-1.0.0-0.0.2.x86_64.rpm //下载centos2hce1-*.rpm [root@localhost test]# ls //检查是否下载成功 centos2hce1-1.0.0-0.0.2.x86_64.rpm 安装迁移工具。 工具安装完成后,系统自动生成/etc/centos2hce1.conf配置文件。 [root@localhost ~]# rpm -ivh centos2hce1-1.0.0-0.0.2.x86_64.rpm 配置centos2hce1.conf文件。 配置HCE的repo源地址,用于检测repo源是否能够正常访问,并更新RPM包。 #iso as yum source link [repo_info] base_yum_url =https://repo.huaweicloud.com/hce/1.1/os/x86_64/ #iso as yum source repostr_hce1_1 = [base] name=hceversion baseurl=https://repo.huaweicloud.com/hce/1.1/os/x86_64/ gpgcheck=0 enabled=1 #released updates [updates] name=hce1_updates baseurl=https://repo.huaweicloud.com/hce/1.1/updates/x86_64/ gpgcheck=0 enabled=1 gpgkey= centos2hce1.conf配置文件说明详见附录:conf配置文件说明。