apiVersion: v1
kind: Namespace
metadata:
name: openshift-ptp
annotations:
workload.openshift.io/allowed: management
labels:
name: openshift-ptp
openshift.io/cluster-monitoring: "true"
PTP 运算符将NodePtpDevice.ptp.openshift.io
自定义资源定义 (CRD) 添加到 OpenShift Container Platform。
安装后,PTP 运算符会在每个节点上搜索集群中支持精密时间协议 (PTP) 的网络设备。运算符会为每个提供兼容 PTP 网络设备的节点创建一个并更新NodePtpDevice
自定义资源 (CR) 对象。
具有内置 PTP 功能的网络接口控制器 (NIC) 硬件有时需要特定于设备的配置。您可以通过在PtpConfig
自定义资源 (CR) 中配置插件,为支持 PTP 运营商的支持硬件使用特定于硬件的 NIC 功能。linuxptp-daemon
服务使用plugin
段落中的命名参数,根据具体的硬件配置启动linuxptp
进程、ptp4l
和phc2sys
。
在 OpenShift Container Platform 4.17 中,Intel E810 NIC 受支持,并带有 |
作为集群管理员,您可以使用 CLI 安装运营商。
在裸机硬件上安装的集群,其节点具有支持 PTP 的硬件。
安装 OpenShift CLI (oc
)。
以具有cluster-admin
权限的用户身份登录。
为 PTP 运营商创建一个命名空间。
将以下 YAML 保存到ptp-namespace.yaml
文件中
apiVersion: v1
kind: Namespace
metadata:
name: openshift-ptp
annotations:
workload.openshift.io/allowed: management
labels:
name: openshift-ptp
openshift.io/cluster-monitoring: "true"
创建Namespace
CR
$ oc create -f ptp-namespace.yaml
为 PTP 运营商创建一个运营商组。
将以下 YAML 保存到ptp-operatorgroup.yaml
文件中
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
name: ptp-operators
namespace: openshift-ptp
spec:
targetNamespaces:
- openshift-ptp
创建OperatorGroup
CR
$ oc create -f ptp-operatorgroup.yaml
订阅 PTP 运营商。
将以下 YAML 保存到ptp-sub.yaml
文件中
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: ptp-operator-subscription
namespace: openshift-ptp
spec:
channel: "stable"
name: ptp-operator
source: redhat-operators
sourceNamespace: openshift-marketplace
创建Subscription
CR
$ oc create -f ptp-sub.yaml
要验证运营商是否已安装,请输入以下命令
$ oc get csv -n openshift-ptp -o custom-columns=Name:.metadata.name,Phase:.status.phase
Name Phase
4.17.0-202301261535 Succeeded
作为集群管理员,您可以使用 Web 控制台安装 PTP 运营商。
您必须创建命名空间和运营商组,如上一节所述。 |
使用 OpenShift Container Platform Web 控制台安装 PTP 运营商
在 OpenShift Container Platform Web 控制台中,单击运营商 → OperatorHub。
从可用运营商列表中选择PTP 运营商,然后单击安装。
在安装运营商页面上的集群上的特定命名空间下,选择openshift-ptp。然后,单击安装。
可选:验证 PTP 运营商是否已成功安装
切换到运营商 → 已安装的运营商页面。
确保PTP 运营商列在openshift-ptp项目中,其状态为InstallSucceeded。
在安装过程中,运营商可能会显示失败状态。如果安装稍后成功并显示InstallSucceeded消息,则可以忽略失败消息。 |
如果运营商未显示为已安装,请进一步进行故障排除
转到运营商 → 已安装的运营商页面,并检查运营商订阅和安装计划选项卡中状态下的任何故障或错误。
转到工作负载 → Pod页面,并检查openshift-ptp
项目中 Pod 的日志。
识别集群中存在的支持 PTP 的网络设备,以便您可以对其进行配置
您已安装 PTP 运营商。
要返回集群中所有支持 PTP 的网络设备的完整列表,请运行以下命令
$ oc get NodePtpDevice -n openshift-ptp -o yaml
apiVersion: v1
items:
- apiVersion: ptp.openshift.io/v1
kind: NodePtpDevice
metadata:
creationTimestamp: "2022-01-27T15:16:28Z"
generation: 1
name: dev-worker-0 (1)
namespace: openshift-ptp
resourceVersion: "6538103"
uid: d42fc9ad-bcbf-4590-b6d8-b676c642781a
spec: {}
status:
devices: (2)
- name: eno1
- name: eno2
- name: eno3
- name: eno4
- name: enp5s0f0
- name: enp5s0f1
...
1 | name 参数的值与父节点的名称相同。 |
2 | devices 集合包含 PTP 运营商为节点发现的支持 PTP 设备的列表。 |
您可以通过创建一个配置主机 NIC 的PtpConfig
自定义资源 (CR),将linuxptp
服务 (ptp4l
、phc2sys
、ts2phc
) 配置为主时钟 (T-GM)。
ts2phc
实用程序允许您将系统时钟与 PTP 主时钟同步,以便节点可以将精确时钟信号流式传输到下游 PTP 普通时钟和边界时钟。
使用以下示例 要配置 PTP 快速事件,请为 |
对于生产环境中的 T-GM 时钟,请在裸机集群主机中安装 Intel E810 Westport Channel NIC。
安装 OpenShift CLI (oc
)。
以具有cluster-admin
权限的用户身份登录。
安装 PTP 运营商。
创建PtpConfig
CR。例如
根据您的需求,为您的部署使用以下 T-GM 配置之一。将 YAML 保存到grandmaster-clock-ptp-config.yaml
文件中
apiVersion: ptp.openshift.io/v1
kind: PtpConfig
metadata:
name: grandmaster
namespace: openshift-ptp
annotations: {}
spec:
profile:
- name: "grandmaster"
ptp4lOpts: "-2 --summary_interval -4"
phc2sysOpts: -r -u 0 -m -w -N 8 -R 16 -s $iface_master -n 24
ptpSchedulingPolicy: SCHED_FIFO
ptpSchedulingPriority: 10
ptpSettings:
logReduce: "true"
plugins:
e810:
enableDefaultConfig: false
settings:
LocalMaxHoldoverOffSet: 1500
LocalHoldoverTimeout: 14400
MaxInSpecOffset: 100
pins: $e810_pins
# "$iface_master":
# "U.FL2": "0 2"
# "U.FL1": "0 1"
# "SMA2": "0 2"
# "SMA1": "0 1"
ublxCmds:
- args: #ubxtool -P 29.20 -z CFG-HW-ANT_CFG_VOLTCTRL,1
- "-P"
- "29.20"
- "-z"
- "CFG-HW-ANT_CFG_VOLTCTRL,1"
reportOutput: false
- args: #ubxtool -P 29.20 -e GPS
- "-P"
- "29.20"
- "-e"
- "GPS"
reportOutput: false
- args: #ubxtool -P 29.20 -d Galileo
- "-P"
- "29.20"
- "-d"
- "Galileo"
reportOutput: false
- args: #ubxtool -P 29.20 -d GLONASS
- "-P"
- "29.20"
- "-d"
- "GLONASS"
reportOutput: false
- args: #ubxtool -P 29.20 -d BeiDou
- "-P"
- "29.20"
- "-d"
- "BeiDou"
reportOutput: false
- args: #ubxtool -P 29.20 -d SBAS
- "-P"
- "29.20"
- "-d"
- "SBAS"
reportOutput: false
- args: #ubxtool -P 29.20 -t -w 5 -v 1 -e SURVEYIN,600,50000
- "-P"
- "29.20"
- "-t"
- "-w"
- "5"
- "-v"
- "1"
- "-e"
- "SURVEYIN,600,50000"
reportOutput: true
- args: #ubxtool -P 29.20 -p MON-HW
- "-P"
- "29.20"
- "-p"
- "MON-HW"
reportOutput: true
- args: #ubxtool -P 29.20 -p CFG-MSG,1,38,248
- "-P"
- "29.20"
- "-p"
- "CFG-MSG,1,38,248"
reportOutput: true
ts2phcOpts: " "
ts2phcConf: |
[nmea]
ts2phc.master 1
[global]
use_syslog 0
verbose 1
logging_level 7
ts2phc.pulsewidth 100000000
#cat /dev/GNSS to find available serial port
#example value of gnss_serialport is /dev/ttyGNSS_1700_0
ts2phc.nmea_serialport $gnss_serialport
[$iface_master]
ts2phc.extts_polarity rising
ts2phc.extts_correction 0
ptp4lConf: |
[$iface_master]
masterOnly 1
[$iface_master_1]
masterOnly 1
[$iface_master_2]
masterOnly 1
[$iface_master_3]
masterOnly 1
[global]
#
# Default Data Set
#
twoStepFlag 1
priority1 128
priority2 128
domainNumber 24
#utc_offset 37
clockClass 6
clockAccuracy 0x27
offsetScaledLogVariance 0xFFFF
free_running 0
freq_est_interval 1
dscp_event 0
dscp_general 0
dataset_comparison G.8275.x
G.8275.defaultDS.localPriority 128
#
# Port Data Set
#
logAnnounceInterval -3
logSyncInterval -4
logMinDelayReqInterval -4
logMinPdelayReqInterval 0
announceReceiptTimeout 3
syncReceiptTimeout 0
delayAsymmetry 0
fault_reset_interval -4
neighborPropDelayThresh 20000000
masterOnly 0
G.8275.portDS.localPriority 128
#
# Run time options
#
assume_two_step 0
logging_level 6
path_trace_enabled 0
follow_up_info 0
hybrid_e2e 0
inhibit_multicast_service 0
net_sync_monitor 0
tc_spanning_tree 0
tx_timestamp_timeout 50
unicast_listen 0
unicast_master_table 0
unicast_req_duration 3600
use_syslog 1
verbose 0
summary_interval -4
kernel_leap 1
check_fup_sync 0
clock_class_threshold 7
#
# Servo Options
#
pi_proportional_const 0.0
pi_integral_const 0.0
pi_proportional_scale 0.0
pi_proportional_exponent -0.3
pi_proportional_norm_max 0.7
pi_integral_scale 0.0
pi_integral_exponent 0.4
pi_integral_norm_max 0.3
step_threshold 2.0
first_step_threshold 0.00002
clock_servo pi
sanity_freq_limit 200000000
ntpshm_segment 0
#
# Transport options
#
transportSpecific 0x0
ptp_dst_mac 01:1B:19:00:00:00
p2p_dst_mac 01:80:C2:00:00:0E
udp_ttl 1
udp6_scope 0x0E
uds_address /var/run/ptp4l
#
# Default interface options
#
clock_type BC
network_transport L2
delay_mechanism E2E
time_stamping hardware
tsproc_mode filter
delay_filter moving_median
delay_filter_length 10
egressLatency 0
ingressLatency 0
boundary_clock_jbod 0
#
# Clock description
#
productDescription ;;
revisionData ;;
manufacturerIdentity 00:00:00
userDescription ;
timeSource 0x20
recommend:
- profile: "grandmaster"
priority: 4
match:
- nodeLabel: "node-role.kubernetes.io/$mcp"
对于 E810 Westport Channel NIC,请将 |
通过运行以下命令创建 CR
$ oc create -f grandmaster-clock-ptp-config.yaml
检查PtpConfig
配置文件是否已应用于节点。
通过运行以下命令获取openshift-ptp
命名空间中 Pod 的列表
$ oc get pods -n openshift-ptp -o wide
NAME READY STATUS RESTARTS AGE IP NODE
linuxptp-daemon-74m2g 3/3 Running 3 4d15h 10.16.230.7 compute-1.example.com
ptp-operator-5f4f48d7c-x7zkf 1/1 Running 1 4d15h 10.128.1.145 compute-1.example.com
检查配置文件是否正确。检查与您在PtpConfig
配置文件中指定的节点相对应的linuxptp
守护程序的日志。运行以下命令
$ oc logs linuxptp-daemon-74m2g -n openshift-ptp -c linuxptp-daemon-container
ts2phc[94980.334]: [ts2phc.0.config] nmea delay: 98690975 ns
ts2phc[94980.334]: [ts2phc.0.config] ens3f0 extts index 0 at 1676577329.999999999 corr 0 src 1676577330.901342528 diff -1
ts2phc[94980.334]: [ts2phc.0.config] ens3f0 master offset -1 s2 freq -1
ts2phc[94980.441]: [ts2phc.0.config] nmea sentence: GNRMC,195453.00,A,4233.24427,N,07126.64420,W,0.008,,160223,,,A,V
phc2sys[94980.450]: [ptp4l.0.config] CLOCK_REALTIME phc offset 943 s2 freq -89604 delay 504
phc2sys[94980.512]: [ptp4l.0.config] CLOCK_REALTIME phc offset 1000 s2 freq -89264 delay 474
您可以通过创建一个配置主机 NIC 的PtpConfig
自定义资源 (CR),将linuxptp
服务 (ptp4l
、phc2sys
、ts2phc
) 配置为双 E810 NIC 的主时钟 (T-GM)。
您可以将linuxptp
服务配置为以下双 E810 NIC 的 T-GM
Intel E810-XXVDA4T Westport Channel NIC
Intel E810-CQDA2T Logan Beach NIC
对于分布式 RAN (D-RAN) 使用案例,您可以按如下方式配置 PTP 以用于双 NIC
NIC 一与全球导航卫星系统 (GNSS) 时间源同步。
NIC 二与 NIC 一提供的 1PPS 定时输出同步。此配置由PtpConfig
CR 中的 PTP 硬件插件提供。
双 NIC PTP T-GM 配置使用单个ptp4l
实例和一个ts2phc
进程,报告两个ts2phc
实例,每个 NIC 一个。主机系统时钟与连接到 GNSS 时间源的 NIC 同步。
使用以下示例 要配置 PTP 快速事件,请为 |
对于生产环境中的 T-GM 时钟,请在裸机集群主机中安装两个 Intel E810 NIC。
安装 OpenShift CLI (oc
)。
以具有cluster-admin
权限的用户身份登录。
安装 PTP 运营商。
创建PtpConfig
CR。例如
将以下 YAML 保存到grandmaster-clock-ptp-config-dual-nics.yaml
文件中
# In this example two cards $iface_nic1 and $iface_nic2 are connected via
# SMA1 ports by a cable and $iface_nic2 receives 1PPS signals from $iface_nic1
apiVersion: ptp.openshift.io/v1
kind: PtpConfig
metadata:
name: grandmaster
namespace: openshift-ptp
annotations: {}
spec:
profile:
- name: "grandmaster"
ptp4lOpts: "-2 --summary_interval -4"
phc2sysOpts: -r -u 0 -m -w -N 8 -R 16 -s $iface_nic1 -n 24
ptpSchedulingPolicy: SCHED_FIFO
ptpSchedulingPriority: 10
ptpSettings:
logReduce: "true"
plugins:
e810:
enableDefaultConfig: false
settings:
LocalMaxHoldoverOffSet: 1500
LocalHoldoverTimeout: 14400
MaxInSpecOffset: 100
pins: $e810_pins
# "$iface_nic1":
# "U.FL2": "0 2"
# "U.FL1": "0 1"
# "SMA2": "0 2"
# "SMA1": "2 1"
# "$iface_nic2":
# "U.FL2": "0 2"
# "U.FL1": "0 1"
# "SMA2": "0 2"
# "SMA1": "1 1"
ublxCmds:
- args: #ubxtool -P 29.20 -z CFG-HW-ANT_CFG_VOLTCTRL,1
- "-P"
- "29.20"
- "-z"
- "CFG-HW-ANT_CFG_VOLTCTRL,1"
reportOutput: false
- args: #ubxtool -P 29.20 -e GPS
- "-P"
- "29.20"
- "-e"
- "GPS"
reportOutput: false
- args: #ubxtool -P 29.20 -d Galileo
- "-P"
- "29.20"
- "-d"
- "Galileo"
reportOutput: false
- args: #ubxtool -P 29.20 -d GLONASS
- "-P"
- "29.20"
- "-d"
- "GLONASS"
reportOutput: false
- args: #ubxtool -P 29.20 -d BeiDou
- "-P"
- "29.20"
- "-d"
- "BeiDou"
reportOutput: false
- args: #ubxtool -P 29.20 -d SBAS
- "-P"
- "29.20"
- "-d"
- "SBAS"
reportOutput: false
- args: #ubxtool -P 29.20 -t -w 5 -v 1 -e SURVEYIN,600,50000
- "-P"
- "29.20"
- "-t"
- "-w"
- "5"
- "-v"
- "1"
- "-e"
- "SURVEYIN,600,50000"
reportOutput: true
- args: #ubxtool -P 29.20 -p MON-HW
- "-P"
- "29.20"
- "-p"
- "MON-HW"
reportOutput: true
- args: #ubxtool -P 29.20 -p CFG-MSG,1,38,248
- "-P"
- "29.20"
- "-p"
- "CFG-MSG,1,38,248"
reportOutput: true
ts2phcOpts: " "
ts2phcConf: |
[nmea]
ts2phc.master 1
[global]
use_syslog 0
verbose 1
logging_level 7
ts2phc.pulsewidth 100000000
#cat /dev/GNSS to find available serial port
#example value of gnss_serialport is /dev/ttyGNSS_1700_0
ts2phc.nmea_serialport $gnss_serialport
[$iface_nic1]
ts2phc.extts_polarity rising
ts2phc.extts_correction 0
[$iface_nic2]
ts2phc.master 0
ts2phc.extts_polarity rising
#this is a measured value in nanoseconds to compensate for SMA cable delay
ts2phc.extts_correction -10
ptp4lConf: |
[$iface_nic1]
masterOnly 1
[$iface_nic1_1]
masterOnly 1
[$iface_nic1_2]
masterOnly 1
[$iface_nic1_3]
masterOnly 1
[$iface_nic2]
masterOnly 1
[$iface_nic2_1]
masterOnly 1
[$iface_nic2_2]
masterOnly 1
[$iface_nic2_3]
masterOnly 1
[global]
#
# Default Data Set
#
twoStepFlag 1
priority1 128
priority2 128
domainNumber 24
#utc_offset 37
clockClass 6
clockAccuracy 0x27
offsetScaledLogVariance 0xFFFF
free_running 0
freq_est_interval 1
dscp_event 0
dscp_general 0
dataset_comparison G.8275.x
G.8275.defaultDS.localPriority 128
#
# Port Data Set
#
logAnnounceInterval -3
logSyncInterval -4
logMinDelayReqInterval -4
logMinPdelayReqInterval 0
announceReceiptTimeout 3
syncReceiptTimeout 0
delayAsymmetry 0
fault_reset_interval -4
neighborPropDelayThresh 20000000
masterOnly 0
G.8275.portDS.localPriority 128
#
# Run time options
#
assume_two_step 0
logging_level 6
path_trace_enabled 0
follow_up_info 0
hybrid_e2e 0
inhibit_multicast_service 0
net_sync_monitor 0
tc_spanning_tree 0
tx_timestamp_timeout 50
unicast_listen 0
unicast_master_table 0
unicast_req_duration 3600
use_syslog 1
verbose 0
summary_interval -4
kernel_leap 1
check_fup_sync 0
clock_class_threshold 7
#
# Servo Options
#
pi_proportional_const 0.0
pi_integral_const 0.0
pi_proportional_scale 0.0
pi_proportional_exponent -0.3
pi_proportional_norm_max 0.7
pi_integral_scale 0.0
pi_integral_exponent 0.4
pi_integral_norm_max 0.3
step_threshold 2.0
first_step_threshold 0.00002
clock_servo pi
sanity_freq_limit 200000000
ntpshm_segment 0
#
# Transport options
#
transportSpecific 0x0
ptp_dst_mac 01:1B:19:00:00:00
p2p_dst_mac 01:80:C2:00:00:0E
udp_ttl 1
udp6_scope 0x0E
uds_address /var/run/ptp4l
#
# Default interface options
#
clock_type BC
network_transport L2
delay_mechanism E2E
time_stamping hardware
tsproc_mode filter
delay_filter moving_median
delay_filter_length 10
egressLatency 0
ingressLatency 0
boundary_clock_jbod 1
#
# Clock description
#
productDescription ;;
revisionData ;;
manufacturerIdentity 00:00:00
userDescription ;
timeSource 0x20
recommend:
- profile: "grandmaster"
priority: 4
match:
- nodeLabel: "node-role.kubernetes.io/$mcp"
将 |
通过运行以下命令创建 CR
$ oc create -f grandmaster-clock-ptp-config-dual-nics.yaml
检查PtpConfig
配置文件是否已应用于节点。
通过运行以下命令获取openshift-ptp
命名空间中 Pod 的列表
$ oc get pods -n openshift-ptp -o wide
NAME READY STATUS RESTARTS AGE IP NODE
linuxptp-daemon-74m2g 3/3 Running 3 4d15h 10.16.230.7 compute-1.example.com
ptp-operator-5f4f48d7c-x7zkf 1/1 Running 1 4d15h 10.128.1.145 compute-1.example.com
检查配置文件是否正确。检查与您在PtpConfig
配置文件中指定的节点相对应的linuxptp
守护程序的日志。运行以下命令
$ oc logs linuxptp-daemon-74m2g -n openshift-ptp -c linuxptp-daemon-container
ts2phc[509863.660]: [ts2phc.0.config] nmea delay: 347527248 ns
ts2phc[509863.660]: [ts2phc.0.config] ens2f0 extts index 0 at 1705516553.000000000 corr 0 src 1705516553.652499081 diff 0
ts2phc[509863.660]: [ts2phc.0.config] ens2f0 master offset 0 s2 freq -0
I0117 18:35:16.000146 1633226 stats.go:57] state updated for ts2phc =s2
I0117 18:35:16.000163 1633226 event.go:417] dpll State s2, gnss State s2, tsphc state s2, gm state s2,
ts2phc[1705516516]:[ts2phc.0.config] ens2f0 nmea_status 1 offset 0 s2
GM[1705516516]:[ts2phc.0.config] ens2f0 T-GM-STATUS s2
ts2phc[509863.677]: [ts2phc.0.config] ens7f0 extts index 0 at 1705516553.000000010 corr -10 src 1705516553.652499081 diff 0
ts2phc[509863.677]: [ts2phc.0.config] ens7f0 master offset 0 s2 freq -0
I0117 18:35:16.016597 1633226 stats.go:57] state updated for ts2phc =s2
phc2sys[509863.719]: [ptp4l.0.config] CLOCK_REALTIME phc offset -6 s2 freq +15441 delay 510
phc2sys[509863.782]: [ptp4l.0.config] CLOCK_REALTIME phc offset -7 s2 freq +15438 delay 502
以下参考信息描述了PtpConfig
自定义资源 (CR) 的配置选项,该资源将linuxptp
服务(ptp4l
、phc2sys
、ts2phc
)配置为主时钟。
PtpConfig CR 字段 | 描述 | ||
---|---|---|---|
|
指定一个 插件机制允许PTP操作员进行自动硬件配置。对于英特尔Westport Channel网卡或英特尔Logan Beach网卡,当 |
||
|
指定 |
||
|
指定启动 |
||
|
指定在丢弃数据之前等待发送方发送 (TX) 时间戳的最大时间。 |
||
|
指定JBOD边界时钟时间延迟值。此值用于校正网络时间设备之间传递的时间值。 |
||
|
指定
|
||
|
配置 |
||
|
设置1-65之间的整数值,以在 |
||
|
可选。如果不存在 |
||
|
设置
|
||
|
设置 |
||
|
指定一个或多个 |
||
|
指定在 |
||
|
使用0到99之间的整数值指定 |
||
|
使用 |
||
|
使用 |
||
|
使用 |
下表描述了PTP主时钟 (T-GM) gm.ClockClass
状态。时钟类别状态根据其相对于主参考时钟 (PRTC) 或其他计时源的精度和稳定性对T-GM时钟进行分类。
保持模式规范是指PTP时钟在不接收来自主时间源的更新的情况下可以保持同步的时间量。
时钟类别状态 | 描述 |
---|---|
|
T-GM时钟以 |
|
T-GM时钟处于 |
|
T-GM时钟处于 |
|
T-GM时钟处于 |
更多信息,请参见 "相位/时间可追溯性信息",ITU-T G.8275.1/Y.1369.1建议。
使用此信息了解如何使用英特尔E810硬件插件将E810网络接口配置为PTP主时钟。硬件引脚配置决定了网络接口如何与系统中的其他组件和设备交互。英特尔E810网卡有四个用于外部1PPS信号的连接器:SMA1
、SMA2
、U.FL1
和U.FL2
。
硬件引脚 | 推荐设置 | 描述 |
---|---|---|
|
|
禁用 |
|
|
禁用 |
|
|
禁用 |
|
|
禁用 |
|
设置spec.profile.plugins.e810.ublxCmds
参数来配置PtpConfig
自定义资源(CR)中的GNSS时钟。每个ublxCmds
段落对应于使用ubxtool
命令应用于主机网卡的配置。例如:
ublxCmds:
- args: #ubxtool -P 29.20 -z CFG-HW-ANT_CFG_VOLTCTRL,1
- "-P"
- "29.20"
- "-z"
- "CFG-HW-ANT_CFG_VOLTCTRL,1"
reportOutput: false
下表描述了等效的ubxtool
命令
ubxtool 命令 | 描述 |
---|---|
|
启用天线电压控制。启用在 |
|
启用天线接收GPS信号。 |
|
配置天线接收来自伽利略GPS卫星的信号。 |
|
禁用天线接收来自GLONASS GPS卫星的信号。 |
|
禁用天线接收来自北斗GPS卫星的信号。 |
|
禁用天线接收来自SBAS GPS卫星的信号。 |
|
配置GNSS接收机的测量定位过程以改进其初始位置估计。这可能需要长达24小时才能获得最佳结果。 |
|
运行一次自动的硬件扫描,并报告网卡状态和配置设置。 |
E810插件实现了以下接口
接口 | 描述 |
---|---|
|
每当更新 |
|
启动PTP进程并运行 |
|
根据 |
E810插件具有以下结构体和变量
结构体 | 描述 |
---|---|
|
表示E810插件的选项,包括布尔标志和网络设备引脚的映射。 |
|
表示 |
|
保存插件执行期间使用的插件特定数据。 |
使用此信息了解如何使用Intel E810硬件插件将一对E810网络接口配置为PTP主时钟(T-GM)。
在配置双网卡集群主机之前,必须使用SMA1电缆通过1PPS接口连接两个网卡。
配置双网卡T-GM时,需要补偿使用SMA1连接端口连接网卡时发生的1PPS信号延迟。电缆长度、环境温度以及组件和制造公差等各种因素都会影响信号延迟。为了补偿延迟,必须计算用于抵消信号延迟的特定值。
PtpConfig 字段 | 描述 |
---|---|
|
使用PTP Operator E810硬件插件配置E810硬件引脚。
|
|
使用 |
|
将 |
PTP Operator容器镜像包含在发布时可用的最新leap-seconds.list
文件。您可以使用全球定位系统(GPS)公告配置PTP Operator来自动更新闰秒文件。
闰秒信息存储在名为leap-configmap
的自动生成的ConfigMap
资源中,该资源位于openshift-ptp
命名空间中。PTP Operator将leap-configmap
资源作为卷挂载到linuxptp-daemon
pod中,该pod可供ts2phc
进程访问。
如果GPS卫星广播新的闰秒数据,PTP Operator将使用新数据更新leap-configmap
资源。ts2phc
进程会自动获取这些更改。
以下过程仅供参考。4.17版本的PTP Operator默认情况下启用自动闰秒管理。 |
您已安装OpenShift CLI (oc
)。
您已以具有cluster-admin
权限的用户身份登录。
您已安装PTP Operator并在集群中配置了PTP主时钟(T-GM)。
在PtpConfig
CR的phc2sysOpts
部分中配置自动闰秒处理。设置以下选项:
phc2sysOpts: -r -u 0 -m -w -N 8 -R 16 -S 2 -s ens2f0 -n 24 (1)
1 | 将-w 设置为强制phc2sys 在启动其自身同步过程之前等待ptp4l 同步系统硬件时钟。 |
以前,T-GM需要在 |
配置Intel e810网卡,以便在PtpConfig
CR的spec.profile.plugins.e810.ublxCmds
部分中通过GPS接收器定期报告NAV-TIMELS
消息。例如:
- args: #ubxtool -P 29.20 -p CFG-MSG,1,38,248
- "-P"
- "29.20"
- "-p"
- "CFG-MSG,1,38,248"
验证已配置的T-GM是否正在接收来自连接的GPS的NAV-TIMELS
消息。运行以下命令:
$ oc -n openshift-ptp -c linuxptp-daemon-container exec -it $(oc -n openshift-ptp get pods -o name | grep daemon) -- ubxtool -t -p NAV-TIMELS -P 29.20
1722509534.4417
UBX-NAV-STATUS:
iTOW 384752000 gpsFix 5 flags 0xdd fixStat 0x0 flags2 0x8
ttff 18261, msss 1367642864
1722509534.4419
UBX-NAV-TIMELS:
iTOW 384752000 version 0 reserved2 0 0 0 srcOfCurrLs 2
currLs 18 srcOfLsChange 2 lsChange 0 timeToLsEvent 70376866
dateOfLsGpsWn 2441 dateOfLsGpsDn 7 reserved2 0 0 0
valid x3
1722509534.4421
UBX-NAV-CLOCK:
iTOW 384752000 clkB 784281 clkD 435 tAcc 3 fAcc 215
1722509535.4477
UBX-NAV-STATUS:
iTOW 384753000 gpsFix 5 flags 0xdd fixStat 0x0 flags2 0x8
ttff 18261, msss 1367643864
1722509535.4479
UBX-NAV-CLOCK:
iTOW 384753000 clkB 784716 clkD 435 tAcc 3 fAcc 218
验证PTP Operator是否已成功生成leap-configmap
资源,并使其与最新版本的leap-seconds.list保持一致。运行以下命令:
$ oc -n openshift-ptp get configmap leap-configmap -o jsonpath='{.data.<node_name>}' (1)
1 | 将<node_name> 替换为您已安装并配置了具有自动闰秒管理功能的PTP T-GM时钟的节点名称。对节点名称中的特殊字符进行转义。例如,node-1\.example\.com 。 |
# Do not edit
# This file is generated automatically by linuxptp-daemon
#$ 3913697179
#@ 4291747200
2272060800 10 # 1 Jan 1972
2287785600 11 # 1 Jul 1972
2303683200 12 # 1 Jan 1973
2335219200 13 # 1 Jan 1974
2366755200 14 # 1 Jan 1975
2398291200 15 # 1 Jan 1976
2429913600 16 # 1 Jan 1977
2461449600 17 # 1 Jan 1978
2492985600 18 # 1 Jan 1979
2524521600 19 # 1 Jan 1980
2571782400 20 # 1 Jul 1981
2603318400 21 # 1 Jul 1982
2634854400 22 # 1 Jul 1983
2698012800 23 # 1 Jul 1985
2776982400 24 # 1 Jan 1988
2840140800 25 # 1 Jan 1990
2871676800 26 # 1 Jan 1991
2918937600 27 # 1 Jul 1992
2950473600 28 # 1 Jul 1993
2982009600 29 # 1 Jul 1994
3029443200 30 # 1 Jan 1996
3076704000 31 # 1 Jul 1997
3124137600 32 # 1 Jan 1999
3345062400 33 # 1 Jan 2006
3439756800 34 # 1 Jan 2009
3550089600 35 # 1 Jul 2012
3644697600 36 # 1 Jul 2015
3692217600 37 # 1 Jan 2017
#h e65754d4 8f39962b aa854a61 661ef546 d2af0bfa
您可以通过创建PtpConfig
自定义资源 (CR) 对象来将linuxptp
服务 (ptp4l
, phc2sys
) 配置为边界时钟。
使用以下 |
安装 OpenShift CLI (oc
)。
以具有cluster-admin
权限的用户身份登录。
安装 PTP 运营商。
创建以下PtpConfig
CR,然后将YAML保存到boundary-clock-ptp-config.yaml
文件中。
apiVersion: ptp.openshift.io/v1
kind: PtpConfig
metadata:
name: boundary-clock
namespace: openshift-ptp
annotations: {}
spec:
profile:
- name: boundary-clock
ptp4lOpts: "-2"
phc2sysOpts: "-a -r -n 24"
ptpSchedulingPolicy: SCHED_FIFO
ptpSchedulingPriority: 10
ptpSettings:
logReduce: "true"
ptp4lConf: |
# The interface name is hardware-specific
[$iface_slave]
masterOnly 0
[$iface_master_1]
masterOnly 1
[$iface_master_2]
masterOnly 1
[$iface_master_3]
masterOnly 1
[global]
#
# Default Data Set
#
twoStepFlag 1
slaveOnly 0
priority1 128
priority2 128
domainNumber 24
#utc_offset 37
clockClass 248
clockAccuracy 0xFE
offsetScaledLogVariance 0xFFFF
free_running 0
freq_est_interval 1
dscp_event 0
dscp_general 0
dataset_comparison G.8275.x
G.8275.defaultDS.localPriority 128
#
# Port Data Set
#
logAnnounceInterval -3
logSyncInterval -4
logMinDelayReqInterval -4
logMinPdelayReqInterval -4
announceReceiptTimeout 3
syncReceiptTimeout 0
delayAsymmetry 0
fault_reset_interval -4
neighborPropDelayThresh 20000000
masterOnly 0
G.8275.portDS.localPriority 128
#
# Run time options
#
assume_two_step 0
logging_level 6
path_trace_enabled 0
follow_up_info 0
hybrid_e2e 0
inhibit_multicast_service 0
net_sync_monitor 0
tc_spanning_tree 0
tx_timestamp_timeout 50
unicast_listen 0
unicast_master_table 0
unicast_req_duration 3600
use_syslog 1
verbose 0
summary_interval 0
kernel_leap 1
check_fup_sync 0
clock_class_threshold 135
#
# Servo Options
#
pi_proportional_const 0.0
pi_integral_const 0.0
pi_proportional_scale 0.0
pi_proportional_exponent -0.3
pi_proportional_norm_max 0.7
pi_integral_scale 0.0
pi_integral_exponent 0.4
pi_integral_norm_max 0.3
step_threshold 2.0
first_step_threshold 0.00002
max_frequency 900000000
clock_servo pi
sanity_freq_limit 200000000
ntpshm_segment 0
#
# Transport options
#
transportSpecific 0x0
ptp_dst_mac 01:1B:19:00:00:00
p2p_dst_mac 01:80:C2:00:00:0E
udp_ttl 1
udp6_scope 0x0E
uds_address /var/run/ptp4l
#
# Default interface options
#
clock_type BC
network_transport L2
delay_mechanism E2E
time_stamping hardware
tsproc_mode filter
delay_filter moving_median
delay_filter_length 10
egressLatency 0
ingressLatency 0
boundary_clock_jbod 0
#
# Clock description
#
productDescription ;;
revisionData ;;
manufacturerIdentity 00:00:00
userDescription ;
timeSource 0xA0
recommend:
- profile: boundary-clock
priority: 4
match:
- nodeLabel: "node-role.kubernetes.io/$mcp"
CR字段 | 描述 |
---|---|
|
|
|
指定一个或多个 |
|
指定唯一标识配置文件对象的配置文件对象名称。 |
|
指定 |
|
指定启动 |
|
接收同步时钟的接口。 |
|
发送同步时钟的接口。 |
|
对于Intel Columbiaville 800系列网卡,将 |
|
对于Intel Columbiaville 800系列网卡,确保 |
|
指定 |
|
ptp4l和phc2sys进程的调度策略。默认值为 |
|
1-65之间的整数值,用于在 |
|
可选。如果不存在 |
|
指定一个或多个 |
|
指定在 |
|
使用0到99之间的整数值指定 |
|
使用 |
|
使用 |
|
使用 |
通过运行以下命令创建 CR
$ oc create -f boundary-clock-ptp-config.yaml
检查PtpConfig
配置文件是否已应用于节点。
通过运行以下命令获取openshift-ptp
命名空间中 Pod 的列表
$ oc get pods -n openshift-ptp -o wide
NAME READY STATUS RESTARTS AGE IP NODE
linuxptp-daemon-4xkbb 1/1 Running 0 43m 10.1.196.24 compute-0.example.com
linuxptp-daemon-tdspf 1/1 Running 0 43m 10.1.196.25 compute-1.example.com
ptp-operator-657bbb64c8-2f8sj 1/1 Running 0 43m 10.129.0.61 control-plane-1.example.com
检查配置文件是否正确。检查与您在PtpConfig
配置文件中指定的节点相对应的linuxptp
守护程序的日志。运行以下命令
$ oc logs linuxptp-daemon-4xkbb -n openshift-ptp -c linuxptp-daemon-container
I1115 09:41:17.117596 4143292 daemon.go:107] in applyNodePTPProfile
I1115 09:41:17.117604 4143292 daemon.go:109] updating NodePTPProfile to:
I1115 09:41:17.117607 4143292 daemon.go:110] ------------------------------------
I1115 09:41:17.117612 4143292 daemon.go:102] Profile Name: profile1
I1115 09:41:17.117616 4143292 daemon.go:102] Interface:
I1115 09:41:17.117620 4143292 daemon.go:102] Ptp4lOpts: -2
I1115 09:41:17.117623 4143292 daemon.go:102] Phc2sysOpts: -a -r -n 24
I1115 09:41:17.117626 4143292 daemon.go:116] ------------------------------------
您可以为每个网卡创建一个PtpConfig
自定义资源 (CR) 对象,将linuxptp
服务 (ptp4l
, phc2sys
) 配置为双网卡硬件的边界时钟。
双网卡硬件允许您将每个网卡连接到同一个上游主时钟,每个网卡使用单独的ptp4l
实例为下游时钟供电。
安装 OpenShift CLI (oc
)。
以具有cluster-admin
权限的用户身份登录。
安装 PTP 运营商。
为每个网卡创建两个单独的PtpConfig
CR,使用“将linuxptp服务配置为边界时钟”中的参考CR作为每个CR的基础。例如
创建boundary-clock-ptp-config-nic1.yaml
,指定phc2sysOpts
的值
apiVersion: ptp.openshift.io/v1
kind: PtpConfig
metadata:
name: boundary-clock-ptp-config-nic1
namespace: openshift-ptp
spec:
profile:
- name: "profile1"
ptp4lOpts: "-2 --summary_interval -4"
ptp4lConf: | (1)
[ens5f1]
masterOnly 1
[ens5f0]
masterOnly 0
...
phc2sysOpts: "-a -r -m -n 24 -N 8 -R 16" (2)
1 | 指定启动ptp4l 作为边界时钟所需的接口。例如,ens5f0 从主时钟同步,ens5f1 同步连接的设备。 |
2 | 必需的phc2sysOpts 值。-m 将消息打印到stdout 。linuxptp-daemon DaemonSet 解析日志并生成Prometheus指标。 |
创建boundary-clock-ptp-config-nic2.yaml
,完全删除phc2sysOpts
字段以禁用第二个网卡的phc2sys
服务
apiVersion: ptp.openshift.io/v1
kind: PtpConfig
metadata:
name: boundary-clock-ptp-config-nic2
namespace: openshift-ptp
spec:
profile:
- name: "profile2"
ptp4lOpts: "-2 --summary_interval -4"
ptp4lConf: | (1)
[ens7f1]
masterOnly 1
[ens7f0]
masterOnly 0
...
1 | 指定在第二个网卡上启动ptp4l 作为边界时钟所需的接口。 |
您必须从第二个 |
通过运行以下命令创建双网卡PtpConfig
CR:
创建配置第一个网卡PTP的CR
$ oc create -f boundary-clock-ptp-config-nic1.yaml
创建配置第二个网卡PTP的CR
$ oc create -f boundary-clock-ptp-config-nic2.yaml
检查PTP Operator是否已应用两个网卡的PtpConfig
CR。检查与安装了双网卡硬件的节点对应的linuxptp
守护进程的日志。例如,运行以下命令:
$ oc logs linuxptp-daemon-cvgr6 -n openshift-ptp -c linuxptp-daemon-container
ptp4l[80828.335]: [ptp4l.1.config] master offset 5 s2 freq -5727 path delay 519
ptp4l[80828.343]: [ptp4l.0.config] master offset -5 s2 freq -10607 path delay 533
phc2sys[80828.390]: [ptp4l.0.config] CLOCK_REALTIME phc offset 1 s2 freq -87239 delay 539
您可以将linuxptp
服务ptp4l
和phc2sys
配置为双PTP边界时钟 (T-BC) 的高可用性 (HA) 系统时钟。
高可用性系统时钟使用来自配置为两个边界时钟的双网卡Intel E810 Salem通道硬件的多个时间源。两个边界时钟实例参与HA设置,每个实例都有其自己的配置概要文件。您将每个网卡连接到同一个上游主时钟,每个网卡使用单独的ptp4l
实例为下游时钟供电。
创建两个PtpConfig
自定义资源 (CR) 对象,将网卡配置为T-BC,以及第三个PtpConfig
CR,配置两个网卡之间的高可用性。
您在配置HA的 |
第三个PtpConfig
CR配置高可用性系统时钟服务。该CR将ptp4lOpts
字段设置为空字符串以防止ptp4l
进程运行。该CR为spec.profile.ptpSettings.haProfiles
下的ptp4l
配置添加配置文件,并将这些配置文件的内核套接字路径传递给phc2sys
服务。当发生ptp4l
故障时,phc2sys
服务切换到备份ptp4l
配置。当主配置文件再次激活时,phc2sys
服务恢复到原始状态。
确保您为用于配置HA的所有三个 |
安装 OpenShift CLI (oc
)。
以具有cluster-admin
权限的用户身份登录。
安装 PTP 运营商。
配置具有Intel E810 Salem通道双网卡的集群节点。
为每个网卡创建两个单独的PtpConfig
CR,使用“将linuxptp服务配置为双网卡硬件的边界时钟”中的CR作为每个CR的参考。
创建ha-ptp-config-nic1.yaml
文件,为phc2sysOpts
字段指定空字符串。例如:
apiVersion: ptp.openshift.io/v1
kind: PtpConfig
metadata:
name: ha-ptp-config-nic1
namespace: openshift-ptp
spec:
profile:
- name: "ha-ptp-config-profile1"
ptp4lOpts: "-2 --summary_interval -4"
ptp4lConf: | (1)
[ens5f1]
masterOnly 1
[ens5f0]
masterOnly 0
#...
phc2sysOpts: "" (2)
1 | 指定启动ptp4l 作为边界时钟所需的接口。例如,ens5f0 从主时钟同步,ens5f1 同步连接的设备。 |
2 | 将phc2sysOpts 设置为空字符串。这些值从配置高可用的PtpConfig CR 的spec.profile.ptpSettings.haProfiles 字段填充。 |
通过运行以下命令应用NIC 1 的PtpConfig
CR:
$ oc create -f ha-ptp-config-nic1.yaml
创建ha-ptp-config-nic2.yaml
文件,为phc2sysOpts
字段指定空字符串。例如:
apiVersion: ptp.openshift.io/v1
kind: PtpConfig
metadata:
name: ha-ptp-config-nic2
namespace: openshift-ptp
spec:
profile:
- name: "ha-ptp-config-profile2"
ptp4lOpts: "-2 --summary_interval -4"
ptp4lConf: |
[ens7f1]
masterOnly 1
[ens7f0]
masterOnly 0
#...
phc2sysOpts: ""
通过运行以下命令应用NIC 2 的PtpConfig
CR:
$ oc create -f ha-ptp-config-nic2.yaml
创建配置HA系统时钟的PtpConfig
CR。例如:
创建ptp-config-for-ha.yaml
文件。将haProfiles
设置为与配置两个NIC的PtpConfig
CR中设置的metadata.name
字段匹配。例如:haProfiles: ha-ptp-config-nic1,ha-ptp-config-nic2
apiVersion: ptp.openshift.io/v1
kind: PtpConfig
metadata:
name: boundary-ha
namespace: openshift-ptp
annotations: {}
spec:
profile:
- name: "boundary-ha"
ptp4lOpts: "" (1)
phc2sysOpts: "-a -r -n 24"
ptpSchedulingPolicy: SCHED_FIFO
ptpSchedulingPriority: 10
ptpSettings:
logReduce: "true"
haProfiles: "$profile1,$profile2"
recommend:
- profile: "boundary-ha"
priority: 4
match:
- nodeLabel: "node-role.kubernetes.io/$mcp"
1 | 将ptp4lOpts 字段设置为空字符串。如果它不是空的,p4ptl 进程将启动并出现严重错误。 |
在配置单个NIC的 |
通过运行以下命令应用HA PtpConfig
CR:
$ oc create -f ptp-config-for-ha.yaml
验证PTP Operator是否已正确应用PtpConfig
CR。执行以下步骤:
通过运行以下命令获取openshift-ptp
命名空间中 Pod 的列表
$ oc get pods -n openshift-ptp -o wide
NAME READY STATUS RESTARTS AGE IP NODE
linuxptp-daemon-4xkrb 1/1 Running 0 43m 10.1.196.24 compute-0.example.com
ptp-operator-657bbq64c8-2f8sj 1/1 Running 0 43m 10.129.0.61 control-plane-1.example.com
应该只有一个 |
通过运行以下命令检查配置文件是否正确。检查与您在PtpConfig
配置文件中指定的节点对应的linuxptp
守护进程的日志。
$ oc logs linuxptp-daemon-4xkrb -n openshift-ptp -c linuxptp-daemon-container
I1115 09:41:17.117596 4143292 daemon.go:107] in applyNodePTPProfile
I1115 09:41:17.117604 4143292 daemon.go:109] updating NodePTPProfile to:
I1115 09:41:17.117607 4143292 daemon.go:110] ------------------------------------
I1115 09:41:17.117612 4143292 daemon.go:102] Profile Name: ha-ptp-config-profile1
I1115 09:41:17.117616 4143292 daemon.go:102] Interface:
I1115 09:41:17.117620 4143292 daemon.go:102] Ptp4lOpts: -2
I1115 09:41:17.117623 4143292 daemon.go:102] Phc2sysOpts: -a -r -n 24
I1115 09:41:17.117626 4143292 daemon.go:116] ------------------------------------
您可以通过创建PtpConfig
自定义资源 (CR) 对象来将linuxptp
服务 (ptp4l
、phc2sys
) 配置为普通时钟。
使用以下示例 |
安装 OpenShift CLI (oc
)。
以具有cluster-admin
权限的用户身份登录。
安装 PTP 运营商。
创建以下PtpConfig
CR,然后将YAML保存到ordinary-clock-ptp-config.yaml
文件中。
apiVersion: ptp.openshift.io/v1
kind: PtpConfig
metadata:
name: ordinary-clock
namespace: openshift-ptp
annotations: {}
spec:
profile:
- name: ordinary-clock
# The interface name is hardware-specific
interface: $interface
ptp4lOpts: "-2 -s"
phc2sysOpts: "-a -r -n 24"
ptpSchedulingPolicy: SCHED_FIFO
ptpSchedulingPriority: 10
ptpSettings:
logReduce: "true"
ptp4lConf: |
[global]
#
# Default Data Set
#
twoStepFlag 1
slaveOnly 1
priority1 128
priority2 128
domainNumber 24
#utc_offset 37
clockClass 255
clockAccuracy 0xFE
offsetScaledLogVariance 0xFFFF
free_running 0
freq_est_interval 1
dscp_event 0
dscp_general 0
dataset_comparison G.8275.x
G.8275.defaultDS.localPriority 128
#
# Port Data Set
#
logAnnounceInterval -3
logSyncInterval -4
logMinDelayReqInterval -4
logMinPdelayReqInterval -4
announceReceiptTimeout 3
syncReceiptTimeout 0
delayAsymmetry 0
fault_reset_interval -4
neighborPropDelayThresh 20000000
masterOnly 0
G.8275.portDS.localPriority 128
#
# Run time options
#
assume_two_step 0
logging_level 6
path_trace_enabled 0
follow_up_info 0
hybrid_e2e 0
inhibit_multicast_service 0
net_sync_monitor 0
tc_spanning_tree 0
tx_timestamp_timeout 50
unicast_listen 0
unicast_master_table 0
unicast_req_duration 3600
use_syslog 1
verbose 0
summary_interval 0
kernel_leap 1
check_fup_sync 0
clock_class_threshold 7
#
# Servo Options
#
pi_proportional_const 0.0
pi_integral_const 0.0
pi_proportional_scale 0.0
pi_proportional_exponent -0.3
pi_proportional_norm_max 0.7
pi_integral_scale 0.0
pi_integral_exponent 0.4
pi_integral_norm_max 0.3
step_threshold 2.0
first_step_threshold 0.00002
max_frequency 900000000
clock_servo pi
sanity_freq_limit 200000000
ntpshm_segment 0
#
# Transport options
#
transportSpecific 0x0
ptp_dst_mac 01:1B:19:00:00:00
p2p_dst_mac 01:80:C2:00:00:0E
udp_ttl 1
udp6_scope 0x0E
uds_address /var/run/ptp4l
#
# Default interface options
#
clock_type OC
network_transport L2
delay_mechanism E2E
time_stamping hardware
tsproc_mode filter
delay_filter moving_median
delay_filter_length 10
egressLatency 0
ingressLatency 0
boundary_clock_jbod 0
#
# Clock description
#
productDescription ;;
revisionData ;;
manufacturerIdentity 00:00:00
userDescription ;
timeSource 0xA0
recommend:
- profile: ordinary-clock
priority: 4
match:
- nodeLabel: "node-role.kubernetes.io/$mcp"
CR字段 | 描述 |
---|---|
|
|
|
指定一个或多个 |
|
指定 |
|
指定 |
|
指定 |
|
指定一个字符串,其中包含要替换默认 |
|
对于Intel Columbiaville 800系列网卡,将 |
|
对于英特尔Columbiaville 800系列NIC,将 |
|
|
|
1-65之间的整数值,用于在 |
|
可选。如果不存在 |
|
指定一个或多个 |
|
指定在 |
|
对于普通时钟,将 |
|
使用 |
|
使用 |
|
使用 |
通过运行以下命令创建PtpConfig
CR:
$ oc create -f ordinary-clock-ptp-config.yaml
检查PtpConfig
配置文件是否已应用于节点。
通过运行以下命令获取openshift-ptp
命名空间中 Pod 的列表
$ oc get pods -n openshift-ptp -o wide
NAME READY STATUS RESTARTS AGE IP NODE
linuxptp-daemon-4xkbb 1/1 Running 0 43m 10.1.196.24 compute-0.example.com
linuxptp-daemon-tdspf 1/1 Running 0 43m 10.1.196.25 compute-1.example.com
ptp-operator-657bbb64c8-2f8sj 1/1 Running 0 43m 10.129.0.61 control-plane-1.example.com
检查配置文件是否正确。检查与您在PtpConfig
配置文件中指定的节点相对应的linuxptp
守护程序的日志。运行以下命令
$ oc logs linuxptp-daemon-4xkbb -n openshift-ptp -c linuxptp-daemon-container
I1115 09:41:17.117596 4143292 daemon.go:107] in applyNodePTPProfile
I1115 09:41:17.117604 4143292 daemon.go:109] updating NodePTPProfile to:
I1115 09:41:17.117607 4143292 daemon.go:110] ------------------------------------
I1115 09:41:17.117612 4143292 daemon.go:102] Profile Name: profile1
I1115 09:41:17.117616 4143292 daemon.go:102] Interface: ens787f1
I1115 09:41:17.117620 4143292 daemon.go:102] Ptp4lOpts: -2 -s
I1115 09:41:17.117623 4143292 daemon.go:102] Phc2sysOpts: -a -r -n 24
I1115 09:41:17.117626 4143292 daemon.go:116] ------------------------------------
下表描述了您必须对参考PTP配置进行的更改,才能将英特尔Columbiaville E800系列NIC用作普通时钟。在您应用于集群的PtpConfig
自定义资源 (CR) 中进行更改。
PTP配置 | 推荐设置 |
---|---|
|
|
|
|
|
|
对于 |
有关配置linuxptp
服务作为具有PTP快速事件的普通时钟的完整示例CR,请参见将linuxptp服务配置为普通时钟。
在需要低延迟性能的电信或其他部署类型中,PTP守护程序线程与其他基础设施组件一起在受限的CPU占用空间中运行。默认情况下,PTP线程使用SCHED_OTHER
策略运行。在高负载下,这些线程可能无法获得其无错误操作所需的调度延迟。
为了减轻潜在的调度延迟错误,您可以配置PTP Operator linuxptp
服务以允许线程使用SCHED_FIFO
策略运行。如果为PtpConfig
CR设置了SCHED_FIFO
,则ptp4l
和phc2sys
将在父容器中的chrt
下运行,其优先级由PtpConfig
CR的ptpSchedulingPriority
字段设置。
设置 |
编辑PtpConfig
CR配置文件
$ oc edit PtpConfig -n openshift-ptp
更改ptpSchedulingPolicy
和ptpSchedulingPriority
字段
apiVersion: ptp.openshift.io/v1
kind: PtpConfig
metadata:
name: <ptp_config_name>
namespace: openshift-ptp
...
spec:
profile:
- name: "profile1"
...
ptpSchedulingPolicy: SCHED_FIFO (1)
ptpSchedulingPriority: 10 (2)
1 | ptp4l 和phc2sys 进程的调度策略。在支持FIFO调度的系统上使用SCHED_FIFO 。 |
2 | 必需。设置用于配置ptp4l 和phc2sys 进程的FIFO优先级的整数1-65。 |
保存并退出以将更改应用于PtpConfig
CR。
获取已应用PtpConfig
CR的linuxptp-daemon
pod的名称和相应的节点。
$ oc get pods -n openshift-ptp -o wide
NAME READY STATUS RESTARTS AGE IP NODE
linuxptp-daemon-gmv2n 3/3 Running 0 1d17h 10.1.196.24 compute-0.example.com
linuxptp-daemon-lgm55 3/3 Running 0 1d17h 10.1.196.25 compute-1.example.com
ptp-operator-3r4dcvf7f4-zndk7 1/1 Running 0 1d7h 10.129.0.61 control-plane-1.example.com
检查ptp4l
进程是否正在使用更新的chrt
FIFO优先级运行。
$ oc -n openshift-ptp logs linuxptp-daemon-lgm55 -c linuxptp-daemon-container|grep chrt
I1216 19:24:57.091872 1600715 daemon.go:285] /bin/chrt -f 65 /usr/sbin/ptp4l -f /var/run/ptp4l.0.config -2 --summary_interval -4 -m
linuxptp
守护程序生成可用于调试的日志。在存储容量有限的电信或其他部署类型中,这些日志会增加存储需求。
为了减少日志消息数量,您可以配置PtpConfig
自定义资源 (CR) 以排除报告master offset
值的日志消息。master offset
日志消息报告当前节点时钟与主时钟之间的差值(以纳秒为单位)。
安装 OpenShift CLI (oc
)。
以具有cluster-admin
权限的用户身份登录。
安装 PTP 运营商。
编辑PtpConfig
CR
$ oc edit PtpConfig -n openshift-ptp
在spec.profile
中,添加ptpSettings.logReduce
规范并将值设置为true
apiVersion: ptp.openshift.io/v1
kind: PtpConfig
metadata:
name: <ptp_config_name>
namespace: openshift-ptp
...
spec:
profile:
- name: "profile1"
...
ptpSettings:
logReduce: "true"
出于调试目的,您可以将此规范恢复为 |
保存并退出以将更改应用于PtpConfig
CR。
获取已应用PtpConfig
CR的linuxptp-daemon
pod的名称和相应的节点。
$ oc get pods -n openshift-ptp -o wide
NAME READY STATUS RESTARTS AGE IP NODE
linuxptp-daemon-gmv2n 3/3 Running 0 1d17h 10.1.196.24 compute-0.example.com
linuxptp-daemon-lgm55 3/3 Running 0 1d17h 10.1.196.25 compute-1.example.com
ptp-operator-3r4dcvf7f4-zndk7 1/1 Running 0 1d7h 10.129.0.61 control-plane-1.example.com
通过运行以下命令验证主偏移量消息是否已从日志中排除
$ oc -n openshift-ptp logs <linux_daemon_container> -c linuxptp-daemon-container | grep "master offset" (1)
1 | <linux_daemon_container> 是linuxptp-daemon pod 的名称,例如linuxptp-daemon-gmv2n 。 |
配置logReduce
规范后,此命令不会在linuxptp
守护进程的日志中报告任何master offset
实例。
通过执行以下步骤来排查PTP 运营商的常见问题。
安装 OpenShift Container Platform CLI (oc
)。
以具有cluster-admin
权限的用户身份登录。
在支持 PTP 的主机的裸机集群上安装 PTP 运营商。
检查运营商和操作数是否已在集群中为配置的节点成功部署。
$ oc get pods -n openshift-ptp -o wide
NAME READY STATUS RESTARTS AGE IP NODE
linuxptp-daemon-lmvgn 3/3 Running 0 4d17h 10.1.196.24 compute-0.example.com
linuxptp-daemon-qhfg7 3/3 Running 0 4d17h 10.1.196.25 compute-1.example.com
ptp-operator-6b8dcbf7f4-zndk7 1/1 Running 0 5d7h 10.129.0.61 control-plane-1.example.com
启用 PTP 快速事件总线时,已准备好的 |
检查集群中是否已找到受支持的硬件。
$ oc -n openshift-ptp get nodeptpdevices.ptp.openshift.io
NAME AGE
control-plane-0.example.com 10d
control-plane-1.example.com 10d
compute-0.example.com 10d
compute-1.example.com 10d
compute-2.example.com 10d
检查节点的可用 PTP 网络接口
$ oc -n openshift-ptp get nodeptpdevices.ptp.openshift.io <node_name> -o yaml
其中
<node_name>
指定您要查询的节点,例如compute-0.example.com
。
apiVersion: ptp.openshift.io/v1
kind: NodePtpDevice
metadata:
creationTimestamp: "2021-09-14T16:52:33Z"
generation: 1
name: compute-0.example.com
namespace: openshift-ptp
resourceVersion: "177400"
uid: 30413db0-4d8d-46da-9bef-737bacd548fd
spec: {}
status:
devices:
- name: eno1
- name: eno2
- name: eno3
- name: eno4
- name: enp5s0f0
- name: enp5s0f1
通过访问相应节点的linuxptp-daemon
pod 来检查 PTP 接口是否已成功同步到主时钟。
通过运行以下命令获取要排查的linuxptp-daemon
pod 和相应节点的名称
$ oc get pods -n openshift-ptp -o wide
NAME READY STATUS RESTARTS AGE IP NODE
linuxptp-daemon-lmvgn 3/3 Running 0 4d17h 10.1.196.24 compute-0.example.com
linuxptp-daemon-qhfg7 3/3 Running 0 4d17h 10.1.196.25 compute-1.example.com
ptp-operator-6b8dcbf7f4-zndk7 1/1 Running 0 5d7h 10.129.0.61 control-plane-1.example.com
远程 shell 连接到所需的linuxptp-daemon
容器
$ oc rsh -n openshift-ptp -c linuxptp-daemon-container <linux_daemon_container>
其中
<linux_daemon_container>
是要诊断的容器,例如linuxptp-daemon-lmvgn
。
在到linuxptp-daemon
容器的远程 shell 连接中,使用 PTP 管理客户端 (pmc
) 工具来诊断网络接口。运行以下pmc
命令以检查 PTP 设备的同步状态,例如ptp4l
。
# pmc -u -f /var/run/ptp4l.0.config -b 0 'GET PORT_DATA_SET'
sending: GET PORT_DATA_SET
40a6b7.fffe.166ef0-1 seq 0 RESPONSE MANAGEMENT PORT_DATA_SET
portIdentity 40a6b7.fffe.166ef0-1
portState SLAVE
logMinDelayReqInterval -4
peerMeanPathDelay 0
logAnnounceInterval -3
announceReceiptTimeout 3
logSyncInterval -4
delayMechanism 1
logMinPdelayReqInterval -4
versionNumber 2
对于 GNSS 源主时钟,请通过运行以下命令验证树内 NIC ice 驱动程序是否正确,例如
$ oc rsh -n openshift-ptp -c linuxptp-daemon-container linuxptp-daemon-74m2g ethtool -i ens7f0
driver: ice
version: 5.14.0-356.bz2232515.el9.x86_64
firmware-version: 4.20 0x8001778b 1.3346.0
对于 GNSS 源主时钟,请验证linuxptp-daemon
容器是否正在接收来自 GNSS 天线的信号。如果容器未接收 GNSS 信号,则/dev/gnss0
文件未填充。要验证,请运行以下命令
$ oc rsh -n openshift-ptp -c linuxptp-daemon-container linuxptp-daemon-jnz6r cat /dev/gnss0
$GNRMC,125223.00,A,4233.24463,N,07126.64561,W,0.000,,300823,,,A,V*0A
$GNVTG,,T,,M,0.000,N,0.000,K,A*3D
$GNGGA,125223.00,4233.24463,N,07126.64561,W,1,12,99.99,98.6,M,-33.1,M,,*7E
$GNGSA,A,3,25,17,19,11,12,06,05,04,09,20,,,99.99,99.99,99.99,1*37
$GPGSV,3,1,10,04,12,039,41,05,31,222,46,06,50,064,48,09,28,064,42,1*62
您可以通过打开到集群节点的调试 shell 并查询 NIC 硬件来获取 Intel 800 系列网卡中时钟生成单元 (CGU) 的数字锁相环 (DPLL) 固件版本。
您已安装OpenShift CLI (oc
)。
您已以具有cluster-admin
权限的用户身份登录。
您已在集群主机中安装了 Intel 800 系列网卡。
您已在支持 PTP 的主机的裸机集群上安装了 PTP 运营商。
通过运行以下命令启动调试 pod
$ oc debug node/<node_name>
其中
<node_name>
是您已安装 Intel 800 系列网卡的节点。
使用devlink
工具以及安装 NIC 的总线和设备名称来检查 NIC 中的 CGU 固件版本。例如,运行以下命令
sh-4.4# devlink dev info <bus_name>/<device_name> | grep cgu
其中
<bus_name>
是安装 NIC 的总线。例如,pci
。
<device_name>
是 NIC 设备名称。例如,0000:51:00.0
。
cgu.id 36 (1)
fw.cgu 8032.16973825.6021 (2)
1 | CGU 硬件修订号 |
2 | 在 CGU 中运行的 DPLL 固件版本,其中 DPLL 固件版本为6201 ,DPLL 模型为8032 。字符串16973825 是 DPLL 固件版本 (1.3.0.1 ) 二进制版本的简写表示。 |
固件版本在版本号的每个部分都有一个前导 nibble 和 3 个八位字节。数字
|