工商注册在哪个网站中文设置wordpress

当前位置: 首页 > news >正文

工商注册在哪个网站,中文设置wordpress,led网站建设方案模板,西安网站建设技术定义 NTP是用来使计算机时间同步化的一种协议#xff0c;全称是Network Time Protocol。它可以使计算机对其服务器或时钟源做同步化#xff0c;可以提供高精准度的时间校正。它可以在大规模的设备范围内同步矫正时间到几ms级别的精度#xff0c;在网络稳定的局域网内#…定义 NTP是用来使计算机时间同步化的一种协议全称是Network Time Protocol。它可以使计算机对其服务器或时钟源做同步化可以提供高精准度的时间校正。它可以在大规模的设备范围内同步矫正时间到几ms级别的精度在网络稳定的局域网内精度甚至可以达到微秒级别。 以什么为基准去同步 UTC协调世界时是基于标准的GMT格林尼治标准时间Greenwich Mean Time提供的准确时间。现在一般都是使用UTC也就是原子钟统一同步全世界的时间。{{ 时间戳 是1970年数字世界内至今。}} 架构 对于一些服务依赖于时间的集群例如Hadoop集群Zookeeper集群就需要有一部主机作为ntp服务器其他客户端主机从这部主机进行时间同步另外ntp服务主机从更高一层的服务器获得时间信息。 NTP同步方式在linux下一般两种使用ntpdate命令直接同步和使用NTPD服务平滑同步。 使用ntpdate命令直接同步的方式存在风险比如一些定时任务在已有时间内执行过直接同步导致时间变回任务执行前的时间段定时任务会重复执行。 使用NTPD服务平滑同步的方式不会让一个时间点在一天内经历两次而是平滑同步时间它每次同步时间的偏移量不会太陡是慢慢来的。 安装配置 实验环境 centos7.9 虚拟机两台 NTP服务器192.168.182.50 NTP客户端192.168.229.50 关闭防火墙systemctl stop firewalldsetenforce 0 手动随便设定个时间date -s 2010-10-10 10:10:10yum install -y ntp vi /etc/ntp.conf server ntp1.aliyun.com server 127.0.0.1 server 192.168.182.50 systemctl start ntpd systemctl enable ntpd –now查看是否安装NTP 一般CentOS系统自带了该服务可以通过下面的命令检查是否安装。 rpm -qa | grep ntp如果有输出ntp和ntpdate版本信息即已安装。 ntp 作为时间服务器 ntpdate 时间同步某台服务器 安装ntpd yum install -y ntpNTP命令

查看服务状态

service ntpd status# 启动ntpd服务 systemctl start ntpd.service# 停止ntpd服务 systemctl stop ntpd.service# 设置开机自启动 systemctl enable ntpd.service# 停止开机自启动 systemctl disable ntpd.service# 查看服务当前状态 systemctl status ntpd.service# 重新启动服务 systemctl restart ntpd.service# 查看所有已启动的服务 systemctl list-units –typeservice搭建ntp服务器给局域网内的其它机器提供授时服务以同步全局域网内的时间保持一致提供集群部署的环境。 修改服务端配置文件 vim /etc/ntp.conf

For more information about this file, see the man pages

ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_mon(5).driftfile /var/lib/ntp/drift# Permit time synchronization with our time source, but do not

permit the source to query or modify the service on this system.

restrict default nomodify notrap nopeer noquery restrict 192.168.182.50 nomodify notrap nopeer noquery ##当前节点IP地址 restrict: 限制访问权限只有本地用户和指定的用户才能修改chronyd的配置。default: 设置默认的访问权限如果没有指定其他用户那么只有root用户可以修改chronyd的配置。nomodify: 禁止修改chronyd的配置。notrap: 禁止发送通知给其他用户或系统管理员。nopeer: 禁止从NTP服务器获取时间信息。noquery: 禁止查询当前系统的时间信息。# Permit all access over the loopback interface. This could

be tightened as well, but to do so would effect some of

the administrative functions.

restrict ntp.sjtu.edu.cn perfer # 放行 ntp.sjtu.edu.cn 进入本 NTP 的服务器 restrict 127.0.0.1 restrict ::1# Hosts on local network are less restricted. #restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap

授权192.168.182.0网段上所有机器可以从这台机器上查询和时间同步

restrict 192.168.182.0 mask 255.255.255.0 nomodify notrap ### 集群所在网段、掩码、权限

权限的设定主要以restrict这个参数来设定主要的语法为restrict IP地址 mask 子网掩码 参数

