RedHat6.9 installation zabbix-3.4.7,db with Percona MySQL 5.7.20

Source: Internet
Author: User
Tags ibm db2 ldap percona

Software version:
Redhat6.9
zabbix-3.4.7
Percona mysql-5.7.20

Preparatory work:
Shut down the firewall, or add the appropriate port.
Turn off SELinux

———— (Install the following Zabbix dependency package) ————
# # # #这里的包是我网上找的, please reply if necessary. #####
RPM-IVH *.rpm
fping-3.5-3.el6.x86_64.rpm
iksemel-1.4-2_2.el6.x86_64.rpm
iksemel-devel-1.4-2_2.el6.x86_64.rpm
libevent-devel-1.4.13-4.el6.x86_64.rpm
libevent-doc-1.4.13-4.el6.noarch.rpm
libevent-headers-1.4.13-4.el6.noarch.rpm
libiconv-1.14-3.el6.x86_64.rpm
libiconv-devel-1.14-3.el6.x86_64.rpm
libiksemel3-1.4-2_2.el6.x86_64.rpm
libssh2-devel-1.4.2-2.el6_7.1.x86_64.rpm
openipmi-devel-2.0.16-14.el6.x86_64.rpm
php54w-5.4.45-2.w6.x86_64.rpm
php54w-bcmath-5.4.45-2.w6.x86_64.rpm
php54w-cli-5.4.45-2.w6.x86_64.rpm
php54w-common-5.4.45-2.w6.x86_64.rpm
php54w-gd-5.4.45-2.w6.x86_64.rpm
php54w-ldap-5.4.45-2.w6.x86_64.rpm
php54w-mbstring-5.4.45-2.w6.x86_64.rpm
php54w-mysql-5.4.45-2.w6.x86_64.rpm
php54w-pdo-5.4.45-2.w6.x86_64.rpm
php54w-xml-5.4.45-2.w6.x86_64.rpm
unixodbc-devel-2.2.14-14.el6.x86_64.rpm
————————————————

Rpm-qa | grep MySQL

Uninstalling the system comes with MySQL
RPM-E MySQL mysql-server mysql-devel

Unzip the RPM installation package downloaded from the Percona website:
Tar zxvf Percona-server-5.7.20-19-r119-el6-x86_64-bundle.tar

CD Percona-server-5.7.20-19-r119-el6-x86_64-bundle

Install the following four packages:
RPM-IVH percona-server-server-57-5.7.20-19.1.el6.x86_64.rpm percona-server-client-57-5.7.20-19.1.el6.x86_64.rpm percona-server-devel-57-5.7.20-19.1.el6.x86_64.rpm percona-server-shared-57-5.7.20-19.1.el6.x86_64.rpm

To create a Zabbix user:
Useradd-u Zabbix

Chgrp zabbix/usr/sbin/fping

chmod 4710/usr/sbin/fping

Unzip the zabbix-3.4.7 source installation package downloaded from the official website:
Tar zxvf zabbix-3.4.7.tar.gz

Compile the installation (compile parameters can be changed according to your needs):
./configure--prefix=/usr/local--enable-server--enable-agent--enable-java--with-mysql--WITH-LIBXML2-- With-unixodbc--with-net-snmp--with-ssh2--with-openipmi--with-libevent--with-libpcre--with-ldap--with-openssl-- With-libcurl--with-iconv--sysconfdir=/etc/zabbix

Make && make install

To modify the database engine:
Vim/etc/my.cnf
Add ———————————— at the end of the ————————————
[Mysqld]
Default-storage-engine=innodb
————————————————————————————

Chkconfig MySQL on

Service MySQL Start

Since the mysql5.7 version of the initial password mechanism has changed, the first time can not be logged in with an anonymous user, but the password is saved in the MySQL log file/var/log/mysqld.log. The following field kk&q)j88uKwU is the default root password, which can be searched based on the keywords provided below.
Vim/var/log/mysqld.log
A temporary password is generated for [email protected]:kk&q)j88uKwU

Enter the default password in the log, login to MySQL
Mysql-u root-p

To modify the root password: (Note that the password needs to meet complexity requirements after the mysql5.7 version; must contain numbers, uppercase letters, lowercase letters, special characters of which three items are available)
———— The following code is an SQL statement, please log in to MySQL and execute it in MySQL ————
Set password for [email protected]=password (' 12345.Com ');

Flush privileges;

Create a Zabbix database
Create database Zabbix character set UTF8 collate utf8_bin;

Grant the Zabbix database a password of 12345. Com:
Grant all privileges on Zabbix. to [e-mail protected] identified by ' 12345.Com ';

Flush Prvileges;
————————————————————

Import Zabbix data to the Zabbix database:
cd/zabbix-3.4.7/database/mysql/

Mysql-uzabbix-p Zabbix <schema.sql

Mysql-uzabbix-p Zabbix <images.sql

