{"id":5654,"date":"2023-10-10T11:04:18","date_gmt":"2023-10-10T03:04:18","guid":{"rendered":"https:\/\/nj.transwarp.cn:8180\/?p=5654"},"modified":"2023-10-10T11:04:17","modified_gmt":"2023-10-10T03:04:17","slug":"sophon%e7%9a%84%e7%9b%b8%e5%85%b3%e8%a7%92%e8%89%b2%e6%97%a5%e5%bf%97%e6%8a%a5%e9%94%99could-not-acquire-change-log-lock","status":"publish","type":"post","link":"https:\/\/kbwp.transwarp.cn\/?p=5654","title":{"rendered":"sophon\u7684\u76f8\u5173\u89d2\u8272\u65e5\u5fd7\u62a5\u9519:\u201cCould not acquire change log lock\u201d"},"content":{"rendered":"<h3>\u6982\u8981\u63cf\u8ff0<\/h3>\n<hr \/>\n<p>Sophon\u7ec4\u4ef6\u7684\u4e00\u4e9b\u89d2\u8272pod\u8fd0\u884c\u4e0d\u6b63\u5e38\u3002<\/p>\n<p><strong>\u8868\u73b0\u5982\u4e0b:<\/strong><\/p>\n<p>1.<code>kubectl get pod -owide|grep apimanager<\/code>\u53d1\u73b0pod\u72b6\u6001\u662f0\/1\u6216\u80051\/1\uff0cpod\u5904\u4e8ecrashloopbackoff\u6216\u8005running\u72b6\u6001\uff0c\u5e76\u4e14\u4e00\u76f4\u5728\u4e0d\u65ad\u91cd\u542f\u3002<\/p>\n<pre><code class=\"language-shell\">apimanager-sophon1-3790167053-rqq1b                         1\/1       Running             154        18h<\/code><\/pre>\n<p>2.pod\u65e5\u5fd7\u5982\u4e0b:<\/p>\n<pre><code class=\"language-shell\">[root@node23 ~]# kubectl logs -f apimanager-sophon1-3790167053-rqq1b\n\n  .   ____          _            __ _ _\n \/\\\\ \/ ___'_ __ _ _(_)_ __  __ _ \\ \\ \\ \\\n( ( )\\___ | '_ | '_| | '_ \\\/ _` | \\ \\ \\ \\\n \\\\\/  ___)| |_)| | | | | || (_| |  ) ) ) )\n  '  |____| .__|_| |_|_| |_\\__, | \/ \/ \/ \/\n =========|_|==============|___\/=\/_\/_\/_\/\n :: Spring Boot ::       (v1.5.16.RELEASE)\n\nJul 12, 2019 4:27:27 AM org.apache.catalina.core.StandardService startInternal\nINFO: Starting service [Tomcat]\nJul 12, 2019 4:27:27 AM org.apache.catalina.core.StandardEngine startInternal\nINFO: Starting Servlet Engine: Apache Tomcat\/8.5.34\nJul 12, 2019 4:27:27 AM org.apache.catalina.core.ApplicationContext log\nINFO: Initializing Spring embedded WebApplicationContext\nJul 12, 2019 4:32:45 AM org.apache.catalina.core.StandardService stopInternal<\/code><\/pre>\n<ol start=\"3\">\n<li>\u540e\u53f0\u67e5\u770b\u5bf9\u5e94\u4e0d\u6b63\u5e38\u7684\u89d2\u8272(\u5728apimanager\u3001sharesever\u3001base\u3001resource\u90fd\u6709\u53d1\u751f)\uff0c\u5728\u89d2\u8272\u5bf9\u5e94\u8282\u70b9\u7684\/var\/log\/sophonX\/\u4e0b \u7684\u65e5\u5fd7\u62a5\u9519\u5982\u4e0b\uff0c\u67e5\u770b pod\u65e5\u5fd7\u4e5f\u6709\u53ef\u80fd\u76f4\u63a5\u770b\u5230\u8fd9\u4e2a\u62a5\u9519\u3002<\/li>\n<\/ol>\n<pre><code class=\"language-shell\">ERROR boot.SpringApplication (SpringApplication.java:reportFailure(771)) - Application startup failed org.springframework.beans.factory.BeanCreationException: \nError creating bean with name 'liquibase' defined in class path resource [org\/springframework\/boot\/autoconfigure\/liquibase\/LiquibaseAutoConfiguration$LiquibaseConfiguration.class]: \nInvocation of init method failed; nested exception is liquibase.exception.LockException: Could not acquire change log lock. Currently locked by zzd170000dsj30 (10.192.67.30) since 5\/10\/20 8:35 PM<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/nj.transwarp.cn:8180\/wp-content\/uploads\/2021\/03\/image-1617183306428.png\" alt=\"file\" \/><\/p>\n<h3>\u8be6\u7ec6\u8bf4\u660e<\/h3>\n<hr \/>\n<h4>\u95ee\u9898\u539f\u56e0:<\/h4>\n<p>pod\u542f\u52a8\u65f6\u521b\u5efadb table\u88ab\u4e2d\u65ad\uff0c change log lock\u6ca1\u6709\u91ca\u653e\u3002\u7531\u4e8e\u6bcf\u6b21\u91cd\u542f\u90fd\u4f1a\u7ee7\u7eed\u521b\u5efa\u4e4b\u524d\u6ca1\u6709\u6267\u884c\u5b8c\u7684db\u64cd\u4f5c\uff0c\u8fd9\u6837\u5c31\u4f1a\u56e0\u4e3alog\u6ca1\u91ca\u653e\u800c\u4e0d\u80fd\u6267\u884c\uff0c\u4f7f\u5f97\u6bcf\u6b21\u91cd\u542f\u90fd\u5931\u8d25\u3002\u4f46deployment\u7684\u5b58\u5728\uff0c\u4f7f\u5176\u4e00\u76f4\u91cd\u542f\uff0c\u76f4\u5230\u542f\u52a8\u6210\u529f\u3002<\/p>\n<p>\u8fdb\u5165txsql\u5143\u6570\u636e\u5e93\uff0c\u6267\u884c<\/p>\n<pre><code class=\"language-sql\">use metastore_\u300a\u5f02\u5e38\u89d2\u8272\u300b_sophonX;\nSELECT * FROM DATABASECHANGELOGLOCK WHERE ID=1;<\/code><\/pre>\n<p>\u65f6\uff0c\u53d1\u73b0LOCKED\u4e3atrue<br \/>\n<img decoding=\"async\" src=\"https:\/\/nj.transwarp.cn:8180\/wp-content\/uploads\/2021\/03\/image-1617188856678.png\" alt=\"file\" \/><\/p>\n<h4>\u89e3\u51b3\u529e\u6cd5<\/h4>\n<ol>\n<li>\u4f7f\u7528\u4e0b\u9762\u547d\u4ee4\u8fdb\u5165txsql\u6570\u636e\u5e93\n<pre><code class=\"language-shell\">[root@jiujiu-tdh-70 ~]# txsql_masterIp=<code>kubectl exec -it $(kubectl get po -o wide | grep -i txsql-server-txsql | grep -i running | grep -E &quot;1\\\/1&quot; | awk &#039;{print $1}&#039; | head -1) -- \/usr\/bin\/txsql\/tools\/txsql.sh list master | grep -iE &quot;get.*master&quot; | grep -Eo &quot;([0-9]+\\.){3}[0-9]+&quot;<\/code>\n[root@jiujiu-tdh-70 ~]#\n[root@jiujiu-tdh-70 ~]# kubectl exec -it $(kubectl get po -o wide | grep -i txsql-server-txsql | grep -w $txsql_masterIp | awk '{print $1}') -- \/usr\/bin\/txsql\/tools\/txsql.sh shell<\/code><\/pre>\n<\/li>\n<li>\n<p>\u8fdb\u5165<strong>\u5f02\u5e38\u89d2\u8272<\/strong>\u7684\u5e93\uff0c\u6267\u884c\u4e0b\u9762\u7684SQL\u6765\u53d6\u6d88\u9501\u3002<\/p>\n<pre><code class=\"language-sql\">UPDATE DATABASECHANGELOGLOCK SET LOCKED=FALSE, LOCKGRANTED=null, LOCKEDBY=null where ID=1;<\/code><\/pre>\n<p>\u4ee5apimanager\u4e3a\u4f8b\uff0c\u5176\u4ed6\u89d2\u8272\u5f02\u5e38\u5219\u8fdb\u5165\u5bf9\u5e94\u7684\u5e93\u4e2d\u3002<\/p>\n<pre><code class=\"language-shell\">mysql> use  metastore_apimanager_sophon1;\nDatabase changed\nmysql> UPDATE DATABASECHANGELOGLOCK SET LOCKED=FALSE, LOCKGRANTED=null, LOCKEDBY=null where ID=1;<\/code><\/pre>\n<p>3.\u91cd\u542f\u6545\u969c\u7684\u89d2\u8272\u3002<br \/>\n\u9875\u9762\u4e0a\u5148\u505c\u6b62\u518d\u542f\u52a8\u89d2\u8272\uff0c\u6216\u8005\u547d\u4ee4\u6267\u884c<code>kubectl delete po &lt;\u5bf9\u5e94\u89d2\u8272\u7684podname&gt;<\/code>\u4e5f\u53ef\u4ee5\u3002<\/p>\n<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>\u6982\u8981\u63cf\u8ff0 Sophon\u7ec4\u4ef6\u7684\u4e00\u4e9b\u89d2\u8272pod\u8fd0\u884c\u4e0d\u6b63\u5e38\u3002 \u8868\u73b0\u5982\u4e0b: 1.kubectl get pod -ow ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/kbwp.transwarp.cn\/?p=5654\" title=\"read more...\">Read more<\/a><\/p>\n","protected":false},"author":17,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5654","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"acf":[],"_links":{"self":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/5654","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\/17"}],"replies":[{"embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5654"}],"version-history":[{"count":4,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/5654\/revisions"}],"predecessor-version":[{"id":10923,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/5654\/revisions\/10923"}],"wp:attachment":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5654"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5654"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5654"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}