canal没有监听到mysql,缓存不能同步

在商品管理页面localhost:8081修改ID为10001商品price,打开页面localhost:8081/item/10001查询,price并没有更新,打开RESP.app查看10001的price数据也并没有更新。进入canal容器

docker exec -it canal bash,tail -f canal-server/logs/heima/heima.log查看运行日志发现at org.h2.jdbc.JdbcConnection.(JdbcConnection.java:116) ~[h2-1.4.196.jar:1.4.196]
        at org.h2.jdbc.JdbcConnection.(JdbcConnection.java:100) ~[h2-1.4.196.jar:1.4.196]
        at org.h2.Driver.connect(Driver.java:69) ~[h2-1.4.196.jar:1.4.196]
        at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1657) ~[druid-1.2.6.jar:1.2.6]
        at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1723) ~[druid-1.2.6.jar:1.2.6]
        at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2801) ~[druid-1.2.6.jar:1.2.6]
Caused by: java.lang.IllegalStateException: Reading from nio:/home/admin/canal-server/conf/heima/h2.mv.db failed; file length 421888 read length 1024 at 423954 [1.4.196/1]

  at org.h2.mvstore.Cursor.next(Cursor.java:50) ~[h2-1.4.196.jar:1.4.196]
        at org.h2.mvstore.MVStore.loadChunkMeta(MVStore.java:695) ~[h2-1.4.196.jar:1.4.196]
        at org.h2.mvstore.MVStore.readStoreHeader(MVStore.java:675) ~[h2-1.4.196.jar:1.4.196]
        at org.h2.mvstore.MVStore.(MVStore.java:358) ~[h2-1.4.196.jar:1.4.196]
        at org.h2.mvstore.MVStore$Builder.open(MVStore.java:2930) ~[h2-1.4.196.jar:1.4.196]
        at org.h2.mvstore.db.MVTableEngine$Store.open(MVTableEngine.java:155) ~[h2-1.4.196.jar:1.4.196]
        ... 17 common frames omitted
Caused by: java.io.EOFException: null
        at org.h2.mvstore.DataUtils.readFully(DataUtils.java:423) ~[h2-1.4.196.jar:1.4.196]
        ... 36 common frames omitted

重命名/home/admin/canal-server/conf/heima/h2.mv.db文件mv  h2.mv.db ./h3.mv.db

重新修改ID10001price,访问ocalhost:8081/item/10001,发现价格更新了,打开RESP.app发现10001的price也更新了,并且昨天晚上在RESP.app删除的ID也删除了,昨天晚上显示的只是在删除的ID后面标上删除字样,并没有在库里面删除,查看运行项目服务控制台有\006\020\f\032\005brand \000(\0000\000B\006RIMOWAR\fvarchar(100)\nG\b\a\020\f\032\004spec \000(\0000\000B\'{\"\351\242\234\350\211\262\": \"\347\272\242\350\211\262\", \"\345\260\272\347\240\201\": \"26\345\257\270\"}R\fvarchar(200)\n\035\b\b\020\004\032\006status \000(\0000\000B\0011R\006int(1)\n6\b\t\020]\032\vcreate_time \000(\0000\000B\0232019-05-01 00:00:00R\bdatetime\n6\b\n\020]\032\vupdate_time \000(\0000\000B\0232019-05-01 
entryType: ROWDATA
storeValue: "\bl\020\002P\000b\352\n\n*\b\000\020\373\377\377\377\377\377\377\377\377\001\032\002id \001(\0000\000B\00510001R\nbigint(20)\nd\b\001\020\f\032\005title \000(\0000\000BCRIMOWA 21\345\257\270\346\211\230\350\277\220\347\256\261\346\213\211\346\235\206\347\256\261 SALSA AIR\347\263\273\345\210\227\346\236\234\347\273\277\350\211\262 820.70.36.4R\fvarchar(264)\n)\b\002\020\f\032\004name \000(\0000\000B\tSALSA AIRR\fvarchar(128)\n-\b\003\020\373\377\377\377\377\377\377\377\377\001\032\005price \000(\0000\000B\00510020R\nbigint(20)\n\226\001\b\004\020\f\032\005image \000(\0000\000Buhttps://m.360buyimg.com/mobilecms/s720x720_jfs/t6934/364/1195375010/84676/e9f2c55f/597ece38N0ddcbc77.jpg!q70.jpg.webpR\fvarchar(200)\n-\b\005\020\f\032\bcategory \000(\0000\000B\t\346\213\211\346\235\206\347\256\261R\fvarchar(200)\n\'\b\006\020\f\032\005brand \000(\0000\000B\006RIMOWAR\fvarchar(100)\nG\b\a\020\f\032\004spec \000(\0000\000B\'{\"\351\242\234\350\211\262\": \"\347\272\242\350\211\262\", \"\345\260\272\347\240\201\": \"26\345\257\270\"}R\fvarchar(200)\n\035\b\b\020\004\032\006status \000(\0000\000B\0011R\006int(1)\n6\b\t\020]\032\vcreate_time \000(\0000\000B\0232019-05-01 00:00:00R\bdatetime\n6\b\n\020]\032\vupdate_time \000(\0000\000B\0232019-05-01 00:00:00R\bdatetime\022*\b\000\020\373\377\377\377\377\377\377\377\377\001\032\002id \001(\0000\000B\00510001R\nbigint(20)\022d\b\001\020\f\032\005title \000(\0000\000BCRIMOWA 21\345\257\270\346\211\230\350\277\220\347\256\261\346\213\211\346\235\206\347\256\261 SALSA AIR\347\263\273\345\210\227\346\236\234\347\273\277\350\211\262 820.70.36.4R\fvarchar(264)\022)\b\002\020\f\032\004name \000(\0000\000B\tSALSA AIRR\fvarchar(128)\022-\b\003\020\373\377\377\377\377\377\377\377\377\001\032\005price \000(\0010\000B\00511020R\nbigint(20)\022\226\001\b\004\020\f\032\005image \000(\0000\000Buhttps://m.360buyimg.com/mobilecms/s720x720_jfs/t6934/364/1195375010/84676/e9f2c55f/597ece38N0ddcbc77.jpg!q70.jpg.webpR\fvarchar(200)\022-\b\005\020\f\032\bcategory \000(\0000\000B\t\346\213\211\346\235\206\347\256\261R\fvarchar(200)\022\'\b\006\020\f\032\005brand \000(\0000\000B\006RIMOWAR\fvarchar(100)\022G\b\a\020\f\032\004spec \000(\0000\000B\'{\"\351\242\234\350\211\262\": \"\347\272\242\350\211\262\", \"\345\260\272\347\240\201\": \"26\345\257\270\"}R\fvarchar(200)\022\035\b\b\020\004\032\006status \000(\0000\000B\0011R\006int(1)\0226\b\t\020]\032\vcreate_time \000(\0000\000B\0232019-05-01 00:00:00R\bdatetime\0226\b\n\020]\032\vupdate_time \000(\0000\000B\0232019-05-01 00:00:00R\bdatetime"
],raw=false,rawEntries=[]]
15:40:33:408  INFO 20224 --- [l-client-thread] t.j.c.client.client.AbstractCanalClient  : 获取消息 Message[id=20,entries=[header {
  version: 1
  logfileName: "mysql-bin.000009"
  logfileOffset: 988
  serverId: 1000
  serverenCode: "UTF-8"
  executeTime: 1681917892000
  sourceType: MYSQL
  schemaName: ""
  tableName: ""
  eventLength: 31
}
entryType: TRANSACTIONEND
storeValue: "\022\003103"
],raw=false,rawEntries=[]]

昨天晚上测试失败的时候控制台一直显示

16:10:47:693  INFO 20224 --- [l-client-thread] t.j.c.client.client.AbstractCanalClient  : 获取消息 Message[id=-1,entries=[],raw=false,rawEntries=[]]
16:10:48:695  INFO 20224 --- [l-client-thread] t.j.c.client.client.AbstractCanalClient  : 获取消息 Message[id=-1,entries=[],raw=false,rawEntries=[]]
....和上面一样重复的内容

你可能感兴趣的:(java,服务器)