下载
链接
https://github.com/azkaban/azkaban/releases/4.0.0.tar.gz
解压
tar -xzvf 4.0.0.tar.gz -C 自定义目标目录
修改azkaban-4.0.0目录下的build.gradle文件
找到初始配置信息
maven{
url 'https://linkedin.bintray.com/maven'
}
进行修改
maven {
url 'https://linkedin.jfrog.io/artifactory/open-source/'
}
原有的仓库地址在国内访问会非常缓慢,甚至不能访问,造成编译过程报错。
修改 nodejs 相关配置
进入到/..../azkaban-4.0.0/azkaban-web-server目录中,打开build.gradle文件,将node选项中的download配置值设为false
node {
// Version of node to use.
version = '8.10.0'
// Version of npm to use.
npmVersion = '5.6.0'
// Base URL for fetching node distributions (change if you have a mirror).
distBaseUrl = 'https://nodejs.org/dist'
// If true, it will download node using above parameters.
// If false, it will try to use globally installed node.
download = false
// Set the work directory for unpacking node
workDir = file("${project.buildDir}/nodejs")
// Set the work directory where node_modules should be located
nodeModulesDir = file("${project.projectDir}")
}
如果不修改的话,azkaban在编译的过程中就会去下载 node-8.10.0,大概率会因为网络问题使下载失败,从而导致编译失败。
我们本机需要准备好node环境(笔者在编译的时候遇到过,node环境已经存在,但是提示 npm not found 的报错信息,尝试多次后无果,最后将虚拟机重启解决。)
修改azkaban-db代码,以支持Mysql8.X系列数据库
进入/..../azkaban-4.0.0/azkaban-db/src/main/java/azkaban/db目录,修改MySQLDataSource.java
@Inject
public MySQLDataSource(final Props props, final DBMetrics dbMetrics) {
super();
this.dbMetrics = dbMetrics;
final int port = props.getInt("mysql.port");
final String host = props.getString("mysql.host");
final String dbName = props.getString("mysql.database");
final String user = props.getString("mysql.user");
final String password = props.getString("mysql.password");
final int numConnections = props.getInt("mysql.numconnections");
//加上mysql的驱动类配置项,如果没有配置则默认是mysql5.x
//-----------------begin-----------------------
String driverName = props.getString("mysql.driverName");
if(driverName == null){
driverName = "com.mysql.jdbc.Driver";
}
//-----------------end-----------------------
final String url = "jdbc:mysql://" + (host + ":" + port + "/" + dbName);
addConnectionProperty("useUnicode", "yes");
addConnectionProperty("characterEncoding", "UTF-8");
//setDriverClassName(com.mysql.jdbc.Driver);
//修改成从配置中读取驱动类名
addConnectionProperty("useSSL", "false");
setDriverClassName(driverName);
setUsername(user);
setPassword(password);
setUrl(url);
setMaxTotal(numConnections);
setValidationQuery("/* ping */ select 1");
setTestOnBorrow(true);
}
azkaban 默认支持MySQL5.x版本,可以根据需要,决定是否让其适配5.x及8.x
编译
指令
cd /..../azkaban-4.0.0/
./gradlew build installDist
可能会出现 test failed 的提示,使用如下参数跳过测试。
./gradlew build installDist -x test
不出意外,编译会顺利进行。
启动 Solo-Server
指令
cd /..../azkaban-4.0.0/azkaban-solo-server/build/install/azkaban-solo-server
sh ./bin/start-solo.sh
浏览器访问:
http://本机ip:8081/
用户名/密码:azkaban/azkaban
标签:node,Solo,4.0,--,props,azkaban,mysql,final
From: https://www.cnblogs.com/Earth-SmaThing/p/17032619.html