Linux Beginner Notes 02

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.