Posts Tagged Zabbix

Zabbix practices

Some useful informations about Zabbix server in production.

1. Zabbix server summary:
Hosts: 2,000+
Items: 170,000+ (After disabled 50% non-important items from 300,000+ items)
Zabbix Server: 1
Zabbix Proxy: 3 (For other 3 data centers, total backend hosts < 500)
MySQL Data size: 200G(with TokuDB engine and keep history data in 30 days)
MySQL QPS: 10,000~15,000

2. Zabbix server hardware:
CPU: Intel(R) Xeon(R) CPU E5-2620 0 @ 2.00GHz * 24 Cores
Memory: 64G RAM
Hard drives: 300G SAS*2(for OS)
Data drives: Shannon Direct-IO SSD G2(for MySQL)

3. Zabbix Server optimization:
MySQL: Percona TokuDB engine + Split big tables about history data
Items: Over 95% items are active/trapper

No Comments

How to upgrade Zabbix from 1.8.x to 2.0.x

http://www.zabbix.com/documentation/2.0/manual/installation/upgrade_notes
http://www.zabbix.com/documentation/2.0/manual/installation/upgrade?s[]=upgrade

Upgraded from 1.8.2 to 2.0.2.

1. Stop Zabbix server
$ su – zabbix
$ sudo /etc/init.d/zabbix_server stop

2. Back up the existing Zabbix database
$ mkdir -p /home/zabbix/zabbix_upgrade/backup
$ cd /home/zabbix/zabbix_upgrade/backup
$ mysqldump -uroot -pzabbixadmin zabbix > zabbix.backup.sql

3. Back up configuration files, PHP files and zabbix binaries
$ cp -rp /etc/zabbix .
$ cp -rp /home/zabbix/public_html .
$ cp -rp /etc/init.d/zabbix-* .
$ cp -rp /usr/sbin/zabbix* .
$ cp -rp /usr/bin/zabbix* .

4. Install new server binaries
Download zabbix-2.0.2.tar.gz from website.
$ cd /home/zabbix/zabbix_upgrade/
$ tar xzvf zabbix-2.0.2.tar.gz
$ cd zabbix-2.0.2
$ ./configure –prefix=/usr –with-mysql –with-net-snmp –with-libcurl –enable-server –enable-agent
$ make
$ sudo make install
$ sudo zabbix_server –help
Zabbix server v2.0.2 (revision 29214) …

5. Review server configuration parameters
$ cd /usr/etc/
$ sudo cp -rp /home/zabbix/zabbix_upgrade/backup/zabbix/zabbix_* .

6. Upgrade the database
Clean the history data:
$date +%s -d “2012/9/1 00:00:00”
1346428800

mysql> DELETE FROM `history_uint` WHERE `clock` < 1346428800; mysql> optimize table history_uint;

mysql> DELETE FROM `history` WHERE `clock` < 1346428800; mysql> optimize table history;

$ cd /home/zabbix/zabbix_upgrade/zabbix-2.0.2/upgrades/dbpatches/2.0/mysql
$ mysql -uroot -p123456 zabbix < patch.sql 7. Install new Zabbix web interface $ cd /home/zabbix/zabbix_upgrade/ $ sudo mv /home/zabbix/public_html /home/zabbix/public_html_bak $ sudo mkdir /home/zabbix/public_html $ sudo chown -R zabbix:zabbix /home/zabbix/public_html $ cp -r zabbix-2.0.2/frontends/php/* /home/zabbix/public_html/ 8. Start new Zabbix binaries $ /etc/init.d/zabbix-server start $ ps aux | grep zabbix_server Open the webpage http://IP/zabbix/ Then follow the steps to setup the Zabbix WebUI. Download the zabbix.conf.php and put it into /home/zabbix/public_html/conf/ Restart Zabbix server $ /etc/init.d/zabbix-server stop $ /etc/init.d/zabbix-server start 9. Upgrade Zabbix agent clients We don't have to upgrade all Zabbix agent clients, but we'd better to do it if we can. Download zabbix-2.0.2.tar.gz from website. $ sudo /etc/init.d/zabbix_agentd stop $ mkdir -p /home/zabbix/zabbix_upgrade/backup $ cd /home/zabbix/zabbix_upgrade/backup $ cp -rp /etc/zabbix . $ cp -rp /etc/init.d/zabbix-* . $ cp -rp /usr/sbin/zabbix* . $ cp -rp /usr/bin/zabbix* . $ cd /home/zabbix/zabbix_upgrade/ $ tar xzvf zabbix-2.0.2.tar.gz $ cd zabbix-2.0.2 $ ./configure --prefix=/usr --with-net-snmp --with-libcurl --enable-agent $ make $ sudo make install $ cd /usr/etc/ $ sudo cp -rp /home/zabbix/zabbix_upgrade/backup/zabbix/zabbix_* . $ sudo zabbix_agent --help Zabbix agent v2.0.2 (revision 29214) ... $ sudo /etc/init.d/zabbix_agentd start 10. Done 11. Something we should pay attention Configuration files location changed: /etc/zabbix → /usr/etc But except the /etc/zabbix/alert.d/. {IPADDRESS} macro deprecated, use {HOST.IP}

5 Comments

Fork me on GitHub