Jackrabbit中的集群(5)



只是为了将Jackrabbit中的每个模块都作一下介绍,所以才放出这么一节来。实际上Jackrabbit对集群的支持并不怎样。

要了解它的集群,你得首先到 /jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster 包里面去看一下。

Jackrabbit采用生产消费模式来Handle它的集群设计。它假定它的架构周边有一台中心DB或是中心文件服务器(这应当是一台性能极好的DB,否则性能不好的话整个集群的意义不大。)。

有了这么一台中心DB后,各服务器会将自己的增删改操作告知中心DB. 这一过程可谓生产过程。

那服务器又是如何知道别人的增删改操作呢,jackrabbit在每个服务器上加了个后台线程。定时的去中心DB上看是不是有新的更新(如果自己的版本比最新版本旧,则有更新), 如果有,则将中心DB所有的版本从前到后依次同步一下。

这样还是会有问题,比方说定时同步的时间是30秒,那30秒之内的有服务器增删改了就没办法了么?

实际上,Jackrabbit还有另一个方案,在所有的增删改之前,会去先锁住相关的记录。这时候只有它一个人可以操作数据,它将自己的版本更新至最新版后,进去增删改操作。然后解锁。

以上的定时同步和手动同步过程便是消费过程。




这样,一整套的集群方案便介绍完了。







  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
提示错误[ERROR] [ERROR] Some problems were encountered while processing the POMs: [ERROR] Unresolveable build extension: Plugin org.apache.maven.wagon:wagon-webdav-jackrabbit:1.0-beta-6 or one of its dependencies could not be resolved: The following artifacts could not be resolved: commons-httpclient:commons-httpclient:jar:3.1 (absent): Could not transfer artifact commons-httpclient:commons-httpclient:jar:3.1 from/to central (https://repo.maven.apache.org/maven2): Connect to repo.maven.apache.org:443 [repo.maven.apache.org/146.75.112.215] failed: connect timed out @ @ [ERROR] The build could not read 1 project -> [Help 1] [ERROR] [ERROR] The project org.drools:droolsjbpm-integration:7.74.0-SNAPSHOT (D:\droolsjbpm-integration-main\droolsjbpm-integration-main\pom.xml) has 1 error [ERROR] Unresolveable build extension: Plugin org.apache.maven.wagon:wagon-webdav-jackrabbit:1.0-beta-6 or one of its dependencies could not be resolved: The following artifacts could not be resolved: commons-httpclient:commons-httpclient:jar:3.1 (absent): Could not transfer artifact commons-httpclient:commons-httpclient:jar:3.1 from/to central (https://repo.maven.apache.org/maven2): Connect to repo.maven.apache.org:443 [repo.maven.apache.org/146.75.112.215] failed: connect timed out -> [Help 2] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException [ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/PluginManagerException
最新发布
06-09

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值