Re: [Zope] database connections in a multi-Zope zeo environment
Dennis Allison wrote at 2005-8-14 14:11 -0700: > ... >1. When I open a database connection with the connection string > > -u dbroot -h localhost -passwd mypassword > >what machine is accessed? I'm presuming localhost is always the local >machine. Is that correct? If not, the name "localhost" were an extremely bad choice: You (or more likely your system administrator) are free to map the name "localhost" to whatever IP address you like. But, if you decide to map it to anything different than your local host, you are worth the confusion you will get >2. How do I open a remote database connection so it works transparently >across multiple instances of Zope? The Zope code, shared across >instances, uses a single connection with a connection string like > > -u dbroot -h 192.168.0.3 -passwd somepassword Why do you ask us? These questions concern the meaning of MySQL connection strings and have nothing to do with Zope. I assume that the options in these connection strings were well chosen: then "-h" means "host". This would mean the connection described by the above string is to host "192.168.0.3" (it usually is better to use names rather than IP addresses). >Presumably each of the remote machines (and the database server if it >runs Zope) needs an entry in the grant table. Yes, if that is necessary that MySQL grants access > And all the database >connections need to share the same password. Right? If they use the same object (in the same ZEO), then the connection string is identical across all ZEO clients. If they use different objects, the connection strings can vary >3. Since queries are bound to their connection, there appears to be no >easy way to manage connections in a simple way programmatically. What? What has the management of connections (which Zope does automatically for you) has to do with the binding of queries to connections? -- Dieter ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] database connections in a multi-Zope zeo environment
I am sure this is a synaptic disconnect, but I can't seem to get my head around this one. I have remote Zopes (call them "A", "B", "C" ) and a database server ("D"). I also have a bunch of mysql databases. All of the machines run mysql. All the Zope instances share the same Data.fs connected via Zeo. The two cases of interet are how to access a local database, that is, one the same machine as the running Zope, and, how to access a remote mysql database. ZMYSQLDA provides a static binding to connections. MYSQL grants access privileges based on source IP address. So, here are my questions: 1. When I open a database connection with the connection string -u dbroot -h localhost -passwd mypassword what machine is accessed? I'm presuming localhost is always the local machine. Is that correct? 2. How do I open a remote database connection so it works transparently across multiple instances of Zope? The Zope code, shared across instances, uses a single connection with a connection string like -u dbroot -h 192.168.0.3 -passwd somepassword Presumably each of the remote machines (and the database server if it runs Zope) needs an entry in the grant table. And all the database connections need to share the same password. Right? 3. Since queries are bound to their connection, there appears to be no easy way to manage connections in a simple way programmatically. Any help/comments much appreciated. ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )