翻译:使用Carte集群

Use Carte Clusters

Use Carte Clusters

Last updated:
Jan 30, 2018
Save as PDF
Carte is a simple web server that allows you to run transformations and jobs remotely.  It receives XML (using a small servlet) that contains the transformation to run and the execution configuration.  It allows you to remotely monitor, start and stop the transformations and jobs that run on the Carte server.  
Carte是一个简单的网络服务,允许你远程运行“转换”和“作业”。它接受XML(使用了一个小型的服务),包含用于运行“转换”和执行配置的信息。它允许你对Carte服务器进行远程监控、启动、停止“转换”与“作业”
You can set up an individual instance of Carte to operate as a standalone execution engine for a job or transformation.  In Spoon you can define one or more Carte servers and send jobs and transformations to them.  If you want to improve PDI performance for resource-intensive transformations and jobs, use Carte cluster.
你可以架设一个自己的Carte实例,作为一个独立执行引擎用于“作业”或“转换”。在Spoon中你可以定义一个或多个Carte服务器,并且发送“作业”和“转换”给它们。如果你想要提升PDI性能用于资源密集型的“转换”和“作业”,请使用Carte集群。
Note: You can cluster the Pentaho Server to provide failover support.   If you decide to use the Pentaho Server, you must enable the proxy trusting filter as explained in Run Scheduled Jobs on a Remote Carte Server, then set up your dynamic Carte slaves and define the Pentaho Server as the master.
注意:你可以把Pentaho服务作为集群来提供故障迁移的能力。如果你决定使用Pentaho服务,你必须启用代理信任过滤,在文章在远程Carte服务上运行已计划的“作业”可以找到说明,然后设置你的动态Carte从服务并定义Pentaho服务为主服务。

Run Transformations and Jobs on a Carte Cluster

运行“转换”和“作业”在Carte集群
There are two types of Carte clusters.   Static Carte cluster has a fixed schema that specifies one master node and two or more slave nodes. In a static cluster, you specify the nodes in a cluster at design-time, before you run the transformation or job.
有两种类型的Carte集群。静态Carte集群拥有一个固定的模式,其需要指定一台主节点和两台及以上的从节点。在静态集群中,你在集群中指定节点只能在设计的时候、在你运行“转换”和“作业”之前。
A Dynamic Carte cluster has a schema that specifies one master node and a varying number of slave nodes.  Unlike a static cluster, slave nodes are not known until runtime.  Instead, you register the slave nodes, then at runtime, PDI monitors the slave nodes every 30 seconds to see if it is available to perform transformation and job processing tasks.
动态集群所有的模式是需要指定一个主节点和数量可调整的从节点。不像静态集群,从节点在运行前无法感知,而是需要你在运行期间注册从节点,PDI每隔监控从节点30秒一次,检测它们是否有能够执行“转换”与“作业”的处理任务。
Static clusters are a good choice for smaller environments where you don’t have a lot of machines (virtual or real) to use for PDI transformations.  Dynamic clusters work well if nodes are added or removed often, such as in a cloud computing environment. Dynamic clustering is also more appropriate in environments where transformation performance is extremely important, or if there can potentially be multiple concurrent transformation executions.
静态集群对于小型环境来说是一个不错的选择,即当你没有很多机器(虚拟机或物理机)用于PDI数据转换。动态集群比较擅长节点经常性地增增减减的情况,比如在云计算环境中。同时动态集群相当适合在对转换性能非常重视或者可能存在并发转换的情况。

Scheduled Jobs to Run on a Remote Carte Server

在远程Carte服务中运行计划的作业

The following instructions are needed to schedule a job to run on a remote Carte server. Without making these configuration changes, you will be unable to remotely run scheduled jobs.
下列的介绍是在远程Carte服务中计划“作业”所需的。如果不对这些配置做出修改,你将无法远程运行计划的作业。
Note: This process is also required for using the Pentaho Server as a load balancer in a dynamic Carte cluster.
注意: 这个过程同样也用于把该Pentaho服务在动态Carte集群中作为一个负载均衡器。
  1. Stop the Pentaho Server and remote Carte server.
  2. Copy the repositories.xml file from the .kettle directory on your workstation to the same location on your Carte slave. Without this file, the Carte slave will be unable to connect to the Pentaho Repository to retrieve PDI content.
  3. Open the /pentaho/server/pentaho-server/tomcat/webapps/pentaho/WEB-INF/web.xml file with a text editor.
  4. Find the Proxy Trusting Filter filter section, and add your Carte server’s IP address to the param-value element.
  1. 停止Pentaho服务和远程Carte服务。
  2. repositories.xml 文件从你工作站的.kettle 目录复制到Carte从服务所在位置。如果丢失这个文件,Carte从服务将无法连接到Pentaho源来接收PDI内容。
  3. 将/pentaho/server/pentaho-server/tomcat/webapps/pentaho/WEB-INF/web.xml文件使用文本编辑器打开
  4. 找到Proxy Trusting Filter 过滤器部分,并把你的Carte服务器的IP地址添加到param-value中。


  1. 01
    <filter>


    02
        <filter-name>Proxy Trusting Filter</filter-name>


    03
        <filter-class>org.pentaho.platform.web.http.filters.ProxyTrustingFilter</filter-class>


    04
        <init-param>


    05
          <param-name>TrustedIpAddrs</param-name>


    06
          <param-value>127.0.0.1,192.168.0.1</param-value>


    07
          <description>Comma separated list of IP addresses of a trusted hosts.</description>


    08
        </init-param>


    09
        <init-param>


    10
          <param-name>NewSessionPerRequest</param-name>


    11
          <param-value>true</param-value>


    12
          <description>true to never re-use an existing IPentahoSession in the HTTP session; needs to be true to work around code put in for BISERVER-2639</description>


    13
        </init-param>


    14
    </filter>

  2. Uncomment the proxy trusting filter-mappings between the <!– begin trust –> and <!– end trust –> markers.
