Percona XtraDB Cluster添加仲裁节点-阿里云开发者社区

开发者社区> leshami> 正文

Percona XtraDB Cluster添加仲裁节点

简介:
+关注继续查看

Galera Arbitrator是Percona XtraDB集群的成员,用于投票,以防您拥有少量服务器(通常为两个)并且不希望添加更多资源。Galera仲裁器不需要专用服务器。它可以安装在运行其他应用程序的机器上。只要确保它具有良好的网络连接。Galera Arbitrator是参与投票的群集的成员,但不是实际复制(虽然它接收与其他节点相同的数据)。此外,它不包含在流量控制计算中。本文给出添加仲裁节点示例。

一、PXC集群环境描述

192.168.1.248 CentOS7.4
192.168.1.249 CentOS7.4
192.168.1.253 CentOS6.7(新增用于作为仲裁节点)

如下图,将仲裁节点添加到现有集群
0412_2

二、添加仲裁节点

# yum install Percona-XtraDB-Cluster-garbd-57

# rpm -ql Percona-XtraDB-Cluster-garbd-57
/etc/init.d/garb      ##启动脚本
/etc/sysconfig/garb  ##配置文件
/usr/bin/garbd
/usr/share/doc/percona-xtradb-cluster-garbd-3/COPYING
/usr/share/doc/percona-xtradb-cluster-garbd-3/README
/usr/share/man/man8/garbd.8.gz
/var/lib/galera

# vim /etc/sysconfig/garb 

GALERA_NODES="192.168.1.248:4567, 192.168.1.249:4567, 192.168.1.253:4567"
GALERA_GROUP=pxc-cluster

##配置后请删除无关的全部内容,否则报如下错误
Garbd config /etc/sysconfig/garb is not configured yet    [失败]

# /etc/init.d/garb start
正在启动 /usr/bin/garbd:                                  [确定]

# /etc/init.d/garb start  
正在启动 /usr/bin/garbd:                                  [确定]
# 
# /etc/init.d/garb status
garbd (pid 5198) 正在运行...

三、验证集群

