je/docs/ReplicationGuide/timesync.html

85 lines
4.2 KiB
HTML
Raw Normal View History

2021-06-06 17:46:45 +00:00
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Time Synchronization</title>
<link rel="stylesheet" href="gettingStarted.css" type="text/css" />
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
<link rel="start" href="index.html" title="Getting Started with Berkeley DB, Java Edition High Availability Applications" />
<link rel="up" href="progoverview.html" title="Chapter 2. Replication API First Steps" />
<link rel="prev" href="secondary.html" title="Secondary Nodes" />
<link rel="next" href="two-node.html" title="Configuring Two-Node Groups" />
</head>
<body>
<div xmlns="" class="navheader">
<div class="libver">
<p>Library Version 12.2.7.5</p>
</div>
<table width="100%" summary="Navigation header">
<tr>
<th colspan="3" align="center">Time Synchronization</th>
</tr>
<tr>
<td width="20%" align="left"><a accesskey="p" href="secondary.html">Prev</a> </td>
<th width="60%" align="center">Chapter 2. Replication API First Steps</th>
<td width="20%" align="right"> <a accesskey="n" href="two-node.html">Next</a></td>
</tr>
</table>
<hr />
</div>
<div class="sect1" lang="en" xml:lang="en">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a id="timesync"></a>Time Synchronization</h2>
</div>
</div>
</div>
<p>
For best results, you should synchronize the clocks used by all
machines in a replication group. If you are using a time-based
consistency policy, this is an absolute requirement
(see <a class="xref" href="consistency.html#timeconsistency" title="Time Consistency Policies">Time Consistency Policies</a> for more information).
Time synchronization is easily achieved using a mechanism like <a class="ulink" href="http://www.ntp.org/" target="_top">NTPD</a>.
</p>
<p>
In addition, time synchronization is also a requirement for
internal JE HA bookkeeping. For example, JE checks for clock
skew between the Master and a Replica
when the Replica performs its startup handshake with the
Master. This handshake will abort and throw
<a class="ulink" href="../java/com/sleepycat/je/EnvironmentFailureException.html" target="_top">EnvironmentFailureException</a> if the clock skew between the
two machines is greater than the value set for the
<a class="ulink" href="../java/com/sleepycat/je/rep/ReplicationConfig.html#MAX_CLOCK_DELTA" target="_top">MAX_CLOCK_DELTA</a> property. This property can be set using the
<a class="ulink" href="../java/com/sleepycat/je/rep/ReplicationConfig.html#setMaxClockDelta(long, java.util.concurrent.TimeUnit)" target="_top">ReplicationConfig.setMaxClockDelta()</a> method, or in the JE
configuration file using the
<code class="literal">je.rep.maxClockDelta</code> property.
</p>
<p>
Finally, well synchronized clocks make it easier to correlate
events in the logging output from different nodes in the group.
</p>
</div>
<div class="navfooter">
<hr />
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left"><a accesskey="p" href="secondary.html">Prev</a> </td>
<td width="20%" align="center">
<a accesskey="u" href="progoverview.html">Up</a>
</td>
<td width="40%" align="right"> <a accesskey="n" href="two-node.html">Next</a></td>
</tr>
<tr>
<td width="40%" align="left" valign="top">Secondary Nodes </td>
<td width="20%" align="center">
<a accesskey="h" href="index.html">Home</a>
</td>
<td width="40%" align="right" valign="top"> Configuring Two-Node Groups</td>
</tr>
</table>
</div>
</body>
</html>