Mycat启动出现的报错字段及解决方法
Mycat报错案例
案例一
- Unable to start JVM: No such file or directory出现找不到或开启不了JVM报错时,其实就是程序在$PATH相对路径下找不到java的启动路径
#报错开启不了JVM
[root@localhost bin]# tail -fn 20 /usr/local/mycat/logs/wrapper.log
STATUS | wrapper | 2022/12/09 11:39:10 | --> Wrapper Started as Daemon
STATUS | wrapper | 2022/12/09 11:39:10 | Launching a JVM...
ERROR | wrapper | 2022/12/09 11:39:10 | Unable to start JVM: No such file or directory (2)
ERROR | wrapper | 2022/12/09 11:39:10 | JVM exited while loading the application.
STATUS | wrapper | 2022/12/09 11:39:15 | Launching a JVM...
ERROR | wrapper | 2022/12/09 11:39:15 | Unable to start JVM: No such file or directory (2)
ERROR | wrapper | 2022/12/09 11:39:15 | JVM exited while loading the application.
STATUS | wrapper | 2022/12/09 11:39:19 | Launching a JVM...
ERROR | wrapper | 2022/12/09 11:39:19 | Unable to start JVM: No such file or directory (2)
ERROR | wrapper | 2022/12/09 11:39:19 | JVM exited while loading the application.
STATUS | wrapper | 2022/12/09 11:39:23 | Launching a JVM...
ERROR | wrapper | 2022/12/09 11:39:23 | Unable to start JVM: No such file or directory (2)
ERROR | wrapper | 2022/12/09 11:39:23 | JVM exited while loading the application.
STATUS | wrapper | 2022/12/09 11:39:27 | Launching a JVM...
ERROR | wrapper | 2022/12/09 11:39:27 | Unable to start JVM: No such file or directory (2)
ERROR | wrapper | 2022/12/09 11:39:27 | JVM exited while loading the application.
FATAL | wrapper | 2022/12/09 11:39:27 | There were 5 failed launches in a row, each lasting less than 300 seconds. Giving up.
FATAL | wrapper | 2022/12/09 11:39:27 | There may be a configuration problem: please check the logs.
STATUS | wrapper | 2022/12/09 11:39:27 | <-- Wrapper Stopped#在$PATH下没有java相对路径
[root@localhost bin]# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
[root@localhost bin]#
[root@localhost bin]# /usr/java/jdk1.8.0_131/bin/java -version
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
[root@localhost bin]# #把路径添加到PATH
[root@localhost bin]# export PATH=$PATH:/usr/java/jdk1.8.0_131/bin
[root@localhost bin]# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/usr/java/jdk1.8.0_131/bin
[root@localhost bin]#
案例二
- Caused by: java.net.ConnectException: 拒绝连接 (Connection refused) 因Mycat刚部署完成不知道哪个是Master哪个是Slave所以出现这个报错。
- 所以需要修改Mycat的datasource目录下的配置文件,需要指定主库创建并授权的用户、密码、主从库的IP地址、端口、原型数据库、实例类型才能连接到主从库中
[root@localhost bin]# tail -fn 20 /usr/local/mycat/logs/wrapper.log
INFO | jvm 1 | 2022/12/09 12:11:09 | at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
INFO | jvm 1 | 2022/12/09 12:11:09 | at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61)
INFO | jvm 1 | 2022/12/09 12:11:09 | at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105)
INFO | jvm 1 | 2022/12/09 12:11:09 | at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151)
INFO | jvm 1 | 2022/12/09 12:11:09 | at com.mysql.cj.exceptions.ExceptionFactory.createCommunicationsException(ExceptionFactory.java:167)
INFO | jvm 1 | 2022/12/09 12:11:09 | at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:89)
INFO | jvm 1 | 2022/12/09 12:11:09 | at com.mysql.cj.NativeSession.connect(NativeSession.java:144)
INFO | jvm 1 | 2022/12/09 12:11:09 | at com.mysql.cj.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:847)
INFO | jvm 1 | 2022/12/09 12:11:09 | ... 7 common frames omitted
INFO | jvm 1 | 2022/12/09 12:11:09 | Caused by: java.net.ConnectException: 拒绝连接 (Connection refused)
INFO | jvm 1 | 2022/12/09 12:11:09 | at java.net.PlainSocketImpl.socketConnect(Native Method)
INFO | jvm 1 | 2022/12/09 12:11:09 | at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
INFO | jvm 1 | 2022/12/09 12:11:09 | at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
INFO | jvm 1 | 2022/12/09 12:11:09 | at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
INFO | jvm 1 | 2022/12/09 12:11:09 | at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
INFO | jvm 1 | 2022/12/09 12:11:09 | at java.net.Socket.connect(Socket.java:589)
INFO | jvm 1 | 2022/12/09 12:11:09 | at com.mysql.cj.protocol.StandardSocketFactory.connect(StandardSocketFactory.java:155)
INFO | jvm 1 | 2022/12/09 12:11:09 | at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:63)
INFO | jvm 1 | 2022/12/09 12:11:09 | ... 9 common frames omitted
STATUS | wrapper | 2022/12/09 12:11:10 | <-- Wrapper Stopped
案例三
[ERROR]com.alibaba.druid.pool.D
ruidDataSource.run:2803create connection SQLException, url: jdbc:mysql://192.168.100.112/mycat?s
erverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&autoReconnect=true, errorCod
- 以上报错字段因MySQL主库中的root用户授权是localhost导致的 ,把在主库中把root用户的授权由localhost改为 ‘%’ ;mycat才能通过root账号连上MySQL
[root@localhost logs]# more wrapper.log
STATUS | wrapper | 2022/12/09 17:09:23 | --> Wrapper Started as Daemon
STATUS | wrapper | 2022/12/09 17:09:23 | Launching a JVM...
INFO | jvm 1 | 2022/12/09 17:09:23 | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.
org
INFO | jvm 1 | 2022/12/09 17:09:23 | Copyright 1999-2006 Tanuki Software, Inc. All Right
s Reserved.
INFO | jvm 1 | 2022/12/09 17:09:23 |
INFO | jvm 1 | 2022/12/09 17:09:24 | path:/usr/local/mycat/./conf
INFO | jvm 1 | 2022/12/09 17:09:24 | 2022-12-09 17:09:24,409[INFO]com.alibaba.druid.pool.Dr
uidDataSource.init:990{dataSource-1} inited
INFO | jvm 1 | 2022/12/09 17:09:27 | 2022-12-09 17:09:27,418[WARN]com.alibaba.druid.pool.Dr
uidDataSource.getConnectionDirect:1424get connection timeout retry : 1
INFO | jvm 1 | 2022/12/09 17:09:28 | 2022-12-09 17:09:28,612[ERROR]com.alibaba.druid.pool.D
ruidDataSource.run:2803create connection SQLException, url: jdbc:mysql://192.168.100.112/mycat?s
erverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&autoReconnect=true, errorCod
e 0, state 08001
INFO | jvm 1 | 2022/12/09 17:09:28 | java.sql.SQLNonTransientConnectionException: Could notcreate connection to database server. Attempted reconnect 3 times. Giving up.
INFO | jvm 1 | 2022/12/09 17:09:28 | at com.mysql.cj.jdbc.exceptions.SQLError.createS
QLException(SQLError.java:110)
mysql> update mysql.user set host='%' where user='root';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0mysql> mysql> select user,host from mysql.user where user='root'\G
*************************** 1. row ***************************
user: root
host: %
1 row in set (0.12 sec)mysql>
案例四
cn.mycat.vertx.xa.impl.Xa
LogImpl.?:?java.sql.SQLException: XAER_RMERR: Fatal error occurred in the transaction branch - check your data for consistency
- 以上报错表示连接数据库的用户没有xa_recover_admin权限。
- 在数据库中对该用户重新授权即可
[root@localhost logs]# more wrapper.log
STATUS | wrapper | 2022/12/09 17:27:41 | --> Wrapper Started as Daemon
STATUS | wrapper | 2022/12/09 17:27:42 | Launching a JVM...
INFO | jvm 1 | 2022/12/09 17:27:42 | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.
org
INFO | jvm 1 | 2022/12/09 17:27:42 | Copyright 1999-2006 Tanuki Software, Inc. All Right
s Reserved.
INFO | jvm 1 | 2022/12/09 17:27:42 |
INFO | jvm 1 | 2022/12/09 17:27:42 | path:/usr/local/mycat/./conf
INFO | jvm 1 | 2022/12/09 17:27:43 | 2022-12-09 17:27:43,093[INFO]com.alibaba.druid.pool.Dr
uidDataSource.init:990{dataSource-1} inited
INFO | jvm 1 | 2022/12/09 17:27:43 | 2022-12-09 17:27:43,350[INFO]com.alibaba.druid.pool.Dr
uidDataSource.init:990{dataSource-2} inited
INFO | jvm 1 | 2022/12/09 17:27:44 | 2022-12-09 17:27:44,116[INFO]io.mycat.config.MycatRout
erConfigOps.recoveryXA:735readXARecoveryLog start
INFO | jvm 1 | 2022/12/09 17:27:44 | 2022-12-09 17:27:44,223[WARN]cn.mycat.vertx.xa.impl.Xa
LogImpl.?:?java.sql.SQLException: XAER_RMERR: Fatal error occurred in the transaction branch - c
heck your data for consistency
INFO | jvm 1 | 2022/12/09 17:27:44 | 2022-12-09 17:27:44,225[WARN]cn.mycat.vertx.xa.impl.Xa
LogImpl.?:?java.sql.SQLException: XAER_RMERR: Fatal error occurred in the transaction branch - c
heck your data for consistency
INFO | jvm 1 | 2022/12/09 17:27:44 | 2022-12-09 17:27:44,250[INFO]io.mycat.vertx.VertxMycat
Server.lambda$start$1:166Mycat Vertx server 2b4f2ad8-9919-4acf-b2ec-95accaf340e9 started up.
INFO | jvm 1 | 2022/12/09 17:27:44 | 2022-12-09 17:27:44,250[INFO]io.mycat.vertx.VertxMycat
Server.lambda$start$1:166Mycat Vertx server 11588fd2-fd63-4719-8c3f-392c99aea303 started up.
案例五
- 当在主库创建数据库、表和插入数据后,从库可以同步,但在客户端无法查看表内数据库;可正常查看表格式
- 出现这种情况可以通过重启mycat服务解决
mysql> select * from t1;
ERROR:
org.apache.calcite.runtime.CalciteContextException: At line 0, column 0: Object 't1' not found within 'discuz'
mysql> mysql> use discuz;
Database changed
mysql> desc t1;
+-------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+-------------+------+-----+---------+-------+
| id | int | YES | | NULL | |
| name | varchar(20) | YES | | NULL | |
| job | char(20) | YES | | NULL | |
+-------+-------------+------+-----+---------+-------+
3 rows in set (0.03 sec)mysql>[root@localhost logs]# /usr/local/mycat/bin/mycat restart
Stopping mycat2...
Stopped mycat2.
Starting mycat2...
[root@localhost logs]#
[root@sunlit5 ~]# mysql -h 192.168.100.111 -uroot -pAdmin@123 -P 8066
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 0
Server version: 5.7.33-mycat-2.0 MySQL Community Server - GPLCopyright (c) 2000, 2022, Oracle and/or its affiliates.Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql> show databases;
+--------------------+
| `Database` |
+--------------------+
| discuz |
| information_schema |
| mysql |
| performance_schema |
+--------------------+
4 rows in set (0.05 sec)mysql> use discuz;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -ADatabase changed
mysql> select * from t1;
+------+----------+------+
| id | name | job |
+------+----------+------+
| 1 | xiaoming | IT |
| 2 | xiaowang | IT |
+------+----------+------+
2 rows in set (0.02 sec)mysql>
案例六
[ERROR]com.alibaba.druid.pool.DruidDataSource.run:2803create connection SQLException, url: jdbc:mysql://192.168.100.112:3306/myca
t?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&autoReconnect=true, errorCode 0, state 08001
- 当mycat启动时出现该报错,表示MySQL中的时区与mycat的时区不一致,需要在MySQL中设置时区
- 时区设置完后,重启mycat即可
[root@localhost logs]# more wrapper.log
STATUS | wrapper | 2022/12/10 23:52:06 | --> Wrapper Started as Daemon
STATUS | wrapper | 2022/12/10 23:52:06 | Launching a JVM...
INFO | jvm 1 | 2022/12/10 23:52:07 | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
INFO | jvm 1 | 2022/12/10 23:52:07 | Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.
INFO | jvm 1 | 2022/12/10 23:52:07 |
INFO | jvm 1 | 2022/12/10 23:52:07 | path:/usr/local/mycat/./conf
INFO | jvm 1 | 2022/12/10 23:52:07 | 2022-12-10 23:52:07,788[INFO]com.alibaba.druid.pool.DruidDataSource.init:990{dataSource-1} inited
INFO | jvm 1 | 2022/12/10 23:52:10 | 2022-12-10 23:52:10,790[WARN]com.alibaba.druid.pool.DruidDataSource.getConnectionDirect:1424get connection timeout retry : 1
INFO | jvm 1 | 2022/12/10 23:52:12 | 2022-12-10 23:52:12,010[ERROR]com.alibaba.druid.pool.DruidDataSource.run:2803create connection SQLException, url: jdbc:mysql://192.168.100.112:3306/myca
t?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&autoReconnect=true, errorCode 0, state 08001
INFO | jvm 1 | 2022/12/10 23:52:12 | java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
INFO | jvm 1 | 2022/12/10 23:52:12 | at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:110)
INFO | jvm 1 | 2022/12/10 23:52:12 | at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
INFO | jvm 1 | 2022/12/10 23:52:12 | at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89)
INFO | jvm 1 | 2022/12/10 23:52:12 | at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63)
INFO | jvm 1 | 2022/12/10 23:52:12 | at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:73)
INFO | jvm 1 | 2022/12/10 23:52:12 | at com.mysql.cj.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:903)
INFO | jvm 1 | 2022/12/10 23:52:12 | at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:828)
INFO | jvm 1 | 2022/12/10 23:52:12 | at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:453)
INFO | jvm 1 | 2022/12/10 23:52:12 | at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:246)
INFO | jvm 1 | 2022/12/10 23:52:12 | at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:198)
mysql> set global time_zone='+8:00';
Query OK, 0 rows affected (0.00 sec)mysql> set time_zone='+8:00';
Query OK, 0 rows affected (0.00 sec)mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)mysql> select curtime();
+-----------+
| curtime() |
+-----------+
| 10:42:51 |
+-----------+
1 row in set (0.00 sec)mysql>
Mycat启动出现的报错字段及解决方法相关推荐
- mysql 启动服务1067_windows无法启动MySQL服务报错1067的解决方法
突然登陆MySQL时,出现禁止访问或者无法连接到数据库,回到服务,去打开wampmysqld ,发现 "windows无法启动MySQL服务 错误1067" ,死活启动不了,咋办? ...
- 1067 mysql_windows无法启动MySQL服务报错1067的解决方法
突然登陆MySQL时,出现禁止访问或者无法连接到数据库,回到服务,去打开wampmysqld ,发现 "windows无法启动MySQL服务 错误1067" ,死活启动不了,咋办? ...
- 启动3ds Max报 d3dx9_43.dll丢失 解决方法
d3dx9_43.dll文件与Microsoft DirectX关联.负责启动基于Windows的游戏和高级图形程序. 在360安全卫士上搜索了 DirectX 下载了这个修复工具 运行应用 点击修复 ...
- springboot无法启动,不报任何异常,解决方法如下
mvn clean install -Dmaven.test.skip=true 项目根目录下面,执行上面的命令,重新启动,OK了 执行上面的语句,会调用系统配置的maven,如果系统未配置,需要先配 ...
- Laravel-admin hasMany表单关联提交报错字段 无详细信息错误说明
问题:使用Laravel-admin后台管理系统,使用表单hasMany来进行关联管理 提交是报错 字段 解决方案: 将报错字段放入关联Model的$fillable中即可解决 记录一下 转载于: ...
- mysql 1058_MySQL数据库之mysql启动服务报1058错误的解决方法
本文主要向大家介绍了MySQL数据库之mysql启动服务报1058错误的解决方法 ,通过具体的内容向大家展现,希望对大家学习MySQL数据库有所帮助. 今天研究一个框架,数据库使用mysql,启动my ...
- mysql 1058_MySQL数据库之mysql启动服务报1058错误的解决方法
本文主要向大家介绍了MySQL数据库之mysql启动服务报1058错误的解决方法 ,通过具体的内容向大家展现,希望对大家学习MySQL数据库有所帮助. 今天研究一个框架,数据库使用mysql,启动my ...
- idea创建web项目运行报404错误_IDEA JavaWeb项目启动运行后出现404错误的解决方法...
404这个错误真的是一言难尽!不过大多是配置文件出错,认真修改还是可以的 1.web.xml配置错误: 默认首页没有写的,在web.xml添加一个就行(前提是你有jsp页面,名字不要写错): 比如这个 ...
- 启动Hyper-V报错0x80070057的解决方法
最近需要安装Docker,第一步就是要启动Hyper-V,然后第一步就遇到了错误. 系统: windows10 版本1607 在网上找过几种办法尝试: 方法一. 无法启动Hyper-V的解决方法: 1 ...
最新文章
- php catch e是什么,php try catch 中的catch(Exception $e) 中的Exception 有什么作用?
- python 测试字符串类型_【教程】如何用Python中的chardet去检测字符编码类型
- 40 WM配置-作业-确认(转储单TO确认)
- Play framework logging设置
- 2018年Java展望
- HashMap的工作原理--重点----数据结构示意图的理解
- MySQL事务学习总结
- druid-1.0.9 jar包 下载
- 王道训练营作业 C++
- GD32F103RC官方移植IAR
- HTML特殊符号表示方法
- 性能优化 之 节流(throttle)与防抖(debounce) vue 使用
- 小程序如何cdn加速服务器,小程序能用cdn加速吗
- 服务器打不开网页dns错误是怎么回事,DNS错误原因是什么 如何解决DNS错误【详细介绍】...
- ant design vue中分页器的使用注意事项
- mac 命令行安装软件
- Deblur-NeRF CVPR 2022
- 小米门卡协议加载失败_小米手机门禁卡空白卡开通步骤及写入激活方法
- sequence_loss_by_example()函数在Tensorflow2.x找不到
- python字符串的表示_python字符串的各种表达方式
热门文章
- 实时系统-调度算法和可调度分析
- 【无线通信模块】GPRS DTU不稳定和容易掉线原因
- airasia Superapp × HMS Core:便捷出行,悦享全程
- 给出语言无符号整数的文法
- 2021全球与中国低氮燃烧器市场现状及未来发展趋势
- jyzy noip模拟赛5.22-1,3
- git push error: RPC failed; HTTP 403 curl 22 The requested URL returned error: 403
- SOLIDWORKS Flow Simulation卡门涡街模拟
- 工具----7、浏览器攻击框架--(BeEF)
- 在gym的BipedalWalker-v2环境里面训练了agent