Pyramid - Adding ZEO to an existing ZODB project

130 views
Skip to first unread message

Ellison Marks

unread,
Nov 1, 2012, 8:57:59 PM11/1/12
to pylons...@googlegroups.com
I'm a bit new to pyramid, but I'm building an application and had a few questions. The one the title refers to is basically this:

The tutorial in the pyramid cookbook about ZEO show how to set up a server "from scratch", as it says. However, I've already started out using the ZODB scaffold, and I'm not yet confident enough to go about changing the setup.py and the ini files too much. I'm wondering if anyone could point me to a tutorial (or provide one themselves) on integrating ZEO into a project that's already using ZODB.

Thanks in advance.

Sam

unread,
Nov 2, 2012, 11:14:55 AM11/2/12
to pylons...@googlegroups.com
You just need to change the zodb_uri setting in your .ini file(s) to an appropriate uri with the zeo: protocol (instead of the file: protocol).

For example, if you're running the zeo server locally from the same directory as your .ini file (as the cookbook recipe suggests under the "Running" section), you would change it like so:

zodb_uri = zeo://%(here)s/zeo.sock

For production use, you may run the zeo server on another machine and will want to connect by IP address and port instead of socket.  See http://docs.pylonsproject.org/projects/pyramid_zodbconn/en/latest/ for more info on ZEO urls and all the other details of zodb connections.

Tres Seaver

unread,
Nov 2, 2012, 12:12:31 PM11/2/12
to pylons...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
http://docs.pylonsproject.org/projects/pyramid_cookbook/en/latest/database/zodb_zeo.html


- --
===================================================================
Tres Seaver +1 540-429-0999 tse...@palladion.com
Palladion Software "Excellence by Design" http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlCT8O8ACgkQ+gerLs4ltQ7QgQCeNwIndPWPIow/3U/oPMoO4BKu
e0gAoLhhwC2RlwQtDoqZsz6Xr1nsQshu
=yQHX
-----END PGP SIGNATURE-----

Ellison Marks

unread,
Nov 2, 2012, 7:08:29 PM11/2/12
to pylons...@googlegroups.com
Yeah, I've been doing a little more reading (particularly on the paster config files), and it seems like the ZEO doc you referenced (that was the one I was reading in the first place) is slightly misleading. For one thing, pyramid_tm handles the repoze.tm2 slot mentioned there, as well as the repoze.retry slot. It also has some automatic configuration with a tween, so the pipeline is unnecessary. For another, the example zeo.conf file it lists doesn't seem to work in my setup(win7 64 bit python 2.7), as the address part of it errors out down the callstack, saying it requires an integer. I switched it to localhost:9001 and it appears to work. The problem I'm having now is, I can't find any docs at all on zeo.conf, to see if there's anything else I should tweak in there.
Reply all
Reply to author
Forward
0 new messages