Mysql-uzabbix-p Zabbix <data.sql

Modifying the Zabbix_server configuration file
Vim/etc/zabbix/zabbix_server
—————————— Modify —————————
38 rows
Logfile=/var/log/zabbix/zabbix_server.log

68 rows
Pidfile=/var/log/zabbix/zabbix_server.pid

85 rows
Dbhost=localhost # #mysql数据库IP, this environment MySQL and zabbix-server on the same machine

95 rows
Dbname=zabbix # #mysql数据库

111 Rows
Dbuser=zabbix # #mysql用户

119 Rows
Dbpassword=12345.com # #mysql密码

126 rows
Dbsocket=/var/lib/mysql/mysql.sock # #这里需要注意. Use the Find/-name mysql.sock to view and then fill in.

322 rows
Snmptrapperfile=/var/run/zabbix/zabbix_traps.tmp

588 rows
Include=/usr/local/etc/zabbix_server.conf.d/*.conf
——————————————————

Modifying the Zabbix_agent configuration file
———————— Modify ——————————
Vim/etc/zabbix/zabbix_agentd.conf

11 rows
Pidfile=/var/log/zabbix/zabbix_agentd.pid

30 rows
Logfile=/var/log/zabbix/zabbix_agentd.log

265 rows
Include=/usr/local/etc/zabbix_agentd.conf.d/*.conf
——————————————————————

Create Zabbix Log Directory
Mkdir-p/var/run/zabbix

Mkdir-p/var/log/zabbix

Chown-r zabbix:zabbix/var/run/zabbix//var/log/zabbix/

Copying Zabbix startup scripts
CP zabbix-3.4.7/misc/init.d/fedora/core5/zabbix_server/etc/init.d/

CP zabbix-3.4.7/misc/init.d/fedora/core5/zabbix_agentd/etc/init.d/

Boot up
Chkconfig Zabbix_server on

Chkconfig Zabbix_agentd on

Mkdir-p/USR/LOCAL/ETC/ZABBIX_SERVER.CONF.D

Mkdir-p/USR/LOCAL/ETC/ZABBIX_AGENTD.CONF.D

Service Zabbix_server Restart

Service Zabbix_agentd Restart

Create a Zabbix Web page
Mkdir/var/www/html/zabbix

CD zabbix-3.4.7/frontends/php

Cp-a. /var/www/html/zabbix

Chown-r zabbix:zabbix/var/www/html/zabbix/

Vim/etc/httpd/conf/httpd.conf
Append the content to the end of the ———————————— —————————————
Alias/zabbix/var/www/html/zabbix
<directory "/var/www/html/zabbix" >
Options FollowSymLinks
AllowOverride None
Order Allow,deny
Allow from all
<ifmodule mod_php5.c>
Php_value Max_execution_time 300
Php_value Memory_limit 128M
Php_value post_max_size 16M
Php_value upload_max_filesize 2M
Php_value Max_input_time 300
Php_value Always_populate_raw_post_data-1
Php_value Date.timezone Asia/shanghai
</IfModule>
</Directory>
<directory "/var/www/html/zabbix/conf" >
Order Deny,allow
Deny from all
<files.php>
Order Deny,allow
Deny from all
</files>
</Directory>
<directory "/var/www/html/zabbix/app" >
Order Deny,allow
Deny from all
<files
.php>
Order Deny,allow
Deny from all
</files>
</Directory>
<directory "/var/www/html/zabbix/include" >
Order Deny,allow
Deny from all
<files *.php>
Order Deny,allow
Deny from all
</files>
</Directory>
————————————————————————————————

Chkconfig httpd on

Service httpd Restart

You can manually configure the Web Access Http://10.1.1.1/zabbix at this point Zabbix-web
Alternatively, you can create it manually as follows:

vim/var/www/html/zabbix/conf/zabbix.conf.php
——————————————————— Add the following —————————————————————————
<?php
Zabbix GUI configuration file.
Global $DB;

$DB [' TYPE '] = ' MYSQL ';
$DB [' SERVER '] = ' localhost ';
$DB [' PORT '] = ' 0 ';
$DB [' DATABASE '] = ' Zabbix ';
$DB [' USER '] = ' Zabbix ';
$DB [' PASSWORD '] = ' 12345.Com ';
Schema name. Used for IBM DB2 and PostgreSQL.
$DB [' SCHEMA '] = ';
$ZBX _server = ' localhost ';
$ZBX _server_port = ' 10051 ';
$ZBX _server_name = ";

$IMAGE _format_default = image_format_png;
————————————————————————————————————————

Chown zabbix.zabbix/var/www/html/zabbix/conf/zabbix.conf.php

At this point the Zabbix_server end is configured.

(This article is only for personal installation configuration note content, if there are shortcomings also please predecessors more advice!) )

RedHat6.9 to install zabbix-3.4.7,db with Percona MySQL 5.7.20

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.