usmannasir / cyberpanel

Cyber Panel - The hosting control panel for OpenLiteSpeed
GNU General Public License v3.0
1.58k stars 611 forks source link

[FIX] Support MariaDB >10.3 on AlmaLinux 8/Rocky Linux/CentOS 8 with dovecot23-mysql #967

Open hifihedgehog opened 2 years ago

hifihedgehog commented 2 years ago

Over the weekend, I migrated my server environment to AlmaLinux 8 and I instantly and regrettably discovered that MariaDB 10.3 was only supported out of the box with CyberPanel. I no sooner found the roadblock and reasoning: package conflicts. As a temporary fix for upgrading to MariaDB 10.6, I (1) uninstalled dovecot23-mysql and its associated dependency packages, (2) then upgraded to MariaDB 10.6, (3) reinstalled dovecot23-mysql's dependencies specifically using rpm with the infamous --nodep for mysql-common that provides libmysqlclient.so.21, and (4) finally installed dovecot23-mysql.

--nodep, of course, is treacherous waters if you don't know exactly where the potential conflicts may be. Thankfully, the only folder that MariaDB and the mysql-common dependency "looks" at it is /usr/share/mysql/charsets as noted here: https://jira.mariadb.org/browse/MDEV-24677?focusedCommentId=181500&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-181500

In my research, I found that there is a permanent fix around this: rebuilding the dovecot23-mysql package so the dependency packages come from MariaDB instead of MySQL. Historically, MariaDB team has reached out and the Ghettoforge has obliged doing precisely this. They built a custom package of postfix-mysql that instead uses MariaDB's libraries under their gf-testing repository as noted here: https://jira.mariadb.org/browse/MDEV-24862?focusedCommentId=180124&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-180124

So @usmannasir, I have been in talks with the MariaDB guys and there hopefully should be a fix coming down the pipeline in the form of a custom package of dovecot23-mysql on Ghettoforge to support MariaDB versions greater than 10.3. You may need to point the repo to gf-testing instead (as was the case with postfix-mysql in the previous example) when installing dovecot23-mysql.

You can follow my public ticket with MariaDB in their Jira issue tracker at the link here below: https://jira.mariadb.org/browse/MDEV-29531?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aall-tabpanel

usmannasir commented 2 years ago

OK. By the way it still says Resolution:Unresolved

We will be adding support for Alma 9 too, their default is which version?

usmannasir commented 2 years ago

I am working on Ubuntu 22 and its default is Server version: 10.6.7

hifihedgehog commented 2 years ago

We will be adding support for Alma 9 too, their default is which version?

Offhand, I don't know. I am on AlmaLinux 8. But it would appear to be MariaDB 10.5.

I am working on Ubuntu 22 and its default is Server version: 10.6.7

That's interesting. A lot of web server operators prefer the CentOS track due to the kernel stability. As well, the latest Linux kernels have seen some steep drops in performance. Ubuntu, being avantgarde, uses the newer kernels that are most susceptible to this performance degradation, especially in database operations. See here. AlmaLinux 8 is on the older kernel and so runs noticeably faster in my testing.

OK. By the way it still says Resolution:Unresolved

Correct. I already reached out to the Ghettoforge mailing list (users@lists.ghettoforge.org) and this was their response:

I'll look into this, I should be able to make a similar change as I did for postfix.

Peter

hifihedgehog commented 2 years ago

OK. By the way it still says Resolution:Unresolved

We will be adding support for Alma 9 too, their default is which version?

Just spoke yesterday with Peter...

Thank you again for providing this valuable support to the FOSS community. I had reached out about two weeks ago expressing interest in a dovecot23-mysql package with its dependencies instead coming from libmariadb. I am seeing significant interest from LiteSpeed's CyberPanel developer about this. He was curious about when this package might be made available since this would be absolutely essential for them to bring support for AlmaLinux 9, which uses MariaDB 10.5 as its default version.

I've now built the dovecot23 packages against mariadb for EL8 and 9. Both are in the gf-testing repos for now. Please let me know how they work out and I'll then move them to -plus.

Peter

.... and he pushed new dovecot23-mysql packages for EL8 and EL9 in the gf-testing repo. I have used the new EL8 package from gf-testing and it works perfectly with AlmaLinux 8, using MariaDB dependencies as expected. Peter will be adding these updated packages to gf-plus soon. I will comment again once he has effected the changes.

usmannasir commented 2 years ago

Can you list out your exact procedure you followed to upgrade and then install the dovecot package.

usmannasir commented 2 years ago

So far in an effort to do this

Total                                                                                 31 MB/s |  59 MB     00:01     
MariaDB                                                                               87 kB/s | 8.2 kB     00:00    
Importing GPG key 0x1BB943DB:
 Userid     : "MariaDB Package Signing Key <package-signing-key@mariadb.org>"
 Fingerprint: 1993 69E5 404B D5FC 7D2F E43B CBCB 082A 1BB9 43DB
 From       : https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'dnf clean packages'.
Error: Transaction test error:
  file /etc/my.cnf from install of MariaDB-common-10.6.10-1.el8.x86_64 conflicts with file from package mariadb-connector-c-config-3.1.11-2.el8_3.noarch
hifihedgehog commented 2 years ago

You may need to first uninstall some of the MariaDB support dependencies that come with MariaDB 10.3 via CentOS's stock repo.