此内容没有您所选择的语言版本。

27.2. Farming Deployment


The easiest way to deploy an application into the cluster is to use the farming service. Using the farming service, you can deploy an application (e.g. EAR, WAR, or SAR; either an archive file or in exploded form) to the all/farm/ directory of any cluster member and the application will be automatically duplicate across all nodes in the same cluster. If a node joins the cluster later, it will pull in all farm deployed applications in the cluster and deploy them locally at start-up time. If you delete the application from a running clustered server node's farm/ directory, the application will be undeployed locally and then removed from all other clustered server nodes' farm/ directories (triggering undeployment).
Farming is enabled by default in the all configuration in JBoss Enterprise Application Platform and thus requires no manual setup. The required farm-deployment-jboss-beans.xml and timestamps-jboss-beans.xml configuration files are located in the deploy/cluster directory. If you want to enable farming in a custom configuration, simply copy these files to the corresponding JBoss deploy directory <JBOSS_HOME>/server/<PROFILE>/deploy/cluster. Make sure that your custom configuration has clustering enabled.
While there is little need to customize the farming service, it can be customized via the FarmProfileRepositoryClusteringHandler bean, whose properties and default values are listed below:
<bean name="FarmProfileRepositoryClusteringHandler"
      class="org.jboss.profileservice.cluster.repository.
      DefaultRepositoryClusteringHandler">
  
  <property name="partition"><inject bean="HAPartition"/></property>
  <property name="profileDomain">default</property>
  <property name="profileServer">default</property>
  <property name="profileName">farm</property>
  <property name="immutable">false</property>
  <property name="lockTimeout">60000</property><!-- 1 minute -->
  <property name="methodCallTimeout">60000</property><!-- 1 minute -->
  <property name="synchronizationPolicy"><inject bean="FarmProfileSynchronizationPolicy"/></property>
</bean>
Copy to Clipboard Toggle word wrap
  • partition is a required attribute to inject the HAPartition service that the farm service uses for intra-cluster communication.
  • profile[Domain|Server|Name] are all used to identify the server profile for which this handler is intended.
  • immutable indicates whether or not this handler allows a node to push content changes to the cluster. A value of true is equivalent to setting synchronizationPolicy to org.jboss.system.server.profileservice.repository.clustered.sync. ImmutableSynchronizationPolicy.
  • lockTimeout defines the number of milliseconds to wait for cluster-wide lock acquisition.
  • methodCallTimeout defines the number of milliseconds to wait for invocations on remote cluster nodes.
  • synchronizationPolicy decides how to handle content additions, reincarnations, updates, or removals from nodes attempting to join the cluster or from cluster merges. The policy is consulted on the "authoritative" node, i.e. the master node for the service on the cluster. Reincarnation refers to the phenomenon where a newly started node may contain an application in its farm/ directory that was previously removed by the farming service but might still exist on the starting node if it was not running when the removal took place. The default synchronization policy is defined as follows:
    <bean name="FarmProfileSynchronizationPolicy"
          class="org.jboss.profileservice.cluster.repository.
          DefaultSynchronizationPolicy">
      <property name="allowJoinAdditions"><null/></property>
      <property name="allowJoinReincarnations"><null/></property>
      <property name="allowJoinUpdates"><null/></property>
      <property name="allowJoinRemovals"><null/></property>
      <property name="allowMergeAdditions"><null/></property>
      <property name="allowMergeReincarnations"><null/></property>
      <property name="allowMergeUpdates"><null/></property>
      <property name="allowMergeRemovals"><null/></property>
      <property name="developerMode">false</property>
      <property name="removalTrackingTime">2592000000</property><!-- 30 days -->
      <property name="timestampService"><inject bean="TimestampDiscrepancyService"/></property>
    </bean>
    
    Copy to Clipboard Toggle word wrap
    • allow[Join|Merge][Additions|Reincarnations|Updates|Removals] define fixed responses to requests to allow additions, reincarnations, updates, or removals from joined or merged nodes.
    • developerMode enables a lenient synchronization policy that allows all changes. Enabling developer mode is equivalent to setting each of the above properties to true and is intended for development environments.
    • removalTrackingTime defines the number of milliseconds for which this policy should remembered removed items, for use in detecting reincarnations.
    • timestampService estimates and tracks discrepancies in system clocks for current and past members of the cluster. Default implementation is defined in timestamps-jboss-beans.xml.
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat