可以参照官方说明文档:https://www.zabbix.com/download?zabbix=5.0&os_distribution=ubuntu&os_version=18.04_bionic&db=mysql&ws=apache
一、环境框架
为了实验简单,采用All in one装在同一台机上。
Zabbix相关二进制包说明:
1)安装在Zabbix Server 服务器上
zabbix-server-mysql #Zabbix Server 服务器包
zabbix-agent #Zabbix 客户端包
zabbix-get #Zabbix 服务检测包
2)Web Server php-fpm 前端服务器上
zabbix-frontend-php #Zabbix 前端web服务包,本质上为LAP
zabbix-apache-conf #Zabbix 前端web服务配置包,本质为LAP
3)数据库(需要单独安装)
mysql-server
二、安装步骤
官网下载二进制包:
root@ubuntu1804:~# wget https://repo.zabbix.com/zabbix/5.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_5.0-1+bionic_all.deb
root@ubuntu1804:~# dpkg -i zabbix-release_5.0-1+bionic_all.deb
查询安装源地址配置文件:
root@ubuntu1804:~# dpkg -L zabbix-release
/.
/etc
/etc/apt
/etc/apt/sources.list.d
/etc/apt/sources.list.d/zabbix.list #配置文件
/etc/apt/trusted.gpg.d
/etc/apt/trusted.gpg.d/zabbix-official-repo.gpg
/usr
/usr/share
/usr/share/doc
/usr/share/doc/zabbix-release
/usr/share/doc/zabbix-release/README.Debian
/usr/share/doc/zabbix-release/changelog.Debian
/usr/share/doc/zabbix-release/copyright
root@ubuntu1804:~# cat /etc/apt/sources.list.d/zabbix.list
deb http://repo.zabbix.com/zabbix/5.0/ubuntu bionic main
deb-src http://repo.zabbix.com/zabbix/5.0/ubuntu bionic main
默认的官方源地址是国外的,为了安装速度可以替换成国内源。
root@ubuntu1804:~# sed -i.bak 's#http://repo.zabbix.com#https://mirrors.aliyun.com/zabbix#' /etc/apt/sources.list.d/zabbix.list
root@ubuntu1804:~# cat /etc/apt/sources.list.d/zabbix.list
deb https://mirrors.aliyun.com/zabbix/zabbix/5.0/ubuntu bionic main
deb-src https://mirrors.aliyun.com/zabbix/zabbix/5.0/ubuntu bionic main
更新
[root@zabbix-server ~]#apt update
安装包:
root@ubuntu1804:~# apt install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-agent zabbix-get
安装Mysql:
root@ubuntu1804:~# apt install mysql-server -y
#如果Mysql和Zabbix Server在同一台主机,以下项目可以不改直接跳过
root@ubuntu1804:~# vim /etc/mysql/mysql.conf.d/mysqld.cnf
bind-address = 127.0.0.1 #改成绑定地址
重启mysql服务:
root@ubuntu1804:~# systemctl restart mysql.service
检查是否开机启动,乌班图默认是开机启动的:
root@ubuntu1804:~# systemctl is-enabled mysql.service
enabled
#准备数据库和用户
root@ubuntu1804:~# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 146
Server version: 5.7.35-0ubuntu0.18.04.1 (Ubuntu)
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 he