MariaDB Cluster - One node slower than others - mysql

I have a MariaDB Cluster (x3) in Master/Master replication.
Every server have the same my.cnf, and exact same resources.
But one of them is 2 time slower than the two others, and i can't figure out why...
Does someone have a clue ?
my.cnf:
[client-server]
#
# include all files from the config directory
#
!includedir /etc/my.cnf.d
[mariadb]
log-error=/var/log/mysql.log
[mysqld]
#1. Mandatory settings: these settings are REQUIRED for proper cluster operation
query_cache_size=0
binlog_format=ROW
default_storage_engine=innodb
innodb_autoinc_lock_mode=2
# innodb_doublewrite=1 - this is the default and it should stay this way
# 2. Optional mysqld settings: your regular InnoDB tuning and such
datadir=/var/lib/mysql
innodb_buffer_pool_size=500M
innodb_flush_log_at_trx_commit=2
max_connections = 50
thread_cache_size = 10
skip-name-resolve
# 3. wsrep provider configuration: basic wsrep options
wsrep_provider=/usr/lib64/galera/libgalera_smm.so
wsrep_provider_options="gcache.size=3G"
wsrep_cluster_address="gcomm://192.168.5.1,192.168.5.2,192.168.5.3"
wsrep_cluster_name='xxx_galera'
wsrep_node_address='192.168.5.2'
wsrep_node_name='node2'
wsrep_sst_method=xtrabackup
wsrep_sst_auth=root:xxxxxxxx
# 4. additional "frequently used" wsrep settings
wsrep_slave_threads=2 #Max = 1/cpu
Thanks
(Sorry for my english)
UPDATE 1:
I see it's slow because i have an app which is doing some requests on databases (with loadbalancing). When it comes to db2, it takes twice more time (18 to 26s instead of 11s)
When the exact same request is executed by another node, it's ok.
When i shutdown this database, no more problem (with only 2 in loadbalancing)
All databases have their own storage, the same resources, and the same connection (200 mbps).
They are virtual machines hosted by Gandi.net, they use Xen.
UPDATE 2:
I just migrated the drive to another server, same results...
So it's not a hardware problem

Related

config percona xtradb cluster erro

I have 2 nodes and name in hosts is percona1, percona2 .I have successfully installed percona cluster on both nodes. then i started doing config 2 node , i edited the config file my.cnf
# Template my.cnf for PXC
# Edit to your requirements.
[client]
socket=/var/lib/mysql/mysql.sock
[mysqld]
server-id=1
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
# Binary log expiration period is 604800 seconds, which equals 7 days
binlog_expire_logs_seconds=604800
######## wsrep ###############
# Path to Galera library
wsrep_provider=/usr/lib64/galera4/libgalera_smm.so
# Cluster connection URL contains IPs of nodes
#If no IP is found, this implies that a new cluster needs to be created,
#in order to do that you need to bootstrap this node
wsrep_cluster_address=gcomm://percona1,percona2
# In order for Galera to work correctly binlog format should be ROW
binlog_format=ROW
# Slave thread to use
wsrep_slave_threads=8
wsrep_log_conflicts
# This changes how InnoDB autoincrement locks are managed and is a requirement for Galera
innodb_autoinc_lock_mode=2
# Node IP address
wsrep_node_address=percona1
# Cluster name
wsrep_cluster_name=my_centos_cluster
#If wsrep_node_name is not specified, then system hostname will be used
wsrep_node_name=cluster_node_1
#pxc_strict_mode allowed values: DISABLED,PERMISSIVE,ENFORCING,MASTER
pxc_strict_mode=ENFORCING
# SST method
wsrep_sst_method=xtrabackup-v2
After the change work was done I started mysql and got an error , I tried to check every space and got error
enter image description here

MySQL Optimization, my.cnf is almost empty

