45321ttt 发表于 2016-12-2 08:57:00

zabbix-3.2安装实战

ZABBIX安装简要说明蓝色为你需要注意下的,红色基本为你需要输入的命令行cat部分会进行VIM编辑 重点部分也用颜色标识了。
[*]先安装zabbix
[*]安装数据库mysql
[*]导入zabbix 数据库初始文件。
[*]配置相关文件,和启动相关服务。
ps:改了php相关文件,一定要重启httpd。
# cat /etc/redhat-release CentOS Linux release 7.2.1511 (Core) # rpm -ivh http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpmRetrieving http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpmwarning:/var/tmp/rpm-tmp.AYeSQ4: Header V4 RSA/SHA512 Signature, key ID a14fe591: NOKEYPreparing...                         ################################# Updating /installing...   1:zabbix-release-3.2-1.el7         ################################## yum install zabbix-server-mysql zabbix-web-mysqlLoaded plugins:fastestmirrorLoading mirrorspeeds from cached hostfile * base: mirrors.zju.edu.cn * extras: mirrors.163.com * updates: mirrors.tuna.tsinghua.edu.cnResolvingDependencies--> Runningtransaction check---> Packagezabbix-server-mysql.x86_64 0:3.2.1-1.el7 will be installed--> ProcessingDependency: fping for package: zabbix-server-mysql-3.2.1-1.el7.x86_64--> ProcessingDependency: libiksemel.so.3()(64bit) for package:zabbix-server-mysql-3.2.1-1.el7.x86_64--> ProcessingDependency: libnetsnmp.so.31()(64bit) for package:zabbix-server-mysql-3.2.1-1.el7.x86_64--> ProcessingDependency: libOpenIPMIposix.so.0()(64bit) for package:zabbix-server-mysql-3.2.1-1.el7.x86_64--> ProcessingDependency: libodbc.so.2()(64bit) for package:zabbix-server-mysql-3.2.1-1.el7.x86_64--> ProcessingDependency: libOpenIPMI.so.0()(64bit) for package:zabbix-server-mysql-3.2.1-1.el7.x86_64---> Packagezabbix-web-mysql.noarch 0:3.2.1-1.el7 will be installed--> ProcessingDependency: zabbix-web = 3.2.1-1.el7 for package:zabbix-web-mysql-3.2.1-1.el7.noarch--> ProcessingDependency: php-mysql for package: zabbix-web-mysql-3.2.1-1.el7.noarch--> Runningtransaction check---> PackageOpenIPMI-libs.x86_64 0:2.0.19-11.el7 will be installed--> ProcessingDependency: OpenIPMI-modalias = 2.0.19-11.el7 for package:OpenIPMI-libs-2.0.19-11.el7.x86_64---> Packagefping.x86_64 0:3.10-1.el7 will be installed---> Packageiksemel.x86_64 0:1.4-2.el7.centos will be installed---> Packagenet-snmp-libs.x86_64 1:5.7.2-24.el7_2.1 will be installed---> Packagephp-mysql.x86_64 0:5.4.16-36.3.el7_2 will be installed--> ProcessingDependency: php-pdo(x86-64) = 5.4.16-36.3.el7_2 for package:php-mysql-5.4.16-36.3.el7_2.x86_64---> PackageunixODBC.x86_64 0:2.3.1-11.el7 will be installed--> ProcessingDependency: libltdl.so.7()(64bit) for package: unixODBC-2.3.1-11.el7.x86_64---> Packagezabbix-web.noarch 0:3.2.1-1.el7 will be installed--> ProcessingDependency: php >= 5.4 for package: zabbix-web-3.2.1-1.el7.noarch--> ProcessingDependency: php-gd for package: zabbix-web-3.2.1-1.el7.noarch--> ProcessingDependency: php-mbstring for package: zabbix-web-3.2.1-1.el7.noarch--> ProcessingDependency: dejavu-sans-fonts for package: zabbix-web-3.2.1-1.el7.noarch--> ProcessingDependency: php-bcmath for package: zabbix-web-3.2.1-1.el7.noarch--> ProcessingDependency: httpd for package: zabbix-web-3.2.1-1.el7.noarch--> ProcessingDependency: php-ldap for package: zabbix-web-3.2.1-1.el7.noarch--> ProcessingDependency: php-xml for package: zabbix-web-3.2.1-1.el7.noarch--> Runningtransaction check---> PackageOpenIPMI-modalias.x86_64 0:2.0.19-11.el7 will be installed---> Packagedejavu-sans-fonts.noarch 0:2.33-6.el7 will be installed--> ProcessingDependency: dejavu-fonts-common = 2.33-6.el7 for package:dejavu-sans-fonts-2.33-6.el7.noarch---> Packagehttpd.x86_64 0:2.4.6-40.el7.centos.4 will be installed--> ProcessingDependency: httpd-tools = 2.4.6-40.el7.centos.4 for package:httpd-2.4.6-40.el7.centos.4.x86_64--> ProcessingDependency: /etc/mime.types for package: httpd-2.4.6-40.el7.centos.4.x86_64---> Packagelibtool-ltdl.x86_64 0:2.4.2-21.el7_2 will be installed---> Packagephp.x86_64 0:5.4.16-36.3.el7_2 will be installed--> ProcessingDependency: php-common(x86-64) = 5.4.16-36.3.el7_2 for package:php-5.4.16-36.3.el7_2.x86_64--> ProcessingDependency: php-cli(x86-64) = 5.4.16-36.3.el7_2 for package:php-5.4.16-36.3.el7_2.x86_64---> Packagephp-bcmath.x86_64 0:5.4.16-36.3.el7_2 will be installed---> Packagephp-gd.x86_64 0:5.4.16-36.3.el7_2 will be installed--> ProcessingDependency: libpng15.so.15(PNG15_0)(64bit) for package:php-gd-5.4.16-36.3.el7_2.x86_64--> ProcessingDependency: libt1.so.5()(64bit) for package: php-gd-5.4.16-36.3.el7_2.x86_64--> ProcessingDependency: libpng15.so.15()(64bit) for package:php-gd-5.4.16-36.3.el7_2.x86_64--> ProcessingDependency: libXpm.so.4()(64bit) for package: php-gd-5.4.16-36.3.el7_2.x86_64--> ProcessingDependency: libX11.so.6()(64bit) for package: php-gd-5.4.16-36.3.el7_2.x86_64---> Packagephp-ldap.x86_64 0:5.4.16-36.3.el7_2 will be installed---> Packagephp-mbstring.x86_64 0:5.4.16-36.3.el7_2 will be installed---> Packagephp-pdo.x86_64 0:5.4.16-36.3.el7_2 will be installed---> Packagephp-xml.x86_64 0:5.4.16-36.3.el7_2 will be installed--> Runningtransaction check---> Packagedejavu-fonts-common.noarch 0:2.33-6.el7 will be installed--> ProcessingDependency: fontpackages-filesystem for package:dejavu-fonts-common-2.33-6.el7.noarch---> Packagehttpd-tools.x86_64 0:2.4.6-40.el7.centos.4 will be installed---> PackagelibX11.x86_64 0:1.6.3-2.el7 will be installed--> ProcessingDependency: libX11-common >= 1.6.3-2.el7 for package:libX11-1.6.3-2.el7.x86_64--> ProcessingDependency: libxcb.so.1()(64bit) for package: libX11-1.6.3-2.el7.x86_64---> PackagelibXpm.x86_64 0:3.5.11-3.el7 will be installed---> Packagelibpng.x86_64 2:1.5.13-7.el7_2 will be installed---> Packagemailcap.noarch 0:2.1.41-2.el7 will be installed---> Packagephp-cli.x86_64 0:5.4.16-36.3.el7_2 will be installed---> Packagephp-common.x86_64 0:5.4.16-36.3.el7_2 will be installed--> ProcessingDependency: libzip.so.2()(64bit) for package:php-common-5.4.16-36.3.el7_2.x86_64---> Packaget1lib.x86_64 0:5.1.2-14.el7 will be installed--> Runningtransaction check---> Packagefontpackages-filesystem.noarch 0:1.44-8.el7 will be installed---> PackagelibX11-common.noarch 0:1.6.3-2.el7 will be installed---> Packagelibxcb.x86_64 0:1.11-4.el7 will be installed--> ProcessingDependency: libXau.so.6()(64bit) for package: libxcb-1.11-4.el7.x86_64---> Packagelibzip.x86_64 0:0.10.1-8.el7 will be installed--> Runningtransaction check---> PackagelibXau.x86_64 0:1.0.8-2.1.el7 will be installed--> FinishedDependency Resolution
DependenciesResolved
========================================================================================================================================= Package                               Arch               Version                           Repository                        Size=========================================================================================================================================Installing: zabbix-server-mysql                   x86_64               3.2.1-1.el7                         zabbix                           1.8 M zabbix-web-mysql                      noarch               3.2.1-1.el7                         zabbix                           5.1 kInstalling fordependencies: OpenIPMI-libs                         x86_64               2.0.19-11.el7                     base                               501 k OpenIPMI-modalias                     x86_64               2.0.19-11.el7                     base                              15 k dejavu-fonts-common                   noarch               2.33-6.el7                        base                              64 k dejavu-sans-fonts                     noarch               2.33-6.el7                        base                               1.4 M fontpackages-filesystem               noarch               1.44-8.el7                        base                               9.9 k fping                                 x86_64               3.10-1.el7                        zabbix-non-supported                40 k httpd                                 x86_64               2.4.6-40.el7.centos.4               updates                            2.7 M httpd-tools                           x86_64               2.4.6-40.el7.centos.4               updates                           83 k iksemel                               x86_64               1.4-2.el7.centos                  zabbix-non-supported                49 k libX11                              x86_64               1.6.3-2.el7                         base                               605 k libX11-common                         noarch               1.6.3-2.el7                         base                               162 k libXau                              x86_64               1.0.8-2.1.el7                     base                              29 k libXpm                              x86_64               3.5.11-3.el7                        base                              54 k libpng                              x86_64               2:1.5.13-7.el7_2                  updates                            213 k libtool-ltdl                        x86_64               2.4.2-21.el7_2                      updates                           49 k libxcb                              x86_64               1.11-4.el7                        base                               189 k libzip                              x86_64               0.10.1-8.el7                        base                              48 k mailcap                               noarch               2.1.41-2.el7                        base                              31 k net-snmp-libs                         x86_64               1:5.7.2-24.el7_2.1                  updates                            747 k php                                 x86_64               5.4.16-36.3.el7_2                   updates                            1.4 M php-bcmath                            x86_64               5.4.16-36.3.el7_2                   updates                           56 k php-cli                               x86_64               5.4.16-36.3.el7_2                   updates                            2.7 M php-common                            x86_64               5.4.16-36.3.el7_2                   updates                            563 k php-gd                              x86_64               5.4.16-36.3.el7_2                   updates                            126 k php-ldap                              x86_64               5.4.16-36.3.el7_2                   updates                           51 k php-mbstring                        x86_64               5.4.16-36.3.el7_2                   updates                            504 k php-mysql                           x86_64               5.4.16-36.3.el7_2                   updates                            100 k php-pdo                               x86_64               5.4.16-36.3.el7_2                   updates                           97 k php-xml                               x86_64               5.4.16-36.3.el7_2                   updates                            124 k t1lib                                 x86_64               5.1.2-14.el7                        base                               166 k unixODBC                              x86_64               2.3.1-11.el7                        base                               413 k zabbix-web                            noarch               3.2.1-1.el7                         zabbix                           3.6 M
Transaction Summary=========================================================================================================================================Install2 Packages (+32 Dependent packages)
Total size: 19 MInstalled size: 80 MIs this ok: yDownloadingpackages:warning:/var/cache/yum/x86_64/7/zabbix-non-supported/packages/fping-3.10-1.el7.x86_64.rpm:Header V4 DSA/SHA1 Signature, key ID 79ea5ed4: NOKEYRetrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIXImporting GPG key0x79EA5ED4: Userid    : "Zabbix SIA <packager@zabbix.com>" Fingerprint: fbab d5fb 2025 5eca b22e e194d13d 58e4 79ea 5ed4 Package   : zabbix-release-3.2-1.el7.noarch (installed) From      : /etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIXIs this ok: ywarning:/var/cache/yum/x86_64/7/zabbix/packages/zabbix-web-3.2.1-1.el7.noarch.rpm:Header V4 RSA/SHA512 Signature, key ID a14fe591: NOKEYRetrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591Importing GPG key0xA14FE591: Userid    : "Zabbix LLC <packager@zabbix.com>" Fingerprint: a184 8f53 52d0 22b9 471d 83d0082a b56b a14f e591 Package   : zabbix-release-3.2-1.el7.noarch (installed) From      : /etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591Is this ok: yRunning transactioncheckRunning transactiontestTransaction testsucceededRunning transactionWarning: RPMDBaltered outside of yum.Installing :1:net-snmp-libs-5.7.2-24.el7_2.1.x86_64                                                                           1/34Installing : libzip-0.10.1-8.el7.x86_64                                                                                          2/34Installing :php-common-5.4.16-36.3.el7_2.x86_64                                                                                 3/34Installing :php-pdo-5.4.16-36.3.el7_2.x86_64                                                                                    4/34Installing :php-mysql-5.4.16-36.3.el7_2.x86_64                                                                                  5/34Installing :php-ldap-5.4.16-36.3.el7_2.x86_64                                                                                 6/34Installing :php-xml-5.4.16-36.3.el7_2.x86_64                                                                                    7/34Installing :php-cli-5.4.16-36.3.el7_2.x86_64                                                                                    8/34Installing :php-mbstring-5.4.16-36.3.el7_2.x86_64                                                                               9/34Installing :php-bcmath-5.4.16-36.3.el7_2.x86_64                                                                              10/34Installing :httpd-tools-2.4.6-40.el7.centos.4.x86_64                                                                           11/34Installing : libXau-1.0.8-2.1.el7.x86_64                                                                                        12/34Installing : libxcb-1.11-4.el7.x86_64                                                                                           13/34Installing :libtool-ltdl-2.4.2-21.el7_2.x86_64                                                                                 14/34Installing :unixODBC-2.3.1-11.el7.x86_64                                                                                       15/34Installing :OpenIPMI-modalias-2.0.19-11.el7.x86_64                                                                           16/34Installing :OpenIPMI-libs-2.0.19-11.el7.x86_64                                                                                 17/34Installing :fontpackages-filesystem-1.44-8.el7.noarch                                                                        18/34Installing :dejavu-fonts-common-2.33-6.el7.noarch                                                                              19/34Installing :dejavu-sans-fonts-2.33-6.el7.noarch                                                                              20/34Installing :2:libpng-1.5.13-7.el7_2.x86_64                                                                                     21/34Installing :iksemel-1.4-2.el7.centos.x86_64                                                                                    22/34Installing : mailcap-2.1.41-2.el7.noarch                                                                                        23/34Installing :httpd-2.4.6-40.el7.centos.4.x86_64                                                                                 24/34Installing :php-5.4.16-36.3.el7_2.x86_64                                                                                       25/34Installing :libX11-common-1.6.3-2.el7.noarch                                                                                 26/34Installing : libX11-1.6.3-2.el7.x86_64                                                                                          27/34Installing : t1lib-5.1.2-14.el7.x86_64                                                                                          28/34Installing : libXpm-3.5.11-3.el7.x86_64                                                                                       29/34Installing :php-gd-5.4.16-36.3.el7_2.x86_64                                                                                    30/34Installing :zabbix-web-mysql-3.2.1-1.el7.noarch                                                                              31/34Installing :zabbix-web-3.2.1-1.el7.noarch                                                                                    32/34Installing : fping-3.10-1.el7.x86_64                                                                                          33/34Installing :zabbix-server-mysql-3.2.1-1.el7.x86_64                                                                           34/34Verifying : fping-3.10-1.el7.x86_64                                                                                             1/34Verifying : libX11-common-1.6.3-2.el7.noarch                                                                                    2/34Verifying : mailcap-2.1.41-2.el7.noarch                                                                                       3/34Verifying : iksemel-1.4-2.el7.centos.x86_64                                                                                     4/34Verifying : 2:libpng-1.5.13-7.el7_2.x86_64                                                                                    5/34Verifying : fontpackages-filesystem-1.44-8.el7.noarch                                                                           6/34Verifying : httpd-2.4.6-40.el7.centos.4.x86_64                                                                                  7/34Verifying : OpenIPMI-libs-2.0.19-11.el7.x86_64                                                                                  8/34Verifying : zabbix-web-3.2.1-1.el7.noarch                                                                                       9/34Verifying : php-common-5.4.16-36.3.el7_2.x86_64                                                                              10/34Verifying : php-pdo-5.4.16-36.3.el7_2.x86_64                                                                                 11/34Verifying : libX11-1.6.3-2.el7.x86_64                                                                                          12/34Verifying : dejavu-fonts-common-2.33-6.el7.noarch                                                                              13/34Verifying : t1lib-5.1.2-14.el7.x86_64                                                                                          14/34Verifying : php-mysql-5.4.16-36.3.el7_2.x86_64                                                                                 15/34Verifying : OpenIPMI-modalias-2.0.19-11.el7.x86_64                                                                           16/34Verifying : zabbix-web-mysql-3.2.1-1.el7.noarch                                                                              17/34Verifying : php-ldap-5.4.16-36.3.el7_2.x86_64                                                                                  18/34Verifying : zabbix-server-mysql-3.2.1-1.el7.x86_64                                                                           19/34Verifying : php-xml-5.4.16-36.3.el7_2.x86_64                                                                                 20/34Verifying : libtool-ltdl-2.4.2-21.el7_2.x86_64                                                                                 21/34Verifying : php-5.4.16-36.3.el7_2.x86_64                                                                                       22/34Verifying : unixODBC-2.3.1-11.el7.x86_64                                                                                       23/34Verifying : php-cli-5.4.16-36.3.el7_2.x86_64                                                                                 24/34Verifying : libXpm-3.5.11-3.el7.x86_64                                                                                       25/34Verifying : dejavu-sans-fonts-2.33-6.el7.noarch                                                                              26/34Verifying : libXau-1.0.8-2.1.el7.x86_64                                                                                        27/34Verifying : httpd-tools-2.4.6-40.el7.centos.4.x86_64                                                                           28/34Verifying : php-gd-5.4.16-36.3.el7_2.x86_64                                                                                    29/34Verifying : php-mbstring-5.4.16-36.3.el7_2.x86_64                                                                              30/34Verifying : php-bcmath-5.4.16-36.3.el7_2.x86_64                                                                              31/34Verifying : libzip-0.10.1-8.el7.x86_64                                                                                       32/34Verifying : 1:net-snmp-libs-5.7.2-24.el7_2.1.x86_64                                                                            33/34Verifying : libxcb-1.11-4.el7.x86_64                                                                                           34/34
Installed:zabbix-server-mysql.x86_64 0:3.2.1-1.el7                            zabbix-web-mysql.noarch 0:3.2.1-1.el7                           
DependencyInstalled:OpenIPMI-libs.x86_64 0:2.0.19-11.el7      OpenIPMI-modalias.x86_640:2.0.19-11.el7       dejavu-fonts-common.noarch 0:2.33-6.el7   dejavu-sans-fonts.noarch 0:2.33-6.el7       fontpackages-filesystem.noarch0:1.44-8.el7   fping.x86_640:3.10-1.el7               httpd.x86_64 0:2.4.6-40.el7.centos.4      httpd-tools.x86_640:2.4.6-40.el7.centos.4   iksemel.x86_64 0:1.4-2.el7.centos         libX11.x86_64 0:1.6.3-2.el7               libX11-common.noarch0:1.6.3-2.el7            libXau.x86_640:1.0.8-2.1.el7             libXpm.x86_64 0:3.5.11-3.el7                libpng.x86_642:1.5.13-7.el7_2               libtool-ltdl.x86_64 0:2.4.2-21.el7_2      libxcb.x86_64 0:1.11-4.el7                  libzip.x86_640:0.10.1-8.el7                   mailcap.noarch 0:2.1.41-2.el7             net-snmp-libs.x86_64 1:5.7.2-24.el7_2.1   php.x86_64 0:5.4.16-36.3.el7_2                  php-bcmath.x86_640:5.4.16-36.3.el7_2   php-cli.x86_64 0:5.4.16-36.3.el7_2          php-common.x86_640:5.4.16-36.3.el7_2          php-gd.x86_64 0:5.4.16-36.3.el7_2         php-ldap.x86_64 0:5.4.16-36.3.el7_2         php-mbstring.x86_640:5.4.16-36.3.el7_2      php-mysql.x86_64 0:5.4.16-36.3.el7_2      php-pdo.x86_64 0:5.4.16-36.3.el7_2          php-xml.x86_640:5.4.16-36.3.el7_2             t1lib.x86_64 0:5.1.2-14.el7               unixODBC.x86_64 0:2.3.1-11.el7            zabbix-web.noarch0:3.2.1-1.el7               
Complete!>>尝试进入数据库,发现没有安装,下面就是安装和解压zabbix的步骤# mysql -uroot -p-bash: mysql:command not found# mysqld -uroot -p-bash: mysqld:command not found##### yum install wgetLoaded plugins:fastestmirrorLoading mirrorspeeds from cached hostfile * base: mirrors.zju.edu.cn * extras: mirrors.163.com * updates: mirrors.tuna.tsinghua.edu.cnResolvingDependencies--> Runningtransaction check---> Packagewget.x86_64 0:1.14-10.el7_0.1 will be installed--> FinishedDependency Resolution
DependenciesResolved
========================================================================================================================================= Package                      Arch                           Version                                  Repository                  Size=========================================================================================================================================Installing: wget                         x86_64                         1.14-10.el7_0.1                        base                         545 k
Transaction Summary=========================================================================================================================================Install1 Package
Total size: 545 kInstalled size: 2.0MIs this ok: yDownloadingpackages:Running transactioncheckRunning transactiontestTransaction testsucceededRunning transactionInstalling : wget-1.14-10.el7_0.1.x86_64                                                                                          1/1Verifying : wget-1.14-10.el7_0.1.x86_64                                                                                          1/1
Installed:wget.x86_64 0:1.14-10.el7_0.1                                                                                                         
Complete!>>添加mysql源# wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm--2016-12-0106:27:17--http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpmResolvingrepo.mysql.com (repo.mysql.com)... 23.49.6.178Connecting torepo.mysql.com (repo.mysql.com)|23.49.6.178|:80... connected.HTTP request sent,awaiting response... 200 OKLength: 6140 (6.0K)Saving to:‘mysql-community-release-el7-5.noarch.rpm’
100%[===============================================================================================>]6,140       4.13KB/s   in 1.5s
2016-12-01 06:27:24(4.13 KB/s) - ‘mysql-community-release-el7-5.noarch.rpm’ saved >>确认包# lshttpdldconfig manmysql-community-release-el7-5.noarch.rpmyum # rpm -ivh mysql-community-release-el7-5.noarch.rpmPreparing...                         ################################# Updating /installing...   1:mysql-community-release-el7-5    ################################# # yum install mysql-community-serverLoaded plugins:fastestmirrorLoading mirrorspeeds from cached hostfile * base: mirrors.zju.edu.cn * extras: mirrors.163.com * updates: mirrors.tuna.tsinghua.edu.cnResolvingDependencies--> Runningtransaction check---> Packagemysql-community-server.x86_64 0:5.6.34-2.el7 will be installed--> ProcessingDependency: mysql-community-common(x86-64) = 5.6.34-2.el7 for package:mysql-community-server-5.6.34-2.el7.x86_64--> ProcessingDependency: mysql-community-client(x86-64) >= 5.6.10 for package:mysql-community-server-5.6.34-2.el7.x86_64--> ProcessingDependency: perl(DBI) for package: mysql-community-server-5.6.34-2.el7.x86_64--> Runningtransaction check---> Packagemysql-community-client.x86_64 0:5.6.34-2.el7 will be installed--> ProcessingDependency: mysql-community-libs(x86-64) >= 5.6.10 for package:mysql-community-client-5.6.34-2.el7.x86_64---> Packagemysql-community-common.x86_64 0:5.6.34-2.el7 will be installed---> Packageperl-DBI.x86_64 0:1.627-4.el7 will be installed--> ProcessingDependency: perl(RPC::PlServer) >= 0.2001 for package:perl-DBI-1.627-4.el7.x86_64--> ProcessingDependency: perl(RPC::PlClient) >= 0.2000 for package:perl-DBI-1.627-4.el7.x86_64--> Runningtransaction check---> Packagemariadb-libs.x86_64 1:5.5.44-2.el7.centos will be obsoleted---> Packagemysql-community-libs.x86_64 0:5.6.34-2.el7 will be obsoleting---> Packageperl-PlRPC.noarch 0:0.2020-14.el7 will be installed--> ProcessingDependency: perl(Net::Daemon) >= 0.13 for package:perl-PlRPC-0.2020-14.el7.noarch--> ProcessingDependency: perl(Net::Daemon::Test) for package:perl-PlRPC-0.2020-14.el7.noarch--> ProcessingDependency: perl(Net::Daemon::Log) for package: perl-PlRPC-0.2020-14.el7.noarch--> ProcessingDependency: perl(Compress::Zlib) for package: perl-PlRPC-0.2020-14.el7.noarch--> Runningtransaction check---> Packageperl-IO-Compress.noarch 0:2.061-2.el7 will be installed--> ProcessingDependency: perl(Compress::Raw::Zlib) >= 2.061 for package:perl-IO-Compress-2.061-2.el7.noarch--> ProcessingDependency: perl(Compress::Raw::Bzip2) >= 2.061 for package:perl-IO-Compress-2.061-2.el7.noarch---> Packageperl-Net-Daemon.noarch 0:0.48-5.el7 will be installed--> Runningtransaction check---> Packageperl-Compress-Raw-Bzip2.x86_64 0:2.061-3.el7 will be installed---> Packageperl-Compress-Raw-Zlib.x86_64 1:2.061-4.el7 will be installed--> FinishedDependency Resolution
DependenciesResolved
========================================================================================================================================= Package                                 Arch                   Version                        Repository                         Size=========================================================================================================================================Installing: mysql-community-libs                  x86_64               5.6.34-2.el7                     mysql56-community               2.0 M   replacing mariadb-libs.x86_64 1:5.5.44-2.el7.centos mysql-community-server                  x86_64               5.6.34-2.el7                     mysql56-community                  59 MInstalling fordependencies: mysql-community-client                  x86_64               5.6.34-2.el7                     mysql56-community                  19 M mysql-community-common                  x86_64               5.6.34-2.el7                     mysql56-community               257 k perl-Compress-Raw-Bzip2               x86_64               2.061-3.el7                      base                               32 k perl-Compress-Raw-Zlib                  x86_64               1:2.061-4.el7                  base                               57 k perl-DBI                              x86_64               1.627-4.el7                      base                              802 k perl-IO-Compress                        noarch               2.061-2.el7                      base                              260 k perl-Net-Daemon                         noarch               0.48-5.el7                     base                               51 k perl-PlRPC                              noarch               0.2020-14.el7                  base                               36 k
Transaction Summary=========================================================================================================================================Install2 Packages (+8 Dependent packages)
Total size: 82 MIs this ok: yDownloadingpackages:warning:/var/cache/yum/x86_64/7/mysql56-community/packages/mysql-community-server-5.6.34-2.el7.x86_64.rpm:Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEYRetrieving key from file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysqlImporting GPG key0x5072E1F5: Userid    : "MySQL Release Engineering<mysql-build@oss.oracle.com>" Fingerprint: a4a9 4068 76fc bd3c 4567 70c88c71 8d3b 5072 e1f5 Package   : mysql-community-release-el7-5.noarch (installed) From      : file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysqlIs this ok: yRunning transactioncheckRunning transactiontestTransaction testsucceededRunning transactionWarning: RPMDBaltered outside of yum.Installing :mysql-community-common-5.6.34-2.el7.x86_64                                                                        1/11Installing :mysql-community-libs-5.6.34-2.el7.x86_64                                                                            2/11Installing :mysql-community-client-5.6.34-2.el7.x86_64                                                                        3/11Installing :perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64                                                                        4/11Installing :1:perl-Compress-Raw-Zlib-2.061-4.el7.x86_64                                                                         5/11Installing :perl-IO-Compress-2.061-2.el7.noarch                                                                                 6/11Installing :perl-Net-Daemon-0.48-5.el7.noarch                                                                                 7/11Installing :perl-PlRPC-0.2020-14.el7.noarch                                                                                     8/11Installing : perl-DBI-1.627-4.el7.x86_64                                                                                       9/11Installing :mysql-community-server-5.6.34-2.el7.x86_64                                                                         10/11Erasing   : 1:mariadb-libs-5.5.44-2.el7.centos.x86_64                                                                        11/11Verifying : perl-Net-Daemon-0.48-5.el7.noarch                                                                                 1/11Verifying : perl-IO-Compress-2.061-2.el7.noarch                                                                                 2/11Verifying : mysql-community-server-5.6.34-2.el7.x86_64                                                                        3/11Verifying : mysql-community-client-5.6.34-2.el7.x86_64                                                                        4/11Verifying : mysql-community-libs-5.6.34-2.el7.x86_64                                                                            5/11Verifying : 1:perl-Compress-Raw-Zlib-2.061-4.el7.x86_64                                                                         6/11Verifying : perl-DBI-1.627-4.el7.x86_64                                                                                       7/11Verifying : perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64                                                                        8/11Verifying : perl-PlRPC-0.2020-14.el7.noarch                                                                                     9/11Verifying : mysql-community-common-5.6.34-2.el7.x86_64                                                                         10/11Verifying : 1:mariadb-libs-5.5.44-2.el7.centos.x86_64                                                                        11/11
Installed:mysql-community-libs.x86_640:5.6.34-2.el7                        mysql-community-server.x86_64 0:5.6.34-2.el7                     
DependencyInstalled:mysql-community-client.x86_64 0:5.6.34-2.el7mysql-community-common.x86_64 0:5.6.34-2.el7 perl-Compress-Raw-Bzip2.x86_640:2.061-3.el7perl-Compress-Raw-Zlib.x86_641:2.061-4.el7perl-DBI.x86_640:1.627-4.el7               perl-IO-Compress.noarch 0:2.061-2.el7      perl-Net-Daemon.noarch 0:0.48-5.el7          perl-PlRPC.noarch0:0.2020-14.el7         
Replaced:mariadb-libs.x86_641:5.5.44-2.el7.centos                                                                                             
Complete!# systemctl enable mysqld# systemctl start mysqld>>默认貌似是进不了数据库的,于是我干脆直接初始化数据库# mysql_secure_installation


