gpt4 book ai didi

mysql - 配置 Plone 以使用 Relstorage 作为 blobstorage

转载 作者:行者123 更新时间:2023-11-30 22:53:00 31 4
gpt4 key购买 nike

我在一个站点上安装了 Plone 4.3.3。首先,buildout 配置为使用 var/filestorage 中的 Data.fs 文件和 var/blobstorage 中的共享 blob 存储。然后我向构建中添加了一个 Relstorage,并将 Data.fs 文件的内容转换为底层 MySQL 数据库。现在 Plone 使用的是 Relstorage 而不是 Data.fs。

但现在我还想使用 Relstorage 而不是 blobstorage。因为我对 Plone 尤其是 Relstorage 比较陌生,所以我的想法是首先设置一个新的空 Plone。然后我将 buildout.cfg 和 base.cfg 从第一个复制到新的。然后我创建了一个新数据库 userZodb 并更改了 base.cfg 以使用新数据库,我还更改了 zeoserver 和客户端的端口。下一步是重新配置 relstorage 以不使用基于文件的 blobstorage。

rel-storage =
type mysql
db userZodb
user zodbuser
passwd innzop
blob-dir ${buildout:var-dir}/blobstorage
shared-blob-dir false

# shared blobs are much faster if we're on the same server.
# if not, turn it off.
shared-blob = off

然后我运行了构建。全部构建成功。启动 zeoserver 后,我从客户端收到此错误:

user@server:~/Plone433-dev/zeocluster3$ ./bin/zeoserver start
.
daemon process started, pid=35136
user@server:~/Plone433-dev/zeocluster3$ ./bin/client1 fg
2014-12-17 14:50:31 INFO ZServer HTTP server started at Wed Dec 17 14:50:31 2014
Hostname: 0.0.0.0
Port: 9180
2014-12-17 14:50:32 INFO Products.PloneFormGen gpg_subprocess initialized, using /usr/bin/gpg
Traceback (most recent call last):
File "/home/user/Plone433-dev/zeocluster3/parts/client1/bin/interpreter", line 289, in <module>
exec(compile(__file__f.read(), __file__, "exec"))
File "/home/user/Plone433-dev/buildout-cache/eggs/Zope2-2.13.22-py2.7.egg/Zope2/Startup/run.py", line 76, in <module>
run()
File "/home/user/Plone433-dev/buildout-cache/eggs/Zope2-2.13.22-py2.7.egg/Zope2/Startup/run.py", line 22, in run
starter.prepare()
File "/home/user/Plone433-dev/buildout-cache/eggs/Zope2-2.13.22-py2.7.egg/Zope2/Startup/__init__.py", line 86, in prepare
self.startZope()
File "/home/user/Plone433-dev/buildout-cache/eggs/Zope2-2.13.22-py2.7.egg/Zope2/Startup/__init__.py", line 262, in startZope
Zope2.startup()
File "/home/user/Plone433-dev/buildout-cache/eggs/Zope2-2.13.22-py2.7.egg/Zope2/__init__.py", line 47, in startup
_startup()
File "/home/user/Plone433-dev/buildout-cache/eggs/Zope2-2.13.22-py2.7.egg/Zope2/App/startup.py", line 81, in startup
DB = dbtab.getDatabase('/', is_root=1)
File "/home/user/Plone433-dev/buildout-cache/eggs/Zope2-2.13.22-py2.7.egg/Zope2/Startup/datatypes.py", line 287, in getDatabase
db = factory.open(name, self.databases)
File "/home/user/Plone433-dev/buildout-cache/eggs/Zope2-2.13.22-py2.7.egg/Zope2/Startup/datatypes.py", line 185, in open
DB = self.createDB(database_name, databases)
File "/home/user/Plone433-dev/buildout-cache/eggs/Zope2-2.13.22-py2.7.egg/Zope2/Startup/datatypes.py", line 182, in createDB
return ZODBDatabase.open(self, databases)
File "/home/user/Plone433-dev/buildout-cache/eggs/ZODB3-3.10.5-py2.7-linux-x86_64.egg/ZODB/config.py", line 101, in open
storage = section.storage.open()
File "/home/user/Plone433-dev/buildout-cache/eggs/RelStorage-1.6.0b2-py2.7.egg/relstorage/config.py", line 33, in open
return RelStorage(adapter, name=config.name, options=options)
File "/home/user/Plone433-dev/buildout-cache/eggs/RelStorage-1.6.0b2-py2.7.egg/relstorage/storage.py", line 212, in __init__
self.blobhelper = BlobHelper(options=options, adapter=adapter)
File "/home/user/Plone433-dev/buildout-cache/eggs/RelStorage-1.6.0b2-py2.7.egg/relstorage/blobhelper.py", line 118, in __init__
fshelper.create()
File "/home/user/Plone433-dev/buildout-cache/eggs/ZODB3-3.10.5-py2.7-linux-x86_64.egg/ZODB/blob.py", line 359, in create
(self.layout_name, self.base_dir, layout))
ValueError: Directory layout `zeocache` selected for blob directory /home/user/Plone433-dev/zeocluster3/var/blobstorage/, but marker found for layout `bushy`

不幸的是,我不知道问题出在哪里。有人建议吗?谢谢!

最佳答案

解决方案是再次使用 zodbconvert。正确配置它可以从一种存储转换为另一种存储,例如从 Blobstorage 转换为 Relstorage。在我的例子中,配置如下所示:

<filestorage source>
path /home/user/Plone433-dev/zeocluster/var/filestorage/Data20141230.fs
blob-dir /home/user/Plone433-dev/zeocluster/var/blobstorage
</filestorage>

<relstorage destination>
shared-blob-dir false
# ZODB Cache Dir
blob-dir ./var/cacheblob
blob-cache-size 10mb
<mysql>
host localhost
db Zodb
user zodbuser
passwd XXXXXXXXX
</mysql>
</relstorage>

之后,您必须更改 base.cfg 和 buildout.cfg 以仅使用 relstorage。您可以在此处找到有关其具体工作原理的更多信息:https://www.techidiots.net/notes/plone-1/plone-4-3-3-relstorage

关于mysql - 配置 Plone 以使用 Relstorage 作为 blobstorage,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27527145/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com