|
| 1 | +--- |
| 2 | +slug: Zabbix |
| 3 | +title: 'Zabbix and OceanBase Database Completed Product Compatibility and Mutual Certification' |
| 4 | +--- |
| 5 | + |
| 6 | +# Zabbix and OceanBase Database Completed Product Compatibility and Mutual Certification |
| 7 | + |
| 8 | +1 Introduction to Zabbix |
| 9 | +======== |
| 10 | + |
| 11 | +Zabbix is an enterprise-grade, open source monitoring solution that provides comprehensive monitoring across the IT infrastructure, from hardware devices, operating systems, and cloud services to business applications. The Zabbix project started in 1998 and has over 20 years of service experience. It is currently widely used by large enterprises in sectors such as finance, telecommunications, manufacturing, education, and retail. |
| 12 | + |
| 13 | +2 Zabbix & OceanBase Database |
| 14 | +================== |
| 15 | + |
| 16 | +Zabbix supports OceanBase Database as a backend database for the storage of configuration and historical data, demonstrating superior performance compared to MySQL. |
| 17 | + |
| 18 | +The following figure shows the simplified system topology of Zabbix. |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | +Both Zabbix server and Zabbix frontend exchange data with the database. |
| 23 | + |
| 24 | +Zabbix server: the primary Zabbix application responsible for data collection, problem diagnostics, and alert dispatch. Zabbix server retrieves all configuration data and some historical/trend data from the database, and writes all collected historical data, generated trend data, event information, and alert information to the database. |
| 25 | + |
| 26 | +Zabbix frontend: the frontend that provides a unified interface for viewing and managing configurations. All historical data, trends, events, and alerts are retrieved from the database. |
| 27 | + |
| 28 | +3 Zabbix Deployment and Installation (CentOS 8) |
| 29 | +==================== |
| 30 | + |
| 31 | +3.1 Install OceanBase Database Community Edition |
| 32 | +---------------- |
| 33 | + |
| 34 | +### 3.1.1 Install OceanBase Database |
| 35 | +``` |
| 36 | + cd /opt/ |
| 37 | + wget https://obbusiness-private.oss-cn-shanghai.aliyuncs.com/download-center/opensource/oceanbase-all-in-one/7/x86_64/oceanbase-all-in-one-4.2.1.0-100120231013145059.el7.x86_64.tar.gz |
| 38 | + tar -xf oceanbase-all-in-one-4.2.1.0-100120231013145059.el7.x86_64.tar.gz |
| 39 | + cd oceanbase-all-in-one |
| 40 | + bin/install.sh |
| 41 | + source ~/.oceanbase-all-in-one/bin/env.sh |
| 42 | +``` |
| 43 | + |
| 44 | +### 3.1.2 Start the service |
| 45 | + |
| 46 | +Run the following command to start the service: |
| 47 | +``` |
| 48 | + obd demo |
| 49 | +``` |
| 50 | + |
| 51 | +To stop the service or delete the cluster, run the following commands: |
| 52 | +``` |
| 53 | + obd cluster stop demo |
| 54 | + obd cluster destroy demo |
| 55 | +``` |
| 56 | + |
| 57 | +3.2 Compile and install Zabbix server |
| 58 | +------------------- |
| 59 | + |
| 60 | +### 3.2.1 Install dependencies |
| 61 | +``` |
| 62 | + dnf install -y git |
| 63 | + dnf install -y automake autoconf |
| 64 | + dnf install -y gcc net-snmp-devel libxml2-devel unixODBC-devel libcurl-devel openssl-devel openldap-devel libevent-devel pcre-devel libssh2-devel OpenIPMI-devel |
| 65 | + dnf install -y java-11-openjdk java-11-openjdk-devel |
| 66 | + dnf localinstall -y mysql-community-{client,common,libs,devel}* |
| 67 | +``` |
| 68 | + |
| 69 | +### 3.2.2 Install Zabbix server |
| 70 | +``` |
| 71 | + mkdir -p /var/www/html && cd /var/www/html |
| 72 | + git clone -b release/6.0 --single-branch --depth=1 https://git.zabbix.com/scm/zbx/zabbix.git 6.0 |
| 73 | + cd /var/www/html/6.0 |
| 74 | + ./bootstrap.sh |
| 75 | + ./configure --prefix=$(pwd) --enable-server --enable-agent --with-mysql=/usr/bin/mysql_config --enable-java --enable-ipv6 --with-libcurl --with-libxml2 --with-openipmi --with-net-snmp --with-ssh2 --with-unixodbc --with-openssl --with-ldap |
| 76 | + make && make install |
| 77 | + make dbschema |
| 78 | +``` |
| 79 | + |
| 80 | +### 3.2.3 Create a tenant and import data |
| 81 | +``` |
| 82 | + obd cluster tenant create demo -n obmysql --max-cpu=4 --memory-size=10G --log-disk-size=4G --max-iops=9223372036854775807 --iops-weight=2 --unit-num=1 --charset=utf8 -s 'ob_tcp_invited_nodes="%"' |
| 83 | + |
| 84 | + obclient -P2881 -uroot@obmysql -h127.0.0.1 |
| 85 | + > create user zabbix@'%' identified by 'xxxxxxxxxx'; |
| 86 | + > create database zabbix character set utf8mb4 collate utf8mb4_bin; |
| 87 | + > grant all on zabbix.* to zabbix@'%'; |
| 88 | + > use zabbix |
| 89 | + > source /var/www/html/6.0/database/mysql/schema.sql; |
| 90 | + > source /var/www/html/6.0/database/mysql/images.sql; |
| 91 | + > source /var/www/html/6.0/database/mysql/data.sql; |
| 92 | +``` |
| 93 | + |
| 94 | +### 3.2.4 Start the service |
| 95 | + |
| 96 | +Modify the configuration file `zabbix_server.conf` of Zabbix server in the `/var/www/html/6.0/etc` directory. Modify the `DBHost`, `DBName`, `DBUser`, `DBPassword`, and `DBPort` parameters to reflect the OceanBase Database connection information. In addition, pay attention to other parameters related to internal processes, data collection processes, and cache configuration. Finally, start Zabbix server. |
| 97 | +``` |
| 98 | + /var/www/html/6.0/sbin/zabbix_server |
| 99 | +``` |
| 100 | + |
| 101 | + |
| 102 | + |
| 103 | +3.3 Install Zabbix frontend |
| 104 | +------ |
| 105 | + |
| 106 | +Install NGINX and PHP. The minimum PHP version is 7.2.5. We recommend that you install PHP 7.4 or later. |
| 107 | + |
| 108 | +Enter http://xx.xx.xx.xx/ui in your browser, and then follow the wizard to fill in the OceanBase Database connection information. |
| 109 | + |
| 110 | +4 Demonstration |
| 111 | +==== |
| 112 | + |
| 113 | +After you log in to Zabbix, the homepage appears. The left side of the page displays the navigation pane, while the right side shows the main window, also known as the Dashboard. |
| 114 | + |
| 115 | + |
| 116 | + |
| 117 | +Testing can be performed by using the built-in PHP test file in the Zabbix Git repository. |
| 118 | + |
| 119 | + |
0 commit comments