<!– begin trust –> 和 <!– end trust —> 标签之间的代理信任过滤映射部分反注释。
  1. <!– begin trust –>
    <filter-mapping>
    <filter-name>Proxy Trusting Filter</filter-name>
    <url-pattern>/webservices/authorizationPolicy</url-pattern>
    </filter-mapping>

    <filter-mapping>
    <filter-name>Proxy Trusting Filter</filter-name>
    <url-pattern>/webservices/roleBindingDao</url-pattern>
    </filter-mapping>

    <filter-mapping>
    <filter-name>Proxy Trusting Filter</filter-name>
    <url-pattern>/webservices/userRoleListService</url-pattern>
    </filter-mapping>

    <filter-mapping>
    <filter-name>Proxy Trusting Filter</filter-name>
    <url-pattern>/webservices/unifiedRepository</url-pattern>
    </filter-mapping>

    <filter-mapping>
    <filter-name>Proxy Trusting Filter</filter-name>
    <url-pattern>/webservices/userRoleService</url-pattern>
    </filter-mapping>

    <filter-mapping>
    <filter-name>Proxy Trusting Filter</filter-name>
    <url-pattern>/webservices/Scheduler</url-pattern>
    </filter-mapping>

    <filter-mapping>
    <filter-name>Proxy Trusting Filter</filter-name>
    <url-pattern>/webservices/repositorySync</url-pattern>
    </filter-mapping>
    <!– end trust –>
  2. Save and close the file, then edit the carte.sh or Carte.bat startup script on the machine that runs your Carte server.
保存并关闭该文件,然后编辑carte.sh或Carte.bat启动脚本,在你所运行Carte服务的服务器上。
  1. Add -Dpentaho.repository.client.attemptTrust=true to the java line at the bottom of the file
添加-Dpentaho.repository.client.attemptTrust=true到文件末尾的java这一行。

    java $OPT -Dpentaho.repository.client.attemptTrust=true org.pentaho.di.www.Carte “${1+$@}”
    1. Save and close the file.
    保存并关闭该文件。

    1. Start your Carte server and Pentaho Server
    启动你的Carte服务和Pentaho服务
    You can now schedule a job to run on a remote Carte instance.
    你现在可以计划一个作业运行到远程Carte实例中。

Stop Carte from the Command Line Interface or URL

从命令行接口或者URL停止Carte

How to stop Carte either from the CLI or URL.
如果从CLI或者URL停止Carte。
  1. Open the command line interface by clicking Startand typing cmd. Press Enter.
  2. In the command line interface, enter the location of the Carte server.
  3. Enter a space, then type the arguments for stopping the server.
  4. Press Enter after the arguments are typed.

  1. 打开命令行接口:开始->运行,输入cmd并回车
  2. 在命令行接口中,输入Carte服务程序的路径。
  3. 敲一个空格,然后输入停止服务的参数。
  4. 在已输入的参数后面敲回车。

Arguments:
参数:

1
Carte <Interface address> <Port> [-s] [-p <arg>] [-u <arg>]

Example:
例:

1
Carte 127.0.0.1 8080 -s -p amidala4ever -u dvader

You can also now use a URL to stop Carte:
你现在可以同样可以用一个URL来停止Carte:
CommandDescriptionType
-h, –helpHelp text.
帮助文字
n/a
-p,–password <arg>The administrator password. Required only if stopping the Carte server.
管理员密码。只有在需要停止Carte服务时提供。
Alphanumeric
-s,–stopStop the running Carte server. This is only allowed when using the hostname/port form of the command.
停止正在运行的Carte服务。这只允许当包含主机端口的命令行的情况下使用。
Alphanumeric
-u,–username <arg>The administrator user name. Required only if stopping the Carte server.
管理员用户名。
只有在需要停止Carte服务时提供。
Alphanumeric

Run Transformations and Jobs from the Repository on the Carte Server

从Carte服务源中运行“转换”和“作业”
To run a job or transformation remotely on a Carte server, you first need to copy the local repositories.xml from the user’s .kettle directory to the Carte server’s $HOME/.kettle directory. The Carte service also looks for the repositories.xml file in the directory from which Carte was started.
在Carte服务商远程运行“作业”或“转换”,你首先需要把从本地用户的.kettle目录中 的repositories.xml文件复制到Carte服务的$HOME/.kettle目录。该Carte服务同样会在其所在目录查找repositories.xml文件。
For more information about locating or changing the .kettle home directory, see Changing the Pentaho Data Integration Home Directory Location (.kettle folder).
更多关于定位和修改.kettle主目录的信息,请查看 修改Pentaho数据集成主目录位置(.kettle目录)


发表评论

电子邮件地址不会被公开。 必填项已用*标注