码迷,mamicode.com
首页 > 其他好文 > 详细

Zabbix3.4-部署安装

时间:2018-03-18 21:46:07      阅读:369      评论:0      收藏:0      [点我收藏+]

标签:arch   blog   部署安装   文件   selinux   centos   mysql   /etc   grant   

Zabbix部署安装:

系统环境:CentOS 7

Zabbix版本:Zabbix 3.4

 

 

  1. 关闭防火墙和SELINUX

systemctl stop firewalld && setenforce 0

  1. 安装zabbix相关软件包

rpm -ivh https://mirrors.aliyun.com/zabbix/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-1.el7.centos.noarch.rpm &&\

yum install zabbix-server zabbix-web zabbix-server-mysql zabbix-web-mysql mariadb-server mariadb zabbix-agent -y

  1. 修改PHP时区配置

sed -i ‘s@# php_value date.timezone Europe/Riga@php_value date.timezone Asia/Shanghai@g‘ /etc/httpd/conf.d/zabbix.conf

  1. 启动数据库

systemctl start mariadb

  1. 创建zabbix所用的数据库及用户

mysql

create database zabbix character set utf8 collate utf8_bin;

grant all on zabbix.* to zabbix@‘localhost‘ identified by ‘123456‘;

exit

cd /usr/share/doc/zabbix-server-mysql-3.4.7/ &&\

zcat create.sql.gz|mysql -uzabbix -p123456 zabbix

  1. 修改zabbix配置文件

vim /etc/zabbix/zabbix_server.conf

DBHost=localhost

DBName=zabbix

DBUser=zabbix

DBPassword=123456

或者使用以下命令替换:

sed -i ‘s@# DBHost=localhost@DBHost=localhost@g‘ /etc/zabbix/zabbix_server.conf &&\

sed -i ‘s@# DBPassword=@DBPassword=123456@g‘ /etc/zabbix/zabbix_server.conf

  1. 启动zabbix

systemctl start zabbix-server &&\

systemctl start httpd

 

 

 

 

 

部署安装脚本:

systemctl stop firewalld && setenforce 0 &&\

rpm -ivh https://mirrors.aliyun.com/zabbix/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-1.el7.centos.noarch.rpm &&\

yum install zabbix-server zabbix-web zabbix-server-mysql zabbix-web-mysql mariadb-server mariadb zabbix-agent -y &&\

sed -i ‘s@# php_value date.timezone Europe/Riga@php_value date.timezone Asia/Shanghai@g‘ /etc/httpd/conf.d/zabbix.conf &&\

systemctl start mariadb &&\

mysql

create database zabbix character set utf8 collate utf8_bin;

grant all on zabbix.* to zabbix@‘localhost‘ identified by ‘123456‘;

exit

cd /usr/share/doc/zabbix-server-mysql-3.4.7/ &&\

zcat create.sql.gz|mysql -uzabbix -p123456 zabbix &&\

sed -i ‘s@# DBHost=localhost@DBHost=localhost@g‘ /etc/zabbix/zabbix_server.conf &&\

sed -i ‘s@# DBPassword=@DBPassword=123456@g‘ /etc/zabbix/zabbix_server.conf &&\

systemctl start zabbix-server &&\

systemctl start httpd

 

Zabbix3.4-部署安装

标签:arch   blog   部署安装   文件   selinux   centos   mysql   /etc   grant   

原文地址:https://www.cnblogs.com/tcheng/p/8597366.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!