基于ogg实现mysql到mysql之间DDL复制的一些限制

19.1 DDL复制的一些限制

1、基于DDL的复制需要mysql的版本在5.7.10及以上
2、不支持双向DDL复制
3、不支持远程捕获
4、DDL复制使用ddl_rewriter and ddl_metadata两个插件作业共享库来实现DDL语句的复制,在开始DDL复制前需要提前在MYSQL服务器上安装这两个库
5、在存储过程中执行DDL语句不能被捕获
CREATE PROCEDURE atssrc.generate_data()
BEGIN
DECLARE i INT DEFAULT 0;
WHILE i < 800 DO
SET i = i + 1;
IF (i = 100) then
alter table atssrc.ddl6 add col2 DATE after id;
ELSEIF (i = 200) then
alter table atssrc.ddl6 add col3 DATETIME after datetime;
ELSEIF (i = 300) then
alter table atssrc.ddl6 add col4 timestamp NULL DEFAULT NULL after
channel;
ELSEIF (i = 400) then
alter table atssrc.ddl6 add col5 YEAR after value;
END IF;
END WHILE;
END$$
DELIMITER ;
call atssrc.generate_data();

安装DDL复制插件

[root@lineqi ogg_target]# ./gg
ggcmd ggMessage.dat ggparam.dat ggsci
[root@lineqi ogg_target]# ./ddl_install.sh install ogg_repl Ogg#1234 3306
checking MySQL version
DDL is supported for your installed MySQL version.
plugin_dir: /usr/lib64/mysql/plugin/

nohup: appending output to ‘nohup.out’
The metadata_server started successfully.

copying of ddl_rewriter.so succeeded
copying of ddl_metadata.so succeeded

ERROR: Not able to drop database oggddl. See ddl_install.log for details

mysql> grant create,insert,select,delete,drop on . to ‘ogg_repl’@’%’;

[root@lineqi ogg_target]# ./ddl_install.sh install ogg_repl Ogg#1234 3306
checking MySQL version
DDL is supported for your installed MySQL version.
plugin_dir: /usr/lib64/mysql/plugin/

nohup: appending output to ‘nohup.out’
The metadata_server started successfully.

copying of ddl_rewriter.so succeeded
copying of ddl_metadata.so succeeded

Plugins installation was successful.

Installation was successful.

你可能感兴趣的:(mysql)