当前位置:网站首页>Set up a time server

Set up a time server

2022-07-06 21:16:00 Yang Yangyang baa ~

1、 Environmental requirements ( Both client and server should be installed chrony)

Two or more virtual machines are needed to act as servers and clients , All must have yum Source , Then install them separately ntp, Because I used it CentOS8, So the download command is :yum install -y chrony
** Be careful :** I am installing yum There are many problems with the source , I am persistent and use a way to install yum Source thus wasted a lot of time and failed to install , Later, I succeeded in borrowing the method of my classmates , Record the successful installation process here :
a. First cd /etc/yum.repos.d/ Take a look at the configuration file :
 Insert picture description here
b. Delete these original yum Source :rm -rf *
 Insert picture description here
c. Check your own mirrored version , Go to relevant websites to download matching yum Source
 Insert picture description here
The website here is :https://developer.aliyun.com/mirror/?spm=a2c6h.25603864.0.0.50154ccaMggZGI, Just copy the corresponding command
 Insert picture description here
d. install yum Source , The order is :

curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo

If your mirror version is centos8, You can directly copy my commands
 Insert picture description here
e. Test and install ntp(CentOS7 In the future, it will basically be chrony), see yum Source installed successfully .
 Insert picture description here
here yum The source is finally available

2、 Find a reliable time server address

This step is to search on Baidu , What I use here is ntp1.aliyun.com,
After you find the right address , Start with the virtual machine ping See if it can connect , It can be used if it can be connected .

3、 Edit the of the server chrony The configuration file

The order is :vim chrony.conf
At this time, the first line of white text , It's a time server address he gave you , But we need to use our own virtual machine to test whether it can ping through , Can be used
 Insert picture description here
My result is that Ping through , But it's slower , Because he is a foreign website .
 Insert picture description here
Turn on chronyd service , Verification time
 Insert picture description here

原网站

版权声明
本文为[Yang Yangyang baa ~]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202131125565664.html

随机推荐