(Access denied for user 'root'@'slaver1' (using password: YES))

(Access denied for user 'root'@'slaver1' (using password: YES))

1、问题描述,启动azkaban的时候报如下所示的错误。之前使用azkaban是root用户,今天使用hadoop用户进行配置和使用,报这个错,说是root连接mysql拒绝了。

  1 [hadoop@slaver1 azkaban-web-2.5.0]$ bin/azkaban-web-start.sh 
  2 Using Hadoop from /home/hadoop/soft/hadoop-2.5.0-cdh5.3.6
  3 Using Hive from /home/hadoop/soft/hive-0.13.1-cdh5.3.6
  4 bin/..
  5 :bin/../lib/azkaban-2.5.0.jar:bin/../lib/commons-collections-3.2.1.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.1.jar:bin/../lib/commons-io-2.4.jar:bin/../lib/commons-jexl-2.1.1.jar:bin/../lib/commons-lang-2.6.jar:bin/../lib/commons-logging-1.1.1.jar:bin/../lib/commons-pool-1.6.jar:bin/../lib/guava-13.0.1.jar:bin/../lib/h2-1.3.170.jar:bin/../lib/httpclient-4.2.1.jar:bin/../lib/httpcore-4.2.1.jar:bin/../lib/jackson-core-asl-1.9.5.jar:bin/../lib/jackson-mapper-asl-1.9.5.jar:bin/../lib/jetty-6.1.26.jar:bin/../lib/jetty-util-6.1.26.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.16.jar:bin/../lib/mail-1.4.5.jar:bin/../lib/mysql-connector-java-5.1.28.jar:bin/../lib/servlet-api-2.5.jar:bin/../lib/slf4j-api-1.6.1.jar:bin/../lib/slf4j-log4j12-1.6.4.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.0-cdh5.3.6/conf:/home/hadoop/soft/hadoop-2.5.0-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/*
  6 [hadoop@slaver1 azkaban-web-2.5.0]$ 2018/05/17 16:47:29.976 +0800 ERROR [AzkabanWebServer] [Azkaban] Starting Jetty Azkaban Executor...
  7 2018/05/17 16:47:30.021 +0800 INFO [AzkabanServer] [Azkaban] Loading azkaban settings file from bin/../conf
  8 2018/05/17 16:47:30.022 +0800 INFO [AzkabanServer] [Azkaban] Loading azkaban properties file
  9 2018/05/17 16:47:30.067 +0800 INFO [AzkabanWebServer] [Azkaban] Setting up Jetty Https Server with port:8443 and numThreads:25
 10 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
 11 2018/05/17 16:47:30.247 +0800 INFO [AzkabanWebServer] [Azkaban] Loading user manager class azkaban.user.XmlUserManager
 12 2018/05/17 16:47:30.690 +0800 INFO [XmlUserManager] [Azkaban] Loading user azkaban
 13 2018/05/17 16:47:30.696 +0800 INFO [XmlUserManager] [Azkaban] Loading user metrics
 14 2018/05/17 16:47:30.696 +0800 INFO [XmlUserManager] [Azkaban] Loading user admin
 15 org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Access denied for user 'root'@'slaver1' (using password: YES))
 16     at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549)
 17     at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
 18     at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
 19     at azkaban.database.DataSourceUtils$MySQLBasicDataSource$MonitorThread.pingDB(DataSourceUtils.java:186)
 20     at azkaban.database.DataSourceUtils$MySQLBasicDataSource$MonitorThread.run(DataSourceUtils.java:174)
 21 Caused by: java.sql.SQLException: Access denied for user 'root'@'slaver1' (using password: YES)
 22     at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1086)
 23     at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4237)
 24     at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4169)
 25     at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:928)
 26     at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:4736)
 27     at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1342)
 28     at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2493)
 29     at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2526)
 30     at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2311)
 31     at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:834)
 32     at com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:47)
 33     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
 34     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
 35     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
 36     at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
 37     at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
 38     at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:416)
 39     at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:347)
 40     at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
 41     at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
 42     at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1556)
 43     at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545)
 44     ... 4 more
 45 Exception in thread "main" azkaban.executor.ExecutorManagerException: Error fetching active flows
 46     at azkaban.executor.JdbcExecutorLoader.fetchActiveFlows(JdbcExecutorLoader.java:209)
 47     at azkaban.executor.ExecutorManager.loadRunningFlows(ExecutorManager.java:146)
 48     at azkaban.executor.ExecutorManager.(ExecutorManager.java:84)
 49     at azkaban.webapp.AzkabanWebServer.loadExecutorManager(AzkabanWebServer.java:248)
 50     at azkaban.webapp.AzkabanWebServer.(AzkabanWebServer.java:185)
 51     at azkaban.webapp.AzkabanWebServer.main(AzkabanWebServer.java:726)
 52 Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Access denied for user 'root'@'slaver1' (using password: YES))
 53     at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549)
 54     at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
 55     at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
 56     at org.apache.commons.dbutils.AbstractQueryRunner.prepareConnection(AbstractQueryRunner.java:175)
 57     at org.apache.commons.dbutils.QueryRunner.query(QueryRunner.java:304)
 58     at azkaban.executor.JdbcExecutorLoader.fetchActiveFlows(JdbcExecutorLoader.java:202)
 59     ... 5 more
 60 Caused by: java.sql.SQLException: Access denied for user 'root'@'slaver1' (using password: YES)
 61     at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1086)
 62     at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4237)
 63     at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4169)
 64     at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:928)
 65     at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:4736)
 66     at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1342)
 67     at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2493)
 68     at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2526)
 69     at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2311)
 70     at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:834)
 71     at com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:47)
 72     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
 73     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
 74     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
 75     at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
 76     at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
 77     at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:416)
 78     at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:347)
 79     at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
 80     at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
 81     at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1556)
 82     at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545)
 83     ... 10 more
 84 2018/05/17 16:47:31.374 +0800 ERROR [DataSourceUtils] [Azkaban] MySQL connection test failed. Please check MySQL connection health!
 85 ^C
 86 [hadoop@slaver1 azkaban-web-2.5.0]$ org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Access denied for user 'root'@'slaver1' (using password: YES))
 87     at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549)
 88     at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
 89     at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
 90     at azkaban.database.DataSourceUtils$MySQLBasicDataSource$MonitorThread.pingDB(DataSourceUtils.java:186)
 91     at azkaban.database.DataSourceUtils$MySQLBasicDataSource$MonitorThread.run(DataSourceUtils.java:174)
 92 Caused by: java.sql.SQLException: Access denied for user 'root'@'slaver1' (using password: YES)
 93     at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1086)
 94     at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4237)
 95     at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4169)
 96     at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:928)
 97     at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:4736)
 98     at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1342)
 99     at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2493)
100     at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2526)
101     at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2311)
102     at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:834)
103     at com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:47)
104     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
105     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
106     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
107     at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
108     at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
109     at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:416)
110     at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:347)
111     at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
112     at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
113     at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1556)
114     at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545)
115     ... 4 more
116 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

 1 [hadoop@slaver1 ~]$ mysql -uroot -p123456
 2 Welcome to the MySQL monitor.  Commands end with ; or \g.
 3 Your MySQL connection id is 32
 4 Server version: 5.1.73 Source distribution
 5 
 6 Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
 7 
 8 Oracle is a registered trademark of Oracle Corporation and/or its
 9 affiliates. Other names may be trademarks of their respective
10 owners.
11 
12 Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
13 
14 mysql> GRANT ALL ON *.* to 'root'@'%' IDENTIFIED BY '123456';
15 Query OK, 0 rows affected (0.00 sec)
16 
17 mysql> FLUSH   PRIVILEGES;  
18 Query OK, 0 rows affected (0.00 sec)
19 
20 mysql> 

3、解决完问题以后,运行如下所示:

 1 [hadoop@slaver1 azkaban-web-2.5.0]$ bin/azkaban-web-start.sh 
 2 Using Hadoop from /home/hadoop/soft/hadoop-2.5.0-cdh5.3.6
 3 Using Hive from /home/hadoop/soft/hive-0.13.1-cdh5.3.6
 4 bin/..
 5 :bin/../lib/azkaban-2.5.0.jar:bin/../lib/commons-collections-3.2.1.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.1.jar:bin/../lib/commons-io-2.4.jar:bin/../lib/commons-jexl-2.1.1.jar:bin/../lib/commons-lang-2.6.jar:bin/../lib/commons-logging-1.1.1.jar:bin/../lib/commons-pool-1.6.jar:bin/../lib/guava-13.0.1.jar:bin/../lib/h2-1.3.170.jar:bin/../lib/httpclient-4.2.1.jar:bin/../lib/httpcore-4.2.1.jar:bin/../lib/jackson-core-asl-1.9.5.jar:bin/../lib/jackson-mapper-asl-1.9.5.jar:bin/../lib/jetty-6.1.26.jar:bin/../lib/jetty-util-6.1.26.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.16.jar:bin/../lib/mail-1.4.5.jar:bin/../lib/mysql-connector-java-5.1.28.jar:bin/../lib/servlet-api-2.5.jar:bin/../lib/slf4j-api-1.6.1.jar:bin/../lib/slf4j-log4j12-1.6.4.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.0-cdh5.3.6/conf:/home/hadoop/soft/hadoop-2.5.0-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/*
 6 [hadoop@slaver1 azkaban-web-2.5.0]$ 2018/05/17 17:10:33.069 +0800 ERROR [AzkabanWebServer] [Azkaban] Starting Jetty Azkaban Executor...
 7 2018/05/17 17:10:33.096 +0800 INFO [AzkabanServer] [Azkaban] Loading azkaban settings file from bin/../conf
 8 2018/05/17 17:10:33.096 +0800 INFO [AzkabanServer] [Azkaban] Loading azkaban properties file
 9 2018/05/17 17:10:33.119 +0800 INFO [AzkabanWebServer] [Azkaban] Setting up Jetty Https Server with port:8443 and numThreads:25
10 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
11 2018/05/17 17:10:33.218 +0800 INFO [AzkabanWebServer] [Azkaban] Loading user manager class azkaban.user.XmlUserManager
12 2018/05/17 17:10:33.280 +0800 INFO [XmlUserManager] [Azkaban] Loading user azkaban
13 2018/05/17 17:10:33.289 +0800 INFO [XmlUserManager] [Azkaban] Loading user metrics
14 2018/05/17 17:10:33.289 +0800 INFO [XmlUserManager] [Azkaban] Loading user admin
15 2018/05/17 17:10:33.722 +0800 INFO [AzkabanWebServer] [Azkaban] Loading JDBC for project management
16 2018/05/17 17:10:33.726 +0800 INFO [ExecutorManager] [Azkaban] Cleaning old logs from execution_logs
17 2018/05/17 17:10:33.737 +0800 INFO [ProjectManager] [Azkaban] Project version retention is set to 3
18 2018/05/17 17:10:33.872 +0800 INFO [ExecutorManager] [Azkaban] Cleaning old log files before 2018-02-22T17:10:33.753+08:00
19 2018/05/17 17:10:33.874 +0800 INFO [ExecutorManager] [Azkaban] Cleaned up 0 log entries.
20 2018/05/17 17:10:33.950 +0800 INFO [TriggerManager] [Azkaban] TriggerManager loaded.
21 2018/05/17 17:10:33.950 +0800 INFO [AzkabanWebServer] [Azkaban] Loading built-in checker and action types
22 2018/05/17 17:10:33.967 +0800 INFO [CheckerTypeLoader] [Azkaban] Registering checker BasicTimeChecker
23 2018/05/17 17:10:33.968 +0800 INFO [CheckerTypeLoader] [Azkaban] Registering checker SlaChecker
24 2018/05/17 17:10:33.968 +0800 INFO [CheckerTypeLoader] [Azkaban] Registering checker ExecutionChecker
25 2018/05/17 17:10:33.968 +0800 INFO [ActionTypeLoader] [Azkaban] Registering action ExecuteFlowAction
26 2018/05/17 17:10:33.968 +0800 INFO [ActionTypeLoader] [Azkaban] Registering action KillExecutionAction
27 2018/05/17 17:10:33.968 +0800 INFO [ActionTypeLoader] [Azkaban] Registering action AlertAction
28 2018/05/17 17:10:33.968 +0800 INFO [ActionTypeLoader] [Azkaban] Registering action CreateTriggerAction
29 2018/05/17 17:10:33.968 +0800 INFO [AzkabanWebServer] [Azkaban] Loading trigger based scheduler
30 2018/05/17 17:10:33.973 +0800 INFO [AzkabanWebServer] [Azkaban] Loading plug-in checker and action types
31 2018/05/17 17:10:33.973 +0800 ERROR [AzkabanWebServer] [Azkaban] plugin path plugins/triggers doesn't exist!
32 2018/05/17 17:10:33.974 +0800 INFO [AzkabanWebServer] [Azkaban] Setting timezone to Asia/Shanghai
33 2018/05/17 17:10:33.974 +0800 INFO [AzkabanWebServer] [Azkaban] Registering MBeans...
34 2018/05/17 17:10:34.028 +0800 INFO [AzkabanWebServer] [Azkaban] Bean azkaban.jmx.JmxJettyServer registered.
35 2018/05/17 17:10:34.038 +0800 INFO [AzkabanWebServer] [Azkaban] Bean azkaban.jmx.JmxTriggerManager registered.
36 2018/05/17 17:10:34.049 +0800 INFO [AzkabanWebServer] [Azkaban] Bean azkaban.jmx.JmxExecutorManager registered.
37 2018/05/17 17:10:34.055 +0800 INFO [AzkabanWebServer] [Azkaban] Setting up web resource dir web/
38 2018/05/17 17:10:34.179 +0800 INFO [JdbcTriggerLoader] [Azkaban] Loading all triggers from db.
39 2018/05/17 17:10:34.226 +0800 INFO [JdbcTriggerLoader] [Azkaban] Loaded 0 triggers.
40 2018/05/17 17:10:34.227 +0800 INFO [log] [Azkaban] jetty-6.1.26
41 2018/05/17 17:10:34.515 +0800 INFO [log] [Azkaban] Started [email protected]:8443
42 2018/05/17 17:10:34.516 +0800 INFO [AzkabanWebServer] [Azkaban] Server running on ssl port 8443.
43 
44 [hadoop@slaver1 azkaban-web-2.5.0]$ 

 

posted @ 2018-05-17 17:15 别先生 阅读( ...) 评论( ...) 编辑 收藏

你可能感兴趣的:((Access denied for user 'root'@'slaver1' (using password: YES)))