其中IP可以是IP地址也可以是defaultdefault是指所有的IP默认是default如果为了安全可以将default替换为网段192.168.182.0/24restrict选项格式 “客户端IP” 和 “IP掩码” 指定了对网络中哪些范围的计算机进行控制如果使用default关键字则表示对所有的计算机进行控制参数指定了具体的限制内容常见的参数如下 ◆ ignore拒绝连接到NTP服务器 即关闭所有的 NTP 联机服务 ◆ nomodify 客户端不能更改服务端的时间参数但是客户端可以通过服务端进行网络校时。 ◆ noquery 不提供客户端的时间查询 ◆ notrap 不提供trap远程登录功能trap服务是一种远程时间日志服务。 ◆ notrust 客户端除非通过认证否则该客户端来源将被视为不信任子网 。 ◆ nopeer 提供时间服务但不作为对等体。 ◆ kod 向不安全的访问者发送Kiss-Of-Death报文。# Use public servers from the pool.ntp.org project.

Please consider joining the pool (http://www.pool.ntp.org/join.html).

#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

注释掉原有的server 0-n

server ntp.sjtu.edu.cn prefer # prefer server 127.127.1.0 #指定了Chrony服务器的IP地址为本地回环地址127.127.1.0这意味着Chrony将使用本机作为时间服务器。 fudge 127.127.1.0 stratum 10 #当与服务器通信失败时Chrony会尝试从本地时间偏移10秒进行修正。 server选项格式 server host [ key n ] [ version n ] [ prefer ] [ mode n ] [ minpoll n ] [ maxpoll n ] [ iburst ] 其中host是上层NTP服务器的IP地址或域名随后所跟的参数解释如下所示 ◆ key 表示所有发往服务器的报文包含有秘钥加密的认证信息n是32位的整数表示秘钥号。 ◆ version 表示发往上层服务器的报文使用的版本号n默认是3可以是1或者2。 ◆ prefer 如果有多个server选项具有该参数的服务器优先使用。 ◆ mode 指定数据报文mode字段的值。 ◆ minpoll 指定与查询该服务器的最小时间间隔为2的n次方秒n默认为6范围为4-14。 ◆ maxpoll 指定与查询该服务器的最大时间间隔为2的n次方秒n默认为10范围为4-14。 ◆ iburst 当初始同步请求时采用突发方式接连发送8个报文时间间隔为2秒。#broadcast 192.168.1.255 autokey # broadcast server #broadcastclient # broadcast client #broadcast 224.0.1.1 autokey # multicast server #multicastclient 224.0.1.1 # multicast client #manycastserver 239.255.254.254 # manycast server #manycastclient 239.255.254.254 autokey # manycast client# Enable public key cryptography. #cryptoincludefile /etc/ntp/crypto/pw# Key file containing the keys and key identifiers used when operating

with symmetric key cryptography.

keys /etc/ntp/keys# Specify the key identifiers which are trusted. #trustedkey 4 8 42# Specify the key identifier to use with the ntpdc utility. #requestkey 8# Specify the key identifier to use with the ntpq utility. #controlkey 8# Enable writing of statistics records. #statistics clockstats cryptostats loopstats peerstats# Disable the monitoring facility to prevent amplification attacks using ntpdc

monlist command when default restrict does not include the noquery flag. See

CVE-2013-5211 for more details.

Note: Monitoring will not be disabled with the limited restriction flag.

disable monitor引用其他博客的/etc/ntp.conf 配置内容

  1. 先处理权限方面的问题包括放行上层服务器以及开放局域网用户来源restrict default kod nomodify notrap nopeer noquery 拒绝 IPv4 的用户restrict -6 default kod nomodify notrap nopeer noquery 拒绝 IPv6 的用户restrict 220.130.158.71 放行 tock.stdtime.gov.tw 进入本 NTP 的服务器restrict 59.124.196.83放行 tick.stdtime.gov.tw 进入本 NTP 的服务器restrict 59.124.196.84放行 time.stdtime.gov.tw 进入本 NTP 的服务器restrict 127.0.0.1底下两个是默认值放行本机来源restrict -6 ::1restrict 192.168.100.0 mask 255.255.255.0 nomodify 放行局域网用户来源或者列出单独IP2. 设定主机来源请先将原本的 [0|1|2].centos.pool.ntp.org 的设定批注掉server 220.130.158.71 prefer 以这部主机为最优先的serverserver 59.124.196.83server 59.124.196.843.默认的一个内部时钟数据用在没有外部 NTP 服务器时使用它为局域网用户提供服务server127.127.1.0 # local clockfudge 127.127.1.0 stratum 104.预设时间差异分析档案与暂不用到的 keys 等不需要更动它driftfile /var/lib/ntp/driftkeys /etc/ntp/keys启动服务设置开机自启 systemctl start ntpd systemctl enable ntpdntpq -p #查看当前服务器与上层 ntp 的状态remote - 本机和上层ntp的ip或主机名“”有连线可做候选“*”正在使用的 refid - 更上一层的ntp地址 st - stratum的 级别 when - 多少秒前曾经同步过时间 poll - 下次更新在多少秒后 reach - 已经向上层ntp服务器要求更新的次数 delay - 网络延迟 offset - 时间补偿 jitter - 系统时间与bios时间差查看服务器ntp服务状态 [rootlocalhost ~]# ntpstatunsynchronisedtime server re-startingpolling server every 8 s表示同步上级时间服务器成功。立即查看时间没有同步不用担心等待5到10分钟后再次查看再次查看时间 date 修改客户端配置文件 vim /etc/ntp.conf restrict 192.168.229.50 nomodify notrap nopeer noquery #当前节点IP地址 restrict 192.168.229.0 mask 255.255.255.0 nomodify notrap #集群所在网段的网段子网掩码 server 192.168.182.50 iburst #NTP服务器IP地址可以注释掉别的server或者在需要配置的ntp服务器后添加perfer–优先提高优先级如server 192.168.182.50 perfer iburst fudge 192.168.182.50 stratum 10查看ntp服务状态

    查看ntp服务状态

    systemctl status ntpd# 查看ntp链接状态 ntpq -premote refid st t when poll reach delay offset jitterLOCAL(0) .LOCL. 10 l 10 64 377 0.000 0.000 0.000 remote 详细说明了我们连接到的NTP服务器。 # 本机和上层ntp的ip或主机名“”有连线可做候选“”正在使用的refid 表示远程服务器连接的NTP服务器。 # 上一层服务器st 指的是服务器的层级指的是服务器离我们有多“近”(数字越低越“近”通常越好)。t 表示类型具体来说是服务器使用单播、广播、多播还是多播。when 指的是距离上次轮询服务器的时间有多长。poll 表明服务器将被轮询的频率对于示例屏幕截图中的大多数条目轮询时间为64秒。reach 包含最近8次NTP更新的结果。如果所有8个都成功这个字段将读取377。#这个数字是八进制的正常情况下值为[0, 1, 3, 7, 17, 37, 77, 177, 377]对应的二进制为[0, 1, 11, 111, 1111, 11111, 111111, 1111111, 11111111],所以8个成功的八进制数将被表示为377。当您第一次在服务器上启动ntp守护进程时这个数字可能需要一段时间才能达到377。delay 表示到达服务器的延迟时间单位为毫秒。offset 指的是本地时钟和服务器时钟之间的差异。jitter 指的是remote和refid服务器之间的网络延迟。######## 查看端口netstat -anup | grep 123 udp 0 0 192.168.182.50:123 0.0.0.0:* 2604/ntpd
    udp 0 0 127.0.0.1:123 0.0.0.0:* 2604/ntpd
    udp6 0 0 ::1:123 :::* 2604/ntpd 错误 no server suitable for synchronization found 原因 在ntp server上重新启动ntp服务后ntp server自身或者与其server的同步的需要一个时间段这个过程可能是5分钟在这个时间之内在客户端运行ntpdate命令时会产生no server suitable for synchronization found的错误。 那么如何知道何时ntp server完成了和自身同步的过程呢 在ntp server上使用命令 watch ntpq -pntp服务启动后reach就以poll值为周期与ntp server通信为了方便理解我们可以简单的认为每次ping一下上层ntp server如果成功那reach就向左移一位右边补1如果失败则右边补0所以如果reach不是上面给出的枚举值那就是在通信过程中出错了。当reach 达到17时对应1111即最近的四次通信都成功了那才开始同步时间这时remote项对应的域名或IP列表有其中一个前面会有*号表示该IP就是NTP server。而在开始同步时间之前当客户端访问weblbserver-1这个NTP server时都会出现stratum 16no server suitable fornchronization found这样的错误。也就是说如果你在NTP server主机上重启了ntp服务那要等4poll秒在前四次通信都是成功的前提下该NTP server才与上层NTP server开始同步时间而且只有当开始同步时该NTP server才能为其它客户端提供NTP服务。因此你在/etc/ntp.conf中设置的同步周期minpoll maxpoll不能太大因为每次ntp服务重启后要等4倍长的时间才能开始同步。 让linux运行ntpdate更新时间时linux不能开启NTP服务否则会提示端口被占用如下 [rootntp_client ~]# ntpdate ntp_server 30 Nov 09:50:59 ntpdate[4394]: the NTP socket is in use, exiting同步硬件时钟 ntp服务默认只会同步系统时间。如果想要让ntp同时同步硬件时间可以设置/etc/sysconfig/ntpd文件在/etc/sysconfig/ntpd文件中 添加【SYNC_HWCLOCKyes】就可以让硬件时间与系统时间一起同步。允许BIOS与系统时间同步也可以通过 hwclock -w 命令。 国内常用NTP服务器地址及IP 210.72.145.44 (国家授时中心服务器IP地址)
    133.100.11.8 日本 福冈大学
    time-a.nist.gov 129.6.15.28 NIST, Gaithersburg, Maryland
    time-b.nist.gov 129.6.15.29 NIST, Gaithersburg, Maryland
    time-a.timefreq.bldrdoc.gov 132.163.4.101 NIST, Boulder, Colorado
    time-b.timefreq.bldrdoc.gov 132.163.4.102 NIST, Boulder, Colorado
    time-c.timefreq.bldrdoc.gov 132.163.4.103 NIST, Boulder, Colorado
    utcnist.colorado.edu 128.138.140.44 University of Colorado, Boulder
    time.nist.gov 192.43.244.18 NCAR, Boulder, Colorado
    time-nw.nist.gov 131.107.1.10 Microsoft, Redmond, Washington
    nist1.symmetricom.com 69.25.96.13 Symmetricom, San Jose, California
    nist1-dc.glassey.com 216.200.93.8 Abovenet, Virginia
    nist1-ny.glassey.com 208.184.49.9 Abovenet, New York City
    nist1-sj.glassey.com 207.126.98.204 Abovenet, San Jose, California
    nist1.aol-ca.truetime.com 207.200.81.113 TrueTime, AOL facility, Sunnyvale, California
    nist1.aol-va.truetime.com 64.236.96.53 TrueTime, AOL facility, Virginia
    ————————————————————————————————————
    ntp.sjtu.edu.cn 202.120.2.101 (上海交通大学网络中心NTP服务器地址
    s1a.time.edu.cn 北京邮电大学
    s1b.time.edu.cn 清华大学
    s1c.time.edu.cn 北京大学
    s1d.time.edu.cn 东南大学
    s1e.time.edu.cn 清华大学
    s2a.time.edu.cn 清华大学
    s2b.time.edu.cn 清华大学
    s2c.time.edu.cn 北京邮电大学
    s2d.time.edu.cn 西南地区网络中心
    s2e.time.edu.cn 西北地区网络中心
    s2f.time.edu.cn 东北地区网络中心
    s2g.time.edu.cn 华东南地区网络中心
    s2h.time.edu.cn 四川大学网络管理中心
    s2j.time.edu.cn 大连理工大学网络中心
    s2k.time.edu.cn CERNET桂林主节点
    s2m.time.edu.cn 北京大学 ntp.aliyun.com 阿里云时钟的跃变问题 什么是时钟跃变前面提到过ntpdate是直接同步更新时间是线性的更新这就造成有可能两个时间点更新前是一个时间点更新后是一个时间点时间倒流比如更新前时间是0点0分5秒更新后时间是0点0分0秒或者两个时间点不变这就造成了时间静止例如如果ntpdate发现你的时间快了则可能会经历两个相同的时刻对某些应用而言这是致命的。 问题第一这样做不安全。ntpdate的设置依赖于ntp服务器的安全性***者可以利用一些软件设计上的缺陷拿下ntp服务器并令与其同步的服务器执行某些消耗性的任务。由于ntpdate采用的方式是跳变跟随它的服务器无法知道是否发生了异常时间不一样的时候唯一的办法是以服务器为准。第二这样做不精确。一旦ntp服务器宕机跟随它的服务器也就会无法同步时间。与此不同ntpd不仅能够校准计算机的时间而且能够校准计算机的时钟。第三这样做不够优雅。由于是跳变而不是使时间变快或变慢依赖时序的程序会出错例如如果ntpdate发现你的时间快了则可能会经历两个相同的时刻对某些应用而言这是致命的。因而唯一一个可以令时间发生跳变的点是计算机刚刚启动但还没有启动很多服务的那个时候。其余的时候理想的做法是使用ntpd来校准时钟而不是调整计算机时钟上的时间。 BUTNTPD 在和时间服务器的同步过程中会把 BIOS 计时器的振荡频率偏差——或者说 Local Clock 的自然漂移(drift)——记录下来。这样即使网络有问题本机仍然能维持一个相当精确的走时。