Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use cloud tools to easily migrate servers to ECS

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

Today, I will talk to you about how to use cloud tools to easily migrate servers to ECS. Many people may not know much about it. In order to make you understand better, the editor has summarized the following for you. I hope you can get something according to this article.

Preface

In many cases, how to migrate the server to Aliyun's ECS has become an obstacle to many users' access to the cloud, especially when there are already very complex software deployments in the local operating system. At this time, the migration to the cloud or between different public clouds makes many people hesitant.

The cloud migration tool provided by Aliyun is made for this migration pain point, and it is very useful!

Introduction

The cloud migration tool directly uses the public network to migrate users' systems, which does not need to occupy additional local storage space, which greatly reduces the burden and cost of migration. At the same time, this tool has made a lot of efforts in terms of ease of use. Compared with previous versions of the tool, it greatly simplifies the conditions for use and lowers the threshold for use, making it possible for users to migrate their systems to Aliyun with one click.

Of course, there are bottlenecks, which is bandwidth, but many physical servers have a lot of bandwidth. CVM can also be billed by traffic. It can be said that bottlenecks can also be solved.

All in all, its characteristics are: low operation complexity, migration speed block, high degree of system reduction.

The images supported by cloud migration tools include Windows Server and common mainstream Linux hairstyles, which support P2V (physical machine migration cloud) and V2V (virtual machine / public cloud migration cloud).

System platform version number support status Windows2003/2008/2012/2016 support CentOS5/6/7 support Red Hat5/6/7 support Ubuntu10/12/14/16/17 support Debian7/8/9 support SUSE Linux11.4/12.1/12.2 support OpenSUSE13.1 support Gentoo13.0 support requirements

Products that need to be used:

The balance of Aliyun account is greater than or equal to 100 yuan (according to the requirement of opening volume)

Physical machines, virtual machines, and public cloud servers that can be connected to the public network

Through this article, you will learn:

Use the cloud migration tool to migrate images to Aliyun

Tutorials

In the tutorial, we take Tencent Cloud CVM as an example to introduce the migration of Linux hairstyle version, and migrate the images from Tencent Cloud in Shanghai to Aliyun. It is recommended that instances with low bandwidth should consider creating a custom image and using this image to create a postpaid instance with a bandwidth of 100m by traffic. If the physical machine has a very large transmission volume, you can also consider using Aliyun's high-speed tunnel service to establish a transmission direct connect.

Then I created a pure Nginx environment and put a default home page and / root/qianyun.txt two files to verify the accuracy of the migration.

Prepare to install the base library

1. Install the essential software Rsync library:

CentOS 、 RHEL:

Yum install epel-release-yyum install rsync git python python-pip-y

Debian 、 Ubuntu:

Apt install rsync git python python-pip-y compile and install cloud-init

Download the cloud-init source code:

Git clone https://git.launchpad.net/cloud-initcd cloud-init

Second, install Python library dependencies:

Pip install-r requirements.txt

3. Compile and install:

Python setup.py install

4. Modify the configuration file:

Mv / etc/cloud/cloud.cfg / etc/cloud/cloud.cfg.bakcd / etc/cloud/wget https://gitee.com/yunvy/codes/p0omxzqs8ecaj5iwtu9b175/raw?blob_name=cloud.cfg-O cloud.cfg create a restricted sub-account

Since the period operation is automatically implemented through the command line, an Access Key process is required, but the default Access Key is global full permissions, so we should use the access control RAM to create a sub-account with only ECS administrative privileges.

However, as the space limit is not suitable for further discussion on access control, you can refer to "using Aliyun SMS service curve to achieve the real name of WP comments" to see step 4. Steps in activating access control service.

Download the moving Cloud tool

First, download the source package

Cd / root/wget http://p2v-tools.oss-cn-hangzhou.aliyuncs.com/Alibaba_Cloud_Migration_Tool.zipunzip Alibaba_Cloud_Migration_Tool.zip

Second, after decompression, there will be two compressed packages, one is Linux and the other is Windows. It is very clear that we are of course Linux.

[root@VM_199_173_centos ~] # unzip Alibaba_Cloud_Migration_Tool.zip Archive: Alibaba_Cloud_Migration_Tool.zip Inflating: go2aliyun_client1.2.5_linux.zip inflating: go2aliyun_client1.2.5_windows.zip

Third, extract the Linux toolkit:

Unzip go2aliyun_client1.2.5_linux.zipcd go2aliyun_client1.2.5_linux/

