您的位置:首页 > 运维架构 > Linux

centos配置linuxptp

2018-02-10 09:19 4259 查看
centos配置linuxptp
redhad配置ptp https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/deployment_guide/ch-configuring_ptp_using_ptp4l#s2-Advantages_of_PTP ptp资料  https://events.static.linuxfound.org/sites/events/files/slides/lcjp14_ichikawa_0.pdf linuxptp项目地址  http://linuxptp.sourceforge.net/ IEEE1588   http://blog.sina.com.cn/s/blog_4b0cdab70100k4fv.html
systemd服务使用  http://blog.csdn.net/wzyzzu/article/details/44171319
一、linuxptp安装

1、yum直接安装: yum -y install linuxptp

2、git下载源码安装: 安装git工具 yum -y install git

下载linuxptp-code项目 git clone https://git.code.sf.net/p/linuxptp/code linuxptp-code

进入下载的linuxptp-code目录 cd linuxptp-code

编译源代码,并安装到系统 make make install

二、linuxptp使用 使用硬件时间戳时,ptp4l用于调整PHC时钟,phc2sys调整系统时钟; 使用软件时间戳时,ptp4l直接调整系统时钟; ptp4l默认工作为master模式,使用-s可设置为slave模式。

(以下命令需要使用root权限,使用yum直接安装的linuxptp为例)1、检查网卡的驱动支持情况 ethtool -T eth0

2、ptp4l 硬件时间戳模式 ptp4l -i eth3 -m

软件时间戳模式 ptp4l -i eth3 -m -S

配置文件使用   -f /etc/ptp4l.conf -s 为slave 模式,默认为master模式

开机启动ptp4l a、修改/etc/sysconfig/ptp4l PTIONS="-f /etc/ptp4l.conf -i eth3 -s" b、启动ptp4l systemctl start ptp4l c、设置开机启动 systemctl enable ptp4l

3、pmc 获取ptp4l运行信息 -b 0为本地ptp4l的运行信息 pmc -u -b 0 'GET CURRENT_DATA_SET' pmc -u -b 0 'GET TIME_STATUS_NP'

4、phc2sys 系统时间钟同步到ptp4l应用程序同步的时钟 phc2sys -a -r

系统时钟同步到特定的PHC时钟 phc2sys -s eth3 -w

开机启动phc2sys a、修改/etc/sysconfig/phc2sys PTIONS="-a -r" b、启动ptp4l systemctl start phc2sys

c、设置开机启动 systemctl enable phc2sys 三、禁用NTP时间1、配置 /etc/ntp.conf server   127.127.1.0 fudge    127.127.1.0 stratum 0

2、文件中/etc/sysconfig/network增加如下所示: PEERNTP=no

3、ntpd服务关闭 临时关闭 service ntpd stop  永久性关闭 chkconfig ntpd off systemctl disable ntpd systemctl disable chronyd systemctl disable ntpdate
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  linuxptp centos