problem: read from the bdb replication system -
09-04-2006
, 12:16 AM
There was a master and some slaves based Berkeley db replication.
The replication system was ok. Every second we updated the master's data a few times and then it replicated to the slave.
I write a apache module on each slave machine, read the slave's data and served as a http server.
When the apache module initialized, the module opened the slave’s environment and xx.db. Apache is running and served with the slave's data. Apache was busy and couldn't stop. When the slave was busy replicating data and logs from the master, apache module access the slave's data returned many many errors.
Some times when the slave restarted, apache module access the slave's data return many many errors too, even segment fault. Under this condition the apache master must restart to avoid this.
I want to know:
How to write apache modules with mod_db4?(Where to open environment and open database in apache module. while the module initialized or process initialized? An opened dbenv or dbp can reuse in it?)
How to read the slave's data in another process? (the process(such as apache) running forever can't stop and the slave maybe restart.) |