Centos8安装zabbix6

1、修改Centos8 yum源

# cd /etc/yum.repos.d/

# sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*

# sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*

2、关闭防火墙和SELinux

# systemctl stop firewalld.service

# systemctl disable firewalld.service

# setenforce 0

# sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config

3、安装数据库 这里用的mysql

# yum remove -y mysql  //移除之前的库

# find / -name mysql

# rm -rf              //  找到之前的残留删除

# wget https://dev.mysql.com/get/mysql80-community-release-el8-1.noarch.rpm

# yum install mysql80-community-release-el8-1.noarch.rpm

# yum module disable mysql

# yum install mysql-community-server --nogpgcheck


///修改一下mysql密码策略
###
下一步之前先去修改etc下面的my.cnf文件
default-authentication-plugin=mysql_native_password 
把这一行的注释去掉,没有的直接加上
###

# /bin/systemctl start mysqld.service  //启动mysql

# service mysqld status

# grep 'temporary password' /var/log/mysqld.log  //查找默认密码

# mysql -u root -p   //进入数据库 输入密码


///修改密码格式

# ALTER USER 'root'@'localhost' IDENTIFIED BY 'root_21ROOT';

# SHOW VARIABLES LIKE 'validate_password%';

# set global validate_password.length=1;

# set global validate_password.policy=0;

# ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';

# create user 'root'@'%' identified by '123456';

# grant all privileges on *.* to 'root'@'%' with grant option;

4、安装zabbix

# rpm -Uvh https://repo.zabbix.com/zabbix/6.0/rhel/8/x86_64/zabbix-release-6.0-2.el8.noarch.rpm

# dnf clean all 

/// 下载乱七八糟的东西
# dnf install zabbix-server-mysql zabbix-web-mysql zabbix-apache-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent2


///创建zabbix库
# mysql -uroot -p

mysql> create database zabbix character set utf8mb4 collate utf8mb4_bin;

mysql> create user zabbix@localhost identified by 'password';

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

mysql> quit; 

///写表
# zcat /usr/share/doc/zabbix-sql-scripts/mysql/server.sql.gz | mysql -uzabbix -p zabbix 

###
去/etc/zabbix/下修改zabbix_server.conf文件
DBPassword=password
去掉前面的注释符或者另起一行  注:此处password代表你创建zabbix库时的密码 不是就填password
###

# systemctl restart zabbix-server zabbix-agent2 httpd php-fpm  ///启动乱七八糟

# systemctl enable zabbix-server zabbix-agent2 httpd php-fpm   ///设置开机自启动

5、安装成功进入web界面 账号Admin 密码zabbix

Centos8安装zabbix6_第1张图片

Centos8安装zabbix6_第2张图片

 参考链接:zabbix官网

Centos8:网盘地址

你可能感兴趣的:(运维之路,linux,centos,运维,服务器,数据库)