Configuring a Solaris NTP Server

 

The /etc/inet/ntp.server file is a template for configuring an NTP server. Copy this file to /etc/inet/ntp.conf, and edit it to meet your network’s requirements. When viewing the ntp.server file contents, remember that an NTP server is also an NTP client.

 

On Solaris 9 the /etc/rc2.d/S74xntpd  script is executed at system boot time and starts the xntpd process if the /etc/inet/ntp.conf file exists. The xntpd process starts in either the client or the server mode, depending on the contents of the ntp.conf file. The following steps describe the xntpd process.

On Solaris 10 this service is controlled by svcadm.

#svcs -a | grep ntp
online 13:09:43 svc:/network/ntp:default

For example to restart it you need to use (note, not ntpd, but ntp):

#svcadm restart ntp

The NTP servers advertise every 64 seconds, by means of a multicast address (224.0.1.1), that they are NTP servers. Any NTP client that is not configured with the unicast address of an NTP server multicasts when the xntpd process starts. View the line that causes the system to act as an NTP server by typing the following:

myhost# grep broadcast /etc/inet/ntp.server
broadcast 224.0.1.1 ttl 4

Local NTP servers answer the multicast advertisements. The NTP client sends request packets to all the NTP servers that it knows. Included in the request packet is the client’s local time. The NTP server replies by inserting UTC time into the packet and then returns the packet to the client. The client compares its original request time with its own time when it receives the response from the server. This allows the client to determine how long the packet was in transit on the network.

The client uses the UTC time value from the NTP server after it receives several responses from the NTP server. It can take up to five minutes for an NTP client to synchronize with an NTP server.

Using an Undisciplined Local Clock

NTP servers can, but should not, use their own undisciplined local clock as an official, reliable time source.

To use an undisciplined local clock, complete the following steps:

1. Copy the /etc/inet/ntp.server file to the /etc/inet/ntp.conf file.

myhost# cp /etc/inet/ntp.server /etc/inet/ntp.conf

2. Open the /etc/inet/ntp.conf file for editing, and change the server IP address to 127.127.1.0, where the number 1represents the undisciplined local clock. Comment out the fudge keyword because special configuration is not needed for the local reference clock.

myhost# vi /etc/inet/ntp.conf

Change:

server 127.127.XType.0 prefer
fudge 127.127.XType.0 stratum 0

to:

server 127.127.1.0 prefer
# fudge 127.127.XType.0 stratum 0

Note – Choices for XType are listed in the comments of the
/etc/inet/ntp.server file.

3. Create a drift file as specified by the drift file /var/ntp/ntp.drift  entry in the /etc/inet/ntp.conf file:

 touch /var/ntp/ntp.drift

4. Verify that the file exists and then start the NTP daemon by using the xntpdscript in the /etc/init.d
directory.

myhost# /etc/init.d/xntpd start
myhost#

6. Verify that the NTP daemon is running using  pgrep -lf ntp. Then use the snoop utility to view NTP server multicast advertisements.

myhost# /usr/sbin/snoop | grep -i ntp

Configure the Stratum of the Server

You can manually configure the stratum of an NTP server by editing the fudge entry in the ntp.conf file. This is useful when you do not have access to an external NTP server and you have to manually synchronize with another system. Systems that use their internal clock advertise themselves as stratum-4 servers.

When a local clock is configured to act as an accurate source of time, NTP will detect this. Systems that use their own clock as a time source will  advertise themselves as a stratum-4 server by default. However, the fudge keyword could be used to alter this behavior. The fudge configuration entry can use the stratum option to override the stratum level sent out with the NTP server’s time advertisements.

Using External NTP Reference Servers

Determine which NTP servers are reachable by your NTP server. Refer to

 http://www.eecis.udel.edu/~mills/ntp/clock2.htm

for a list of  stratum-2 servers. You must notify the NTP server’s administrators of  your intention to use their NTP server as a reference server so the administrator can properly size NTP servers for the additional NTP load.

To use external NTP reference servers, complete the following steps:

1. Copy the /etc/inet/ntp.server file to the /etc/inet/ntp.conf file.

# cp /etc/inet/ntp.server /etc/inet/ntp.conf

2. Open the /etc/inet/ntp.conf file for editing, and change the server entry. Comment out the fudge keyword because special configuration is not needed for an external reference clock.

# vi /etc/inet/ntp.conf

Change:

server 127.127.XType.0 prefer
fudge 127.127.XType.0 stratum 0

to:

server external-time-server-a
server external-time-server-b
server external-time-server-c
# fudge 127.127.XType.0 stratum 0

 

3. Create a drift file as specified by the drift file /var/ntp/ntp.drift entry in the /etc/inet/ntp.conf file.

# touch /var/ntp/ntp.drifts

4. Verify that the file exists.

# ls -al /var/ntp/ntp.drift
-rw-r--r--1 root other 0 Dec 27 01:41 /var/ntp/ntp.drift

5. Start the NTP daemon by using the /etc/init.d/xntpd script.

# /etc/init.d/xntpd start

6. Check to see if the NTP daemon is running.

# pgrep -lf ntp
1595 /usr/lib/inet/xntpd
 

Managing Daemons

By default, all NTP messages are sent to the syslog utility.

