2025OceanBase 數(shù)據(jù)庫(kù)生態(tài)工具_(dá)第1頁(yè)
2025OceanBase 數(shù)據(jù)庫(kù)生態(tài)工具_(dá)第2頁(yè)
2025OceanBase 數(shù)據(jù)庫(kù)生態(tài)工具_(dá)第3頁(yè)
2025OceanBase 數(shù)據(jù)庫(kù)生態(tài)工具_(dá)第4頁(yè)
2025OceanBase 數(shù)據(jù)庫(kù)生態(tài)工具_(dá)第5頁(yè)
已閱讀5頁(yè),還剩217頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶(hù)提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

OceanBaseOceanBase數(shù)據(jù) OceanBase|產(chǎn)品版本 |文檔版本OceanBaseOceanBase該類(lèi)警示信息可能會(huì)導(dǎo)致系統(tǒng)重大變更甚至故權(quán)重設(shè)置為0,該服務(wù)器不會(huì)再接受新請(qǐng) cddC:/windowWindows系baeloglist--ipconfig[-all|-switchOceanBaseOceanBase SQL ob_admin簡(jiǎn) ob_admin安 ob_admin功能介 dump_all命 dump_hex命 dump_format命 dump_meta命 help命 clusterbackup partition元信 什么是 KV配置文件說(shuō) monagent配置文件說(shuō) Prometheus配置文件說(shuō) Prometheus配置模 安裝 PRM Debug模 Release模 OBAgent安裝目錄結(jié) 手動(dòng)部署 步驟1:部署 (可選)步驟3:部署Prometheus (可選)更新KV配 使用OBD部署 同時(shí)部署OceanBase集群和 單獨(dú)部署 啟動(dòng) (可選)部署Prometheus (可選)更新KV配 OceanBase數(shù)據(jù)庫(kù)指 OBAgent開(kāi)發(fā)指 OBAgent數(shù)據(jù)處理流 輸出插件(Output)接口定 使用OBAgent采集MySQL性能指 YUM安 Debug模 Release模 RPM安裝 OceanBaseOceanBaseCDCobcdcobcdc安裝部署RPMobcdc開(kāi)發(fā)說(shuō)明obcdcOceanBaseobcdcobcdcobcdc

obcdcSQL基于cluster_idRPC(不建議修改Sequencer模塊相關(guān)配置FormatterDataProcessorbinlogrecordCMakeoblogclientoblogproxyTLSoblogproxy(obcdc)OBServerTLS

OceanBaseyumoblogmsg安裝部署通過(guò)編譯后的oblogmsg庫(kù)依賴(lài)oblogmsg

反序列化一個(gè)record,或者從一個(gè)已經(jīng)序列化過(guò)的record中(parsedOK()返回true)解析數(shù) recordILogRecord::parsedOKfalseTableAPITableAPIRPCTableAPI單處理批操作(batch查詢(xún)操作

TableAPISQLKVOceanBasemavenobkv-table-clientinitinsertgetupdatereplaceinsertOrupdateincrementappendscanbatchIDEAdatabaseempty

HBaseAPI方案介紹HBaseAPI存儲(chǔ)模型HBaseAPIHBaseAPI存儲(chǔ)模型KeyKeyRangecolumnfamilyHBaseAPI客戶(hù)端使用介紹HBaseAPIOBHBaseOCPOBServerOHTable使用OHTablePool配置HBaseRefreshTableIncrementColumnCheckAndCheckAndGet

SQLDiagnoser概述SQLSQLDiagnoserSQLSQLSQL

OceanBaseob_admin是OceanBase數(shù)據(jù)庫(kù)的配套運(yùn)維工具之一,主要用于排查數(shù)據(jù)不一致、丟數(shù)據(jù)、ob_admin。OBAgent是一個(gè)監(jiān)控采集框架,支持推、拉兩種數(shù)據(jù)采集模式,可以滿(mǎn)足不同的應(yīng)用場(chǎng)景。OBAgent默認(rèn)支持的插件包括主機(jī)數(shù)據(jù)采集、OceanBase數(shù)據(jù)庫(kù)指標(biāo)的采集、監(jiān)控?cái)?shù)據(jù)標(biāo)簽PrometheusHTTPOBAgent。ob_errorOceanBaseob_errorob_error。CDC(ChangeDataCapture,即變更數(shù)據(jù)捕獲)能夠幫助您識(shí)別從上次提取之后發(fā)生變化的數(shù)據(jù)。您可用CDC提供的數(shù)據(jù)做歷史庫(kù)、近實(shí)時(shí)緩存、提供給消息隊(duì)列(MQ),用戶(hù)消MQCDC。OBD全稱(chēng)為OceanBaseDeployer,是OceanBase開(kāi)源軟件的安裝部署工具。OBD同時(shí)也是包管理器,可以用來(lái)管理OceanBase所有的開(kāi)源軟件。詳細(xì)的使用說(shuō)明,請(qǐng)參考OBD文TableAPI。DOOBA是OceanBase數(shù)據(jù)庫(kù)內(nèi)部的一個(gè)運(yùn)維腳本,用于性能監(jiān)控,使用Python語(yǔ)言開(kāi)發(fā),且僅支持Python2.7。本文將詳細(xì)介紹如何使用DOOBA對(duì)OceanBase數(shù)據(jù)庫(kù)性能進(jìn)DOOBA。HBaseAPITableAPIHBaseAPI(目前已兼容HBase0.94版本的特性)。若您當(dāng)前有業(yè)務(wù)使用了原生HBase數(shù)據(jù)操作邏OceanBaseOBServerHBaseTable,并通HBaseAPIHBaseAPI。SQLSQLDiagnoserSQLSQLSQLDiagnoser。ob_adminob_admin是OceanBase數(shù)據(jù)庫(kù)的配套運(yùn)維工具之一,本文介紹了ob_admin的安裝步驟ob_admin您可通過(guò)OceanBaseOceanBaseoceanbaseshshbuild.shrpm--cdmakeob_admin功能介紹ob_adminslog_tool、archive_tool、clog_tool、dumpsstdump_backupob_admin。$./ob_adminslog_toolf../store/slog/1 datalogdumpclogclogdumpsst用來(lái)顯示block_file文件中的內(nèi)容,例如superblock,macroblockmeta,sstablesstablemetadumpsst。dump_backup功能可解析用于物理備份的數(shù)據(jù)備份內(nèi)容。具體用法請(qǐng)參見(jiàn)ob_admin可以通過(guò)環(huán)境變量OB_ADMIN_LOG_LEVEL環(huán)境變量可取值為:DEBUG、TRACE、INFO、WARNNING、ERROR./ob_adminarchive_tool

ob_adminarchive_tooldump_logdata_files./ob_adminarchive_tooldump_log12ob_adminarchive_tooldump_indexindex_files./ob_adminarchive_tooldump_index12ob_adminarchive_tooldump_keyarchive_key_files./ob_adminarchive_tooldump_keyob_adminob_adminarchive_tooldump_logdata_files-h-p12345-t您也可以在配置文件里以指定格式配置好各租戶(hù)的kms信息,獲取主密鑰,例如:ob_adminarchive_tooldump_logdata_files-fconfig_file-ttenant_id OceanBaseclogredoclog時(shí)持久化事務(wù)數(shù)據(jù)。事務(wù)數(shù)據(jù)是事務(wù)對(duì)數(shù)據(jù)庫(kù)的修改記錄。clog_toolclogclog_tool。目前,clog_tool集成在ob_admin工具中,您可以通過(guò)執(zhí)行ob_admin命令調(diào)用clog_toolclog_tool解析指定的clog文件,并將這個(gè)日志文件按照類(lèi)SQLdump_allob_adminclog_tooldump_all<clog_file_name> dump_all命令解析并打印指定的clog其中clog_file_name為指定clog文件名。clog_file_name可以包含文件路徑。例ob_adminclog_tooldump_all clogclog101103ob_adminclog_tooldump_all101 clogclog101102103和ob_adminclog_tooldump_all dump_hexob_adminclog_tooldump_hex<clog_file_name> clogob_admindump_all命令打印dump_hex<clog_file_name>dump_alldump_format命令ob_adminclog_tooldump_format<clog_file_name> 通過(guò)dump_all命令打印的日志不便于閱讀。為了增強(qiáng)可讀性,使用dump_format命<clog_file_name>dump_allob_adminclog_tooldump_filter'<filter_name><clog_file_name> <clog_file_name>dump_all目前,filter_name的取值如下:|過(guò)濾條件名稱(chēng)|說(shuō)明||----------------|---------||table_id|||partition_id|||log_id|filter_name可以單獨(dú)使用,也可以組合使用。過(guò)濾多個(gè)條件時(shí),條件名稱(chēng)需要用英文分table_id123,clog101且位于當(dāng)前目錄,則運(yùn)行以下命令解析并打印該ob_adminclog_tooldump_filter'table_id=123' table_id123partition_id2clog101且位于當(dāng)前 ob_adminclog_toolstat_clog<clog_file_name>

true時(shí),直接退出;當(dāng)CLOG_TOOL_BREAK_ON_FAIL<clog_file_name>dump_alldump_meta

ob_adminclog_tooldump_meta dump_metaclog<clog_file_name>dump_allclogOB_LOG_SUBMITclog(clog)clog事務(wù)日志的打印格式主要包含三部分:摘要(abstract)、頭部(header)$$$abstract|header||| data_len:***,generation_timestamp:***,epoch_id:***,proposal_id:***,active_memstore_version:***,PaxosOceanBaseredo本地單分區(qū)事務(wù):事務(wù)信息的維護(hù)與該事務(wù)的訪(fǎng)問(wèn)數(shù)據(jù)在同一個(gè)節(jié)點(diǎn)上(事務(wù)執(zhí)行時(shí)日志記錄行持久化,這類(lèi)日志記錄稱(chēng)之為事務(wù)執(zhí)行時(shí)日志記錄。事務(wù)執(zhí)行時(shí)日志記錄的類(lèi)型如下所mutator事務(wù)的狀態(tài)日志,攜帶mutatorabortredoprepare分布式事務(wù)的prepare日志,包含事務(wù)的修改內(nèi)容(redo日分布式事務(wù)的commit日志,標(biāo)abortclearredo單分區(qū)事務(wù)的commit日志,標(biāo)abort同事務(wù)具有不同的事務(wù)標(biāo)識(shí)符。為了實(shí)現(xiàn)事務(wù)標(biāo)識(shí)符的唯一性,事務(wù)標(biāo)識(shí)符的結(jié)構(gòu)如下所classclassuint64_thv_;common::ObAddrserver_;int64_tint64_tOBServer維護(hù)的單調(diào)遞增值,OBServer重啟后重hashOceanBase64hashhash產(chǎn)生沖突的概率極低。因此,在大多數(shù)情況下,可以使用hash值來(lái)區(qū)分不同事dumpsstblock_filesuperblock,macroblock,macroblockmeta,sstablesstablemetadumpsst。dumpsst的命令格式如下:Usage:Usage:dumpsstcommand[commandargs][options]-d,--dumpdump,args:-h,--helpdisplaythismessage.-a,--macro-idmacroblock-n,--macro-sizemacroblocksize,in-q,--quietloglevel:-s,--skip_replayskipslogreplay,onlyworkformacro_blockmodedumpallmetasandrowsinob_admindumpsst-dpm-fblock_file_path-amacro_id-imicro_iddumpallrowsinmacro:ob_admindumpsst-dmacro_block-fblock_file_path-amacro_id-imicro_id:rowsindumpsstdumpsst$./ob_admin$./ob_admindumpsst-f/home/admin/ob1.obs0/store-d$./ob_admindumpsst-f/home/admin/ob1.obs0/store-d- 寫(xiě)sb-

dump您可使用以下命令顯示SSTable數(shù)據(jù)塊內(nèi)容,包括宏塊commonheader,sstable./ob_admindumpsst-f/home/admin/ob1.obs0/store-dmb-a13-./ob_admindumpsst-f/home/admin/ob1.obs0/store-dmacro_block-a13-其中,-f指定數(shù)據(jù)文件所在文件夾的絕對(duì)路徑,-a指定宏塊的下標(biāo),-ddump內(nèi)dumpsst-s$./ob_admin$./ob_admindumpsst-f/home/admin/ob1.obs0/store-dmacro_meta-a$./ob_admindumpsst-f/home/admin/ob1.obs0/store-dmm-a其中,-f指定數(shù)據(jù)文件所在文件夾的絕對(duì)路徑,-a指定宏塊的下標(biāo),-ddumpmmsstablemacro_blocksstablettablekey。命令格式通常如下。./ob_admin./ob_admindumpsst-dsstable-f./store/-tsstable_meta模式與macro_meta模式類(lèi)似,顯示輸出指定sstable相關(guān)的所有宏塊元數(shù)ttablekey。命令格式通常如下。./ob_admin./ob_admindumpsst-dsstable_meta-f./store/-tdumpsst對(duì)cwd(當(dāng)前工作目錄)有要求,您只能在OceanBase的home目ob_admin,cwdOceanBasehome目錄。dump_backuphelpdump_backupUsage:dump_backupcommand[commandargs]Usage:dump_backupcommand[commandargs][options]-h,--helpdisplaythismessage.-o,--offsetdatafile-f,--file-pathrelativedatafile-s,--storage-infooss/cosshouldprovidestorage-q,--quietloglevel:-k,--master_keymasterkey,hex-m,--master_key_idmasterkey-c,--check_existcheckfileisexistornotdumpob_admindump_backup-dfile:///home/admin/backup_infodumpmacro:ob_admindump_backup-dfile:///home/admin/macro_block_1.0-o1024-l2048dumpdatawith-f:ob_adminob_admindump_backup-f/home/admin/macro_block_1.0-o1024-l2048dumpdatawith-s:ob_admindump_backup-d'oss://home/admin/backup_info'-s'host=http://oss-cn-ob_admindump_backup-d'cos://home/admin/backup_info'--fmacro_blockclusterbackup tenant_name_infotenant_info,dump./ob_admindump_backupfcluster_backup_piece_info partition

-

和-

./ob_admin./ob_admindump_backup-f 82partition-o138668,-d1628partition./ob_admin./ob_admindump_backup-f/meta_file_0-o138668-lindex-o-l./ob_admin./ob_admindump_backup-f

0-

./ob_admin./ob_admindump_backup-f/1100611139453785/0/major_data/macro_block_1.0-o0-本文將簡(jiǎn)要介紹什么是OBAgent,以及OBAgent具有的特性。OBAgent是一個(gè)監(jiān)控采集框架。OBAgent支持推、拉兩種數(shù)據(jù)采集模式,可以滿(mǎn)足不同的應(yīng)用場(chǎng)景。OBAgent默認(rèn)支持的插件包括主機(jī)數(shù)據(jù)采集、OceanBase數(shù)據(jù)庫(kù)指標(biāo)的采集、監(jiān)控PrometheusHTTPOBAgentOBAgent具有以下特性:Go插件驅(qū)動(dòng),易開(kāi)發(fā)。KVencrypted=trueaesmonagent#configVersion:"2021-08-key:http.server.basic.auth.usernamevalue:{http_basic_auth_user}valueType:stringvalue:{http_basic_auth_password}valueType:stringencrypted:key:http.admin.basic.auth.usernamevalue:{pprof_basic_auth_user}valueType:stringkey:http.admin.basic.auth.passwordvalue:{pprof_basic_auth_password}valueType:stringencrypted:#configVersion:"2021-08-MySQLkey:monagent.mysql.monitor.uservalue:mysql_monitor_uservalueType:string#MySQL監(jiān)控用戶(hù)密碼key:monagent.mysql.monitor.passwordvalue:mysql_monitor_passwordvalueType:stringencrypted:MySQLSQLvalue:3306valueType:int64MySQLkey:monagent.mysql.hostvalue:valueType:OceanBasekey:monagent.ob.monitor.uservalue:{monitor_user}valueType:#OceanBase監(jiān)控用戶(hù)密碼key:monagent.ob.monitor.passwordvalue:{monitor_password}encrypted:trueOceanBaseSQLkey:valueType:OceanBaseRPCkey:monagent.ob.rpc.portvalue:{rpc_port}valueType:OceanBasekey:monagent.ob.install.pathvalue:{ob_install_path}valueType:stringkey:monagent.host.ipvalue:{host_ip}valueType:stringOceanBasekey:value:{cluster_name}valueType:OceanBasekey:monagent.ob.cluster.idvalueType:OceanBasezonekey:value:{zone_name}valueType:OceanBasekey:monagent.pipeline.ob.statusvalue:{ob_monitor_status}valueType:valueType:key:monagent.pipeline.ob.log.statusvalue:{ob_log_monitor_status}valueType:stringkey:monagent.pipeline.node.statusvalue:{host_monitor_status}valueType:string#alertmanagerkey:monagent.alertmanager.addressvalue:{alertmanager_address}valueType:string#MySQLkey:monagent.pipeline.mysql.statusvalue:inactivevalueType:KVmonagent_basic_auth.yaml,KVmonagent_pipeline.yaml,KVmonagent配置文件說(shuō)明monagentmonagent.yamllevel:filename:log/monagent.logmaxsize:30maxage:maxbackups:10localtime:truecompress:true,addressmetrics,adminAddresspprofaddress:adminAddress:":8089"runDir:runaesplain。其中,aeskeykeymodulePath,propertiesPathKVcryptoMethod:plaincryptoPath:conf/.config_secret.keymodulePath:conf/module_configmonagent者關(guān)閉,配置禁用后對(duì)應(yīng)的變量為{disable_http_basic_auth} OceanBase數(shù)據(jù)庫(kù)監(jiān)控流水線(xiàn)配置模版,無(wú)需修PrometheusPrometheusPrometheusprometheus.yaml#OBAgent的RPM包中包含PrometheusrulesOceanBasePrometheusalertmanager。Prometheusjob_name:scheme:httpjob_name:nodeusername:{http_basic_auth_user}password:{http_basic_auth_password}metrics_path:/metrics/node/hostscheme:http{targetjob_name:ob_basicusername:{http_basic_auth_user}password:{http_basic_auth_password}metrics_path:/metrics/ob/basicscheme:http{targetjob_name:ob_extrausername:{http_basic_auth_user}password:{http_basic_auth_password}metrics_path:/metrics/ob/extrascheme:http{targetjob_name:agentusername:{http_basic_auth_user}password:{http_basic_auth_password}metrics_path:/metrics/statscheme:http{targetOBAgent,您可以使用RPM包或者構(gòu)建源碼安裝OBAgentOBAgentGo1.14PRMOBAgent提供RPM包,您可以去Release頁(yè)面下載RPM包,然后使用以下命令安裝:rpm-ivhobagent-1.0.0-1.el7.x86_64.rpm Debugmakemakebuild//makebuildwillbedebugmodebymakebuild-Releasemakebuild- OBAgentOBAgentbinconf和runOBAgent├──│└──├──│├──││├──│││└──│├──││├──││├──││├──││└──│├──│└──│├──│└──│├──│└──└──其中,

Prometheusrunmonagent。

OBAgent提供使用OBD部署和手動(dòng)部署。若要手動(dòng)部署OBAgent,您要配置OBAgent、Prometheus和PrometheusAlertmanager(可選)。本文將介紹如何手動(dòng)部署OBAgentOceanBaseOBAgent已經(jīng)安裝。詳細(xì)信息,請(qǐng)參考安裝OBAgent。OBAgent8088、8089monagentKVmonagentSupervisormonagentOBAgentcd/home/admin/obagentmonagent2>&1&Supervisorcommand=./bin/monagent-cconf/monagent.yaml您需要安裝Prometheus配置Prometheus,詳細(xì)信息,請(qǐng)參考Prometheus配置文件說(shuō)明將配置好的Prometheus配置文件復(fù)制到部署Prometheus的主機(jī)上,然后使用如下命Prometheus。./prometheus-- (可選)步驟3:部署 PrometheusAlertmanagerPrometheusAlertmanagerPrometheusAlertmanagerPrometheusOBAgent提供默認(rèn)的報(bào)警項(xiàng),配置文件位于conf/prometheus_config/ruleshost_rules.yaml存儲(chǔ)機(jī)器報(bào)警項(xiàng),ob_rules.yaml存儲(chǔ)OceanBasePrometheusrules*:node-alertalert:disk-node_filesystem_size_bytes{mountpoint="/",fstype=~"ext4|xfs"})>80for:summary:"{{$labels.instance}}diskfulldescription:"{{$labels.instance}}disk>{{$value}}Grafana。./bin/grafana- grafanaadminprometheusgrafana。導(dǎo)入dashboard,針對(duì)OceanBase和主機(jī)指標(biāo)的配置已經(jīng)發(fā)布到grafana,id分別為1521515216dashboardgrafana(可選)KVOBAgentHTTPKVKVkeyvalue使用OBD部署OBAgent提供使用OBD部署和手動(dòng)部署。若要手動(dòng)部署OBAgent,您要配置OBAgent、Prometheus和PrometheusAlertmanager(可選)。推薦您使用OBD部署OBAgent。本OBDOBAgent。在部署OBAgent之前,您需要確認(rèn)OBAgent的默認(rèn)端口8088、8089未占用。您也可以自obdclusterdeploy命令之后將檢查您的目標(biāo)機(jī)器是否有OBAgent安裝包。如果沒(méi)有安裝包,OBD將自動(dòng)從yumOceanBase如果您希望同時(shí)部署OceanBase集群和OBAgent,您只需要在OceanBase數(shù)據(jù)庫(kù)的配置OBAgent--oceanbase-cehome_path:serversoceanbase-ce

OBD不支持為已部署的集群添加新的組件。如果您希望為已部署的集群配置OBAgent,您需若要單獨(dú)部署OBAgent,您需要準(zhǔn)備OBAgent的配置文件。請(qǐng)確保配置文件中的以下字段OceanBasehttp_basic_auth_user:admin#PasswordforHTTPauthentication.http_basic_auth_password:******#Usernamefordebugservice.Thedefaultvalueisadmin.pprof_basic_auth_user:admin#Passwordfordebugservice.pprof_basic_auth_password:******OceanBase#MonitorusernameforOceanBaseDatabase.TheusermusthavereadaccesstoOceanBaseDatabaseasasystemtenant.Thedefaultvalueisroot.monitor_user:root#MonitorpasswordforOceanBaseDatabase.Thedefaultvalueisempty.Whenadependsexists,OBDgetsthisvaluefromtheoceanbase-ceofthedepends.Thevalueisthesameastheroot_passwordinoceanbase-ce.#TheSQLportforobserver.Thedefaultvalueis2881.Whenadependsexists,OBDgetsthisvaluefromtheoceanbase-ceofthedepends.Thevalueisthesameasthemysql_portinoceanbase-ce.sql_port:#TheRPCportforobserver.Thedefaultvalueis2882.Whenadependsexists,OBDgetsthisvaluefromtheoceanbase-ceofthedepends.Thevalueisthesameastherpc_portinoceanbase-ce.#ClusternameforOceanBaseDatabase.Whenadependsexists,OBDgetsthisvaluefromtheoceanbase-ceofthedepends.Thevalueisthesameastheappnameinoceanbase-ce.cluster_name:#ClusterIDforOceanBaseDatabase.Whenadependsexists,OBDgetsthisvaluefromtheoceanbase-ceofthedepends.Thevalueisthesameasthecluster_idincluster_id:#Zonenameforyourobserver.Thedefaultvalueiszone1.Whenadependsexists,OBDgetsthisvaluefromtheoceanbase-ceofthedepends.Thevalueisthesameasthezonenameinoceanbase-ce.zone_name:whethertoenablethisparameterbasedondepends.OBAgentobdclusterdeploy<deployname>c<yamlpath>]f]U]A]OBAgentobdclusterstart<deployname>您需要先安裝PrometheusOBD會(huì)替換OBAgent配置文件模版中的變量,可以復(fù)制該配置文件)到部署Prometheus的主機(jī),然后執(zhí)行如下命令使用 ./prometheus-- (可選)PrometheusPrometheusAlertmanager。PrometheusAlertmanager。PrometheusAlertmanagerPrometheus。OBAgent提供默認(rèn)的報(bào)警項(xiàng),配置文件位于conf/prometheus_config/ruleshost_rules.yaml存儲(chǔ)機(jī)器報(bào)警項(xiàng),ob_rules.yaml存儲(chǔ)OceanBasePrometheusrules*:node-alertalert:disk-node_filesystem_size_bytes{mountpoint="/",fstype=~"ext4|xfs"})>80summary:"{{$labels.instance}}diskfulldescription:"{{$labels.instance}}disk>{{$value}}Grafana。./bin/grafana- grafanaadminprometheusgrafana。導(dǎo)入dashboard,針對(duì)OceanBase數(shù)據(jù)庫(kù)和主機(jī)指標(biāo)的配置已經(jīng)發(fā)布到grafana,id分15215、15216dashboardgrafana。(可選)KV要更新KV配置,請(qǐng)使用

obdclusteredit-config。詳細(xì)信息,請(qǐng)參考

集群命令組 CPUdevice,fstype,device,fstype,device,fstype,15cacheNTPOceanBase數(shù)據(jù)庫(kù)指標(biāo) ob_cluster_id,ob_cluster_name,obzone,svr_ip,ob_cluster_id,ob_cluster_name,obzone,svr_ip,tenant_name,kvcacheob_cluster_id,ob_cluster_name,obzone,svr_ip,ob_cluster_id,ob_cluster_name,obzone,svr_ip,ob_cluster_id,ob_cluster_name,obzone,svr_ip,ob_cluster_id,ob_cluster_name,obzone,svr_ip,plancache大小ob_cluster_id,ob_cluster_name,obzone,svr_ip,ob_cluster_id,ob_cluster_name,obzone,svr_ip,ob_cluster_id,ob_cluster_name,obzone,svr_ip,ob_cluster_id,ob_cluster_name,OceanBase磁盤(pán)剩余大ob_cluster_id,ob_cluster_name,OceanBaseob_cluster_id,ob_cluster_name,obzone,svr_ip,memstoreob_cluster_id,ob_cluster_name,obzone,svr_ip,memstore凍結(jié)次數(shù)ob_cluster_id,ob_cluster_name,obzone,svr_ip,memstore凍結(jié)閾值ob_cluster_id,ob_cluster_name,obzone,svr_ip,memstoreob_cluster_id,ob_cluster_name,OBServerCPUob_cluster_id,ob_cluster_name,OBServer已分配CPUob_cluster_id,ob_cluster_name,OBServerob_cluster_id,ob_cluster_name,OBServer已分配內(nèi)存大ob_cluster_id,ob_cluster_name,OBServerunitob_cluster_id,ob_cluster_name,obzone,svr_ip,OceanBase不同的stat_id,ob_sysstat不相同,參RPCRPCRPCRPCRPCRPCselectSQLreplaceSQLreplaceSQLupdateSQLupdateSQL執(zhí)行時(shí)間deleteSQLdeleteSQLSQLSQLSQLrowcacherowcacheblockcacheblockcachememstorememstorememstorememstorememstorememstoreclogmemstorememstoremajorfreezememstore大小限制OBAgentOBAgent是一個(gè)插件驅(qū)動(dòng)的監(jiān)控采集框架。要擴(kuò)展OBAgent的功能,或者自定義數(shù)據(jù)的處OBAgentOBAgent插件類(lèi)型章節(jié)。OBAgent//Initializer//InitializerInittypeInitializerinterfaceInit(configmap[string]interface{})typeCloserinterfaceClose()Close()//DescriberSampleConfigDescriptiontypeDescriberinterface{SampleConfig()stringDescription()stringOBAgent支持的插件類(lèi)型見(jiàn)下表:處理插件輸出插件僅適用于拉模式。通過(guò)HTTP服務(wù)暴露數(shù)據(jù)。用來(lái)metricsCollect()([]metric.Metric,Process(metrics...metric.Metric)([]metric.Metric,ProcessmetricsmetricsExport(metrics[]metric.Metric)(*bytes.Buffer,輸出插件(Exporter)Exportmetrcsbytebuffererror。輸出插件(Output)typetypeOutputinterface{Write(metrics[]metric.Metric)errorOBAgentMetrictypetypeMetricinterface{Clone()MetricSetName(namestring)GetName()stringSetTime(timetime.Time)GetTime()GetTime()time.TimeSetMetricType(metricTypeType)GetMetricType()TypeFields()map[string]interface{}Tags()map[string]string使用OBAgent采集MySQL性能指標(biāo)OBAgent集成了Prometheus提供的mysqldexporter,可以使用OBAgent來(lái)采集MySQLOBAgentMySQLOBAgent中打包了采集MySQL的流水線(xiàn)配置,默認(rèn)沒(méi)有開(kāi)啟,您可通過(guò)修改如下配置項(xiàng)來(lái)MySQLkey:monagent.mysql.monitor.uservalue:mysql_monitor_uservalueType:stringkey:monagent.mysql.monitor.passwordvalue:mysql_monitor_passwordvalueType:stringencrypted:MySQLSQLvalue:3306valueType:#MySQL的連接地址key:monagent.mysql.hostvalue:valueType:key:monagent.pipeline.mysql.statusvalue:inactivevalueType:MySQL流水線(xiàn)的配置如下。OBAgentRPMmonitor_mysql.yaml,mysqldInput:&mysqldInputplugin:mysqldInputtimeout:10sdsn:${monagent.mysql.monitor.user}:${monagent.mysql.monitor.password}@binlog_size:truemysqldexporter

MySQLOBDOBAgent@INTERVAL,替換為計(jì)算周期。@GBLABELS,LabelMEMStoresum(ob_sysstat{stat_id="130000",@LABELS})by(@GBLABELS)/1048576{@LABELS})by100*1/(1+sum(rate@LABELS}[@INTERVAL]))by([@GBLABELS)](/GBLABELS))/50008",@LABELS}[@INTERVAL])) sum(ob_cache_size_bytes{cache_name="user_block_cache",@LABELS}) ([@GBLABELS) /GBLABELS))/80057",@LABELS}[@INTERVAL])) ([@GBLABELS)](/GBLABELS))80041",@LABELS}[@INTERVAL])) (@GBLABELS)/sum(rate@LABELS}[@INTERVAL]))byCPU100 sum(rate(node_cpu_seconds_total [@INTERVAL])) (node_cpu_seconds_total{@LABELS}[@INTERVAL]))sum{@LABELS} {@LABELS})by(@GBLABELS)/mpleted_total{@LABELS}[@INTERVAL]))byavg(rate{@LABELS}[@INTERVAL]))(@GBLABELS)/SSStore60000",@LABELS}[@INTERVAL]))by(@GBLABELS)60001",@LABELS}[@INTERVAL])) (@GBLABELS)/sum(rate@LABELS}[@INTERVAL]))by60002",@LABELS}[@INTERVAL]))by(@GBLABELS)1000000*_read_time_seconds_total{@LABELS}[@INTERVAL]))(@GBLABELS))/(avg(rate(nod{@LABELS}[@INTERVAL]))1000000*_read_time_seconds_total{@LABELS}[@INTERVAL]))(@GBLABELS))/(avg(rate(nod{@LABELS}[@INTERVAL]))mpleted_total{@LABELS}[@INTERVAL]))byytes_total{@LABELS}[@INTERVAL])) (@GBLABELS)/1048576SSStore60003",@LABELS}[@INTERVAL]))by(@GBLABELS)60004",@LABELS}[@INTERVAL])) (@GBLABELS)/sum(rate@LABELS}[@INTERVAL]))by60005",@LABELS}[@INTERVAL]))by(@GBLABELS)1000000*_write_time_seconds_total{@LABELS}[@INTERVAL]))(@GBLABELS))/(avg(rate(nodl{@LABELS}[@INTERVAL]))by1000000*_write_time_seconds_total{@LABELS}[@INTERVAL]))(@GBLABELS))/(avg(rate(nodl{@LABELS}[@INTERVAL]))by by(@GBLABELS)avg(node_load15{@LABELS})by(@GBLABELS) by(@GBLABELS)sum(ob_sysstat{stat_id="130002",@LABELS})by(@GBLABELS)/1048576BufferCacheavg{@LABELS})by(@GBLABELS)bytes{@LABELS})by(@GBLABELS)/1073741824_bytes{@LABELS})by(@GBLABELS)avg(node_memory_MemFree_bytes{@LABELS})byavg{@LABELS})byavg{@LABELS})by(@GBLABELS))MEMStoresum(ob_sysstat{stat_id="130004",@LABELS})by(@GBLABELS)/1048576MEMStore100*sum(ob_sysstat{stat_id=" (@GBLABELS) @LABELS})by60022",@LABELS}[@INTERVAL]))by(@GBLABELS)60021",@LABELS}[@INTERVAL]))by(@GBLABELS)60023",@LABELS}[@INTERVAL])) (@GBLABELS)/(sum(rate@LABELS}[@INTERVAL]))by(@GBLABELS)+sum(rate@LABELS}[@INTERVAL]))bye_bytes_total{@LABELS}[@INTERVAL])) (@GBLABELS)/1048576mit_bytes_total{@LABELS}[@INTERVAL]))by(@GBLABELS)/1048576CPU100*sum(ob_sysstat{stat_id=" (@GBLABELS) @LABELS})bysum(ob_partition_num{@LABELS})by100 sum(rate(ob_plan_cache_hit_total{@LABELS}[@INTERVAL])) {@LABELS}[@INTERVAL]))bytes{@LABELS})by(@GBLABELS)/1048576SQL20001",@LABELS}[@INTERVAL]))by(@GBLABELS)SQL20002",@LABELS}[@INTERVAL])) (@GBLABELS)/sum(rate@LABELS}[@INTERVAL]))by100*1/(1+sum(rate@LABELS}[@INTERVAL]))by(@GBLABELS)/sum(rate@LABELS}[@INTERVAL]))bysum(ob_cache_size_bytes{@LABELS})by(@GBLABELS)/RPC10001",@LABELS}[@INTERVAL]))by(@GBLABELS)RPC10005",@LABELS}[@INTERVAL])) (@GBLABELS)+sum(rate@LABELS}[@INTERVAL]))by(@GBLABELS))/sum(rate@LABELS}[@INTERVAL]))byRPC10003",@LABELS}[@INTERVAL]))by(@GBLABELS)1000510005",@LABELS}[@INTERVAL])) @LABELS}[@INTERVAL])) @LABELS}[@INTERVAL]))40002",@LABELS}[@INTERVAL])) @LABELS}[@INTERVAL])) @LABELS}[@INTERVAL])) @LABELS}[@INTERVAL])) @LABELS}[@INTERVAL]))RPCSQL40003",@L40003",@LABELS}[@INTERVAL])) @LABELS}[@INTERVAL])) @LABELS}[@INTERVAL])) @LABELS}[@INTERVAL])) @LABELS}[@INTERVAL])) @LABELS}[@INTERVAL])) @LABELS}[@INTERVAL])) @LABELS}[@INTERVAL])) @LABELS}[@INTERVAL])) @LABELS}[@INTERVAL]))40008",@LABELS}[@INTERVAL]))by(@GBLABELS)40009",@LABELS}[@INTERVAL])) (@GBLABELS)/sum(rate@LABELS}[@INTERVAL]))by40012",@LABELS}[@INTERVAL]))by(@GBLABELS)每秒處理Insert40002",@LABELS}[@INTERVAL]))by(@GBLABELS)40003",@LABELS}[@INTERVAL])) (@GBLABELS)/sum(rate@LABELS}[@INTERVAL]))by40010",@LABELS}[@INTERVAL]))by(@GBLABELS)40011",@LABELS}[@INTERVAL]))by(@GBLABELS)Replace40004",@LABELS}[@INTERVAL]))by(@GBLABELS)Replace40005",@LABELS}[@INTERVAL])) (@GBLABELS)/sum(rate@LABELS}[@INTERVAL]))by40000",@LABELS}[@INTERVAL]))by(@GBLABELS)40001",@LABELS}[@INTERVAL])) (@GBLABELS)/sum(rate@LABELS}[@INTERVAL]))byUpdate40006",@LABELS}[@INTERVAL]))by(@GBLABELS)服務(wù)端每條Update語(yǔ)句平均處40007",@LABELS}[@INTERVAL])) (@GBLABELS)/sum(rate@LABELS}[@INTERVAL]))bymax(ob_table_num{@LABELS})byMEMStoresum(ob_sysstat{stat_id="130001",@LABELS})by(@GBLABELS)/104857630005",@LABELS}[@INTERVAL]))by(@GBLABELS)30006",@LABELS}[@INTERVAL])) (@GBLABELS)/sum(rate@LABELS}[@INTERVAL]))by30002",@LABELS}[@INTERVAL]))by(@GBLABELS)30000",@LABELS}[@INTERVAL])) (@GBLABELS)/sum(rate@LABELS}[@INTERVAL]))bysum(rate(ob_waitevent_wait_total{@LABELS}[@INTERVAL]))econds_total{@LABELS}[@INTERVAL])) (ob_waitevent_wait_total{@LABELS}[@INTERVAL]))OBAgent 100 max(ob_active_session_num{@LABELS}/262144)by100 sum(rate(node_cpu_seconds_total [@INTERVAL])) by (node_cpu_seconds_total 140006",@LABELS})(@GBLABELS)/sum@LABELS})by(@GBLABELS)100 (1 avg{@LABELS})by(@GBLABELS)avg{@LABELS})bymax(ob_zone_stat{name="frozen_version",@LABELS})by(@GBLABELS)-min(ob_zone_stat{name="last_merged_version",@LABELS})by(@GBLABELS)100*max(sum(rate(node_network_receive_bytes_total{@LABELS}[@INTERVAL]))(device,@GBLABELS)/sum(bandwidth{@LABELS}))by100*max(sum(rate(node_network_transmit_bytes_total{@LABELS}[@INTERVAL]))(device,@GBLABELS)/sum(bandwidth{@LABELS}))byinactive",@LABELS})bysum(ob_index_error_num{@LABELS})bysum(node_load1{@LABELS})by(@GBLABELS)/sum(cpu_count{@LABELS})by(1-(avg(node_memory_MemFree_bytes{@LABELS})by(@GBLABELS)+avg{@LABELS})by(@GBLABELS)avg{@LABELS})by(@GBLABELS))_bytes{@LABELS})by(@GBLABELS))*100max(ob_zone_stat{name="by(@GBLABELS)max(ob_zone_stat{name="is_merge_error",@LABELS})bysum(ob_partition_num{@LABELS})bymax(node_filesystem_readonly{@LABELS})by100 (sum(ob_disk_total_bytes{@LABELS})by(@GBLABELS)sum(ob_disk_free_byt{@LABELS})by(@GBLABELS))sum(ob_disk_total_bytes{@LABELS})by130000",@LABELS})(@GBLABELS)/sum@LABELS})by(@GBLABELS)130001",@LABELS})(@GBLABELS)/sum@LABELS})by(@GBLABELS)ob_errorOceanBaseob_errorYUMyum-config-manageryum-config-manager--add-repoDebugbashbashbuild.shdebug--initcdbuild_debugmakeob_errorDEBUG_BUILD_DIR/tools/ob_error/src/ob_errorReleasecdbuild_releasemakeob_error的編譯產(chǎn)物默認(rèn)存儲(chǔ)在RELEASE_BUILD_DIR/tools/ob_error/src/ob_errorRPM頁(yè)面rpm-ivhoceanbase-ce-utils-3.1.1- ob_error,rpm2cpioob_errorrpm2cpiorpm2cpiooceanbase-ce-utils-3.1.1-4.el7.x86_64.rpm|cpio-idmvcphome/admin/oceanbase/bin/ob_error您只需要輸入錯(cuò)誤碼就可以得到與操作系統(tǒng)、Oracle模式、MySQL模式和OceanBase數(shù)據(jù)$ob_error$ob_error4001OceanBaseErrorCode:OB_OBJ_TYPE_ERROR(-4001)Message:ObjecttypeerrorSolution:ContactOceanBaseSupportOracleErrorCode:ORA-Message:sequenceparametermustbeanintegerRelatedOceanBaseErrorCode:當(dāng)設(shè)施為my時(shí),如果錯(cuò)誤碼不是MySQL模式中的錯(cuò)誤,您將得到OceanBase數(shù)據(jù)庫(kù) MySQL模式的錯(cuò)誤信息。$ob_error$ob_errormyOceanBaseErrorCode:OB_ERROR(-4000)Message:CommonerrorSolution:ContactOceanBase$ob_errormyMySQLErrorCode:1210(HY000)Message:InvalidargumentMessage:MissargumentMessage:IncorrectargumentstoESCAPERelatedOceanBaseErrorCode:INCORRECT_ARGUMENTS_TO_ESCAPE(-

