zabbix Repository installation for centos7

准备环境

[root@localhost ~]# hostnamectl set-hostname zabbix
[root@zabbix ~]# setenforce 0
setenforce: SELinux is disabled
[root@zabbix ~]# sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config
[root@zabbix ~]# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
[root@zabbix ~]# yum install epel-release.noarch wget vim gcc gcc-c++ lsof chrony tree nmap unzip rsync -y
[root@zabbix ~]# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
[root@zabbix ~]# yum install httpd mariadb mariadb-server mariadb-client php php-mysql -y

安装zabbix

[root@zabbix ~]# rpm -ivh http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm
获取http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm
警告:/var/tmp/rpm-tmp.uFFKlX: 头V4 RSA/SHA512 Signature, 密钥 ID a14fe591: NOKEY
准备中...                          ################################# [100%]
正在升级/安装...
   1:zabbix-release-3.2-1.el7         ################################# [100%]
[root@zabbix ~]# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
[root@zabbix ~]# yum install zabbix-server-mysql zabbix-web-mysql zabbix-get zabbix-agent -y

配置

[root@zabbix ~]# systemctl start mariadb.service
[root@zabbix ~]# /usr/bin/mysqladmin -u root password '123456'
[root@zabbix ~]# mysql -uroot -p123456
MariaDB [(none)]> GRANT ALL PRIVILEGES ON *.* TO zabbix@localhost IDENTIFIED BY 'zabbix';
MariaDB [(none)]> CREATE DATABASE zabbix DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
MariaDB [(none)]> GRANT ALL ON zabbix.* TO 'zabbix'@'%' IDENTIFIED BY 'zabbix';
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> quit
[root@zabbix ~]# cd /usr/share/doc/zabbix-server-mysql-3.2.1/
[root@zabbix zabbix-server-mysql-3.2.1]# zcat create.sql.gz | mysql -uzabbix -p zabbix
[root@zabbix zabbix-server-mysql-3.2.1]# vim /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
[root@zabbix zabbix-server-mysql-3.2.1]# vim /etc/httpd/conf.d/zabbix.conf
php_value date.timezone Asia/Chongqing
[root@zabbix zabbix-server-mysql-3.2.1]# systemctl start httpd
[root@zabbix zabbix-server-mysql-3.2.1]# systemctl start zabbix-server
[root@zabbix zabbix-server-mysql-3.2.1]# systemctl start zabbix-agent

浏览器访问 http://ip/zabbix
访问默认用户名/密码:Admin/zabbix

zabbix Repository installation for centos7_第1张图片
8CDF50F4-DDFD-4E49-AABC-06DDDA5BAD60.png

你可能感兴趣的:(zabbix Repository installation for centos7)