华为ntp配置是什么意思

ntp服务器配置_百度文库
您的浏览器Javascript被禁用,需开启后体验完整功能,
享专业文档下载特权
&赠共享文档下载特权
&10W篇文档免费专享
&每天抽奖多种福利
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
ntp服务器配置
阅读已结束,下载本文需要
定制HR最喜欢的简历
下载文档到电脑,同时保存到云知识,更方便管理
加入VIP
还剩25页未读,
定制HR最喜欢的简历
你可能喜欢我们搭建集群环境的时候,时间必须是要统一的,才能保证集群数据的一致性。
一般操作是直接使用NTP,跟默认的时间服务器同步,但是最好还是让所有节点跟集群中的某台作为时间服务器的节点同步。
步骤:(节点有NameNode1,NameNode2,DataNode1,DataNode2,DataNode3)
选择一台服务器作为时间服务器。(DataNode1做为时间服务器)
使用root用户,查看服务器是否安装ntp服务&
rpm -qa|grep ntp
&没有安装的话使用yum&install进行安装。
&&修改文件 /etc/ntp.conf,一共修改三处内容:
& ①将#去掉。并且将网段修改正确。
restrict 192.168.0.0 mask 255.255.255.0 nomodify notrap
&②将以下4个server进行#注释掉
#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 127.127.1.0 #local clock
127.127.1.0 stratum 10
编辑etc/sysconfig/ntpd文件
# Drop root to id 'ntp:ntp' by default.
SYNC_HWCLOCK=yes
OPTIONS="-u ntp:ntp -p /var/run/ntpd.pid -g"
启动ntpd服务,并且设置开机启动
systemctl start ntpd.service
systemctl enable ntpd.service
每个需要同步的子节点进行确认有没有ntp。如果没有的话就安装下。
root账户下在每个需要同步的子节点编写crontab任务(crontab -e)。这个任务的意义就是每10分钟和master01同步下服务器时间。
0-59/10 * * * * /usr/sbin/ntpdate master01.timer.cn
1.作为时间服务器的节点的时间校准可以是人工指定(不与其他集群协作的情况下),也可以是跟其他组织的时间服务器同步
这里只说第二种情况。首先要确认当前服务器的时区
将时区设为上海
rm -rf /etc/localtime
ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
然后通过定时任务,与阿里云的时间服务器 ntp1.aliyun.com&同步(方法同上面第10步,ntp1~ntp7)
2.不同操作系统之间也是可以做时间同步的。linux与windows之间同步是没问题的。
阅读(...) 评论()扫一扫体验手机阅读
华为NTP配置实例
<span type="1" blog_id="2150045" userid='
2篇文章,590人气,0粉丝
高并发架构之路
¥51.00149人订阅
9本网络安全实战书籍精华
¥51.00511人订阅把华为交换机设置成时钟源服务器(NTP),提供给下面客户端Linux服务器使用,
1,先设置交换机的时区,和正确时间
# 假设地理位置在中国北京,设置本地时区名称为BJ。
如果系统默认的UTC是伦敦时间,伦敦当地时间为日0时0分0秒,想要得到对应的北京时间的方法是:北京处于+8时区,时间偏移量增加了8。在配置时,就是在系统默认的UTC时区的基础上,加上偏移量8,才能得到预期的BJ时区。
&HUAWEI& clock timezone BJ add 08:00:00&&&&&&&&&&&&&&&&
设置时区并在现在的UTC基础上偏移8
&HUAWEI& clock datetime 0:0:0 &&&&&&&&&&&&&&&&
这是设置时间的命令,设置成对应的北京时间就行。
2,开启交换机的NTP服务
# 使能NTP服务器功能。
[~HUAWEI] undo ntp server disable&&&&&&&&&&&&&&&& 开启NTP服务(默认关闭)
[*HUAWEI] commit
# 配置NTP主时钟,层数为2。
&[~HUAWEI] ntp refclock-master 2
[*HUAWEI] commit
3,下面的是NTP设置的更多功能,可以不配置
# 配置NTP认证功能,配置认证密钥并声明该密钥可信。
[~HUAWEI] ntp authentication enable
[*HUAWEI] ntp authentication-keyid 42 authentication-mode hmac-sha256 Hello@123456
[*HUAWEI] ntp trusted authentication-keyid 42
[*HUAWEI] commit
# 配置NTP主时钟,层数为2。
&HUAWEI& system-view
[~HUAWEI] ntp refclock-master 2
[*HUAWEI] commit
# 配置NTP认证功能,配置认证密钥并声明该密钥可信。
[~HUAWEI] ntp authentication enable
[*HUAWEI] ntp authentication-keyid 42 authentication-mode hmac-sha256 Hello@123456
[*HUAWEI] ntp trusted authentication-keyid 42
[*HUAWEI] commit
# 配置NTP广播服务器,从接口10GE1/0/1发送NTP广播报文,并指定使用密钥ID 42加密。
[~HUAWEI] interface 10ge 1/0/1
[~HUAWEI-10GE1/0/1] undo portswitch
[*HUAWEI-10GE1/0/1] ntp broadcast-server authentication-keyid 42
[*HUAWEI-10GE1/0/1] quit
[*HUAWEI] commit
# 使能NTP服务器功能。
[~HUAWEI] undo ntp server disable
[*HUAWEI] commit
# 配置NTP主时钟,层数为2。
&HUAWEI& system-view
[~HUAWEI] ntp refclock-master 2
[*HUAWEI] commit
# 配置NTP认证功能,配置认证密钥并声明该密钥可信。
[~HUAWEI] ntp authentication enable
[*HUAWEI] ntp authentication-keyid 42 authentication-mode hmac-sha256 Hello@123456
[*HUAWEI] ntp trusted authentication-keyid 42
[*HUAWEI] commit
# 配置NTP组播服务器,从接口10GE1/0/1发送NTP组播报文,并指定使用密钥ID 42加密。
[~HUAWEI] interface 10ge 1/0/1
[~HUAWEI-10GE1/0/1] undo portswitch
[*HUAWEI-10GE1/0/1] ntp multicast-server authentication-keyid 42
[*HUAWEI-10GE1/0/1] quit
[*HUAWEI] commit
# 使能NTP服务器功能。
[~HUAWEI] undo ntp server disable
[*HUAWEI] commit
# 配置NTP主时钟,层数为2。
&HUAWEI& system-view
[~HUAWEI] ntp refclock-master 2
[*HUAWEI] commit
# 配置NTP认证功能,配置认证密钥并声明该密钥可信。
[~HUAWEI] ntp authentication enable
[*HUAWEI] ntp authentication-keyid 42 authentication-mode hmac-sha256 Hello@123456
[*HUAWEI] ntp trusted authentication-keyid 42
[*HUAWEI] commit
# 配置NTP多播服务器,从接口10GE1/0/1发送NTP多播报文。
[~HUAWEI] interface 10ge 1/0/1
[~HUAWEI-10GE1/0/1] undo portswitch
[*HUAWEI-10GE1/0/1] ntp manycast-server
[*HUAWEI-10GE1/0/1] quit
[*HUAWEI] commit
# 使能NTP服务器功能。
[~HUAWEI] undo ntp server disable
[*HUAWEI] commit
阅读(...) 评论()NTP 配置实例
最新回复: 13:47:26
SwitchB、SwitchC和SwitchD在同一个局域网中并且通过网络和SwitchA相连。SwitchA的时间已经同步到权威时钟(卫星定位系统)。
用户要求由SwitchB、SwitchC和SwitchD组成的局域网中三台设备时间同步到SwitchA以保证计费业务的准确性。
根据TOP,配置IP地址,保证SwitchA,SwitchB,SwitchC和SwitchD路由可达
# 在SwitchA上配置IP地址,SwitchB、SwitchC和SwitchD的配置请参考配置文件。
&HUAWEI& system-view
[HUAWEI] sysname SwitchA
[SwitchA] vlan 100
[SwitchA-vlan100] quit
[SwitchA] interface vlanif 100
[SwitchA-Vlanif100] ip address 2.2.2.2 24
[SwitchA-Vlanif100] quit
[SwitchA] interface gigabitethernet 0/0/1
[SwitchA-GigabitEthernet0/0/1] port link-type hybrid
[SwitchA-GigabitEthernet0/0/1] port hybrid untagged vlan 100
[SwitchA-GigabitEthernet0/0/1] port hybrid pvid vlan 100
[SwitchA-GigabitEthernet0/0/1] quit
[SwitchA] ospf 1
[SwitchA-ospf-1] area 0
[SwitchA-ospf-1-area-0.0.0.0] network 2.2.2.0 0.0.0.255
[SwitchA-ospf-1-area-0.0.0.0] quit
[SwitchA-ospf-1] quit
在SwitchA上配置NTP主时钟并启动NTP认证功能
# 在SwitchA上指定使用自己的本地时钟作为主时钟,层数为2。
[SwitchA] ntp-service refclock-master 2
# 使能NTP认证功能、配置验证密钥并声明该密钥可信。
[SwitchA] ntp-service authentication enable
[SwitchA] ntp-service authentication-keyid 42 authentication-mode md5 Hello123
[SwitchA] ntp-service reliable authentication-keyid 42
在SwitchB上配置NTP主时钟并启动NTP认证功能
# 在SwitchB上使能NTP认证功能、配置验证密钥并声明该密钥可信。
&SwitchB& system-view
[SwitchB] ntp-service authentication enable
[SwitchB] ntp-service authentication-keyid 42 authentication-mode md5 Hello123
[SwitchB] ntp-service reliable authentication-keyid 42
# 指定SwitchA作为SwitchB的NTP服务器,并使用已配置的验证密钥。
[SwitchB] ntp-service unicast-server 2.2.2.2 authentication-keyid 42
在SwitchC上指定SwitchB作为SwitchC的NTP服务器
&SwitchC& system-view
[SwitchC] ntp-service authentication enable
[SwitchC] ntp-service authentication-keyid 42 authentication-mode md5 Hello123
[SwitchC] ntp-service reliable authentication-keyid 42
[SwitchC] ntp-service unicast-server 1.0.0.1 authentication-keyid 42
在SwitchD上指定SwitchB作为SwitchD的NTP服务器
&SwitchD& system-view
[SwitchD] ntp-service authentication enable
[SwitchD] ntp-service authentication-keyid 42 authentication-mode md5 Hello123
[SwitchD] ntp-service reliable authentication-keyid 42
[SwitchD] ntp-service unicast-server 1.0.0.1 authentication-keyid 42
除了通过NTP配置时钟,还可以通过手动配置时间:
设置系统的日期、时间和时区
&HUAWEI& clock timezone BJ add 08:00:00
&HUAWEI& clock datetime 20:10:0
多谢楼主分享~~
* 是否包含第三方商业秘密:
第三方商业秘密
第三方商业秘密是指第三方不为公众所知悉、具有商业价值并经权利人采取保密措施的技术信息和经营信息,包括但不限于:产品的价格信息、路标规划、商务授权、核心算法和源代码等。如有疑问,请联系:e.(各社区公共邮箱)。
如果附件按钮无法使用,请将Adobe Flash Player 更新到最新版本!}

我要回帖

更多关于 华为交换机ntp 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信