Deployment in the production environment: zabbix3.2.1 (Ubuntu system)

Source: Internet
Author: User
Tags file copy gz file mysql client snmp

First, the configuration

Role

Ip

Host Name

Virtual IP

Z Abbixserver primary node

10.36.1.55

Compute51

10.36.1.101

" /td>

Z Abbixserver from node

10.36.1.56

Compute52

M Ysql Database Master node

10.36.1.1

Controller1

10.36.1.100  

MySQL Database from node

10.36.1.17

Controller2


Second, installation

This deployment is entirely a reference to the official Zabbix documentation

Https://www.zabbix.com/documentation/3.0/manual/installation/install_from_packages



First, MySQL database preparation
In my production environment, there is already a set of MySQL highly available environments here, I just need to create the libraries required for Zabbix
1. Create a Zabbix database
shell> Mysql-uroot-p<your Root password>
Mysql> CREATE database Zabbix character set UTF8 collate utf8_bin;
Mysql> Grant all privileges the zabbix.* to [e-mail protected] identified by ' Zabbix ';
Mysql> Flush Privileges
Mysql> quit;
Description: 10.36.1.100 is the VIP address of the Access database (that is, virtual IP, do not understand the VIP member ha)



Second, back to the installation of Zabbix server
1. Download zabbix_3.2.1.orig.tar.gz
Download Link: http://repo.zabbix.com/zabbix/3.2/ubuntu/pool/main/z/zabbix/zabbix_3.2.1.orig.tar.gz

2. Decompression
TAR-ZXVF zabbix-3.2.0.tar.gz

3. Create a general account: Zabbix for running Zabbix service
Groupadd Zabbix
Useradd-g Zabbix Zabbix

4. Create a Zabbix database
Just now, a database has been created with the name Zabbix.
4.1, the beginning of the problem of egg pain came, I said test with Zabbix This account login database unexpectedly prompt no permission
Workaround:
Prior to our authorization, we were executed:
Grant all privileges the zabbix.* to [e-mail protected] identified by ' Zabbix ';
Below, I log into the database with root and execute:
Grant all privileges the zabbix.* to [e-mail protected] identified by ' Zabbix ';
Flush Privileges
Try logging in again:
Mysql-uzabbix-pzabbix
You can log in. OK, that's it first, we'll come back to that later.

4.2, OK, then go down, import Zabbix data into the Zabbix database
The zabbix-3.2.1.tar.gz file SCP is first issued to the database server/root/directory, and then extracted
SCP zabbix-3.2.1.tar.gz [Email protected]:/root (The IP of my database master node is 10.36.1.1)

Then enter the directory to extract the zabbix-3.2.1.tar.gz/root/zabbix-3.2.1/database/mysql
[Email protected]:~/zabbix-3.2.1/database/mysql# pwd
/root/zabbix-3.2.1/database/mysql
[Email protected]:~/zabbix-3.2.1/database/mysql# ls-l
Total 3064
-rw-r--r--1 Zabbix Zabbix 1032494 Sep 17:47 data.sql
-rw-r--r--1 Zabbix Zabbix 1978341 Sep 17:43 images.sql
-rw-r--r--1 Zabbix Zabbix 122134 Sep 17:47 schema.sql
Did you see 3 files? Don't worry about what to do first, import it again!
Remember: note the import order Schema-->images-->data
Mysql-uzabbix-pzabbix Zabbix < Schema.sql
Mysql-uzabbix-pzabbix Zabbix < Images.sql
Mysql-uzabbix-pzabbix Zabbix < Data.sql

After the import is completed, log in to the database to see if the Zabbix Library has data
Mysql-uzabbix-pzabbix
Use Zabbix
Show tables;
Niubi Actually have, then I can not here ha!!



5. Start configuration source below
Configuring Zabbix Server and Agent
./configure--enable-server--enable-agent--with-mysql--with-libcurl--with-libxml2
This configuration, I will follow the official, I do not need too much functionality, basically so!

