• PXC安装


    安装软件依赖包
    yum install -y  perl-IO-Socket-SSL perl-DBD-MySQL perl-Time-HiRes socat nc    openssl-devel libaio-devel libaio
     
    安装xtrabackup
    下载地址:
    http://www.percona.com/downloads/XtraBackup/
     
    rpm -ivh percona-xtrabackup-2.3.3-1.el5.x86_64.rpm
     
    安装PXC
    下载地址:
    https://www.percona.com/downloads/

    安装必要条件:
    1,rpm -qa|grep mysql 和  rpm -qa | grep mariadb,如果有安装对应软件则需要卸载再安装
    2,关闭selinux和防火墙



    rpm -ivh Percona-XtraDB-Cluster-shared-57-5.7.18-29.20.1.el7.x86_64.rpm
    rpm -ivh Percona-XtraDB-Cluster-server-57-5.7.18-29.20.1.el7.x86_64.rpm --nodeps
    rpm -ivh Percona-XtraDB-Cluster-client-57-5.7.18-29.20.1.el7.x86_64.rpm
    rpm -ivh  Percona-XtraDB-Cluster-57-5.7.18-29.20.1.el7.x86_64.rpm
     
    groupadd mysql
    useradd -g mysql -d /usr/local/mysql -s /sbin/nologin -M -n mysql
    cd /usr/local/mysql/
    chown -R mysql:mysql *
    mkdir -p /data/{mysql,tmp}
    chown -R mysql:mysql  /data/{mysql,tmp}

    mysqld --defaults-file=/etc/my.cnf --basedir=/usr/local/mysql --datadir=/data/mysql --user=mysql --initialize-insecure
       
     
    添加配置文件:
    wsrep_provider=/usr/local/mysql/lib/libgalera_smm.so                             #库文件
    wsrep_cluster_address=gcomm://192.168.56.26,192.168.56.27,192.168.56.28          #节点中所有ip
    wsrep_node_address=192.168.56.27                                                 #节点的ip
    wsrep_slave_threads=2                                                            #开启的复制线程数,cpu核数*2
    binlog_format=ROW                                                                #binlog格式必须为row
    default_storage_engine=InnoDB                                                    #暂时不支持其他存储引擎,只支持innodb,当然可以支持myisam,需要另外参数打开
    innodb_autoinc_lock_mode=2                                                       #自增锁的优化
    wsrep_cluster_name=pxc-yayun                                                     #集群名字
    wsrep_sst_auth=sst:mypwd                                                         #sst模式需要的用户名和密码
    wsrep_sst_method=xtrabackup-v2                                                   #采用什么方式复制数据。还支持mysqldump,rsync


    第一个节点第一次启动:
    mysqld --defaults-file=/etc/my.cnf --wsrep-new-cluster &

    其他节点启动:
    mysqld --defaults-file=/etc/my.cnf &

    查看节点的状态
    mysql>  show status like 'wsrep%';   



  • 相关阅读:
    卡常技巧
    Java经典习题3
    Java经典习题4
    VC++ MFC 文件处理unicode
    批处理更换ip地址
    C#实现系统托盘
    驱动打印
    c++ vs2010 GetWindowText GetWindowTextW
    VC++ MFC ListBox 复选框
    C# 获取本机ip地址
  • 原文地址:https://www.cnblogs.com/liang545621/p/9400944.html
Copyright © 2020-2023  润新知