当前位置:网站首页>PXC high availability cluster summary
PXC high availability cluster summary
2022-07-02 06:53:00 【He Yishi】
The following questions are my answer to MySQL High availability cluster summary , I hope we can make you right PXC Have some understanding !
One 、PXC What is the meaning of the master node and the slave node of ?
PXC The master node and the slave node in follow Replication There are great differences between master and slave nodes .
First Replication The data synchronization of the cluster can only be from the master node to the slave node , And the identity of the node is fixed , The primary node is always Master, The slave node is always Slave, Not interchangeable .
however PXC The master node on refers to the first node to start , It doesn't just start MySQL service , And use it Galera establish PXC colony . When all this is done , The master node is automatically degraded to a normal node . When other nodes start, they only need to start MySQL service , Then add to PXC Just cluster , So these nodes start to shut down , Identity has always been a common node .
Two 、 Why? Node1 It can start , While the rest of the PXC When the node starts, it will flash back ?
This is because Node1 Do more work when starting , As mentioned above . So you didn't wait node1 hold PXC Clusters are created , You start the others quickly PXC node , They can't find Node1 Starting up PXC colony , So it automatically flashed back .
The correct way is to start Node1 after , wait for 10 Second , And then use Navicat Visit , Yes, I can , Then start other PXC node
3、 ... and 、 If PXC The cluster is running , Shut down directly on the host , Or stop Docker service , Why start which one next PXC Nodes will flash back ?
This is from PXC Cluster node management ,PXC The data directory of the node is /var/lib/mysql, Fortunately, this directory is mapped to the data volume . For example, you visit v1 Data volume can be seen node1 Data directory for . One of them grastate.dat The file of , It has a safe_to_bootstrap Parameters are PXC Used to record who is the last to quit PXC Cluster node . such as node1 Is the last closed node , that PXC It will be safe_to_bootstrap Set to 1, representative node1 The node finally exits , Its data is up-to-date . The next time you start, you must start node1, Then other nodes and node1 Sync .
If you are in the PXC Shut down the host when all nodes are running normally Docker Service or power supply , that PXC There is no time to judge who is the last node to exit , all PXC The nodes are closed in an instant , Which node is safe_to_boostrap The parameters are 0. It's also easy to solve this problem , That's picking node1, Change this parameter to 1, Then start up normally node1, Just start other nodes .
Four 、PXC The cluster has only one node , Close the container of this node , Can it be started next time ?
Of course you can , because PXC There is only one node in , Then this node must be started according to the master node , So when you start it , It will start MySQL service , Also created PXC colony . Even if the container is closed , Next time, it's still this step , There will be no startup failure . if PXC A cluster is composed of multiple nodes ,node1 It stopped , Other nodes are running normally . It's time to start node1 There will be a flash back ,node1 It just started for a few seconds and hung up . This is because node2 Wait for some nodes to be in the existing PXC Run in , At this time, you start node1, Create another one with the same name PXC colony , It will definitely lead to conflict . therefore node1 And then he stepped back .
In this case , The correct solution is , hold node1 Container delete . take it easy , Didn't let you delete v1 Data volume , So the data cannot be lost . Then create a node1, For the setting synchronized with a node in the startup parameters, choose any one that is running now PXC node , then Node1 You can start .
边栏推荐
- 20201002 vs 2019 qt5.14 developed program packaging
- [self cultivation of programmers] - Reflection on job hunting Part II
- unittest. Texttestrunner does not generate TXT test reports
- ZZQ的博客目录--更新于20210601
- Explanation and application of annotation and reflection
- pytest(1) 用例收集规则
- Vscode installation, latex environment, parameter configuration, common problem solving
- ModuleNotFoundError: No module named ‘jieba. analyse‘; ‘ jieba‘ is not a package
- Cve - 2015 - 1635 (ms15 - 034) réplication de la vulnérabilité d'exécution de code à distance
- sprintf_s的使用方法
猜你喜欢
Win10:添加或者删除开机启动项,在开机启动项中添加在用户自定义的启动文件
Sentry搭建和使用
The use of regular expressions in JS
Cve - 2015 - 1635 (ms15 - 034) réplication de la vulnérabilité d'exécution de code à distance
CTF three count
Implement strstr() II
SQLI-LABS通关(less18-less20)
Utilisation de la carte et de foreach dans JS
Date time API details
Win10网络图标消失,网络图标变成灰色,打开网络设置闪退等问题解决
随机推荐
Fe - eggjs combined with typeorm cannot connect to the database
The default Google browser cannot open the link (clicking the hyperlink does not respond)
ModuleNotFoundError: No module named ‘jieba. analyse‘; ‘ jieba‘ is not a package
CTF three count
pytest(2) mark功能
Error "list" object is not callable in Web automatic switching window
看完有用的blog
PHP Session原理简析
Selenium+msedgedriver+edge browser installation driver pit
CVE-2015-1635(MS15-034 )远程代码执行漏洞复现
Virtualenv and pipenv installation
js判断对象是否为空
Latex 编译报错 I found no \bibstyle & \bibdata & \citation command
Latex warning: citation "*****" on page y undefined on input line*
2020-9-23 use of QT timer qtimer class.
The table component specifies the concatenation parallel method
Latex在VSCODE中编译中文,使用中文路径问题解决
Cve - 2015 - 1635 (ms15 - 034) réplication de la vulnérabilité d'exécution de code à distance
How to try catch statements that return promise objects in JS
如何调试微信内置浏览器应用(企业号、公众号、订阅号)