zabbix监控keepalived高可用脑裂

本文档详细介绍了如何通过Zabbix监控Keepalived实现高可用性,防止出现脑裂情况。首先搭建了LAMP架构,然后配置Zabbix和Keepalived,最后在Zabbix中设置监控项和触发器,确保对Keepalived状态的实时监控。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1. 搭建lamb架构(用脚本安装,过程略)

2. 配置zabbix

[root@zml ~]# yum -y install net-snmp-devel libevent-devel
[root@zml ~]# cd /usr/src/
[root@zml src]# tar -xf zabbix-4.0.3.tar.gz 
[root@zml src]# groupadd -r zabbix
[root@zml src]# useradd -r -M -s /sbin/nologin -g zabbix zabbix
[root@zml src]# mysql -uroot -pzml123!
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.23 MySQL Community Server (GPL)

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

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> create database zabbix character set utf8 collate utf8_bin;
Query OK, 1 row affected (0.24 sec)

mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix123!';
Query OK, 0 rows affected, 2 warnings (0.21 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.25 sec)

mysql> exit
Bye
[root@zml src]# cd zabbix-4.0.4/database/mysql/
[root@zml mysql]# ls
data.sql  images.sql  Makefile.am  Makefile.in  schema.sql
[root@zml mysql]# mysql -uzabbix -pzabbix123! zabbix < schema.sql
mysql: [Warning] Using a password on the command line interface can be insecure.
[root@zml mysql]#  mysql -uzabbix -pzabbix123! zabbix < images.sql
mysql: [Warning] Using a password on the command line interface can be insecure.
[root@zml mysql]# mysql -uzabbix -pzabbix123! zabbix < data.sql
mysql: [Warning] Using a password on the command line interface can be insecure.
[root@zml mysql]# cd ../..
[root@zml zabbix-4.0.3]# ./configure --enable-server \
> --enable-agent \
> --with-mysql \
> --with-net-snmp \
> --with-libcurl \
> --with-libxml2
[root@zml zabbix-4.0.3]# make install
[root@zml zabbix-4.0.3]# ls /usr/local/etc/
zabbix_agentd.conf  zabbix_agentd.conf.d  zabbix_server.conf  zabbix_server.conf.d
[root@zml zabbix-4.0.3]# vim /usr/local/etc/zabbix_server.conf
#
# Mandatory: no
# Default:
 DBPassword=zabbix123!

### Option: DBSocket
[root@zml zabbix-4.0.3]# zabbix_server 
[root@zml zabbix-4.0.3]# zabbix_agentd 
[root@zml zabbix-4.0.3]# ss -antl
State       Recv-Q Send-Q        Local Address:Port                       Peer Address:Port              
LISTEN      0      128                       *:22                                    *:*                  
LISTEN      0      100               127.0.0.1:25                                    *:*                  
LISTEN      0      128                       *:10050                                 *:*                  
LISTEN      0      128                       *:10051                                 *:*                  
LISTEN      0      128               127.0.0.1:9000                                  *:*                  
LISTEN      0      128                      :::80                                   :::*              
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值