i have a virtual machine where i installed koha - Open Source Integrated Library System (ILS), it works ok but i want to optimizate mysql, i run MySQLTuner script and i got this recommendations:
General recommendations:
Restrict Host for user#% to user#SpecificDNSorIp
MySQL started within last 24 hours - recommendations may be inaccurate
Configure your accounts with ip or subnets only, then update your configuration with skip-name-resolve=1
Performance should be activated for better diagnostics
Consider installing Sys schema from "Link"
Read this before changing innodb_log_file_size and/or
innodb_log_files_in_group: "Link"
Variables to adjust:
query_cache_size (=0)
query_cache_type (=0)
performance_schema = ON enable PFS
innodb_log_file_size should be (=16M) if possible, so InnoDB total log files
size equals to 25% of buffer pool size.
innodb_buffer_pool_instances (=1)
My current config in my my.cnf (/etc/mysql/my.cnf) file is:
# This group is read both both by the client and the server
# use it for options that affect everything
#
[client-server]
# Import all .cnf files from configuration directory
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mariadb.conf.d/
Does anyone have any recommendations about how to do those recommendations?

Empty Slow Query Log

Good afternoon,
we are trying to have access to our slow query log file at "/var/log/mysql/localhost-slow.log" but it looks like the file is empty. The "my.cnf" file says "!includedir /etc/my.cnf.d", and inside that directory we have the following files:
mysql-clients.cnf;
server.cnf;
tokudb.cnf;
Looking at the "server.cnf" file it looks like it's set properly to write slow queries logs:
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#
# this is read by the standalone daemon and embedded servers
[server]
# this is only for the mysqld standalone daemon
[mysqld]
slow-query-log = 1
slow-query-log-file = /var/log/mysql/localhost-slow.log
long_query_time = 1
log-queries-not-using-indexes
# this is only for embedded server
[embedded]
# This group is only read by MariaDB-5.5 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mysqld-5.5]
# These two groups are only read by MariaDB servers, not by MySQL.
# If you use the same .cnf file for MySQL and MariaDB,
# you can put MariaDB-only options here
[mariadb]
[mariadb-5.5]
We've tried to SET GLOBAL general_log = 'ON'; but it didn't help. Any idea on what could be the issue?
Verify that it is really reading that file:
mysqld --verbose --help | head -33
You will probably see
Default options are read from the following files in the given order:
followed by a list of file paths.

MySQL - my.ini not loading on windows

I have installed MySQL it via wizard with the installer (5.6) and seems I'm unable to load properly the my.ini file, even though the services is targeting the correct file (C:\ProgramData\MySQL\MySQL Server 5.6\my.ini), I'm a bit out of ideas already. Any suggestion?
After a server restart, MySQL still does have mysql_query_cache OFF and 0 as size.
I'm using mysql_cache_type=1 through the my.ini, but after server restart, the changes are not applied to mysql, my.ini looks like this at this moment:
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.
[mysqld]
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
query_cache_type=1
query_cache_limit=40777216
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
# These are commonly set, remove the # and set as required.
# basedir = .....
# datadir = .....
# port = .....
# server_id = .....
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
Thank you!

Can't get MySQL Community Server to Start from Command prompt or Netbeans IDE

I have installed Netbeans 7 on my Windows 7. In addition, the MySQL Community Server 5.6.12
is installed with the MSI installer on thesame 7 PC.
The MySQL server is integrated with the Netbeans IDE. However , it is not possible to start or stop the MySQL server from the command prompt or the Netbeans IDE.
I am only able to start or stop the server from the Windows 7 services tool.
Also , it is difficult running SQL queries from the Netbeans IDE even though it shows there is connection with the MySQL server.
I have added the my.ini file to the installed directory of the MySQL server , that is :
C:\Program Files\MySQL\MySQL Server 5.6
below is the my.ini file :
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.
[mysqld]
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
# These are commonly set, remove the # and set as required.
# basedir = .....
# datadir = .....
port = 3306
# server_id = .....
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
Any suggestion is welcomed.