Skip to content

Configuration 配置

sinofool edited this page Mar 3, 2014 · 3 revisions

There are two configuration files of this system, dbpool.cfg and dbpool.xml.
这个系统有两个配置文件,分别是dbpool.cfg和dbpool.xml。

1. server side config
This file controls how this system works itself.
此文件控制系统本身。
There is only one option in this file: Endpoints.
It controls the server listening port.

2. dbpool.properties
This file controls how client get the configuration.
If you want a simple solution with ability to extend for future, use FlatfileProvider.
If you want a powerful, full featured solution, use ZeroCIceProvider.

3. dbpool.xml
This file controls what this system offered to the client.
此文件控制系统对外的输出。
See Design Your Database Cluster (TBD)
参见 设计数据库集群(未完成)
See the example file here: dbpool.xml

This file can be reloaded without restarting the system, and it is designed to be so.
修改此文件不需要重启系统,而且应该用reload的方法重新加载。
To load the file changes into the system, using DBPoolServer::reload().
要更新文件,调用DBPoolServer::reload()方法。
After reloading, the system will update all its client configuration and the client will reconnect to updated database automatically.
调用Reload后,系统会自动通知所有客户端更新配置,并且重新建立数据库连接。
Meanwhile, there is a double check at client side, client will register itself periodically (15 seconds default). This ensures all clients get the server update in time. And it makes the system recoverable.
同时,为了保证客户端连接的可靠性,客户端默认15秒会尝试向服务器注册自己。有了这个机制,服务器重启就不会影响系统的正常工作了。

Clone this wiki locally