NOTE: RUNNING ALLPARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL      SERVERS IN PRODUCTION USE!PLEASE READ EACH STEP CAREFULLY!
In order to log intoMySQL to secure it, we'll need the currentpassword for theroot user.If you've just installedMySQL, andyou haven't set theroot password yet, the password will be blank,so you should justpress enter here.
Enter currentpassword for root (enter for none):OK, successfullyused password, moving on...
Setting the rootpassword ensures that nobody can log into the MySQLroot user withoutthe proper authorisation.
Set rootpassword? yNewpassword: 输入你需要设置的密码Re-enternew password: 确认你输入的密码Password updatedsuccessfully!Reloading privilegetables.. ... Success!

By default, a MySQLinstallation has an anonymous user, allowing anyoneto log into MySQLwithout having to have a user account created forthem.This is intended only for testing, and tomake the installationgo a bitsmoother.You should remove them beforemoving into aproductionenvironment.
Removeanonymous users? y ... Success!
Normally, rootshould only be allowed to connect from 'localhost'.Thisensures that someonecannot guess at the root password from the network.
Disallowroot login remotely? y ... Success!
By default, MySQLcomes with a database named 'test' that anyone canaccess.This is also intended only for testing, andshould be removedbefore moving into aproduction environment.
Removetest database and access to it? y - Dropping test database...ERROR 1008 (HY000)at line 1: Can't drop database 'test'; database doesn't exist ... Failed! Not critical, keep moving... - Removing privileges on test database... ... Success!
Reloading theprivilege tables will ensure that all changes made so farwill take effectimmediately.
Reloadprivilege tables now? y ... Success!



