Chinasp.ru

Авто Клондайк
2 просмотров
Рейтинг статьи
1 звезда2 звезды3 звезды4 звезды5 звезд
Загрузка...

Сервер времени NTP GPS для точного времени

Сервер времени NTP GPS для точного времени

Сервер времени NTP GPS

Rackmount, выделенный безопасный Stratum 1 GPS NTP-сервер, активная антенна и программное обеспечение для однократной или широковещательной синхронизации времени.

Истинная страта 1 Сервер времени времени NTP GP-адрес задания времени Конфигурируется по сети Ручки> 3000 NTP-запросов в минуту Твердотельная память исключает «сбой диска» Ведущая отраслевая гарантия на 6 лет Отчет об ошибках Syslog Бесплатная поддержка срока службы продукта

Обратитесь к Galleon за дополнительной информацией о сервере времени NTP GPS.

Преимущества

  • В новых версиях TimeVisor2 и TimeVisor3 полностью обновлен Web-конфигуратор (с сохранением функциональности конфигуратора предыдущей версии), среди новых функций которого можно назвать:
    • возможность оперативного контроля состояния связи с источником точного времени (со спутниками) и статуса синхронизации времени
    • возможность анализа статистики синхронизации времени за временной промежуток на основе графического представления данных
    • возможность выполнения сложных сетевых настроек, в том числе использование дополнительных сетевых адресов, сетевых шлюзов и маршрутов
    • возможность защитить WEB-интерфейс от случайного изменения настроек использованием авторизованного доступа с настройкой учетных записей и паролей

    Setting Up “NTP (Network Time Protocol) Server” in RHEL/CentOS 7

    Network Time Protocol – NTP- is a protocol which runs over port 123 UDP at Transport Layer and allows computers to synchronize time over networks for an accurate time. While time is passing by, computers internal clocks tend to drift which can lead to inconsistent time issues, especially on servers and clients logs files or if you want to replicate servers resources or databases.

    NTP Server Install in CentOS

    Requirements:

    Additional Requirements:

    This tutorial will demonstrate how you can install and configure NTP server on CentOS/RHEL 7 and automatically synchronize time with the closest geographically peers available for your server location by using NTP Public Pool Time Servers list.

    Step 1: Install and configure NTP daemon

    1. NTP server package is provided by default from official CentOS /RHEL 7 repositories and can be installed by issuing the following command.

    Install NTP in CentOS

    2. After the server is installed, first go to official NTP Public Pool Time Servers, choose your Continent area where the server physically is located, then search for your Country location and a list of NTP servers should appear.

    NTP Pool Server

    3. Then open NTP daemon main configuration file for editing, comment the default list of Public Servers from pool.ntp.org project and replace it with the list provided for your country like in the screenshot below.

    Configure NTP Server in CentOS

    4. Further, you need to allow clients from your networks to synchronize time with this server. To accomplish this, add the following line to NTP configuration file, where restrict statement controls, what network is allowed to query and sync time – replace network IPs accordingly.

    The nomodify notrap statements suggest that your clients are not allowed to configure the server or be used as peers for time sync.

    5. If you need additional information for troubleshooting in case there are problems with your NTP daemon add a log file statement which will record all NTP server issues into one dedicated log file.

    Enable NTP Logs in CentOS

    6. After you have edited the file with all configuration explained above save and close ntp.conf file. Your final configuration should look like in the screenshot below.

    NTP Server Configuration in CentOS

    Step 2: Add Firewall Rules and Start NTP Daemon

    7. NTP service uses UDP port 123 on OSI transport layer (layer 4). It is designed particularly to resist the effects of variable latency (jitter). To open this port on RHEL/CentOS 7 run the following commands against Firewalld service.

    Open NTP Port in Firewall

    8. After you have opened Firewall port 123, start NTP server and make sure you enable it system-wide. Use the following commands to manage the service.

    Start NTP Service

    Step 3: Verify Server Time Sync

    9. After NTP daemon has been started, wait a few minutes for the server to synchronize time with its pool list servers, then run the following commands to verify NTP peers synchronization status and your system time.

    Verify NTP Server Time

    10. If you want to query and synchronize against a pool of your choice use ntpdate command, followed by the server or servers addresses, as suggested in the following command line example.

    Synchronize NTP Time

    Step 4: Setup Windows NTP Client

    11. If your windows machine is not a part of a Domain Controller you can configure Windows to synchronize time with your NTP server by going to Time from the right side of Taskbar -> Change Date and Time Settings -> Internet Time tab -> Change Settings -> Check Synchronize with an Internet time server -> put your server’s IP or FQDN on Server filed -> Update now -> OK.

    Synchronize Windows Time with NTP

    That’s all! Setting up a local NTP Server on your network ensures that all your servers and clients have the same time set in case of an Internet connectivity failure and they all are synchronized with each other.

    Checking the status of NTP with ntpq command

    The ntpq utility program is used to monitor NTP daemon ntpd operations and determine performance. The program can be run either in interactive mode or controlled using command line arguments. Type the following command on your Linux or Unix-based system:
    $ ntpq -pn
    OR
    $ ntpq -p
    Sample outputs:

    * the source you are synchronized to (syspeer). The above is an example of working ntp client. Where,

    1. -p : Print a list of the peers known to the server as well as a summary of their state.
    2. -n : Output all host addresses in dotted-quad numeric format rather than converting to the canonical host names.

    Another reliable source is running the following command:
    $ ntpq -c rv
    Look for the leap code as follows:
    Linux Verify NTP is Working Or Not
    So leap code 0 (leap_none) means normal synchronized state. And leap code 3 (leap_alarm) means NTP wasnever synchronized. Here is a sample outputs:
    How to check NTP is working?

    Configure Chrony as NTP Server

    To configure chrony as NTP Server you just need to add an » allow » directive to the /etc/chrony.conf file in order to open the NTP port and allow chronyd to reply to client requests. » allow » with no specified subnet allows access from all IPv4 and IPv6 addresses.

    allow [all] [subnet]
    The allow directive is used to designate a particular subnet from which NTP clients are allowed to access the computer as an NTP server. The default is that no clients are allowed access, i.e. chronyd operates purely as an NTP client.

    So we will add this directive on our NTP Client which we created above, with this we configure chrony as NTP Server.

    Restart the Chronyd service

    With this the steps to configure chrony as NTP Server is complete. You may add more directives as provided in the chrony.conf man page .

    Next configure your NTP Client, below are the minimal configuration for chrony.conf

    Here I have added the IP of my NTP Server i.e. 192.168.0.113

    Next we will start tcpdump from one terminal and restart the chronyd service on another terminal.

    In parallel session I have tcpdump monitoring port 123

    As you see with an interval of 2 seconds my NTP client is contacting the NTP Server.

    Check the current time sources that chronyd is accessing.

    Check the system’s clock performance

    So our client is in sync with NTP Server which we created above.

    Способ 4: консоль PowerShell

    В Windows 10 есть системная утилита PowerShell, которая представляет собой более продвинутую командную строку с усовершенствованной графической оболочкой, поддержкой более 600 команд и наличием подсказок. Кроме того, она имеет несколько расширенный функционал, чем классическое приложение.
    Рассмотрим, как изменить время через консоль:

    1. Откройте консоль PowerShell с правами администратора любым удобным способом: найдите в списке установленных программ в меню «Пуск», используйте системный поиск или окно «Выполнить» с запросом powershell.

    2. В открывшейся консоли пропишите команду Set-Date, затем введите следующее значение: -Date «dd/mm/yyyy hh/mm», где dd – это день, mm – месяц, yyyy – год полностью, hh – часы, mm – минуты.

    Если требуется установить 12-часовой формат времени, то используйте PM и AM в конце команды, что значит «до полудня» и «после полудня» соответственно. Для применения установок нажмите на клавишу Enter и выйдите из консоли PowerShell.

    Изменить время и дату в ОС от Microsoft можно несколькими способами, причем все они предусмотрены системой. Установка стороннего софта для настроек не требуется. Напишите в комментариях, каким методом пользуетесь вы?

    Если вы нашли ошибку, пожалуйста, выделите фрагмент текста и нажмите Ctrl+Enter.

    Code Explanation

    Let’s take a quick look at the code to see how it works. First, we include the libraries needed for this project.

    • WiFi.h library provides ESP32 specific WiFi methods we are calling to connect to network.
    • time.h is the ESP32 native time library which does graceful NTP server synchronization.

    Next, we set up a few constants like SSID, WiFi password, UTC Offset & Daylight offset that you are already aware of.

    Along with that we need to specify the address of the NTP Server we wish to use. pool.ntp.org is an open NTP project great for things like this.

    The pool.ntp.org automatically picks time servers which are geographically close for you. But if you want to choose explicitly, use one of the sub-zones of pool.ntp.org.

    AreaHostName
    Worldwidepool.ntp.org
    Asiaasia.pool.ntp.org
    Europeeurope.pool.ntp.org
    North Americanorth-america.pool.ntp.org
    Oceaniaoceania.pool.ntp.org
    South Americasouth-america.pool.ntp.org

    In setup section, we first initialize serial communication with PC and join the WiFi network using WiFi.begin() function.

    Once ESP32 is connected to the network, we initialize the NTP client using configTime() function to get date and time from an NTP server.

    Now we can simply call the printLocalTime() custom function whenever we want to print current date & time.

    getLocalTime() function is used to transmit a request packet to a NTP server and parse the received time stamp packet into to a readable format. It takes time structure as a parameter.

    You can access the date & time information by accessing members of this time structure.

    голоса
    Рейтинг статьи
    Читайте так же:
    Регулировка клапанов на мотике
Ссылка на основную публикацию
Adblock
detector