# tail -fn 50 /var/log/message
Apr 13 09:13:22 ydq4 garbd[7854]: CRC-32C: using hardware acceleration.
Apr 13 09:13:22 ydq4 garbd[7854]: Read config: #012#011daemon:  1#012#011name:    
garb#012#011address: gcomm://192.168.1.248:4567,192.168.1.249:4567,192.168.1.253:4567#012#011group:  
pxc-cluster#012#011sst:    trivial#012#011donor:  #012#011options: gcs.fc_limit=9999999; 
gcs.fc_factor=1.0; gcs.fc_master_slave=yes#012#011cfg:    #012#011log:    
Apr 13 09:13:22 ydq4 garbd[7856]: Using CRC-32C for message checksums.
Apr 13 09:13:22 ydq4 garbd[7856]: gcomm thread scheduling priority set to other:0 
Apr 13 09:13:22 ydq4 garbd[7856]: Fail to access the file (./gvwstate.dat) error (No such file or directory). 
It is possible if node is booting for first time or re-booting after a graceful shutdown
Apr 13 09:13:22 ydq4 garbd[7856]: Restoring primary-component from disk failed. Either node is booting for 
first time or re-booting after a graceful shutdown
Apr 13 09:13:22 ydq4 garbd[7856]: GMCast version 0
Apr 13 09:13:22 ydq4 garbd[7856]: (dc339071, 'tcp://0.0.0.0:4567') listening at tcp://0.0.0.0:4567
Apr 13 09:13:22 ydq4 garbd[7856]: (dc339071, 'tcp://0.0.0.0:4567') multicast: , ttl: 1
Apr 13 09:13:22 ydq4 garbd[7856]: EVS version 0
Apr 13 09:13:22 ydq4 garbd[7856]: gcomm: connecting to group 'pxc-cluster', peer '192.168.1.248:4567,192.168.1.249:4567,192.168.1.253:4567'
Apr 13 09:13:22 ydq4 garbd[7856]: (dc339071, 'tcp://0.0.0.0:4567') connection established to dc339071 tcp://192.168.1.253:4567
Apr 13 09:13:22 ydq4 garbd[7856]: (dc339071, 'tcp://0.0.0.0:4567') address 'tcp://192.168.1.253:4567' points to own listening address, blacklisting
Apr 13 09:13:22 ydq4 garbd[7856]: (dc339071, 'tcp://0.0.0.0:4567') connection established to 66d23117 tcp://192.168.1.249:4567
Apr 13 09:13:22 ydq4 garbd[7856]: (dc339071, 'tcp://0.0.0.0:4567') connection established to a643db62 tcp://192.168.1.248:4567
Apr 13 09:13:22 ydq4 garbd[7856]: (dc339071, 'tcp://0.0.0.0:4567') turning message relay requesting on, nonlive peers: 
Apr 13 09:13:23 ydq4 garbd[7856]: declaring 66d23117 at tcp://192.168.1.249:4567 stable
Apr 13 09:13:23 ydq4 garbd[7856]: declaring a643db62 at tcp://192.168.1.248:4567 stable
Apr 13 09:13:23 ydq4 garbd[7856]: Node 66d23117 state primary
Apr 13 09:13:23 ydq4 garbd[7856]: Current view of cluster as seen by this node#012view (view_id(PRIM,66d23117,16)#012memb 
{#012#01166d23117,0#012#011a643db62,0#012#011dc339071,0#012#011}#012joined {#012#011}#012left {#012#011}#012partitioned {#012#011}#012)
Apr 13 09:13:23 ydq4 garbd[7856]: Save the discovered primary-component to disk
Apr 13 09:13:23 ydq4 garbd[7856]: open file(./gvwstate.dat.tmp) failed(Permission denied)
Apr 13 09:13:23 ydq4 garbd[7856]: gcomm: connected
Apr 13 09:13:23 ydq4 garbd[7856]: Shifting CLOSED -> OPEN (TO: 0)
Apr 13 09:13:23 ydq4 garbd[7856]: New COMPONENT: primary = yes, bootstrap = no, my_idx = 2, memb_num = 3
Apr 13 09:13:23 ydq4 garbd[7856]: STATE EXCHANGE: Waiting for state UUID.
Apr 13 09:13:23 ydq4 garbd[7856]: STATE EXCHANGE: sent state msg: dc5dbeeb-3eb7-11e8-8e45-e34b2f81e1c9
Apr 13 09:13:23 ydq4 garbd[7856]: STATE EXCHANGE: got state msg: dc5dbeeb-3eb7-11e8-8e45-e34b2f81e1c9 from 0 (pxc-cluster-node-2)
Apr 13 09:13:23 ydq4 garbd[7856]: STATE EXCHANGE: got state msg: dc5dbeeb-3eb7-11e8-8e45-e34b2f81e1c9 from 1 (pxc-cluster-node-1)
Apr 13 09:13:23 ydq4 garbd[7856]: STATE EXCHANGE: got state msg: dc5dbeeb-3eb7-11e8-8e45-e34b2f81e1c9 from 2 (garb)
Apr 13 09:13:23 ydq4 garbd[7856]: Quorum results:#012#011version    = 4,#012#011component  = PRIMARY,#012#011conf_id    = 4,
#012#011members    = 2/3 (primary/total),#012#011act_id    = 248529,#012#011last_appl. = -1,
#012#011protocols  = 0/7/3 (gcs/repl/appl),#012#011group UUID = cd96b06a-0a1d-11e8-99d2-837e6f3b95a9
Apr 13 09:13:23 ydq4 garbd[7856]: Flow-control interval: [8388607, 8388607]
Apr 13 09:13:23 ydq4 garbd[7856]: Trying to continue unpaused monitor
Apr 13 09:13:23 ydq4 garbd[7856]: Shifting OPEN -> PRIMARY (TO: 248529)
Apr 13 09:13:23 ydq4 garbd[7856]: Sending state transfer request: 'trivial', size: 7
Apr 13 09:13:23 ydq4 garbd[7856]: Member 2.0 (garb) requested state transfer from '*any*'. Selected 0.0 (pxc-cluster-node-2)(SYNCED) as donor.
Apr 13 09:13:23 ydq4 garbd[7856]: Shifting PRIMARY -> JOINER (TO: 248529)
Apr 13 09:13:23 ydq4 garbd[7856]: 0.0 (pxc-cluster-node-2): State transfer to 2.0 (garb) complete.
Apr 13 09:13:23 ydq4 garbd[7856]: 2.0 (garb): State transfer from 0.0 (pxc-cluster-node-2) complete.
Apr 13 09:13:23 ydq4 garbd[7856]: SST leaving flow control
Apr 13 09:13:23 ydq4 garbd[7856]: Shifting JOINER -> JOINED (TO: 248529)
Apr 13 09:13:23 ydq4 garbd[7856]: Member 0.0 (pxc-cluster-node-2) synced with group.
Apr 13 09:13:23 ydq4 garbd[7856]: Member 2.0 (garb) synced with group.
Apr 13 09:13:23 ydq4 garbd[7856]: Shifting JOINED -> SYNCED (TO: 248529)  -->这里提示状态由加入变为同步
Apr 13 09:13:26 ydq4 garbd[7856]: (dc339071, 'tcp://0.0.0.0:4567') turning message relay requesting off
### Author : Leshami
### Blog : http://blog.csdn.net/leshami
注意,其余的2个节点的wsrep_cluster_address参数要将仲裁节点地址添加进去
##在集群的节点查看,此时wsrep_cluster_size已经变成3了
mysql> show global status like '%wsrep_cluster%';
+--------------------------+--------------------------------------+
| Variable_name            | Value                                |
+--------------------------+--------------------------------------+
| wsrep_cluster_conf_id    | 5                                    |
| wsrep_cluster_size      | 3                                    |
| wsrep_cluster_state_uuid | cd96b06a-0a1d-11e8-99d2-837e6f3b95a9 |
| wsrep_cluster_status    | Primary                              |
+--------------------------+--------------------------------------+

-- pxc版本
mysql> show variables like 'version%';
+-------------------------+-----------------------------------------------------------------+
| Variable_name          | Value                                                          |
+-------------------------+-----------------------------------------------------------------+
| version                | 5.7.20-18-57-log                                                |
| version_comment        | Percona XtraDB Cluster (GPL),  WSREP version 29.24, wsrep_29.24 |
| version_compile_machine | x86_64                                                          |
| version_compile_os      | Linux                                                          |
+-------------------------+-----------------------------------------------------------------+

版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。

相关文章
阿里云服务器怎么设置密码?怎么停机?怎么重启服务器?
如果在创建实例时没有设置密码,或者密码丢失,您可以在控制台上重新设置实例的登录密码。本文仅描述如何在 ECS 管理控制台上修改实例登录密码。
9481 0
Oracle 11GR2 RAC添加节点
<p><br></p> <p></p> <h2 style="font-size:16px; font-weight:normal; margin:10px 0px 0px; padding:0px 5px 3px; letter-spacing:-0.05em; font-family:'Microsoft YaHei','BitStream vera Sans'; border-b
1776 0
阿里云注册集群—混合集群-使用自定义节点添加脚本
混合集群的添加云上节点的方式依赖本地数据中心自建Kubernetes集群的搭建方式,比如使用Kubeadm搭建、使用Kubernetes二进制文件打击那或者使用Rancher平台搭建等。本文将介绍如何编写自定义节点添加脚本。
189 0
阿里云服务器端口号设置
阿里云服务器初级使用者可能面临的问题之一. 使用tomcat或者其他服务器软件设置端口号后,比如 一些不是默认的, mysql的 3306, mssql的1433,有时候打不开网页, 原因是没有在ecs安全组去设置这个端口号. 解决: 点击ecs下网络和安全下的安全组 在弹出的安全组中,如果没有就新建安全组,然后点击配置规则 最后如上图点击添加...或快速创建.   have fun!  将编程看作是一门艺术,而不单单是个技术。
10841 0
阿里云服务器如何登录?阿里云服务器的三种登录方法
购买阿里云ECS云服务器后如何登录?场景不同,阿里云优惠总结大概有三种登录方式: 登录到ECS云服务器控制台 在ECS云服务器控制台用户可以更改密码、更换系.
13165 0
[喵咪大数据]Hadoop节点添加下线和磁盘扩容操作
Hadoop绝非一个简单程序,集群模式下更是如此,所有的数据都存储在Hadoop中如果操作不当会存在丢失数据的风险,那么怎么在安全的情况,扩容下线维护或者磁盘满了怎么增加空间,就是今天的主要内容了.
231 0
给网站的标题添加点色彩
这16行JavaScript,可能会提升你网站的回头率~
18 0
阿里云ECS云服务器初始化设置教程方法
阿里云ECS云服务器初始化是指将云服务器系统恢复到最初状态的过程,阿里云的服务器初始化是通过更换系统盘来实现的,是免费的,阿里云百科网分享服务器初始化教程: 服务器初始化教程方法 本文的服务器初始化是指将ECS云服务器系统恢复到最初状态,服务器中的数据也会被清空,所以初始化之前一定要先备份好。
6885 0
+关注
leshami
传播知识,分享快乐!十年以上数据库,系统运维与管理,性能优化经验。全部文章,欢迎扩散,转载请注明出处!
639
文章
0
问答
文章排行榜
最热
最新
相关电子书
更多
《2021云上架构与运维峰会演讲合集》
立即下载
《零基础CSS入门教程》
立即下载
《零基础HTML入门教程》
立即下载