For performance reasons, it is recommended to keep indexes local to the machine running Архива. The store data, however, may be stored on an network attached storage device (NAS) or storage area network (SAN).
On Windows, when refering to a remote paths, it is possible to specify the network path as a standard UNC path (e.g. "\\server\share\file_path").
The Архива Windows Service may not have sufficient access to mapped drives. It may be necessary to change the user account the Архива service is running under. To accomplish this, from the Services Control Panel applet (not the Архива task tray icon configuration!), select the service, right click, select Properties, select Logon Tab, enter network Administrator account login account details, save and restart the Архива server.
In the Volumes tab of the Архива configuration, click add new volume. Enter the UNC network path as the store directory (e.g. server\store\store0). Make sure the index path you enter is on a local drive (e.g. c:\index).
To use an external storage device, it is best to define a mount point to the root of the NAS device (e.g. \mnt\mailarchiva) using the Linux mount, smbmount or nfsmount commands. When adding multiple volumes in the Архива configuration screen, in the store directory field, specify a sub directory of the mount point (e.g. \mnt\mailarchiva\store1).
Архива will automatically create the directory store1 (you do not need to do this yourself!). Using this configuration, one does not need to create multiple mount points for each volume. Be sure to add the mount point to fstab so that upon machine reboot, Архива will continue to have access to the device
.
If Архива is being configured to write to an external NAS, whether the volume store or the backup store, it is important ensure that the directory where the mount point is created is immutable (i.e. not writeable even by ROOT). This ensures that Архива will not write data to the local drive when the mount point is disconnected. This is especially important in situations where mount points are unstable.
Edit the startserver script with /usr/local/mailarchiva/server/startserver. Add the line umask 022 in the beginning to ensure that rw permissions to ROOT only.
Remote SMB/NFS Share Locking
MailArchiva's archiving engine is highly complex and uses very sophisticated locking. You can use mounted shares, but some poorly implemented NAS'ses are seemingly unable cope with the locking and synchronization requirements of our archiving engine. To resolve, please disable strict locking in the SMB or NFS drivers.
For example, for SMB shares, disable strict locking in smb.conf as follows:
[global] strict locking = no |
If this remedy does not help, it is possible to switch Архива to use more rudimentary file format. In Configuration->Archive, set volume format to V1.
Auto Mount Script
To ensure that remote mount points are remounted, insert this script in a cron job:
---------------------------------------------------------------------- created check_mount script [ /usr/local/sbin/check_mounts.sh ] ---------------------------------------------------------------------- #!/bin/sh # -------------------------------------------------------------------- # purpose: check mounted partitions, # log if not mounted + mount and notify admins # args: none # deps: bash, GNU utils, logger, /proc, /etc/fstab # -------------------------------------------------------------------- # -------------------------------------------------------------------- # configuration # -------------------------------------------------------------------- FSTAB_EXCL="(^#|noauto|none|user)" PROGNAME=$(basename $0) export PATH="/bin:/sbin:/usr/bin:/usr/sbin" # -------------------------------------------------------------------- # -------------------------------------------------------------------- # configure destination address for emails (admins) # -------------------------------------------------------------------- if [ -f /etc/default/suk_scripts ]; then . /etc/default/suk_scripts; else ROOTMAIL="root@`hostname --fqdn`" fi # -------------------------------------------------------------------- # -------------------------------------------------------------------- # functions # -------------------------------------------------------------------- function err_descr() { case "$?" in 0) err_rv="OK" ;; 1) err_rv="FAILED" ;; *) err_rv="$?" ;; esac; } function log() { /usr/bin/logger -i -p kern.warn -t ${PROGNAME} "$@"; } function log_mail() { mail -s "$@" ${ROOTMAIL} ; log "$@"; } # -------------------------------------------------------------------- # -------------------------------------------------------------------- # check mounts # -------------------------------------------------------------------- if [ ! -f /proc/mounts ]; then log "WARN: /proc wasn't mounted!" mount -t proc proc /proc; err_descr err_descr log_mail "WARN: mounted /proc (${err_rv})" fi egrep /etc/fstab -ve "${FSTAB_EXCL}" | while read i; do i=( ${i} ) # empty ? case ${#i[0]} in 0) log_mail "FATAL: I shouldn't have read ${i[@]} !" eval ${i[0]:=ERROR} 2>/dev/null ;; esac # select device case ${i[0]} in /dev*) dev=( ${i[0]} ${i[1]} ) ;; *) dev=( UNKNOWN UNKNOWN ) ;; esac # munge rootfs case "${#dev[1]}" in 1) case "${dev[1]}" in /) dev[0]=/dev/root ;; esac ;; esac # check mounts grep /proc/mounts -e ${dev[0]} &> /dev/null case "$?" in 1) case ${dev[0]} in /dev/root) /bin/true ;; UNKNOWN) ;; *) log "WARN: ${dev[1]} isn't mounted" mount ${dev[1]}; err_descr log_mail "INFO: mounted ${dev[1]}" ;; esac ;; esac done # -------------------------------------------------------------------- exit $? ---------------------------------------------------------------------- ---------------------------------------------------------------------- added check_mounts to cron [ /etc/cron.d/check_mounts ] ---------------------------------------------------------------------- */15 * * * * root /usr/local/sbin/check_mounts.sh ---------------------------------------------------------------------- |