云服务器内容精选

  • OS_THREADS 提供当前节点下所有线程的状态信息,如表1所示。 表1 OS_THREADS字段 名称 类型 描述 node_name text 当前节点的名称。 pid bigint 当前节点进程中正在运行的线程号。 lwpid integer 与pid对应的轻量级线程号。 thread_name text 与pid对应的线程名称。 creation_time timestamp with time zone 与pid对应的线程创建的时间。 父主题: OS
  • GLOBAL_OS_THREADS 提供整个集群中所有正常节点下的线程状态信息,如表1所示。 表1 GLOBAL_OS_THREADS字段 名称 类型 描述 node_name text 当前节点的名称。 pid bigint 当前节点进程中正在运行的线程号。 lwpid integer 与pid对应的轻量级线程号。 thread_name text 与pid对应的线程名称。 creation_time timestamp with time zone 与pid对应的线程创建的时间。 父主题: OS
  • GLOBAL_OS_RUNTIME 提供整个集群中所有正常节点下的操作系统运行状态信息,如表1所示。 表1 GLOBAL_OS_RUNTIME字段 名称 类型 描述 node_name name 节点名称。 id integer 编号。 name text 操作系统运行状态名称。 value numeric 操作系统运行状态值。 comments text 操作系统运行状态注释。 cumulative boolean 操作系统运行状态的值是否为累加值。 父主题: OS
  • OS_THREADS 提供当前节点下所有线程的状态信息,如表1所示。 表1 OS_THREADS字段 名称 类型 描述 node_name text 当前节点的名称。 pid bigint 当前节点进程中正在运行的线程号。 lwpid integer 与pid对应的轻量级线程号。 thread_name text 与pid对应的线程名称。 creation_time timestamp with time zone 与pid对应的线程创建的时间。 父主题: OS
  • GLOBAL_OS_THREADS 提供数据库中所有正常节点下的线程状态信息,如表1所示。 表1 GLOBAL_OS_THREADS字段 名称 类型 描述 node_name text 节点名称。 pid bigint 当前节点进程中正在运行的线程号。 lwpid integer 与pid对应的轻量级线程号。 thread_name text 与pid对应的线程名称。 creation_time timestamp with time zone 与pid对应的线程创建的时间。 父主题: OS
  • GLOBAL_OS_RUNTIME 提供数据库中所有正常节点下的操作系统运行状态信息,如表1所示。 表1 GLOBAL_OS_RUNTIME字段 名称 类型 描述 node_name name 节点名称。 id integer 编号。 name text 操作系统运行状态名称。 value numeric 操作系统运行状态值。 comments text 操作系统运行状态注释。 cumulative boolean 操作系统运行状态的值是否为累加值。 父主题: OS
  • GLOBAL_OS_THREADS 提供整个集群中所有正常节点下的线程状态信息。 表1 GLOBAL_OS_THREADS字段 名称 类型 描述 node_name text 当前节点的名称。 pid bigint 当前节点进程中正在运行的线程号。 lwpid integer 与pid对应的轻量级线程号。 thread_name text 与pid对应的线程名称。 creation_time timestamp with time zone 与pid对应的线程创建的时间。 父主题: OS
  • GLOBAL_OS_RUNTIME 提供整个集群中所有正常节点下的操作系统运行状态信息。 表1 GLOBAL_OS_RUNTIME字段 名称 类型 描述 node_name name 节点名称。 id integer 编号。 name text 操作系统运行状态名称。 value numeric 操作系统运行状态值。 comments text 操作系统运行状态注释。 cumulative boolean 操作系统运行状态的值是否为累加值。 父主题: OS
  • GLOBAL_OS_RUNTIME 提供数据库中所有正常节点下的操作系统运行状态信息。 表1 GLOBAL_OS_RUNTIME字段 名称 类型 描述 node_name name 节点名称。 id integer 编号。 name text 操作系统运行状态名称。 value numeric 操作系统运行状态值。 comments text 操作系统运行状态注释。 cumulative boolean 操作系统运行状态的值是否为累加值。 父主题: OS
  • GLOBAL_OS_THREADS 提供数据库中所有正常节点下的线程状态信息。 表1 GLOBAL_OS_THREADS字段 名称 类型 描述 node_name text 节点名称。 pid bigint 当前节点进程中正在运行的线程号。 lwpid integer 与pid对应的轻量级线程号。 thread_name text 与pid对应的线程名称。 creation_time timestamp with time zone 与pid对应的线程创建的时间。 父主题: OS
  • 约束限制 对于HCE OS 1.1镜像,仅支持从CentOS7.9迁移到HCE OS 1.1,并且不支持配置图形化界面的CentOS7.9系统的迁移。 操作系统迁移过程中涉及rpm卸载、安装及更新,操作系统存在异常重启的风险。请在迁移前做好操作系统的系统盘备份,可以通过创建云服务器备份。 建议操作系统内存剩余大于128MB,系统盘空间剩余大于1GB。 父主题: 将操作系统迁移至HCE OS 1.1
  • 系统回退 系统回退。 迁移操作支持系统回退,您可根据需要决定是否回退至原操作系统。 执行centos2hce2.py --rollback all命令进行系统回退。回退后,执行reboot命令对系统重启。 执行centos2hce2.py --precommit rollback命令,恢复环境。 (可选)若迁移前已开启selinux,迁移时会自动关闭selinux服务。如有需要,回退后请手动恢复selinux状态。 执行centos2hce2.py --precommit rbk-selinux命令。 [root@localhost ~]# centos2hce2.py --precommit rbk-selinux 2022-09-05 03:58:37,015-INFO-centos2hce2.py-[line:1401]: precommit migration 2022-09-05 03:58:37,047-INFO-centos2hce2.py-[line:1319]: now begin to set selinux 2022-09-05 03:58:37,051-INFO-centos2hce2.py-[line:1324]: modify selinux config succeed 2022-09-05 03:58:37,051-INFO-centos2hce2.py-[line:1325]: selinux has been set, please reboot now 2022-09-05 03:58:37,051-INFO-centos2hce2.py-[line:1340]: set rollback selinux succeed 2022-09-05 03:58:37,051-INFO-centos2hce2.py-[line:1365]: upgrade precommit selinux success 执行reboot命令,进行系统重启。 [root@localhost ~]# reboot 系统重启后,可查看到selinux状态为开启状态。 [root@localhost ~]# getenforce Enforcing 清理系统数据。 执行centos2hce2.py --commit all命令清理数据。 执行命令后,系统会自动清理目标系统和原系统的系统数据,包括步骤3中备份路径下的系统数据。 [root@localhost ~]# centos2hce2.py --commit all 2022-08-22 04:45:32,601-INFO-centos2hce2.py-[line:1242]: commit migration
  • 迁移系统至HCE OS 执行迁移命令centos2hce2.py --upgrade all进行系统迁移。 出现migrare sucess提示信息,表明系统迁移成功。迁移后支持回退至原系统,详见操作步骤1。 迁移命令不能设置为Linux后台执行方式。 可附加--simple_name参数,使得迁移后的grub菜单中显示Huawei Cloud EulerOS的简称。 系统迁移完毕后,执行reboot命令(若reboot无响应,执行reboot -f)使系统完成切换。 系统重启后,执行cat /etc/hce-release命令查看迁移后的操作系统信息,执行uname -a命令查看系统内核信息。 若显示Huawei Cloud EulerOS操作系统,则迁移成功;否则迁移失败,请联系技术工程师咨询。 操作系统迁移为Huawei Cloud EulerOS后,控制台仍然显示迁移前的操作系统名称。您可手动更新控制台操作系统名称,具体操作详见迁移系统后,如何更改控制台操作系统名称?。 清理旧版本组件的文件。 待迁移系统迁移到HCE OS后,新版本组件替换旧版本组件,但此时旧版本组件的文件仍然保存在系统中。执行命令centos2hce2.py --precommit upgrade可清理旧版本组件的文件。 返回信息中提示“upgrade precommit success”表示环境清理成功。 清理动作可执行多次。 (可选)修改Cloud-init相关配置。 若迁移之前的操作系统中存在Cloud-init,服务状态正常,且Cloud-init为rpm包形式,请跳过此步骤。 若迁移之前的操作系统存在Cloud-init服务,服务状态正常,且Cloud-init为某个文件(如CentOS 7系列),非rpm包形式,迁移后请对/etc/cloud/cloud.cfg文件进行如下配置。 设置开放root密码远程登录并开启root用户的ssh权限。 设置“disable_root”为“0”不禁用root用户;“ssh_pwauth”为“1”启用密码远程登录;“lock_passwd”为“False”不锁住用户密码。 users: - name: root lock_passwd: False disable_root: 0 ssh_pwauth: 1 执行/usr/bin/cloud-init init --local命令,无错误发生,说明Cloud-init配置成功。 正确安装的Cloud-init会显示Cloud-init的版本详细信息,并且无任何错误信息。 (可选)因迁移时会自动关闭selinux服务,如迁移后需启用selinux,执行centos2hce2.py --precommit upg-selinux命令。此命令分为两个阶段,每次执行后都需重启系统(若迁移前未开启selinux请忽略此步骤)。 执行centos2hce2.py --precommit upg-selinux命令。 [root@localhost ~]# centos2hce2.py --precommit upg-selinux 2022-08-21 23:46:23,891-INFO-centos2hce2.py-[line:1239]: precommit migration 2022-08-21 23:46:23,891-INFO-centos2hce2.py-[line:1149]: begin to set selinux 2022-08-21 23:46:23,892-INFO-centos2hce2.py-[line:1157]: grub path is /boot/grub2/grub.cfg 2022-08-21 23:46:23,895-INFO-centos2hce2.py-[line:1162]: sed selinux succeed 2022-08-21 23:46:23,897-INFO-centos2hce2.py-[line:1167]: create autorelabel file succeed 2022-08-21 23:46:23,901-INFO-centos2hce2.py-[line:1172]: modify selinux config succeed 2022-08-21 23:46:23,901-INFO-centos2hce2.py-[line:1174]: create phase 1 flag file succeed 2022-08-21 23:46:23,901-INFO-centos2hce2.py-[line:1184]: selinux has been set, please reboot now 2022-08-21 23:46:23,901-INFO-centos2hce2.py-[line:1206]: upgrade precommit selinux success [root@localhost ~]# reboot 系统重启后,再次执行centos2hce2.py --precommit upg-selinux命令。 [root@localhost ~]# centos2hce2.py --precommit upg-selinux 2022-08-21 23:57:07,576-INFO-centos2hce2.py-[line:1239]: precommit migration 2022-08-21 23:57:07,576-INFO-centos2hce2.py-[line:1176]: now begin to set selinux phase 2 2022-08-21 23:57:07,580-INFO-centos2hce2.py-[line:1181]: modify selinux config succeed 2022-08-21 23:57:07,580-INFO-centos2hce2.py-[line:1183]: create phase 2 flag file succeed 2022-08-21 23:57:07,580-INFO-centos2hce2.py-[line:1184]: selinux has been set, please reboot now 2022-08-21 23:57:07,580-INFO-centos2hce2.py-[line:1206]: upgrade precommit selinux success [root@localhost ~]# reboot c.第二次重启后,执行getenforce查看selinux状态,Enforcing表明selinux为开启状态。 [root@localhost ~]# getenforce Enforcing (可选)确认迁移完毕后,清理原系统数据。 迁移操作完成后,原系统的系统数据仍然保留在新系统中,并占用较大内存。建议执行centos2hce2.py --commit all命令清理数据。 执行命令后,系统会自动清理原系统的系统数据,包括步骤3中备份路径下的系统数据。 执行命令后,操作系统无法回退。 [root@localhost ~]# centos2hce2.py --commit all 2022-08-22 04:45:32,601-INFO-centos2hce2.py-[line:1242]: commit migration
  • 安装迁移工具并检查迁移条件 从华为云开源镜像站下载最新版本的迁移工具安装包centos2hce2-*.rpm。 *表示迁移工具版本,本节以centos2hce2-1.0.0-0.0.30.hce2.x86_64.rpm安装包示例。由于迁移工具不断更新,版本号也随之不断更新,操作过程中请适配为实际的安装包名称。 [root@localhost test]# wget https://repo.huaweicloud.com/hce/2.0/updates/x86_64/Packages/centos2hce2-1.0.0-0.0.30.hce2.x86_64.rpm //下载centos2hce2-*.rpm [root@localhost test]# ls //检查是否下载成功 centos2hce2-1.0.0-0.0.30.hce2.x86_64.rpm 安装迁移工具。 [root@localhost test]# rpm -ivh centos2hce2-1.0.0-0.0.30.hce2.x86_64.rpm --nodeps warning: centos2hce2-1.0.0-0.0.30.hce2.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID a8def926: NOKEY Verifying... ################################# [100%] Preparing... ################################# [100%] Updating / installing... 1:centos2hce2-1.0.0-0.0.6.hce2 ################################# [100%] 配置待迁移系统的系统软件数据的备份路径。 在系统切换前,迁移工具将自动备份系统软件的所有数据至备份路径。 执行vim /etc/centos2hce2.conf命令,在centos2hce2.conf配置文件中配置backup_dir字段,配置备份路径。backup_dir默认为/mnt/sdb/.osbak。 # backup dir backup_dir = "/mnt/sdb/.osbak" #配置原系统软件数据的备份路径 为避免迁移过程中系统数据的丢失,建议配置备份目录。 在系统迁移时,迁移工具会自动检查备份目录的空间。建议配置单独的数据盘(如/dev/sdb/,并将该分区挂载到/mnt/sdb/),避免因为空间不足导致的检查失败。 请勿将tmpfs类型的文件系统(如/dev、/run等)作为备份目录,系统重启后tmpfs类型文件系统内的文件会丢失。 设置系统迁移参数。 设置web迁移方式。 web迁移方式通过下载RPM包集合对系统迁移,因此要求在下载RPM包的过程中不能断网。 在centos2hce2.conf配置文件中,进行如下设置: [repo_relation] ..... # default yum source, val: web or iso default_yum_source = 'web' ..... # if web as source, web link config as follow web_link_dir = "https://repo.huaweicloud.com/hce/2.0/os/x86_64/;https://repo.huaweicloud.com/hce/2.0/updates/x86_64/" 表1 参数说明 参数 说明 default_yum_source 迁移方式,设置为'web'。 web_link_dir HCE OS的base repo源和updates repo源地址,多个repo源之间需用英文分号隔开。设置为https://repo.huaweicloud.com/hce/2.0/os/x86_64/;https://repo.huaweicloud.com/hce/2.0/updates/x86_64/ 配置isclose_modules参数,仅CentOS 8系列需要配置。 CentOS 8系列支持将RPM包集成为module的方式批量安装RPM包。HCE OS不支持此种安装方式。因此系统迁移前,须关闭module功能。 “yes”表示系统迁移前会自动关闭系统上的modules,默认为“yes”。 “no”表示系统迁移前不会自动关闭系统上的modules,且若检测到有modules开启时,迁移操作中断。 [system] # whether close modules, if value is no, system may be not migrate isclose_modules = "yes" 执行命令dnf module list可查看待迁移系统中所有运行的module。 执行命令dnf module list | grep '\[e\]'可查看待迁移系统开启的module。 执行centos2hce2.py --check all命令,检查当前系统配置是否满足迁移条件。 提示“Enviroment check passed!”时,表示满足迁移条件,可直接执行迁移操作。 提示“call migration failed”时,表示不满足迁移条件,请根据步骤6自动处理相关异常信息。 安装迁移工具依赖的软件。 执行centos2hce2.py --install all命令,迁移工具会先进行备份,接着系统自动安装迁移工具依赖的软件包,并进行迁移前相关预处理操作。 以下提示表明,已安装依赖的软件包及相关预处理操作,需再次执行步骤5进行环境检查。 2022-08-19 03:12:58,373-INFO-centos2hce2.py-[line:832]: Dependency packages already exist! 2022-08-19 03:12:58,373-INFO-centos2hce2.py-[line:891]: migrate install depend options finished
  • 前提条件 HCE OS中已安装dnf组件,dnf命令可用。 [root@localhost bin]# dnf usage: dnf [options] COMMAND List of Main Commands: alias List or create command aliases autoremove remove all unneeded packages that were originally installed as dependencies check check for problems in the packagedb check-update check for available package upgrades clean remove cached data deplist [deprecated, use repoquery --deplist] List package's dependencies and what packages provide them distro-sync synchronize installed packages to the latest available versions downgrade Downgrade a package ......