centos7.9安装zabbix5.0.14及配置过程

这篇文章主要介绍了centos7.9安装zabbix5.0.14的详细过程,本文给大家介绍了基础环境配置方法及安装zabbix相关组件的过程讲解,需要的朋友可以参考下

一、基础环境配置

1、关闭firewalld、关闭selinux

 ##关闭firewalld systemctl stop firewalld systemctl disabled firewalld ##关闭selinux setenforce 0 && sed -i.bak 's/^SELINUX=.*/SELINUX=disabled/g' /etc/selinux/config

2、配置yum仓库
配置zabbix仓库

 wget https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm yum install zabbix-release-5.0-1.el7.noarch.rpm ##在/etc/yum.repos.d/中查看zabbix仓库的配置情况 [root@localhost opt]# cat /etc/yum.repos.d/zabbix.repo [zabbix] name=Zabbix Official Repository - $basearch baseurl=http://repo.zabbix.com/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=http://repo.zabbix.com/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=http://repo.zabbix.com/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=http://repo.zabbix.com/non-supported/rhel/7/$basearch/ enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX gpgcheck=1

配置mysql仓库(zabbix监控后台需要用到mysql存储)

 ##使用清华大学的镜像仓库 [root@localhost opt]# cat /etc/yum.repos.d/mysql.repo [mysql] name=mysql baseurl=https://mirrors.tuna.tsinghua.edu.cn/mysql/yum/mysql-5.7-community-el7-x86_64/ gpgcheck=0 enabled=1

配置centos extras仓库(后续的安装需要用到此仓库的软件包)

 [root@localhost opt]# cat /etc/yum.repos.d/centos-extras.repo [centos-extras] name=centos-extras baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/7.9.2009/extras/x86_64/ enabled=1 gpgcheck=0

二、安装数据库

 yum install mysql-community-server

启动mysql服务

 systemctl start mysql systemctl enable mysql

在服务器初始启动时,会发生以下情况:

服务器初始化。

SSL 证书和密钥文件在数据目录中生成。

validate_password 已安装并启用。

‘root'@'localhost创建了 一个超级用户帐户。超级用户的密码已设置并存储在错误日志文件中。要显示它,请使用以下命令:

 [root@localhost opt]# grep 'temporary password' /var/log/mysqld.log 2021-08-16T08:00:40.185610Z 1 [Note] A temporary password is generated for root@localhost: r8EaYzX_Xper

通过使用生成的临时密码登录并为超级用户帐户设置自定义密码,尽快更改 root 密码:

 [root@localhost opt]# mysql -uroot -p Enter password: Welcome to the MySQL monitor.  Commands end with ; or \g. Your MySQL connection id is 702 Server version: 5.7.35 MySQL Community Server (GPL) Copyright (c) 2000, 2021, 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> ALTER USER 'root'@'localhost' IDENTIFIED BY 'xxxxxxx';

注意:
validate_password 默认安装。执行的默认密码策略validate_password要求密码至少包含1个大写字母、1个小写字母、1个数字和1个特殊字符,并且密码总长度至少为8个字符。

修改一下mysql的配置文件,提高其性能

 [root@centos7 ~]# vim /etc/my.cnf [mysqld]  //在[mysqld]下面添加下面两行 skip_name_resolve =ON innodb_file_per_table=ON

三、安装zabbix相关组件

1、安装zabbix-server
安装zabbix-server和zabbix-agent

 yum install zabbix-server-mysql zabbix-agent

安装zabbix-get命令行工具(用于后期在客户端部署angent是测试监控项使用)

 yum install zabbix-get

2、安装frontend
启用Red Hat Software Collections(方便安装依赖包)

 ##这个软件包在centos-extras仓库中,所以之前配置了centos-extras仓库 yum install centos-release-scl

编辑配置文件 /etc/yum.repos.d/zabbix.repo and enable zabbix-frontend repository.

 [zabbix-frontend] ... enabled=1 ...

安装Zabbix frontend packages

 yum install zabbix-web-mysql-scl zabbix-nginx-conf-scl

安装frontend时报错
以上就是centos7.9安装zabbix5.0.14及配置过程的详细内容,更多请关注0133技术站其它相关文章!

赞(0) 打赏
未经允许不得转载:0133技术站首页 » 服务器