zabbix的数据库和服务的安装

Server installation with MySQL database

It is a good practice to have the innodb_file_per_table option enabled on MySQL. Check this setting before proceeding.

Red Hat Enterprise Linux / CentOS

Installing packages

Here is an example for Zabbix server and web frontend installation with MySQL database:

# yum install zabbix-server-mysql zabbix-web-mysql

Creating initial database

Create Zabbix database and user on MySQL by the following commands, where <root_password> shall be replaced with the actual root password (e.g., shell> mysql -uroot -p12345) and <password> with new password for zabbix user on the database (including apostrophes: …identified by ‘67890‘;):

shell> mysql -uroot -p<root_password>
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> grant all privileges on zabbix.* to [email protected] identified by ‘<password>‘;
mysql> quit;

Now import initial schema and data. Make sure to insert correct version for 3.2.*. You will be prompted to enter your newly created password.

# zcat /usr/share/doc/zabbix-server-mysql-3.2.*/create.sql.gz | mysql -uzabbix -p zabbix

In order to check the version you have in your package, use the following command:

# rpm -q zabbix-server-mysql

Database configuration for Zabbix server                            #对于zabbix服务器的配置

Edit server host, name, user and password in zabbix_server.conf as follows, where DBPassword is the password you‘ve set creating initial database:

# vi /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=<password>

Starting Zabbix server process

It‘s time to start Zabbix server process and make it start at system boot:

# systemctl start zabbix-server
# systemctl enable zabbix-server

PHP configuration for Zabbix frontend                 #配置zabbix的前端PHP

Apache configuration file for Zabbix frontend is located in /etc/httpd/conf.d/zabbix.conf. Some PHP settings are already configured. But it‘s necessary to uncomment the “date.timezone” setting and set the right timezone for you.

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

SELinux configuration

Having SELinux status enabled in enforcing mode, you need to execute the following command to enable successful connection of Zabbix frontend to the server:

# setsebool -P httpd_can_connect_zabbix on

As frontend and SELinux configuration is done, you need to restart Apache web server:

# systemctl start httpd

Installing frontend

Now you are ready to proceed with frontend installation steps which will allow you to access your newly installed Zabbix.

Zabbix official repository provides fping, iksemel, libssh2 packages for RHEL as well. These packages are located in the non-supported directory.


Debian / Ubuntu

Installing packages

Here is an example for Zabbix server and web frontend installation with MySQL database:

# apt-get install zabbix-server-mysql zabbix-frontend-php

Creating initial database

Create Zabbix database and user on MySQL by the following commands, where <root_password> shall be replaced with the actual root password (e.g., shell> mysql -uroot -p12345) and <password> with new password for zabbix user on the database (including apostrophes: …identified by ‘67890‘;):

shell> mysql -uroot -p<root_password>
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> grant all privileges on zabbix.* to [email protected] identified by ‘<password>‘;
mysql> quit;

Then import initial schema and data. You will be prompted to enter your newly created password.

# zcat /usr/share/doc/zabbix-server-mysql/create.sql.gz | mysql -uzabbix -p zabbix

Database configuration for Zabbix server

Edit server host, name, user and password in zabbix_server.conf as follows, where DBPassword is the password you‘ve set creating initial database::

# vi /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=<password>

Starting Zabbix server process

Now you may start Zabbix server process and make it start at system boot

# service zabbix-server start
# update-rc.d zabbix-server enable

PHP configuration for Zabbix frontend

Apache configuration file for Zabbix frontend is located in /etc/zabbix/apache.conf. Some PHP settings are already configured. But it‘s necessary to uncomment the “date.timezone” setting and set the right timezonefor you.

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

After that you need to restart Apache web server:

# service apache2 restart

If you have SELinux status enabled in enforcing mode see corresponding block for RHEL / CentOS above.

Installing frontend

Now you are ready to proceed with frontend installation steps which will allow you to access your newly installed Zabbix.

时间: 2024-10-08 09:58:35

zabbix的数据库和服务的安装的相关文章

zabbix切换数据库思路

