当前位置:网站首页>Operating system migration practice: deploying MySQL database on openeuler
Operating system migration practice: deploying MySQL database on openeuler
2022-07-26 16:43:00 【Euler open source community】
Let me write it out front
In system migration, library migration is a very “ bald ” Affair . Simple needs ( Make another copy as it is to XXX Environmental Science ) It doesn't mean that its process is simple …… Fortunately openEuler The community provides tools x2openEuler, Being able to evaluate in advance will MySQL Migration to openEuler The compatibility of the operating system , Real time data relocation , Reduce a lot of preparation and time . Thinking that there may be friends who meet the same needs , Here I want to share my experience , I also hope you can communicate together
1. Brief introduction
This article is mainly used in openEuler 20.03 sp1 Deployment on operating system MySQL database . This practice mainly uses x86_64 Architecture virtual machine , Through evaluation tools x2openEuler assessment MySQL 5.7.21 The software is ported to openEuler The compatibility of the operating system , Then implement data relocation . If you use another version MySQL, You can refer to .
2. Environmental Science
| project | explain |
|---|---|
| The server | TaiShan 200 The server |
| CPU | Huawei Kunpeng 920 processor |
| Raid card | SAS3508 |
| Network card | Mellanox SP333 |
| – | TM210 |
| – | TM280 |
| Disk capacity | 500GB above |
OS
| Software | edition | remarks |
|---|---|---|
| OS | Centos 7.6.1810 | At present mysql Cluster server |
| OS | openEuler 20.03 SP1 | Migration target server |
software package
| Software | edition |
|---|---|
| mysql5 | 5.7.21 |
| mysql5-common | 5.7.21 |
| mysql5-embedded | 5.7.21 |
| mysql5-embedded-devel | 5.7.21 |
| mysql5-errmsg | 5.7.21 |
| mysql5-libs | 5.7.21 |
| mysql5-server | 5.7.21 |
| mysql5-test | 5.7.21 |
3. Software compatibility evaluation
openEuler The community provided x2openEuler Tools , For binary programs that have been compiled , Carry out the main completion software package 、 Interface level evaluation , Determine whether the application software needs to be transplanted and adapted , Whether there are dependent software packages to be introduced ; At the same time, evaluate whether the interface prototype of software call is different between the two systems .
notes : Compiled binary program , It is difficult to ensure that all are compatible with the new OS, When it is serious, it will cause memory risk , Often this kind of problem is difficult to identify through verification , It is particularly important to evaluate software compatibility before migration .
3.1 obtain mysql Of RPM Package and extract to /opt/mysql Under the table of contents
wget –P /opt https://downloads.mysql.com/archives/get/p/23/file/mysql-5.7.21-1.el7.x86_64.rpm-bundle.tar
cd /opt/
mkdir mysql
tar -xf mysql-5.7.21-1.el7.x86_64.rpm-bundle.tar -C mysql
3.2 download x2openEuler Tools to /opt/mysql
Download guide :https://www.openeuler.org/zh/other/migration/
3.3 Deployment tools
cd /opt/mysql
rpm -ivh x2openEuler-2.0.0-1.x86_64.rpm
Be careful : install rpm When needed root user , And now the network is needed ( Used to download installation dependencies ) Be careful : Follow the prompts to install dependent packages such as bzip2-devel etc.
su x2openEuler
x2openEuler redis-db -init
Enter... In sequence redis Database ip:127.0.0.1 port :6379 Database index number (0-16):0 password ( The tool encrypts the password ): If redis When the password is not set or empty , Just go back .
x2openEuler init source_centos7.6-openEuler20.03-LTS-SP1.tar.gz
remarks :x2openEuler Use rpm After the installation, it will be in /opt/x2openEuler The directory contains source_centos7.6-openEuler20.03-LTS-SP1.tar.gz This default resource bundle , Need to support centos8.2 To openEuler20.03-LTS-SP1 The evaluation of , You need to get the corresponding static resource package import , If the corresponding resource package is source_centos8.2-openEuler20.03-LTS-SP1.tar.gz, Import this package command :x2openEuler init source_centos8.2-openEuler20.03-LTS-SP1.tar.gz, Select the corresponding resource package for instructions
3.4 scanning mysql
x2openEuler scan /opt/mysql/
Note that the migration file to be analyzed needs to be able to x2openEuler Permissions that users can read
The scanning will be completed in /opt/x2openEuler/output Directory generation html Report in format
4. Analysis of evaluation results
The software compatibility evaluation report shows software compatibility in three parts , They are dependent on package compatibility 、C/C++ Interface compatibility 、java Interface compatibility , The dependency package compatibility reflects the direct dependency in the software package installation process , Not 100% Indicates that it cannot be installed correctly ; Interface compatibility reflects the impact of a single software on other software packages during its operation 、 Dynamic library or system interface call changes , Not 100% Indicates that an exception may be triggered when a function is called , When not called, it may behave normally ; Some results are suggested to be reviewed manually , Recommendations for final package usage priority openEuler Migrated package >openEuler On the manual recompile package >centos software package .
4.1 Report analysis
open html The report , line-by-line analysis , Come to the conclusion : stay openEuler Use directly on centos Of mysql There is a risk in the package , The risks are as follows :
1 Interfaces to be confirmed indicate mysql A series of software packages will call libaio.so.1.0.1, The number of function parameters ranges from 4 Turn into 5, Directly affect the function , An exception may be triggered when a function is called ;
in addition , The report shows that confirmation is needed 3 Dependency packages , After manual confirmation, it belongs to mysql Series package self closed loop dependency , Therefore, the software package installation has no impact .

