从GCP迁移到AWS的问题

时间:2020-07-02 10:06:41

标签: amazon-web-services ssh google-cloud-platform

我尝试将实例从GCP迁移到AWS。在此过程中,我遇到了很多问题。但最后我成功迁移了。

我使用Cloud Endure进行迁移。迁移完成后,我尝试通过SSH进入已迁移的实例,但无法通过SSH进入实例。端口22的连接被拒绝。因此,我启动了另一个实例(测试),并分离了迁移实例的卷,并将其连接到测试实例,并将该卷安装为xvdf1-> / mnt。然后我用nspawn检查是什么原因引起的。我发现服务systemd-remount-fs cloud-init,iscsid,open-iscsi,cloud-config和lightdm处于失败状态。

因此,我终止了nspawn容器,并将/etc/cloud/cloud.cfg.d/95_mirrors.cfg复制到/mnt/etc/cloud/cloud.cfg.d,然后再次使用nspawn创建了该容器。现在,cloud-init和cloud-config处于活动状态,并保持失败状态。

我也检查了ssh状态,它没有被加载。我进行了以下更改:

update-rc.d ssh defaults
systemctl enable ssh.socket
systemctl enable ssh.service
echo /etc/init.d/ssh restart > /etc/NetworkManager/dispatcher.d/10ssh
chmod 755 /etc/NetworkManager/dispatcher.d/10ssh

此后,我重新启动了容器,现在ssh服务和ssh套接字处于活动状态。

我卸载了该卷,将其与测试实例分离,并作为根卷xvda1附加到迁移的实例上。

我能够SSH进入服务器。

但是现在我每次需要更新时都面临两个问题

E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.

然后,我必须再次运行rm /var/lib/dpkg/lockdpkg --configure -a来安装任何软件包。

如果我尝试安装任何软件包,则说lsof的安装卡住了

root@ip-192-168-3-237:/etc/cloud/cloud.cfg.d# apt-get install lsof
Reading package lists... Done
Building dependency tree
Reading state information... Done
lsof is already the newest version (4.89+dfsg-0.1).
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up gce-compute-image-packages (20190801-0ubuntu1~16.04.1) ...

Progress: [ 25%] [#####################################..................................................................]

我无法在该迁移实例中安装任何软件包。

对此有什么可能的解决方案?

0 个答案:

没有答案
相关问题