zabbix--4.4 安装及可能问题--监控软件

目录

        • 一、Install from Packages
        • 1、Choose your platform
        • 2、Install and configure Zabbix server for your platform
            • a. Install Zabbix repository 打不开,配置阿里的库
            • b. Install Zabbix server and agent
            • c. Install Zabbix frontend
            • d. Create initial database
            • e. Configure the database for Zabbix server
            • f. Configure PHP for Zabbix frontend
            • g. Start Zabbix server and agent processes 启动、防火墙
            • h. Configure Zabbix frontend
            • `可能的错误`
        • 3、Start using Zabbix


官网:https://www.zabbix.com
下载:https://www.zabbix.com/download

一、Install from Packages

My platfrom:
zabbix--4.4 安装及可能问题--监控软件_第1张图片
LTS (Long Term Support):长期演进版

1、Choose your platform

2、Install and configure Zabbix server for your platform

a. Install Zabbix repository 打不开,配置阿里的库
rpm -Uvh 官网仓库地址/zabbix-release-4.4-1.el7.noarch.rpm
`解决`:https://mirror-status.centos.org/#cn 镜像状态列表,删除地址栏“/centos”。找到 zabbix 配个repo。
[aliyun]
name=aliyun
baseurl=https://mirrors.aliyun.com/zabbix/zabbix/4.4/rhel/7/x86_64/
enable=1
gpgcheck=0

阿里:https://mirrors.aliyun.com/zabbix/zabbix/4.4/rhel/7/x86_64/
清华:https://mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix/4.4/rhel/7/x86_64/ 
yum clean all # 清缓存
yum makecache # 元数据
b. Install Zabbix server and agent
yum install zabbix-server-mysql zabbix-agent -y

Note: nginx package is not available in official repository. It can be found in epel repository.

c. Install Zabbix frontend
yum install epel-release -y #要安装nginx,必须的
yum install zabbix-web-mysql zabbix-nginx-conf -y
d. Create initial database
`数据库要自己安装的`
systemctl start mysqld
systemctl restart mysqld
systemctl status mysqld
tail -f -n 10000 /var/log/mysqld.log
systemctl enable|disable mysqld
firewall-cmd --state
firewall-cmd --permanent --add-port=3306/tcp
firewall-cmd --reload
`配置如下`
grep password /var/log/mysqld.log
mysql -uroot -p
Enter password: root_password
mysql> ALTER USER 'root'@'localhost' identified by '1820?ALTER_user';
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'Zabbix4.4_password';
报错:ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'identified by '1820?ALTER_user'' at line 1
create user 'zabbix'@'localhost' identified by '1820?ALTER_user';
`答案:grant all privileges on zabbix.* to 'zabbix'@'localhost' with grant option;`
mysql> quit;
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
MySQL数据库密码:1820?ALTER_user
cp create.sql.gz create.sql.gz-backup
gunzip create.sql.gz
gzip create.sql
vi create.sql 
USE zabbix; 增加选择数据库命令。
e. Configure the database for Zabbix server
vi /etc/zabbix/zabbix_server.conf 第118行
DBPassword=Zabbix4.4_password
f. Configure PHP for Zabbix frontend
vi /etc/nginx/conf.d/zabbix.conf 去掉注释符号
# listen 80;
# server_name example.com;
vi /etc/php-fpm.d/zabbix.conf # uncomment and set timezone 时区
php_value[date.timezone] = Europe/Riga #Asia/Shanghai
g. Start Zabbix server and agent processes 启动、防火墙
firewall-cmd --list-all
firewall-cmd --permanent --add-port=80/tcp
firewall-cmd --reload
systemctl restart zabbix-server zabbix-agent nginx php-fpm
systemctl enable zabbix-server zabbix-agent nginx php-fpm
h. Configure Zabbix frontend

http://server_ip_or_name/setup.php 前台安装地址。

可能的错误

mysql启动报错:[ERROR] [FATAL] InnoDB: Table flags are 0 in the data dictionary but the flags in file ./ibdata1 are 0x4800!
MySQL回退低版本,启动数据格式问题。
rm -rf /var/lib/mysql
https://www.jianshu.com/p/7af95b08b954

启动zabbix-server 报错记录
journalctl -xe
报错 zabbix_server[3650]: /usr/sbin/zabbix_server: error while loading shared libraries: libmysqlclient.so.18
find / -name libmysqlclient.so* 缺少libmysqlclient.so.18文件
rpm -ivh mysql-community-libs-compat

more /var/log/zabbix/zabbix_server.log 有日志文件后
报错:cannot set resource limit: [13] Permission denied
解决:SELinux 不能Enforcing setenforce 0/getenforce
永久设置文件:/etc/selinux/config SELINUX=disabled

无报错但启动时:PID file /run/zabbix/zabbix_server.pid not readable (yet?) after start
/etc/zabbix/zabbix_server.conf 删除当前的pid文件+确保没有正在运行的zabbix_server进程

3、Start using Zabbix

zabbix--4.4 安装及可能问题--监控软件_第2张图片

你可能感兴趣的:(软件)