Sad, the configuration will check the environment, but there are many dependent packages are not installed, then install the relevant dependency package
Apt-get Update
Apt-get-y Install make
Apt-get-y Install GCC
Apt-get-y Install Libghc-hsql-mysql-dev
Apt-get Install libmysqlclient18
Apt-get-y Install Libxml2-dev
Apt-get Install Libcurl3-dev
Apt-get Install Libsnmp-dev

What are some of the options in configure? Let's see Help!!
./configure--help
--enable-ipv6 Turn on support of IPV6
--enable-server Turn on build of Zabbix server
--enable-agent Turn on build of Zabbix agent and client utilities
--WITH-MYSQL[=ARG] Use MySQL client library [Default=no], optionally
Specify path to Mysql_config
If you want to use NET-SNMP library:
--WITH-NET-SNMP[=ARG] Use NET-SNMP package [Default=no], optionally
Specify path to Net-snmp-config
If you want to use XML library:
--WITH-LIBXML2[=ARG] Use LIBXML2 client library [Default=no], optionally
Specify path to Xml2-config
If you want to use the CURL library:
--with-libcurl[=dir] Use CURL package [Default=no], optionally specify
Path to Curl-config


6. Start compiling the installation below
Make install

After the installation is complete, the default installation daemon's binary file path is: (/usr/local/sbin zabbix_server,zabbix_agentd Zabbix_proxy)
Client in/usr/local/bin/binary (zabbix_get zabbix_sender)

Of course, this is the default, you can use--prefix to specify the installation directory when configure

7. Check the existence of each configuration file after installation is complete.
/usr/local/etc/zabbix_agentd.conf Client Files
/usr/local/etc/zabbix_server.conf Server file


8. Edit the zabbix_server.conf configuration file below to specify the database
# vim/usr/local/etc/zabbix_server.conf
dbhost=10.36.1.100 #我这里用的是独立数据库
Dbname=zabbix
Dbuser=zabbix
Dbpassword=zabbix

9. Continue, install Zabbix Web interface below
PHP file copy
The Zabbix frontend is written in PHP, so it needs a PHP support network server to run. Installation is done by simply copying the PHP files from the Web server to the front-end/php HTML document directory.
The common HTML document directory locations for Apache Web servers include:
/usr/local/apache2/htdocs (default directory when Apache is installed)
/srv/www/htdocs (OpenSUSE, SLES)
/var/www/html (Fedora, RHEL, CentOS)
/var/www (Debian, Ubuntu)

9.1, install apache2, and copy php files (php files in the extracted zabbix-3.2.1 directory)
Apt-get-y-install apache2
CD var/www/html
mkdir Zabbix #创建一个目录
Chown Zabbix:zabbix zabbix/#将这个目录的
Cp-r/root/zabbix-3.2.1/frontends/php/*/var/www/html/zabbix

9.2. Install PHP5 and configure Zabbix front-end PHP
Apt-get Install PHP5
Apt-get Install PHP5-GD
Apt-get Install Php5-mysql
Vim/etc/php5/apache2/php.ini

The following configuration entries for subsequent modifications to the PHP.ini configuration file are opened:
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 (date.timezone = Asia/shanghai #去掉 ";", add Asia/shanghai)
The reason to configure the content in PHP.ini is to ensure that all software prerequisites are met.


10. Start installing the front end below
Open http://10.36.1.55/zabbix/setup.php via Firefox browser
10.1, come in will see zabbix3.2 welcome interface
Direct Click Netx Step
10.2. Then go to check the prerequisites interface and make sure that all software prerequisites are met and choose next to continue.
10.3, then came to the database configuration
I'm using a standalone database, and it's a set of MySQL high availability.
Do you remember executing this order before? Grant all privileges the zabbix.* to [e-mail protected] identified by ' Zabbix ';
So now go into the two databases and execute the following commands separately:
Grant all privileges the zabbix.* to [e-mail protected] identified by ' Zabbix ';
Flush privileges;

10.4. Start configuring Database information below
Databases host 10.36.1.100 (VIP)
Port 3306
Database Name:zabbix
User:zabbix
Password:zabbix

It's basically done.

This article is from the "Fa&it-Q Group: 223843163" blog, please be sure to keep this source http://freshair.blog.51cto.com/8272891/1880671

Deployment in the production environment: zabbix3.2.1 (Ubuntu system)

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.