All done!If you've completed all of the above steps,your MySQLinstallation shouldnow be secure.
Thanks for usingMySQL!

Cleaning up...# mysql -uroot -pEnterpassword: 输入你设置的密码Welcome to the MySQLmonitor.Commands end with ; or \g.Your MySQLconnection id is 13Server version:5.6.34 MySQL Community Server (GPL)
Copyright (c) 2000,2016, Oracle and/or its affiliates. All rights reserved.
Oracle is aregistered trademark of Oracle Corporation and/or itsaffiliates. Othernames may be trademarks of their respectiveowners.
Type 'help;' or '\h'for help. Type '\c' to clear the current input statement.
mysql>create database zabbix character set utf8 collate utf8_bin;Query OK, 1 rowaffected (0.00 sec) >>这里设置了数据库的密码也是后面web中需要用的。mysql> grant all privileges on zabbix.* tozabbix@localhost identified by 'zabbix';Query OK, 0 rowsaffected (0.00 sec)
mysql> quit;Bye>>导入数据库# cd /usr/share/doc/zabbix-server-mysql-3.2.1/[root@zabbix-serverzabbix-server-mysql-3.2.1]# lsAUTHORSChangeLog COPYINGcreate.sql.gzNEWS README[root@zabbix-serverzabbix-server-mysql-3.2.1]# zcat/usr/share/doc/zabbix-server-mysql-3.2.1/create.sql.gz | mysql -uzabbix -pzabbixEnterpassword:ERROR 1045(28000): Access denied for user 'zabbix'@'localhost' (using password: YES)[root@zabbix-serverzabbix-server-mysql-3.2.1]# zcat/usr/share/doc/zabbix-server-mysql-3.2.1/create.sql.gz | mysql -uzabbix -pzabbixEnterpassword:[root@zabbix-serverzabbix-server-mysql-3.2.1]# systemctl start zabbix-server>>以下为VIM需要变更的地方,注释的都删除即可。[root@zabbix-serverzabbix-server-mysql-3.2.1]# cat /etc/zabbix/zabbix_server.conf | grep DBHost### Option: DBHost#DBHost=localhost[root@zabbix-serverzabbix-server-mysql-3.2.1]# cat /etc/zabbix/zabbix_server.conf | grep DBNam### Option: DBName# DBName=DBName=zabbix[root@zabbix-serverzabbix-server-mysql-3.2.1]# cat /etc/zabbix/zabbix_server.conf | grep DBUser#      ForSQLite3 path to database file must be provided. DBUser and DBPassword areignored.### Option: DBUser# DBUser=DBUser=zabbix[root@zabbix-serverzabbix-server-mysql-3.2.1]# cat /etc/zabbix/zabbix_server.conf | grepDBPassword#      ForSQLite3 path to database file must be provided. DBUser and DBPassword areignored.### Option:DBPassword#DBPassword=[root@zabbix-serverzabbix-server-mysql-3.2.1]# vim /etc/zabbix/zabbix_server.conf[root@zabbix-serverzabbix-server-mysql-3.2.1]# systemctl start zabbix-server[root@zabbix-serverzabbix-server-mysql-3.2.1]# systemctl enable zabbix-serverCreated symlink from/etc/systemd/system/multi-user.target.wants/zabbix-server.service to/usr/lib/systemd/system/zabbix-server.service.[root@zabbix-serverzabbix-server-mysql-3.2.1]# cat /etc/php.ini | grep date.timezone; http://php.net/date.timezone;date.timezone=[root@zabbix-serverzabbix-server-mysql-3.2.1]# vim /etc/php.ini[root@zabbix-serverzabbix-server-mysql-3.2.1]# cat /etc/php.ini | grep date.timezone; http://php.net/date.timezonedate.timezone= Asia/Shanghai# systemctl start httpd[root@zabbix-serverzabbix-server-mysql-3.2.1]#systemctlenable httpdCreated symlink from/etc/systemd/system/multi-user.target.wants/httpd.service to/usr/lib/systemd/system/httpd.service.[root@zabbix-serverzabbix-server-mysql-3.2.1]# systemctl stop firewalld[root@zabbix-serverzabbix-server-mysql-3.2.1]# systemctl restart httpd
图片什么的我就不上传了,基本就是你设置中的密码初始化配置中 所有项都必须通过,改了配置一定要重启httpd



得得_08 发表于 2017-9-9 00:35:19

请问一下你是关闭了selinux对吗?
页: [1]
查看完整版本: zabbix-3.2安装实战