保姆级别编译安装zabbix!!!

本文详细介绍了在CentOS系统上编译安装Zabbix的全过程,包括配置数据库、编辑Zabbix server配置文件、启动服务、解决报错、配置Web页面、解决中文乱码问题等步骤,旨在提供一个全面的Zabbix安装教程。
摘要由CSDN通过智能技术生成

一、编译安装zabbix

  • 10.0.2.18 MySQL
  • 10.0.2.8 zabbix

1、配置数据库:

[root@mysql ~]#yum install mariadb-server -y
[root@mysql ~]#vim /etc/my.cnf.d/mariadb-server.cnf 
bind-address=10.0.2.18
[root@mysql ~]#systemctl restart mariadb
[root@mysql ~]#mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 8
Server version: 10.3.17-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> create database zabbix character set  utf8 collate utf8_bin;
Query OK, 1 row affected (0.001 sec)

MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@'10.0.2.%' identified by 'xiurong';
Query OK, 0 rows affected (0.001 sec)

2、配置zabbix

[root@zabbix ~]#groupadd -g 1001 zabbix
[root@zabbix ~]#useradd -u 1001 -g 1001 zabbix
[root@zabbix ~]#id zabbix
uid=1001(zabbix) gid=1001(zabbix) groups=1001(zabbix)

[root@zabbix ~]#yum install make gcc libxml2-devel net-snmp net-snmp-devel curl curl-devel php php-bcmath php-mbstring mariadb mariadb-devel -y
[root@zabbix ~]#wget https://sourceforge.net/projects/zabbix/files/ZABBIX%20Latest%20Stable/4.4.7/zabbix-4.4.7.tar.gz
[root@zabbix ~]#mv zabbix-4.4.7.tar.gz /usr/local/src/
[root@zabbix ~]#cd /usr/local/src/
[root@zabbix src]#tar xvf zabbix-4.4.7.tar.gz 
[root@zabbix src]#cd zabbix-4.4.7
[root@zabbix zabbix-4.4.7]#yum install libevent-devel pcre-devel -y
[root@zabbix zabbix-4.4.7]#./configure --prefix=/apps/zabbix_server --enable-server --enable-agent --with-mysql --with-net-snmp --with-libcurl --with-libxml2
[root@zabbix zabbix-4.4.7]#make install
[root@zabbix zabbix-4.4.7]#cd database/mysql/
[root@zabbix mysql]#pwd
/usr/local/src/zabbix-4.4.7/database/mysql
[root@zabbix mysql]#mysql -uzabbix -pxiurong -h10.0.2.18 zabbix
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 9
Server version: 10.3.17-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [zabbix]> use zabbix 
Database changed
MariaDB [zabbix]> show tables;
Empty set (0.001 sec)

MariaDB [zabbix]> exit
Bye
[root@zabbix mysql]#mysql -uzabbix -pxiurong -h10.0.2.18 zabbix < schema.sql 
[root@zabbix mysql]#mysql -uzabbix -pxiurong -h10.0.2.18 zabbix < images.sql 
[root@zabbix mysql]#mysql -uzabbix -pxiurong -h10.0.2.18 zabbix < data.sql 
[root@zabbix mysql]#mysql -uzabbix -pxiurong -h10.0.2.18 zabbix
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 14
Server version: 10.3.17-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [zabbix]> use zabbix 
Database changed
MariaDB [zabbix]> show tables;
+----------------------------+
| Tables_in_zabbix           |
+----------------------------+
| acknowledges               |
| actions                    |
| alerts                     |
| application_discovery      |
| application_prototype      |
| application_template       |
| applications               |
| auditlog                   |
| auditlog_details           |
| autoreg_host               |
| conditions                 |
| config   
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值