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

zabbix3.4 安装服务端方法

时间:2018-11-01 16:02:27      阅读:161      评论:0      收藏:0      [点我收藏+]

标签:解决中文乱码   .gz   连接mysql   serve   sans   ase   share   grant   fonts   

主机名称 操作系统 IP地址 zabbix CentOS 7.4 192.168.26.56

1.修改主机名,修改host

hostnamectl set-hostname zabbix.rhce.cc
echo ‘192.168.26.56 zabbix.rhce.cc zabbix‘ >> /etc/hosts

2关闭防火墙及seLinux

firewall-cmd --set-default-zone=trusted
sed -i ‘/SELINUX=/cSELINUX=disabled‘ /etc/selinux/config
setenforce 0

3关闭 NetworkManager

systemctl stop NetworkManager
systemctl disable NetworkManager

4.配置yum源及包

rm -rf /etc/yum.repos.d/*
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
rpm -ivh https://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm 
#rpm -ivh  https://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm

5.安装软件


yum install zabbix-server-mysql zabbix-proxy-mysql  zabbix-web-mysql zabbix-get zabbix-agent -y
yum install *open*vm*tool bash* vim lrzsz wget tree  -y

6安装mariadb数据库

yum install -y  mariadb-server
systemctl start mariadb.service

7创建数据库

mysql -e ‘create database zabbix character set utf8 collate utf8_bin;‘
mysql -e ‘grant all privileges on zabbix.* to zabbix@localhost identified by "zabbix";‘

8导入数据

zcat /usr/share/doc/zabbix-server-mysql-3.4.11/create.sql.gz | mysql -uzabbix -pzabbix  zabbix

9配置zabbixserver连接mysql

sed -i.ori ‘91a  DBHost=localhost‘ /etc/zabbix/zabbix_server.conf
sed -i.ori ‘115a DBPassword=zabbix‘ /etc/zabbix/zabbix_server.conf

10添加时区

sed -i.ori ‘18a php_value date.timezone Asia/Shanghai‘ /etc/httpd/conf.d/zabbix.conf

11解决中文乱码

yum -y install wqy-microhei-fonts
\cp /usr/share/fonts/wqy-microhei/wqy-microhei.ttc  /usr/share/fonts/dejavu/DejaVuSans.ttf

12启动服务

systemctl restart mariadb.service
systemctl start zabbix-server
systemctl start httpd
systemctl enable mariadb.service
systemctl enable httpd
systemctl enable zabbix-server

13输出信息

echo "浏览器访问 http://hostname -I|awk ‘{print $1}‘/zabbix"

zabbix3.4 安装服务端方法

标签:解决中文乱码   .gz   连接mysql   serve   sans   ase   share   grant   fonts   

原文地址:http://blog.51cto.com/12909202/2311667

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