To view the logged information in pseudo real-time, use the tail utility with the follow (-f) option. For example:

myhost# tail -f /var/adm/messages
Dec 27 01:25:37 myhost xntpd[1614]: [ID 450285 daemon.error] 0 makes a poor control keyid

You can query or configure a running xntpdprocess by using the xntpdc utility, which was introduced in the Solaris 8 OE. The xntpdc utility provides an extensive xntpdstate. You can use statistic information in the interactive or the command-line mode.

The NTP service is automatically started at boot time if the /etc/inet/ntp.conf file exists. You can manually stop the service by using the /etc/init.d/xntpd run script with stop as an argument.

To stop the daemon, perform the command:

# /etc/init.d/xntpd stop

To start the daemon, perform the command:

# /etc/init.d/xntpd start

Configuring an NTP Client

Configuration of an NTP client also requires the /etc/inet/ntp.conf  file to be established, as it does with NTP servers.

To initialize the file configuration, complete the following steps:

1. Copy the /etc/inet/ntp.client file to the /etc/inet/ntp.conf file.

# cp /etc/inet/ntp.client /etc/inet/ntp.conf

The /etc/inet/ntp.conf file contains only one entry, by default, that configures the client to use the default multicast address to solicit for servers.

# tail -1 /etc/inet/ntp.client
multicastclient 224.0.1.1

 

2. Check if the NTP daemon is running. # pgrep -lf ntp

3. Start the NTP daemon by using the xntpd script in the /etc/init.d  directory.


# /etc/init.d/xntpd start

The xntpd startup script initially uses the ntpdate utility to synchronize the client’s clock to UTC time. After the ntpdate utility has accomplished this, the xntpd process is started by the xntpd script to maintain synchronization.

# pgrep -lf ntp
1679 /sbin/sh /etc/init.d/xntpd start
1680 /usr/sbin/ntpdate -s -w -m 224.0.1.1

 

Note – The xntpd script remains in a wait state until the ntpdate utility completes. The ntpdate utility automatically runs to gather NTP inputs and sets the initial time on this system. The ntpdate utility might perform this initial setting by means of a step or a slew. Refer to the ntpdate man page for further details.

Managing NTP Client Daemons

The NTP client’s daemons are managed in a similar way to the way in which the NTP server’s daemons are managed.

To manage NTP client daemons, complete the following steps:

1. Check if the NTP daemon is running.


# pgrep -lf ntp

2. Start the NTP daemon by using the xntpdscript in the /etc/init.d  directory.

# /etc/init.d/xntpd start

The xntpd startup script initially uses the ntpdate utility to synchronize the client’s clock to UTC time. After the ntpdate utility
has accomplished this, the xntpd process is started by the xntpd script to maintain synchronization.

# pgrep -lf ntp
1679 /sbin/sh /etc/init.d/xntpd start
1680 /usr/sbin/ntpdate -s -w -m 224.0.1.1

 

 

From:http://www.softpanorama.org/Net/Application_layer/NTP/configuring_a_solaris_ntp_server.shtml

 

 

### 回答1: 很抱歉,您遇到了这个问题。这个错误提示通常是在安装或配置软件时出现的。这可能是由于许多不同的原因造成的,例如配置文件的错误设置、缺少依赖项、权限问题等。 要解决此问题,您可以尝试以下几种方法: 1. 检查您的配置文件是否正确设置,并确保您已经安装了所需的依赖项。 2. 确保您有足够的权限来访问所需的文件和目录。您可以尝试使用sudo命令来运行程序,以便获得管理员权限。 3. 查看程序的日志文件以了解更多信息。日志文件通常包含有关错误原因的详细信息,帮助您更好地诊断问题。 4. 如果您仍然无法解决问题,请尝试在相关的技术论坛或社区中寻求帮助。您可能会得到更多的建议和指导。 希望这些方法能够帮助您解决问题。如果您需要进一步的帮助,请告诉我更多细节,我会尽力回答您的问题。 ### 回答2: "A problem occurred configuring" 是一个英语短语,指的是在配置过程中出现了问题。它通常用于描述在软件安装、网络设置或设备连接等过程中遇到的困难或错误。 这个问题的具体原因可能有很多种。可能是由于错误的输入、配置文件的损坏、网络连接的故障、设备驱动程序的不兼容性或其他未知的技术问题。 解决这个问题的方法取决于具体的情况。首先,我们应该检查输入是否准确且符合要求,确保所有的配置选项都正确填写。如果是配置文件损坏,在备份的前提下,我们可以尝试使用备份文件进行修复。如果是网络连接问题,我们可以检查线缆连接、路由器设置或尝试重新启动网络设备。如果是设备驱动程序不兼容性,我们可以尝试更新或更换驱动程序。 此外,查找错误信息和日志文件也是解决问题的关键。这些信息通常会提供有关具体问题的详细信息,从而指导我们采取正确的行动。我们可以在互联网上搜索类似的问题和解决方案,或者寻求专业人士的帮助。 总之,在遇到配置问题时,我们应该耐心且仔细地诊断问题,并采取适当的解决方案。通过正确的操作和合理的解决方案,我们通常能够成功解决配置问题并继续进行正常的操作。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值