In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the knowledge of "how to build NetData tools under Linux". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
You can see the main functions of netdata from Github, and there are several main points:
Interactive bootstrap dashboards, cool.
Every metreic responds to all requests in 0.5ms, even if it is a bad machine.
Very efficient, collecting thousands of metrics per second, but accounting for only 1% of cpu single core, a small amount of MB memory and no disk IO at all
Provide complex and various types of alarms, support dynamic thresholds, alarm templates, multiple notification methods, etc.
Extensible, using built-in plug-ins API (such as bash, python, perl, node.js, java, go, ruby, etc.) to collect any measurable data
Zero configuration: netdata automatically monitors everything after installation
Zero dependency: netdata has its own web server, which provides static web files and web API
Zero maintenance: just run!
Support a variety of time series back-end services, such as graphite, opentsdb, prometheus, json document DBs
NetData working interface
System environment:
Centos7
Download and install netData
# download project code ➜git clone https://github.com/firehol/netdata.git # package needed to install the mutation➜ yum-y install zlib-devel libuuid-devel libmnl-devel gcc make git autoconf autogen automake pkgconfig # run the built-in installation startup script ➜cd. / netdata➜. / netdata-installer.sh
When installing the startup script, prompt for the detailed directory of the netData installation and press enter to execute.
Install startup script
Startup and configuration
After the installation is complete, the script outputs a piece of information, including: KSM, port, startup command
Open KSM to save storage footprint
If you have the following information indicating that your system has KSM, but it is not enabled, you can follow the instructions to execute two echo commands to save 40-60% of storage space.
-Check KSM (kernel memory deduper)-Memory de-duplication instructions You have kernel memory de-duper (called Kernel Same-page Merging, or KSM) available, but it is not currently enabled. To enable it run: echo 1 > / sys/kernel/mm/ksm/run echo 1000 > / sys/kernel/mm/ksm/sleep_millisecs If you enable it, you will save 40-60 of netdata memory.
Web Port configuration
The default web access port is 19999.
Netdata by default listens on all IPs on port 19999, so you can access it with: http://this.machine.ip:19999/
If you modify the port, you need to edit # default port = 19999 in the configuration file / etc/netdata/netdata.conf. Remove the comment symbol # and try to change the default value of 19999!
The restart takes effect after the port is modified.
If there is a firewall, open the port (CentOS7 uses firewalld).
Modify web port
Turn netData on / off
# stop ➜systemctl stop netdata # start➜ systemctl start netdata # restart ➜systemctl restart netdata # boot boot➜ systemctl enable netdata # Uninstall ➜. / netdata-uninstaller.sh-- force
At this point, the NetData installation is started and can be accessed through http://host_ip:port without account password.
The following will be combined with Nginx to set account password.
Use Nginx to configure domain name access and set account password authorization
Since netdata does not have an account password system, in order to protect the privacy of the server, we need to use nginx reverse proxy to configure domain name access and use account password authorization.
Prepare in advance:
If the server does not have Nginx, install: yum install nginx
Domain name of netdata, such as netdata.example.com
Generate Nginx password file
# the location of the password file is customized, and the path needs to be recorded and placed in the Nginx configuration. ➜printf "netdata:$ (openssl passwd-apr1)" > / usr/local/nginx/conf/htpasswd
Configure nginx.conf
Create a netdata.conf file in the... nginx/conf.d, write the following, and modify the port number, domain name, and auth_basic_user_file as appropriate.
Upstream backend {# the netdata server, please modify the specific port number server 127.0.0.1 keepalive 1999; keepalive 64;} server {# nginx listens to this listen 80; # the virtual host name of this, request to change the specific domain name server_name netdata.example.com; # auth password auth_basic "netdata Login"; # the path to the password file generated in the previous step auth_basic_user_file / usr/local/nginx/conf/htpasswd Location / {proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://backend; proxy_http_version 1.1; proxy_pass_request_headers on; proxy_set_header Connection "keep-alive"; proxy_store off;}}
Restart nginx
# the location of the password file is customized, and the path needs to be recorded and placed in the Nginx configuration. ➜systemctl reload nginx
After restarting Nginx, you can access it directly through the domain name netdata.example.com, and you need to enter your account number and password. However, it can still be accessed through http://IP:Port, and then disable IP access.
NetData disables external IP requests
Open the NetData configuration file: the bind to modification for the / etc/netdata/netdata.conf,web entry is as follows:
[web] bind to = 127.0.0.1:: 1
Restart NetData: systemctl restart netdata
This is the end of the content of "how to build NetData tools under Linux". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.