{"id":657,"date":"2020-07-28T14:11:17","date_gmt":"2020-07-28T06:11:17","guid":{"rendered":"http:\/\/www.gbase8.cn\/?p=657"},"modified":"2024-11-29T01:22:05","modified_gmt":"2024-11-28T17:22:05","slug":"gbase-8a%e9%9b%86%e7%be%a4%e8%bf%90%e7%bb%b4%e5%b8%b8%e7%94%a8%e5%91%bd%e4%bb%a4%e7%ae%80%e5%8c%96%e7%89%88","status":"publish","type":"post","link":"https:\/\/www.gbase8.cn\/en\/657","title":{"rendered":"\u5357\u5927\u901a\u7528GBase 8a\u6570\u636e\u5e93\u96c6\u7fa4\u8fd0\u7ef4\u5de1\u68c0\u7ef4\u62a4\u5e38\u7528\u547d\u4ee4\u7b80\u5316\u7248"},"content":{"rendered":"\n<p>GBase 8a\u6570\u636e\u5e93\u96c6\u7fa4\uff0c\u63d0\u4f9b\u4e86\u591a\u79cd\u8fd0\u7ef4\u76d1\u63a7\u7528\u7684\u547d\u4ee4\uff0c\u7528\u6765\u67e5\u770b\u5f53\u524d\u96c6\u7fa4\u8fd0\u884c\u72b6\u6001\u662f\u5426\u5f02\u5e38\u3002\u4e5f\u63d0\u4f9b\u4e86\u7b80\u5355\u7684\u5bfc\u5165\u548c\u5bfc\u51fa\u65b9\u6848\u3002\u672c\u6587\u6c47\u603b\u4e86\u5728\u73b0\u573a\u8fd0\u7ef4\u4eba\u5458\u6700\u7ecf\u5e38\u4f7f\u7528\u7684\u547d\u4ee4\u6c47\u603b\u3002<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_84 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">\u76ee\u5f55\u5bfc\u822a<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a2a88931ba92\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a2a88931ba92\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.gbase8.cn\/en\/657\/#%E5%8F%82%E8%80%83\" >\u53c2\u8003<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.gbase8.cn\/en\/657\/#GBase_8a%E9%9B%86%E7%BE%A4%E8%BF%90%E7%BB%B4%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4%E7%AE%80%E5%8C%96%E7%89%88\" >GBase 8a\u96c6\u7fa4\u8fd0\u7ef4\u5e38\u7528\u547d\u4ee4\u7b80\u5316\u7248<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%8F%82%E8%80%83\"><\/span>\u53c2\u8003<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><a href=\"https:\/\/www.gbase8.cn\/6824\">GBase 8a\u8fd0\u7ef4\u7ba1\u7406\u7528\u81ea\u5b9a\u4e49\u5b58\u50a8\u8fc7\u7a0b\u6c47\u603b<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"GBase_8a%E9%9B%86%E7%BE%A4%E8%BF%90%E7%BB%B4%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4%E7%AE%80%E5%8C%96%E7%89%88\"><\/span>GBase 8a\u96c6\u7fa4\u8fd0\u7ef4\u5e38\u7528\u547d\u4ee4\u7b80\u5316\u7248<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u6700\u65b0\u7248\u672c https:\/\/www.gbase8.cn\/657<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">GBase 8a\u96c6\u7fa4\u8fd0\u7ef4\u5e38\u7528\u547d\u4ee4\u7b80\u5316\u7248\n============================================\n\u6700\u65b0\u7248\u672c https:\/\/www.gbase8.cn\/657\n============================================\n1\u3001\u67e5\u770b\u96c6\u7fa4\u662f\u5426\u6b63\u5e38\n1.1 \u67e5\u770b\u96c6\u7fa4\u72b6\u6001\ngcadmin\n1.2 \u67e5\u770b\u96c6\u7fa4\u6570\u636e\u4e0d\u4e00\u81f4\u60c5\u51b5,\u540e\u9762\u53ef\u9009\u7684\u6570\u5b57\uff0c\u662f\u663e\u793aevent\u6570\u91cf\uff0c\u9ed8\u8ba416\u4e2a\ngcadmin showdmlevent [number]\ngcadmin showddlevent [number]\ngcadmin showdmlstorageevent [number]\n\u6307\u5b9a\u8868\u5206\u7247\u548cIP\ngcadmin showXXXevent dbname.tablename nX IP\n\u6bd4\u5982\ngcadmin showdmlevent testdb.t1 n1 192.168.0.11\n1.2 \u91cd\u542f\u96c6\u7fa4\u670d\u52a1\nV8 \u5728\u64cd\u4f5c\u7cfb\u7edfroot\u4e0b: service gcware start\/stop\/restart\nV9 \u5728dba\u7528\u6237\u4e0b\uff0c\u4e00\u822c\u662fgbase: gcluster_services all start\/stop\/restart\n2\u3001\u96c6\u7fa4\u547d\u4ee4\u884c\uff0c\u7528\u4e8e\u6267\u884cSQL\u547d\u4ee4\nsu - gbase\n\u4ea4\u4e92\u6a21\u5f0f gccli -uUsername -pPassword -hIP\n\u7b80\u5355\u6267\u884c gccli -uUsername -pPassword -hIP -e\"show processlist\"\n\u6279\u91cf\u6587\u4ef6 gccli -uUsername -pPassword -hIP &lt; allSQL.txt\n3\u3001\u67e5\u770b\u96c6\u7fa4\u8fd0\u884c\u7684SQL\n3.1 \u6307\u5b9a\u8282\u70b9\n\u7b80\u5355 show processlist\n\u5b8c\u6574 show full processlist\n\u8be6\u7ec6 show detail processlist\n3.2 \u6240\u6709\u8c03\u5ea6\u8282\u70b9\nselect COORDINATOR_NAME, ID, user, host, command, start_time, time, state, substring(info,0,100) info from information_schema.COORDINATORS_TASK_INFORMATION where command='query' and time >=0 order by time desc limit 10;\n3.3 \u6240\u6709\u6570\u636e\u8282\u70b9\nselect NODE_NAME, ID, user, host, command, start_time, time, state, substring(info,0,100) info from information_schema.GNODES_TASK_INFORMATION where command='query' and info is not null and info not like '%information_schema.processlist%' order by time desc limit 10;\n4\u3001\u5bfc\u51fa\u6570\u636e\nrmt:select * from ac08 where btime between '2020-01-01' and '2020-02-01' into outfile '\/opt\/ac08.txt' fields terminated by ',' ENCLOSED BY '\"' null_value '\\N'\n5\u3001\u52a0\u8f7d\u6570\u636e\nload data infile 'ftp:\/\/gbase:gbase@192.168.0.100\/\/opt\/ac08.txt' into table ac08 NULL_VALUE '\\N' fields terminated by ',' ENCLOSED BY '\"' DATETIME FORMAT \u2018%Y-%m-%d %H:%i:%s\u2019\n\u5e26\u6beb\u79d2\u7684\u65e5\u671f\nload data infile 'ftp:\/\/gbase:gbase@192.168.0.100\/\/opt\/ac08.txt' into table ac08 NULL_VALUE '\\N' fields terminated by ',' ENCLOSED BY '\"' DATETIME FORMAT \u2018%Y-%m-%d %H:%i:%s.%f\u2019\n6\u3001\u67e5\u770b\u5f53\u524d\u52a0\u8f7d\u8fdb\u5ea6\nselect db_name,tb_name,IP,state,start_time,progress,total_size,loaded_size,loaded_records,skipped_records from information_schema.load_status order by db_name,tb_name;\nselect tb_name,IP,state,ELAPSED_TIME,avg_speed,progress,total_size,loaded_size from information_schema.load_status order by avg_speed;\n7\u3001\u67e5\u770b\u5386\u53f2\u52a0\u8f7d\u7ed3\u679c\nselect task_id,db_name,tb_name,user,HOST_IP,start_time,end_time,elapsed_time,total_size,loaded_records,skipped_records from information_schema.load_result where start_time>'2020-07-26' order by start_time;\n8\u3001\u67e5\u770b\u8868\u3001\u5b58\u50a8\u8fc7\u7a0b\u3001\u51fd\u6570\nshow tables;\nshow tables like '%XXX%' ;\nshow function status;\nshow procedure status;\n9\u3001\u67e5\u770b\u8868\u3001\u51fd\u6570\u3001\u5b58\u50a8\u8fc7\u7a0b\u7ed3\u6784\nshow create table mytablename;\nshow create procedure myProc;\nshow create function myFunc;\n10\u3001\u67e5\u770b\u53d8\u91cf\nshow variables like '%XXXX%';\n\u67e5\u770b\u72b6\u6001\nshow status like '%meminfo%';\n12\u3001\u67e5\u770b\u67d0\u4e2a\u8868\u5360\u7528\u7684\u7a7a\u95f4\nselect * from information_schema.cluster_tables a where table_schema='testdb' and table_name='t1';\n\u67e5\u770b\u6bcf\u4e2a\u5206\u7247\u7684\u7a7a\u95f4\nselect * from information_schema.CLUSTER_TABLE_SEGMENTS a where table_schema='testdb' and table_name='t1';\n13\u3001\u5404\u79cd\u65e5\u5fd7\u4f4d\u7f6e\n\u670d\u52a1 \u8fdb\u7a0b\u540d\u5b57 \u9ed8\u8ba4\u65e5\u5fd7\u4f4d\u7f6e\ngcware corosync\n\u670d\u52a1\u542f\u505c\u65e5\u5fd7\uff0c\u53ea\u6709\u542f\u52a8\u548c\u505c\u6b62\u4fe1\u606f\nV8\u7248\u672c \u5b89\u88c5\u76ee\u5f55\/gcluster\/log\/gcluster\/corosync_system.log\nV9\u7248\u672c \u5b89\u88c5\u76ee\u5f55\/gcluster\/log\/gcluster\/gcware_system.log\n\u670d\u52a1\u8be6\u7ec6\u65e5\u5fd7\uff0c\u8be6\u7ec6\u7684\u542f\u52a8\u505c\u6b62\u4fe1\u606f\nV8\u7248\u672c \/var\/log\/corosync.log\nV9\u7248\u672c \u5b89\u88c5\u76ee\u5f55\/gcware\/log\/gcware.log\ngcadmin\u547d\u4ee4\u6267\u884c\u65e5\u5fd7\nV8\u7248\u672c \/var\/log\/gcware\/gcware_XXXX.log\nV9\u7248\u672c \u5b89\u88c5\u76ee\u5f55\/gcware\/liblog\/gcware.log\ngcluster gclusterd\n\u5b89\u88c5\u76ee\u5f55\/gcluster\/log\/gcluster\/system.log \u542f\u505c\u65e5\u5fd7\n\u5b89\u88c5\u76ee\u5f55\/gcluster\/log\/gcluster\/express.log \u5f15\u64ce\u65e5\u5fd7\n\u5b89\u88c5\u76ee\u5f55\/gcluster\/log\/gcluster\/gclusterd.log \u901a\u7528\u65e5\u5fd7\uff0c\u8bb0\u5f55\u53ef\u6267\u884c\u7684SQL\u547d\u4ee4\n\u5b89\u88c5\u76ee\u5f55\/gcluster\/log\/gcluster\/gclusterd-audit.log \u5ba1\u8ba1\u65e5\u5fd7\uff0c\u8bb0\u5f55\u6240\u6709\u547d\u4ee4\u6267\u884c\u7ed3\u679c\ngnode gbased \u5b89\u88c5\u76ee\u5f55\/gnode\/log\/gbase\/system.log\u542f\u505c\u65e5\u5fd7\n\u5b89\u88c5\u76ee\u5f55\/gnode\/log\/gbase\/express.log\u5f15\u64ce\u65e5\u5fd7\nsyncserver gc_sync_server\n\u5b89\u88c5\u76ee\u5f55\/gnode\/log\/gbase\/syncserver.log \u670d\u52a1\u65e5\u5fd7\n\u5b89\u88c5\u76ee\u5f55\/gnode\/log\/gbase\/ syncclient_XXXX.log \u5ba2\u6237\u7aef\u65e5\u5fd7\ngcrecover\n\u5b89\u88c5\u76ee\u5f55\/gclusger\/log\/gcluster\/ gc_recover.log \u8c03\u5ea6\u65e5\u5fd7\n\u5b89\u88c5\u76ee\u5f55\/gclusger\/log\/gcluster\/gcrecover_taskrecord.log \u540c\u6b65\u8bb0\u5f55\n\u5b89\u88c5\u76ee\u5f55\/gclusger\/log\/gcluster\/gcrecover_system.log \u542f\u505c\u65e5\u5fd7\ngcmonit \u5b89\u88c5\u76ee\u5f55\/gclusger\/log\/gcluster\/gcmonit.log \u8fdb\u7a0b\u76d1\u63a7\ngcmmonit \u5b89\u88c5\u76ee\u5f55\/gclusger\/log\/gcluster\/gcmmonit.log \u8fdb\u7a0b\u76d1\u63a7\u7684\u76d1\u63a7<\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5357\u5927\u901a\u7528GBase 8a\u6570\u636e\u5e93\u96c6\u7fa4\uff0c\u63d0\u4f9b\u4e86\u591a\u79cd\u8fd0\u7ef4\u76d1\u63a7\u7528\u7684\u547d\u4ee4\uff0c\u7528\u6765\u67e5\u770b\u5f53\u524d\u96c6\u7fa4\u8fd0\u884c\u72b6\u6001\u662f\u5426\u5f02\u5e38\u3002\u4e5f\u63d0\u4f9b\u4e86\u7b80\u5355\u7684\u5bfc\u5165\u548c\u5bfc\u51fa\u65b9\u6848\u3002\u672c\u6587\u6c47\u603b\u4e86\u5728\u73b0\u573a\u8fd0\u7ef4\u4eba\u5458\u6700\u7ecf\u5e38\u4f7f\u7528\u7684\u547d\u4ee4\u6c47\u603b\u3002<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[28],"class_list":["post-657","post","type-post","status-publish","format-standard","hentry","category-gbase8a","tag-28"],"_links":{"self":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/657","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/comments?post=657"}],"version-history":[{"count":30,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/657\/revisions"}],"predecessor-version":[{"id":12799,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/657\/revisions\/12799"}],"wp:attachment":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/media?parent=657"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/categories?post=657"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/tags?post=657"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}