报错1: could not retrieve transation read-only status server
2021-08-19T15:26:46,042 INFO [HiveServer2-Handler-Pool: Thread-110] metastore.ObjectStore: Retriable exception while instantiating ObjectStore, retrying. 9 tries left
javax.jdo.JDODataStoreException: Could not retrieve transaction read-only status from server
at org.datanucleus.api.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:543) ~[datanucleus-api-jdo-4.2.1.jar:?]
at org.datanucleus.api.jdo.JDOPersistenceManager.getDataStoreConnection(JDOPersistenceManager.java:2275) ~[datanucleus-api-jdo-4.2.1.jar:?]
at org.apache.hadoop.hive.metastore.MetaStoreDirectSql.getProductName(MetaStoreDirectSql.java:210) ~[hive-exec-2.1.0.2.6.3.0-235.jar:2.1.0.2.6.3.0-235]
...
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_181]
Caused by: java.sql.SQLException: Could not retrieve transaction read-only status from server
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:965) ~[mysql-connector-java.jar:5.1.45]
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:898) ~[mysql-connector-java.jar:5.1.45]
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:887) ~[mysql-connector-java.jar:5.1.45]
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:861) ~[mysql-connector-java.jar:5.1.45]
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:878) ~[mysql-connector-java.jar:5.1.45]
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:874) ~[mysql-connector-java.jar:5.1.45]
at com.mysql.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:3552) ~[mysql-connector-java.jar:5.1.45]
at com.mysql.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:3521) ~[mysql-connector-java.jar:5.1.45]
at com.jolbox.bonecp.ConnectionHandle.isReadOnly(ConnectionHandle.java:867) ~[bonecp-0.8.0.RELEASE.jar:?]
at org.datanucleus.store.rdbms.ConnectionFactoryImpl$ManagedConnectionImpl.getConnection(ConnectionFactoryImpl.java:406) ~[datanucleus-rdbms-4.1.7.jar:?]
at org.datanucleus.store.rdbms.RDBMSStoreManager.getNucleusConnection(RDBMSStoreManager.java:1357) ~[datanucleus-rdbms-4.1.7.jar:?]
at org.datanucleus.api.jdo.JDOPersistenceManager.getDataStoreConnection(JDOPersistenceManager.java:2263) ~[datanucleus-api-jdo-4.2.1.jar:?]
解决
升级mysql-connector版本:由mysql-connector-java-5.1.45-bin.jar 升级为 mysql-connector-java-8.0.25.jar