Pandora FMS community forums
ERROR al intentar acceder a la consola - Printable Version

+- Pandora FMS community forums (https://pandorafms.org/forum)
+-- Forum: Pandora FMS (https://pandorafms.org/forum/forum-3.html)
+--- Forum: Español / Spanish forum (https://pandorafms.org/forum/forum-8.html)
+--- Thread: ERROR al intentar acceder a la consola (/thread-6969.html)

Pages: 1 2 3


ERROR al intentar acceder a la consola - jfcarpi - 04-11-2013

Hoy no podia acceder al servidor. Tras reiniciar, al intentar acceder a la consola me sale:

""Cannot connect to the database, please check your database setup in the include/config.php file.

Probably your database, hostname, user or password values are incorrect or the database server is not running.

DB ERROR: No such file or directory
If you have modified auth system, this problem could be because Pandora cannot override authorization variables from the config database. Remove them from your database by executing:
DELETE FROM tconfig WHERE token = "auth";"""

He obtenido las siguientes salidas al intentar arrancar mysql:

[email protected]:~> su
Password:
pandora:/home/artica # (Bcd /
pandora:/ # (B/etc/init.d/mysql status
redirecting to systemctl
mysql.service - LSB: Start the MySQL database server
  Loaded: loaded (/etc/init.d/mysql)
  Active: failed (Result: exit-code) since Thu, 11 Apr 2013 11:18:22 +0000; 13min ago
Process: 1167 ExecStart=/etc/init.d/mysql start (code=exited, status=1/FAILURE)
  CGroup: name=systemd:/system/mysql.service
  ├ 1388 /bin/sh /usr/bin/mysqld_safe --mysqld=mysqld --use...
  └ 1988 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib...

Apr 11 11:17:47 pandora mysql[1167]: /etc/rc.status: line 57: /dev/stderr: ...ss
Apr 11 11:18:22 pandora mysql[1167]: Starting service MySQL warning: /var/r...ds
Apr 11 11:18:22 pandora mysql[1167]: chmod: cannot access '/var/run/mysql/m...ry
Apr 11 11:18:22 pandora mysql[1167]: ..failed
pandora:/ # (Bhead /srv/www/htdocs/pandora_console/include/config.php
<?php
// Begin of automatic config file
$config["dbname"]="pandora"; // MySQL DataBase name
$config["dbuser"]="pandora"; // DB User
$config["dbpass"]="pandora"; // DB Password
$config["dbhost"]="localhost"; // DB Host
$config["homedir"]="/srv/www/htdocs/pandora_console"; // Config homedir
$config["homeurl"]="/pandora_console"; // Base URL
// End of automatic config file
?><?php
pandora:/ # (Bmysql -upandora -ppandora pandora -h loclahostalhost
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)


Un saludo


Re: ERROR al intentar acceder a la consola - mario.pulido - 04-11-2013

Según muestras el mysql server no se inicia correctamente.

Comprueba mediante un " ps aux | grep mysql " todos los procesos que están corriendo actualmente y eliminalos (kill -9 nºproceso).

Una vez haber realizado esto, inicia el servicio mysql (/etc/init.d/mysql start) y comprueba si se inicia correctamente. Si no es asi comprueba el log de mysql que errores te muestra.

Un saludo


Re: ERROR al intentar acceder a la consola - jfcarpi - 04-11-2013

No se inicia.

pandora:/var/log/mysql # /ps aux | grep mysql
mysql    4825  1.7  6.8 309352 34996 ?        Sl  13:25  0:07 /usr/sbin/mysql
root      5150  0.0  0.1  4172  796 pts/0    S+  13:32  0:00 grep mysql
pandora:/var/log/mysql # kill -9 4825
pandora:/var/log/mysql # /etc/init.d/mysql start
redirecting to systemctl
Job failed. See system journal and 'systemctl status' for details.
pandora:/var/log/mysql # cat mysqld.log
130411 13:32:58 mysqld_safe mysqld from pid file /var/run/mysql/mysqld.pid ended
130411 13:33:13 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
130411 13:33:13 InnoDB: The InnoDB memory heap is disabled
130411 13:33:13 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130411 13:33:13 InnoDB: Compressed tables use zlib 1.2.7
130411 13:33:13 InnoDB: Initializing buffer pool, size = 128.0M
130411 13:33:13 InnoDB: Completed initialization of buffer pool
130411 13:33:13 InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
130411 13:33:13  InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
InnoDB: Last MySQL binlog file position 0 840033749, file name ./mysql-bin.000015
130411 13:33:14130411 13:33:15

Un saludo



Re: ERROR al intentar acceder a la consola - mario.pulido - 04-11-2013

Realiza un "systemctl status mysql.service" como te indica y muestranos que información te proporciona.

Un saludo


Re: ERROR al intentar acceder a la consola - jfcarpi - 04-11-2013

Mario,

[email protected]:~> systemctl status mysql.service
mysql.service - LSB: Start the MySQL database server
  Loaded: loaded (/etc/init.d/mysql)
  Active: failed (Result: exit-code) since Thu, 11 Apr 2013 13:33:44 +0000; 2h 28min ago
Process: 5159 ExecStart=/etc/init.d/mysql start (code=exited, status=1/FAILURE)
  CGroup: name=systemd:/system/mysql.service
  5213 /bin/sh /usr/bin/mysqld_safe --mysqld=mysqld --use...
  5543 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib...

[email protected]:~> exit

Un saludo


Re: ERROR al intentar acceder a la consola - mario.pulido - 04-11-2013

Comprueba el tamaño libre que tiene en root, ante todo.

Nos muestra los errores el archivo ibdata (/var/lib/mysql/). Si tienes todavia espacio libre,te recomiendo que sigas estos pasos, para ver si conseguimos levantar el servidor mysql.
Renombra los ficheros ibdata1, ib_logfile0 y ib_logfile1. (mv ibdata1 ibdata1_OLD,  mv ib_logfile0 ib_logfile0_OLD, mv ib_logfile1 ib_logfile1_OLD )
Intenta volver a iniciar mysql.

Un saludo



Re: ERROR al intentar acceder a la consola - jfcarpi - 04-11-2013

Hola,

Por lo que veo de los logs no hay suficiente espacio.

[email protected]:~> su
Password:
pandora:/home/artica # cd /
pandora:/ # df -h
Filesystem                  Size  Used Avail Use% Mounted on
rootfs                      3.9G  1.3G  2.4G  35% /
devtmpfs                    242M  36K  242M  1% /dev
tmpfs                        248M    0  248M  0% /dev/shm
tmpfs                        248M  408K  248M  1% /run
/dev/mapper/systemVG-LVRoot  3.9G  1.3G  2.4G  35% /
tmpfs                        248M    0  248M  0% /sys/fs/cgroup
tmpfs                        248M    0  248M  0% /media
/dev/sda1                    149M  39M  103M  28% /boot
/dev/mapper/systemVG-LVvar  2.9G  2.8G    0 100% /var
tmpfs                        248M  408K  248M  1% /var/lock
tmpfs                        248M  408K  248M  1% /var/run
pandora:/ # cd var
pandora:/var # cd lib
pandora:/var/lib # cd mysql/
pandora:/var/lib/mysql # ls
ibdata1  mysql-bin.000003  mysql-bin.000009  mysql-bin.000015
ib_logfile0  mysql-bin.000004  mysql-bin.000010  mysql-bin.index
ib_logfile1  mysql-bin.000005  mysql-bin.000011  mysql-bin.~rec~
mysql  mysql-bin.000006  mysql-bin.000012  pandora
mysql-bin.000001  mysql-bin.000007  mysql-bin.000013  performance_schema
mysql-bin.000002  mysql-bin.000008  mysql-bin.000014  test
pandora:/var/lib/mysql # mv ibdata1 ibdata1_OLD
pandora:/var/lib/mysql # mv ib_logfile0 ib_logfile0_OLD
pandora:/var/lib/mysql # mv ib_logfile1 ib_logfile1_OLD
pandora:/var/lib/mysql # ps aux | grep mysql
mysql    5543  0.0  6.8 309352 34996 ?        Sl  13:33  0:10 /usr/sbin/mysql
root      8313  0.0  0.1  4172  800 pts/0    S+  17:19  0:00 grep mysql
pandora:/var/lib/mysql # kill -9 5543
pandora:/var/lib/mysql # (/etc/init.d/mysql start
redirecting to systemctl
Job failed. See system journal and 'systemctl status' for details.
pandora:/var/lib/mysql # cd ..
pandora:/var/lib # cd ..
pandora:/var # cd log
pandora:/var/log # cd mysql/
pandora:/var/log/mysql # cat mysqld.log
130411 17:19:33 mysqld_safe mysqld from pid file /var/run/mysql/mysqld.pid ended
130411 17:20:15 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
130411 17:20:15 InnoDB: The InnoDB memory heap is disabled
130411 17:20:15 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130411 17:20:15 InnoDB: Compressed tables use zlib 1.2.7
130411 17:20:15 InnoDB: Initializing buffer pool, size = 128.0M
130411 17:20:15 InnoDB: Completed initialization of buffer pool
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
130411 17:20:15  InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
130411 17:20:15InnoDB: Error number 28 means 'No space left on device'.
InnoDB: Some operating system error numbers are described at
InnoDB: http://dev.mysql.com/doc/refman/5.5/en/operating-system-error-codes.html
InnoDB: Error in creating ./ibdata1: probably out of disk space
130411 17:20:15130411 17:20:15130411 17:20:15130411 17:20:15 mysqld_safe mysqld from pid file /var/run/mysql/mysqld.pid ended
pandora:/var/log/mysql # systemctl status mysql.service
mysql.service - LSB: Start the MySQL database server
  Loaded: loaded (/etc/init.d/mysql)
  Active: failed (Result: exit-code) since Thu, 11 Apr 2013 17:20:45 +0000; 2min 46s ago
Process: 8361 ExecStart=/etc/init.d/mysql start (code=exited, status=1/FAILURE)
  CGroup: name=systemd:/system/mysql.service

Apr 11 17:20:13 pandora mysql[8361]: /etc/rc.status: line 57: /dev/stderr: ...ss
Apr 11 17:20:45 pandora mysql[8361]: Starting service MySQL warning: /var/r...ds
Apr 11 17:20:45 pandora mysql[8361]: chmod: cannot access '/var/run/mysql/m...ry
Apr 11 17:20:45 pandora mysql[8361]: ..failed
pandora:/var/log/mysql # exit
exit
[email protected]:~> exit
logout

No obstante el sistema es una maquina virtual hyperv con un disco de 40GB, entiendo que la instalacion del apliance por defecto hace un disco de 4GB y de aqui el problema.
Entiendo que lo suyo seria expandir la particion para usar todo el disco y repetir el proceso de arranque del mysql, me puedes confirmar esto.
Saludos



Re: ERROR al intentar acceder a la consola - mario.pulido - 04-12-2013

Buenas

Si, ese parece que esta siendo el problema para que no arranque mysql. Lo suyo seria borrar todos los logs bienarios que se encuentran en la carpeta (mysql-bin.00*), aunque la mejor forma de borrarlos seria mediante la instrucción PURGE BINARY LOGS BEFORE DATE_SUB( NOW( ), INTERVAL 7 DAY); en mysql aunque los puedes borrar a mano directamente del directorio /var/lib/mysql y volver a iniciar mysql.

Un saludo



Re: ERROR al intentar acceder a la consola - jfcarpi - 04-12-2013

Parece que no quiere, ahora salen otros errores, pego el proceso

pandora:/var/lib/mysql # ls
ibdata1 ib_logfile1_OLD  mysql-bin.000002  mysql-bin.000005  mysql-bin.000008  mysql-bin.000011  mysql-bin.000014  pandora
ibdata1_OLD mysql  mysql-bin.000003  mysql-bin.000006  mysql-bin.000009  mysql-bin.000012  mysql-bin.000015  performance_schema
ib_logfile0_OLD  mysql-bin.000001  mysql-bin.000004  mysql-bin.000007  mysql-bin.000010  mysql-bin.000013  mysql-bin.index  test
pandora:/var/lib/mysql # rm mysql-bin.00*
pandora:/var/lib/mysql # df -h
Filesystem                  Size  Used Avail Use% Mounted on
rootfs                      3.9G  1.3G  2.4G  35% /
devtmpfs                    242M  36K  242M  1% /dev
tmpfs                        248M    0  248M  0% /dev/shm
tmpfs                        248M  408K  248M  1% /run
/dev/mapper/systemVG-LVRoot  3.9G  1.3G  2.4G  35% /
tmpfs                        248M    0  248M  0% /sys/fs/cgroup
tmpfs                        248M    0  248M  0% /media
/dev/sda1                    149M  39M  103M  28% /boot
/dev/mapper/systemVG-LVvar  2.9G  157M  2.6G  6% /var
tmpfs                        248M  408K  248M  1% /var/run
tmpfs                        248M  408K  248M  1% /var/lock
pandora:/var/lib/mysql # ps aux | grep mysql
root      2686  0.0  0.1  4172  800 pts/0    S+  10:53  0:00 grep mysql
pandora:/var/lib/mysql # /etc/init.d/mysql start
redirecting to systemctl
Job failed. See system journal and 'systemctl status' for details.
pandora:/var/lib/mysql # systemctl status mysql.service
mysql.service - LSB: Start the MySQL database server
  Loaded: loaded (/etc/init.d/mysql)
  Active: failed (Result: exit-code) since Fri, 12 Apr 2013 10:57:48 +0000; 25s ago
Process: 2735 ExecStart=/etc/init.d/mysql start (code=exited, status=1/FAILURE)
  CGroup: name=systemd:/system/mysql.service

pandora:/var/lib/mysql # cat /var/loog/mysql/mysqld.log
130411 17:19:33 mysqld_safe mysqld from pid file /var/run/mysql/mysqld.pid ended
130411 17:20:15 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
130411 17:20:15 InnoDB: The InnoDB memory heap is disabled
130411 17:20:15 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130411 17:20:15 InnoDB: Compressed tables use zlib 1.2.7
130411 17:20:15 InnoDB: Initializing buffer pool, size = 128.0M
130411 17:20:15 InnoDB: Completed initialization of buffer pool
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
130411 17:20:15  InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
130411 17:20:15InnoDB: Error number 28 means 'No space left on device'.
InnoDB: Some operating system error numbers are described at
InnoDB: http://dev.mysql.com/doc/refman/5.5/en/operating-system-error-codes.html
InnoDB: Error in creating ./ibdata1: probably out of disk space
130411 17:20:15130411 17:20:15130411 17:20:15130411 17:20:15 mysqld_safe mysqld from pid file /var/run/mysql/mysqld.pid ended
130412 10:21:34 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
130412 10:21:35 InnoDB: The InnoDB memory heap is disabled
130412 10:21:35 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130412 10:21:35 InnoDB: Compressed tables use zlib 1.2.7
130412 10:21:35 InnoDB: Initializing buffer pool, size = 128.0M
130412 10:21:35 InnoDB: Completed initialization of buffer pool
InnoDB: Error: auto-extending data file ./ibdata1 is of a different size
InnoDB: 0 pages (rounded down to MB) than specified in the .cnf file:
InnoDB: initial 640 pages, max 0 (relevant if non-zero) pages!
130412 10:21:35 InnoDB: Could not open or create data files.
130412 10:21:35 InnoDB: If you tried to add new data files, and it failed here,
130412 10:21:35 InnoDB: you should now edit innodb_data_file_path in my.cnf back
130412 10:21:35 InnoDB: to what it was, and remove the new ibdata files InnoDB created
130412 10:21:35130412 10:21:35 mysqld_safe mysqld from pid file /var/run/mysql/mysqld.pid ended
130412 10:57:18 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
130412 10:57:18 InnoDB: The InnoDB memory heap is disabled
130412 10:57:18 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130412 10:57:18 InnoDB: Compressed tables use zlib 1.2.7
130412 10:57:18 InnoDB: Initializing buffer pool, size = 128.0M
130412 10:57:18 InnoDB: Completed initialization of buffer pool
InnoDB: Error: auto-extending data file ./ibdata1 is of a different size
InnoDB: 0 pages (rounded down to MB) than specified in the .cnf file:
InnoDB: initial 640 pages, max 0 (relevant if non-zero) pages!
130412 10:57:18 InnoDB: Could not open or create data files.
130412 10:57:18 InnoDB: If you tried to add new data files, and it failed here,
130412 10:57:18 InnoDB: you should now edit innodb_data_file_path in my.cnf back
130412 10:57:18 InnoDB: to what it was, and remove the new ibdata files InnoDB created
130412 10:57:18 InnoDB: in this failed attempt. InnoDB only wrote those files full of
130412 10:57:18 InnoDB: zeros, but did not yet use them in any way. But be careful: do not
130412 10:57:18 InnoDB: remove old data files which contain your precious data!
130412 10:57:18 [ERROR] Plugin 'InnoDB' init function returned error.
130412 10:57:18 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
130412 10:57:18 [ERROR] Unknown/unsupported storage engine: InnoDB
130412 10:57:18 [ERROR] Aborting

130412 10:57:18 [Note] /usr/sbin/mysqld: Shutdown complete

130412 10:57:18 mysqld_safe mysqld from pid file /var/run/mysql/mysqld.pid ended
pandora:/var/lib/mysql # exit

Un saludo


Re: ERROR al intentar acceder a la consola - mario.pulido - 04-12-2013

Elimina los ibdata1, ib_logfile0 y ib_logfile1 que se habrán vuelto a crear tras el intento de arranque y vuelve a renombrar a su nombre correcto los que estaban con _OLD.
Tras eliminar los logs binarios tampoco hemos conseguido mucho espacio extra, que al final tocará aumentar el filesystem, pero el objetivo ahora mismo es arrancar mysql y guardar un backup de la base de datos de Pandora para no perder los datos.

Comprueba si arranca mysql tras hacer lo que te he indicado.

Un saludo