CentOS 7上安装Zabbix Server 3.0 图文详解
CentOS 7上安装Zabbix Server 3.0 图文详解
1.查看系统信息。
cat /etc/RedHat-release
CentOS Linux release 7.0.1406 (Core)
uname -a
Linux VM_96_155_centos3.10.0-123.el7.x86_64 #1 SMP Mon Jun 30 12:09:22 UTC 2014 x86_64 x86_64 x86_64GNU/Linux
2.使用rpm命令安装zabbix 3.0最新的epel源,关闭selinux和iptables。
rpm -ivh http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm
systemctl stop firewalld.service
setenforce 0
3.利用epel源安装zabbixserver所需软件包。
yum install zabbix-server-mysqlzabbix-web-mysql zabbix-agent zabbix-wget
4.安装并且启动mysql5.6,创建zabbix数据库。
rpm -ivhhttp://repo.mysql.com/yum/mysql-5.6-community/el/6/x86_64/mysql-community-release-el6-5.noarch.rpm
yum install -y mysql-community-server
systemctl start mysqld
[root@VM_96_155_centos ~]# ps -ef | grep mysql
root 6633 1 0 00:23 ? 00:00:00 /bin/sh /usr/bin/mysqld_safe--datadir=/var/lib/mysql --socket=/var/lib/mysql/mysql.sock--pid-file=/var/run/mysqld/mysqld.pid --basedir=/usr --user=mysql
mysql 6838 6633 0 00:23 ? 00:00:00 /usr/sbin/mysqld--basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin--user=mysql --log-error=/var/log/mysqld.log--pid-file=/var/run/mysqld/mysqld.pid --socket=/var/lib/mysql/mysql.sock
root 6982 1946 0 00:25 pts/0 00:00:00 grep --color=auto mysql
mysql> create database zabbix characterset utf8 collate utf8_bin;
Query OK, 1 row affected (0.00 sec)
mysql> grant all privileges on zabbix.*to 'zabbix'localhost'' identified by 'zabbix';
Query OK, 0 rows affected (0.08 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
5.导入默认的zabbix数据库信息。
cd/usr/share/doc/zabbix-server-mysql-3.0.4/
zcat create.sql.gz | mysql -uroot zabbix
6.修改zabbix_server.conf的配置文件。
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
7.修改配置文件/etc/httpd/conf.d/zabbix.conf
1234567 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 Europe/Riga
8.修改/etc/php.ini配置文件中的date.timezone = Asia/Shanghai
9.开启apache服务。
systemctl start httpd
ps -ef | grep httpd
root 4750 1 0 23:51 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 4751 4750 0 23:51 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 4752 4750 0 23:51 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 4753 4750 0 23:51 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 4754 4750 0 23:51 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
apache 4755 4750 0 23:51 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
root 4822 1945 0 23:52 pts/0 00:00:00 grep --color=auto httpd
11.选择下一步,Check of pre-requisites,如图所示:
12.选择下一步,配置数据库配置文件,如下图所示:
13.选择下一步,配置zabbix server detail,如下图所示:
14.点击下一步,便完成安装,安装完成的界面如下图所示:
15.Zabbix·server的默认账号Admin 密码zabbix,如图所示:
16.登陆的默认首页,如图所示:
到此为止,zabbix3.0.4安装完毕,接下来,我会陆陆续续写出来更多的关于zabbix监控的文章。
一些Zabbix相关教程集合:
ZABBIX 的详细介绍:请点这里
ZABBIX 的下载地址:请点这里
参考资料:https://www.zabbix.com/documentation/3.0/manual/installation/install_from_packages