Compile and install Zabbix 3.0 and separate deployment configurations

Source: Internet
Author: User

Compile and install Zabbix 3.0 and separate deployment configurations

Experimental System: CentOS 6.6 _ x86_64

Prerequisites: Prepare the compiling environment in advance, and disable both firewall and selinux.

Tutorial Description: there are 4 hosts in this experiment, and IP address and role allocation are shown in the topology.

Http://pan.baidu.com/s/1gd0JRaj used in the test with mariadb software.

Tutorial topology:

I. Preparations

1. Modify the hostname and hosts files as follows:

Note: mysql is the data storage host of zabbix, server is the main service host of zabbix, web is the front-end display host of zabbix, and agent is the monitored host. Generally, these four roles can be set up on the same host and deployed separately in this experiment.

2. Synchronization time:

Ntpdate 192.168.70.21 // address to write your own time server

Ii. Install the mysql server

1. Install mysql on the mysql.jason.com Host:

Tar xf mariadb-10.0.20-linux-x86_64.tar.gz-C/usr/local/
Cd/usr/local/
Ln-sv mariadb-10.0.20-linux-x86_64 mysql
Useradd-r mysql
Mkdir-pv/mydata/data
Chown-R mysql. mysql/mydata/data/
Cd mysql/
Chown-R root. mysql.
Scripts/mysql_install_db -- user = mysql -- datadir =/mydata/data/
Cp support-files/my-large.cnf/etc/my. cnf
Cp support-files/mysql. server/etc/init. d/mysqld
Chkconfig -- add mysqld
Chkconfig mysqld on

2. Edit the configuration file and start:

Vim/etc/my. cnf
----------------------------------------------->
[Mysqld]
Datadir =/mydata/data // Add this row
<-----------------------------------------------
Service mysqld start

3. Create a zabbix database and an authorized user:

/Usr/local/mysql/bin/mysql
------------------------------------>
Create database zabbix;
Grant all on zabbix. * TO 'zabbix' @ '2017. 192.% 'identified by '20160301 ';
Grant all on zabbix. * TO 'zabbix' @ 'localhost' identified by '123 ';
Grant all on zabbix. * TO 'zabbix' @ 'mysql .jason.com 'identified by '123 ';
Flush privileges;

4. Import database files:

Wget http://iweb.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Development/3.0.0alpha2/zabbix-3.0.0alpha2.tar.gz
Tar xf zabbix-3.0.0alpha2.tar.gz
Cd zabbix-3.0.0alpha2/database/mysql/
/Usr/local/mysql/bin/mysql-uzabbix-p123456 zabbix <schema. SQL // The import sequence cannot be incorrect.
/Usr/local/mysql/bin/mysql-uzabbix-p123456 zabbix <images. SQL
/Usr/local/mysql/bin/mysql-uzabbix-p123456 zabbix <data. SQL

3. Install the Zabbix-Server

1. Compile and install zabbix on the server.jason.com Host:

Yum-y install mysql-devel libxml2-devel net-snmp-devel libcurl-devel
Wget http://iweb.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Development/3.0.0alpha2/zabbix-3.0.0alpha2.tar.gz
Tar xf zabbix-3.0.0alpha2.tar.gz
Cd zabbix-3.0.0alpha2
Groupadd zabbix
Useradd-g zabbix
./Configure -- prefix =/usr/local/zabbix-server -- enable-server -- with-mysql -- with-net-snmp -- with-libcurl -- with-libxml2
Make install

2. Edit the configuration file and start:

Mkdir/var/log/zabbix
Chown-R zabbix: zabbix/var/log/zabbix
Vim/usr/local/zabbix-server/etc/zabbix_server.conf
------------------------------------------------------------->
LogFile =/var/log/zabbix/zabbix_server.log
DBHost = 192.168.19.66
DBName = zabbix
DBUser = zabbix
DBPassword = 123456
ListenIP = 127.0.0.1, 192.168.19.74
<-------------------------------------------------------------
/Usr/local/zabbix-server/sbin/zabbix_server-c/usr/local/zabbix-server/etc/zabbix_server.conf // start the service

