To maintain and manage the Linux system, performance monitoring is very important, especially real-time monitoring data. This data helps us determine the load pressure of the server, adjust resource allocation in a timely manner, and better serve services. So, today, migrant workers give you amway a Linux performance real-time monitoring tool: Netdata.

Let’s make an effect picture and look at it

Netdata introduction

Netdata is a real-time performance monitoring tool for Linux systems. Is a highly optimized Linux daemon that provides real-time performance monitoring of Linux systems, applications (including but not limited to Web servers, databases, etc.), SNMP services, and more.

Netdata shows the monitored information by means of visualization, so that you can clearly understand the real-time running status of your system, program and application, and can also be integrated with Prometheus, Graphite, OpenTSDB, Kafka, Grafana and so on.

Netdata is free, open source software currently available on Linux, FreeBSD and macOS, as well as other systems derived from them, such as Kubernetes and Docker.

Netdata Warehouse address: _github.com/netdata/ne…

Netdata features

1, friendly, beautiful visual interface 2, can be customized control interface 3, fast and efficient installation 4, simple configuration, even zero configuration 5, zero dependency 6, extensible, built-in plug-in API 7, wide system platform support

How does Netdata work?

Netdata is an efficient, highly modular metric management engine. Its lock-free design makes it ideal for concurrent operations on metrics.

For a description of the functions of each component in the figure above, you can refer to the official description, which will not be repeated here.

What can Netdata monitor?

Netdata collects metrics from more than 200 popular services and applications, as well as dozens of system-related metrics, such as CPU, memory, disks, file systems, network, and more. These collectors, as we call them, are managed by plug-ins that support a variety of programming languages, including Go and Python.

Popular collectors include Nginx, Apache, MySQL, Statsd, CGroups (containers, Docker, Kubernetes, LXC, etc.), Traefik, Web server access.log files, etc.

For a detailed list of support, please refer to the following instructions: _github.com/netdata/ne…

Install Netdata 1. Install Netdata directly

First, you need to update the system kernel and some dependent library files

[root@CentOS7-1 ~]# yum update -y
Copy the code

If no action is taken, you will be prompted as follows when you install directly. It is also possible to enter y to have the system automatically update.

After the update, run the following command to install Netdata.

[root@CentOS7-1 ~]# bash <(curl -Ss https://my-netdata.io/kicksta...
Copy the code

Then, the program automatically performs the installation action, downloading a series of packages for installation, and checking once in the process, as follows:

Depending on your network relationship, the waiting time may be longer or shorter due to access to foreign resources.

Some key information can also be seen during the installation process, as shown in the image above.

The preceding figure shows the access methods and commands for starting and stopping services.

The installation is complete as shown in the following figure

Netdata: Netdata: Netdata: Netdata: Netdata: Netdata: Netdata

[root@CentOS7-1 ~]# lsof -i :19999
COMMAND   PID    USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
netdata 14787 netdata    4u  IPv4  27995      0t0  TCP *:dnp-sec (LISTEN)
netdata 14787 netdata    5u  IPv6  27996      0t0  TCP *:dnp-sec (LISTEN)
[root@CentOS7-1 ~]# ps -ef|grep netdata
netdata   14787      1  2 23:24 ?        00:00:06 /usr/sbin/netdata -P /var/run/netdata/netdata.pid -D
netdata   14800  14787  0 23:24 ?        00:00:00 /usr/sbin/netdata --special-spawn-server
netdata   14954  14787  0 23:24 ?        00:00:01 bash /usr/libexec/netdata/plugins.d/tc-qos-helper.sh 1
netdata   14974  14787  0 23:24 ?        00:00:02 /usr/bin/python /usr/libexec/netdata/plugins.d/python.d.plugin 1
root      14975  14787  1 23:24 ?        00:00:04 /usr/libexec/netdata/plugins.d/ebpf.plugin 1
netdata   14976  14787  0 23:24 ?        00:00:01 /usr/libexec/netdata/plugins.d/go.d.plugin 1
netdata   14977  14787  1 23:24 ?        00:00:05 /usr/libexec/netdata/plugins.d/apps.plugin 1
root      15277   1149  0 23:29 pts/0    00:00:00 grep --color=auto netdata
Copy the code

2, Docker installation

First prepare the Docker environment, and then execute the following commands directly to complete the installation.

