En el artículo anterior, explique como se pueden sincronizar archivos de nuestro servidor Linux en el servicio S3 de Amazon Web Service. Eso funciona bien, pero ahora quiero integrarlo con Bacula. Crear volumenes de almacenamiento en la nube de Amazon. En fin, combinar dos excelesntes sistemas de respaldo!
En este artículo NO VOY A EXPLICAR como funciona Bacula. Voy a explicar como integrar S3 en tu sistema de archivos.
Preparando lo que necesitamos para la instalación:
# aptitude install build-essential libcurl4-openssl-dev libxml2-dev libfuse-dev checkinstall
Descargamos la mas reciente versión de s3fs de la pagina web oficial http://code.google.com/p/s3fs/wiki/FuseOverAmazon y descomprimimos:
# wget -c http://s3fs.googlecode.com/files/s3fs-1.61.tar.gz # tar xvfz s3fs-1.61.tar.gz
Compilamos e instalamos:
# ./configure --prefix=/usr checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... no checking for mawk... mawk checking whether make sets $(MAKE)... yes checking for g++... g++ checking whether the C++ compiler works... yes checking for C++ compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking for style of include used by make... GNU checking dependency style of g++... gcc3 checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking for DEPS... no configure: error: Package requirements (fuse >= 2.8.4 libcurl >= 7.0 libxml-2.0 >= 2.6 libcrypto >= 0.9) were not met: Requested 'fuse >= 2.8.4' but version of fuse is 2.8.1 Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables DEPS_CFLAGS and DEPS_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.
Oups... nuestro ubuntu 10.04 tiene la versión 2.8.1 de fuse!!!
Instalando fuse 2.8.4
Elimino cualquier rastro del la versión de fuse actual. En mi caso fue suficiente con:
# aptitude purge fuse-utils libfuse-dev libfuse2
Sin embargo revisa que no quede nada.
Descargo fuse de launchpad y lo instalo:
# wget https://launchpad.net/ubuntu/+archive/primary/+files/fuse_2.8.4.orig.tar.gz
# ./configure
# make
A mi me gusta debianizar los paquetes asi que instalo checkinstall y ejecuto:
# checkinstall -D make install # dpkg -i fuse_2.8.4-1_amd64.deb
O simplemente instalo fuse...
# make install
Ahora si, continuamos con nuestra instalación de s3fs:
# ./configure # make
Creamos el paquete .deb nuevamente:
# checkinstall -D make install
O simplemente instalo s3fs...
# make install
Creo el archivo de configuración con las claves que ofrece Amazon:
# nano /etc/passwd-s3fs [accessKeyId]:[secretAccessKey]
Cambio el permiso del archivo:
# chmod 640 /etc/passwd-s3fs
Creo el punto de montaje
# mkdir /mnt/s3
Actualizamos las librerias:
# ldconfig
Sino lo haces obtendras el siguiente error:
s3fs: error while loading shared libraries: libfuse.so.2: cannot open shared object file: No such file or directory
Montamos el bucket a mano para probarlo
# s3fs [your-s3-bucket-name] /mnt/s3 -ouse_cache=/tmp -o allow_other
Puedes montarlo automáticamente agregando la siguiente línea en el fstab:
s3fs#[your-s3-bucket-name] /mnt/s3/blah fuse use_cache=/tmp,allow_other 0 0



Google
Facebook
Twitter
Del.icoi.us
Blogger
Rain Concert