cassandra cluster requires strict time synchronization

Cassandra's cluster has very strict time requirements. The time of any machine in the cluster must be synchronized. Even a second delay will cause inexplicable problems. Because cassandra distinguishes the last response based on the timestamp, if different operations are performed on the same record, if the time is not synchronized, the previous operation may take effect after the latter operation. When operating at high speed, there may be strange phenomena that records cannot be deleted, tables still exist after being dropped, and so on.

At the same time, if these various strange problems occur, you should first check whether your cluster is time-synchronized. If it is really caused by the time asynchrony, and you don't find it, it will waste a lot of your time to investigate the cause.

For time synchronization, all machines in the cluster can be synchronized with the same clock synchronization server, or a certain machine in the cluster can be used as the clock synchronization server, and other machines can synchronize with it.

There are generally two synchronization methods. One is timing synchronization, that is, using crontabl under Linux to do a timing task and timing synchronization. How often to synchronize this synchronization is poor and not desirable. If you want to ensure long-term and stable synchronization of your cassandra cluster, you need precise time synchronization, which is to use ntp synchronization, which is also a clock synchronization protocol. It has its own set of algorithms, how much difference is currently, when will it be synchronized next time, etc. This set of algorithms can ensure that the clock is synchronized all the time.

ntp is a service of linux, the configuration file is /etc/ntp.conf

The method of configuring and starting the ntp service does not need to go into details. How to synchronize the two Linux servers under Baidu and how to configure the ntp synchronization is a large article.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326825825&siteId=291194637