Настройка windows на синхронизацию от ntp сервера - Строительный журнал
4 просмотров
Рейтинг статьи
1 звезда2 звезды3 звезды4 звезды5 звезд
Загрузка...

Synchronizing Servers with NTP

Synchronizing Servers with NTP

For an operating system and all of its services to run smoothly, the system clock has to be accurate. If it’s off by just a few seconds, the results could be disastrous.

For example, if machines share files over a local network, their clocks have to be synchronized to establish when exactly data is modified. Inaccurate clocks could create version conflicts or cause data to be overwritten.

There would also be issues running cron jobs. With an inaccurate clock, launch times would be fuzzy at best, and it would be incredibly difficult to properly analyze logs and troubleshoot system errors.

That’s just the tip of the iceberg.

To avoid these issues, system clocks have to synchronize. In Linux, this is done using an NTP (Network Time Protocol). In this article, we’ll be going step-by-step to install and configure an NTP on a server. Let’s start with a brief, theoretical introduction.

Как работает протокол NTP

В основе протокола NTP лежит иерархическая структура серверов точного времени, в которой выделяются различные уровни (англ. strata). К уровню 0 относятся эталонные часы (атомные часы или часы GPS). На нулевом уровне NTP-серверы не работают.

С эталонными часами синхронизируются NTP-серверы первого уровня, которые являются источниками для серверов уровня 2. Серверы уровня 2 синхронизируются с серверами уровня 1, но могут также синхронизироваться и между собой. Аналогичным образом работают серверы уровня 3 и ниже. Всего поддерживается до 256 уровней.

Иерархическая структура протокола NTP характеризуется отказоустойчивостью и избыточностью. В случае отказов соединения с вышестоящими серверами резервные серверы берут процесс синхронизации на себя. За счет избыточности обеспечивается постоянная доступность NTP-серверов. Синхронизируясь с несколькими серверами, NTP использует данные всех источников, чтобы рассчитать наиболее точное время.

Настройка Firewall

Для того чтобы протокол времени (NTP) успешно работал, нужно создать разрешающее правило по порту 123.

/ip firewall filter

add action=accept chain=input comment=NTP-Allow dst-port=123 protocol=udp

Настраиваем NTP Firewall

Если посмотреть на счётчик, то видим, что пакеты долетают от клиентов. Как это? Спросите вы.

NTP Download

Basic information on NTP can be found on our NTP info page as well as in our knowledge base articles.

The Meinberg NTP package provides a GUI setup program for Windows which installs the NTP service and associated executable programs that have been compiled from the original public NTP source code available at the NTP download page at ntp.org.

The GUI installer also contains the corresponding HTML based NTP documentation, as well as the libcrypto DLL from the OpenSSL project, which is required to create or check signatures of the NTP network packets, if the symmetric or public key authentication feature is used.

Unattended installation is also supported. Please see the NTP Installer README for help on how to use the installer.

  • NTP package for current Windows versions (XP and later), with IPv6 support
  • Outdated NTP package for Windows NT, Windows 2000, and newer, IPv4 only
  • External Web Links
  • NTP Cheat Sheet / Short Reference
  • Linux driver for Meinberg plug-in radio clocks
Читать еще:  Программа для регулировки скорости кулера процессора amd

For the Windows operating system there’s also an NTP Time Server Monitor program available which allows configuration of the local NTP service and graphical monitoring of the local and remote NTP servers.

If you have any questions or feedback, please contact ntp-support@meinberg.de.

NTP for current Windows versions (Windows XP and later), with IPv6 support

The current stable NTP version can be used with current 32 and 64 bit Windows versions (Windows XP and newer). Beside the standard IPv4 network protocol it also supports IPv6. Alternatively, there’s an older version available which can also be used on Windows 2000 or even Windows NT.

    When installing the service, the path to the executable program entered in the registry is placed in quotation marks, since a path that contains spaces represents a potential security hole. For more details see the article Securing the NTP Service Installation on Windows in our knowledge base.

Also the previous version ntp-4.2.8p15 of the setup program provided some minor security patches and some enhancements. See the NTP changelog for details.

It is explicitly recommended to upgrade earlier installations to this version.

ntp-4.2.8p15-v2-win32-setup.exe (4.29 MB)
24 February 2021
NTP package with IPv6 support for Windows XP and newer

Note: If the NTP service fails to start after installation on Windows XP or Windows 7, the Visual Studio Redistributable package my be missing, althogh it should be available by default on all current Windows installations. The 32 bit (x86) version of the redistributable is required even on 64 bit Windows systems. The package is available from the Microsoft download page:

NTP Error Message
NTP Error Message during start of NTP Service

NTP Welcome Message NTP Setup
Start installer of the Visual Studio Redistibutable package:

NTP Setup Ready
Visual Studio Setup is complete.

NTP for Windows NT, Windows 2000, and newer, IPv4 only, without current security patches

This version of the NTP package is outdated but is still provided since it can also be used on Windows 2000 or even Windows NT. It supports IPv4 only, but not IPv6. For current Windows installations the current stable NTP version should be used which also contains current security patches.

  • NTP 4.2.4p8 fixes a critical security problem. If you are running an older version please update as soon as possible.
  • This version of the installer supports PATH variables up to 8k in size, please note that older versions only support a maximum of 1024 bytes for the contents of the PATH variable and will most probably overwrite the variable if it is longer. This will cause problems with your Windows installation and should be avoided.

ntp-4.2.4p8@lennon-o-lpv-win32-setup.exe (2.8 MB)
26 October 2010
Old and stable NTP-package Windows NT/2000 (IPv4 only)
How to verify integrity of the downloaded file

Screenshots NTP Installer (Windows)

