點擊上方“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 &
文章版權歸作者所有,未經允許請勿轉載,若此文章存在違規行為,您可以聯系管理員刪除。
轉載請注明本文地址:http://specialneedsforspecialkids.com/yun/129303.html
摘要:三私有代碼庫阿里云使用引言使用肯定離不開和代碼的集成。本著代碼可靠性,服務器穩定性,功能擴展性綜合對比,我們選擇使用阿里云的庫。 來自用戶的DevOps實踐分享,分享從開發代碼到生產環境部署的一條龍操作的實踐及經驗, 包含工具技術的選型及考量、私有代碼庫與私有鏡像庫的應用等。 (一)容器服務的Rancher選型 1、為什么說是下一代核心技術 從互聯網的多次變革說起,早期的C/S架構,到...
摘要:對于該故障的分析,我們要從主從實例相同,但是事務不同的原因入手,該問題猜測與相關,我們針對同步事務的時序做如下分析。接受者被動接收提議者的提議,并記錄和反饋,或學習達成共識的提議。節點將的提案信息發送至組內,仍收到了大多數成員返回。 本文是由愛可生運維團隊出品的「MySQL專欄」系列文章,內容來自于運維團隊一線實戰經驗,涵蓋MySQL各種特性的實踐,優化案例,數據庫架構,HA,監控等...
閱讀 1350·2023-01-11 13:20
閱讀 1694·2023-01-11 13:20
閱讀 1152·2023-01-11 13:20
閱讀 1869·2023-01-11 13:20
閱讀 4107·2023-01-11 13:20
閱讀 2730·2023-01-11 13:20
閱讀 1392·2023-01-11 13:20
閱讀 3611·2023-01-11 13:20