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
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
相关文章推荐
- Linux---CentOS 定时运行脚本配置
- linux配置文件错误,无法启动进入系统 centos 6.21 Disconnected from system bus
- Linux-CentOS下的Python运行环境配置
- CentOS 5.2,Linux 2.6+ 内核 ,Apache+MySQL+PHP 安装及基本配置过程记录 && 将apache安装为系统服务
- Linux-CentOS XAMPP Apache配置多端口
- Linux-centos虚拟机克隆后修改网络配置
- Linux下centOS 6.5 配置Tomcat 8.0+版本
- 开发人员学Linux(11):CentOS7安装配置持续集成工具Jenkins
- Linux 下配置IP地址和DNS(centOS)
- Linux(CentOS)下安装配置和使用PostgreSQL数据库
- 配置python3+django+linux(centos的环境)
- Linux-CentOS 安装配置swftools
- Linux工具XFTP、Xshell(centos配置java环境 工具篇 总结一)
- centos下利用yum安装LAMP(Linux+Apache+MySQL+PHP)及配置
- Linux(CentOS)下的apache服务器配置与管理
- Linux(CentOS)下的JDK的安装和环境配置
- CentOS Linux下Java环境的安装和配置 (CentOS+JDK1.6.0_11)
- linux教程:配置Tomcat开机启动 centos7
- CentOS/Linux 网卡设置 IP地址配置
- 阿里云服务器Linux CentOS安装配置(九)shell编译、打包、部署