当前位置:网站首页>How to safely and quickly migrate from CentOS to openeuler

How to safely and quickly migrate from CentOS to openeuler

2022-07-05 19:40:00 InfoQ

At the end of last year ,Centos 8  Stop maintaining updated messages , It has aroused great attention in the industry . transfer CentOS It's not a simple thing ; It is not only necessary to replace the operating system and its application software and business system 、 adapter 、 Migration and refactoring , Its stability should also be comprehensively considered 、 Security and flexibility , There are also some migration costs 、 Partner ecology and so on .
 
After some research , We used openEuler. And the reason is that , First, the operating system openEuler The kernel comes from Linux, Support various scenarios , Relatively stable and easy to use . secondly , It has relatively perfect compatible evaluation and analysis tools , Reduce some of our work . There's more , Its partner ecological development is relatively good , processor 、 The whole machine 、 Basic software 、 Application software 、 Industry customers can cover , There are also more than a dozen mainstream osv be based on  openEuler  The operating system has released a commercial distribution . Community developers are also more active , The questions or needs mentioned can give some support . and openEuler It's open source. , From cost to application , Overall, I feel quite good .
 
below , Let me share from Centos Migrate to openEuler Experience ; Hopefully that helped .

1. Migration Overview

1.1  Matters needing attention for migration

Key migration issues :
CentOS To openEuler, Whether it's the kernel 、 The basic software packages have changed . Analysts say OS There are three key issues in migration :
1)      Whether the existing software can run in the new system , Including whether there are problems in software installation and functions
2)      Hardware and new OS Is it compatible with
3)      Whether the relevant configurations that have been made can be inherited to the new OS
 
Migration implementation considerations :
1)      It may have an impact on the current network business , Please plan the time window and resources in advance
2)      Please pay attention to the backup of existing network data
3)      It is suggested to strictly follow the process described in the text
4)      The current network business suggests professionals to implement migration , It is recommended to contact the operation and maintenance personnel of the operating system manufacturer to provide technical guidance

1.2  Overview of migration schemes

The migration of operating system and application software mainly includes the following three steps :
①     Migration assessment ( Software 、 Hard 、 To configure )
②     Migration adaptation ( Software adaptation 、 Hard fit 、 Lack of dependence 、 Configuration differences )
③     Migration implementation ( stand-alone 、 The main equipment 、 Distributed )
openEuler Community migration tools x2openEuler Provides ①
Migration assessment
Ability , According to the evaluation results , If there are compatibility issues , Refer to... In this article ②
Migration adaptation
To guide the , Carry out after adaptation ③
Migration implementation
; If there is no compatibility problem , Directly ③
Migration implementation
, The general scheme includes new 、 Capacity expansion 、 Replace three scenarios and stand-alone 、 The main equipment 、 Distributed and other software forms .

2. Migration assessment

openEuler Provided by the community
x2openEuler Tools
Analyze and generate the compatibility evaluation report from the following perspectives :
  • Software evaluation
By identifying the package list information that the application software depends on , Yes rpm/tar/zip/gzip/jar/py/pyc/sh/bin Application for scanning evaluation , And generate .html assessment report .
  • Configure collection and evaluation
Support the collection and generation of user environment data json Format file , Support collecting hardware configuration 、 Configure interface 、 Kernel options configuration parameters 、 System configuration parameters (sysctl/proc/sys)、 environment variable 、 service 、 process 、 port 、 The command interface 、 Information such as system call items and device driver interfaces , And complete the analysis and evaluation of configuration information .
  • Hardware evaluation
Evaluate the whole machine of the operating environment (x86/aarch64)、 Machine board (RAID/NIC/FC/IB/GPU/SSD/TPM) Whether in openEuler Compatibility checklist
 
For detailed usage and functions of the tool, please refer to
x2openEuler Use guide

2.1  Install the migration assessment tool x2openEuler

Download the latest version of the tool according to the architecture

wget https://repo.oepkgs.net/openEuler/rpm/openEuler-20.03-LTS-SP1/contrib/x2openEuler/x86_64/Packages/x2openEuler-2.0.0-430.x86_64.rpm
 
install x2openEuler Tools
yum install x2openEuler-x.x-x.x86_64.rpm
 

2.2  Application software compatibility evaluation

Here to evaluate read-os-1.0.0-1.el7.aarch64.rpm Take the application package and output the software evaluation report as an example , Please select the required parameters according to the actual situation and replace with the software package or package directory to be scanned .

