1、问题描述,启动azkaban的时候报如下所示的错误。之前使用azkaban是root用户,今天使用hadoop用户进行配置和使用,报这个错,说是root连接mysql拒绝了。
[hadoop@slaver1 azkaban-web-2.5.]$ bin/azkaban-web-start.sh
Using Hadoop from /home/hadoop/soft/hadoop-2.5.-cdh5.3.6
Using Hive from /home/hadoop/soft/hive-0.13.-cdh5.3.6
bin/..
:bin/../lib/azkaban-2.5..jar:bin/../lib/commons-collections-3.2..jar:bin/../lib/commons-configuration-1.8.jar:bin/../lib/commons-dbcp-1.4.jar:bin/../lib/commons-dbutils-1.5.jar:bin/../lib/commons-email-1.2.jar:bin/../lib/commons-fileupload-1.2..jar:bin/../lib/commons-io-2.4.jar:bin/../lib/commons-jexl-2.1..jar:bin/../lib/commons-lang-2.6.jar:bin/../lib/commons-logging-1.1..jar:bin/../lib/commons-pool-1.6.jar:bin/../lib/guava-13.0..jar:bin/../lib/h2-1.3..jar:bin/../lib/httpclient-4.2..jar:bin/../lib/httpcore-4.2..jar:bin/../lib/jackson-core-asl-1.9..jar:bin/../lib/jackson-mapper-asl-1.9..jar:bin/../lib/jetty-6.1..jar:bin/../lib/jetty-util-6.1..jar:bin/../lib/joda-time-2.0.jar:bin/../lib/jopt-simple-4.3.jar:bin/../lib/junit-4.8.jar:bin/../lib/log4j-1.2..jar:bin/../lib/mail-1.4..jar:bin/../lib/mysql-connector-java-5.1..jar:bin/../lib/servlet-api-2.5.jar:bin/../lib/slf4j-api-1.6..jar:bin/../lib/slf4j-log4j12-1.6..jar:bin/../lib/velocity-1.7.jar:bin/../lib/velocity-tools-2.0.jar:bin/../extlib/*.jar:bin/../plugins/*/*.jar:/home/hadoop/soft/hadoop-2.5.-cdh5.3.6/conf:/home/hadoop/soft/hadoop-2.5.-cdh5.3.6/*:/home/hadoop/soft/hive-0.13.1-cdh5.3.6/conf:/home/hadoop/soft/hive-0.13.1-cdh5.3.6/lib/*
[hadoop@slaver1 azkaban-web-2.5.0]$ 2018/05/17 16:47:29.976 +0800 ERROR [AzkabanWebServer] [Azkaban] Starting Jetty Azkaban Executor...
2018/05/17 16:47:30.021 +0800 INFO [AzkabanServer] [Azkaban] Loading azkaban settings file from bin/../conf
2018/05/17 16:47:30.022 +0800 INFO [AzkabanServer] [Azkaban] Loading azkaban properties file
2018/05/17 16:47:30.067 +0800 INFO [AzkabanWebServer] [Azkaban] Setting up Jetty Https Server with port:8443 and numThreads:25
2018/05/17 16:47:30.135 +0800 INFO [log] [Azkaban] Logging to org.slf4j.impl.Log4jLoggerAdapter(org.mortbay.log) via org.mortbay.log.Slf4jLog
2018/05/17 16:47:30.247 +0800 INFO [AzkabanWebServer] [Azkaban] Loading user manager class azkaban.user.XmlUserManager
2018/05/17 16:47:30.690 +0800 INFO [XmlUserManager] [Azkaban] Loading user azkaban
2018/05/17 16:47:30.696 +0800 INFO [XmlUserManager] [Azkaban] Loading user metrics
2018/05/17 16:47:30.696 +0800 INFO [XmlUserManager] [Azkaban] Loading user admin
org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Access denied for user 'root'@'slaver1' (using password: YES))
at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549)
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
at azkaban.database.DataSourceUtils$MySQLBasicDataSource$MonitorThread.pingDB(DataSourceUtils.java:186)
at azkaban.database.DataSourceUtils$MySQLBasicDataSource$MonitorThread.run(DataSourceUtils.java:174)
Caused by: java.sql.SQLException: Access denied for user 'root'@'slaver1' (using password: YES)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1086)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4237)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4169)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:928)
at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:4736)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1342)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2493)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2526)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2311)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:834)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:416)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:347)
at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1556)
at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545)
... 4 more
Exception in thread "main" azkaban.executor.ExecutorManagerException: Error fetching active flows
at azkaban.executor.JdbcExecutorLoader.fetchActiveFlows(JdbcExecutorLoader.java:209)
at azkaban.executor.ExecutorManager.loadRunningFlows(ExecutorManager.java:146)
at azkaban.executor.ExecutorManager.<init>(ExecutorManager.java:84)
at azkaban.webapp.AzkabanWebServer.loadExecutorManager(AzkabanWebServer.java:248)
at azkaban.webapp.AzkabanWebServer.<init>(AzkabanWebServer.java:185)
at azkaban.webapp.AzkabanWebServer.main(AzkabanWebServer.java:726)
Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Access denied for user 'root'@'slaver1' (using password: YES))
at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549)
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
at org.apache.commons.dbutils.AbstractQueryRunner.prepareConnection(AbstractQueryRunner.java:175)
at org.apache.commons.dbutils.QueryRunner.query(QueryRunner.java:304)
at azkaban.executor.JdbcExecutorLoader.fetchActiveFlows(JdbcExecutorLoader.java:202)
... 5 more
Caused by: java.sql.SQLException: Access denied for user 'root'@'slaver1' (using password: YES)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1086)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4237)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4169)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:928)
at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:4736)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1342)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2493)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2526)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2311)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:834)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:416)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:347)
at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1556)
at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545)
... 10 more
2018/05/17 16:47:31.374 +0800 ERROR [DataSourceUtils] [Azkaban] MySQL connection test failed. Please check MySQL connection health!
^C
[hadoop@slaver1 azkaban-web-2.5.0]$ org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Access denied for user 'root'@'slaver1' (using password: YES))
at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549)
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
at azkaban.database.DataSourceUtils$MySQLBasicDataSource$MonitorThread.pingDB(DataSourceUtils.java:186)
at azkaban.database.DataSourceUtils$MySQLBasicDataSource$MonitorThread.run(DataSourceUtils.java:174)
Caused by: java.sql.SQLException: Access denied for user 'root'@'slaver1' (using password: YES)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1086)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4237)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4169)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:928)
at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:4736)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1342)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2493)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2526)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2311)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:834)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:416)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:347)
at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1556)
at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545)
... 4 more
2018/05/17 16:48:01.382 +0800 ERROR [DataSourceUtils] [Azkaban] MySQL connection test failed. Please check MySQL connection health!
2、解决方法如下所示:登陆你的mysql,然后授予权限,然后再刷新权限即可。
参考:https://blog.csdn.net/shp5174/article/details/55259064
[hadoop@slaver1 ~]$ mysql -uroot -p123456
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 5.1. Source distribution Copyright (c) , , Oracle and/or its affiliates. All rights reserved. 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> GRANT ALL ON *.* to 'root'@'%' IDENTIFIED BY '123456';
Query OK, rows affected (0.00 sec) mysql> FLUSH PRIVILEGES;
Query OK, rows affected (0.00 sec) mysql>
3、解决完问题以后,运行如下所示:
[hadoop@slaver1 azkaban-web-2.5.]$ bin/azkaban-web-start.sh
Using Hadoop from /home/hadoop/soft/hadoop-2.5.-cdh5.3.6
Using Hive from /home/hadoop/soft/hive-0.13.-cdh5.3.6
bin/..
:bin/../lib/azkaban-2.5..jar:bin/../lib/commons-collections-3.2..jar:bin/../lib/commons-configuration-1.8.jar:bin/../lib/commons-dbcp-1.4.jar:bin/../lib/commons-dbutils-1.5.jar:bin/../lib/commons-email-1.2.jar:bin/../lib/commons-fileupload-1.2..jar:bin/../lib/commons-io-2.4.jar:bin/../lib/commons-jexl-2.1..jar:bin/../lib/commons-lang-2.6.jar:bin/../lib/commons-logging-1.1..jar:bin/../lib/commons-pool-1.6.jar:bin/../lib/guava-13.0..jar:bin/../lib/h2-1.3..jar:bin/../lib/httpclient-4.2..jar:bin/../lib/httpcore-4.2..jar:bin/../lib/jackson-core-asl-1.9..jar:bin/../lib/jackson-mapper-asl-1.9..jar:bin/../lib/jetty-6.1..jar:bin/../lib/jetty-util-6.1..jar:bin/../lib/joda-time-2.0.jar:bin/../lib/jopt-simple-4.3.jar:bin/../lib/junit-4.8.jar:bin/../lib/log4j-1.2..jar:bin/../lib/mail-1.4..jar:bin/../lib/mysql-connector-java-5.1..jar:bin/../lib/servlet-api-2.5.jar:bin/../lib/slf4j-api-1.6..jar:bin/../lib/slf4j-log4j12-1.6..jar:bin/../lib/velocity-1.7.jar:bin/../lib/velocity-tools-2.0.jar:bin/../extlib/*.jar:bin/../plugins/*/*.jar:/home/hadoop/soft/hadoop-2.5.-cdh5.3.6/conf:/home/hadoop/soft/hadoop-2.5.-cdh5.3.6/*:/home/hadoop/soft/hive-0.13.1-cdh5.3.6/conf:/home/hadoop/soft/hive-0.13.1-cdh5.3.6/lib/*
[hadoop@slaver1 azkaban-web-2.5.0]$ 2018/05/17 17:10:33.069 +0800 ERROR [AzkabanWebServer] [Azkaban] Starting Jetty Azkaban Executor...
2018/05/17 17:10:33.096 +0800 INFO [AzkabanServer] [Azkaban] Loading azkaban settings file from bin/../conf
2018/05/17 17:10:33.096 +0800 INFO [AzkabanServer] [Azkaban] Loading azkaban properties file
2018/05/17 17:10:33.119 +0800 INFO [AzkabanWebServer] [Azkaban] Setting up Jetty Https Server with port:8443 and numThreads:25
2018/05/17 17:10:33.150 +0800 INFO [log] [Azkaban] Logging to org.slf4j.impl.Log4jLoggerAdapter(org.mortbay.log) via org.mortbay.log.Slf4jLog
2018/05/17 17:10:33.218 +0800 INFO [AzkabanWebServer] [Azkaban] Loading user manager class azkaban.user.XmlUserManager
2018/05/17 17:10:33.280 +0800 INFO [XmlUserManager] [Azkaban] Loading user azkaban
2018/05/17 17:10:33.289 +0800 INFO [XmlUserManager] [Azkaban] Loading user metrics
2018/05/17 17:10:33.289 +0800 INFO [XmlUserManager] [Azkaban] Loading user admin
2018/05/17 17:10:33.722 +0800 INFO [AzkabanWebServer] [Azkaban] Loading JDBC for project management
2018/05/17 17:10:33.726 +0800 INFO [ExecutorManager] [Azkaban] Cleaning old logs from execution_logs
2018/05/17 17:10:33.737 +0800 INFO [ProjectManager] [Azkaban] Project version retention is set to 3
2018/05/17 17:10:33.872 +0800 INFO [ExecutorManager] [Azkaban] Cleaning old log files before 2018-02-22T17:10:33.753+08:00
2018/05/17 17:10:33.874 +0800 INFO [ExecutorManager] [Azkaban] Cleaned up 0 log entries.
2018/05/17 17:10:33.950 +0800 INFO [TriggerManager] [Azkaban] TriggerManager loaded.
2018/05/17 17:10:33.950 +0800 INFO [AzkabanWebServer] [Azkaban] Loading built-in checker and action types
2018/05/17 17:10:33.967 +0800 INFO [CheckerTypeLoader] [Azkaban] Registering checker BasicTimeChecker
2018/05/17 17:10:33.968 +0800 INFO [CheckerTypeLoader] [Azkaban] Registering checker SlaChecker
2018/05/17 17:10:33.968 +0800 INFO [CheckerTypeLoader] [Azkaban] Registering checker ExecutionChecker
2018/05/17 17:10:33.968 +0800 INFO [ActionTypeLoader] [Azkaban] Registering action ExecuteFlowAction
2018/05/17 17:10:33.968 +0800 INFO [ActionTypeLoader] [Azkaban] Registering action KillExecutionAction
2018/05/17 17:10:33.968 +0800 INFO [ActionTypeLoader] [Azkaban] Registering action AlertAction
2018/05/17 17:10:33.968 +0800 INFO [ActionTypeLoader] [Azkaban] Registering action CreateTriggerAction
2018/05/17 17:10:33.968 +0800 INFO [AzkabanWebServer] [Azkaban] Loading trigger based scheduler
2018/05/17 17:10:33.973 +0800 INFO [AzkabanWebServer] [Azkaban] Loading plug-in checker and action types
2018/05/17 17:10:33.973 +0800 ERROR [AzkabanWebServer] [Azkaban] plugin path plugins/triggers doesn't exist!
2018/05/17 17:10:33.974 +0800 INFO [AzkabanWebServer] [Azkaban] Setting timezone to Asia/Shanghai
2018/05/17 17:10:33.974 +0800 INFO [AzkabanWebServer] [Azkaban] Registering MBeans...
2018/05/17 17:10:34.028 +0800 INFO [AzkabanWebServer] [Azkaban] Bean azkaban.jmx.JmxJettyServer registered.
2018/05/17 17:10:34.038 +0800 INFO [AzkabanWebServer] [Azkaban] Bean azkaban.jmx.JmxTriggerManager registered.
2018/05/17 17:10:34.049 +0800 INFO [AzkabanWebServer] [Azkaban] Bean azkaban.jmx.JmxExecutorManager registered.
2018/05/17 17:10:34.055 +0800 INFO [AzkabanWebServer] [Azkaban] Setting up web resource dir web/
2018/05/17 17:10:34.179 +0800 INFO [JdbcTriggerLoader] [Azkaban] Loading all triggers from db.
2018/05/17 17:10:34.226 +0800 INFO [JdbcTriggerLoader] [Azkaban] Loaded 0 triggers.
2018/05/17 17:10:34.227 +0800 INFO [log] [Azkaban] jetty-6.1.26
2018/05/17 17:10:34.515 +0800 INFO [log] [Azkaban] Started [email protected]:8443
2018/05/17 17:10:34.516 +0800 INFO [AzkabanWebServer] [Azkaban] Server running on ssl port 8443. [hadoop@slaver1 azkaban-web-2.5.0]$