安装NETDATA集群监控面板
介绍
官方链接
演示网页:https://my-netdata.io/
官方首页:http://netdata.cloud/
文档地址:http://docs.netdata.cloud
github地址:https://github.com/netdata/netdata#infographic
安装
官网提供一键安装脚本
bash <(curl -Ss https://my-netdata.io/kickstart.sh)
国内使用一键安装脚本需要添加参数
bash <(curl -Ss https://my-netdata.io/kickstart.sh) --stable-channel
修改主节点的配置
# 主服务器配置
# 生成uuid格式的字符串
root@cby:~# uuidgen
856a8565-75ac-441f-89e1-2d983272cfde
root@cby:~# vim /etc/netdata/stream.conf
root@cby:~# cat /etc/netdata/stream.conf
[856a8565-75ac-441f-89e1-2d983272cfde]
enabled = yes
default history = 3600
default memory mode = save
health enabled by default = auto
allow from = *
root@cby:~#
root@cby:~#
# allow from 可以设置数据流的允许来源以保证安全
# destination 是主节点ip地址
# 重启netdata
root@cby:~# systemctl restart netdata
root@cby:~#
配置其他节点
# 其它服务器配置
root@cby:~# vim /etc/netdata/netdata.conf
root@cby:~# cat /etc/netdata/netdata.conf
[global]
run as user = netdata
page cache size = 32
dbengine multihost disk space = 256
memory mode = none
hostname = node-1
[web]
mode = none
root@cby:~#
root@cby:~# vim /etc/netdata/stream.conf
root@cby:~# cat /etc/netdata/stream.conf
[stream]
enabled = yes
destination = 101.43.189.29:19999
api key = 856a8565-75ac-441f-89e1-2d983272cfde
root@cby:~#
root@cby:~#
# destination填写服务端的IP和端口
# 重启netdata
root@cby:~# systemctl restart netdata
root@cby:~#
启用插件
以MySQL插件为例
# 创建权限用户
root@cby:~# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 7137
Server version: 8.0.35 MySQL Community Server - GPL
Copyright (c) 2000, 2023, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
mysql>
mysql> CREATE USER 'netdata'@'localhost' IDENTIFIED BY 'password';
Query OK, 0 rows affected (0.52 sec)
mysql> GRANT USAGE, REPLICATION CLIENT, PROCESS ON *.* TO 'netdata'@'localhost';
Query OK, 0 rows affected (0.01 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.13 sec)
# 配置Netdata的mysql.conf
root@cby:/etc/netdata# cd /etc/netdata
root@cby:/etc/netdata# sudo ./edit-config go.d/mysql.conf
······略······
# netdata
- name: local
dsn: netdata:password@unix(/var/lib/mysql/mysql.sock)
- name: local
dsn: netdata:password@tcp(127.0.0.1:3306)/db_test
······略······
# 异常查看
root@cby:/etc/netdata# cd /usr/libexec/netdata/plugins.d/
root@cby:/etc/netdata# sudo -u netdata -s
root@cby:/etc/netdata# ./go.d.plugin -d -m mysql
systemctl restart netdata
访问
访问主节点地址 即可查看到监控面板,在node标签页面中即可查看到其他的nodes监控情况
http://101.43.189.29:19999/
访问老版本的面板
http://101.43.189.29:19999/v0/
http://101.43.189.29:19999/v1/
http://101.43.189.29:19999/v2/
关于
https://www.oiox.cn/index.php/start-page.html
CSDN、GitHub、51CTO、知乎、开源中国、思否、博客园、掘金、简书、华为云、阿里云、腾讯云、哔哩哔哩、今日头条、新浪微博、个人博客
全网可搜《小陈运维》
文章主要发布于微信公众号