<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>NTP &#8211; Eternal Center</title>
	<atom:link href="https://eternalcenter-sep-2022.github.io/category/service/other-service/ntp/feed/" rel="self" type="application/rss+xml" />
	<link>https://eternalcenter-sep-2022.github.io/</link>
	<description></description>
	<lastBuildDate>Sun, 19 Jun 2022 07:26:56 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>[步骤] Linux 时间同步的设置 （通过 NTP 实现）</title>
		<link>https://eternalcenter-sep-2022.github.io/ntp-client/</link>
		
		<dc:creator><![CDATA[Mingyu Zhu]]></dc:creator>
		<pubDate>Sun, 21 Jul 2019 12:40:05 +0000</pubDate>
				<category><![CDATA[Chinese (中文)]]></category>
		<category><![CDATA[NTP]]></category>
		<category><![CDATA[Other Service (其它服务)]]></category>
		<category><![CDATA[Service (服务)]]></category>
		<guid isPermaLink="false">https://eternalcenter-sep-2022.github.io/?p=4869</guid>

					<description><![CDATA[注意： 从 CentOS 7.2&#38;RHEL 7.0 开始实现时间同步的程序默认从 NTP 换成了 Chrony 。 NTP 也可以继续使用，但是需要单独安装 NTP 的安装包。 步骤一：系统环境要求 服务器系统要配置好可用的软件源 步骤二：确保 NTP 已经安装 步骤三：确保系统会使用 Chrony 或 NTP 的时间同步 （补充：此时 NTP service 的状态可能还不是 active 状态） 步骤四：修改配置文件 将部分内容修改如下： （说明：在配置文件的末尾添加要进行时间同步的服务器） 步骤五：重启客户端的 NTP 服务 步骤六：显示客户端时间同步的状态 6.1 通过 NTP 命令显示 （补充：1) 此命令可能会显示多行，每一行显示一个时钟源的状态2) 最左边有一个星号 “*” 的行代表目前正在被使用的时钟源，这代表这个时钟源可以被使用且最精确） 6.2 通过 timedatectl 命令显示 （补充：如果 NTP 时间同步正常，则此时 NTP service &#8230; <p class="link-more"><a href="https://eternalcenter-sep-2022.github.io/ntp-client/" class="more-link">Continue reading<span class="screen-reader-text"> "[步骤] Linux 时间同步的设置 （通过 NTP 实现）"</span></a></p>]]></description>
										<content:encoded><![CDATA[
<h2>注意：</h2>



<p>从 CentOS 7.2&amp;RHEL 7.0 开始实现时间同步的程序默认从 NTP 换成了 Chrony 。 NTP 也可以继续使用，但是需要单独安装 NTP 的安装包。</p>



<h3 id="步骤一-系统环境要求">步骤一：系统环境要求</h3>



<p>服务器系统要配置好可用的软件源</p>



<h3 id="步骤二-确保-ntp-已经安装">步骤二：确保 NTP 已经安装</h3>



<pre class="wp-block-code"><code># yum -y install ntp</code></pre>



<h3 id="步骤三-确保系统会使用-chrony-或-ntp-的时间同步">步骤三：确保系统会使用 Chrony 或 NTP 的时间同步</h3>



<pre class="wp-block-code"><code># timedatectl set-ntp true
# timedatectl
               Local time: Fri 2020-06-12 09:52:30 EDT
           Universal time: Fri 2020-06-12 13:52:30 UTC
                 RTC time: Fri 2020-06-12 13:51:52
                Time zone: America/New_York (EDT, -0400)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no</code></pre>



<p>（补充：此时 NTP service 的状态可能还不是 active 状态）</p>



<h3 id="步骤四-修改配置文件">步骤四：修改配置文件</h3>



<pre class="wp-block-code"><code># vim /etc/sysconfig/ntp</code></pre>



<p>将部分内容修改如下：</p>



<pre class="wp-block-code"><code>......
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</code></pre>



<p>（说明：在配置文件的末尾添加要进行时间同步的服务器）</p>



<h3 id="步骤五-重启客户端的-ntp-服务">步骤五：重启客户端的 NTP 服务</h3>



<pre class="wp-block-code"><code># service ntpd restart</code></pre>



<h3>步骤六：显示客户端时间同步的状态</h3>



<h4>6.1 通过 NTP 命令显示</h4>



<pre class="wp-block-code"><code># ntpq -p</code></pre>



<p>（<br>补充：<br>1) 此命令可能会显示多行，每一行显示一个时钟源的状态<br>2) 最左边有一个星号 “*” 的行代表目前正在被使用的时钟源，这代表这个时钟源可以被使用且最精确<br>）</p>



<h4>6.2 通过 timedatectl 命令显示</h4>



<pre class="wp-block-code"><code># timedatectl
               Local time: Fri 2020-06-12 09:52:30 EDT
           Universal time: Fri 2020-06-12 13:52:30 UTC
                 RTC time: Fri 2020-06-12 13:51:52
                Time zone: America/New_York (EDT, -0400)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no</code></pre>



<p>（补充：如果 NTP 时间同步正常，则此时 NTP service 的状态肯定是 active 状态）</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
