您的位置:首页 > 运维架构 > Linux

linux下kettle网页版执行job方式(作业采用文件资源库存放)

2017-06-21 17:18 441 查看
目标:通过carte服务,使用网页版执行job(作业)

前提:

1、kettle部署在Linux机器上

2、job使用文件资源库方式存放,资源库名字为DZHY,存放位置为:/home/tools/kettle/job/DZHY

步骤

1、配置文件资源库

    首先,将kettle的作业文件从本地放到远程服务器上,如存放位置为服务器地址:/home/tools/kettle/job/DZHY

     然后,在/root/.kettle/repositories.xml中配置文件资源库,配置方式如下:

   

   <name>DZHY</name>
    <description>File repository</description>
    <is_default>false</is_default>
    <base_directory>/home/tools/kettle/job/</base_directory>
    <read_only>N</read_only>
    <hides_hidden_files>N</hides_hidden_files>


  注意:<base_directory>路径可以直接作业存放的上层文件夹路径,后续网页执行时需要将此部分忽略掉;

2、配置数据共享文件

    在/root/.kettle/shared.xml中配置需要连接的数据库,示例如下:  

<connection>
<name>ora11g</name>
<server>172.16.5.195</server>
<type>ORACLE</type>
<access>Native</access>
<database>orcl</database>
<port>1521</port>
<username>GSJLS</username>
<password>Encrypted 2be98afc86aa7f2e4cb79ce10ffbb80f6</password>
<servername/>
<data_tablespace/>
<index_tablespace/>
<attributes>
<attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
<attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
<attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
<attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute>
<attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
<attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
<attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>N</attribute></attribute>
<attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
<attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
</attributes>
</connection>


3、linux下通过shell启动carte服务

     通过shell远程启动carte服务时,最好通过后台命令启动,不然关闭shell时,启动命令也会停止;

     命令如:  nohup ./carte.sh a.xml & 

     其中a.xml内容如下:   

<slave_config>
<max_log_lines>5</max_log_lines>
<max_log_timeout_minutes>1</max_log_timeout_minutes>
<object_timeout_minutes>1</object_timeout_minutes>
<slaveserver>
<name>master1</name>
<hostname>172.17.2.89</hostname>
<port>8081</port>
</slaveserver>
</slave_config>


 由于carte服务为Java进程,可以通过jps命令查看进程信息;

查看carte服务是否启动成功:通过浏览器输入http://172.17.2.89:8081/查看是否启动成功

4、通过网页执行job作业

在本地浏览器中输入,即可执行成功
http://172.17.2.89:8081/kettle/executeJob/?rep=DZHY20170620&job=/DZHY/job/YWToHC/DZHY_HC&level=INFO


此时在查看http://172.17.2.89:8081/kettle/status/,发现作业正在执行,并且没有报错。

注意1:启动时执行的job路径不能和repositories.xml中配置的base_directory有重合的地方

注意2:文件资源库连接方式时,一定按照如上格式进行执行,目前官方提供的carte服务的job接口文档没有这种方式。

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