ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

zabbix 安装部署

2019-12-15 21:01:50  阅读:209  来源: 互联网

标签:http 部署 server repo zabbix mysql MariaDB 安装


环境:CentOS7 机器 两台  分别为server 和 client

zabbix下载网址:http://repo.zabbix.com

本次操作使用zabbix4.0 网址:http://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm

操作:rpm -ivh http://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm  (下载解压)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 [root@node1 ~]# cat /etc/yum.repos.d/zabbix.repo [zabbix] name=Zabbix Official Repository - $basearch baseurl=http://repo.zabbix.com/zabbix/4.0/rhel/7/$basearch/ enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591    [zabbix-non-supported] name=Zabbix Official Repository non-supported - $basearch baseurl=http://repo.zabbix.com/non-supported/rhel/7/$basearch/ enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX gpgcheck=1

安装zabbix相关组件

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

启动数据库,设置开机自启

1 2 3 systemctl enable mariadb.service   systemctl start mariadb.service

登录mysql,并创建zabbix数据库,授权用户,用以登录zabbix数据库

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 [root@node1 ~]# mysql Welcome to the MariaDB monitor.  Commands end with ; or \g. Your MariaDB connection id is 2 Server version: 5.5.64-MariaDB MariaDB Server    Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. 创建名为zabbix的库 MariaDB [(none)]> create database zabbix  charset 'utf8'; Query OK, 1 row affected (0.00 sec) 授权zabbix用户在 任意主机访问zabbix库 MariaDB [(none)]> grant all on zabbix.* to zabbix@localhost identified by '123'; Query OK, 0 rows affected (0.00 sec)    MariaDB [(none)]> flush privileges; Query OK, 0 rows affected (0.00 sec)    MariaDB [(none)]>

  导入zabbix初始数据库  注意路径,不同版本zabbix路径名大同小异

1 zcat /usr/share/doc/zabbix-server-mysql-4.0.14/create.sql.gz |mysql -uzabbix -p123  zabbix

  编辑zabbix-server配置文件,配置数据库信息

1 2 3 4 5 [root@node1 ~]# cat  /etc/zabbix/zabbix_server.conf |grep "^DB" DBHost=localhost DBName=zabbix DBUser=zabbix DBPassword=123  

设置时区

进入php.ini 配置

1 2 3 vim /etc/php.ini ;http://php.net/date.timezone date.timezone = Asia/Shanghai

  

下一步,启动所有服务

1 2 systemctl enable httpd zabbix-server zabbix-ahent systemctl start httpd zabbix-server zabbix-agent

  查看相关端口是否监听  server监听10051  client监听  10050

netstat  -ntlp | grep 10051  (server监听)

netstat -ntlp | grep 10050 (client监听)

浏览器访问本机ip, 注意关闭防火墙

http://localhost/zabbix

使用默认管理员登录

账号: admin

密码: zabbix

 

中文乱码问题解决方式:

将我们选择的字体文件上传到zabbix web服务, /usr/share/zabbix/assets/fonts目录下(rpm安装目录)

1 2 3 4 rm -rf graphfont.ttf mv simkai.ttf  graphfont .ttf 授权644 chmod 644 graphfont.ttf

标签:http,部署,server,repo,zabbix,mysql,MariaDB,安装
来源: https://www.cnblogs.com/leilei001/p/12045887.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有