乡下人产国偷v产偷v自拍,国产午夜片在线观看,婷婷成人亚洲综合国产麻豆,久久综合给合久久狠狠狠9

  • <output id="e9wm2"></output>
    <s id="e9wm2"><nobr id="e9wm2"><ins id="e9wm2"></ins></nobr></s>

    • 分享

      NTP時(shí)間對(duì)時(shí)服務(wù)

       老玩童eivjpq7n 2021-05-19

      一. 為什么需要NTP

      · 為了讓服務(wù)器更安全

      · 為了讓時(shí)間同步更準(zhǔn)確

      二. 時(shí)間同步軟件

      NTP(Network Time Protocol,網(wǎng)絡(luò)時(shí)間協(xié)議)是用來(lái)使網(wǎng)絡(luò)中的各個(gè)計(jì)算機(jī)時(shí)間同步的一種協(xié)議。它的用途是把計(jì)算機(jī)的時(shí)鐘同步到世界協(xié)調(diào)時(shí)UTC,其精度在局域網(wǎng)內(nèi)可達(dá)0.1ms,在互聯(lián)網(wǎng)上絕大多數(shù)的地方其精度可以達(dá)到1-50ms。

      NTP服務(wù)器就是利用NTP協(xié)議提供時(shí)間同步服務(wù)的

      · NTP(CentOS6)

      · Chrony (CentOS7)

      二. 部署NTP服務(wù)器

      1. 安裝NTP服務(wù)

      [root@node01 ~]# yum -y install ntp

      2. 修改NTP配置文件

      [root@node01 ~]# mv /etc/ntp.conf /etc/ntp.conf.ori

      [root@node01 ~]# cat >/etc/ntp.conf << EOF
      > driftfile /var/lib/ntp/drift
      >
      > restrict default nomodify
      > restrict 172.16.1.0/24 192.168.10.0/24
      >
      > restrict ::1
      >
      > server ntp.aliyun.com iburst
      > server ntp.aliyun.com iburst
      > server ntp.aliyun.com iburst
      > server ntp.aliyun.com iburst
      > EOF

      注:其中nomodify(表示客戶(hù)端可以同步) notrap nopeer noquery(表示安全,開(kāi)啟后不能使用ntpstat ntpq -p這兩個(gè)命令)

      3. 關(guān)閉chronyd

      [root@node01 ~]# systemctl stop chronyd

      [root@node01 ~]# systemctl disable chronyd

      4. 啟動(dòng)NTP服務(wù)

      [root@node01 ~]# systemctl start ntpd.service

      [root@node01 ~]# systemctl status ntpd.service

      5. 測(cè)試NTP服務(wù)
      [root@node01 ~]# ntpq -p #查看NTP服務(wù)器和哪些上游服務(wù)器同步時(shí)間

      remote refid st t when poll reach delay offset jitter

      ==============================================================================
      *203.107.6.88 10.137.38.86 2 u 4 64 3 32.120 38.238 1.300

      st:即stratum階層,值越小表示ntp serve的精準(zhǔn)度越高

      when:幾秒前曾做過(guò)時(shí)間同步更新的操作

      Poll表示,每隔多少毫秒與ntp server同步一次

      reach:已經(jīng)向上層NTP服務(wù)器要求更新的次數(shù)

      delay:網(wǎng)絡(luò)傳輸過(guò)程鐘延遲的時(shí)間

      offset:時(shí)間補(bǔ)償?shù)慕Y(jié)果

      jitter:Linux系統(tǒng)時(shí)間與BIOS硬件時(shí)間的差異時(shí)間

      ==============================================================================

      [root@node01 ~]# ntpstat # 顯示本機(jī)上一次和服務(wù)器同步時(shí)間的情況

      synchronised to NTP server (203.107.6.88) at stratum 3

             time correct to within 1005 ms

             polling server every 64 s

      四. 部署Chronyc服務(wù)器

      1. 查看是否安裝chrony服務(wù)

      [root@node01 ~]# rpm -qa chrony

      chrony-3.4-1.el7.x86_64

      2. 修改chronyc配置文件

      [root@node01 ~]# vim /etc/chrony.conf

      3. 運(yùn)行程序

      [root@node01 ~]# systemctl start chronyd

      [root@node01 ~]# systemctl status chronyd

      4. 測(cè)試
      [root@node01 ~]# systemctl stop ntpd

      [root@node01 ~]# chronyc sources -v
      210 Number of sources = 2

      .-- Source mode '^' = server, '=' = peer, '#' = local clock.
      / .- Source state '*' = current synced, ' ' = combined , '-' = not combined,
      | / '?' = unreachable, 'x' = time may be in error, '~' = time too variable.
      || .- xxxx [ yyyy ] /- zzzz
      || Reachability register (octal) -. | xxxx = adjusted offset,
      || Log2(Polling interval) --. | | yyyy = measured offset,
      || \ | | zzzz = estimated error.
      || | | \
      MS Name/IP address Stratum Poll Reach LastRx Last sample
      ===============================================================================
      ^ 120.25.115.20 2 6 167 26 2845us[ 2845us] /- 21ms
      ^* 203.107.6.88 2 6 77 28 -2116us[-5914us] /- 29ms

      客戶(hù)端

      [root@web01 ~]# ntpdate 10.0.0.61

      21 Jun 18:47:08 ntpdate[6529]: step time server 10.0.0.61 offset 63.273886 sec

      6. 幾個(gè)命令

      chronyc sources -v - 查看時(shí)間同步源

      chronyc sourcestats -v - 查看時(shí)間同步源狀態(tài)

      imedatectl set-ntp yes - 啟用NTP時(shí)間同步

      cronyc tracking - 顯示系統(tǒng)時(shí)間信息

      chronyc accheck - 檢查NTP訪(fǎng)問(wèn)是否對(duì)特定主機(jī)可用

      chronyc activity - 該命令會(huì)顯示有多少NTP源在線(xiàn)/離線(xiàn)

      chronyc add server - 手動(dòng)添加一臺(tái)新的NTP服務(wù)器。

      chronyc clients - 在客戶(hù)端報(bào)告已訪(fǎng)問(wèn)到服務(wù)器

      chronyc delete - 手動(dòng)移除NTP服務(wù)器或?qū)Φ确?wù)器

      chronyc settime - 手動(dòng)設(shè)置守護(hù)進(jìn)程時(shí)間

      timedatectl set-local-rtc 1 設(shè)置硬件時(shí)間,硬件時(shí)間默認(rèn)為UTC

        本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶(hù)發(fā)布,不代表本站觀(guān)點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購(gòu)買(mǎi)等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
        轉(zhuǎn)藏 分享 獻(xiàn)花(0

        0條評(píng)論

        發(fā)表

        請(qǐng)遵守用戶(hù) 評(píng)論公約

        類(lèi)似文章 更多