<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                # 時間服務器 ## 1 概念 ### 1.1 作用 NTP(Network Time Protocol,網絡時間協議)是用來使網絡中的各個計算機時間同步的一種協議。它的用途是把計算機的時鐘同步到世界協調時UTC,其精度在局域網內可達0.1ms,在互聯網上絕大多數的地方其精度可以達到1-50ms。 NTP服務器就是利用NTP協議提供時間同步服務的 ### 1.2 常用軟件 * ntp軟件 CentOS6自帶 地址: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html-single/system_administrators_guide/ * chrony軟件 CentOS7自帶,比ntp的優勢在于不需要做定時任務,只需要每個服務器配置好內網時間服務器地址并啟用chrony即可 ### 1.3 主機信息 IP規劃為10.0.0.62/172.16.1.62 主機名為m02 主機版本centos7 ## 2 時間服務器部署1[ntp] ### 2.1 軟件安裝 核實ntp軟件包是否安裝,備份配置文件 ```sh rpm -qa ntp yum -y install ntp cp /etc/ntp.conf{,.bak} ``` ### 2.2 修改配置 ```sh cat >/etc/ntp.conf <<EOF restrict default kod nomodify notrap nopeer noquery restrict 172.16.1.0/24 10.0.0.0/24 server ntp1.aliyun.com server time.nist.gov EOF ``` ### 2.3 啟動ntp服務 1) centos6 ```sh /etc/init.d/ntpd start chkconfig ntpd on chkconfig --list ntpd ``` 時間服務器搭建完成,其他客戶端機上只需要做定時任務同步時間即可 2) centos7 ```sh systemctl start ntpd systemctl enable ntpd ``` 3) 定時任務范例 ``` #times sync by noah.luo at 2018-06-02 */5 * * * * /usr/sbin/ntpdate ntp1.aliyun.com >/dev/null 2>&1 ``` ## 3 時間服務器部署2[chrony] ### 3.1 軟件安裝 ```sh rpm -qa chrony yum -y install chrony ``` ### 3.2 修改配置 1) sed替換 ```sh sed -i 's#0.rhel.pool.ntp.org#ntp1.aliyun.com#g' /etc/chrony.conf sed -i 's#1.rhel.pool.ntp.org#ntp2.aliyun.com#g' /etc/chrony.conf sed -i 's#2.rhel.pool.ntp.org#ntp3.aliyun.com#g' /etc/chrony.conf sed -i 's#3.rhel.pool.ntp.org#ntp4.aliyun.com#g' /etc/chrony.conf sed -ri 's#^\#allow.*#allow 10.0.0\nallow 172.16.1#g' /etc/chrony.conf ``` 2) 結果驗證 ```sh egrep "^allow|^server" /etc/chrony.conf server ntp1.aliyun.com iburst server ntp2.aliyun.com iburst server ntp3.aliyun.com iburst server ntp4.aliyun.com iburst allow 10.0.0 allow 172.16.1 ``` ### 3.3 啟動服務 1) centos6方法 ```sh /etc/init.d/chronyd start chkconfig chronyd on chkconfig --list chronyd ``` 2) centos7方法 ```sh systemctl start chronyd.service systemctl enable chronyd.service ``` 3) 客戶端時間同步 * chrony方法 安裝chrony程序,然后將server配置成剛剛搭建的內網服務器并設置好開機自啟動 * ntp方法 安裝ntp軟件,用定時任務的方式來實現 ``` #times sync by noah.luo at 2018-06-02 */5 * * * * /usr/sbin/ntpdate ntp1.aliyun.com >/dev/null 2>&1 ``` ## 4 擴展-用windows主機做ntp服務器 ``` 輸入regedit,進入注冊表編輯器: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\W32Time\Config 修改AnnounceFlags值為5 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\W32Time\TimeProviders\NtpServer 修改Enabled值為1 再在服務器中,將windows time服務設置為延遲啟動并立即啟動 ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看