raspdroid
Posts: 1619
Joined: Thu Nov 06, 2014 9:15 am
Location: Gran Canaria :: España

Configurando Bacula en Raspbian Jessie

Wed Jan 18, 2017 11:28 pm

Hola,

Tengo una Raspberry Pi 2 como servidor de copias de seguridad con Bacula sobre Raspbian Jessie. Bacula lo instalé desde los repositorios de Raspbian , es la versión 5.x, hay una más actual la 7.x que tiene funciones como la verificación de la integridad de las copias entre otras cosas pero de momento me sirve esta.

Uso discos duros SATA conectados a una estación usb similar a esta https://www.cablematic.es/ref/HS31?gcli ... GwodYrYK6A

Y usé este tutorial para hacer que los discos se monten automágicamente http://wiki.bacula.org/doku.php?id=remo ... utochanger

Tengo casi todo configurado pero también tengo algunos errores.
Jan 18 21:48:08 servidor bacula-sd[6014]: Starting Bacula Storage daemon...: bacula-sd.
Jan 18 21:48:16 servidor bacula-director[6094]: No bacula-director SQL package installed
El log me dice que no tengo ningún paquete SQL de bacula-director instalado. Y es cierto es que tengo problemas al instalar bacula-director-mysql

Iba a usar el de SQLite que dicen que para hasta 20 máquinas es suficiente pero también he leído que han tenido problemas de corrupción de la base de datos con sqlite3 por lo que quiero usar mysql.

Instalé mariadb-server 10 y core-10 pero cuando instalo bacula-director-mysql intenta sustituir mariadb por mysql-server-5.5

Code: Select all

sudo apt-get install bacula-director-mysql 
[sudo] password for raspdroid:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
bacula-director-common dbconfig-common mysql-client mysql-client-5.5 mysql-server mysql-server-5.5
mysql-server-core-5.5
Suggested packages:
gawk tinyca
The following packages will be REMOVED:
mariadb-client-10.0 mariadb-client-core-10.0 mariadb-server mariadb-server-10.0 mariadb-server-core-10.0
The following NEW packages will be installed:
bacula-director-common bacula-director-mysql dbconfig-common mysql-client mysql-client-5.5 mysql-server
mysql-server-5.5 mysql-server-core-5.5
0 upgraded, 8 newly installed, 5 to remove and 0 not upgraded.
Need to get 5,692 kB/7,626 kB of archives.
After this operation, 27.7 MB disk space will be freed.
Do you want to continue? [Y/n]
No me importa usar mysql 5.5, es solo para bacula pero es que tampoco lo puedo instalar siempre me da error.
Do you want to continue? [Y/n] Y
Get:1 http://mirrordirector.raspbian.org/raspbian/ jessie/main mysql-client-5.5 armhf 5.5.53-0+deb8u1 [1,447 kB]
Get:2 http://mirrordirector.raspbian.org/raspbian/ jessie/main mysql-server-core-5.5 armhf 5.5.53-0+deb8u1 [3,448 kB]
Get:3 http://mirrordirector.raspbian.org/raspbian/ jessie/main bacula-director-common armhf 5.2.6+dfsg-9.3 [96.0 kB]
Get:4 http://mirrordirector.raspbian.org/raspbian/ jessie/main dbconfig-common all 1.8.47+nmu3+deb8u1 [628 kB]
Get:5 http://mirrordirector.raspbian.org/raspbian/ jessie/main mysql-client all 5.5.53-0+deb8u1 [73.7 kB]
Fetched 5,692 kB in 8s (680 kB/s)
Preconfiguring packages ...
(Reading database ... 32294 files and directories currently installed.)
Removing mariadb-server (10.0.28-0+deb8u1) ...
Removing mariadb-server-10.0 (10.0.28-0+deb8u1) ...
Removing mariadb-client-10.0 (10.0.28-0+deb8u1) ...
Removing mariadb-client-core-10.0 (10.0.28-0+deb8u1) ...
Removing mariadb-server-core-10.0 (10.0.28-0+deb8u1) ...
Processing triggers for man-db (2.7.0.2-5) ...
Selecting previously unselected package mysql-client-5.5.
(Reading database ... 32074 files and directories currently installed.)
Preparing to unpack .../mysql-client-5.5_5.5.53-0+deb8u1_armhf.deb ...
Unpacking mysql-client-5.5 (5.5.53-0+deb8u1) ...
Selecting previously unselected package mysql-server-core-5.5.
Preparing to unpack .../mysql-server-core-5.5_5.5.53-0+deb8u1_armhf.deb ...
Unpacking mysql-server-core-5.5 (5.5.53-0+deb8u1) ...
Preparing to unpack .../mysql-server-5.5_5.5.53-0+deb8u1_armhf.deb ...
Aborting downgrade from (at least) 10.0 to 5.5.
If are sure you want to downgrade to 5.5, remove the file
/var/lib/mysql/debian-*.flag and try installing again.
dpkg: error processing archive /var/cache/apt/archives/mysql-server-5.5_5.5.53-0+deb8u1_armhf.deb (--unpack):
subprocess new pre-installation script returned error exit status 1
Selecting previously unselected package bacula-director-common.
Preparing to unpack .../bacula-director-common_5.2.6+dfsg-9.3_armhf.deb ...
Unpacking bacula-director-common (5.2.6+dfsg-9.3) ...
Selecting previously unselected package dbconfig-common.
Preparing to unpack .../dbconfig-common_1.8.47+nmu3+deb8u1_all.deb ...
Unpacking dbconfig-common (1.8.47+nmu3+deb8u1) ...
Selecting previously unselected package mysql-client.
Preparing to unpack .../mysql-client_5.5.53-0+deb8u1_all.deb ...
Unpacking mysql-client (5.5.53-0+deb8u1) ...
Selecting previously unselected package bacula-director-mysql.
Preparing to unpack .../bacula-director-mysql_5.2.6+dfsg-9.3_armhf.deb ...
Unpacking bacula-director-mysql (5.2.6+dfsg-9.3) ...
Selecting previously unselected package mysql-server.
Preparing to unpack .../mysql-server_5.5.53-0+deb8u1_all.deb ...
Unpacking mysql-server (5.5.53-0+deb8u1) ...
Processing triggers for man-db (2.7.0.2-5) ...
Processing triggers for systemd (215-17+deb8u6) ...
Errors were encountered while processing:
/var/cache/apt/archives/mysql-server-5.5_5.5.53-0+deb8u1_armhf.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

