| 
                        副标题[/!--empirenews.page--]
                          
从Github上能够看到netdata的主要功能,主要有几点:
 
    -  interactive bootstrap dashboards, 酷炫
 
    - 所有请求每个metreic都在0.5ms内响应,即便是一台烂机器
 
    - 非常高效,每秒采集数千个指标,但仅占cpu单核1%,少量MB的内存以及完全没有磁盘IO
 
    - 提供复杂的、各种类型的告警,支持动态阈值、告警模板、多种通知方式等
 
    - 可扩展,使用自带的插件API(比如bash, python, perl, node.js, java, go,  ruby等)来收集任何可以衡量的数据
 
    - 零配置:安装后netdata会自动的监测一切
 
    - 零依赖:netdata有自己的web server, 提供静态web文件和web API
 
    - 零维护:只管跑上!
 
    - 支撑多种时间序列后端服务,比如graphite, opentsdb, prometheus, json document DBs
 
 
  
NetData工作界面 
系统环境: 
Centos7 
下载安装netData 
- # 下载项目代码 
 - ➜ git clone https://github.com/firehol/netdata.git 
 - # 安装变异所需要的包 
 - ➜ yum -y install zlib-devel libuuid-devel libmnl-devel gcc make git autoconf autogen automake pkgconfig 
 - # 运行自带的安装启动脚本 
 - ➜ cd ./netdata 
 - ➜ ./netdata-installer.sh 
 
  
安装启动脚本时,提示netData安装的详细目录,按下Enter键执行。 
  
安装启动脚本 
启动和配置 
安装完成后,脚本输出一段信息,包括:KSM、端口、启动命令 
开启 KSM 以节省储存占用 
如果有下列信息,说明你的系统有 KSM,但是未启用,可以按照说明执行两句echo命令,节省 40-60% 的储存空间。 
-  --- 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端口配置 
默认的web访问端口为19999。 
- netdata by default listens on all IPs on port 19999, 
 - so you can access it with: 
 -  http://this.machine.ip:19999/ 
 
  
如果修改端口,需要编辑配置文件/etc/netdata/netdata.conf 中的 # default port =  19999。去掉注释符号#,端口尽量改掉默认的19999 !!! 
修改端口后重启生效。 
如果有防火墙,需开放端口(CentOS7使用firewalld)。 
  
修改web端口 
启动/关闭netData 
- # 停止 
 - ➜ systemctl stop netdata 
 - # 启动 
 - ➜ systemctl start netdata 
 - # 重启 
 - ➜ systemctl restart netdata 
 - # 开机启动 
 - ➜ systemctl enable netdata 
 - # 卸载 
 - ➜ ./netdata-uninstaller.sh --force 
 
  
至此,NetData安装启动完毕,可以通过http://host_ip:port 进行访问,无需账号密码。 
下面将结合Nginx设置账号密码。 
使用Nginx配置域名访问,设置账号密码授权 
由于netdata没有帐号密码体系,为保护服务器隐私,我们要使用nginx反向代理配置域名访问,并使用账号密码授权。 
事先准备: 
    - 如果服务器没有Nginx,安装: yum install nginx
 
    - netdata的域名,如: netdata.example.com
 
 
生成Nginx密码文件 
- # 密码文件存放位置自定义,路径需记录下来,放在Nginx配置中。 
 - ➜ printf "netdata:$(openssl passwd -apr1)" > /usr/local/nginx/conf/htpasswd 
 
  
配置nginx.conf 
                        (编辑:52站长网) 
【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! 
                     |