当我启动Zope实例时,我的日志文件中出现了一个奇怪的错误。该实例使用ZEO服务器运行,Zope安装是virtualenv(在/ home / myUser / opt中)。我收到几个产品的错误,但Zope工作正常,这些产品已安装。以下是产品BTreeFolder2的示例:
2014-01-22T12:38:13 ERROR Application Couldn't install BTreeFolder2
Traceback (most recent call last):
File "/home/myUser/opt/Zope2-2.13.21/local/lib/python2.7/site-packages/Zope2-2.13.21-py2.7.egg/OFS/Application.py", line 693, in install_product
transaction.commit()
File "/home/myUser/opt/Zope2-2.13.21/local/lib/python2.7/site-packages/transaction-1.1.1-py2.7.egg/transaction/_manager.py", line 89, in commit
return self.get().commit()
File "/home/myUser/opt/Zope2-2.13.21/local/lib/python2.7/site-packages/transaction-1.1.1-py2.7.egg/transaction/_transaction.py", line 329, in commit
self._commitResources()
File "/home/myUser/opt/Zope2-2.13.21/local/lib/python2.7/site-packages/transaction-1.1.1-py2.7.egg/transaction/_transaction.py", line 446, in _commitResources
rm.tpc_vote(self)
File "/home/myUser/opt/Zope2-2.13.21/local/lib/python2.7/site-packages/ZODB3-3.10.5-py2.7-linux-x86_64.egg/ZODB/Connection.py", line 781, in tpc_vote
s = vote(transaction)
File "/home/myUser/opt/Zope2-2.13.21/local/lib/python2.7/site-packages/ZODB3-3.10.5-py2.7-linux-x86_64.egg/ZEO/ClientStorage.py", line 1098, in tpc_vote
return self._check_serials()
File "/home/myUser/opt/Zope2-2.13.21/local/lib/python2.7/site-packages/ZODB3-3.10.5-py2.7-linux-x86_64.egg/ZEO/ClientStorage.py", line 929, in _check_serials
raise s
ConflictError: database conflict error (oid 0x01, class OFS.Application.Application, serial this txn started with 0x03a449da3a7b1e44 2014-01-22 11:38:13.706468, serial currently committed 0x03a449da3af74dee 2014-01-22 11:38:13.820164)
我想解决这个问题,即使它不影响我网站的功能,但我不知道在哪里看。有什么建议? :)
或者这只是意味着必须使用ZEO服务器的数据更新缓存的对象?
答案 0 :(得分:1)
当Zope实例启动时,它会在ZODB中注册扩展(Products)。但是,当您运行多个共享ZEO服务器的实例时,它们都会在大致相同的时间启动,在此阶段会遇到冲突。冲突基本上是无害的,它们只是因为另一个实例成功安装持久性组件而发生。
解决方案是配置不注册产品的实例,除了一个(通常在多机群集中每台机器一个);然后在重新启动时,只有一个实例进行注册,其余实例运行相同的软件堆栈,不需要。
请注意,在最近的Zope安装中,产品的持久性部分已被弃用且大部分已禁用;如果您不使用通过Web产品或ZClasses,您可能根本不需要启用它。
如果确实需要,请将enable-product-installation
中的zope.conf
配置设置为on
仅一个实例,其余为off
。如果您使用buildout
和plone.recipe.zope2instance
recipe,则可以在buildout配方配置中指定此设置。