I use mariadb 10.5 with galera 4. I have a 3 node cluster which worked perfectly for the past 6 months. Lately I have been having problems with very cpu intensive query and had to kill that process. One of the nodes (n1) went out of sync so I recreated it. Everything synced perfectly but since that day n1 shows wsrep_cluster_size=0 and the rest of them show wsrep_cluster_size=3.
After a couple of days I decided to stop n2 and n3 to recreate it from n1. Again everything went smoothly but now n3 shows wsrep_cluster_size=0 and n1,n2 show wsrep_cluster_size=3.
I have no idea what's going on. I've checked all the logs and manually checked all the tables and everything seems ok. Data is synced and database is working just fine.
Heres is my configuration
[mysqld]
binlog_format = ROW
bind-address = 0.0.0.0
# Galera Provider Configuration
wsrep_on = ON
wsrep_provider = /usr/lib/galera/libgalera_smm.so
# Galera Cluster Configuration
wsrep_cluster_name = cluser
wsrep_cluster_address = gcomm://10.0.0.2,10.0.0.3,10.0.0.4
wsrep_node_address = 10.0.0.2
wsrep_node_name = n1
# Galera Synchronization Configuration
wsrep_sst_method = rsync
log_error = /var/lib/mysql/node.log
default_storage_engine = InnoDB
innodb_autoinc_lock_mode = 2
innodb_locks_unsafe_for_binlog = 1
innodb_file_per_table = 1
#innodb_thread_concurrency = 0
innodb_buffer_pool_size = 10G
#innodb_log_buffer_size = 64M
innodb_flush_method = O_DIRECT
innodb_log_file_size = 2G
innodb_log_files_in_group = 2
wsrep_slave_threads = 5
innodb_locks_unsafe_for_binlog = 1
innodb_autoinc_lock_mode = 2
skip-name-resolve
lc-messages-dir = /usr/share/mysql
skip-external-locking
key_buffer_size = 16M
max_connections = 300
wait_timeout = 20
max_allowed_packet = 16M
thread_stack = 192K
thread_cache_size = 8
# * Query Cache Configuration
#
query_cache_limit = 1M
query_cache_size = 16M
expire_logs_days = 10
max_binlog_size = 100M
Here is my SHOW STATUS LIKE 'wsrep%' for 3 nodes
https://pastebin.com/GXj0c38R
And logs
https://pastebin.com/YxJBcguK
This is definitely a bug. Please report it on MariaDB JIRA.
In addition to the wsrep_cluster_size=0 on n3, wsrep_cluster_conf_id is uninitialised (and not the 23 like other nodes) and wsrep_cluster_state_uuid is blank.
For a synced node I'd expect these to have consistent values on all nodes.
Related
I have slow queries with a mysql request. But the request is not difficult:
SELECT * FROM emailarchiv WHERE typ='MAIL' AND benutzer = '542' ORDER BY datum DESC LIMIT 0,50;
# User#Host: XXX[XXX] # localhost []
# Thread_id: 13245239 Schema: usr_XXX_1 QC_hit: No
# Query_time: 20.919740 Lock_time: 0.000066 Rows_sent: 50 Rows_examined: 79212
Ok, in the database are 79212 entrys...but 20seconds???
My System: Centos7 MariaDB 5.5, 10GB RAM, 10 CPUs
Here my my.conf:
[mysqld]
local-infile = 0
datadir = /var/lib/mysql
socket = /var/lib/mysql/mysql.sock
user = mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
# Forced OLD_PASSWORD format is turned OFF by Plesk
#old_passwords = 1
# Disabling symbolic-links is recommended to prevent assorted security risks;
# to do so, uncomment this line:
# symbolic-links = 0
max_connections = 100
#port = 3306 #Port nicht aendern
key_buffer_size = 512M
max_allowed_packet = 256M
table_open_cache = 4096
sort_buffer_size = 64M
net_buffer_length = 128K
read_buffer_size = 1512K
read_rnd_buffer_size = 4096K
myisam_sort_buffer_size = 64M
max_heap_table_size = 512M
tmp_table_size = 1024M
key_cache_block_size = 4096
query_cache_size = 512M
query_cache_limit = 512M
thread_cache_size = 20
table_cache = 16384
#open_files_limit = 9212 #nicht aktivieren!! Verursacht Probleme...
#wait_timeout = 10 #nicht aktivieren !!
join_buffer_size = 32M
#bind-address = 127.0.0.1
#Aenderungen ab 23.07.2021
innodb_buffer_pool_size = 512M
max_heap_table_size= 1024M
skip-name-resolve
slow-query-log = 1
slow-query-log-file = /srv/slow-query.log
long_query_time = 5
ssl-ca=/etc/mysql-ssl/ca-cert.pem
ssl-cert=/etc/mysql-ssl/server-cert.pem
ssl-key=/etc/mysql-ssl/server-key.pem
[mysqld_safe]
#log-error = /var/log/mysqld.log
What goes here wrong?
I solved the problem by myself ;-)
I don't use indexes for the rows "typ" and "benutzer" that was the problem. Now the Query_time is 2 seconds 👍
I installed Mariadb 10.5.12-1.el7 on Centos 7.9
Sometimes when I run some query like "SHOW VARIABLES LIKE 'max_join_size';" , this message appear :
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 3515012
Current database: *** NONE ***
I setup a cluster Packemaker/drbd/mariadb
And these are the conf:
max_allow_packet = 1G
bind-address = 0.0.0.0
datadir= /db/mysql/
socket=/db/mysql/mysql.sock
log_error=/var/log/mariadb/error.log
skip-external-locking
innodb_buffer_pool_size = 75G
innodb_log_file_size = 18G
innodb_buffer_pool_instances = 75
max_allowed_packet = 1G
thread_stack = 256K
thread_cache_size = 2000
max_connections = 2000
query_cache_limit = 256K
table_open_cache = 2000
table_definition_cache = 1400
expire_logs_days = 10
max_binlog_size = 100M
default_storage_engine = innodb
innodb_file_per_table = 1
interactive_timeout = 30
wait_timeout = 30
query_cache_type = 1
query_cache_size = 36M
query_cache_min_res_unit = 2K
What is the cause of this issue ?
Thanks
I have problems with my DB proceses
I runn an website developed using angular, typescript and laravel
Script demo: https://codecanyon.net/item/mtdb-ultimate-movietv-database/6447206
Script documentation: https://support.vebto.com/help-center/categories/35/mtdb-ultimate-movieandtv-database
Server:
Processor: Intel 2x Xeon Silver 4214 - 24 c / 48 t - 2.2 GHz / 3.2 GHz
Memory: 96GB DDR4 ECC 2400MHz
Storage: 2x960GB SSD NVMe Soft RAID 1
PHP 7.3 fcgi
mysql - MariaBD 10.3:
[mysqld]
log-error=/var/lib/mysql/server188.com.err
performance-schema=0
innodb_file_per_table=1
local-infile=0
key_buffer_size = 256M
max_allowed_packet = 268435456
innodb_buffer_pool_size=134217728
max_connections = 1000
max_user_connections = 500
wait_timeout = 28800
connect_timeout = 10
table_open_cache=4000
join_buffer_size = 1M
open_files_limit=10000
tmp_table_size = 64M
max_heap_table_size = 64M
read_buffer_size = 64M
concurrent_insert = 2
max_connect_errors = 10
net_buffer_length = 16384
myisam_sort_buffer_size = 64M
bulk_insert_buffer_size = 8M
thread_cache_size = 384
query_cache_limit = 7M
query_cache_size = 64M
query_cache_type = 1
query_prealloc_size = 262144
query_alloc_block_size = 65536
transaction_alloc_block_size = 8192
transaction_prealloc_size = 4096
max_write_lock_count = 16
#skip-networking
innodb_buffer_pool_size=4G
innodb_thread_concurrency=16
performance-schema=0
default-storage-engine=MyISAM
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
[myisamchk]
key_buffer = 384M
sort_buffer = 384M
read_buffer = 256M
write_buffer = 256M
The strangest thing is that when I get an cpu load of 16 - 17, my site stop loading, but others websites on the same server runn very well.
Also, the load NEVER pass of 17 cpu, but the server can handle 48
I think there is some limit somewhere.
Can someone make a suggestion?
I am administrating a server with MariaDB and it often uses a lot of RAM - often so much that it crashes because it can't allocate more RAM, and even when it doesn't it can be pretty slow because it swaps. Even when it is running smoothly, I can see with htop that among the processes using the most RAM there are two dozen of /usr/sbin/mysqld processes. Of course I googled it but I barely understand what the settings in my.cnf do, so nothing I changed appeared to have an effect.
The server has:
2 GB of RAM
Debian GNU/Linux 9.12 (stretch)
mysql --version returns: Ver 15.1 Distrib 10.1.44-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
Here is the content of /etc/mysql/my.cnf:
# This file has been automatically moved from your previous
# /etc/mysql/my.cnf, with just this comment added at the top, to maintain MySQL
# operation using your previously customised configuration.
# To switch to the new packaging configuration for automated management of
# /etc/mysql/my.cnf across multiple variants:
#
# 1. Move your customisations from this file to /etc/mysql/conf.d/ and
# to /etc/mysql/<variant>.conf.d/ as appropriate.
# 2. Run "update-alternatives --remove my.cnf /etc/mysql/my.cnf.migrated"
# 3. Remove the file /etc/mysql/my.cnf.migrated
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
# This will be passed to all mysql clients
# It has been reported that passwords should be enclosed with ticks/quotes
# escpecially if they contain "#" chars...
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
# Here is entries for some specific programs
# The following values assume you have at least 32M ram
# This was formally known as [safe_mysqld]. Both versions are currently parsed.
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0
[mysqld]
#
# * Basic Settings
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
#bind-address = 127.0.0.1
bind-address = ***.***.***.***
#
# * Fine Tuning
#
key_buffer = 8M
max_allowed_packet = 16M
thread_stack = 192K
thread_cache_size = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover = BACKUP
#max_connections = 100
#table_cache = 64
#thread_concurrency = 10
#
# * Query Cache Configuration
#
query_cache_limit = 1M
query_cache_size = 8M
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
# As of 5.1 you can enable the log at runtime!
#general_log_file = /var/log/mysql/mysql.log
#general_log = 1
#
# Error log - should be very few entries.
#
log_error = /var/log/mysql/error.log
#
# Here you can see queries with especially long duration
slow_query_log_file = /var/log/mysql/mysql-slow.log
# slow_query_log = 1
long_query_time = 1
#log_queries_no_using_indexes
#
# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
# other settings you may need to change.
#server-id = 1
#log_bin = /var/log/mysql/mysql-bin.log
expire_logs_days = 10
max_binlog_size = 100M
#binlog_do_db = include_database_name
#binlog_ignore_db = include_database_name
#
# * InnoDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
#
# * Security Features
#
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
#
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem
character_set_server=utf8mb4
skip_character_set_client_handshake
skip-name-resolve
tmp_table_size= 32M # 128
max_heap_table_size=128M
wait_timeout=60 #120
max_connections=25 # 40
thread_stack=128K
[mysqldump]
quick
quote-names
max_allowed_packet = 16M
[mysql]
#no-auto-rehash # faster start of mysql but no tab completition
[isamchk]
key_buffer = 16M
#
# * IMPORTANT: Additional settings that can override those from this file!
# The files must end with '.cnf', otherwise they'll be ignored.
#
!includedir /etc/mysql/conf.d/
Is something wrong in my my.cnf? Would updating MariaDB help?
i am new to flume. My flume agent is not writing data to HDFS. Please help. Here is the code. The purpose of the code is to get the data from apache and park it to HDFS.
#identify the components on agent a1
a1.sources = apache_server
a1.sinks = hdfs_sink
a1.channels = c1
# Configure the source:
a1.sources.apache_server.type = exec
a1.sources.apache_server.command = tail -f /var/log/httpd/error_log
# Describe the sink:
a1.sinks.hdfs_sink.type = hdfs
a1.sinks.hdfs_sink.hdfs.path = hdfs://hadoop1.example.com:9000/Apache_Logs
a1.sinks.hdfs_sink.hdfs.writeFormat = Text
a1.sinks.hdfs_sink.hdfs.fileType = DataStream
a1.sinks.hdfs-sink.hdfs.rollInterval = 10
a1.sinks.hdfs_sink.hdfs.rollSize = 0
a1.sinks.hdfs-sink.hdfs.filePrefix=apacheaccess
# Configure a channel that buffers events in memory:
a1.channels.c1.type = memory
a1.channels.c1.capacity = 20000
a1.channels.c1.transactionCapacity = 100
# Bind the source and sink to the channel:
a1.sources.apache_server.channels = c1
a1.sinks.hdfs_sink.channel = c1