1. 环境描写叙述

    主从环境

    项目

    Master

    Slave

    OS版本号

    SuSE 11sp1 x86_64

    SuSE 11sp1 x86_64

    MySQL版本号

    官方版本号5.5.37

    官方版本号5.5.37

    hostname

    NDMC74

    NDMC75

    IP

    192.168.223.132

    192.168.223.133

    PORT

    3306

    3306

    server-id

    1323306

    1333306

    參数文件

    /etc/my.cnf

    /etc/my.cnf

    DATADIR

    /data/mysql/mysql3306/data

    /data/mysql/mysql3306/data

    1. 主从库相关配置确认

    (1)server-id配置

    Master节点:

    NDMC74:~ # mysql -S /tmp/mysql.sock -e "show global variables like 'server_id';"

    +---------------+---------+

    | Variable_name | Value   |

    +---------------+---------+

    | server_id     | 1323306 |

    +---------------+---------+

    Slaver节点:

    NDMC75:~ # mysql -S /tmp/mysql.sock -e "show global variables like 'server_id';"

    +---------------+---------+

    | Variable_name | Value   |

    +---------------+---------+

    | server_id     | 1333306 |

    +---------------+---------+

    (2)确认binlog是否开启

    NDMC74:~ # mysql -S /tmp/mysql.sock -e "show global variables like 'log_bin';"

    +---------------+-------+

    | Variable_name | Value |

    +---------------+-------+

    | log_bin       | ON    |

    +---------------+-------+

    1. Master上使用xtrabackup做全库备份

    NDMC74:~ # innobackupex --defaults-file=/etc/my.cnf /data/backup/innobackupex

    InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy

    and Percona LLC and/or its affiliates 2009-2013.  All Rights Reserved.

    This software is published under

    the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.

    Get the latest version of Percona XtraBackup, documentation, and help resources:

    http://www.percona.com/xb/p

    140731 11:20:44  innobackupex: Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_file=/etc/my.cnf;mysql_read_default_group=xtrabackup' (using password: NO).

    140731 11:20:44  innobackupex: Connected to MySQL server

    140731 11:20:44  innobackupex: Executing a version check against the server...

    140731 11:20:44  innobackupex: Done.

    IMPORTANT: Please check that the backup run completes successfully.

    At the end of a successful backup run innobackupex

    prints "completed OK!".

    innobackupex: Using mysql server version 5.5.37-log

    innobackupex: Created backup directory /data/backup/innobackupex/2014-07-31_11-20-44

    140731 11:20:44  innobackupex: Starting ibbackup with command: xtrabackup  --defaults-file="/etc/my.cnf"  --defaults-group="mysqld" --backup --suspend-at-end --target-dir=/data/backup/innobackupex/2014-07-31_11-20-44 --tmpdir=/tmp --extra-lsndir='/tmp'

    innobackupex: Waiting for ibbackup (pid=25767) to suspend

    innobackupex: Suspend file '/data/backup/innobackupex/2014-07-31_11-20-44/xtrabackup_suspended_2'

    xtrabackup version 2.2.3 based on MySQL server 5.6.17 Linux (x86_64) (revision id: )

    xtrabackup: uses posix_fadvise().

    xtrabackup: cd to /data/mysql/mysql3306/data

    xtrabackup: open files limit requested 8192, set to 8192

    xtrabackup: using the following InnoDB configuration:

    xtrabackup:   innodb_data_home_dir = ./

    xtrabackup:   innodb_data_file_path = ibdata1:1G:autoextend

    xtrabackup:   innodb_log_group_home_dir = ./

    xtrabackup:   innodb_log_files_in_group = 3

    xtrabackup:   innodb_log_file_size = 268435456

    >> log scanned up to (6118588398)

    [01] Copying ./ibdata1 to /data/backup/innobackupex/2014-07-31_11-20-44/ibdata1

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    [01]        ...done

    [01] Copying ./test/tt.ibd to /data/backup/innobackupex/2014-07-31_11-20-44/test/tt.ibd

    [01]        ...done

    [01] Copying ./tp50/warehouse.ibd to /data/backup/innobackupex/2014-07-31_11-20-44/tp50/warehouse.ibd

    [01]        ...done

    [01] Copying ./tp50/item.ibd to /data/backup/innobackupex/2014-07-31_11-20-44/tp50/item.ibd

    [01]        ...done

    >> log scanned up to (6118588398)

    [01] Copying ./tp50/district.ibd to /data/backup/innobackupex/2014-07-31_11-20-44/tp50/district.ibd

    [01]        ...done

    [01] Copying ./tp50/customer.ibd to /data/backup/innobackupex/2014-07-31_11-20-44/tp50/customer.ibd

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    [01]        ...done

    [01] Copying ./tp50/history.ibd to /data/backup/innobackupex/2014-07-31_11-20-44/tp50/history.ibd

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    [01]        ...done

    [01] Copying ./tp50/new_orders.ibd to /data/backup/innobackupex/2014-07-31_11-20-44/tp50/new_orders.ibd

    [01]        ...done

    [01] Copying ./tp50/orders.ibd to /data/backup/innobackupex/2014-07-31_11-20-44/tp50/orders.ibd

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    [01]        ...done

    [01] Copying ./tp50/order_line.ibd to /data/backup/innobackupex/2014-07-31_11-20-44/tp50/order_line.ibd

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    [01]        ...done

    [01] Copying ./tp50/stock.ibd to /data/backup/innobackupex/2014-07-31_11-20-44/tp50/stock.ibd

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    >> log scanned up to (6118588398)

    [01]        ...done

    >> log scanned up to (6118588398)

    xtrabackup: Creating suspend file '/data/backup/innobackupex/2014-07-31_11-20-44/xtrabackup_suspended_2' with pid '25767'

    140731 11:22:07  innobackupex: Continuing after ibbackup has suspended

    140731 11:22:07  innobackupex: Executing FLUSH TABLES WITH READ LOCK...

    140731 11:22:07  innobackupex: All tables locked and flushed to disk

    140731 11:22:07  innobackupex: Starting to backup non-InnoDB tables and files

    innobackupex: in subdirectories of '/data/mysql/mysql3306/data'

    innobackupex: Backing up files '/data/mysql/mysql3306/data/mysql/*.{frm,isl,MYD,MYI,MAD,MAI,MRG,TRG,TRN,ARM,ARZ,CSM,CSV,opt,par}' (72 files)

    >> log scanned up to (6118588398)

    innobackupex: Backing up file '/data/mysql/mysql3306/data/test/tt.frm'

    innobackupex: Backing up file '/data/mysql/mysql3306/data/test/v1.frm'

    innobackupex: Backing up file '/data/mysql/mysql3306/data/test/v2.frm'

    innobackupex: Backing up file '/data/mysql/mysql3306/data/test/v3.frm'

    innobackupex: Backing up files '/data/mysql/mysql3306/data/performance_schema/*.{frm,isl,MYD,MYI,MAD,MAI,MRG,TRG,TRN,ARM,ARZ,CSM,CSV,opt,par}' (18 files)

    innobackupex: Backing up files '/data/mysql/mysql3306/data/tp50/*.{frm,isl,MYD,MYI,MAD,MAI,MRG,TRG,TRN,ARM,ARZ,CSM,CSV,opt,par}' (10 files)

    140731 11:22:08  innobackupex: Finished backing up non-InnoDB tables and files

    140731 11:22:08  innobackupex: Executing FLUSH ENGINE LOGS...

    140731 11:22:08  innobackupex: Waiting for log copying to finish

    xtrabackup: The latest check point (for incremental): '6118588398'

    xtrabackup: Stopping log copying thread.

    .>> log scanned up to (6118588398)

    xtrabackup: Creating suspend file '/data/backup/innobackupex/2014-07-31_11-20-44/xtrabackup_log_copied' with pid '25767'

    xtrabackup: Transaction log of lsn (6118588398) to (6118588398) was copied.

    140731 11:22:09  innobackupex: All tables unlocked

    innobackupex: Backup created in directory '/data/backup/innobackupex/2014-07-31_11-20-44'

    innobackupex: MySQL binlog position: filename 'mysql-bin.000009', position 376

    140731 11:22:09  innobackupex: Connection to database server closed

    140731 11:22:09  innobackupex: completed OK!

    NDMC74:~ #

    NDMC74:/data/backup/innobackupex/2014-07-31_11-20-44 # ls -l

    总计 1048608

    -rw-r--r-- 1 root root        357 07-31 11:20 backup-my.cnf

    -rw-r----- 1 root root 1073741824 07-31 11:20 ibdata1

    drwxr-xr-x 2 root root       4096 07-31 11:22 mysql

    drwxr-xr-x 2 root root       4096 07-31 11:22 performance_schema

    drwx------ 2 root root         71 07-31 11:22 test

    drwx------ 2 root root       4096 07-31 11:22 tp50

    -rw-r--r-- 1 root root         23 07-31 11:22 xtrabackup_binlog_info

    -rw-r----- 1 root root         95 07-31 11:22 xtrabackup_checkpoints

    -rw-r--r-- 1 root root        572 07-31 11:22 xtrabackup_info

    -rw-r----- 1 root root       2560 07-31 11:22 xtrabackup_logfile

    为了保证备份集中的数据一致,须要操作:

    NDMC74:~ # innobackupex --apply-log /data/backup/innobackupex/2014-07-31_11-20-44

    InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy

    and Percona LLC and/or its affiliates 2009-2013.  All Rights Reserved.

    This software is published under

    the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.

    Get the latest version of Percona XtraBackup, documentation, and help resources:

    http://www.percona.com/xb/p

    IMPORTANT: Please check that the apply-log run completes successfully.

    At the end of a successful apply-log run innobackupex

    prints "completed OK!".

    140731 11:28:16  innobackupex: Starting ibbackup with command: xtrabackup  --defaults-file="/data/backup/innobackupex/2014-07-31_11-20-44/backup-my.cnf"  --defaults-group="mysqld" --prepare --target-dir=/data/backup/innobackupex/2014-07-31_11-20-44 --tmpdir=/tmp

    xtrabackup version 2.2.3 based on MySQL server 5.6.17 Linux (x86_64) (revision id: )

    xtrabackup: cd to /data/backup/innobackupex/2014-07-31_11-20-44

    xtrabackup: This target seems to be not prepared yet.

    xtrabackup: xtrabackup_logfile detected: size=2097152, start_lsn=(6118588398)

    xtrabackup: using the following InnoDB configuration for recovery:

    xtrabackup:   innodb_data_home_dir = ./

    xtrabackup:   innodb_data_file_path = ibdata1:1G:autoextend

    xtrabackup:   innodb_log_group_home_dir = ./

    xtrabackup:   innodb_log_files_in_group = 1

    xtrabackup:   innodb_log_file_size = 2097152

    xtrabackup: using the following InnoDB configuration for recovery:

    xtrabackup:   innodb_data_home_dir = ./

    xtrabackup:   innodb_data_file_path = ibdata1:1G:autoextend

    xtrabackup:   innodb_log_group_home_dir = ./

    xtrabackup:   innodb_log_files_in_group = 1

    xtrabackup:   innodb_log_file_size = 2097152

    xtrabackup: Starting InnoDB instance for recovery.

    xtrabackup: Using 104857600 bytes for buffer pool (set by --use-memory parameter)

    InnoDB: Using atomics to ref count buffer pool pages

    InnoDB: The InnoDB memory heap is disabled

    InnoDB: Mutexes and rw_locks use GCC atomic builtins

    InnoDB: Compressed tables use zlib 1.2.3

    InnoDB: Using CPU crc32 instructions

    InnoDB: Initializing buffer pool, size = 100.0M

    InnoDB: Completed initialization of buffer pool

    InnoDB: Highest supported file format is Barracuda.

    InnoDB: 128 rollback segment(s) are active.

    InnoDB: Waiting for purge to start

    InnoDB: 5.6.17 started; log sequence number 6118588398

    [notice (again)]

    If you use binary log and don't use any hack of group commit,

    the binary log position seems to be:

    InnoDB: Last MySQL binlog file position 0 324258362, file name ./mysql-bin.000008

    xtrabackup: starting shutdown with innodb_fast_shutdown = 1

    InnoDB: FTS optimize thread exiting.

    InnoDB: Starting shutdown...

    InnoDB: Shutdown completed; log sequence number 6118588408

    140731 11:28:18  innobackupex: Restarting xtrabackup with command: xtrabackup  --defaults-file="/data/backup/innobackupex/2014-07-31_11-20-44/backup-my.cnf"  --defaults-group="mysqld" --prepare --target-dir=/data/backup/innobackupex/2014-07-31_11-20-44 --tmpdir=/tmp

    for creating ib_logfile*

    xtrabackup version 2.2.3 based on MySQL server 5.6.17 Linux (x86_64) (revision id: )

    xtrabackup: cd to /data/backup/innobackupex/2014-07-31_11-20-44

    xtrabackup: This target seems to be already prepared.

    xtrabackup: notice: xtrabackup_logfile was already used to '--prepare'.

    xtrabackup: using the following InnoDB configuration for recovery:

    xtrabackup:   innodb_data_home_dir = ./

    xtrabackup:   innodb_data_file_path = ibdata1:1G:autoextend

    xtrabackup:   innodb_log_group_home_dir = ./

    xtrabackup:   innodb_log_files_in_group = 3

    xtrabackup:   innodb_log_file_size = 268435456

    xtrabackup: using the following InnoDB configuration for recovery:

    xtrabackup:   innodb_data_home_dir = ./

    xtrabackup:   innodb_data_file_path = ibdata1:1G:autoextend

    xtrabackup:   innodb_log_group_home_dir = ./

    xtrabackup:   innodb_log_files_in_group = 3

    xtrabackup:   innodb_log_file_size = 268435456

    xtrabackup: Starting InnoDB instance for recovery.

    xtrabackup: Using 104857600 bytes for buffer pool (set by --use-memory parameter)

    InnoDB: Using atomics to ref count buffer pool pages

    InnoDB: The InnoDB memory heap is disabled

    InnoDB: Mutexes and rw_locks use GCC atomic builtins

    InnoDB: Compressed tables use zlib 1.2.3

    InnoDB: Using CPU crc32 instructions

    InnoDB: Initializing buffer pool, size = 100.0M

    InnoDB: Completed initialization of buffer pool

    InnoDB: Setting log file ./ib_logfile101 size to 256 MB

    InnoDB: Progress in MB: 100 200

    InnoDB: Setting log file ./ib_logfile1 size to 256 MB

    InnoDB: Progress in MB: 100 200

    InnoDB: Setting log file ./ib_logfile2 size to 256 MB

    InnoDB: Progress in MB: 100 200

    InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0

    InnoDB: New log files created, LSN=6118588408

    InnoDB: Highest supported file format is Barracuda.

    InnoDB: 128 rollback segment(s) are active.

    InnoDB: Waiting for purge to start

    InnoDB: 5.6.17 started; log sequence number 6118588428

    [notice (again)]

    If you use binary log and don't use any hack of group commit,

    the binary log position seems to be:

    InnoDB: Last MySQL binlog file position 0 324258362, file name ./mysql-bin.000008

    xtrabackup: starting shutdown with innodb_fast_shutdown = 1

    InnoDB: FTS optimize thread exiting.

    InnoDB: Starting shutdown...

    InnoDB: Shutdown completed; log sequence number 6118588438

    140731 11:28:26  innobackupex: completed OK!

    NDMC74:~ #

    1. Master上创建同步账号并授权REPLICATION

    mysql> CREATE USER 'repl'@'192.168.223.%' IDENTIFIED BY 'replpass';

    Query OK, 0 rows affected (0.02 sec)

    mysql> GRANT REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'repl'@'192.168.223.%';

    Query OK, 0 rows affected (0.02 sec)

    然后在Slave上測试,看看是否能使用repl用户登录Masterserver:

    NDMC75:~ # mysql -h192.168.223.132 -urepl -preplpass

    mysql> show grants\G

    *************************** 1. row ***************************

    Grants for repl@192.168.223.%: GRANT REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'repl'@'192.168.223.%' IDENTIFIED BY PASSWORD '*D98280F03D0F78162EBDBB9C883FC01395DEA2BF'

    1 row in set (0.00 sec)

    1. 将Master的全备scp到Slave主机上

    NDMC74:~ # cd /data/backup/innobackupex/

    NDMC74:/data/backup/innobackupex # scp -r ./2014-07-31_11-20-44 192.168.223.133:/data/backup

    将Slave上的MySQL停掉,然后将Master的备份文件放到Slave的datadir文件夹下:

    NDMC75:~ # mv /data/backup/2014-07-31_11-20-44 /data/mysql/mysql3306/data

    NDMC75:~ #cd
    /data/mysql/mysql3306

    NDMC75:/data/mysql/mysql3306 # chown -R mysql:mysql data

    注意:Slave的my.cnf文件和Master的一样,仅仅是改动一下server-id就可以。

    1. 启动Slave数据库

    NDMC75:~ # /usr/local/mysql/bin/mysqld --defaults-file=/etc/my.cnf &

    NDMC75:~ # ps -ef |grep mysqld

    mysql     1293     1  1 11:50 pts/0    00:00:01 /usr/local/mysql/bin/mysqld --defaults-file=/etc/my.cnf

    root      3124 19598  0 11:51 pts/0    00:00:00 grep mysqld

    同一时候查看一下error.log文件,看看有没有错误信息。

    1. 在slave上运行change master设置主server复制信息

    Master binlog信息从备份文件里能够获得:

    NDMC74:~ # cd /data/backup/innobackupex/2014-07-31_11-20-44

    NDMC74:~ # cat xtrabackup_binlog_info

    mysql-bin.000009        376

    mysql> change master to master_host='192.168.223.132', master_user='repl', master_password='replpass',master_port=3306,master_log_file='mysql-bin.000009',master_log_pos=376;

    Query OK, 0 rows affected (0.05 sec)

    1. 在slave上启动复制

    mysql> start slave;

    Query OK, 0 rows affected (0.00 sec)

    1. 检查主从复制是否正常

    mysql> show slave status\G

    *************************** 1. row ***************************

    Slave_IO_State: Waiting for master to send event

    Master_Host: 192.168.223.132

    Master_User: repl

    Master_Port: 3306

    Connect_Retry: 60

    Master_Log_File: mysql-bin.000009

    Read_Master_Log_Pos: 452

    Relay_Log_File: mysql-relay-bin.000002

    Relay_Log_Pos: 329

    Relay_Master_Log_File: mysql-bin.000009

    Slave_IO_Running: Yes

    Slave_SQL_Running: Yes

    Replicate_Do_DB:

    Replicate_Ignore_DB:

    Replicate_Do_Table:

    Replicate_Ignore_Table:

    Replicate_Wild_Do_Table:

    Replicate_Wild_Ignore_Table:

    Last_Errno: 0

    Last_Error:

    Skip_Counter: 0

    Exec_Master_Log_Pos: 452

    Relay_Log_Space: 485

    Until_Condition: None

    Until_Log_File:

    Until_Log_Pos: 0

    Master_SSL_Allowed: No

    Master_SSL_CA_File:

    Master_SSL_CA_Path:

    Master_SSL_Cert:

    Master_SSL_Cipher:

    Master_SSL_Key:

    Seconds_Behind_Master: 0

    Master_SSL_Verify_Server_Cert: No

    Last_IO_Errno: 0

    Last_IO_Error:

    Last_SQL_Errno: 0

    Last_SQL_Error:

    Replicate_Ignore_Server_Ids:

    Master_Server_Id: 1323306

    1 row in set (0.00 sec)

    -- Bosco
    ---- END ----

    -------------------------------------------------------------------------------------------------------

    版权全部,文章同意转载,但必须以链接方式注明源地址,否则追究法律责任!