docker run -d --name=netdata -p 19999:19999 -v netdatalib:/var/lib/netdata -v netdatacache:/var/cache/netdata -v /etc/passwd:/host/etc/passwd:ro -v /etc/group:/host/etc/group:ro -v /proc:/host/proc:ro -v /sys:/host/sys:ro -v /etc/os-release:/host/etc/os-release:ro --restart unless-stopped --cap-add SYS_PTRACE --security-opt apparmor=unconfined  netdata/netdataCopy the code

Once the installation is complete, you can access it in the following ways.

The interface display

1. Overall data interface

2, memory,

3, CPU,

4, disk

5, the network

6, application

7. Network interface

8. Data synchronization

Charts on the Netdata dashboard synchronize with each other, there is no master chart. You can pan or zoom any chart at any time, and all other charts will appear.

You can pan the chart by dragging with the mouse. Use SHIFT+ to zoom in/out on the Mouse Wheel chart while the mouse pointer is hovering over the chart.

The power of Netdata

What makes it so powerful is that it works with and supports a variety of applications, as shown above:

Netdata cluster management solution

What is shown above is only the monitoring data of a single server, and one disadvantage of NetData is that all monitored servers need to install Agent. Therefore, there is a problem, that is, how to manage and display the monitoring data in a unified manner?

Netdata has not designed the master-slave mode officially. Like Zabbix, one server can be the master server, and the others can be the slave server, collecting data to the master server for unified processing and display. However, the official also provides related solutions.

1. Netdata. cloud Use the built-in NetData. cloud, which is the signin in the upper right corner of the WEB interface of each installed node. As long as we use the same account to log in to netData. cloud (kexue is required), then the nodes can be easily controlled by one account. Each node enables port 19999 and allows the administrator to view the data. Then the control center collects the data from the ports of each node through the front end and sends it to NetData. cloud for recording and displaying.

This is passive cluster monitoring, essentially stand-alone machines, and it’s not easy to do a custom cluster dashboard.

So, to solve this problem, NetData provides another way to aggregate the data from each node into one (primary) server, where the data is processed, and other nodes do not need to open port 19999. It is an active transmission mode, sending the collected data to the master server, so that the master server can carry out customized dashboard development.

Disadvantages: The traffic and load of the primary server are relatively large (in the case of a large number of cluster servers). If the load of the primary server is too high, we can solve this problem by setting the data collection cycle of the node server (Update every).

Netdata cluster monitoring configuration

Many articles are only introduced its installation and some interface display results, and did not provide cluster monitoring this solution and its specific configuration, migrant brother is also checked a lot of information, now will be the configuration process to share with you.

Streaming: Docs.net data.cloud/st…

1. Configure the node server

[root@CentOS7-1 ~]# CD /etc/netdata.conf [root@CentOS7-1 netdata]# vim netdata.conf # Hostname = [recommended to change to your hostname] [web] mode = noneCopy the code

Next, create a new file stream.conf in /etc/netdata/ and configure it as follows:

[stream] enabled = yes destination = MASTER_SERVER_IP:PORT API key = XXXX-XXXX-XXXX-XXXX-xxxx # Destination = MASTER_SERVER_IP:PORT Specifies the IP address and PORT of the master server. The API key must be a string of uUID characters. In Linux, you can use the following command to automatically generate the characters. [root@CentOS7-1 netdata]# uuidgen 480fdc8c-d1ac-4d6f-aa26-128eba744089Copy the code

After the configuration is complete, restart the NetData service on the node.

[root@CentOS7-1 ~]# systemctl restart netdata
Copy the code

2. Configure the primary server

Create stream.conf in the same directory as netdata.conf and write the following configuration:

[API_KEY]/[480fdc8c-d1ac-4d6f-aa26-128eba744089] enabled = yes default history = 3600 default memory mode = save health enabled by default = auto allow from = * [API_KEY] enabled = yes default history = 3600 default memory mode = save Health Enabled by default = auto allow from = * # Where, API_KEY corresponds to the API key of the node server (a string), allow from You can set the allowed source of data flow to ensure security. If there are multiple node servers, write them together in stream.confCopy the code

Restart NetData after the configuration is complete:

systemctl restart netdata
Copy the code

After all configurations are complete, you can click the drop-down list (host name) in the upper right corner of the WEB interface of the primary server to view the monitoring information.

If you need to customize the control panel, you can refer to the official documentation to modify the XML file. Docs.net data.cloud/we…

Here, this practical, cool server performance real-time monitoring tools on the end of the introduction, the original is not easy, if helpful, please click in the like, forwarding share support migrant workers brother, your support is my biggest creative power.