install zabbix 3.4 with mysql5.7


## zabbix install
## centos version
[root@localhost min]# cat /etc/redhat-release
CentOS Linux release 7.5.1804 (Core)

## install mysql repo
wget http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm
yum install mysql57-community-release-el7-7.noarch.rpm
================================================================================
 Package             Arch   Version
                                  Repository                               Size
================================================================================
Installing:
 mysql57-community-release
                     noarch el7-7 /mysql57-community-release-el7-7.noarch 7.8 k

Transaction Summary
================================================================================
Install  1 Package

## mysql repo enable
[root@localhost mysql]# yum repolist enabled | grep "mysql.*-community.*"
mysql-connectors-community/x86_64 MySQL Connectors Community                 65
mysql-tools-community/x86_64      MySQL Tools Community                      69
mysql57-community/x86_64          MySQL 5.7 Community Server                287

## install mysql
yum install mysql-community-server mysql mysql-libs mysql-devel mysql-server
================================================================================
 Package                      Arch    Version          Repository          Size
================================================================================
Installing:
 mysql-community-client       x86_64  5.7.23-1.el7     mysql57-community   24 M
 mysql-community-devel        x86_64  5.7.23-1.el7     mysql57-community  3.6 M
 mysql-community-libs         x86_64  5.7.23-1.el7     mysql57-community  2.2 M
     replacing  mariadb-libs.x86_64 1:5.5.56-2.el7
 mysql-community-libs-compat  x86_64  5.7.23-1.el7     mysql57-community  2.0 M
     replacing  mariadb-libs.x86_64 1:5.5.56-2.el7
 mysql-community-server       x86_64  5.7.23-1.el7     mysql57-community  165 M
Installing for dependencies:
 mysql-community-common       x86_64  5.7.23-1.el7     mysql57-community  274 k

Transaction Summary
================================================================================
Install  5 Packages (+1 Dependent package)
Installing : mysql-community-common-5.7.23-1.el7.x86_64                   1/7
Installing : mysql-community-libs-5.7.23-1.el7.x86_64                     2/7
Installing : mysql-community-client-5.7.23-1.el7.x86_64                   3/7
Installing : mysql-community-server-5.7.23-1.el7.x86_64                   4/7
Installing : mysql-community-libs-compat-5.7.23-1.el7.x86_64              5/7
Installing : mysql-community-devel-5.7.23-1.el7.x86_64                    6/7
Erasing    : 1:mariadb-libs-5.5.56-2.el7.x86_64                           7/7

##  MySQL Start
systemctl start  mysqld.service

## after install .. mysql setup config
sudo grep 'temporary password' /var/log/mysqld.log

Open & Edit /etc/my.cnf
Add skip-grant-tables under [mysqld]
Restart Mysql
You should be able to login to mysql now using the below command mysql -u root -p
Run mysql> flush privileges;
Set new password by ALTER USER 'root'@'localhost' IDENTIFIED BY 'NewPassword';
Go back to /etc/my.cnf and remove/comment skip-grant-tables
Restart Mysql
Now you will be able to login with the new password mysql -u root -p

## Create initial database
# mysql -uroot -p
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> uninstall plugin validate_password;
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'password';
mysql> quit;

## install zabbix repo : zabbix-release-3.4-2.el7.noarch.rpm
wget https://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm
rpm -i zabbix-release-3.4-2.el7.noarch.rpm

##zabbix-server-mysql
yum install zabbix-server-mysql
================================================================================
 Package               Arch     Version            Repository              Size
================================================================================
Installing:
 zabbix-server-mysql   x86_64   3.4.13-1.el7       zabbix                 2.0 M
Installing for dependencies:
 OpenIPMI-libs         x86_64   2.0.23-2.el7       base                   521 k
 OpenIPMI-modalias     x86_64   2.0.23-2.el7       base                    16 k
 fping                 x86_64   3.10-1.el7         zabbix-non-supported    40 k
 iksemel               x86_64   1.4-2.el7.centos   zabbix-non-supported    49 k
 unixODBC              x86_64   2.3.1-11.el7       base                   413 k

Transaction Summary
================================================================================
Install  1 Package (+5 Dependent packages)

Installing : iksemel-1.4-2.el7.centos.x86_64                                                                                                                                                                 1/6
Installing : unixODBC-2.3.1-11.el7.x86_64                                                                                                                                                                    2/6
Installing : OpenIPMI-modalias-2.0.23-2.el7.x86_64                                                                                                                                                           3/6
Installing : OpenIPMI-libs-2.0.23-2.el7.x86_64                                                                                                                                                               4/6
Installing : fping-3.10-1.el7.x86_64                                                                                                                                                                         5/6
Installing : zabbix-server-mysql-3.4.13-1.el7.x86_64 

yum install zabbix-web-mysql
===================================================================================================================================================================================================================
 Package                                               Arch                                        Version                                                      Repository                                    Size
===================================================================================================================================================================================================================
Installing:
 zabbix-web-mysql                                      noarch                                      3.4.13-1.el7                                                 zabbix                                       7.0 k
Installing for dependencies:
 apr                                                   x86_64                                      1.4.8-3.el7_4.1                                              base                                         103 k
 apr-util                                              x86_64                                      1.5.2-6.el7                                                  base                                          92 k
 httpd                                                 x86_64                                      2.4.6-80.el7.centos.1                                        updates                                      2.7 M
 httpd-tools                                           x86_64                                      2.4.6-80.el7.centos.1                                        updates                                       90 k
 libzip                                                x86_64                                      0.10.1-8.el7                                                 base                                          48 k
 mailcap                                               noarch                                      2.1.41-2.el7                                                 base                                          31 k
 php                                                   x86_64                                      5.4.16-45.el7                                                base                                         1.4 M
 php-bcmath                                            x86_64                                      5.4.16-45.el7                                                base                                          58 k
 php-cli                                               x86_64                                      5.4.16-45.el7                                                base                                         2.7 M
 php-common                                            x86_64                                      5.4.16-45.el7                                                base                                         565 k
 php-gd                                                x86_64                                      5.4.16-45.el7                                                base                                         128 k
 php-ldap                                              x86_64                                      5.4.16-45.el7                                                base                                          53 k
 php-mbstring                                          x86_64                                      5.4.16-45.el7                                                base                                         505 k
 php-mysql                                             x86_64                                      5.4.16-45.el7                                                base                                         101 k
 php-pdo                                               x86_64                                      5.4.16-45.el7                                                base                                          99 k
 php-xml                                               x86_64                                      5.4.16-45.el7                                                base                                         126 k
 t1lib                                                 x86_64                                      5.1.2-14.el7                                                 base                                         166 k
 zabbix-web                                            noarch                                      3.4.13-1.el7                                                 zabbix                                       2.7 M

Transaction Summary
===================================================================================================================================================================================================================
Install  1 Package (+18 Dependent packages)

##zabbix java-gateway
=====================================================================================================================================================================================================
 Package                                                Arch                                      Version                                            Repository                                 Size
=====================================================================================================================================================================================================
Updating:
 zabbix-java-gateway                                    x86_64                                    3.4.14-1.el7                                       zabbix                                    737 k

Transaction Summary
=====================================================================================================================================================================================================
Upgrade  1 Package


##zabbix-agent
yum install zabbix-agent

===================================================================================================================================================================================================================
 Package                                               Arch                                            Version                                               Repository                                       Size
===================================================================================================================================================================================================================
Installing:
 zabbix-agent                                          x86_64                                          3.4.13-1.el7                                          zabbix                                          366 k

Transaction Summary
===================================================================================================================================================================================================================
Install  1 Package


##nmap
===============================================================================================================================================================================================================
 Package                                        Arch                                             Version                                                  Repository                                      Size
===============================================================================================================================================================================================================
Installing:
 nmap                                           x86_64                                           2:6.40-13.el7                                            base                                           3.9 M

Transaction Summary
===============================================================================================================================================================================================================
Install  1 Package


## Import initial schema and data. You will be prompted to enter your newly created password
# zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix

# Configure the database for Zabbix server
vi /etc/zabbix/zabbix_server.conf

DBPassword=password

##firewall
vi /etc/sysconfig/iptables

##zabbix.conf
vi  /etc/httpd/conf.d/zabbix.conf
php_value date.timezone Asia/Seoul

##start
systemctl restart zabbix-server zabbix-agent httpd
systemctl enable zabbix-server zabbix-agent httpd
systemctl start zabbix-java-gateway

##/usr/sbin/zabbix_server -c /etc/zabbix/zabbix_server.conf

## kill process
ps -ef | grep "zabbix_server" | awk {'print "kill -9 " $2'} | sh -x

## zabbix doesn't started...
vi zabbix_server_add.te
module zabbix_server_add 1.1;

require {
        type zabbix_var_run_t;
        type tmp_t;
        type zabbix_t;
        class sock_file { create unlink write };
        class unix_stream_socket connectto;
        class process setrlimit;
}

#============= zabbix_t ==============

#!!!! This avc is allowed in the current policy
allow zabbix_t self:process setrlimit;

#!!!! This avc is allowed in the current policy
allow zabbix_t self:unix_stream_socket connectto;

#!!!! This avc is allowed in the current policy
allow zabbix_t tmp_t:sock_file { create unlink write };

#!!!! This avc is allowed in the current policy
allow zabbix_t zabbix_var_run_t:sock_file { create unlink write };
------------------------------------------------------------------------
## install policy
yum install policycoreutils-python
checkmodule -M -m -o zabbix_server_add.mod zabbix_server_add.te
semodule_package  -m zabbix_server_add.mod -o zabbix_server_add.pp
semodule -i zabbix_server_add.pp

##firewall
firewall-cmd --add-port=80/tcp
firewall-cmd --add-port=10050/tcp
firewall-cmd --add-port=10051/tcp
firewall-cmd --zone=public --list-all
firewall-cmd --list-all
firewall-cmd --state



댓글

이 블로그의 인기 게시물

error You have $NVM_DIR set to "/root/.nvm", but that directory does not exist. Check your profile files and environment.

linux mint install xrdp

centos 6.x yum update problem making ssl connection