使用xtrabackup实现MySQL主从复制的更多相关文章

  1. centos5.4下mysql主从复制

    centos5.4下mysql主从复制配置分享. 本文转自:http://www.jbxue.com/article/771.html 安装环境:centos 5.4 mysql版本:mysql 5. ...

  2. MySQL主从复制的配置

    环境 操作系统:CentOS-6.6-x86_64-bin-DVD1.iso MySQL版本:mysql-5.6.26.tar.gz 主节点IP:192.168.1.205     主机名:edu-m ...

  3. mysql主从复制、redis基础、持久化和主从复制

    一.mysql(mariadb)基础 1.基础命令(centos7操作系统下) 1.启动mysql systemctl start mariadb 2.linux客户端连接自己 mysql -uroo ...

  4. 在线建立或重做mysql主从复制架构方法(传统模式和GTID模式)【转】

    mysql主从复制架构,是mysql数据库主要特色之一,绝大多数公司都有用到. 而GTID模式是基于事务的复制模式的意思,发展到现在也是越来越多人用. 以前很多文章,介绍搭建mysql主从复制架构,是 ...

  5. Mysql学习总结(43)——MySQL主从复制详细配置

    环境 操作系统:CentOS-6.6-x86_64-bin-DVD1.iso MySQL版本:mysql-5.6.26.tar.gz 主节点IP:192.168.1.205 主机名:edu-mysql ...

  6. Dubbo入门到精通学习笔记(十九):MySQL源码编译安装、MySQL主从复制的配置

    文章目录 MySQL 源码编译安装(CentOS-6.6+MySQL-5.6) 一.服务器配置: 二.源码安装 MySQL5.6.26: MySQL主从复制的配置 环境 依赖课程 MySQL 主从复制 ...

  7. Centos7 mariadb (mysql)主从复制实现

    一.mysql基本命令 .启动mysql systemctl start mariadb .linux客户端连接自己 mysql -uroot -p -h 127.0.0.1 .远程链接mysql服务 ...

  8. MySQL主从复制(Master-Slave)实践

    MySQL数据库自身提供的主从复制功能可以方便的实现数据的多处自动备份,实现数据库的拓展.多个数据备份不仅可以加强数据的安全性,通过实现读写分离还能进一步提升数据库的负载性能. 下图就描述了一个多个数 ...

  9. 2.快速部署MySQL主从复制

      1.快速部署MySQL主从复制 [root@mysql ~]# mysql -uroot -p123456 -S /data/3307/mysql.sock -e "show slave ...

