azkaban icon indicating copy to clipboard operation
azkaban copied to clipboard

Start azkaban exec server got error ERROR MySQLDataSource:103

Open FrommyMind opened this issue 6 years ago • 9 comments

In my conf/azkaban.properties the mysql configuration info as below. database.type=mysql mysql.port=3306 mysql.host=dnode04 mysql.database=azkaban mysql.user=azkaban mysql.password=password mysql.numconnections=100

but when I try start azkaban exec server , I got error 2018-04-17 10:39:13 ERROR MySQLDataSource:103 - Failed to find write-enabled DB connection. Wait 15 seconds and retry. No.Attempt = 1 java.sql.SQLException: Cannot create PoolableConnectionFactory (Access denied for user 'azkaban'@'dnode02' (using password: YES)) at org.apache.commons.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:2294) at org.apache.commons.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:2039) at azkaban.db.MySQLDataSource.getConnection(MySQLDataSource.java:76) at org.apache.commons.dbutils.AbstractQueryRunner.prepareConnection(AbstractQueryRunner.java:175) at org.apache.commons.dbutils.QueryRunner.query(QueryRunner.java:286) at azkaban.db.DatabaseOperator.query(DatabaseOperator.java:68) at azkaban.executor.ExecutorDao.fetchExecutor(ExecutorDao.java:63) at azkaban.executor.JdbcExecutorLoader.fetchExecutor(JdbcExecutorLoader.java:273) at azkaban.execapp.AzkabanExecutorServer.insertExecutorEntryIntoDB(AzkabanExecutorServer.java:265) at azkaban.execapp.AzkabanExecutorServer.start(AzkabanExecutorServer.java:243) at azkaban.execapp.AzkabanExecutorServer.launch(AzkabanExecutorServer.java:153) at azkaban.execapp.AzkabanExecutorServer.main(AzkabanExecutorServer.java:149)

It try to use dnode02 which my azkanban exec server installed on .

Yes, I have start azkaban exec server with the configuration mysql.host=localhost, but even I modified the properties, It doesn't work.

FrommyMind avatar Apr 17 '18 02:04 FrommyMind

please type host localhost, and let me know what it returns.

kunkun-tang avatar Apr 17 '18 06:04 kunkun-tang

This error is azkaban can't communicate with mysql, Even if you set user:azkaban can remote login already. I got this erro too when I installed mysql by yum. change DB to maria-db fix it.

step-1 linux shell> vi /etc/yum.repos.d/MariaDB.repo #MariaDB.repo [mariadb] name = MariaDB baseurl =http://yum.mariadb.org/10.2/centos7-amd64 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1 step-2 linux shell>yum install MariaDB-server MariaDB-client -y linux shell>systemctl start mariadb linux shell>systemctl enable mariadb step-3 linux shell>mysql mysql> CREATE USER'azkaban'@'%'IDENTIFIED BY 'azkaban'; mysql> GRANT SELECT,INSERT,UPDATE,DELETE ONazkaban.* to 'azkaban'@'%' WITH GRANT OPTION; mysql> use azkaban step-4 mysql> source/software/azkaban-master/azkaban-db/build/sql/create-all-sql-0.1.0-SNAPSHOT.sql mysql> insert into executors(host,port)values("ip1 or hostname1",12321); mysql> insert into executors(host,port)values("ip2 or hostname2",12321);

step-5(important) mysql> update executos set active=1;

now ,restart azkaban-web-server and azkaban-executor-server. Wish you success.

You can refer to the installation part of DB in my microblog. https://blog.csdn.net/weixin_39445556/article/details/79944117

RoryLiuwenxuan avatar Apr 17 '18 09:04 RoryLiuwenxuan

@kunkun-tang
here is the result

[root@dnode02 ~]# host localhost
localhost has address 127.0.0.1
Host localhost not found: 2(SERVFAIL)
Host localhost not found: 2(SERVFAIL)

@RoryLiuwenxuan

My DB is MariaDB

Server version: 5.5.56-MariaDB MariaDB Server

FrommyMind avatar Apr 17 '18 12:04 FrommyMind

can you login mysql by execut “mysql -hyourIP -uazkabanUser -pazkabanPassWord”,if you can’t,please try my way. A few minutes of trying to change a chance of success. good luck

RoryLiuwenxuan avatar Apr 17 '18 14:04 RoryLiuwenxuan

@RoryLiuwenxuan

[root@dnode02 ~]# mysql -h10.1.49.100 -uazkaban -pazkaban

Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 323 Server version: 5.5.52-MariaDB MariaDB Server

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>

I mean it just try to connect local db not the one I configured in azkaban.properties

FrommyMind avatar Apr 18 '18 00:04 FrommyMind

There must be something wrong with the database connection. Are you able to see any errors from Mysql Server logs?

kunkun-tang avatar Apr 23 '18 04:04 kunkun-tang

Hi @RoryLiuwenxuan,

Quick question, did you remember to run flush privileges after adding the azkaban user to mariadb? It's usually required when updating grant statements to flush the internal caches. More info can be found here: https://mariadb.com/kb/en/library/flush/

Thanks

li-afaris avatar May 23 '18 01:05 li-afaris

Happened to me recently. I was using MySQL engine 8.0.15, changed to 5.7.21 and it works now.

porthunt avatar Aug 06 '19 09:08 porthunt

Happened to me recently. I was using MySQL engine 8.0.15, changed to 5.7.21 and it works now.

you can go to the directory azkaban/azkaban-exec-server/build/install/azkaban-exec-server/lib, delete the mysql-connector-java-5.1.28.jar and add the mysql-connector-java-8.0.22.jar, then restart exec server process, it works! try it out.

dgqypl avatar May 24 '21 08:05 dgqypl