点击上方“IT那活儿”公众号,关注后了解更多内容,不管IT什么活儿,干就完了!!!
为保障支撑系统的安全、稳定运行,根据公司安全漏洞扫描检查,检查结果中存在安全漏洞,在与安全组协商讨论后,决定首先对数据中心数据库服务器进行安全加固,加固方式为补丁升级。
2. 数据库版本信息
数据库新版本:8.0.27
192.168.48.132 mgrslave2
mysql> select * from replication_group_members;
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+
| CHANNEL_NAME | MEMBER_ID | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE | MEMBER_ROLE | MEMBER_VERSION |
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+
| group_replication_applier | 30c16455-f052-11ec-9838-000c29c0b10f | mgrslave1 | 3307 | ONLINE | SECONDARY | 8.0.19 |
| group_replication_applier | 3ae38ddb-f055-11ec-a2b5-000c292f5d0e | mgrslave2 | 3307 | ONLINE | SECONDARY | 8.0.19 |
| group_replication_applier | bf71ff91-f094-11ec-bf83-000c2997f11b | mgrmaster | 3307 | ONLINE | PRIMARY | 8.0.19 |
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+
mysql> set global innodb_fast_shutdown = 0;
Query OK, 0 rows affected (0.00 sec)
mysql> select @@innodb_fast_shutdown;
+------------------------+
| @@innodb_fast_shutdown |
+------------------------+
| 0 |
+------------------------+
1 row in set (0.00 sec)
mysql> shutdown;
Query OK, 0 rows affected (0.04 sec)
[root@mgrslave1 my3307]# tar -xf mysql-8.0.27-linux-glibc2.12-x86_64.tar
[root@mgrslave1 my3307]# unlink mysql
[root@mgrslave1 my3307]# ln -s mysql-8.0.27-linux-glibc2.12-x86_64 mysql
[root@mgrslave1 my3307]# ./mysql/bin/mysqld_safe --defaults-file=/home/my3307/my.cnf &
#建议主库启动服务时添加--read_only参数 ,防止有连接操作
[root@mgrslave1 my3307]# mysql -uroot -p -S /home/my3307/run/mysql.sock
Enter password:
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 10
Server version: 8.0.27 MySQL Community Server - GPL
Copyright (c) 2000, 2019, 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> START GROUP_REPLICATION;
Query OK, 0 rows affected (13.35 sec)
mysql> SELECT * FROM performance_schema.replication_group_members;
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+----------------------------+
| CHANNEL_NAME | MEMBER_ID | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE | MEMBER_ROLE | MEMBER_VERSION | MEMBER_COMMUNICATION_STACK |
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+----------------------------+
| group_replication_applier | 30c16455-f052-11ec-9838-000c29c0b10f | mgrslave1 | 3307 | ONLINE | SECONDARY | 8.0.27 | XCom |
| group_replication_applier | 3ae38ddb-f055-11ec-a2b5-000c292f5d0e | mgrslave2 | 3307 | ONLINE | SECONDARY | 8.0.19 | XCom |
| group_replication_applier | bf71ff91-f094-11ec-bf83-000c2997f11b | mgrmaster | 3307 | ONLINE | PRIMARY | 8.0.19 | XCom |
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+---------
mysql> START GROUP_REPLICATION;
Query OK, 0 rows affected (5.56 sec)
mysql> SELECT * FROM performance_schema.replication_group_members;
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+----------------------------+
| CHANNEL_NAME | MEMBER_ID | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE | MEMBER_ROLE | MEMBER_VERSION | MEMBER_COMMUNICATION_STACK |
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+----------------------------+
| group_replication_applier | 30c16455-f052-11ec-9838-000c29c0b10f | mgrslave1 | 3307 | ONLINE | SECONDARY | 8.0.27 | XCom |
| group_replication_applier | 3ae38ddb-f055-11ec-a2b5-000c292f5d0e | mgrslave2 | 3307 | ONLINE | SECONDARY | 8.0.27 | XCom |
| group_replication_applier | bf71ff91-f094-11ec-bf83-000c2997f11b | mgrmaster | 3307 | ONLINE | PRIMARY | 8.0.19 | XCom |
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+----------------------------+
3 rows in set (0.01 sec)
mysql> START GROUP_REPLICATION;
Query OK, 0 rows affected (9.84 sec)
mysql> SELECT * FROM performance_schema.replication_group_members;
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+----------------------------+
| CHANNEL_NAME | MEMBER_ID | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE | MEMBER_ROLE | MEMBER_VERSION | MEMBER_COMMUNICATION_STACK |
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+----------------------------+
| group_replication_applier | 30c16455-f052-11ec-9838-000c29c0b10f | mgrslave1 | 3307 | ONLINE | PRIMARY | 8.0.27 | XCom |
| group_replication_applier | 3ae38ddb-f055-11ec-a2b5-000c292f5d0e | mgrslave2 | 3307 | ONLINE | SECONDARY | 8.0.27 | XCom |
| group_replication_applier | bf71ff91-f094-11ec-bf83-000c2997f11b | mgrmaster | 3307 | ONLINE | SECONDARY | 8.0.27 | XCom |
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+----------------------------+
mysql> select group_replication_set_as_primary(bf71ff91-f094-11ec-bf83-000c2997f11b);
+--------------------------------------------------------------------------+
| group_replication_set_as_primary(bf71ff91-f094-11ec-bf83-000c2997f11b) |
+--------------------------------------------------------------------------+
| Primary server switched to: bf71ff91-f094-11ec-bf83-000c2997f11b |
+--------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> SELECT * FROM performance_schema.replication_group_members;
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+----------------------------+
| CHANNEL_NAME | MEMBER_ID | MEMBER_HOST | MEMBER_PORT | MEMBER_STATE | MEMBER_ROLE | MEMBER_VERSION | MEMBER_COMMUNICATION_STACK |
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+----------------------------+
| group_replication_applier | 30c16455-f052-11ec-9838-000c29c0b10f | mgrslave1 | 3307 | ONLINE | SECONDARY | 8.0.27 | XCom |
| group_replication_applier | 3ae38ddb-f055-11ec-a2b5-000c292f5d0e | mgrslave2 | 3307 | ONLINE | SECONDARY | 8.0.27 | XCom |
| group_replication_applier | bf71ff91-f094-11ec-bf83-000c2997f11b | mgrmaster | 3307 | ONLINE | PRIMARY | 8.0.27 | XCom |
+---------------------------+--------------------------------------+-------------+-------------+--------------+-------------+----------------+----------------------------+
3 rows in set (0.00 sec)
若在升级过程中,遇到报错。首先检查error日志对错误进行排查。如果问题无法解决,则进行版本回退。
清理redo log文件:
#rm -f /home/my3306/data/ ib_logfile{0,1,2,3}
#unlink mysql
# ln –s /opt/mysql-8.0.19-linux-glibc2.12-x86_64 mysql
#mysqld_safe --defaults-file=/home/my3306/my.cnf &
文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。
转载请注明本文地址:https://www.ucloud.cn/yun/129303.html
摘要:三私有代码库阿里云使用引言使用肯定离不开和代码的集成。本着代码可靠性,服务器稳定性,功能扩展性综合对比,我们选择使用阿里云的库。 来自用户的DevOps实践分享,分享从开发代码到生产环境部署的一条龙操作的实践及经验, 包含工具技术的选型及考量、私有代码库与私有镜像库的应用等。 (一)容器服务的Rancher选型 1、为什么说是下一代核心技术 从互联网的多次变革说起,早期的C/S架构,到...
摘要:对于该故障的分析,我们要从主从实例相同,但是事务不同的原因入手,该问题猜测与相关,我们针对同步事务的时序做如下分析。接受者被动接收提议者的提议,并记录和反馈,或学习达成共识的提议。节点将的提案信息发送至组内,仍收到了大多数成员返回。 本文是由爱可生运维团队出品的「MySQL专栏」系列文章,内容来自于运维团队一线实战经验,涵盖MySQL各种特性的实践,优化案例,数据库架构,HA,监控等...
阅读 1346·2023-01-11 13:20
阅读 1684·2023-01-11 13:20
阅读 1132·2023-01-11 13:20
阅读 1858·2023-01-11 13:20
阅读 4099·2023-01-11 13:20
阅读 2704·2023-01-11 13:20
阅读 1385·2023-01-11 13:20
阅读 3594·2023-01-11 13:20