第十章练习题

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命令可以查看到关机前的日志











评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值