因为没有直接在官网和其它地方找到答案, 所以记录一下.
源端: MYSQL 8.0.29
目标端 MYSQL 5.7.38
工具 : OGG 21.3
启动抽取进程 Extract的时候报的错
2022-06-21 16:22:26 INFO OGG-01680 Please ensure the environment variable TZ is set to match the database time zone as timestamp in MySQL depends upon correct setting of TZ.
Source Context :
SourceModule : [ggdb.mysql.util]
SourceID : [../gglib/ggdbmysql/mysqlutil.c]
SourceMethod : [MYSQLUTIL_check_err]
SourceLine : [560]
ThreadBacktrace : [15] elements
: [/root/ogg/libgglog.so(CMessageContext::AddThreadContext())]
: [/root/ogg/libgglog.so(CMessageFactory::CreateMessage(CSourceContext*, unsigned int, ...))]
: [/root/ogg/libgglog.so(_MSG_String_UInt32_String(CSourceContext*, int, char const*, unsigned int, char const*, CMessageFactory::MessageDisposition))]
: [/root/ogg/extract(MYSQLUTIL_check_err(short, char const*, ...))]
: [/root/ogg/extract(MYSQLUTIL_get_database_charset())]
: [/root/ogg/extract(DBUTIL_getDatabaseMetadata(ggs::gglib::ggunicode::UString const*, ggs::gglib::ggapp::CDatabaseMetadata const**, ggs::gglib::ggunicode::UString&))]
: [/root/ogg/extract(gl_odbc_param(char const*, char const*, char (&) [2048]))]
: [/root/ogg/extract(get_infile_params(ggs::gglib::ggapp::ReplicationContextParams&, ggs::gglib::ggdatasource::DataSourceParams&, ggs::gglib::ggdatatarget::DataTargetParams&, ggs::gglib::ggmetadata::MetadataContext&))]
: [/root/ogg/extract()]
: [/root/ogg/extract(ggs::gglib::MultiThreading::MainThread::ExecMain())]
: [/root/ogg/extract(ggs::gglib::MultiThreading::Thread::RunThread(ggs::gglib::MultiThreading::Thread::ThreadArgs*))]
: [/root/ogg/extract(ggs::gglib::MultiThreading::MainThread::Run(int, char**))]
: [/root/ogg/extract(main)]
: [/lib64/libc.so.6(__libc_start_main)]
: [/root/ogg/extract()]
2022-06-21 16:22:26 ERROR OGG-00768 Failed to Map database character to ULibCharSet. SQL error (0).
2022-06-21 16:22:26 ERROR OGG-01668 PROCESS ABENDING
咋一看以为是字符集的问题, 于是查询官网错误码
OGG-00768: {0}. SQL error ({1,number,0}). {2}
Cause: This is a generic error message and there can be multiple reasons for it. One reason could be that a query to set the session timeout failed. Ignoring this message results in the session being disconnected after a default time period if the connection has been idle. This error message also is used when an operation against the database fails, such as a query.
Action: To resolve this error, verify in the database why the query or other operation would fail. For example, verify that the user that executed the operation has the correct privileges to do so.
官网的意思就是连接的时候的问题, 比如超时之类的.
本次环境和超时没有关系, 超时参数设置都很大.
那就是连接的问题了, 比如密码插件之类的(很遗憾插件改为mysql_native_password还是相同的报错)
源端数据库版本换成 5.7.38之后正常了.
严格来说不算解决问题, 因为已经换了数据库版本了. 具体原因得等各位大佬来解决(^_^)
额外记录下 ogg-mysql设置SSL.
Extract 和 Replicat 的 配置文件都加上如下内容
这几个文件都是mysql服务器上的, 修改下路径就行, 当然也可以自己重新用openssl生成, 官网也是有教程的
SETENV (OGG_MYSQL_OPT_SSL_CA='/var/lib/mysql.pem')
SETENV (OGG_MYSQL_OPT_SSL_CERT='/var/lib/mysql/client-cert.pem')
SETENV (OGG_MYSQL_OPT_SSL_KEY='/var/lib/mysql/client-key.pem')
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。