[Koha] Multiple Kohas (and zebras) on one server

Magnus Enger magnus at enger.priv.no
Fri Jul 18 01:22:14 NZST 2008


Dear all, 

I am a Norwegian librarian/hacker, investigating the possibilities of 
offering Koha hosted on Amazon EC2 to Norwegian libraries. To achieve 
some economics of scale I am ineterested in hosting two or more 
installations of Koha (w/Zebra) on one server (or instance, in the EC2 
lingo). 

So far I have one "standard" installation of Koha running normally (on 
Debian 4.0 Etch, using ami-8bbc58e2 from http://alestic.com/): 
http://koha.collib.info/ 
(I have loaded the MARC-records from Project Gutenberg in this 
installastion to see what it looks like...)

I have also been able to make a second installation on the same 
instance (using the "single" option at the beginning of Makefile.PL, 
and putting all the files in /mnt/kohanor - my idea/goal is to 
eventualy be able to put several "single" installations into 
subdirectories in /mnt), and to configure Apache to recognize it: 
http://kohanor.collib.info/

So far this approach has brought to light at least two problems: 

PROBLEM 1: Getting a working Zebra for the second installation
It seems that selecting the "single" install does not alter a lot of 
the relevant settings in koha-conf.xml (and other config files) from 
the default, so initially I got the same results when I searched 
kohanor.collib.info as when I searched koha.collib.info, which looks 
great but wasn't quite what I was after... 

I have edited koha-conf.xml and zebra-biblios.cfg as well as 
koha-zebra-ctl.sh and koha-zebraqueue-ctl.sh to reflect the relevant 
paths for a "single" installation in /mnt/kohanor. I have created new 
daemons for the installation in /mnt/kohanor with these incantations: 

$ ln -s /mnt/kohanor/bin/koha-zebra-ctl.sh /etc/init.d/kohanor-zebra-daemon
$ update-rc.d kohanor-zebra-daemon defaults
$ /etc/init.d/kohanor-zebra-daemon start

$ ln -s /mnt/kohanor/bin/koha-zebraqueue-ctl.sh
/etc/init.d/kohanor-zebraqueue-daemon
$ update-rc.d kohanor-zebraqueue-daemon defaults
$ /etc/init.d/kohanor-zebraqueue-daemon start

ps shows that two zebras are indeed running, but cataloguing a book 
and searching for it gives no results. It is in the "biblio" and 
"biblioitems" tables (in the correct database) in MySQL, though.

Exporting KOHA_CONF and running rebuild_zebra.pl gives this output (I 
have tried cataloguing three books by now):

$ export KOHA_CONF=/mnt/kohanor/etc/koha-conf.xml
$ /mnt/kohanor/bin/migration_tools/rebuild_zebra.pl -b

Zebra configuration information
================================
Zebra biblio directory	    = /mnt/kohanor/var/lib/zebradb/biblios
Zebra authorities directory = /mnt/kohanor/var/lib/zebradb/authorities
Koha directory		    = /mnt/kohanor/intranet/cgi-bin
BIBLIONUMBER in :     999$c
BIBLIOITEMNUMBER in : 999$d
================================
skipping authorities
====================
exporting biblio
====================
1..
Records exported: 3
====================
REINDEXING zebra
====================
12:49:48-17/07 zebraidx(19141) [log] zebra_start 2.0.32 
/mnt/kohanor/etc/zebradb/zebra-biblios.cfg
12:49:48-17/07 zebraidx(19141) [log] Loaded filter module 
/usr/lib/idzebra-2.0/modules/mod-dom.so
12:49:48-17/07 zebraidx(19141) [log] Loaded filter module 
/usr/lib/idzebra-2.0/modules/mod-grs-marc.so
12:49:48-17/07 zebraidx(19141) [log] Loaded filter module 
/usr/lib/idzebra-2.0/modules/mod-grs-regx.so
12:49:48-17/07 zebraidx(19141) [log] Loaded filter module 
/usr/lib/idzebra-2.0/modules/mod-text.so
12:49:48-17/07 zebraidx(19141) [log] Loaded filter module 
/usr/lib/idzebra-2.0/modules/mod-grs-xml.so
12:49:48-17/07 zebraidx(19141) [log] Loaded filter module 
/usr/lib/idzebra-2.0/modules/mod-alvis.so
12:49:48-17/07 zebraidx(19141) [log] enabling shadow 
spec=/mnt/kohanor/var/lib/zebradb/biblios/shadow:4G
12:49:48-17/07 zebraidx(19141) [log] cache_fname = 
/mnt/kohanor/var/lib/zebradb/biblios/shadow/cache
12:49:48-17/07 zebraidx(19141) [log] dir /tmp/5Xdrm17vr7/biblio
12:49:48-17/07 zebraidx(19141) [log] update grs.marcxml.record 
/tmp/5Xdrm17vr7/biblio/exported_records 0
12:49:48-17/07 zebraidx(19141) [log] update grs.marcxml.record 
/tmp/5Xdrm17vr7/biblio/exported_records 1625
12:49:48-17/07 zebraidx(19141) [log] update grs.marcxml.record 
/tmp/5Xdrm17vr7/biblio/exported_records 2800
12:49:48-17/07 zebraidx(19141) [log] Iterations: isam/dict 8/2
12:49:48-17/07 zebraidx(19141) [log] Dict: inserts/updates/deletions: 
1/0/1
12:49:49-17/07 zebraidx(19141) [log] Records: 3 i/u/d 0/3/0
12:49:49-17/07 zebraidx(19141) [log] zebra_stop: 0.31 0.03 0.02
12:49:49-17/07 zebraidx(19143) [log] zebra_start 2.0.32 
/mnt/kohanor/etc/zebradb/zebra-biblios.cfg
12:49:49-17/07 zebraidx(19143) [log] Loaded filter module 
/usr/lib/idzebra-2.0/modules/mod-dom.so
12:49:49-17/07 zebraidx(19143) [log] Loaded filter module 
/usr/lib/idzebra-2.0/modules/mod-grs-marc.so
12:49:49-17/07 zebraidx(19143) [log] Loaded filter module 
/usr/lib/idzebra-2.0/modules/mod-grs-regx.so
12:49:49-17/07 zebraidx(19143) [log] Loaded filter module 
/usr/lib/idzebra-2.0/modules/mod-text.so
12:49:49-17/07 zebraidx(19143) [log] Loaded filter module 
/usr/lib/idzebra-2.0/modules/mod-grs-xml.so
12:49:49-17/07 zebraidx(19143) [log] Loaded filter module 
/usr/lib/idzebra-2.0/modules/mod-alvis.so
12:49:49-17/07 zebraidx(19143) [log] enabling shadow 
spec=/mnt/kohanor/var/lib/zebradb/biblios/shadow:4G
12:49:49-17/07 zebraidx(19143) [log] cache_fname = 
/mnt/kohanor/var/lib/zebradb/biblios/shadow/cache
12:49:49-17/07 zebraidx(19143) [log] zebra_stop: 0.15 0.00 0.01
====================
CLEANING
====================

No errors, but still no results in search:
http://kohanor.collib.info/cgi-bin/koha/opac-search.pl?q=lessig

My guess is that there are still some missing settings somewhere, and 
I will continue my investigations along this path. 


PROBLEM 2: Getting the command line-scripts that rely on the 
environment variables KOHA_CONF and PERL5LIB to work. I imagine 
writing some kind of wrapper-script that would set these variables 
before executing the actual script, but I havn't actually got around 
to trying it yet. 


Anyone have any thoughts/experiences to share on these points? Or 
anything else relating to multiple installations on one server? Is 
there some completely other approach to this that I'm not thinking of? 
(I have looked briefly at chroot, but it looks like getting all the 
dependencies into the "jails" would be non-trivial too. Virtualization 
might have worked, except I'm already doing this in a virtualized 
environment...) Any insights would be greatly appreciated! 

Regards, 
Magnus Enger


More information about the Koha mailing list