{"id":9041,"date":"2022-11-29T11:48:41","date_gmt":"2022-11-29T03:48:41","guid":{"rendered":"https:\/\/nj.transwarp.cn:8180\/?p=9041"},"modified":"2022-11-29T12:14:42","modified_gmt":"2022-11-29T04:14:42","slug":"txsql-%e8%bf%9e%e6%8e%a5%e6%95%b0%e6%bb%a1%e4%ba%86%e5%af%bc%e8%87%b4%e6%9c%8d%e5%8a%a1%e5%bc%82%e5%b8%b8%e7%9a%84%e6%8e%92%e6%9f%a5%e5%92%8c%e8%a7%a3%e5%86%b3%e5%8a%9e%e6%b3%95","status":"publish","type":"post","link":"https:\/\/kbwp.transwarp.cn\/?p=9041","title":{"rendered":"TxSQL \u8fde\u63a5\u6570\u6ee1\u4e86\u5bfc\u81f4\u670d\u52a1\u5f02\u5e38\u7684\u6392\u67e5\u548c\u89e3\u51b3\u529e\u6cd5"},"content":{"rendered":"<h3>\u6982\u8981\u63cf\u8ff0<\/h3>\n<p>\u672c\u6587\u4e3b\u8981\u63cf\u8ff0 TxSQL \u8fde\u63a5\u6570\u6ee1\u4e86\u5bfc\u81f4\u670d\u52a1\u5f02\u5e38\u7684\u6392\u67e5\u548c\u89e3\u51b3\u529e\u6cd5\u3002<\/p>\n<h3>\u8be6\u7ec6\u8bf4\u660e<\/h3>\n<h4>\u95ee\u9898\u73b0\u8c61<\/h4>\n<p>TxSQL \u6240\u6709 pod \u5747\u4e3a 0\/1 \u65f6\u53ef\u80fd\u4f1a\u662f\u672c\u6587\u63cf\u8ff0\u7684\u60c5\u51b5\u3002<\/p>\n<h4>\u6392\u67e5\u6b65\u9aa4<\/h4>\n<p>\u91c7\u7528\u5982\u4e0b\u65b9\u5f0f\u6392\u67e5\u662f\u5426\u4e3a TxSQL \u8fde\u63a5\u6570\u6ee1\u4e86\u5bfc\u81f4\uff1a<\/p>\n<p>1\u3001\u786e\u5b9a TxSQL pod<\/p>\n<p>\u4efb\u610f\u8282\u70b9\u6267\u884c\uff1a<\/p>\n<pre><code class=\"language-bash\">kubectl get po -owide | grep txsql1<\/code><\/pre>\n<p>\u770b\u5230\u7684\u4e09\u4e2a\u7ed3\u679c\u5373\u4e3a3\u4e2a TxSQL pod<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/nj.transwarp.cn:8180\/wp-content\/uploads\/2022\/11\/image-1669692240056.png\" alt=\"file\" \/><\/p>\n<p>2\u3001\u786e\u5b9a TxSQL Master \u8282\u70b9<\/p>\n<p>\u6839\u636e\u4e0a\u4e00\u6b65\u7ed3\u679c\uff0c\u6267\u884c\uff1a<\/p>\n<pre><code class=\"language-bash\">kubectl exec -it {\u4e0a\u4e00\u6b65\u4efb\u610fpod\u7b2c\u4e00\u5217} -- \/usr\/bin\/txsql\/tools\/txsql.sh list | head -n 1 | awk '{print $3}'<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/nj.transwarp.cn:8180\/wp-content\/uploads\/2022\/11\/image-1669692550732.png\" alt=\"file\" \/><\/p>\n<p>\u5f97\u5230\u7684\u7ed3\u679c\u662f master \u7684 IP \u5730\u5740\uff0c\u5982\u4e0a\u56fe\u7684 172.22.22.2 \uff0c\u518d\u6839\u636e\u4e0a\u4e00\u6b65\u7ed3\u679c\uff0c\u53ef\u4ee5\u5f97\u5230 master \u7684 pod \u540d\uff0c\u5373 <code>txsql-server-txsql1-6bffd78b48-qlfnh<\/code>\u3002<\/p>\n<p>3\u3001\u67e5\u770b\u6700\u5927\u8fde\u63a5\u6570\u914d\u7f6e<\/p>\n<p>\u6839\u636e\u4e0a\u4e00\u6b65\u7ed3\u679c\uff0c\u6267\u884c\uff1a<\/p>\n<pre><code class=\"language-bash\">kubectl exec -it {\u4e0a\u4e00\u6b65\u5f97\u5230\u7684Master pod\u540d} -- cat \/usr\/bin\/txsql\/etc\/phxsqlproxy.conf | grep Master<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/nj.transwarp.cn:8180\/wp-content\/uploads\/2022\/11\/image-1669692880283.png\" alt=\"file\" \/><\/p>\n<p>\u5f53\u524d\u7684\u6700\u5927\u8fde\u63a5\u6570\u4e3a<code>MasterWorkerThread<\/code>\u548c<code>MasterIORoutineCnt<\/code>\u7684\u4e58\u79ef\uff0c\u5982\u56fe\u5c31\u662f 5 * 100 \uff0c\u8868\u793a\u5f53\u524d\u6700\u5927\u8fde\u63a5\u6570\u4e3a500\u3002<\/p>\n<p>4\u3001\u67e5\u770b\u5f53\u524d Master \u7684\u8fde\u63a5\u6570<\/p>\n<p>\u6839\u636e\u7b2c2\u6b65\u7ed3\u679c\uff0c\u6267\u884c\uff1a<\/p>\n<pre><code class=\"language-bash\">kubectl exec -it {\u7b2c2\u6b65\u5f97\u5230\u7684Master pod\u540d} -- \/usr\/bin\/txsql\/tools\/txsql.sh localshell<\/code><\/pre>\n<p>\u8fd9\u6837\u53ef\u4ee5\u8fdb\u5165\u4e00\u4e2a MySQL shell<\/p>\n<p>\u7136\u540e\u6267\u884cSQL\uff1a<\/p>\n<pre><code class=\"language-sql\">show processlist;<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/nj.transwarp.cn:8180\/wp-content\/uploads\/2022\/11\/image-1669693284419.png\" alt=\"file\" \/><\/p>\n<p>\u5de6\u4e0b\u89d2\u5373\u4e3a\u5f53\u524d\u8fde\u63a5\u6570\uff0c\u5982\u5f53\u524d\u7684 501 \uff0c\u6bd4\u4e0a\u4e00\u6b65\u83b7\u53d6\u7684\u6700\u5927\u8fde\u63a5\u6570500\u66f4\u5927\u4e86\uff0c\u56e0\u6b64\u786e\u5b9a\u4e3a\u662f TxSQL \u8fde\u63a5\u6570\u8d85\u4e86\u5bfc\u81f4\u7684\u95ee\u9898\u3002<\/p>\n<h4>\u89e3\u51b3\u65b9\u6cd5<\/h4>\n<p>\u5982\u679c\u6839\u636e\u524d\u9762\u7684\u6392\u67e5\u6b65\u9aa4\u786e\u5b9a\u4e3a\u662f\u8fde\u63a5\u6570\u8d85\u4e86\u7684\u95ee\u9898\uff0c\u5219\u53ef\u4ee5\u91c7\u7528\u4ee5\u4e0b\u4e24\u79cd\u65b9\u6cd5\u89e3\u51b3\uff1a<\/p>\n<h5>1 \u627e\u5230\u5f53\u524d\u5360\u7528\u8f83\u591a\u7684\u8fde\u63a5\uff0c\u7ed3\u675f\u4f7f\u7528\u5b83\u7684\u8fdb\u7a0b\u6765\u91ca\u653e<\/h5>\n<p>\u5982\u6392\u67e5\u6b65\u9aa44\u4e2d\u622a\u56fe\uff0c\u53ef\u4ee5\u770b\u51fa\u662f Inceptor1 \u7684 Metastore \u5360\u7528\u4e86\u5f88\u591a\u8fde\u63a5\uff0c\u6b64\u65f6\u53ef\u4ee5\u901a\u8fc7\u91cd\u542f Inceptor1 \u7684Metastore\u89d2\u8272\u6765\u91ca\u653e\u6389\u8fd9\u4e9b\u8fde\u63a5\uff0c\u6062\u590d TxSQL\u3002<\/p>\n<h5>2 \u589e\u5927 TxSQL \u5141\u8bb8\u7684\u6700\u5927\u8fde\u63a5\u6570<\/h5>\n<p>\u5bf9\u6392\u67e5\u6b65\u9aa41\u4e2d\u7684\u6bcf\u4e2a TxSQL pod\uff0c\u5747\u4f5c\u5982\u6b64\u64cd\u4f5c\uff1a<\/p>\n<p>1\u3001\u8fdb\u5165 pod<\/p>\n<pre><code class=\"language-bash\">kubectl exec -it {pod\u540d} bash<\/code><\/pre>\n<p>2\u3001\u7f16\u8f91\u914d\u7f6e\u6587\u4ef6<\/p>\n<pre><code class=\"language-bash\">vi \/usr\/bin\/txsql\/etc\/phxsqlproxy.conf<\/code><\/pre>\n<p>\u589e\u5927<code>MasterWorkerThread<\/code>\u7684\u503c\uff0c\u6bd4\u5982\u60f3\u63d0\u9ad8\u6700\u5927\u8fde\u63a5\u6570\u5230 1000 \uff0c\u5c31\u4fee\u6539\u4e3a10\u3002<\/p>\n<p>\u6bcf\u4e2aTxSQL pod\u90fd\u505a\u4e86\u4ee5\u4e0a\u4e24\u6b65\u64cd\u4f5c\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7\u91cd\u542f TxSQL \u6765\u4f7f\u5176\u751f\u6548\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6982\u8981\u63cf\u8ff0 \u672c\u6587\u4e3b\u8981\u63cf\u8ff0 TxSQL \u8fde\u63a5\u6570\u6ee1\u4e86\u5bfc\u81f4\u670d\u52a1\u5f02\u5e38\u7684\u6392\u67e5\u548c\u89e3\u51b3\u529e\u6cd5\u3002 \u8be6\u7ec6\u8bf4\u660e \u95ee\u9898\u73b0\u8c61 TxSQL  ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/kbwp.transwarp.cn\/?p=9041\" title=\"read more...\">Read more<\/a><\/p>\n","protected":false},"author":81,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[50],"tags":[],"class_list":["post-9041","post","type-post","status-publish","format-standard","hentry","category-troubleshotting"],"acf":[],"_links":{"self":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/9041","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\/81"}],"replies":[{"embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9041"}],"version-history":[{"count":0,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/9041\/revisions"}],"wp:attachment":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9041"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9041"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9041"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}