Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the construction of linux log server?

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

What this article shares with you is about how the linux log server is built. The editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.

one. Server side

# ps-ef | grep syslogd

Check whether the syslogd process has a parameter of-r

As mentioned earlier,-r means to accept log information from a remote server. In this way, the server will listen on udp port 514.

Check the / etc/init.d/syslog and / etc/sysconfig/syslog files on the log server

The former is the script that starts syslog, and the latter is the choice of parameters when syslogd starts.

You can add the-r parameter at the appropriate place in any file.

For example:

In the / etc/init.d/syslog file

Start () {

Echo-n $"Starting system logger:"

Daemon syslogd-r $SYSLOGD_OPTIONS

In the / etc/sysconfig/syslog file

# Options to syslogd

#-m 0 disables' MARK' messages.

#-r enables logging from remote machines

#-x disables DNS lookups on messages recieved with-r

# See syslogd (8) for more details

SYSLOGD_OPTIONS= "- r-m 0"

Of course, you can simply use this command. But not after rebooting.

# / sbin/syslogd-r m 0

In addition, if you need to forward the logs of itself and the remote server to another log server, you need the parameter with-h

You can man syslogd for details.

two. Client

Modify the / etc/syslog.conf file on the client server

such as

*. * @ hostname

Is to transfer all the log logs to the hostname log server.

Note that the client needs to be able to recognize the hostname of the log server. One way is that DNS can parse the log server hostname, and the other is to add the log server's hostname to / etc/hosts.

Of course, you can also use IP directly.

three. Restart the client syslog

/ etc/init.d/syslog

In this way, you can see the client log in the various logs of the log server / var/log.

The above is how the linux log server is built, and the editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report