4. There are two directories in the directory:

[root@VM_199_173_centos go2aliyun_client1.2.5_linux] # ls go2aliyun_client1.2.5_linux_i386 go2aliyun_client1.2.5_linux_x86_64

I386 is a 32-bit system and x86 / 64 is a 64-bit system, but the server uses 64-bit by default, so we go to the go2aliyun_client1.2.5_linux_x86_64 directory.

Cd o2aliyun_client1.2.5_linux_x86_64 configuration

First, modify the user_config.json file, this is a json configuration file

{"access_id": "," secret_key ":", "region_id": "," image_name ":", "system_disk_size": 40, "platform": "", "architecture": "", "data_disks": [], "bandwidth_limit": 0}

Specific parameters:

Whether the parameter name type is required indicates that access_idString is the API access key AccessKeyID of your Aliyun account. For more details, see creating an Access Key. Secret_keyString is the API access key AccessKeySecret of your Aliyun account. For more details, see creating an Access Key. Region_idString is the region ID where your server migrated to Ali Cloud, such as cn-hangzhou (East China 1). For values, please see https://help.aliyun.com/document_detail/53289.html" data-spm-anchor-id= "a2c4g.11186623.2.28" > region and availability zone. Image_nameString is to set an image name for your server image, which cannot be duplicated with the existing image name in the same region.

The length is [2128] English or Chinese characters, must begin with a large and small letter or Chinese, and can contain numbers, periods (.), underscores (_) or dashes (-).

The image name is displayed in the ECS console.

Cannot start with http:// and https://.

System_disk_sizeint specifies the size of the system disk in GB. Value range:

[40, 500]

The value of this parameter needs to be larger than the actual size of the system disk of the source server. For example, if the size of the source system disk is 500 GB and the actual occupation is 100 GB, the value of this parameter should be greater than 100 GB.

PlatformString is not the operating system of the source server. Value range:

CentOS

Ubuntu

SUSE

OpenSUSE

Debian

RedHat

Others Linux

Windows Server 2003

Windows Server 2008

Windows Server 2012

Windows Server 2016

The value of the parameter platform needs to be consistent with the above list, must be case-sensitive, and keep spaces consistent. ArchitectureString No system architecture. Value range:

I386Rank 32-bit system architecture

X86x6x6x6x6x6x6x86x6x6x6x6x6x6x6x6x6x6x6x6x6x6x6x6x6x6x6x6x6x86x6x6x6x6x6x6x6x6x6x6x6x6x6x6x6x86x6x6x6x6x6x6x6x6x6x6x6x6x6x6x6x6x6xx6xx6xxx6xx6x6xx6x6x6x6x6x6x6x6x6x6x6x6x6xx6xxx86xx86xx6xx6xx6x6xx6x6

Bandwidth_limitint No bandwidth limit for data transmission (in KB/s).

Default value: 0data_disksArray No data disk list. A maximum of 16 data disks are supported. For more information, please see the data disk configuration parameter description.

This parameter can be set to the expected value of the downsized data disk in GB, which cannot be less than the actual usage space of the data disk.

For the contents of the data disk, please refer to https://help.aliyun.com/document_detail/62394.html#Table2, so I can create a configuration file as follows:

{"access_id": "LTAIXeadwww.mf8.biz", "secret_key": "VHVQ1Tzwww.mf8.bizvH8pIMoMSA", "region_id": "cn-shanghai", "image_name": "MF8-BIZ-QIANYUN-IMAGE-001", "system_disk_size": 50, "platform": "CentOS", "architecture": "x86164"," data_disks ": []," bandwidth_limit ": 0}

Pay special attention to the case of platform!

Second, the directory in rsync_excludes_linux.txt is not migrated to avoid unnecessary waste of space, we can add unnecessary directories in it.

Migrate cd / root/go2aliyun_client1.2.5_linux/go2aliyun_client1.2.5_linux_x86_64chmod + x. / go2aliyun_client./go2aliyun_client

Then a temporary ECS of the selected region is automatically created for synchronization. After the synchronization is completed, a snapshot is automatically created and created as a custom mirror.

At this time, we don't have to worry about anything, just make a cup of coffee and take a nap.

Enter any key to Exit... appears It means that our migration has been completed.

Then you can see the snapshot created in the snapshot list:

After reading the above, do you have any further understanding of how to easily migrate servers to ECS with cloud tools? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report