x2openEuler scan read-os-1.0.0-1.el7.aarch64.rpm
null
According to the report tips , There are incompatible dependent packages and interfaces , Please refer to
3.1-3.2 Chapter ( Below )
Complete the adaptation .

2.3  Hardware compatibility evaluation

Here, take the analysis of local hardware resource information as an example , Please choose to analyze local hardware resource information or import external hardware information data according to the actual situation .
x2openEuler hardware-analyse
null
According to the report tips , There are incompatible hardware , Please refer to
3.3 chapter ( Below )
Complete hardware adaptation .

2.4  Configure compatibility evaluation

Here, take the evaluation of local configuration information as an example , The required parameters can be selected according to the actual situation and replaced with the external imported data that needs to be evaluated .
x2openEuler conf-analyse 
null
null
According to the report tips , There are changed configurations that need to be checked , Please refer to
3.4 chapter ( Below )
Complete configuration adaptation .

3. Migration adaptation

The migration adaptation work starts from the analysis and evaluation report , Implement different adaptation actions for the error details in the report .

3.1  Application software migration

    With 2.2 chapter read-os-1.0.0-1.el7.aarch64.rpm Take the evaluation report as an example , From the interface level , The interface called has changed , After analysis, the case relies on “ Removed interface ”,
null
You need to contact the software manufacturer or the responsible party of self-developed software for adaptation .
 
Compatible software can be used directly .

3.2 OS Package adaptation

With 2.2 chapter read-os-1.0.0-1.el7.aarch64.rpm Take the evaluation report as an example , The missing packages found in the dependent packages are as follows ,
null
You need to refer to
Software compatibility adaptation process
Complete package import . After adaptation , Introduce the software package into the software warehouse and refresh the software compatibility list as needed .
 
Compatible software can be used directly .

3.3  Hardware adaptation

With 2.3 Chapter hardware evaluation report as an example ,“ Is it in the compatibility list ” There is “ To be confirmed ” The type of hardware .
null
Need reference
Hardware compatibility testing service
, Guide hardware manufacturers or communities to carry out adaptation , After the adaptation is completed, release the adaptation driver to the software warehouse and refresh the compatibility list .
 
“ Is it in the compatibility list ” by “ yes ” The hardware of has been certified for compatibility , Go straight to the next step .
 

3.4  Configuration adaptation

Analyze the configuration evaluation report ,x2openEuler The tool automatically divides the system configuration into static and dynamic , Users only need to combine their actual business demands and different tuning strategies , Compare the differences , Select the configuration that needs to be modified , Script automation , Realize one click configuration synchronization .

4. Migration implementation ( Existing system replacement )

Before migration , You need to be familiar with the software deployment architecture and deployment networking in advance , Output the migration scheme of the corresponding scenario . at present  openEuler  Provide migration solutions for mainstream scenarios , Like big data 、 Distributed storage 、 virtualization 、 Containers 、 Database software , Successfully support multiple industry users to complete the migration , Please contact openEuler Operation and maintenance personnel provide technical guidance . The implementation process of relocation mainly includes stopping business 、 Backup isolation 、 System deployment 、 Configuration synchronization 、 Application deployment 、 The core steps of business cutover .

4.1  Stop business

It is necessary to apply for a shutdown window and prepare for the relocation , Evaluate the downtime maintenance window according to the business scenario and cutover difficulty . For the common single machine in migration implementation 、 The main equipment 、 Distributed cluster scenario , Different application software can achieve short-term business interruption or no interruption at all , The specific scenario needs to be analyzed separately in combination with the application software , The three common scenarios are as follows :
1)   Stand alone software : Business interruption , downtime x Hours
2)   Active and standby software : No downtime
3)   Distributed cluster software : No downtime

4.2  Backup isolation

To ensure the security of business applications in the relocation process , Prevent the loss of information in the relocation process , It is recommended to make a backup before moving , Isolation is to prevent the relocation process from affecting other normal business operations . Perform disaster recovery backup for different business scenarios 、 Network isolation can be implemented in combination with the specific characteristics of business software , Such as Mysql Database scenarios can be accessed through xtrabackup And other tools for fast backup and restore .

4.3  System deployment

