摘要 |
<p>Provided are a zookeeper-based information configuration method and device. The method comprises: occupying a lock between processes by way of starting a process, establishing a long-term connection between the process and a zookeeper server, and monitoring all configuration information on a local disk via the process, so that a process of reading configuration information only requires searching for configuration information corresponding thereto from the local disk; if corresponding configuration information is found, reading, by the process of reading the configuration information, configuration information corresponding thereto from the local disk; and if corresponding configuration information is not found, establishing, by the process of reading the configuration information, a short-term connection with a zookeeper server, and acquiring configuration information corresponding thereto from the zookeeper server and storing same on the local disk. The method and device of the present invention can reduce the load of a zookeeper server.</p> |