随机推荐

  1. php websocket-网页实时聊天之PHP实现websocket(ajax长轮询和websocket都可以时间网络聊天室)

    php websocket-网页实时聊天之PHP实现websocket(ajax长轮询和websocket都可以时间网络聊天室) 一.总结 1.ajax长轮询和websocket都可以时间网络聊天室 ...

  2. 使用vue-cil搭建项目

    原文: 简书原文:https://www.jianshu.com/p/1af9b72cf86e 大纲 1.安装NodeJs 2.安装vue-cli 3.创建项目 4.启动项目 5.打包项目 6.项目实 ...

  3. vue学习笔记一:用Key管理可复用元素

    vue为了高效的渲染元素,会尽可能的复用组件,而不是从头渲染,如下案例 <template> <div id="app"> <template v-i ...

  4. [RxJS] Multicast with a selector argument, as a sandbox

    Let's explore a different use of the multicast() operator in RxJS, where you can provide a selector ...

  5. ALERT日志中常见监听相关报错之二:ORA-3136错误的排查

    最近在多个大型系统中遇到此问题,一般来说假设client未反映异常的话能够忽略的. 假设是client登陆时遇到ORA-12170: TNS:Connect timeout occurred,能够參考 ...

  6. php实现从尾到头打印列表

    php实现从尾到头打印列表 一.总结 4.数组倒序:array_reverse() 5.函数肯定要return,而不是echo 二.php实现从尾到头打印列表 输入一个链表,从尾到头打印链表每个节点的 ...

  7. java连接MongoDB查询导出为excel表格

    背景 因为项目需求.每一个星期须要统计每一个公众号7天的訪问数,月底就须要统计一个月的訪问数,40多个公众号.每次手动统计都须要花费1个小时,总之是一项无技术耗时耗神的手工活. 于是.想写个程序来统计 ...

  8. 群晖synology的Video Station无法通过浏览器在线播放视频

    群晖synology的Video Station无法通过浏览器在线播放视频 http://www.hangge.com/blog/cache/detail_419.html

  9. hadoop集群安装(多机,非伪集群)

    1. 创建用户 创建hadoop用户组:sudo addgroup hadoop 创建hadoop用户:sudo adduser -ingroup hadoop hadoop 为hadoop用户分配r ...

  10. php实现字符串的排列(交换)(递归考虑所有情况)

    php实现字符串的排列(交换)(递归考虑所有情况) 一.总结 交换: 当有abc的时候,分别拿第一位和其它位交换,第一位固定,余下的位做递归,这样有考虑到所有情况,因为第一位只可能是所有的字母,那第一 ...