[root@localhost ~]# mysql -uroot -p123456a? -h192.168.209.132 -e 'show databases;' mysql: [Warning] Using a password on the command line interface can be insecure. +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | sys | +--------------------+
H2数据库信息
1 2 3 4 5 6 7 8 9 10
[root@localhost ~]# mysql -uroot -p123456a? -h192.168.209.137 -e 'show databases;' mysql: [Warning] Using a password on the command line interface can be insecure. +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | sys | +--------------------+
H1创建数据库,在H2中是否显示
1 2 3 4 5 6 7 8 9 10 11 12 13
[root@localhost ~]# mysql -uroot -p123456a? -h192.168.209.132 -e 'create database h1;' mysql: [Warning] Using a password on the command line interface can be insecure. [root@localhost ~]# mysql -uroot -p123456a? -h192.168.209.137 -e 'show databases;' mysql: [Warning] Using a password on the command line interface can be insecure. +--------------------+ | Database | +--------------------+ | information_schema | | h1 | | mysql | | performance_schema | | sys | +--------------------+
H2创建数据库,在H1中是否显示
1 2 3 4 5 6 7 8 9 10 11 12 13 14
[root@localhost ~]# mysql -uroot -p123456a? -h192.168.209.137 -e 'create database h2;' mysql: [Warning] Using a password on the command line interface can be insecure. [root@localhost ~]# mysql -uroot -p123456a? -h192.168.209.132 -e 'show databases;' mysql: [Warning] Using a password on the command line interface can be insecure. +--------------------+ | Database | +--------------------+ | information_schema | | h1 | | h2 | | mysql | | performance_schema | | sys | +--------------------+
#解压 tar -zxvf keepalived-1.4.0.tar.gz #删除安装包 rm -rf keepalived-1.4.0.tar.gz #编译 cd /app/keepalived-1.4.0/ ./configure --prefix=/usr/local/keepalived #出现如下错误: checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /usr/bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking whether make supports nested variables... (cached) yes checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking for gcc... no checking for cc... no checking for cl.exe... no configure: error: in `/app/keepalived-1.4.0': configure: error: no acceptable C compiler found in $PATH #安装编译依赖包 yum -y install gcc #Openssl错误 configure: error: !!! OpenSSL is not properly installed on your system. !!! !!! Can not include OpenSSL headers files. !!! #安装openssl yum -y install openssl-devel #最终编译 make && make install
[root@hadoop keepalived]# mysql -uroot -p123456a? -h 192.168.209.138 mysql: [Warning] Using a password on the command line interface can be insecure. Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 55 Server version: 5.7.20-log MySQL Community Server (GPL)
Copyright (c) 2000, 2017, 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'forhelp. Type '\c' to clear the current input statement.
Normally, a slave does not log to its own binary log any updates that are received from a master server. This option tells the slave to log the updates performed by its SQL thread to its own binary log. For this option to have any effect, the slave must also be started with the –log-bin option to enable binary logging. Prior to MySQL 5.5, the server would not start when using the –log-slave-updates option without also starting the server with the –log-bin option, and would fail with an error; in MySQL 5.5, only a warning is generated. (Bug #44663) –log-slave-updates is used when you want to chain replication servers. For example, you might want to set up replication servers using this arrangement: A -> B -> C Here, A serves as the master for the slave B, and B serves as the master for the slave C. For this to work, B must be both a master and a slave. You must start both A and B with –log-bin to enable binary logging, and B with the –log-slave-updates option so that updates received from A are logged by B to its binary log.
a) M01同步从M02同步数据过来的时候,log_slave_updates参数用来控制M01是否把所有的操作写入到binary log,默认的情况下mysql是关闭的; b) R01数据的更新需要通过读取到M01的binary log才能进行更新,这个时候M01是没有写binary log的,所以当数据从M02写入的时候,R01也就没有更新了。。