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


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

一、Install from Packages

My platfrom:
在这里插入图片描述
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

配置

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值