¿Alguna idea de como solucionarlo? o será más fácila compilar la nueva versión e intentar usarla con mariadb?

Saludos

raspdroid
Posts: 1619
Joined: Thu Nov 06, 2014 9:15 am
Location: Gran Canaria :: España

Re: Configurando Bacula en Raspbian Jessie

Wed Jan 18, 2017 11:34 pm

mmm que torpe ahora leyendo el output vi que lo dice bien claro, si se quiere hacer un downgrade hay que elimiar el archivo debian-10.0.flag, lo que hice fue renombrarlo por si acaso:

Code: Select all

sudo mv /var/lib/mysql/debian-10.0.flag /var/lib/mysql/debian-10.0.flag.olg
Ahora parece que sí:

Code: Select all

sudo apt-get -f install

raspdroid
Posts: 1619
Joined: Thu Nov 06, 2014 9:15 am
Location: Gran Canaria :: España

Re: Configurando Bacula en Raspbian Jessie

Wed Jan 18, 2017 11:36 pm

Pero me sigue dando errores... :(
The following NEW packages will be installed:
mysql-server-5.5
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
7 not fully installed or removed.
Need to get 0 B/1,591 kB of archives.
After this operation, 30.8 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Preconfiguring packages ...
(Reading database ... 32495 files and directories currently installed.)
Preparing to unpack .../mysql-server-5.5_5.5.53-0+deb8u1_armhf.deb ...
Unpacking mysql-server-5.5 (5.5.53-0+deb8u1) ...
Processing triggers for man-db (2.7.0.2-5) ...
Processing triggers for systemd (215-17+deb8u6) ...
Setting up bacula-director-common (5.2.6+dfsg-9.3) ...
Setting up dbconfig-common (1.8.47+nmu3+deb8u1) ...
Setting up mysql-client-5.5 (5.5.53-0+deb8u1) ...
Setting up mysql-client (5.5.53-0+deb8u1) ...
Setting up bacula-director-mysql (5.2.6+dfsg-9.3) ...
dbconfig-common: writing config to /etc/dbconfig-common/bacula-director-mysql.conf
Processing configuration...Ok.
Setting up mysql-server-core-5.5 (5.5.53-0+deb8u1) ...
Setting up mysql-server-5.5 (5.5.53-0+deb8u1) ...
Installing new version of config file /etc/apparmor.d/usr.sbin.mysqld ...
Installing new version of config file /etc/init.d/mysql ...
Installing new version of config file /etc/logrotate.d/mysql-server ...
Installing new version of config file /etc/mysql/conf.d/mysqld_safe_syslog.cnf ...
Installing new version of config file /etc/mysql/debian-start ...
170118 23:34:04 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
170118 23:34:04 [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.
170118 23:34:04 [Note] /usr/sbin/mysqld (mysqld 5.5.53-0+deb8u1) starting as process 2647 ...
Job for mysql.service failed. See 'systemctl status mysql.service' and 'journalctl -xn' for details.
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing package mysql-server-5.5 (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.5; however:
Package mysql-server-5.5 is not configured yet.

dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured
Processing triggers for systemd (215-17+deb8u6) ...
Errors were encountered while processing:
mysql-server-5.5
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
sudo systemctl status mysql.service -l
● mysql.service - LSB: Start and stop the mysql database server daemon
Loaded: loaded (/etc/init.d/mysql)
Active: failed (Result: exit-code) since Wed 2017-01-18 23:35:09 UTC; 4min 51s ago

Jan 18 23:35:09 servidor /etc/init.d/mysql[3960]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in
Jan 18 23:35:09 servidor mysql[2848]: Starting MySQL database server: mysqld . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . failed!
Jan 18 23:35:09 servidor systemd[1]: mysql.service: control process exited, code=exited status=1
Jan 18 23:35:09 servidor systemd[1]: Failed to start LSB: Start and stop the mysql database server daemon.
Jan 18 23:35:09 servidor systemd[1]: Unit mysql.service entered failed state.

raspdroid
Posts: 1619
Joined: Thu Nov 06, 2014 9:15 am
Location: Gran Canaria :: España

Re: Configurando Bacula en Raspbian Jessie

Fri Jan 20, 2017 11:48 pm

Probé a usar la versión 7.4 con Mariadb-10 en Raspbian Jessie pero sin resultados, si lo configuro para compilar con mysql luego cuando compila no encuentra mysql.h y si lo intento con sqlite3 pues no encuentra sqlite3.h por lo que desistí.

Al final creo que voy a usar rdiff-backup que está basado en rsync y sirve para hacer copias incrementales y completas (entre otras cosas).

Saludos

Return to “Español”