$ob_error$ob_errorora51OracleErrorCode:ORA-Message:timeoutoccurredwhilewaitingforaRelatedRelatedOceanBaseErrorOB_ERR_TIMEOUT_ON_RESOURCE(-還有一種特殊情況,如果您使用-a選項(xiàng),若輸入的錯(cuò)誤碼在對(duì)應(yīng)模式中存在,您將會(huì)得OceanBaseOracle$ob_error$ob_errorora600-a5727OceanBaseErrorCode:OB_ERR_PROXY_REROUTE(-5727)Message:SQLrequestshouldbereroutedSolution:ContactOceanBaseSupportOracleErrorCode:ORA-Message:internalerrorcode,arguments:-5727,SQLrequestshouldbereroutedRelatedOceanBaseErrorCode:OB_ERR_PROXY_REROUTE(--aORA-00600

錯(cuò)誤。ORA-

Oracle src/oberror_errno.def4000DEFINE_ERROR(OB_ERROR,-4000,-1,"HY000","Common DEFINE_ERROR(OB_ERROR,DEFINE_ERROR(OB_ERROR,-4000,-1,"HY000","Commonerror",cpp

cdcdBUILD_DIRob_errorCDCCDC(ChangeDataCapture,即變更數(shù)據(jù)捕獲)能夠幫助您識(shí)別從上次提取之后發(fā)生變化的數(shù)據(jù)。您可用CDC提供的數(shù)據(jù)做歷史庫(kù)、近實(shí)時(shí)緩存、提供給消息隊(duì)列(MQ),用戶(hù)消MQ做分析和審計(jì)等。obcdcoblogmsg其中,obcdc是OceanBaseCDC的基本組件,obcdc衍生出oblogproxy,obcdc依賴(lài)obcdcOceanBase(事務(wù))obcdc通過(guò)RPC向OceanBase數(shù)據(jù)庫(kù)請(qǐng)求各分區(qū)的Clog(Redo)日志,結(jié)合各個(gè)表、列schema(SQLOBServer),Redo式(LOGMSG),obcdcobcdc對(duì)外提供OceanBase增量事務(wù)數(shù)據(jù),調(diào)用obcdc的進(jìn)程拿到數(shù)據(jù)后可用于數(shù)據(jù)同步數(shù)據(jù)同步:將OceanBase數(shù)據(jù)同步到同構(gòu)或者異構(gòu)的數(shù)據(jù)庫(kù),可以做邏輯遷移、邏輯備OceanBaseobcdc,obcdcobcdcoblogproxy是obcdc的代理,oblogproxy調(diào)用obcdc,作為obcdc的消費(fèi)者獲取OceanBaseoblogproxy提供實(shí)時(shí)增量鏈路接入和管理能力,方便應(yīng)用接入OceanBase數(shù)據(jù)庫(kù)的增量日oblogproxyoblogproxy使用安裝oblogproxy。您可以參考數(shù)據(jù)遷移相關(guān)內(nèi)容,將OceanBase數(shù)據(jù)庫(kù)的數(shù)據(jù)實(shí)時(shí)同步到MySQL數(shù)據(jù)遷移概述。oblogmsg是一種數(shù)據(jù)庫(kù)增量數(shù)據(jù)的輸出格式,OceanBase數(shù)據(jù)庫(kù)的增量采集模塊obcdc正是使用的這種消息格式來(lái)輸出增量數(shù)據(jù),oblogmsg支持OceanBase數(shù)據(jù)庫(kù)中不同數(shù)據(jù)類(lèi)oblogmsg,安裝部署obcdc安裝部署RPMobcdc,本文將詳細(xì)為您介紹具體操作obcdcOceanBasetools/obcdc目錄下,有兩個(gè)子目錄:srcobcdcobcdc_tailf。testsobcdc_tailfOceanBasewatch*.sh:各種監(jiān)控腳本。obcdcOceanBaseOB_BUILD_LIBOBLOG=ON命令如:./build.shdebuginitDOB_BUILD_LIBOBLOG=ONmakelibobcdc.so:${PROJECT_BUILD_D

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶(hù)所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶(hù)上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶(hù)上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶(hù)因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論