MySQL Forums
Forum List  »  Spanish

BACKUP GRANDE
Posted by: Andres Molina
Date: May 25, 2021 07:04AM

Buenos días para todos, tengo problemas la general el backup de 300 bases de datos que tenemos en la compañía para la que trabajo, les explico primero lo que tengo y luego lo que me pasa para que por favor me den una luz al final del camino por favor.

S.O Centos 8 (Core)
Mysql 5.7.31

Para generar los abckups tengo un cron diario que lee un archivo plano en el cual tengo el listado de las 300 bases de datos, ya que necesito generar el archivo.sql por separado de cada bd.

Todas las bd están en InnoDB por lo que no puedo generar backup de la carpeta mysql


Los backups se venían generando sin problema hasta hace un par de semanas.

El backup se empieza a generar sin inconvenientes, pero cuando van 100 o 150 mas o menos empieza a generar el siguiente error.

mysqldump: Got error: 2003: Can't connect to MySQL server on '127.0.0.1' (111) when trying to connect

por lo que decidí repartir el backup en 3 crons diferentes para que genere 100 backups cada día, pero ahora hay días que si genera el backup completo de las 100 bd, pero otros días me genera 5 o 10 y vuelve y me genera el mismo error.


La línea en bash para generar el backups es la siguiente

$MYSQLDUMP -h 127.0.0.1 --log-error=$LGENERAL --quick --default-character-set=utf8 --lock-tables=false --routines --triggers --max_allowed_packet=900M -u $USER -p$PASSWORD $BD > $BKDIR/$CARPETA/"$BD"_`date +%Y%m%d`.sql

Tenemos BD que pueden pesar gigas.


aquí dejo mi configuración de my.cnf

# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html

[client]
password = **********
port = 3306
host = 127.0.0.1
socket = /var/lib/mysql/mysql.sock

[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
innodb_buffer_pool_size = 40G
innodb_log_file_size = 6G
innodb_buffer_pool_load_at_startup=ON
innodb_buffer_pool_dump_at_shutdown=ON
innodb_flush_method=O_DIRECT
innodb_flush_log_at_trx_commit = 1
innodb_buffer_pool_instances = 26
innodb_log_buffer_size = 8M
query_cache_type=0
query_cache_size=0
query_cache_limit= 3MB
join_buffer_size = 8MB
table_open_cache = 5000
#table_definition_cache = -1
table_definition_cache = 400
innodb_file_per_table=1
innodb_stats_on_metadata = off
#
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
#
# 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
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
skip-log-bin
skip-name-resolve
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
local_infile=ON
# local_infile=OFF
# Recommended in standard MySQL setup
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
slow_query_log = 1
long_query_time = 3
log_output = TABLE
#general-log
expire_logs_days = 1
#performance_schema = OFF
max_connections = 600
max_allowed_packet = 128M
wait_timeout = 30
# wait_timeout = 28800
interactive_timeout = 30
# interactive_timeout = 28800

log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
long_query_time = 3
log_output = TABLE
general-log
expire_logs_days = 1
max_connections = 600
max_allowed_packet = 64M
innodb_file_per_table=1


Estamos en la búsqueda de un experto en mysql que nos pueda ayudar con un tunning ya que no contamos con un dba por si saben de alguien que nos pueda ayudar.

Por ahora agradezco cualquier concejo que me ayude a solucionar el problema de generación de backups.

Options: ReplyQuote


Subject
Views
Written By
Posted
BACKUP GRANDE
526
May 25, 2021 07:04AM
264
May 25, 2021 08:14AM
245
May 25, 2021 11:04AM
211
May 25, 2021 11:07AM
225
May 25, 2021 12:48PM
224
May 25, 2021 03:47PM
221
May 25, 2021 07:53PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.