Check the port and start listening:

4. Install Zabbix-Web Server

1. Install httpd and php on the web.jason.com Host:

Yum-y install httpd php-mysql libXpm php-bcmath php-gd php-mbstring php-xml t1lib
Mkdir/var/www/html/zabbix
Wget http://iweb.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Development/3.0.0alpha2/zabbix-3.0.0alpha2.tar.gz
Tar xf zabbix-3.0.0alpha2.tar.gz
Cd zabbix-3.0.0alpha2/frontends/php/
Cp-a./var/www/html/zabbix/

2. Configure php and start httpd:

Vim/etc/php. ini
----------------------------------------->
Date. timezone = Asia/Shanghai
Post_max_size = 16 M
Max_execution_time= 300
Max_input_time= 300
----------------------------------------->
Service httpd start

Access http: // 192.168.19.76/zabbix in a browser and follow the prompts to install:

The permission error is reported. Download the configuration file and save it to the/var/www/html/zabbix/conf/zabbix. conf. php file. If an error is returned after the configuration file is manually written, you can ignore it. Close the browser and re-open the connection. Log on to the admin account with the logon password zabbix:

Vim/var/www/html/zabbix/conf/zabbix. conf. php // manually write the configuration
---------------------------------------------------------->
<? Php
// Zabbix GUI configuration file.
Global $ DB;

$ DB ['type'] = 'mysql ';
$ DB ['server'] = '192. 168.19.66 ';
$ DB ['Port'] = '0 ';
$ DB ['database'] = 'zabbix ';
$ DB ['user'] = 'zabbix ';
$ DB ['Password'] = '000000 ';

// Schema name. Used for IBM DB2 and PostgreSQL.
$ DB ['scheme'] = '';

$ ZBX_SERVER = '192. 168.19.74 ';
$ ZBX_SERVER_PORT = '123 ';
$ ZBX_SERVER_NAME = '';

$ IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG;
?>

5. Install Zabbix-Agent

1. Install On the agent.jason.com Host:

Wget http://iweb.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Development/3.0.0alpha2/zabbix-3.0.0alpha2.tar.gz
Tar xf zabbix-3.0.0alpha2.tar.gz
Cd zabbix-3.0.0alpha2
Groupadd zabbix-agent
Useradd-g zabbix-agent
./Configure -- prefix =/usr/local/zabbix-agent -- enable-agent
Make install

2. Edit the configuration file:

Mkdir/var/log/zabbix
Chown-R zabbix-agent: zabbix-agent/var/log/zabbix/
Vim/usr/local/zabbix-agent/etc/zabbix_agentd.conf
------------------------------------------------------------>
LogFile =/var/log/zabbix/zabbix_agentd.log
Server = 192.168.19.74
ServerActive = 192.168.19.74
Hostname = agent.jason.com
User = zabbix-agent
<------------------------------------------------------------
/Usr/local/zabbix-agent/sbin/zabbix_agentd-c/usr/local/zabbix-agent/etc/zabbix_agentd.conf

6. Add hosts

Here I will give a general demonstration. The process may not be detailed:

Now, the demonstration process is complete. Thank you for watching!

Some Zabbix Tutorials:

Compile and install Zabbix2.4.5 source code in Ubuntu 14.04

Install and deploy the distributed monitoring system Zabbix 2.06

Install and deploy the distributed monitoring system Zabbix 2.06

Install and deploy Zabbix in CentOS 6.3

Zabbix distributed monitoring system practice

Under CentOS 6.3, Zabbix monitors apache server-status

Monitoring MySQL database Parameters Using Zabbix in CentOS 6.3

Install Zabbix 2.0.6 in 64-bit CentOS 6.2

ZABBIX details: click here
ZABBIX: click here

This article permanently updates the link address:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.