centos7二进制安装zabbix6.0+MySQL8.0
时间: 2023-10-07 17:06:47 浏览: 136
centos7安装zabbix
好的,您可以参考以下步骤进行 CentOS 7 上的 Zabbix 6.0 和 MySQL 8.0 的二进制安装:
1. 首先,安装必需的依赖软件包:
```
yum install -y gcc gcc-c++ make wget net-snmp net-snmp-devel net-snmp-utils libcurl-devel libxml2-devel libevent-devel pcre-devel libssh2-devel openssl-devel glibc-devel patch rpm-build
```
2. 下载 Zabbix 6.0 的二进制安装包:
```
wget https://repo.zabbix.com/zabbix/6.0/rhel/7/x86_64/zabbix-release-6.0-1.el7.noarch.rpm
```
安装下载的 RPM 包:
```
rpm -ivh zabbix-release-6.0-1.el7.noarch.rpm
```
3. 安装 Zabbix Server、Zabbix Agent 和 Zabbix Web:
```
yum install -y zabbix-server-mysql zabbix-agent zabbix-web-mysql
```
4. 下载 MySQL 8.0 的二进制安装包:
```
wget https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
```
安装下载的 RPM 包:
```
rpm -ivh mysql80-community-release-el7-3.noarch.rpm
```
5. 安装 MySQL 8.0:
```
yum install -y mysql-community-server
```
6. 创建 Zabbix 数据库和用户:
```
mysql -uroot -p
```
登录 MySQL 数据库后,执行以下命令创建数据库、用户和授权:
```
CREATE DATABASE zabbix character set utf8 collate utf8_bin;
CREATE USER 'zabbix'@'localhost' IDENTIFIED WITH mysql_native_password BY 'zabbix';
GRANT ALL PRIVILEGES ON zabbix.* TO 'zabbix'@'localhost' WITH GRANT OPTION;
exit;
```
7. 导入 Zabbix Server 数据库结构:
```
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
```
8. 配置 Zabbix Server 和 Agent:
修改 Zabbix Server 的配置文件 `/etc/zabbix/zabbix_server.conf`,设置数据库用户名和密码:
```
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
```
修改 Zabbix Agent 配置文件 `/etc/zabbix/zabbix_agentd.conf`,设置监听 IP 和 Server IP:
```
Server=127.0.0.1
ListenIP=0.0.0.0
```
9. 启动服务:
```
systemctl start zabbix-server zabbix-agent mysql
```
10. 设置开机自启动:
```
systemctl enable zabbix-server zabbix-agent mysql
```
至此,完成了在 CentOS 7 上安装 Zabbix 6.0 和 MySQL 8.0 的二进制安装。感谢您的提问!
阅读全文