The system deployment tool can be used for automatic batch deployment , Greatly improve deployment efficiency . The deployment process can be based on gkit Tool building pxe The server , After synchronizing the configuration file, you can quickly complete the installation process :
1)   To configure pxe server information
null
2)  Import the configured template , Click on the install , Automatic configuration pxe The server
null
3)  confirm Pxe The service status is green , Express pxe Server setup completed
null
4)  Enter server kvm, Set up the server from pxe Start and restart
null
5)  The next steps are automatically completed , Synchronous configuration ip,OS installation is complete

4.4  Configuration synchronization

according to
3.4 chapter ( Above, )
Complete the adaptation , be based on x2openEuler Integrated configuration tools , Realize system parameter configuration 、 One click synchronization of service status configuration , Ensure that the basic operating environment and status information are migrated synchronously , Ensure that the operating environment of the system is consistent after the business relocation .

4.5  Application deployment

Before application deployment, the applications to be deployed can be packaged into RPM Package form , By writing the application deployment installation script , Verify in the experimental environment , Ensure the accuracy of the deployment script . After basic verification , Copy the script in batch to the server to be deployed for execution , Complete automatic application deployment . For mainstream open source software , Like big data 、 database 、 virtualization 、 Container, etc ,openEuler Complete rpm package , Can be directly applied and deployed .

4.6  Business cutover

The business cutover link needs to consider the characteristics of the application software , Achieve the smallest possible business interruption and efficient smooth relocation . For single machine 、 The main equipment 、 Distributed cluster software , The business cutover process is as follows :
1) Stand alone software
When this kind of software is migrated , It involves operating system switching , Basically, the business will be interrupted , The impact of disruption caused by migration needs to be fully considered , Select the appropriate window to migrate , Consider using a standby server , Cutover migration . Keep the original node after the cutover x Observe the business operation of the new node for days ,x Destroy the original node after days .
2) Active and standby software
When this kind of software is migrated , Without interrupting business , First standby, then main , Based on the active and standby state synchronization mechanism , Smooth migration . Isolate the standby node server , Redeploy on the standby node OS And business , Realize active and standby synchronization based on the active and standby synchronization mechanism , Then upgrade through active / standby switchover OS The backup node is switched to the primary node , The other node works in the same way OS upgrade . Observe the business operation of the new primary node after the active / standby switch ,x Replace the standby node after days .
3) Distributed cluster software
When this kind of software is migrated , Non disruptive business , It can be based on the built-in scalability mechanism of distributed software , Smooth migration is achieved by rolling substitution . Isolate the nodes that need to be replaced , Then redeploy the new OS, Then join the original cluster . Switch 1/3 After counting nodes, observe the business operation of new nodes ,x Replace the old node after days .
 

5. Migration implementation ( New capacity expansion )

5.1  System deployment

The system deployment tool can be used for automatic batch deployment , Greatly improve deployment efficiency . The deployment process can be based on gkit Tool building pxe The server , After synchronizing the configuration file, you can quickly complete the installation process :
1)      To configure pxe server information
null
2) Import the configured template , Click on the install , Automatic configuration pxe The server
null
3) confirm Pxe The service status is green , Express pxe Server setup completed
null
4) Enter server kvm, Set up the server from pxe Start and restart
null

5) The next steps are automatically completed , Synchronous configuration ip,OS installation is complete

5.2  Configuration synchronization

according to 【 Migration adaptation 】 Complete the adaptation action in Chapter , be based on x2openEuler Integrated configuration tools , Realize system parameter configuration 、 One click synchronization of service status configuration , Ensure that the basic operating environment and status information are migrated synchronously , Ensure that the operating environment of the system is consistent after the business relocation .

5.3  Application deployment

Before application deployment, the applications to be deployed can be packaged into RPM Package form , By writing the application deployment installation script , Verify in the experimental environment , Ensure the accuracy of the deployment script . After basic verification , Copy the script in batch to the server to be deployed for execution , Complete automatic application deployment . For mainstream open source software , Like big data 、 database 、 virtualization 、 Container, etc ,openEuler Complete rpm package , Can be directly applied and deployed .
 

6. summary

These are some of my experiences and methods , Although there are many questions in the process , But fortunately, community developers are very enthusiastic , On the whole, it is relatively smooth . Share this blog , I also hope to bring some help to my friends , Communicate together .
 
Reference link :
<https://www.openeuler.org/zh/other/migration/>
原网站

版权声明
本文为[InfoQ]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/186/202207051934507943.html