Centos7yum方式安装Zabbix3.4服务端

前端之家收集整理的这篇文章主要介绍了Centos7yum方式安装Zabbix3.4服务端前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
  1. 一、系统环境
  2. cat /etc/redhat-release
  3. CentOS Linux release 7.3.1611 (Core)
  4.  
  5. 关闭防火墙及selinux
  6. systemctl stop firewalld.service
  7. systemctl disable firewalld.service
  8. sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
  9. grep SELINUX=disabled /etc/selinux/config
  10. setenforce 0
  11.  
  12. 二、数据库安装及配置
  13. 1MariaDB概述
  14. MariaDB数据库管理系统是MysqL的一个分支,主要由开源社区在维护,采用GPL授权许可。
  15. 开发这个分支的原因是:甲骨文公司收购了MysqL后,有将MysqL闭源的潜在风险,因此社区采用分支的方式来避开这个风险。
  16. MariaDB的目的是完全兼容MysqL包括API和命令行,使之能轻松成为MysqL的代替品。
  17.  
  18. 2、安装mariadb
  19. yum install mariadb-server mariadb -y
  20. mariadb数据库的相关命令是:
  21. systemctl start mariadb #启动MariaDB
  22. systemctl stop mariadb #停止MariaDB
  23. systemctl restart mariadb #重启MariaDB
  24. systemctl enable mariadb #设置开机启动
  25.  
  26. 2Zabbix3.4安装
  27. rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-1.el7.centos.noarch.rpm
  28. yum install zabbix-server-MysqL zabbix-web-MysqL -y
  29.  
  30. 3、创建数据库
  31. create database zabbix character set utf8 collate utf8_bin;
  32. grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
  33.  
  34. 4、导入数据
  35. zcat /usr/share/doc/zabbix-server-MysqL-3.4.0/create.sql.gz | MysqL -uzabbix -pzabbix zabbix
  36.  
  37. 5、配置数据库用户及密码
  38. grep -n '^'[a-Z] /etc/zabbix/zabbix_server.conf
  39. 38:LogFile=/var/log/zabbix/zabbix_server.log
  40. 49:LogFileSize=0
  41. 72:PidFile=/var/run/zabbix/zabbix_server.pid
  42. 99:DBName=zabbix
  43. 115:DBUser=zabbix
  44. 123:DBPassword=zabbix
  45. 314:SNMPTrapperFile=/var/log/snmptrap/snmptrap.log
  46. 432:Timeout=4
  47. 474:AlertScriptsPath=/usr/lib/zabbix/alertscripts
  48. 484:ExternalScripts=/usr/lib/zabbix/externalscripts
  49. 520:LogSlowQueries=3000
  50.  
  51. 6、启动zabbix server并设置开机启动
  52. systemctl enable zabbix-server
  53. systemctl start zabbix-server
  54.  
  55. 7、编辑Zabbix前端PHP配置,更改时区
  56. vim /etc/httpd/conf.d/zabbix.conf
  57. PHP_value date.timezone Asia/Shanghai
  58.  
  59. 8SELinux配置
  60. setsebool -P httpd_can_connect_zabbix on
  61. setsebool -P httpd_can_network_connect_db on
  62.  
  63. 9、启动httpd并设置开机启动
  64. systemctl start httpd
  65. systemctl enable httpd
  66.  
  67. 五、zabbxi-agent安装及配置
  68. 1、安装zabbxi-agent
  69. yum install zabbix-agent -y
  70.  
  71. 2、配置zabbxi-agent
  72. grep -n '^'[a-Z] /etc/zabbix/zabbix_agentd.conf
  73. 13:PidFile=/var/run/zabbix/zabbix_agentd.pid
  74. 32:LogFile=/var/log/zabbix/zabbix_agentd.log
  75. 43:LogFileSize=0
  76. 97:Server=172.16.8.254
  77. 138:ServerActive=172.16.8.254
  78. 149:Hostname=Zabbix server
  79. 267:Include=/etc/zabbix/zabbix_agentd.d/*.conf
  80.  
  81. 3、启动zabbxi-agent并设置开机启动
  82. systemctl enable zabbix-agent.service
  83. systemctl restart zabbix-agent.service

猜你在找的CentOS相关文章