开发者

Sharing properties file from a single location

We have Java Enterprise applications deployed on to multiple servers. There are replicated servers running same application to load-balance(let's call them J2EE servers).Note that this is not clustered.

There is a common server (let's call it props server) which hosts all properties files relevant to all applications. The folder containing properties files is NFS shared between all the other J2EE servers. The issue is that you can see props server is a single point of failure. If it did not come up or if the NFS share gets corrupted, other servers wont be able to load properties.

What are the options t开发者_开发技巧o avoid this hard dependency ? Given the constraint that we do not want to duplicate property files to all servers.


If you are having this problem, the more scalable solution would be to look into using this:

http://java.sun.com/j2se/1.4.2/docs/guide/lang/preferences.html

This abstracts away things like where they are located. You can then have these settings stored in an LDAP server, cloned properties, or whatever is best - you can even use different mechanisms for different environments.


One of approaches would be for every J2EE server to have a cloned set of configuration files. This implies a constraint that every time a config is changed for one server it should be rsync-ed among all others (after the change is known to be OK).

The positive aspect is clear, you really have N independently configurable servers and a config change kills (if kills) only one server.

The negative aspect is that sometimes someone will forget to do 'rsync' & 'bounce' after a config change on a single box.


Given the constraint that we do not want to duplicate property files to all servers.

If you are ok to copy properties to some servers, elect a leader and make sure any modification is propagated to backups, then Paxos is your friend. If the leader fails, a new leader can be elected. I have updated the wikipedia page. It contained errors regarding the description of the algorithm.


Take a look at the PAXOS algorithm. It is designed to bring multiple servers to consensus.

http://en.wikipedia.org/wiki/Paxos_algorithm

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