一、Environment

OS:CentOS6.5 64bit 【桌面版安装】

Server端:192.168.201.109 ServerName

Clinet端:192.168.201.199 AgentName

iptables:关闭

selinux: disabled

Now let’s get started with the actual installation of Zabbix 3.0.4. First we will prepare database, then web server and once that is done

we will install Zabbix server, agent and web interface.

二、Prepare database

*升级MySQL非必选项

Before we even start with Zabbix we need to install a database for it. And here we will use the latest version of MySQL.
CentOS by default is supplied with a very old version of MySQL – 5.1. We can check that by running:

yum list installed | grep mysql

Expected output:

mysql-server.x86_64                5.1.71-1.el6

Although a basic installation of Zabbix can run on MySQL 5.1, it is highly recommended to use a more up-to-date version, which is 5.6 currently. Therefore we have to remove the old version first.

Please be aware of what you are doing. Never do this on a production system where existing MySQL instances might be running!

yum remove mysql*

Then we need to install the MySQL repository configuration package. We pick the right version for our CentOS 6 system from here: http://dev.mysql.com/downloads/repo/yum/

Install the repository.

rpm -ivh http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm

Retrieving http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm

Preparing...                ########################################### [100%]

1:mysql-community-release

########################################### [100%]

Install the MySQL server itself.

yum install mysql-server

If everything is correct then one of the outputs should install mysql-community-server along with 10 other dependencies. Double check that you are going to install MySQL version 5.6.x.

Installing:

mysql-community-server  x86_64   5.6.26-2.el6  mysql56-community      53 M

Read all questions you might be asked during the install but most likely you need to answer “yes” by pressing “y” key.

Before starting up the database we have to edit the MySQL configuration file but to open a file we need some text editor. Here you can use whichever you want, but in the tutorial we will be using vim, so here is how to install it.

yum install vim -y

*Configuration MySQL【必选项】

Open the MySQL configuration file with “vim” file editor. If you are new to vim then here is a quick tutorial on that.

vim /etc/my.cnf

This file consists of multiple sections. At this point we will not do much tuning and only add one setting under the [mysqld] section, which is important prior to creation of any database.


[mysqld]

innodb_file_per_table


Save and close the file.

Start the MySQL service.

service mysqld start

Starting mysqld:                 [  OK  ]

It is highly recommended to secure your database and specify a password for the “root” account, remove anonymous logins etc. It is done by following all instructions after the MySQL secure installation.

mysql_secure_installation

Enter current password for root (enter for none):

Set root password? [Y/n]

Remove anonymous users? [Y/n]

Disallow root login remotely? [Y/n]

Remove test database and access to it? [Y/n]

Reload privilege tables now? [Y/n]

Normally you should answer “Yes” to all these questions.

Log in to your MySQL instance with the password set in the previous step.

mysql -u root -p

Create a new database for Zabbix. It is very important to also specify the character set and collation otherwise the database will be case insensitive.

CREATE DATABASE zabbix CHARACTER SET utf8 COLLATE utf8_bin;

Create a database user, set password and grant privileges.

GRANT ALL PRIVILEGES ON zabbix.* TO zabbix@localhost IDENTIFIED BY 'your_password';

Just to be sure check that the database is created.

mysql> show databases;


+--------------------+

| Database           |

+--------------------+

| information_schema |

| mysql              |

| performance_schema |

| zabbix             |

+--------------------+

4 rows in set (0.00 sec)


If everything is fine then exit the database for now.

exit

三、Prepare web server

Beside a database we also need a web server therefore we will install Apache and PHP.

Zabbix 3.0 requires PHP to be at least version 5.4 or higher. Our CentOS 6.5 repositories come with PHP 5.3.3 therefore we need to install a newer one.

To do this we need a repository that contains all our required packages. Webtatic could be a good choice therefore we will install it.

*升级PHP为必选项

*配置webtatic源

[root@allserver ~]# rpm -ivh http://repo.webtatic.com/yum/el6/latest.rpm

*卸载旧版本php

[root@allserver ~]# yum erase php php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mcrypt php-mbstring php-devel php-pecl-memcached php-pecl-memcache  php-common php-pdo php-cli php-fpm libmemcached

*安装新版本php

[root@allserver ~]# yum install httpd php56w php56w-mysql php56w-gd php56w-imap php56w-ldap php56w-odbc php56w-pear php56w-xml php56w-xmlrpc php56w-mcrypt php56w-mbstring php56w-devel php56w-pecl-memcached  php56w-common php56w-pdo php56w-cli php56w-pecl-memcache php56w-bcmath php56w-fpm

如果出现如下错误:

