ECS:OBS:如何添加或删除 NTP 服务器

Summary: 本文介绍如何修改 ECS NTP 配置。

This article applies to This article does not apply to This article is not tied to any specific product. Not all product versions are identified in this article.

Instructions

重要说明:xDoctor 4-8.104.0 及更高版本中发布了一项新功能。此知识库 (KB) 现在通过 xDoctor 自动执行,以快速尝试添加或删除 NTP 服务器。如果脚本无法添加或删除 NTP 服务器,它将提供调查结果的详细摘要。  
有关更多信息,请参阅文章 ECS ObjectScale:如何运行 KB 自动化脚本 (Auto Pilot)(可能需要以注册用户身份登录戴尔支持。)
 
  1. 要查找 NAN IP,您可以使用警报中标识的 IP 或 getclusterinfo -i 使用此脚本为您的目标。
命令:
# getclusterinfo -i
示例:
admin@ecsnode1:~> getclusterinfo -i

Registered Racks
================

Ip Address        epoxy   seg mac             seg color    seg id    NAN Hostname
===============   =====   =================   ==========   =======   ============
169.xxx.1.1      False   00:00:00:00:00:00   red          1         provo-red.nanlocal
Node private      Node              Public                                BMC
Ip Address        Id       Status   Mac                 Ip Address        Mac                 Ip Address        Private.4(NAN)    Node Name
===============   ======   ======   =================   ===============   =================   ===============   ===============   =========
192.xxx.219.1     1        MA       00:00:00:00:00      0.0.0.0           00:00:00:00:00      192.xxx.xxx.101   169.xxx.1.1       provo-red
192.xxx.219.2     2        SA       00:00:00:00:00      0.0.0.0           00:00:00:00:00      192.xxx.xxx.102   169.xxx.1.2       sandy-red
192.xxx.219.3     3        SA       00:00:00:00:00      0.0.0.0           00:00:00:00:00      192.xxx.xxx.103   169.xxx.1.3       orem-red
192.xxx.219.4     4        SA       00:00:00:00:00      0.0.0.0           00:00:00:00:00      192.xxx.xxx.104   169.xxx.1.4       ogden-red
192.xxx.219.5     5        SA       00:00:00:00:00      0.0.0.0           00:00:00:00:00      192.xxx.xxx.105   169.xxx.1.5       layton-red
192.xxx.219.6     6        SA       00:00:00:00:00      0.0.0.0           00:00:00:00:00      192.xxx.xxx.106   169.xxx.1.6       logan-red
192.xxx.219.7     7        SA       00:00:00:00:00      0.0.0.0           00:00:00:00:00      192.xxx.xxx.107   169.xxx.1.7       lehi-red
192.xxx.219.8     8        SA       00:00:00:00:00      0.0.0.0           00:00:00:00:00      192.xxx.xxx.108   169.xxx.1.8       murray-red
Status:
M - Master, S - Slave
E - Epoxy
I - Initializing, U - Updating, A - Active
P - On, O - Off
! - Warning/Error list:
    1 -(W) Hostname set to default hostname set by installer


169.xxx.2.1      False   00:00:00:00:00:00   green        2         tucson-green.nanlocal
Node private      Node              Public                                BMC
Ip Address        Id       Status   Mac                 Ip Address        Mac                 Ip Address        Private.4(NAN)    Node Name
===============   ======   ======   =================   ===============   =================   ===============   ===============   =========
192.xxx.219.1     1        MA       00:00:00:00:00      0.0.0.0           00:00:00:00:00      192.xxx.219.101   169.xxx.2.1       provo-green
192.xxx.219.2     2        SA       00:00:00:00:00      0.0.0.0           00:00:00:00:00      192.xxx.xxx.102   169.xxx.2.2       sandy-green
192.xxx.219.3     3        SA       00:00:00:00:00      0.0.0.0           00:00:00:00:00      192.xxx.xxx.103   169.xxx.2.3       orem-rgreen
192.xxx.219.4     4        SA       00:00:00:00:00      0.0.0.0           00:00:00:00:00      192.xxx.xxx.104   169.xxx.2.4       ogden-green
192.xxx.219.5     5        SA       00:00:00:00:00      0.0.0.0           00:00:00:00:00      192.xxx.xxx.105   169.xxx.2.5       layton-green
192.xxx.219.6     6        SA       00:00:00:00:00      0.0.0.0           00:00:00:00:00      192.xxx.xxx.106   169.xxx.2.6       logan-green
192.xxx.219.7     7        SA       00:00:00:00:00      0.0.0.0           00:00:00:00:00      192.xxx.xxx.107   169.xxx.2.7       lehi-green
192.xxx.219.8     8        SA       00:00:00:00:00      0.0.0.0           00:00:00:00:00      192.xxx.xxx.108   169.xxx.2.8       murray-green
Status:
M - Master, S - Slave
E - Epoxy
I - Initializing, U - Updating, A - Active
P - On, O - Off
! - Warning/Error list:
    1 -(W) Hostname set to default hostname set by installer
  1. 从具有 xDoctor 4-8.104.0 及更高版本的控制节点运行自动化命令。
 
