Добрый день.
Задавал вопрос на forum.sql.ru, но там увы, не ответили.
Есть настроенный сервер IP телефонии на Astreisk и померший сектор на жестком диске. Не повезло файлу /var/lib/mysql/ibdata1 База не запускается, есть резервные копии, и хотелось бы восстановить ее из бэкапа..
Что за файл конкретно помер не знаю, но может можно восстановить базу из бэкапов без этой информации...
У самого опыта немного ни в linux, ни в mysql. Сейчас задача - просто восстановить, чтоб запускалась вебморда и писались разговоры. Важны только данные конфигурации астериска\freepbx, чтобы не перенастраивать заново. Сама телефония сейчас работает и без mysql
# О системе
mysql Ver 15.1 Distrib 10.1.24-MariaDB, for Linux (x86_64) using readline 5.1
Asterisk 11.25.1
Centos 6.9
Лог старта Mysql
191120 21:18:25 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
2019-11-20 21:18:25 140640657311776 [Note] Using unique option prefix 'log-warning' is error-prone and can break in the future. Please use the full name 'log_warnings' instead.
2019-11-20 21:18:25 140640657311776 [Note] /usr/sbin/mysqld (mysqld 10.1.24-MariaDB) starting as process 2060 ...
2019-11-20 21:18:26 140640657311776 [Note] InnoDB: Started in read only mode
2019-11-20 21:18:26 140640657311776 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2019-11-20 21:18:26 140640657311776 [Note] InnoDB: The InnoDB memory heap is disabled
2019-11-20 21:18:26 140640657311776 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2019-11-20 21:18:26 140640657311776 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2019-11-20 21:18:26 140640657311776 [Note] InnoDB: Compressed tables use zlib 1.2.3
2019-11-20 21:18:26 140640657311776 [Note] InnoDB: Using Linux native AIO
2019-11-20 21:18:26 140640657311776 [Note] InnoDB: Using SSE crc32 instructions
2019-11-20 21:18:26 140640657311776 [Note] InnoDB: Disabling background IO write threads.
2019-11-20 21:18:26 140640657311776 [Note] InnoDB: Initializing buffer pool, size = 256.0M
2019-11-20 21:18:26 140640657311776 [Note] InnoDB: Completed initialization of buffer pool
2019-11-20 21:18:26 7fe9746b8820 InnoDB: Operating system error number 2 in a file operation.
InnoDB: The error means the system cannot find the path specified.
InnoDB: If you are installing InnoDB, remember that you must create
InnoDB: directories yourself, InnoDB does not create them.
InnoDB: Operation open to file /home/buildbot/buildbot/build/mariadb-10.1.24/storage/xtradb/os/os0file.cc and at line 2155
2019-11-20 21:18:26 140640657311776 [ERROR] InnoDB: File ./ibdata1: 'open' returned OS error 71. Cannot continue operation
191120 21:18:26 [ERROR] mysqld got signal 6 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
To report this bug, see https://mariadb.com/kb/en/reporting-bugs
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail.
Server version: 10.1.24-MariaDB
key_buffer_size=134217728
read_buffer_size=131072
max_used_connections=0
max_threads=153
thread_count=0
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 467125 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
Thread pointer: 0x0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0x0 thread_stack 0x48400
/usr/sbin/mysqld(my_print_stacktrace+0x2b)[0x7fe975143abb]
/usr/sbin/mysqld(handle_fatal_signal+0x4d5)[0x7fe974ca2365]
/lib64/libpthread.so.0(+0xf7e0)[0x7fe9742a17e0]
/lib64/libc.so.6(gsignal+0x35)[0x7fe9726c7495]
/lib64/libc.so.6(abort+0x175)[0x7fe9726c8c75]
/usr/sbin/mysqld(+0x792e2c)[0x7fe974e64e2c]
/usr/sbin/mysqld(+0x793d19)[0x7fe974e65d19]
/usr/sbin/mysqld(+0x810b0b)[0x7fe974ee2b0b]
/usr/sbin/mysqld(+0x812e70)[0x7fe974ee4e70]
/usr/sbin/mysqld(+0x734e4d)[0x7fe974e06e4d]
/usr/sbin/mysqld(_Z24ha_initialize_handlertonP13st_plugin_int+0x68)[0x7fe974ca4a78]
/usr/sbin/mysqld(+0x46e425)[0x7fe974b40425]
/usr/sbin/mysqld(_Z11plugin_initPiPPci+0x92a)[0x7fe974b413da]
/usr/sbin/mysqld(+0x3cef35)[0x7fe974aa0f35]
/usr/sbin/mysqld(_Z11mysqld_mainiPPc+0x1c5e)[0x7fe974aa374e]
/lib64/libc.so.6(__libc_start_main+0xfd)[0x7fe9726b3d1d]
/usr/sbin/mysqld(+0x3c5749)[0x7fe974a97749]
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
191120 21:18:26 mysqld_safe mysqld from pid file /var/lib/mysql/ASTERISK.pid ended
- Список файлов в каталоге /var/lib/mysql
[root@ASTERISK log]# ls -lh /var/lib/mysql/ --group-directories-first
total 65M
drwx------ 2 mysql mysql 12K Aug 21 19:29 asterisk
drwx------ 2 mysql mysql 4.0K Aug 21 19:29 asteriskcdrdb
drwx--x--x 2 mysql mysql 4.0K Oct 14 11:53 mysql
drwx------ 2 mysql mysql 4.0K Aug 21 19:16 performance_schema
-rw-rw---- 1 mysql mysql 16K Sep 23 10:25 aria_log.00000001
-rw-rw---- 1 mysql mysql 52 Sep 23 10:25 aria_log_control
-rw-rw---- 1 mysql mysql 32M Oct 14 11:54 ib_logfile0
-rw-rw---- 1 mysql mysql 32M Oct 11 22:43 ib_logfile1
-rw-rw---- 1 mysql mysql 2.7K Aug 21 19:28 localhost.localdomain.err
-rw-rw---- 1 mysql mysql 0 Aug 21 19:20 multi-master.info
srwxrwxrwx 1 mysql mysql 0 Oct 17 18:16 mysql.sock
-rw-rw---- 1 mysql mysql 24K Sep 25 20:16 tc.log
Бэкапы делал сам Astrisk, помимо разных файлов конфигурации, есть 2 файла: mysql2.sql и mysql3.sql такого содержимого..
DROP TABLE IF EXISTS `admin`;
CREATE TABLE `admin` (
`variable` varchar(20) NOT NULL DEFAULT '',
`value` varchar(80) NOT NULL DEFAULT '',
PRIMARY KEY (`variable`)
);
INSERT INTO `admin` VALUES ('default_directory','1');
INSERT INTO `admin` VALUES ('directory28_migrated','1');
INSERT INTO `admin` VALUES ('email','root@localhost');
INSERT INTO `admin` VALUES ('need_reload','false');
INSERT INTO `admin` VALUES ('update_semail','ec711eb317488afb2f3babd635a287f2');
INSERT INTO `admin` VALUES ('version','13.0.192.14');
DROP TABLE IF EXISTS `ampusers`;
CREATE TABLE `ampusers` (
`username` varchar(255) NOT NULL,
`password_sha1` varchar(40) NOT NULL,
`extension_low` varchar(20) NOT NULL DEFAULT '',
`extension_high` varchar(20) NOT NULL DEFAULT '',
`deptname` varchar(20) NOT NULL DEFAULT '',
`sections` blob NOT NULL,
`digest` varchar(32) NOT NULL DEFAULT '',
PRIMARY KEY (`username`)
);
INSERT INTO `ampusers` VALUES ('Administrator','b662e4da175db33ae813b60aba06dd4d03df36d8','','','','*','cb5c05e2a82de2a675f3aadef7fac718');
...
Как правильно восстанавливать?