Error: Package: php56w-mcrypt-5.6.24-1.w6.x86_64 (remote_repo)

Requires: libmcrypt.so.4()(64bit)

You could try using --skip-broken to work around the problem

You could try running: rpm -Va --nofiles –nodigest

则缺少libmcrypt-2.5.8-9.el6.x86_64.rpm,安装该rpm再执行安装php命令

*配置/etc/php.ini


post_max_size=16M

max_execution_time=300

max_input_time=300

date.timezone=Europe/Riga

always_populate_raw_post_data=-1


*启动web server

service httpd start

*CentOS6.5 curl默认版本为curl 7.19.7,【是否升级为可选项】

CURL升级为了SMTP Authentication,如果不升级则zabbix服务启动时:/var/log/zabbix/zabbix-server.log则显示:

39715:20160729:144131.510 SMTP authentication:        NO

*升级CURL

git clone https://github.com/zabbixcn/curl-rpm

cd curl-rpm/RPMS

yum install curl-7.29.0-25.el6.x86_64.rpm  libcurl-7.29.0-25.el6.x86_64.rpm  libcurl-devel-7.29.0-25.el6.x86_64.rpm

curl –V

curl 7.29.0

四、Download and install Zabbix 3.0.4

Now we are getting closer to Zabbix itself.

Step 1 – Add Account

Before installing Zabbix we need to ensure we have a user group and user account for it because Zabbix is not meant to be run under the “root” account.

groupadd zabbix

useradd -g zabbix zabbix

Step 2 – Add Required Repository

rpm –ivh http://repo.zabbix.com/zabbix/3.0/rhel/6/x86_64/zabbix-release-3.0-1.el6.noarch.rpm

Step 3 – Install Dependency Package

dejavu-sans-fonts为依赖包,dejavu-fonts-common为dejavu-sans-fonts的依赖包

rpm -ivh dejavu-fonts-common-2.33-1.el6.noarch.rpm

rpm -ivh dejavu-sans-fonts-2.33-1.el6.noarch.rpm

Step 3 – Install Zabbix Server

yum install zabbix-server-mysql

yum install zabbix-web-mysql

Step 4 – Initial Database

Import the database schema. Provide the password you set when creating the Zabbix user for database.

cd /usr/share/doc/zabbix-server-mysql-3.0.4/

[root@allserver zabbix-server-mysql-3.0.4]# zcat create.sql.gz | mysql -uroot -p123456 zabbix

Step 5 – Configure zabbix_server.conf

配置/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=123456

StartTrappers=5

StartPingers=1

StartDiscoverers=1

SNMPTrapperFile=/var/log/snmptrap/snmptrap.log

HousekeepingFrequency=1

Timeout=4

AlertScriptsPath=/usr/lib/zabbix/alertscripts

ExternalScripts=/usr/lib/zabbix/externalscripts

LogSlowQueries=3000


Step 6 – Configure Web Sources

Create a new directory for web frontend files.

mkdir /var/www/html/zabbix

Move web interface sources.

cd /usr/share/zabbix/

cp -a . /var/www/html/zabbix/

Set Apache user as owner of the web interface files.

chown -R apache:apache /var/www/html/zabbix

Step 7 – Start Services

Enable Zabbix server, Zabbix agent, Apache and MySQL services on boot.

chkconfig httpd on

chkconfig mysqld on

chkconfig zabbix-server on

chkconfig zabbix-agentd on

Start Zabbix server.

service zabbix-server start

五、Configure Zabbix With Browser

it is time to proceed to the frontend installation in your web browser.

Use the same address you have for your server now and add /zabbix to the URL

Check for pre-requisites and fix errors if you have any.

Enter settings to connect to database.

Enter details to connect to web interface.

The “Name” field can be left blank or you can enter a name that will appear on each page.

Review the last settings in the next page and if all is good your Zabbix should be able to automatically create configuration files.

Finish configuration

Connect to the Zabbix web interface with default credentials.

Username: Admin

Password: zabbix

And this is the new web interface.

Congratulations! You have installed the new Zabbix 3.0. Have fun! Don’t forget to check our documentation for 3.0. And stay tuned for next tutorials and articles where we will cover the main features of Zabbix 3.0 and do lots of useful configuration.

