网站首页 > 教程文章 正文
1.集群规划
进程 | 虚拟机节点1 | 虚拟机节点2 | 虚拟机节点3 |
zabbix-agent | √ | √ | √ |
zabbix-server | √ | ||
PostgreSQL | √ | ||
zabbix-web | √ |
2.准备工作
默认在虚拟机节点2安装kafka、在虚拟机节点3安装redis
2.1关闭3台节点防火墙
sudo systemctl stop firewalld.service
sudo systemctl disable firewalld.service
2.2关闭3台节点上的SELinux
1)修改配置文件/etc/selinux/config
vim /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
2)重启虚拟机
reboot
2.3配置3台节点的Zabbix yum源
2.3.1安装yum仓库
1)安装 zabbix 的软件仓库配置包
分别在三个节点下运行一下这个命令
rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-latest.el7.noarch.rpm
2)安装Software Collections仓库
分别在三个节点下运行一下这个命令
yum install -y centos-release-scl
2.3.2修改zabbix仓库配置文件
1)查看原始zabbix.repo文件
cat /etc/yum.repos.d/zabbix.repo
##查看内容如下所示
[zabbix]
name=Zabbix Official Repository - $basearch
baseurl=https://repo.zabbix.com/zabbix/zabbix/5.0/rhel/7/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
[zabbix-frontend]
name=Zabbix Official Repository frontend - $basearch
baseurl=https://repo.zabbix.com/zabbix/zabbix/5.0/rhel/7/$basearch/frontend
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
[zabbix-debuginfo]
name=Zabbix Official Repository debuginfo - $basearch
baseurl=https://repo.zabbix.com/zabbix/zabbix/5.0/rhel/7/$basearch/debuginfo/
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
gpgcheck=1
[zabbix-non-supported]
name=Zabbix Official Repository non-supported - $basearch
baseurl=https://repo.zabbix.com/zabbix/non-supported/rhel/7/$basearch/
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
gpgcheck=1
2)执行以下命令完成全局替换,修改为阿里云的镜像
sed -i 's/http:\/\/repo.zabbix.com/https:\/\/mirrors.aliyun.com\/zabbix/g' /etc/yum.repos.d/zabbix.repo
3)查看修改之后的zabbix.repo文件
cat /etc/yum.repos.d/zabbix.repo
##内容如下
[zabbix]
name=Zabbix Official Repository - $basearch
baseurl=https://mirrors.aliyun.com/zabbix/zabbix/5.0/rhel/7/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
[zabbix-frontend]
name=Zabbix Official Repository frontend - $basearch
baseurl=https://mirrors.aliyun.com/zabbix/zabbix/5.0/rhel/7/$basearch/frontend
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
[zabbix-debuginfo]
name=Zabbix Official Repository debuginfo - $basearch
baseurl=https://mirrors.aliyun.com/zabbix/zabbix/5.0/rhel/7/$basearch/debuginfo/
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
gpgcheck=1
[zabbix-non-supported]
name=Zabbix Official Repository non-supported - $basearch
baseurl=https://mirrors.aliyun.com/zabbix/non-supported/rhel/7/$basearch/
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
gpgcheck=1
4)打开/etc/yum.repos.d/zabbix.repo文件,启用zabbix-web仓库
[zabbix]
name=Zabbix Official Repository - $basearch
baseurl=https://mirrors.aliyun.com/zabbix/zabbix/5.0/rhel/7/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
[zabbix-frontend]
name=Zabbix Official Repository frontend - $basearch
baseurl=https://mirrors.aliyun.com/zabbix/zabbix/5.0/rhel/7/$basearch/frontend
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
[zabbix-debuginfo]
name=Zabbix Official Repository debuginfo - $basearch
baseurl=https://mirrors.aliyun.com/zabbix/zabbix/5.0/rhel/7/$basearch/debuginfo/
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
gpgcheck=1
[zabbix-non-supported]
name=Zabbix Official Repository non-supported - $basearch
baseurl=https://mirrors.aliyun.com/zabbix/non-supported/rhel/7/$basearch/
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
gpgcheck=1
2.4安装zabbix
在节点1、节点2、节点3分别执行以下安装命令
##节点1
yum install zabbix-server-pgsql zabbix-agent
yum install zabbix-web-pgsql-scl zabbix-apache-conf-scl
##节点2
yum install zabbix-agent
##节点3
yum install zabbix-agent
2.5配置zabbix
2.5.1创建zabbix数据库
##在数据库主机上运行以下代码
sudo -u postgres createuser --pwprompt zabbix
sudo -u postgres createdb -O zabbix zabbix
2.5.2导入建表语句
zcat /usr/share/doc/zabbix-server-pgsql-5.0.44/create.sql.gz | sudo -u zabbix psql zabbix
2.5.3配置zabbix-server(节点1)
vim /etc/zabbix/zabbix_server.conf
DBHost=节点1ip地址
DBName=zabbix
DBUser=root
DBPassword=123456
2.5.4配置zabbix_agent(三台节点)
##节点1
vim /etc/zabbix/zabbix_agent.conf
##修改内容如下
Server=节点1ip地址
##节点2
vim /etc/zabbix/zabbix_agent.conf
##修改内容如下
Server=节点1ip地址
##节点3
vim /etc/zabbix/zabbix_agent.conf
##修改内容如下
Server=节点1ip地址
2.5.5配置Zabbix_Web时区
vim /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf
##修改内容如下
listen = /var/opt/rh/rh-php72/run/php-fpm/zabbix.sock
listen.acl_users = apache
listen.allowed_clients = 127.0.0.1
pm = dynamic
pm.max_children = 50
pm.start_servers = 5
pm.min_spare_servers = 5
pm.max_spare_servers = 35
pm.max_requests = 200
php_value[session.save_handler] = files
php_value[session.save_path] = /var/opt/rh/rh-php72/lib/php/session/
php_value[max_execution_time] = 300
php_value[memory_limit] = 128M
php_value[post_max_size] = 16M
php_value[upload_max_filesize] = 2M
php_value[max_input_time] = 300
php_value[max_input_vars] = 10000
php_value[date.timezone] = Asia/Shanghai
2.6启动zabbix
2.6.1启动zabbix
##节点1
systemctl start zabbix-server zabbix-agent httpd rh-php72-php-fpm
systemctl enable zabbix-server zabbix-agent httpd rh-php72-php-fpm
##节点2
systemctl start zabbix-agent
systemctl enable zabbix-agent
##节点3
systemctl start zabbix-agent
systemctl enable zabbix-agent
2.6.2停止zabbix
##节点1
systemctl stop zabbix-server zabbix-agent httpd rh-php72-php-fpm
systemctl disable zabbix-server zabbix-agent httpd rh-php72-php-fpm
##节点2
systemctl stop zabbix-agent
systemctl disable zabbix-agent
##节点3
systemctl stop zabbix-agent
systemctl disable zabbix-agent
2.6.3连接Zabbix_Web数据库
1)浏览器访问http://节点1ip地址/zabbix/
2)检查配置
3)配置数据库
4)配置 zabbix-server
2.6.4登录zabbix
1)用户名:Admin 密码:zabbix
2)点击User Setting,语言设置为中文
- 上一篇: 学习笔记-更换国内镜像源 - CentOS
- 下一篇: VMware更新阿里云镜像源CentOS7镜像
猜你喜欢
- 2024-12-01 Zabbix Agent安装部署
- 2024-12-01 php composer国内镜像
- 2024-12-01 给R语言RStudio添加阿里云镜像源
- 2024-12-01 LINUX 国内源以及镜像源更换方法
- 2024-12-01 tekton的最新版本安装教程和发布镜像的示例
- 2024-12-01 【Python大语言模型系列】云服务器部署dify大模型应用开发平台
- 2024-12-01 docker配置阿里镜像加速器
- 2024-12-01 Docker配置-阿里云镜像仓库
- 2024-12-01 K8s集群
- 2024-12-01 利用阿里云镜像加速器对Docker镜像源进行加速
- 06-18CentOS7安装Mongodb 4.x.x(centos7安装openstack)
- 06-18Window环境配置Mongodb(mongodb默认配置文件路径)
- 06-18FineReport如何连接和使用MongoDB数据库
- 06-18nosql之mongodb(nosql怎么读正确发音)
- 06-18Mongodb centos7安装(mongodb4.4.2安装教程)
- 06-18群晖(Synology)NAS 安装 MongoDB(群晖安装nat123)
- 06-18MongoDB 安装及实践(mongodb的安装过程和操作命令)
- 06-18MongoDB最全详解(万字图文总结)(mongodb lsm)
- 最近发表
-
- CentOS7安装Mongodb 4.x.x(centos7安装openstack)
- Window环境配置Mongodb(mongodb默认配置文件路径)
- FineReport如何连接和使用MongoDB数据库
- nosql之mongodb(nosql怎么读正确发音)
- Mongodb centos7安装(mongodb4.4.2安装教程)
- 群晖(Synology)NAS 安装 MongoDB(群晖安装nat123)
- MongoDB 安装及实践(mongodb的安装过程和操作命令)
- MongoDB最全详解(万字图文总结)(mongodb lsm)
- CentOS安装MongoDB教程(centos安装mpich)
- MongoDB入门指南:下载、安装和配置一款强大的NoSQL数据库
- 标签列表
-
- location.href (44)
- document.ready (36)
- git checkout -b (34)
- 跃点数 (35)
- 阿里云镜像地址 (33)
- qt qmessagebox (36)
- mybatis plus page (35)
- vue @scroll (38)
- 堆栈区别 (33)
- 什么是容器 (33)
- sha1 md5 (33)
- navicat导出数据 (34)
- 阿里云acp考试 (33)
- 阿里云 nacos (34)
- redhat官网下载镜像 (36)
- srs服务器 (33)
- pico开发者 (33)
- https的端口号 (34)
- vscode更改主题 (35)
- 阿里云资源池 (34)
- os.path.join (33)
- redis aof rdb 区别 (33)
- 302跳转 (33)
- http method (35)
- js array splice (33)