HA Server Setup
Environment Credentials
- Database Name:
zabbix - Database Username:
zabbix - Database Password:
sp!cyowl42 - Zabbix Username:
Admin - Zabbix Password:
zabbix
Zabbix Database Setup
- Login as root and ensure system is up to date before starting the setup.
- Add Zabbix repository
- Install MySQL server and Zabbix scripts.
- Secure MySQL server deployment by setting up password validate component, password validation policy, removing anonymous users, disabling remote root login and removing test databases.
- Login to mysql-server. Hit enter when asked for a password.
- Create initial database for Zabbix with users fo localhost, zabbix servers and with password as
sp!cyowl42.MySQLcreate database zabbix character set utf8mb4 collate utf8mb4_bin; create user zabbix@localhost identified by 'sp!cyowl42'; grant all privileges on zabbix.* to zabbix@localhost; create user zabbix@zbsrv1.aadya.tech identified by 'sp!cyowl42'; grant all privileges on zabbix.* to zabbix@zbsrv1.aadya.tech; create user zabbix@zbsrv2.aadya.tech identified by 'sp!cyowl42'; grant all privileges on zabbix.* to zabbix@zbsrv1.aadya.tech; set global log_bin_trust_function_creators = 1; quit; - Use
zabbix@localhostuser created in the previous step to import schemas for the database that's just created. Use the same password as used before. - Login to mysql-server as root and disable log_bin_trust_function_creators option after importing database schema.
- Enable mysql to be accessible on all interfaces and restart mysql-server
Zabbix Server Setup
- On both the systems login as root and ensure system is up to date before starting the setup.
- Fix locale
- Add Zabbix repository.
- Install Zabbix server, frontend, agent2.
- Configure the database for Zabbix server and enable reporting by editing
/etc/zabbix/zabbix_server.conf- DBHost=zbdb.aadya.tech
- DBPassword=sp!cyowl42
- StartReportWriters=3
- WebServiceURL=http://localhost:10053/report
- HANodeName=zbsrv1
- NodeAddress=zbsrv1.aadya.tech
- Enable nginx to load zabbix-server
- Restart and enable autostart for Zabbix server and agent processes.
- Repeat steps 1-7 on zbsrv2, but with
HANodeName=zbsrv2andNodeAddress=zbsrv2.aadya.techin/etc/zabbix/zabbix_server.conf - Open Zabbix UI web page at default http://zbsrv1.aadya.tech and go through initial configuration.
- Database type: MySQL
- Database host: zbdb.aadya.tech
- Database port: 0
- Database name: zabbix
- User: zabbix
- Password: sp!cyowl42
- Zabbix server name: Aadya Monitoring
- Default time zone: (UTC-04:00) America/New_York
- This generates Zabbix web configuration on zbsrv1. Either repeat step 9 or copy
/etc/zabbix/web/zabbix.conf.phpfrom zbsrv1 to zbsrv2.
Fine Tuning
More than 75% used in the configuration cache
On every Zabbix server and proxy, there is a shared memory for storing host, item, and trigger data. As you add more hosts, items, and triggers to your server, you’ll eventually have to increase the size of this memory so that you won’t face any problems with your server’s performance.
If you get the alert Zabbix server: More than 75% used in the configuration cache. then update CacheSize from the default value of 32M to higher value and then restart zabbix-server.
More than 75% used in the trends cache
In Zabbix, “trends” are a type of data storage representing aggregated historical data. Zabbix monitors and collects a vast amount of data from various sources, which can quickly become large and cumbersome to manage and analyze. To efficiently handle this, Zabbix uses two primary types of historical data storage: History and Trends.
The primary purpose of Trends is to reduce storage requirements and improve the performance of long-term data analysis and visualization. By storing trends, Zabbix allows users to maintain historical performance and status information over extended periods (months or even years) without overwhelming the database with detailed history records.
The message Zabbix server: More than 75% used in the trends cache from your Zabbix monitoring system indicates that the trends cache size is nearing or exceeding its configured maximum limit, which can impact performance.
This issue arises when the trends cache, which stores trend data before it is written to the database, fills up due to high data input rates or insufficient flushing.
Update the default value of 16M to 32M and then restart zabbix-server.
Value cache is fully used: Please increase ValueCacheSize configuration parameter
To make the calculation of trigger expressions, calculated items and some macros much faster, a value cache option is supported by the Zabbix server.
This in-memory cache can be used for accessing historical data, instead of making direct SQL calls to the database. If historical values are not present in the cache, the missing values are requested from the database and the cache updated accordingly. Update the default value of 8M to higher value and then restart zabbix-server.