CentOS6.5上Zabbix3.0的RPM安装【一】-安装并配置Server的更多相关文章

  1. CentOS6.5上Zabbix3.0的RPM安装【三】-安装并添加Agent

    七.Download and install Zabbix Agent Zabbix Agent is required to install on all remote systems needs  ...

  2. CentOS6.5上Zabbix3.0的RPM安装【四】-乱码

    当Agent添加完成后,部分显示(如cpu负载)出现乱码情况: 解决步骤如下: 1, 在windows7中找一个自己喜欢的字体或者去网上下载一个字体.[以“楷体 常规”为例] 2, 右击”楷体 常规” ...

  3. CentOS6.5上Zabbix3.0的RPM安装【二】-汉化

    六.汉化 zabbix实际是有中文语言的,我们可以通过修改web端源文件来开启中文语言.首先点击zabbix监控页面右上角管理员头像进入“用户基本资料设置页面“. 选择中文语言. 点击“Update” ...

  4. centos6.5 搭建zabbix3.0

    一.搭建LAMP平台 注意zabbix3.0需要php5.4以上的版本 (1)安装依赖包 httpd和mysql安装过程省略 rpm -e httpd --nodeps yum -y install ...

  5. Win2008上.NET4.0部署出错HTTP 错误 500.21 - Internal Server Error的解决方法

    原因:在安装Framework v4.0之后,再启用IIS,导致Framework没有完全安装 解决:开始->所有程序->附件->鼠标右键点击“命令提示符”->以管理员身份运行 ...

  6. zabbix3.0安装部署文档

    zabbix v3.0安装部署 摘要: 本文的安装过程摘自http://www.ttlsa.com/以及http://b.lifec-inc.com ,和站长凉白开的<ZABBIX从入门到精通v ...

  7. PHP 5.5.38 + mysql 5.0.11 + zabbix3.0 + nginx 安装

    PHP 5.5.38 + mysql 5.0.11 + zabbix3.0 + nginx 1.首先在安装好环境下安装 zabbix3.0情况下 2. yum install mysql-devel ...

  8. Zabbix3.0学习笔记

    第1章 zabbix监控 1.1 为什么要监控 在需要的时刻,提前提醒我们服务器出问题了 当出问题之后,可以找到问题的根源   网站/服务器 的可用性 1.1.1 网站可用性 在软件系统的高可靠性(也 ...

  9. centos6.8上yum安装zabbix3.2

    centos6.8上yum安装zabbix3.2 zabbix3.2安装文档:https://www.zabbix.com/documentation/3.2/manual/installation/ ...

随机推荐

  1. MySQL最新版本 MySQL5.7.11 批量自动化一键式安装(转)

    --背景云端 以前都喜欢了源码安装MySQL,总觉得源码是高大上的事情,不过源码也需要时间,特别是make的时候,如果磁盘和cpu差的话,时间很长很长,在虚拟机上安装mysql尤其甚慢了. 现在业务发 ...

  2. 在Azure New Portal上创建基于ARM的带SLB的VM

    目前Azure的New Portal在国内已经上线了.本文将介绍最常见的一种场景:通过Azure的New Portal创建带有Server Load Balance的多台虚拟机. 1 创建Resour ...

  3. 【转】 Pro Android学习笔记(七八):服务(3):远程服务:AIDL文件

    目录(?)[-] 在AIDL中定义服务接口 根据AIDL文件自动生成接口代码 文章转载只能用于非商业性质,且不能带有虚拟货币.积分.注册等附加条件.转载须注明出处:http://blog.csdn.n ...

  4. L2-004. 这是二叉搜索树吗?(前序转后序递归)

    L2-004. 这是二叉搜索树吗? 时间限制 400 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 陈越 一棵二叉搜索树可被递归地定义为具有下列性质的 ...

  5. java restful response 万能类

    import java.util.HashMap; import java.util.Map; public class ResponseData { private final String mes ...

  6. 新手编译开发OpenWrt入门教程(自定义固件、ubuntu学习)

    转自:   http://www.znck007.com/forum.php?mod=viewthread&tid=21571 由于openwrt编译教程资料很多,不同的cpu芯片只需要选择对 ...

  7. I/O---读取txt文件----demo

    首先获得一个文件句柄.File file = new File(); file即为文件句柄. 读取甲方的信息:new FileInputStream(file) 目前这个信息已经读进来内存当中了.接下 ...

  8. CIA泄露资料分析(黑客工具&技术)—Windows篇

    背景 近期,维基解密曝光了一系列据称来自美国中央情报局(CIA)网络攻击活动的秘密文件,代号为“Vault 7”,被泄露文件的第一部分名为“Year Zero”,共有8761个文件,包含7818个网页 ...

  9. java反射专题二

    一丶Class中常用方法详解 1)getFields() 只能获取到运行时类中及其父类中声明为public的属性 2)getDeclaredFields() 获取运行时类本身声明的所有属性 3)get ...

  10. 使用pip一次升级所有安装的Python包(太牛了)

    import pip from subprocess import call for dist in pip.get_installed_distributions(): call("pip ...