提醒: --target-rack 此作支持,此脚本包含在 xDoctor4.8.104.0 版本中,该版本包含 Ansible 自动化脚本版本 3.0。
 
命令:
# sudo xdoctor autopilot --kb 273244 --target-rack <rack color>
示例:(此示例适用于机架 1。)
admin@ecsnode1:~> sudo xdoctor autopilot --kb 273244 --target-rack red

Using /etc/ansible/ansible.cfg as config file
VERSION: 3.0
Playbook tasks: 66
Role tasks: 28
Total tasks: 94 across 1 host(s)


自动化脚本选项:

  1. 选择要执行的选项:将 NTP 服务器添加到配置从配置中删除 NTP 服务器。
示例:
TASK [Ask user if they want to add or remove an NTP server] **************************************************************************************************************************************************
[Ask user if they want to add or remove an NTP server]
******************************************************************************
Please select one of the following options to add or remove an NTP server:
******************************************************************************
(1) Add an NTP server to the configuration.
(2) Remove an NTP server from the configuration.

(0) Exit
******************************************************************************
  1. 更改 NTP 服务器配置:
-> (1) Add an NTP server IP or FQDN

TASK [Ask for NTP server IP or FQDN if adding] ***************************************************************************************************************************************************************
[Ask for NTP server IP or FQDN if adding]
******************************************************************************
Enter the IP or FQDN of the NTP server:
******************************************************************************
:127.0.0.1

...

TASK [NTP server was successfully added or removed summary] **************************************************************************************************************************************************
ok: [169.xxx.1.6] => {
    "msg": [
        "*******************************************************************************",
        "*******************************************************************************",
        "The IP or FQDN address 127.0.0.1 was successfully added to the NTP server list.",
        "*******************************************************************************",
        "*******************************************************************************"
    ]
}
  1. 更改 NTP 服务器配置:
->(2) Remove an NTP server from the configuration.

TASK [Prompt user to select NTP server to remove] ************************************************************************************************************************************************************
[Prompt user to select NTP server to remove]
******************************************************************************
Enter the letter of the NTP server you want to remove:
******************************************************************************
(a) 127.0.0.1
(b) x.x.x.x

(0) Exit
******************************************************************************
(a)

ok: [169.xxx.1.6] => {
    "msg": [
        "*******************************************************************************",
        "*******************************************************************************",
        "127.0.0.1 was successfully removed from the NTP server list.",
        "*******************************************************************************",
        "*******************************************************************************"
    ]
}


如何将 IP 添加到 NTP:

运行以下命令一次,以添加 NTP 服务器 IP。针对每个 NTP 服务器重复该命令(或用空格分隔)。
命令:
# sudo setrackinfo -a NTPServer <NTP_Server_IP>
示例:
# sudo setrackinfo -a NTPServer 10.3.4.5

使用以下命令检查结果: getrackinfo -r
# getrackinfo -r
Rack Master Info
================
ChassisID = 00:01:02:63:1d:1e
RackID = 1
RackName = red
epoxy = False

Basic Config:
-------------
        EcsManagedBmc = no
        RackInstallServer = no

Network Config:
---------------
        DNSSearch =  corp.dell.com dell.com
        DNSServer =  x.x.x.x y.y.y.y
        NTPServer =  x.x.x.x

System Config:
--------------
        NANDomain = nan
        NANNetwork = 169.xxx.0.0/16
        NANVlan = 4
        PublicVlan = 1
        RackFirstNode = 1
        RackLastNode = 24
        RackNetwork = 192.xxx.xxx.0/24
        RackSwitchCommunityName = public
        RackVlan = 0


如何从 NTP 配置中删除 IP:

使用以下命令删除一个或多个 NTP IP:
命令:
# sudo setrackinfo -d NTPServer <NTP_Server_IP>
示例:
# sudo setrackinfo -d NTPServer 10.3.4.5

Additional Information

有关 DNS 配置,请参阅文章 ECS:如何添加或删除 DNS 服务器。

Affected Products

ECS Appliance

Products

ECS, ECS Appliance Gen 3, ECS Appliance Hardware Series, ECS Appliance Software with Encryption, ECS Appliance Software without Encryption
Article Properties
Article Number: 000273244
Article Type: How To
Last Modified: 14 Aug 2025
Version:  6
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.