1. Basic environment configuration1. Turn off firewalld and selinux ##Shut down firewalld systemctl stop firewalld systemctl disabled firewalld ##Turn off selinux setenforce 0 && sed -i.bak 's/^SELINUX=.*/SELINUX=disabled/g' /etc/selinux/config 2. Configure the yum warehouse and the zabbix warehouse wget https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm yum install zabbix-release-5.0-1.el7.noarch.rpm ##View the configuration of the zabbix warehouse in /etc/yum.repos.d/[root@localhost opt]# cat /etc/yum.repos.d/zabbix.repo [zabbix] name=Zabbix Official Repository - $basearch baseurl=http://repo.zabbix.com/zabbix/5.0/rhel/7/$basearch/ enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591 [zabbix-frontend] name=Zabbix Official Repository frontend - $basearch baseurl=http://repo.zabbix.com/zabbix/5.0/rhel/7/$basearch/frontend enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591 [zabbix-debuginfo] name=Zabbix Official Repository debuginfo - $basearch baseurl=http://repo.zabbix.com/zabbix/5.0/rhel/7/$basearch/debuginfo/ enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591 gpgcheck=1 [zabbix-non-supported] name=Zabbix Official Repository non-supported - $basearch baseurl=http://repo.zabbix.com/non-supported/rhel/7/$basearch/ enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX gpgcheck=1 Configure mysql warehouse (mysql storage is required for zabbix monitoring background) ##Use Tsinghua University's mirror repository [root@localhost opt]# cat /etc/yum.repos.d/mysql.repo [mysql] name=mysql baseurl=https://mirrors.tuna.tsinghua.edu.cn/mysql/yum/mysql-5.7-community-el7-x86_64/ gpgcheck=0 enabled=1 Configure the centos extras repository (subsequent installations will require the software packages in this repository) [root@localhost opt]# cat /etc/yum.repos.d/centos-extras.repo [centos-extras] name=centos-extras baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/7.9.2009/extras/x86_64/ enabled=1 gpgcheck=0 2. Install the databaseyum install mysql-community-server Start mysql service systemctl start mysql systemctl enable mysql On initial server startup, the following occurs: Server initialization. SSL certificate and key files are generated in the data directory. validate_password is installed and enabled. 'root'@'localhost creates a superuser account. The superuser password is set and stored in the error log file. To display it, use the following command: [root@localhost opt]# grep 'temporary password' /var/log/mysqld.log 2021-08-16T08:00:40.185610Z 1 [Note] A temporary password is generated for root@localhost: r8EaYzX_Xper Change the root password as soon as possible by logging in with the generated temporary password and setting a custom password for the superuser account: [root@localhost opt]# mysql -uroot -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 702 Server version: 5.7.35 MySQL Community Server (GPL) Copyright (c) 2000, 2021, Oracle and/or its affiliates. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'xxxxxxx'; Notice: Modify the mysql configuration file to improve its performance [root@centos7 ~]# vim /etc/my.cnf [mysqld] //Add the following two lines under [mysqld] skip_name_resolve = ON innodb_file_per_table=ON 3. Install zabbix related components 1. Install zabbix-server yum install zabbix-server-mysql zabbix-agent Install the zabbix-get command line tool (for later deployment of angent on the client to test monitoring items) yum install zabbix-get 2. Install frontend ##This software package is in the centos-extras repository, so the centos-extras repository was configured before yum install centos-release-scl Edit the configuration file /etc/yum.repos.d/zabbix.repo and enable zabbix-frontend repository. [zabbix-frontend] ... enabled=1 ... Install Zabbix frontend packages yum install zabbix-web-mysql-scl zabbix-nginx-conf-scl Error when installing frontend 3. Create the initial database #mysql -uroot -pxxxxx mysql> create database zabbix character set utf8 collate utf8_bin; mysql> create user zabbix@localhost identified by 'xxxxxxx'; mysql> grant all privileges on zabbix.* to zabbix@localhost; mysql> quit; Import the initial schema and data, and you will be prompted for your newly created password. # zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix 4. Edit the configuration file /etc/zabbix/zabbix_server.conf to configure the database for Zabbix server DBPassword=xxxxxxx 5. Configure PHP for Zabbix frontend ##Uncomment these two lines listen 80; server_name example.com; ##At the same time, comment out the configuration that provides the default web service vim /etc/opt/rh/rh-nginx116/nginx/nginx.conf ... server { #listen 80 default_server; #listen [::]:80 default_server; server_name _; ... ##Then restart the service Edit the configuration file /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf, add the nginx user in the listen.acl_users directive (the system will automatically create it when installing rh-nginx116-nginx) listen.acl_users = apache,nginx ##Then configure the time zone php_value[date.timezone] = Asia/Shanghai 6. Start the zabbix server and agent processes, and set them to start automatically at boot. systemctl restart zabbix-server zabbix-agent rh-nginx116-nginx rh-php72-php-fpm systemctl enable zabbix-server zabbix-agent rh-nginx116-nginx rh-php72-php-fpm 4. Configure Zabbix frontendOpen the Zabbix frontend URL in your browser: For Apache: http://<server_ip_or_name>/zabbix Check the prerequisites to ensure that all software prerequisites are met. NOTE: If you need to change the Apache user or group, you must verify permissions on the session folder. Otherwise Zabbix installer may not be able to continue. Configure Database Connection Enter the details for connecting to your database. The Zabbix database must have been created Zabbix Server Details Enter the Zabbix server details. Entering the name of the Zabbix server is optional Review the settings summary. Installation Complete Log in This is the end of this article about centos7.9 installation of zabbix5.0.14 and configuration process. For more information about centos7.9 installation of zabbix, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Whitespace processing in HTML/CSS and how to preserve whitespace in the page
>>: Some common advanced SQL statements in MySQL
This article shares the installation and configur...
Table of contents What is a relational database? ...
Today I had a sneak peek at IE8 beta 1 (hereafter...
Table of contents What is VUE Core plugins in Vue...
This seems to be no longer possible with the new ...
At the beginning, I felt sad. The screenshots are...
Deleting a table is not very common, especially f...
The implementation method is divided into three s...
Overview The builder pattern is a relatively simp...
This article introduces the installation and use ...
Recently, I have been studying the MySQL database...
Since I installed the official version of IE8.0, ...
VirtualBox is a free and open source virtualizati...
1. Download the MySQL jdbc driver (mysql-connecto...
Common utf8mb4 sorting rules in MySQL are: utf8mb...