You are not logged in.
Pages: 1
I have two machines: server and miniserver and ran the following commands
server:
sudo pacman -S openmpi
cd ~/.ssh
ssh-keygen -t rsa
cp id_rsa.pub authorized_keys
chmod 600 authorized_key
sssh-copy-id miniserver
sudo vi /etc/ssh/sshd_config: Add the following lines
PubkeyAuthentication yes
RSAAuthentication yes
sudo pacman -S ntp
sudo vi /etc/ntp.conf: Add the following lines
tos orphan 15
logfile /var/log/ntp.log
sudo ntpd -u ntp:ntp
sudo systemctl start ntpd.service
sudo systemctl enable ntpd.service
sudo pacman -S nfs-utils
mkdir ~/sharedfolder
chmod 777 ~/sharedfolder
sudo vi /etc/exports:
/home/vorlket/sharedfolder miniserver(rw,sync)
sudo exportfs -arv
sudo systemctl start nfs-server.service
sudo systemctl enable nfs-server.serviceminiserver:
sudo pacman -S openmpi
cd ~/.ssh
ssh-keygen -t rsa
cp id_rsa.pub authorized_keys
chmod 600 authorized_key
sssh-copy-id server
sudo vi /etc/ssh/sshd_config:
PubkeyAuthentication yes
RSAAuthentication yes
sudo pacman -S ntp
sudo pacman -S nfs-utils
mkdir ~/sharedfolder
chmod 777 ~/sharedfolder
sudo mount server:/home/vorlket/sharedfolder /home/vorlket/sharedfolderNow, I want to know: how to get miniserver synchronize to the ntpd running on server.
Last edited by vorlket (2024-01-05 14:48:16)
Offline
We prefer one questioin per topic and your 3 questions are not related. please create seperate threads.
Let's keep this thread about the nptd question .
1. how to get miniserver synchronize to the ntpd running on server;
server 0.pool.ntp.org iburst
server 1.pool.ntp.org iburst
server 2.pool.ntp.org iburst
server 3.pool.ntp.org iburstreplace the addresses / names in those lines with the ones used by your server .
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
Both miniserver and server are not connected to the internet.
Last edited by vorlket (2024-01-01 20:29:43)
Offline
So?
If you want to use the ntp server on "server" as ntp server on "miniserver", you'll have to configure the "miniservers" /etc/ntp.conf to use the "server" as server, whether by domain or IP.
Whether there's an internet connection doesn't matter, but there needs to be *some* network connection (same LAN segment, local router, …)
NTP is the "Network Time Protocol", it doesn't make any sense w/o a network.
Offline
Ok. They are connected in a LAN and connected to the internet when needed, i.e. not always connected to the internet. Let me change the configuration file and check. Thanks.
Offline
$ ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
server .XFAC. 16 u 2 64 0 0.000 +0.000 0.000Is this a correct setup?
10 mins later:
$ ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
*server 220.158.215.20 3 u 15 64 77 0.379 +0.251 0.630Last edited by vorlket (2024-01-02 02:12:03)
Offline
Your "server" gets resolved to a publically routable IP that belongs to telesmart.co.nz?
Offline
When not connected to the internet:
[vorlket@server ~]$ ntpq -p
No association ID's returned
[vorlket@miniserver ~]$ ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
server .XFAC. 16 u 34 128 0 0.000 +0.000 0.000When connected to the internet:
[vorlket@server ~]$ ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
180-150-99-115. .STEP. 16 u - 64 0 0.000 +0.000 0.000
*time.cloudflare 10.236.8.7 3 u 36 64 1 7.479 +0.015 0.530
pauseq4vntp2.da .STEP. 16 u 966 64 0 0.000 +0.000 0.000
220.158.215.20 .STEP. 16 u 805 64 0 0.000 +0.000 0.000
[vorlket@miniserver ~]$ ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
server 162.159.200.123 4 u 11 256 1 0.714 -371.62 0.000Offline
Maybe post your /etc/ntp.conf and the output of "ping -c1 server"
"nmap -p 123 server" will btw tell you whether "server" listens on the NTP port
Offline
[vorlket@server ~]$ cat /etc/ntp.conf
# Please consider joining the pool:
#
# http://www.pool.ntp.org/join.html
#
# For additional information see:
# - https://wiki.archlinux.org/index.php/Network_Time_Protocol_daemon
# - http://support.ntp.org/bin/view/Support/GettingStarted
# - the ntp.conf man page
# Associate to Arch's NTP pool
server 0.arch.pool.ntp.org iburst
server 1.arch.pool.ntp.org iburst
server 2.arch.pool.ntp.org iburst
server 3.arch.pool.ntp.org iburst
tos orphan 15
# By default, the server allows:
# - all queries from the local host
# - only time queries from remote hosts, protected by rate limiting and kod
restrict default kod limited nomodify nopeer noquery notrap
restrict 127.0.0.1
restrict ::1
# Location of drift file
driftfile /var/lib/ntp/ntp.drift
logfile /var/log/ntp.log
[vorlket@miniserver ~]$ cat /etc/ntp.conf
# Please consider joining the pool:
#
# http://www.pool.ntp.org/join.html
#
# For additional information see:
# - https://wiki.archlinux.org/index.php/Network_Time_Protocol_daemon
# - http://support.ntp.org/bin/view/Support/GettingStarted
# - the ntp.conf man page
# Associate to Arch's NTP pool
#server 0.arch.pool.ntp.org
#server 1.arch.pool.ntp.org
#server 2.arch.pool.ntp.org
#server 3.arch.pool.ntp.org
server 192.168.1.3
# By default, the server allows:
# - all queries from the local host
# - only time queries from remote hosts, protected by rate limiting and kod
restrict default kod limited nomodify nopeer noquery notrap
restrict 127.0.0.1
restrict ::1
# Location of drift file
driftfile /var/lib/ntp/ntp.drift[vorlket@miniserver ~]$ ping -c1 server
PING server (192.168.1.3) 56(84) bytes of data.
64 bytes from server (192.168.1.3): icmp_seq=1 ttl=64 time=0.246 ms
--- server ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.246/0.246/0.246/0.000 ms[vorlket@miniserver ~]$ nmap -p 123 server
Starting Nmap 7.94 ( https://nmap.org ) at 2024-01-03 20:53 AEDT
Nmap scan report for server (192.168.1.3)
Host is up (0.00079s latency).
PORT STATE SERVICE
123/tcp closed ntp
Nmap done: 1 IP address (1 host up) scanned in 0.03 secondsOffline
Well, 123 is closed on that host, not even filtered.
On the server, check
ss -tulpen | grep 123Offline
NTP uses udp
nmap -sU -p 123 serverntpd can be finicky you might need a line like
restrict *serverip*on miniserver. And probably a "prefer" on the server line as well.
If you want to keep serving wih no internet:
server 127.127.1.0
fudge 127.127.1.0 stratum 10in the server's ntp.conf but your clocks WILL drift by the server drift.
That said, is there a requirement for using ntpd instead of just systemd-timesyncd.service on the miniserver?
Offline
[vorlket@miniserver ~]$ sudo nmap -sU -p 123 server
Starting Nmap 7.94 ( https://nmap.org ) at 2024-01-05 11:19 AEDT
Nmap scan report for server (192.168.1.3)
Host is up (0.00022s latency).
PORT STATE SERVICE
123/udp open ntp
MAC Address: 00:0A:F7:7A:14:12 (Broadcom)
Nmap done: 1 IP address (1 host up) scanned in 0.27 seconds[vorlket@server ~]$ ntpq -p
No association ID's returned
[vorlket@miniserver ~]$ ntpq -p remote refid st t when poll reach delay offset jitter
==============================================================================
server .XFAC. 16 u 261 1024 0 0.000 +0.000 0.000No requirement, the NFS page says install NTP.
Offline
Restarted my servers and now,
[vorlket@server ~]$ ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
*LOCAL(0) .LOCL. 10 l 35 64 377 0.000 +0.000 0.000
[vorlket@miniserver ~]$ ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
server LOCAL(0) 11 u 6 64 7 0.396 -1687.2 1.732Offline
No requirement, the NFS page says install NTP.
wtf are you talking about?
It is highly recommended to use a time synchronization daemon to keep client/server clocks in sync. Without accurate clocks on all nodes, NFS can introduce unwanted delays.
Is this a massive https://en.wikipedia.org/wiki/XY_problem
You don't have to run your own NTP server to use NFS, just make sure the system times are correct on all nodes.
Offline
Ok, thanks.
Offline
Pages: 1