Linux时间同步练习

题目如下:

一.配置server主机要求如下:

1.server主机的主机名称为 ntp_server.example.com

2.server主机的IP为: 172.25.254.100

3.server主机的时间为1984-11-11 11:11:11

4.配置server主机的时间同步服务要求可以被所有人使用

二.设定clinet主机要求如下

1.client主机的IP为:172.25.254.200

2.client主机的主机名称为: client.example.com

3.同步172.25.254.100主机的时间到达本机

4.用命令显示对于172.25.254.100主机的时间同步情况

一、配置server主机要求如下 

 1.1、server主机名修改为'ntp_server.example.com'

 [root@node1 ~]# hostnamectl hostname ntp_server.example.com

 1.2、添加ip地址

[root@node1 ~]# nmcli connection modify ens160 +ipv4.method manual ipv4.addresses 172.25.254.100/24 ipv4.gateway 172.25.254.2  ipv4.dns 223.5.5.5 autoconnect yes

激活网卡

[root@node1 ~]# nmcli connection up ens16

1.3、server主机的时间为`1984-11-11 11:11:11`

 [root@node1 ~]# systemctl stop chronyd.service        #先停时钟服务

[root@node1 ~]# timedatectl set-time "1984-11-11 11:11:11"

 1.4、配置server主机的时间同步服务要求可以被所有人使用

[root@node1 ~]# vim /etc/chrony.conf

pool pool.ntp.org iburst

allow 0.0.0.0/0

local stratum 10

 二、设定client主机要求如下:

2.1、client主机的IP为:172.25.254.200

[root@node1 ~]# nmcli connection modify ens160 +ipv4.method manual ipv4.addresses  172.25.254.200/24 ipv4.gateway 172.25.254.2  ipv4.dns 223.5.5.5 autoconnect yes

#激活网卡

[root@node1 ~]# nmcli connection up ens160     

2.2、修改主机名为`client.example.com` 

[root@node1 ~]# hostnamectl hostname  client.example.com 

2.3、同步172.25.254.100主机的时间到达本机 

 2.4、显示同步情况

[root@node1 ~]# chronyc sources -v

相关推荐

  1. linux时间同步

    2024-04-23 22:18:02       58 阅读
  2. Linux-时间同步服务器

    2024-04-23 22:18:02       39 阅读
  3. Linux时间同步命令

    2024-04-23 22:18:02       62 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-04-23 22:18:02       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-04-23 22:18:02       106 阅读
  3. 在Django里面运行非项目文件

    2024-04-23 22:18:02       87 阅读
  4. Python语言-面向对象

    2024-04-23 22:18:02       96 阅读

热门阅读

  1. Spring Cloud Eureka面试题

    2024-04-23 22:18:02       26 阅读
  2. 【设计模式】观察者模式

    2024-04-23 22:18:02       36 阅读
  3. ecs150 project2 Unix Shell

    2024-04-23 22:18:02       31 阅读
  4. Vue3+Ant Design 父组件调用子组件方法

    2024-04-23 22:18:02       32 阅读
  5. 基于深度神经网络的图像识别技术研究

    2024-04-23 22:18:02       31 阅读
  6. vue-router学习4:嵌套路由

    2024-04-23 22:18:02       31 阅读
  7. nginx配置不同设备访问不同地址

    2024-04-23 22:18:02       37 阅读
  8. Cesium简单案例

    2024-04-23 22:18:02       29 阅读