HDP SQLException : SQL state: HY000 java.sql.SQLException: null, message from server:
全部错误:
2020-08-29 00:38:52,849 [JISQL] /usr/java/current/bin/java -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-connector-java.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://ambari.wanfeng16899.com/ranger -u 'rangeradmin' -p '********' -noheader -trim -c \; -query "select 1;" Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary. SQLException : SQL state: HY000 java.sql.SQLException: null, message from server: "Host '192.168.0.182' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'" ErrorCode: 1129 2020-08-29 00:38:53,132 [E] Can't establish connection!! Exiting.. 2020-08-29 00:38:53,132 [I] Please run DB setup first or contact Administrator..
提示,mysql-connector-java.jar包过期,因为我MySQL用的5.7版本,mysql-connector-java.jar用的8.0版本导致不匹配,更换即可。找到所有路径进行替换
[root@ambari ~]# find / -name mysql-connector-java.jar
find: ‘/proc/2455/task/15094’: No such file or directory
/var/lib/ambari-server/resources/mysql-connector-java.jar
/usr/share/java/mysql-connector-java.jar
/usr/hdp/3.1.4.0-315/ranger-admin/ews/lib/mysql-connector-java.jar