I. Log management (RSYSLOG)
-RSYSLOGD service Management capture log
-Systemd-journald Service Analysis log
-Manage Log Profile/etc/rsyslog.conf
1. Experiment: Log synchronization (Synchronize the logs on the desktop host to the server host)
(1). Turn off the firewall of the two host
Set ip:desktop:172.25.254.1 server:172.25.254.11
Modify host Name: Hostnamectl set-hostname DESKTOP1
Hostnamectl Set-hostnameserver11
(2). Desktop:
Modify the/etc/rsyslog.conf file (*. * @172.25.254.11) and restart the Rsyslog service
Server
Modify the/etc/rsyslog.conf file (open the UDP receive log port) to restart the Rsyslog service
(3). Detect: View the log files of the server in real time (Tail-f/var/log/messages)
The Desktop Execution command logger test hello generates a detection log to see if it can be seen in the log information of the server.
2. View pre-boot log analysis
(1) mkdir/var/log/journal
(2) Chgrp systemd-journal/var/log/journal
(3) chmod g+s/var/log/journal
(4) Systemctl Reloadsystemctl-journald | Killall-1 Systemd-journald
Detection: Restart the host to view the log information, whether there is a previous log information to boot
(5) Ls/var/log/journal
Init 6
Journalctl
Two. Time synchronization (desktop host and server host time synchronization)
1. Close the Desktop,server host's firewall;
2. Change the configuration file of the server-side chronyd service/etc/chrony.conf (allow 172.25/16;local stratum 1), restart the Chronyd service
3. Change the configuration file/etc/chrony.conf (server172.25.254.11 iburst) of the desktop-side chronyd service and restart the Chronyd service
4. Is the detection time synchronization successful?
-Timedatectl (Ntpsynchronized:yes)
-Chronyc Sources-v
Note: (1). The firewall must be shut down;
(2). After modifying the configuration, you must restart the service;
(3). Be sure that the IP configuration is successful
Linux Beginner Notes 02