[ZBX-18947] Diverse MySQL8 problems Created: 2021 Jan 30 Updated: 2025 Apr 08 |
|
Status: | Open |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Proxy (P), Server (S) |
Affects Version/s: | 5.2.4 |
Fix Version/s: | None |
Type: | Incident report | Priority: | Trivial |
Reporter: | jchegedus | Assignee: | Aleksandrs Petrovs-Gavrilovs |
Resolution: | Unresolved | Votes: | 1 |
Labels: | database | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified | ||
Environment: |
Debian 10.7 |
Attachments: |
![]() |
Description |
OK, that's quite "edgy" and I found quite a number of things, not sure if that should be split into multiple discussions, but here we are. I am making a test scenario to install a MySQL 8 Replication cluster and run a Zabbix Server / Proxy against it. This should all be based on Debian. The first thing to be noticed is that, I have a cluster separated, but while installing the zabbix-proxy-mysql in my test, he also installs a MariaDB along with the DEB package, which is quite forceful and in my opinion that should be avoided. Second issue, is that the DEB package for zabbix-proxy-mysql, doesn't have a schema to create the zabbix-proxy database. (the one that should be in /usr/share/zabbix-proxy-mysql*/something.gz) There is no schema files that I could find. So while trying to create the database according to the zabbix documentation I get: MySQL localhost:3306 ssl zabbix_proxy SQL > create database zabbix_proxy DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci; Query OK, 1 row affected, 2 warnings (0.0053 sec) Warning (code 3719): 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. Warning (code 3778): 'utf8_general_ci' is a collation of the deprecated character set UTF8MB3. Please consider using UTF8MB4 with an appropriate collation in stead. ( I found another ticket here https://support.zabbix.com/browse/ZBX-17207 which this command was really smooth ) I tried a few other variants but then anything really works, to I ignored the warning and tried to create the Tables like that. Then grabbing the schema.sql file from the source, when I try to create the database on MySQL8 cluster, I get: ERROR 3098 (HY000) at line 2022: The table does not comply with the requirements by an external plugin. From the whole file I found the error line is: INSERT INTO dbversion VALUES ('5020000','5020000'); Which is very odd. Then I remember reading Vittorio Cioe (MySQL Senior Consultant) which explains on the presentation: https://assets.zabbix.com/files/zabbix_summit_2019/Vittorio_Cioe-Scaling_Zabbix_with_MySQL_InnoDB_Cluster.pdf on page 25, line in RED – Primary key/unique non-null key is required on every table. Therefore, changing the creation on that dbversion table to: CREATE TABLE "dbversion" ( "mandatory" integer DEFAULT '0' NOT NULL, "optional" integer DEFAULT '0' NOT NULL, PRIMARY KEY (mandatory) ) ENGINE=InnoDB; So in resume:
|
Comments |
Comment by jchegedus [ 2021 Jan 30 ] |
I just realized later that I had installed a wrong DEB version (4.0.4) from another repo, THAT file didn't contain the schema.sql.gz |
Comment by jchegedus [ 2021 Jan 30 ] |
After loading the zabbix proxy properly it seems is a no go so far... I will try to evaluate what workarounds I can do tomorrow. 1027:20210130:181907.982 Zabbix supports only "utf8_bin" collation. Database "zabbix_proxy" has default collation "utf8_general_ci" 1027:20210130:181907.997 character set name or collation name that is not supported by Zabbix found in 442 column(s) of database "zabbix_proxy" 1027:20210130:181907.997 only character set "utf8" and collation "utf8_bin" should be used in database And also: 1040:20210130:181908.132 [Z3005] query failed: [3098] The table does not comply with the requirements by an external plugin. [delete from trigger_queue] |
Comment by jchegedus [ 2021 Jan 30 ] |
Humm, looks like I'm not the sharpest tool on the shed today :/ "utf8_general_ci" |
Comment by jchegedus [ 2021 Jan 30 ] |
Added patch file, fixing all the tables which had no Primary Key... like that is working, so far... tomorrow more tests. |
Comment by jchegedus [ 2021 Feb 01 ] |
Another development here. When trying to add the create.sql file for the server, I ran into the same problem: ERROR 3098 (HY000) at line xxxx: The table does not comply with the requirements by an external plugin. Then I went through the whole SQL file and fixed all the tables without PRIMARY KEY. When trying again, the same error, but from a different line, which made the mystery a bit deeper. The line in question is: INSERT INTO `users` (`userid`,`alias`,`name`,`surname`,`passwd`,`url`,`autologin`,`autologout`,`refresh`,`rows_per_page`,`roleid`) values ('1','Admin','Zabbix' ,'Administrator','$2y$10$92nDno4n0Zm7Ej7Jfsz8WukBfgSS/U0QkIuu8WkJPihXBb2A1UrEK','','1','0','30s','50','3'); Reading about some possible reasons, it looks like there is a relationship with this: https://dev.mysql.com/doc/refman/5.7/en/group-replication-options.html#sysvar_group_replication_enforce_update_everywhere_checks But I could not successfully test yet. Note this created an impossibility to run zabbix server on MySQL8 Group Replication, I wonder if there are other people doing it and how. To make it clear, I am trying with MySQL 8.0.23 |
Comment by jchegedus [ 2021 Feb 01 ] |
hummm it seems not ready. Or I am missing some configuration which I am unable to figure out at this moment. I see this on Zabbix Proxy log: 19894:20210201:122820.523 [Z3005] query failed: [3098] The table does not comply with the requirements by an external plugin. [delete from task where status in (3,4) and clock<=1612096100] And this on MySQL Error log: 2021-02-01T12:28:20.523822Z 192887 [ERROR] [MY-011543] [Repl] Plugin group_replication reported: 'Table task has a foreign key with 'CASCADE', 'SET NULL' or 'SET DEFAULT' clause. This is not compatible with Group Replication.' Looks like it is not compatible at this moment after all. At least with these versions combined. |
Comment by Aleksandrs Petrovs-Gavrilovs [ 2021 Feb 03 ] |
Hello, Sorry for a long waited reply. Indeed it's not directly compatible, but primary index can be added manually. If you need it - please for history* tables use alter table command like this: Best Regards, |
Comment by jchegedus [ 2021 Feb 05 ] |
Aleksandrs, yeah, I realize the complication with MySQL8 Group Replication thing... I did a number of tests and I got the server / proxy working, but only when there is no multiple R/W servers, it only works when there is one R/W and multiple R/O. |
Comment by KB Benton [ 2025 Apr 08 ] |
Related to https://support.zabbix.com/browse/ZBX-18043. I was going to file a feature request if I had not seen this and the other tickets. Zabbix HA would be a lot better if it would support MySQL Router and therefore, InnoDB Cluster both in single R/W node and multiple R/W nodes. Yes - it's true that because InnoDB uses a clustered index and that index is partitioned by either primary or unique key. From a performance standpoint, it's best to have a non-contextual primary key such as an auto_increment column. This keeps the lookups of rows faster because the size of the primary key is kept as small as reasonably possible.
|