Azkaban使用MYSQL管理工程、计划和执行
安装Mysql 具体安装过程可参考相关资料,比如http://ifalone.me/305.html ,http://dev.mysql.com/doc/index.html
为Azkaban创建数据库,其中数据库名字不一定是azkaban
mysql> CREATE DATABASE azkaban;
创建Azkaban数据库的用户,其中用户名字不一定是azkaban
mysql> CREATE USER 'username'@'%' IDENTIFIED BY 'password';
增加azkaban用户对azkaban数据库的增删改查权限
mysql> GRANT SELECT,INSERT,UPDATE,DELETE ON <database>.* to '<username>'@'%' WITH GRANT OPTION;
有必要的话可以增加Packet大小,此项限制mysql接受的数据包大小,可以在/etc/my.cnf中配置
[mysqld]
...
max_allowed_packet=1024M
配置完重启MYSQL
sudo /sbin/service mysqld restart
创建Azkaba需要的数据库表,将azkaban-sql-script-2.1.tar.gz解压,执行create-all-sql脚本即可(其中带有‘_update_’的脚本可以忽视)
获取JDBC连接器mysql-connector-java-5.1.25.tar.gz,下载地址http://dev.mysql.com/downloads/connector/j/ 。mysql-connector-java-5.1.25.tar.gz需要在webserver和excutorserver安装完后,分别拷入Azkaban2-web-server-install-dir/extlib和supertool/azkaban/excutorserver/extlib
Edit
下载安装Web Server
将azkaban-web-server-2.1.tar.gz解压到合适目录,如Azkaban2-web-server-install-dir
解压完应该有如下文件目录
Folder Description
bin 运行 Azkaban jetty server的脚本
conf Azkaban web server的配置文件
lib Azkaban依赖的jar包
extlib 放入到这个目录的jar包会被添加Azkaban的classpath
plugins 插件安装在此目录
web Azkaban web server的相关css,html等文件
获取SSL需要的keystore。此处尤其注意要用java的keytool工具,不然会报错(PATH最好将新填的内容放在旧的前面,如PATH=$JAVA_HOME/bin:......:${PATH})
证书制作可参考http://wingware.iyunv.com/blog/1160396 ,http://docs.codehaus.org/display/JETTY/How+to+configure+SSL
keytool -keystore keystore -alias jetty -genkey -keyalg RSA
示例如下
keytool -keystore keystore -alias jetty -genkey -keyalg RSA
Enter keystore password: password
What is your first and last name?
[Unknown]: jetty.mortbay.org
What is the name of your organizational unit?
[Unknown]: Jetty
What is the name of your organization?
[Unknown]: Mort Bay Consulting Pty. Ltd.
What is the name of your City or Locality?
[Unknown]:
What is the name of your State or Province?
[Unknown]:
What is the two-letter country code for this unit?
[Unknown]:
Is CN=jetty.mortbay.org, OU=Jetty, O=Mort Bay Consulting Pty. Ltd.,
L=Unknown, ST=Unknown, C=Unknown correct?
[no]: yes
Enter key password for <jetty>
(RETURN if same as keystore password): password
将azkaban-hdfs-viewer-2.1.tar.gz解压到Azkaban2-web-server-install-dir/plugins/viewer并将目录重命名为hdfs
*如果hadoop没有启动安全机制,重启AzkabanWebServer 即可使用hdfs插件。如果hadoop启动了安全机制,则需要修改Azkaban2-web-server-install-dir/plugins/viewer/hdfs/conf/plugin.properties里的如下配置:
Parameter Description
azkaban.should.proxy Wether Azkaban should proxy as another user to view the hdfs filesystem, rather than Azkaban itself, defaults to true
hadoop.security.manager.class The security manager to be used, which handles talking to secure hadoop cluster, defaults to azkaban.security.HadoopSecurityManager_H_1_0 (for hadoop 1.x versions)
proxy.user The Azkaban user configured with kerberos and hadoop. Similar to how oozie should be configured, for secure hadoop installations
proxy.keytab.location The location of the keytab file with which Azkaban can authenticate with Kerberos for the specified proxy.user
Job Type插件
修改Azkaban2-exec-server-install-dir/conf/azkaban.properties :
azkaban.jobtype.plugin.dir=plugins/jobtypes
将azkaban-jobtype-2.1.tar.gz解压到Azkaban2-exec-server-install-dir/plugins/并将目录重命名为jobtypes
如果hadoop没有启动安全机制,只需要修改Azkaban2-exec-server-install-dir/plugins/jobtypes/commonprivate.properties中如下配置:
Parameter Description
hadoop.home Your $HADOOP_HOME setting.
jobtype.global.classpath The cluster specific hadoop resources, such as hadoop-core jar, and hadoop conf (e.g. ${hadoop.home}/hadoop-core-1.0.4.jar,${hadoop.home}/conf)
如果hadoop启动了安全机制,则需要修改Azkaban2-exec-server-install-dir/plugins/jobtypes/commonprivate.properties中如下配置:
Parameter Description
hadoop.security.manager.class The security manager to be used, which handles talking to secure hadoop cluster, defaults to azkaban.security.HadoopSecurityManager_H_1_0 (for hadoop 1.x versions)
proxy.user The Azkaban user configured with kerberos and hadoop. Similar to how oozie should be configured, for secure hadoop installations
proxy.keytab.location The location of the keytab file with which Azkaban can authenticate with Kerberos for the specified proxy.user
hadoop.home Your $HADOOP_HOME setting.
jobtype.global.classpath The cluster specific hadoop resources, such as hadoop-core jar, and hadoop con (e.g. ${hadoop.home}/hadoop-core-1.0.4.jar,${hadoop.home}/conf)
Edit
使用说明及举例。Job具体可配置信息可参看http://azkaban.github.io/azkaban2/documents/2.1/jobconf.html