How to set chrony when the time shifts in CentOS7

How to set chrony when the time shifts in CentOS7

――What is chrony?

NTP client installed as standard in CentOS 7(Up to CentOS6, ntpd was installed)
There are differences, but
chrony :Useful in environments where constant communication with the NTP server is not possible, such as virtual impressions
ntp :Useful in an environment where you can always communicate with the NTP server

chrony settings

--Installation

$ sudo yum install chrony
Loaded plugin:fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp-srv2.kddilabs.jp
 * extras: ftp-srv2.kddilabs.jp
 * updates: ftp-srv2.kddilabs.jp
Package chrony-3.4-1.el7.x86_64 is installed or latest version
Do nothing

It is installed by default and seems to be the latest version.

--Change configuration file

$ sudo vi /etc/chrony.conf 
#Comment out
#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst

#add to
server ntp.jst.mfeed.ad.jp iburst
server ntp.nict.jp iburst 

--Restarting chrony

$ sudo systemctl restart chronyd

--Synchronization confirmation

$ chronyc sources
210 Number of sources = 2
MS Name/IP address         Stratum Poll Reach LastRx Last sample               
===============================================================================
^- ntp1.jst.mfeed.ad.jp          2   6    17     7  -1686us[-1785us] +/-   61ms
^* ntp-k1.nict.jp                1   6    17     7    -84us[ -183us] +/-   10ms

^ represents the server - is an acceptable server * Is the server currently in sync

--Check the time

$ date
Tuesday, September 1, 2020 21:00:25 JST

reference

-Using CHRONY -[Linux] Time synchronization setting and operation procedure by Chrony [Chronyd] -I adjusted the time dilation with CentOS 7

Recommended Posts

How to set chrony when the time shifts in CentOS7
How to set the display time to Japan time in Rails
[Java] How to set the Date time to 00:00:00
How to set when "The constructor Empty () is not visible" occurs in junit
How to cure the time dilation when launching Japaneseized Kibana
How to set Lombok in Eclipse
Summary of how to use the proxy set in IE when connecting with Java
How to set the IP address and host name of CentOS8
How to output the value when there is an array in the array
[jOOQ] How to CASE WHEN in the WHERE / AND / OR clause
How to solve the unknown error when using slf4j in Java
How to write the view when Vue is introduced in Rails?
How to get the date in java
How to set the indent to 2 single-byte spaces in the JAXB implementation of the JDK
How to find the total number of pages when paging in Java
How to constrain the action of the transition destination when not logged in
[Swift] How to set an image in the background without using UIImageView.
[Ruby] How to prevent errors when nil is included in the operation
How to reference a column when overriding the column name method in ActiveRecord
How to check the logs in the Docker container
When the server fails to start in Eclipse
Set the time of LocalDateTime to a specific time
How to add sound in the app (swift)
How to delete the database when recreating the application
[Java] (for MacOS) How to set the classpath
[Ruby on Rails] When logging in for the first time ・ How to split the screen in half using jQuery
How to build the simplest blockchain in Ruby
How to log in automatically when Ubuntu restarts
How to check Rails commands in the terminal
Spring Boot --How to set session timeout time
How to set environment variables in the properties file of Spring boot application
[Java] How to omit the private constructor in Lombok
How to install the root certificate of Centos7 (Cybertrust)
Organized how to interact with the JDK in stages
Set the root URL when starting tomcat in intelliJ
How to specify the resource path in HTML import
[Rails 6] How to set a background image in Rails [CSS]
How to debug the generated jar file in Eclipse
Install MySQL 5.6 on CentOS6 [How to specify the version]
[Rails] How to display an image in the view
How to study kotlin for the first time ~ Part 2 ~
How to study kotlin for the first time ~ Part 1 ~
How to delete the tweet associated with the user when you delete it at the same time
How to use UsageStatsManager in Android Studio (How to check the startup time of other apps)
How to get the class name of the argument of LoggerFactory.getLogger when using SLF4J in Java
How to set the log level to be displayed in the release version of orhanobut / logger
A memo to do for the time being when building CentOS 6 series with VirtualBox
[Swift] How to display the entered characters in Widget via UserDefaults when using WidgetKit
How to get the class name / method name running in Java
How to perform a specific process when the back button is pressed in Android Fragment
How to correctly check the local HTML file in the browser
How to set environment variables when using Payjp with Rails
How to change application.properties settings at boot time in Spring boot
I want to set the conditions to be displayed in collection_check_boxes
A memorandum when I investigated how to convert from Epoch Time to Date type in Scala
How to connect the strings in the List separated by commas
How to create a placeholder part to use in the IN clause
How to get values in real time with TextWatcher (Android)
How to set character code and line feed code in Eclipse
How to retrieve the hash value in an array in Ruby
How to solve the problem when the value is not sent when the form is disabled in rails and sent