Discussion:
[Gluster-users] MySQL on Gluster VMs
Kevin Lemonnier
2016-10-10 13:30:11 UTC
Permalink
Hi,

We have a few Proxmox clusters using GlusterFS as storage.
The nodes are both running the gluster brick and proxmox,
and one of the problems we have often is that when a server
crashes for some reason, the InnoDB of the VM that were
running on the VMs it hosted are dead. Most of the time
setting innodb_force_recovery is enough to fix it, but sometime
it isn't and we have to restart from scratch and import backups.

So my question is this : Does anyone had that problem, and if
yes how did you solve it ? Am I missing some critical piece of
configuration in MySQL or Gluster to prevent innodb from exploding
at the first crash ? I've forced reboot of plenty of physical machines
without any problems, so there is clearly something with gluster there.

I might be wrong, but I imagine that the problem is that MySQL writes,
but when the server crashes the two other nodes are still on an older
version of the files. I tried adding cache=directsync to the VMs,
hoping that would mean a write is successfull only when the 3 replicas
have completed it, but that doesn't really seem better.

We are considering having separate physical MySQL servers shared between
the different VMs, but that doesn't seem like an ideal sale speech :
"You can do whatever you want on the VM, but try to avoid MySQL, it crashes".
--
Kevin Lemonnier
PGP Fingerprint : 89A5 2283 04A0 E6E9 0111
Kevin Lemonnier
2016-10-12 11:39:28 UTC
Permalink
imho GlusterFS is not the best place for MySQL.
Maybe you want to consider using Galera Cluster with Maxscale.
No, the point isn't to replicate MySQL. It's to have highly available
VMs that happens to be running MySQL servers, but they aren't clustered,
they belong to different clients.

It's basically like a VPS service, with the clients running whatever
they want on their VMs, and 95% of the time that's a very classic LAMP.
--
Kevin Lemonnier
PGP Fingerprint : 89A5 2283 04A0 E6E9 0111
David Gossage
2016-10-12 12:45:28 UTC
Permalink
Post by Kevin Lemonnier
imho GlusterFS is not the best place for MySQL.
Maybe you want to consider using Galera Cluster with Maxscale.
No, the point isn't to replicate MySQL. It's to have highly available
VMs that happens to be running MySQL servers, but they aren't clustered,
they belong to different clients.
It's basically like a VPS service, with the clients running whatever
they want on their VMs, and 95% of the time that's a very classic LAMP.
Hmm I have 3-4 VM's running mysql or maria on them and haven't had any
issues with them crashing from it. Maybe they aren't heavily used enough
yet. Obviously it's an issue if a VM does crash and mysql does not cleanly
handle the sudden shutdown as well as a physical server would, but do you
know why you are having stability issues to begin with in the VM's? Unless
my gluster storage was having some bug issue and oVirt paused my VM's on me
I haven't had any VM's crash on oVirt or RHEV using gluster storage under
3.6/3.7/3.8. Worse I have ever had I think was occasional weirdness post
live migrate from one host to another while I was doing some heavy task on
one of the hosts, but I think that has more to do with the behavior of live
migration that gluster.
Post by Kevin Lemonnier
--
Kevin Lemonnier
PGP Fingerprint : 89A5 2283 04A0 E6E9 0111
_______________________________________________
Gluster-users mailing list
http://www.gluster.org/mailman/listinfo/gluster-users
Kevin Lemonnier
2016-10-12 13:01:35 UTC
Permalink
This post might be inappropriate. Click to display it.
Lindsay Mathieson
2016-10-12 12:47:18 UTC
Permalink
Post by Kevin Lemonnier
We have a few Proxmox clusters using GlusterFS as storage.
The nodes are both running the gluster brick and proxmox,
and one of the problems we have often is that when a server
crashes for some reason, the InnoDB of the VM that were
running on the VMs it hosted are dead
Just to check I have this straight:
- Proxmox cluster using GlusterFS for storage
- bricks on Proxmox nodes
- Linux VM's running on Proxmox Nodes
- InnoDB running on the linux vms

When one of the proxmox nodes crashes (Power outage?) the InnoDB
database is hosed?

We run multiple MS SQL servers in the same setup and a few mysql, never
had that problem with them after server outages.

- Replica 3?
- Could you post your gluster info?
- Whats the underlying filesystem for the bricks? ZFS? What sync mode
does it have set?
- Whats the KVM cache mode?


Cheers,
--
Lindsay Mathieson
Kevin Lemonnier
2016-10-12 13:06:33 UTC
Permalink
Post by Lindsay Mathieson
- Proxmox cluster using GlusterFS for storage
- bricks on Proxmox nodes
- Linux VM's running on Proxmox Nodes
- InnoDB running on the linux vms
Yes, that's exactly it.
Post by Lindsay Mathieson
When one of the proxmox nodes crashes (Power outage?) the InnoDB
database is hosed?
Not always, but often. Most of the time enabling force recovery fixes it,
but not always, I had to export, wipe and then re-import everything a few times
to fix innodb.
Post by Lindsay Mathieson
We run multiple MS SQL servers in the same setup and a few mysql, never
had that problem with them after server outages.
- Replica 3?
- Could you post your gluster info?
- Whats the underlying filesystem for the bricks? ZFS? What sync mode
does it have set?
- Whats the KVM cache mode?
The KVM cache is directsync, I was using none before and I started putting
directsync hoping to fix that problem.
The bricks are on XFS, but I also tried ext4. I didn't try ZFS because I have
no idea how that even works.

Here is the config of one of the clusters :

Volume Name: VMs
Type: Replicate
Volume ID: c5272382-d0c8-4aa4-aced-dd25a064e45c
Status: Started
Number of Bricks: 1 x 3 = 3
Transport-type: tcp
Bricks:
Brick1: ips4adm:/mnt/storage/VMs
Brick2: ips5adm:/mnt/storage/VMs
Brick3: ips6adm:/mnt/storage/VMs
Options Reconfigured:
performance.readdir-ahead: on
cluster.quorum-type: auto
cluster.server-quorum-type: server
network.remote-dio: enable
cluster.eager-lock: enable
performance.quick-read: off
performance.read-ahead: off
performance.io-cache: off
performance.stat-prefetch: off
features.shard: on
features.shard-block-size: 64MB
cluster.data-self-heal-algorithm: full
network.ping-timeout: 15

The data-self-heal-algorithm was advised by Krutika I believe,
when we were having huge heal problems.
Appart from that, everything works fine. fsck when the VM starts after
a crash usually finds a few things, but nothing big, everything boots
and nothing is missing. Only MySQL, from time to time.

I imagine you might run into the problem someday too, we're just having
a lot more crashes than the average user for reasons I mentionned in
another mail.
--
Kevin Lemonnier
PGP Fingerprint : 89A5 2283 04A0 E6E9 0111
Loading...