标签:code 用户 lld mirror sql libc 技术 gsl 3.0
#crontab -l 00 00 * * * /usr/sbin/ntpdate -u x.x.x.x #选择ntp服务器 #systemctl restart crond
1.1 安装依赖包:
yum -y install wget net-snmp-devel net-snmp-utils OpenIPMI-devel httpd openssl-devel java lrzsz fping-devel libcurl-devel perl-DBI pcre-devel libxml2 libxml2-devel mysql-devel gcc php php-bcmath php-gd php-xml php-mbstring php-ldap php-mysql.x86_64 php-pear php-xmlrpc net-tools wget vim-enhanced
systemctl stop firewalld.service
systemctl disable firewalld.service
需要关闭 selinux,一定要关闭这个,开启selinux会引起一连串问题,甚至zabbix的discovery功能也不能正常使用
sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config
grep SELINUX /etc/selinux/config
然后重启系统即可。
reboot
二、安装zabbix server3.0
1.0 搭建lamp环境
在centos7上安装zabbix server3.0之前,我们首先搭建zabbix所需要的lamp环境。
下载最新的yum源,如下:
wget -P /etc/yum.repos.d http://mirrors.aliyun.com/repo/Centos-7.repo
在开始安装之前,还需要说明下centos7自带的mysql是mariadb,我们可以通过如下命令查看:
yum search mysql|tac
现在开始安装lamp环境,使用如下命令:
yum -y install mariadb mariadb-server php php-mysql httpd
systemctl enable mariadb.service
systemctl start mariadb.service
初始化mysql数据库,并配置root用户密码。使用如下命令:
mysql_secure_installation
mysql -uroot -pPioneerservice@3306 -e "create database zabbix default character set utf8 collate utf8_bin;" mysql -uroot -pPioneerservice@3306 -e "grant all privileges on zabbix.* to zabbix@localhost identified by ‘zabbix‘"
现在来测试刚刚创建的zabbix用户,是否可以连接mysql数据库,如下:
[root@zabbix ~]# mysql -uzabbix -pzabbix MariaDB [(none)]> show databases; MariaDB [(none)]> quit
[root@zabbix ~]# systemctl start httpd.service
[root@zabbix ~]# netstat -ltun
到此lamp环境已经全部搭建完毕。
1.1 安装zabbix server3.0
rpm -ivh http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm 3.2版本 rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm 3.4版本
以上安装完毕后,我们现在来正式安装zabbix3.0,使用如下命令:
yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-get
[root@zabbix ~]# cd /usr/share/doc/zabbix-server-mysql-3.2.11/ [root@zabbix zabbix-server-mysql-3.2.11]# zcat create.sql.gz | mysql -uroot -pDe123456 zabbix
[root@zabbix ~]# vim /etc/zabbix/zabbix_server.conf LogFile=/var/log/zabbix/zabbix_server.log LogFileSize=0 PidFile=/var/run/zabbix/zabbix_server.pid DBHost=localhost DBName=zabbix DBUser=zabbix DBPassword=zabbix SNMPTrapperFile=/var/log/snmptrap/snmptrap.log Timeout=4 AlertScriptsPath=/usr/lib/zabbix/alertscripts ExternalScripts=/usr/lib/zabbix/externalscripts LogSlowQueries=3000
vim /etc/httpd/conf.d/zabbix.conf Alias /zabbix /usr/share/zabbix Options FollowSymLinks AllowOverride None Require all granted php_value max_execution_time 300 php_value memory_limit 128M php_value post_max_size 16M php_value upload_max_filesize 2M php_value max_input_time 300 php_value always_populate_raw_post_data -1 php_value date.timezone Asia/Chongqing
修改前:
修改后:
systemctl start zabbix-server.service
systemctl enable zabbix-server.service
最后重启apache,如下:
[root@zabbix ~]# systemctl restart httpd.service
到目前为止,zabbix3.0已经安装完毕。
标签:code 用户 lld mirror sql libc 技术 gsl 3.0
原文地址:https://www.cnblogs.com/liyanping/p/9778870.html