将腾讯云的云服务器迁移至轻量云服务器Ubuntu

将腾讯云的云服务器迁移至轻量云服务器Ubuntu,第1张

腾讯云的云服务器迁移至轻量云服务器Ubuntu 将腾讯云的云服务器迁移至轻量云服务器(Ubuntu)出现的问题

通过“镜像”,可以将整个硬盘都迁移过去,这是最好的方案。具体可以看腾讯云怎么 *** 作。

但是这会面临一些问题,比如密码登陆不上,ssh连接不上等等。

密码登陆不上:这是自动将ubuntu的密码重置了,腾讯云自带的控制台修改即可。ssh连接不上:根本原因是网络配置错误。暂且发现是MAC地址配置错误,这是因为直接移动硬盘,忽略了网络环境的影响。我们修改/etc/netplan/50-cloud-init.yaml中的MAC地址即可,新的MAC地址可以通过先重装系统看对应文件,然后复制下来安装镜像之后修改即可。如果无效,可以对比一下/etc下新旧服务器有关net的文件的区别,然后一一更改。

写博客完整过程是用英文写的,完整见下

Full Procedure

My cloud service will expire soon. So I bought a cheaper one called lightweight cloud server. So I need to transfer all my data to it.

OS: Ubuntu Server 18.04.1 LTS 64bit

Instance: Tencentyun

Make mirror and load it into the new server

But we have met some problems. If we found that the password is wrong, we can simply change it in Tencentyun Control center.

The second is that we can’t use ssh to connect with it.

When trying to install ssh, it says we can’t resolve tencentyun.com.Also, we can’t even ping it.No package has been sent out.When I use the server to ping other networks, it says network is unreachableWhen I use service network restart to restart the network, it says Unit network.service not found..

We use wrong command. This is right. service networking restart

Overall, I think that this is caused by network configuration difference. Because two sever has different network environment, the same setting can cause different results. So I reset the sever and check the difference as follows:

Solutions

According to technique articles that I have found, the configuration file won’t be changed when transferring to other servers. Among all the files, the key one is the MAC configuration in /etc/netplan/50-cloud-init.yaml.

You will find information of new server once you install the same OS in it. once you have recorded it, you can start your transferring and the MAC modification later.

But next, if you will find that your ssh is polluted, you can refer to related material.

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5714545.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存