第十章练习题

来源:互联网 发布:c语言对数函数怎么表示 编辑:程序博客网 时间:2024/06/05 18:55

1.配置desktop主机和server主机的日志服务要求如下:

*)desktop主机中的日志全部定向到/var/log/westos文件中

更改该vim /etc/rsyslog.conf配置文件如下,并重启rsyslog服务:


*)时时同步desktop主机中的所有日志到server中

更改desktop主机中该vim /etc/rsyslog.conf配置文件如下

服务端测试结果为:



2.在server主机中用timedatectl命令设定系统时区为上海,时间为11:11:11


3.配置server主机的chronyd服务,使server主机中的时间可以被desktop主机同步

4.同步server主机中的时间到desktop主机中

1.服务端

vim /etc/chrony.conf                                   ##主配置文件
21 # Allow NTP client access from local network.
22 allow 172.25.254.191/24                      ##允许谁去同步我的时间
27 # Serve time even if not synchronized to any NTP server.
28 local stratum 10                            ##不去同步任何人的时间,时间同步服务器级别

systemctl restart chronyd
systemctl stop firewalld

2.客户端
vim /etc/chrony.conf
  3 server 0.rhel.pool.ntp.org iburst
  4 server 1.rhel.pool.ntp.org iburst====> server ntpserverip iburst
  5 server 2.rhel.pool.ntp.org iburst====>
  6 server 3.rhel.pool.ntp.org iburst

systemctl restart chronyd

测试结果如下图:



5.配置系统中的systemd-journal程序,使journal命令可以查看到关机前的日志











0 0
原创粉丝点击