因为没有直接在官网和其它地方找到答案, 所以记录一下.
场景
源端: 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.