zabbix切换数据库操作 1.安装mysql-server数据库 ,讲三个表结构复制过去 将schema.sql  images.sql   data.sql  数据库从zabbix服务器上复制到/root路径下面 然后导入表结构 [[email protected] ~]#  /usr/bin/mysql -uzabbix -pzabbix zabbix < /root/schema.sql Warning: Using a password on the command line inte

监控和安全运维 1.8 zabbix服务端安装

1. Zabbix简介基于web的开源软件,开源监控系统状态也可以监控网络设备.和nagios不同的是zabbix会把获取的数据保存在数据库中,所以zabbix需要有数据库支持 Zabbix还可以自动发现主机和网络设备支持邮件和短信告警Zabbix大多配置都可以在web界面配置完成官网http://www.zabbix.com/ 2. 安装zabbix rpm -ivh http://www.lishiming.net/data/attachment/forum/month_1211/epel-

zabbix服务端安装

Zabbix服务端安装规范文档 修订历史记录 日期 版本 说明 作者 2014-01-21 <1.0> <初始化> 刘孟杰 目录 1.   前言..... 4 1.1   目的.... 4 1.2   术语.... 4 1.3   适用版本.... 4 1.4   阅读范围.... 4 2.     环境准备..... 4 2.1    yum安装LAMP环境.... 4 2.2    安装其他所需组件.... 4 2.3    启动服务.... 4 3.     安装zabbix

zabbix服务端安装配置

from http://www.cnblogs.com/wsl222000/p/5615111.html 1.安装好httpd,mysql,php yum install httpd php mysql mysql-devel php-xmlwriter php-gd php-mbstring php-bcmath php-mysql 2.下载安装zabbix-2.2.6.tar.gz tar zxvf zabbix-2.2.6.tar.gz -C /usr/local/src/ #解压 use

Zabbix企业应用之服务端与客户端的安装

一.简介 zabbix是一个基于WEB界面的提供分布式系统监视以及网络监视功能的企业级的开源解决方案 zabbix能监视各种网络参数,保证服务器系统的安全运营:并提供灵活的通知机制以让系统管理员快速定位/解决存在的各种问题 zabbix有2部分组成,zabbix server和zabbix agent(可选组件) zabbix server可以通过SNMP,zabbix agent,ping,端口监视等方法提供对远程服务器/网络状态的监视,数据收集等功能,它可以运行在Linux,Solaris,

zabbix 服务端安装(server)

zabbix版本:Zabbix 2.2 LTS 备注:Linux下安装zabbix需要有LAMP或者LNMP运行环境 准备篇: 一.Web环境:Nginx+MySQL+PHP CentOS 7.0编译安装Nginx1.6.0+MySQL5.6.19+PHP5.5.14 http://www.osyunwei.com/archives/7891.html 二.zabbix软件包下载 zabbix-2.2.6 http://jaist.dl.sourceforge.net/project/zabbi

zabbix服务端安装配置笔记

由于没有闲置服务器,就在所有运行服务器中找一台较为空闲的Windows 2008,安装VMware,起一台虚拟机来装. 环境:CentOS6.7 x64 Minimal 服务端IP:172.16.10.30 zabbix版本:2.0 1.安装依赖包之前需要安装epel扩展源    //系统自带的源无法安装到zabbix #yum install -y epel-release 2.安装LAMP环境     //zabbix需要运行在LAMP环境下 #yum install -y  httpd m

centos 7 上zabbix 3.0 服务端安装

zabbix服务端安装 安装完毕mysql-5.6.php5.6 mysql-5.6安装:https://www.cnblogs.com/xzlive/p/9771642.html  创建zabbix 用户 # groupadd zabbix # useradd -g zabbix zabbix 1.1 下载安装zabbix所有版本下载地址:http://www.zabbix.com/download.php # yum install net-snmp-devel libxml2-devel

Zabbix 3.4.10 服务端的安装与设置

实验验目的:  Zabbix 3.x 服务端的安装 实验主机:  m01  (centos 7.4)  IP 10.0.0.61/172.16.1.61 1) 配置yum源, 并用wget命令把相关的软件包下载到本地, 然后再进行安装, 如下所示 #配置yum 源解决依赖的问题 [[email protected] /]# rpm -ivh https://mirrors.aliyun.com/zabbix/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-