How to actually set up MariaDB replication/high availability

I’m setting up a high availability LAMP stack – so far, I have two servers with HAProxy running on both their frontends that own a floating IP. HAProxy redirects requests to backend Apache servers running on each of them (same machine, port 8000).

This all works, and I’m happy with this so far for high availability. I have yet to deal with the databases yet however.

Since I only have two servers, I don’t think I can do master-master like Galera cluster due to the requirement of quorum. So, I planned to do master-slave read only replication.

Most of the guides I see online don’t mention the MaxScale proxy that MariaDB suggests in its high availability guide (page 4 for example)

I’m just really confused overall on what to do and how to set it up?

From my perspective, I’d like to set up a MaxScale proxy on one of my servers and run MariaDB on both servers; MaxScale will handle things like redirects. How can I actually accomplish what I’m looking for?

Go to Source
Author: forkwasher

Why are CASE-expressions in the list documenting operator precedence?

In the list here:

https://mariadb.com/kb/en/operator-precedence/

case-expressions are put at the same precedence level as BETWEEN, between the NOT operator and the comparison operators.

However, case-expressions always begin with CASE and end with END, and all subexpressions are also delimited by the CASE keywords. They’re like parenthetical expressions, so I don’t understand why case-expressions are on this list.

Is there an SQL expression that would be parsed differently if the case-expression precedence was set higher or lower?

Go to Source
Author: JoL

Have Ubuntu 20 VPS on ex. index.php, but it’s 404 site

I am trying to remove all of this sql and then start again on mariadb, but it still sais warning and errors:

sudo apt remove mysql-server mysql-client mariadb-server mariadb-client
sudo apt auroremove mysql-server mysql-client mariadb-server mariadb-client
sudo apt purge mysql-server mysql-client mariadb-server mariadb-client
sudo apt update
sudo apt upgrade

There are full of errors here. See the four pictures (remove, auroremove, purge and upgrade): https://ibb.co/r6zcTDf, https://ibb.co/Xk7pPLk, https://ibb.co/KhLxPpw and https://ibb.co/khdgmJr.

commando:
/var/www/html/test.com/index.php //<?php phpinfo();

website https://test.com/index.php:
404 Not Found
nginx/1.18.0 (Ubuntu)

/var/log/mysql/error.log

[System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.20-0ubuntu0.20.04.1)  (Ubuntu).
[System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.20-0ubuntu0.20.04.1) starting as process 28629
[System] [MY-011012] [Server] Starting upgrade of data directory.
[System] [MY-013576] [InnoDB] InnoDB initialization has started.
[ERROR] [MY-012936] [InnoDB] Database upgrade cannot be accomplished with innodb_force_recovery > 0
[ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error.
[ERROR] [MY-011013] [Server] Failed to initialize DD Storage Engine.
[ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
[ERROR] [MY-010119] [Server] Aborting
[System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.20-0ubuntu0.20.04.1)  (Ubuntu).

I have innodb_force_recovery = 1 on /etc/mysql/mysql.conf.d/mysqld.cnf, but that didn’t help me.

Can you help me?

Go to Source
Author: Oldie