Zabbix调优

1、调优

① Database:
  历史数据不要保存太长时长;
  尽量让数据缓存在数据库服务器的内存中;
② 触发器表达式:减少使用聚合函数 min(), max(), avg();尽量使用last(),nodata();
  因为聚合函数,要运算
③ 数据收集:polling较慢(减少使用SNMP/agentless/agent);尽量使用trapping(agent(active)主动监控);
④ 数据类型:文本型数据处理速度较慢;尽量少收集类型为文本 text或string类型的数据;多使用类型为numeric 数值型数据 的;

2、zabbix服务器的进程

(1) 服务器组件的数量;
  alerter, discoverer, escalator, http poller, hourekeeper, icmp pinger, ipmi polller, poller, trapper, configration syncer, ...
  StartPollers=60
  StartPingers=10
  ...
  StartDBSyncer=5
  ...
 
(2) 设定合理的缓存大小
   CacheSize=8M
   HistoryCacheSize=16M
   HistoryIndexCacheSize=4M
   TrendCacheSize=4M
   ValueCacheSize=4M
 
(3) 数据库优化
 
忘记密码怎么办
数据库中users表,密码采用的md5加密.
 

配置

 

集群时间同步

 
 
为了节约网络资源,可让集群中一台服务器(主时间服务器)同步网络时间,其它服务器与主时间服务器进行同步。
例:三台服务器需要做时间同步
192.168.10.11 主时间服务器
192.168.10.12
192.168.10.13
 

配置过程

 
所有机器安装chrony
# yum install -y chrony
 

主时间服务器配置

1. 修改主配置文件
# egrep -v "^#|^$" /etc/chrony.conf
server 0.centos.pool.ntp.org iburst # 这里的server是网络时间服务器,本机将会向它们同步时间
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst
driftfile /var/lib/chrony/drift
makestep 1.0 3
rtcsync
allow 192.168.10.0/24 # 允许谁向本服务器同步时间,这行本来是注释的,将其打开并修改。
logdir /var/log/chrony
阿里ntp的服务器列表
time1.aliyun.com
time2.aliyun.com
time3.aliyun.com
time4.aliyun.com
time5.aliyun.com
time6.aliyun.com
time7.aliyun.com
 
2. 重启服务
# systemctl restart chronyd
 
3. 查看时间服务器
# chronyc sources
 

集群中其他服务器配置

其他服务器只需要将server中的网络时间服务器地址改为主时间服务器地址就可以了
[root@host2 ~]# egrep -v "^#|^$" /etc/chrony.conf
server 192.168.10.11 iburst
driftfile /var/lib/chrony/drift
makestep 1.0 3
rtcsync
logdir /var/log/chrony
[root@host2 ~]# systemctl restart chronyd
 
 
 
posted @ 2020-10-20 20:10  梦里花落知多少sl  阅读(152)  评论(0)    收藏  举报