4.2 The analysis results suggest
Suggest : Due to the risk of function calls , It is recommended to use it directly in openEuler Official compilation and transplantation mysql-5.7.21 Series of software packages
https://repo.openeuler.org/openEuler-20.03-LTS-SP1/everything/x86_64/Packages/mysql5-5.7.21-3.oe1.x86_64.rpm
https://repo.openeuler.org/openEuler-20.03-LTS-SP1/everything/x86_64/Packages/mariadb-common-10.3.9-9.oe1.x86_64.rpm
https://repo.openeuler.org/openEuler-20.03-LTS-SP1/everything/x86_64/Packages/mysql5-common-5.7.21-3.oe1.x86_64.rpm
https://repo.openeuler.org/openEuler-20.03-LTS-SP1/everything/x86_64/Packages/mysql5-server-5.7.21-3.oe1.x86_64.rpm
https://repo.openeuler.org/openEuler-20.03-LTS-SP1/everything/x86_64/Packages/mysql5-errmsg-5.7.21-3.oe1.x86_64.rpm
https://repo.openeuler.org/openEuler-20.03-LTS-SP1/everything/x86_64/Packages/mecab-0.996-2.oe1.x86_64.rpm
5. mount this database mysql
5.1 install mysql And configure the password
1) install mariadb And mysql Related services .
rpm -ivh mysql5-5.7.21-3.oe1.x86_64.rpm mariadb-common-10.3.9-9.oe1.x86_64.rpm mysql5-common-5.7.21-3.oe1.x86_64.rpm mysql5-server-5.7.21-3.oe1.x86_64.rpm mecab-0.996-2.oe1.x86_64.rpm mysql5-errmsg-5.7.21-3.oe1.x86_64.rpm
2) start-up mysql.
systemctl start mysqld
3)mysql State query .
systemctl status mysqld
Status as running It starts successfully :
[email protected]-2p32g.2288hv5-2s44p-384g--b5-0 ~# systemctl status mysqld
● mysqld.service - MySQL 5.7 database server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; disabled; vendor preset: disabled)
Active: active (running) since Thu 2021-09-09 10:23:25 CST; 1 day 4h ago
Process: 103715 ExecStartPre=/usr/libexec/mysql-check-socket (code=exited, status=0/SUCCESS)
Process: 103738 ExecStartPre=/usr/libexec/mysql-prepare-db-dir mysqld.service (code=exited, sta>
Process: 103773 ExecStart=/usr/libexec/mysqld --daemonize --basedir=/usr --pid-file=/run/mysqld>
Process: 103803 ExecStartPost=/usr/libexec/mysql-check-upgrade (code=exited, status=0/SUCCESS)
Main PID: 103775 (mysqld)
Tasks: 37
Memory: 188.4M
CGroup: /system.slice/mysqld.service
└─103775 /usr/libexec/mysqld --daemonize --basedir=/usr --pid-file=/run/mysqld/mysqld.
4) Log in and change the default password .
mysql -uroot -p
- a. No password by default , Press enter to login .
[email protected]-2p32g.2288hv5-2s44p-384g--b5-0 /# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.21 MySQL Community Server (GPL)
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
- b. Set the password .
alter user ‘user’@‘localhost’ identified by ‘passward’;
mysql> alter user 'root'@'localhost' identified by '123456';
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql>
flush privileges Must be implemented , Otherwise, the setting will not take effect .
5) Verify password .
Log out and log back in , Check whether the password has been successfully modified .
[email protected]-2p32g.2288hv5-2s44p-384g--b5-0 /# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3Server version: 5.7.21 MySQL Community Server (GPL)
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
6. summary
Move again according to the evaluation results , The overall operation is relatively easy , If the evaluation result is in doubt , Can be directed to openEuler Community mailing list ([email protected]) consulting .
Reference material :
openEuler Official website https://www.openeuler.org/zh/other/migration/
x2openEuler User guide
https://docs.openeuler.org/zh/docs/20.03_LTS_SP1/docs/thirdparty_migration/x2openEuleruseguide.html
openEuler Community mailing list https://www.openeuler.org/zh/community/mailing-list/
边栏推荐
- JS API summary of Array Operations
- Want the clouds in the picture to float? Video editing services can be achieved in three steps with one click
- Replicationcontroller and replicaset of kubernetes
- NUC 11构建 ESXi 7.0.3f安装网卡驱动-V2(2022年7月升级版)
- 利用MySQL主从复制延迟拯救误删数据
- 搭建typora图床
- MVC和ECS两种设计架构的初浅理解
- srec_ Use of common cat parameters
- 微信小程序---网络数据请求
- Pat class a 1047 student list for course
猜你喜欢

