{"id":2286,"date":"2022-11-29T10:51:57","date_gmt":"2022-11-29T02:51:57","guid":{"rendered":"https:\/\/nj.transwarp.cn:8180\/?p=2286"},"modified":"2022-11-29T10:51:57","modified_gmt":"2022-11-29T02:51:57","slug":"waterdrop%e7%a8%8b%e5%ba%8f%e6%97%a0%e6%b3%95%e5%b1%95%e5%bc%80%e6%95%b0%e6%8d%ae%e5%ba%93%e4%bf%a1%e6%81%af","status":"publish","type":"post","link":"https:\/\/kbwp.transwarp.cn\/?p=2286","title":{"rendered":"waterdrop\u7a0b\u5e8f\u65e0\u6cd5\u5c55\u5f00\u6570\u636e\u5e93\u4fe1\u606f"},"content":{"rendered":"<h3>\u73b0\u8c61<\/h3>\n<p>\u4f7f\u7528sql\u53ef\u4ee5show tables\u83b7\u53d6\u6570\u636e\u5e93\u8868\u4fe1\u606f\uff0c\u4f46\u662fwaterdrop\u70b9\u51fb\u6570\u636e\u5e93\u5c55\u5f00\u65f6\u62a5\u9519\uff0c\u62a5\u9519\u4e3a<code>system_link<\/code>\u4e2d\u65e0\u6cd5\u627e\u5230<code>views_v<\/code>;<\/p>\n<hr \/>\n<h3>\u6392\u67e5\u53ca\u4fee\u590d<\/h3>\n<p>txsql\u4e2d\u5b58\u653einceptor\u5143\u6570\u636e\uff0c\u8fdb\u5165\u540e\u53d1\u73b0\u786e\u5b9e\u7f3a\u5931\u4e86views_v\u89c6\u56fe\uff0c\u6000\u7591\u4e3a\u4eba\u5de5\u64cd\u4f5c\u662f\u5220\u9664<br \/>\n<br \/>\n1.\u67e5\u770btxsql\u7684pod\u540d\u79f0\u548c\u8282\u70b9<\/p>\n<pre><code>[root@amen01-7 ~]# kubectl get po -owide|grep txsql\ntxsql-server-txsql1-3329110420-868pb                        1\/1       Running   1          41d       172.22.39.9   amen03-9\ntxsql-server-txsql1-3329110420-bmwj7                        1\/1       Running   1          41d       172.22.39.7   amen01-7\ntxsql-server-txsql1-3329110420-zgjw5                        1\/1       Running   0          1d        172.22.39.8   amen02-8\n[root@amen01-7 ~]# <\/code><\/pre>\n<p>2.\u4ece\u4efb\u610fpod\u83b7\u53d6txsql\u4e3b\u8282\u70b9\uff0c\u4fee\u590d\u4ece\u4e3b\u8282\u70b9\u767b\u5f55txsql\u8fdb\u884c<\/p>\n<pre><code>[root@amen01-7 ~]# kubectl exec -it txsql-server-txsql1-3329110420-bmwj7 -c txsql-server-txsql1 -- \/usr\/bin\/txsql\/tools\/txsql.sh list\nget master 172.22.39.7 expire time 1581492299 Wed Feb 12 15:24:59 2020\nip 172.22.39.7 port 17000\nip 172.22.39.8 port 17000\nip 172.22.39.9 port 17000<\/code><\/pre>\n<p>3.\u4e3b\u8282\u70b9\u4e3a172.22.39.7\uff0c\u767b\u9646\u8be5\u8282\u70b9\u7684txsql<\/p>\n<pre><code>[root@amen01-7 ~]# kubectl exec -it txsql-server-txsql1-3329110420-bmwj7 -c txsql-server-txsql1 -- \/usr\/bin\/txsql\/tools\/txsql.sh \nWarning: Using a password on the command line interface can be insecure.\nWelcome to the MySQL monitor.  Commands end with ; or \\g.\nYour MySQL connection id is 939962\nServer version: 5.6.31-77.0-log Source distribution\n\nCopyright (c) 2009-2016 Percona LLC and\/or its affiliates\nCopyright (c) 2000, 2016, Oracle and\/or its affiliates. All rights reserved.\n\nOracle is a registered trademark of Oracle Corporation and\/or its\naffiliates. Other names may be trademarks of their respective\nowners.\n\nType 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.\n\nmysql> <\/code><\/pre>\n<p>4.\u5bf9\u4e8e\u672c\u4f8b\uff0c<code>metastore_inceptor1<\/code>\u5e93\u4e2d\u4e0d\u5b58\u5728\u89c6\u56fe<code>view_v<\/code>,\u4f7f\u7528sql\u91cd\u5efa\u8be5\u89c6\u56fe\uff1a<\/p>\n<pre><code>CREATE ALGORITHM=UNDEFINED DEFINER=<code>inceptoruser<\/code>@<code>%<\/code> SQL SECURITY DEFINER VIEW <code>views_v<\/code> AS select <code>tbls<\/code>.<code>TBL_ID<\/code> AS <code>view_id<\/code>,<code>tbls<\/code>.<code>TBL_NAME<\/code> AS <code>view_name<\/code>,<code>DBS<\/code>.<code>NAME<\/code> AS <code>database_name<\/code>,from_unixtime(<code>tbls<\/code>.<code>CREATE_TIME<\/code>) AS <code>create_time<\/code>,<code>tbls<\/code>.<code>VIEW_ORIGINAL_TEXT<\/code> AS <code>origin_text<\/code>,<code>tbls<\/code>.<code>VIEW_EXPANDED_TEXT<\/code> AS <code>expanded_text<\/code>,<code>tbls<\/code>.<code>OWNER<\/code> AS <code>owner_name<\/code> from ((<code>temp_view_v<\/code> <code>tbls<\/code> join <code>DBS<\/code> on((<code>tbls<\/code>.<code>DB_ID<\/code> = <code>DBS<\/code>.<code>DB_ID<\/code>))) join <code>SDS<\/code> on((<code>tbls<\/code>.<code>SD_ID<\/code> = <code>SDS<\/code>.<code>SD_ID<\/code>)));<\/code><\/pre>\n<p>5.\u9a8c\u8bc1waterdrop\u7a0b\u5e8f\u80fd\u5426\u6b63\u5e38\u5c55\u5f00\u6570\u636e\u5e93\u4fe1\u606f<\/p>\n<hr \/>\n<h3>\u9644\u5f55\uff1ametastore\u4e2d\u8868\u7684\u5173\u8054\u5173\u7cfb<\/h3>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2020\/02\/Snipaste_2020-02-12_15-31-34.png\" alt=\"\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u73b0\u8c61 \u4f7f\u7528sql\u53ef\u4ee5show tables\u83b7\u53d6\u6570\u636e\u5e93\u8868\u4fe1\u606f\uff0c\u4f46\u662fwaterdrop\u70b9\u51fb\u6570\u636e\u5e93\u5c55\u5f00\u65f6\u62a5\u9519\uff0c\u62a5\u9519\u4e3a ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/kbwp.transwarp.cn\/?p=2286\" title=\"read more...\">Read more<\/a><\/p>\n","protected":false},"author":21,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[38,39],"tags":[],"class_list":["post-2286","post","type-post","status-publish","format-standard","hentry","category-configuration","category-usage_issues"],"acf":[],"_links":{"self":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/2286","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/users\/21"}],"replies":[{"embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2286"}],"version-history":[{"count":0,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/2286\/revisions"}],"wp:attachment":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2286"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2286"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2286"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}