yum安装zabbix

1、重要!关闭selinux和firewalld

查看SELinux当前状态:

getenforce

关闭SELinux的方法

临时关闭,重启机器后恢复原状态:

setenforce 0                  #设置SELinux 成为permissive模式

setenforce 1                #设置SELinux 成为enforcing模式)

修改/etc/selinux/config文件中的SELINUX="" 为 disabled ,然后重启。

systemctl status firewalld.service  

systemctl stop firewalld

永久关闭防火墙

systemctl disable firewalld

2、安装repo源

rpm -ivh https://mirror.tuna.tsinghua.edu.cn/zabbix/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-2.el7.noarch.rpm

修改zabbix.repo

yum安装zabbix

3、安装server 、web和mariadb

yum install zabbix-server-mysql zabbix-web-mysql -y

 yum -y install mariadb-sever

 

4、配置mariadb

shell> mysql -uroot -p<password>

mysql> create database zabbix character set utf8 collate utf8_bin;

mysql> create user ‘zabbix‘@‘localhost‘ identified by ‘<password>‘;

mysql> grant all privileges on zabbix.* to ‘zabbix‘@‘localhost‘;

mysql> quit;

导入数据表

 cd /usr/share/doc/zabbix-server-mysql-4.0.22

gzip -d create.sql.gz

mysql -uzabbix -p123456 zabbix <create.sql

 

5、修改server配置文件

[[email protected] zabbix]# grep -Ev '^$|#' /etc/zabbix/zabbix_server.conf

DBHost=localhost

DBName=zabbix

DBUser=zabbix

DBPassword=123456

 

6、修改httpd配置文件

yum安装zabbix

 

yum安装zabbix

 

 

7、yum的命令

yum 会把下载的软件包和header存储在cache中,而不自动删除。如果觉得占用磁盘空间,可以使用yum clean指令进行清除,更精确 的用法是yum clean headers清除header,yum clean packages清除下载的rpm包,yum clean all一全部清除。

就是把服务器的包信息下载到本地电脑缓存起来,makecache建立一个缓存
以后用install时就在缓存中搜索,提高了速度。
配合yum -C search xxx使用
不用上网检索就能查找软件信息