DTS is equipped with a new self-developed kernel, which breaks through the key technology of the three center architecture of the two places Tencent cloud database

FTP protocol

RE9: read the paper deal inductive link prediction for nodes having only attribute information

该怎么写单元测试呢
最终一致性性分布式事务 TCC

Marketing guide | several common micro blog marketing methods

Singleton mode

Re8:读论文 Hier-SPCNet: A Legal Statute Hierarchy-based Heterogeneous Network for Computing Legal Case

Alibaba Cloud Toolkit —— 项目一键部署工具

Re7: reading papers fla/mlac learning to predict charges for critical cases with legal basis
随机推荐
2022 Niuke summer multi school training camp 1 (acdgij)
PyQt5快速开发与实战 3.4 信号与槽关联
How to test the circle of friends (mind map)
Linux安装mysql8.0.29详细教程
Linux Installation mysql8.0.29 detailed tutorial
How to configure tke cluster node Max pod
理财产品锁定期是什么意思?理财产品在锁定期能赎回吗?
docker安装redis?如何配置持久化策略?
Pat grade a 1049 counting ones
Replicationcontroller and replicaset of kubernetes
Pat grade a 1048 find coins
Comprehensively design an oppe homepage -- layout and initialization
The "nuclear bomb level" log4j vulnerability is still widespread and has a continuing impact
综合设计一个OPPE主页--布局与初始化
【飞控开发基础教程3】疯壳·开源编队无人机-串口(基础收发)
Marxan模型保护区优化与保护空缺甄选技术、InVEST生态系统中的应用
Trends in software testing tools in 2021
Configmap of kubernetes
Oracle创建表分区后,查询的时候不给出partition,但是会给分区字段指定的值,会不会自动按照分区查询?
Nacos win10 installation and configuration tutorial