Here are some screenshot of the NTP installation (click to enlarge):

Step 1:
Step 1: Select the local program folder.

Schritt 2:
Step 2: Select the components to be installed.

Step 3a (without initial configuration file):
for experienced users — the configuration file must be setup manually.

Step 3b: (initial configuration with external time server):
specification of up to 9 external NTP servers.

Step 3c (initial configuration with Meinberg Time Service):
Set up your own NTP server with built-in Meinberg reference clock (e.g. GPS180PEX).

Step 4:
Select the service settings (recommended «Use System Account»).

Final take

Now your Windows Server 2019 clock is synchronized with time the NTP server’s pool.ntp.org and works as NTP client. You can achieve full network and accompanying infrastructure time synchronization by synchronizing all network workstations, servers, routers, hubs, and switches.

Since NTP servers operate over the UDP protocol using TCP/IP, these network infrastructures must be working efficiently for effective NTP server operation. In case you want to make time servers on windows server 2019 hosted on a virtual machine, you should disable the virtual machine time synchronization settings and sync their time with the domain Windows Server 2019.

Хронометраж в среде VMware vSphere

Существует расхожее мнение, что среда виртуализации оказывает влияние на механизмы исчисления времени внутри виртуальных машин, другими словами, хронометраж неточен. Погрешности происходят из-за совместного использования физических ресурсов гипервизора виртуальными машинами, которые работают на нем.

Для отслеживания течения времени, используется один из двух методов: подсчет тиков или отсчет времени. При подсчете тиков операционная система использует аппаратное устройство для передачи прерываний через заранее определенный интервал, например, 100 раз в секунду. Далее, отслеживаются эти прерывания или тики, чтобы определить, сколько времени прошло.

В режиме отсчета времени, происходит следующее: после старта системы аппаратное устройство начинает производить хронометраж. При необходимости производится считывание показаний этого счетчика. Системы на базе Windows используют периодический таймер CMOS для доставки прерываний или тиков.

Помимо подсчета времени, операционные системы также должны отслеживать абсолютное время. Когда система запускается, она считывает начальное время CMOS с точностью до секунды и запрашивает по сети данные с NTP сервера для получения более точных результатов. Затем используется один из методов, описанных выше, для измерения хода времени с этого момента.

Кроме того, чтобы исправить возможную рассинхронизацию времени и другие ошибки в измерениях, операционная система включает в себя демон, который периодически запускается для сверки часов с NTP серверами. Например, в системах семейства Windows, этот демон называется w32tm.

Среда VMware vSphere предоставляет виртуальным машинами все те же два способа хронометража плюс один дополнительный — VMware Tools. VMware Tools, или средства интеграции, служат для задач корректной работы виртуальной машины. Интересующая нас опция —включение периодической синхронизации времени. После ее активации будет выполняться сверка часов виртуальной машины и гипервизора каждую минуту.

Опция Synchronize guest time with host

Опция Synchronize guest time with host

При отставании часов в гостевой ОС, средства интеграции переместят часы в будущее, чтобы часы гостевой ОС и гипервизора совпадали. В обратном случае, когда часы гостевой ОС спешат по сравнению к часам гипервизора, будет начат процесс постепенного замедления времени до полной синхронизации. Синхронизация времени по умолчанию отключена для всех виртуальных машин. Чтобы убедиться в этом, можно проверить пользовательский интерфейс.

Но есть нюанс, даже если синхронизация времени VMware Tools отключена, синхронизация времени выполняется во время запуска гостевой операционной системы и во время некоторых операций обслуживания виртуальной машины на платформе vSphere. К этому интересному нюансу, я обязательно вернуть чуть позже в практической части.

How to troubleshoot time server synchronization problems

If after changing the settings, your device still has problems connecting to the NTP server, you can reset the Windows Time service configurations using Command Prompt.

  1. Open the Start menu.
  2. Search for cmd.exe, right-click the result, and select Run as administrator.

Type the following command to disable the Windows Time service and press Enter:

net stop w32time

Type the following command to unregister the Windows Time service and to remove all settings information from the registry and press Enter:

Type the following command to register the Windows Time service and to load the default settings to the registry and press Enter:

Type the following command to start the Windows Time service and press Enter:

net start w32time

Type the following command to force your computer to synchronize your computer without waiting and press Enter:

w32tm /resync /nowait

Once you completed the steps, your device should now synchronize with its clock over the internet.

More Windows 10 resources

For more helpful articles, coverage, and answers to common questions about Windows 10, visit the following resources:

Who would have the best costume at a Microsoft Halloween party?

Who would have the best costume at a Microsoft Halloween party?

It’s Halloween, and you know what that means: Nerdy, festive polls on Windows Central. Grab some candy corn and get voting.

Samsung challenges global chip shortage with plan to triple foundry efforts

Samsung challenges global chip shortage with plan to triple foundry efforts

Samsung’s had a strong past few fiscal quarters and isn’t letting that pile of money it’s sitting on go to waste. Instead, the company is keen on maintaining momentum with heightened chip output amid the ongoing global semiconductor crisis.

Nacon MG-X Xbox Android gamepad review: This belongs on the scrap heap

Nacon MG-X Xbox Android gamepad review: This belongs on the scrap heap

You needn’t really bother reading this review, since I’ll summarize it here. Avoid this controller, it’s absolutely awful.

The NFL is back! Check out these must-have Windows apps for football fans

The NFL is back! Check out these must-have Windows apps for football fans

After months of waiting through the offseason, the NFL is finally back this week. With these Windows 10 apps, you won’t miss a snap of the NFL action.

0 0 голоса
Рейтинг статьи
Ссылка на основную публикацию