The most detailed Centos 9 Stream installation and deployment of the latest Zabbix 6.4 on the entire network

Select the version to install as shown in the picture

1. Information summary

1. Server system Centos 9 stream

Mirror download address: CentOS Stream

2. Zabbix official website guide

Download Zabbix

3. Server user information integration

①Server user

root  123456

Admin  123456

②MySQL user

root  12456

zabbix  password

③Zabbix6.4 users

zabbix  password

The front-end WEB logs in to Admin zabbix by default

4. Network configuration

Change the network to a static IP in the configuration file or graphical interface according to your own needs, and then restart the network.

Centos stream 9 uses a new network setting method and a new NetworkManager, so it is different from centos7 and 8.

①Enter the network card configuration file and modify the following location

vim /etc/NetworkManager/system-connections/enp2s0.nmconnection
[ipv4]
address1=172.20.20.200/24,172.20.20.254  #分别表示IP、子网掩码、网关
dns=114.114.114.114;
method=manual  #method是类型,默认的是auto 

 ② Restart the network

#nmcli connection reload
#nmcli connection down ens2s0
#nmcli connection up ens2s0

③ View network information, and test network and DNS

Check whether the IP information has been changed

ifconfig

 test connectivity

ping www.baidu.com

Two, close the firewall, SELINUX

1. Turn off the firewall

①Close only this time

systemctl stop firewalld

②Permanently closed

systemctl disable firewalld

③ Check the firewalld service status, if active is dead, it means it has been permanently closed

systemctl status firewalld

2. Close SElinux

①Temporarily closed

setenforce 0

②Permanently closed

vim /etc/selinux/config 

Change the line SELINUX=enforcing in the file to SELINUX=disabled or SELINUX=permissive, then save and exit, restart centos 9 to take effect

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled  #改这里
# SELINUXTYPE= can take one of three values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected. 
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

③ Check whether the status is closed

getenforce

3. Install MYSQL8

#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 --nogpgchec

Fourth, initialize MYSQL

1. Modify my.cnf

vim /etc/my.cnf
default-authentication-plugin=mysql_native_password 

Remove the comment from this line, if not, add it directly, as shown below

 2. Restart mysql and set it to start automatically

#systemctl restart mysqld  #重启
#service mysqld status  #查看状态
#service enable mysqld  #设置开机自启

Five, MYSQL password configuration

1. Modify the root password, and find the login password when logging in for the first time

① Find the default password

grep ‘temporary password’ /var/log/mysqld.log 

The searched password is, for example: b6aeg+rg8e!Y

②Change password

#mysql -u root -p  #输入查找到的默认密码登录
#alter user root@"localhost" identified with mysql_native_password by "root_21ROOT"; #先创建复杂密码 
#SHOW VARIABLES LIKE ‘validate_password%’; #查看、修改密码策略
#set global validate_password.policy=0;
#set global validate_password.mixed_case_count=0;
#set global validate_password.number_count=0;
#set global validate_password.special_char_count=0;
#set global validate_password.length=0;
#SHOW VARIABLES LIKE ‘validate_password%’;
#alter user root@"localhost" identified with mysql_native_password by "123456";  #修改密码

Six, install Zabbix6.4

1. Install the zabbix repository

#rpm -Uvh https://repo.zabbix.com/zabbix/6.4/rhel/9/x86_64/zabbix-release-6.4-1.el9.noarch.rpm
#dnf clean all

2. Install Zabbix server, Web front end, agent2

dnf install zabbix-server-mysql zabbix-web-mysql zabbix-apache-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent2

Seven, create the initial database

1. Make sure the database server is started and running, execute the following command

#mysql -uroot -p
#123456
#mysql> create database zabbix character set utf8mb4 collate utf8mb4_bin;
#mysql> create user zabbix@localhost identified with mysql_native_password by "password";
#mysql> grant all privileges on zabbix.* to zabbix@localhost;
#mysql> set global log_bin_trust_function_creators = 1;
#mysql> use mysql;  #删除空用户名。更新权限
#mysql> delete from user where user=' ';
#mysql> flush privileges;
#mysql> quit;

2. Import the initial schema and data, you will be prompted to enter the newly created password

 zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix

#password

3. Disable the log_bin_trust_function_creators option after importing the database schema

#mysql -uroot -p
#输入密码 123456
#mysql> set global log_bin_trust_function_creators = 0;
#mysql> quit;

Eight, configure the database for Zabbix server

1. Edit the configuration file /etc/zabbix/zabbix_server.conf

DBPassword=password #130行

2. Start the Zabbix server and agent processes, and set them to boot automatically

#systemctl restart zabbix-server zabbix-agent2 httpd php-fpm
#systemctl enable zabbix-server zabbix-agent2 httpd php-fpm

9. Log in to Zabbix WEB front-end configuration

1. Enter 172.20.20.200/zabbix in the browser, select Chinese as the language, and the next step

2. Next step

3. Enter the password as: password, the next step

 

4. Enter the host name, the next step

5. Next step

6. Complete

7. Front-end WEB default account: Admin, password: zabbix

 8. Complete

Guess you like

Origin blog.csdn.net/weixin_49001495/article/details/130123875