Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Indexing and Searching Services

Since the 5.0  version of the dLibra system, it has been possible to divide the search service

Usługi indeksowania i wyszukiwania

Od wersji 5.0 dLibry istnieje możliwość rozdzielenia usługi wyszukiwania (Search Server) znanej z wersji known from version 4.0 na dwie osobne usługi zajmujące się wyszukiwaniem into two separate services, for searching (Search Server) i indeksowaniem and indexing (Index Server) niezależnie od siebie. Domyślna konfiguracja serwera dLibry zakłada, że obie usługi działają w ramach tej samej maszyny wirtualnej Java i współdzielą ten sam katalog z indeksem wyszukiwawczym. Konfiguracja taka odpowiada konfiguracji z wersji 4.0 (niezależnie od tego, czy usługa wyszukiwania umieszczona jest wraz z innymi usługami serwera dLibra czy uruchomiona jest na oddzielnej maszynie). Oprócz domyślnej konfiguracji dLibra udostępnia dwie inne możliwości różniące się fizycznym rozmieszczeniem usług.

Search Server i Index Server na tej samej maszynie

Rozwiązanie to zakłada, że usługi Search Server i Index Server będą umieszczone na jednej fizycznej maszynie, jednak będą działać w ramach oddzielnych maszyn wirtualnych Java. W celu uzyskania takiej konfiguracji należy wykonać następujące kroki:

, which are independent from each other. In the default configuration of the dLibra server, both services operate within the framework of the same Java virtual machine and share the same catalog with a search index. Such a configuration corresponds to the configuration from version 4.0 (regardless of whether the search service is located together with other services of the dLibra server or if it is run on a separate machine). Apart from the default configuration, the dLibra system makes available two other options, which differ with respect to the physical distribution of the services.

Search Server and Index Server on the Same Machine

In that solution, the Search Server and Index Server services are located on the same physical machine but operate within the framework of separate Java virtual machines. In order to obtain such a configuration, the user has to take the following steps:

  • Copy the server directory (without the “logs” subdirectory) to the new location and, optionally, change the name of the directory so that it indiates that it refers to the Index Server service. Further in the text, we will – for clarity’s sake –  call the original directory of the server SE and the copied catalog with the Index Server – IS.
  • Delete the SE/conf/is subdirectory.
  • Open the SE/conf/server.xml file in the <service-list> section; remove the part concerning the Index Server service.
  • In subdirectory IS/conf, remove all subdirectories apart from is, mx, and wrapper.
  • Open file IS/conf/server.xml; in section <service-list>, remove all entries apart from those which concern th eIndex Server service and the JMX interface. Also, change the value of parameter serverPort to a different one than its counterpart in file SE/conf/server.xml (for example, if parametr serverPort has value 10051 in file SE/conf/server.xml, then the value can be set to 11051 in file IS/conf/server.xml). If section <systemServicesUrl> is commented out, then the comment should be removed, and the URL should be entered in the System Services service (the address and port of the server correspond to the intial server).
  • In the database, in table SYS_SERVICES, modify the entry pertaining to the Index Server service, by changing the value of column SER_PORT to the value set in file IS/conf/server.xml in the previous step.
  • In the same table, add a new tuple corresponding to the JMX interface for the new Index Server. Here is an example for the Oracle database

  • Kopiujemy katalog serwera (bez podkatalogu logs) do nowej lokalizacji i opcjonalnie zmieniamy nazwę katalogu w taki sposób, by wskazywała, że dotyczy usługi Index Server. Dalej na potrzebę przejrzystości opisu pierwotny katalog serwera nazywać będziemy SE natomiast skopiowany katalog z usługą Index Server nazywać będziemy IS.
  • Usuwamy podkatalog SE/conf/is.
  • Otwieramy plik SE/conf/server.xml i w sekcji <service-list> usuwamy wpis dotyczący usługi Index Server.
  • W podkatalogu IS/conf usuwamy wszystkie podkatalogi oprócz is, mx, wrapper.
  • Otwieramy plik IS/conf/server.xml i w sekcji <service-list> usuwamy wszystkie wpisy oprócz tych dotyczących usługi Index Server i interfejsu JMX. Oprócz tego zmieniamy parametr serverPort na wartość inną niż odpowiedni parametr w pliku SE/conf/server.xml (np. jeśli w SE/conf/server.xml parametr serverPort ma wartość 10051 to w pliku IS/conf/server.xml parametr ten można ustawić na wartość 11051). Jeśli sekcja <systemServicesUrl> jest zakomentowana, należy komentarz usunąć i wprowadzić URL do usługi System Services (adres i port serwera odpowiadają pierwotnemu serwerowi).
  • W bazie danych modyfikujemy w tabeli SYS_SERVICES wpis dotyczący usługi Index Server zmieniając wartość kolumny SER_PORT na taką, jaka ustawiona została w pliku IS/conf/server.xml w poprzednim kroku.
  • W tej samej tabeli dopisujemy nową krotkę odpowiadającą interfejsowi JMX dla nowego Index Servera. Przykład dla bazy danych Oracle:

    Code Block
    insert into SYS_SERVICES
    (SER_ID, SER_TYPE, SER_DESCRIPTION,
     SER_VERSION, SER_CONNECTED, SER_PASSWORD,
     SER_HOST, SER_PORT)
    values
    (SYS_SERVICES_SER_ID_SEQ.NEXTVAL, 'mx', 'dLibra JMX Management Service',
     '5.0', 0, '@ME_PASSWD@',
     '@SERVER_HOSTNAME@', @SERVER_PORT@);
    

    Parametry Parameters @ME_PASSWD@, @SERVER_HOSTNAME@ i , and @SERVER_PORT@ należy zamienić zgodnie z wartościami umieszczonymi w pliku should be changed in accordance with the values in file IS/conf/server.xml.

  • Kopiujemy katalog zawierający indeksy wyszukiwawcze (ścieżka do tego katalogu zapisana jest w pliku Copy the directory which contains search indexes (the path to that directory is saved in file SE/conf/lucene.properties w kluczu , in key indexDirectory). Ścieżkę do nowej lokalizacji indeksów wpisujemy do klucza indexDirectory pliku Enter the path to the new index location in key indexDirectory of file IS/conf/lucene.properties. Podobnie postępujemy z katalogiem zawierającym kopie zapasowe indeksów wyszukiwawczych, przy czym należy uwzględnić fakt, iż ścieżka do tego katalogu zapisana jest pod kluczem indexBackupDirectory.Do the same for the directory which contains the backup copies of search indexes, taking into account the fact that the path to that directory is saved at key indexBackupDirectory.
  • Start up the dLibra server from the SE directory, and then from the IS directory. After the first startup of such a service configuration, file services.dat will be created in the directories of both servers. It should be used for generating new licensesUruchamiamy serwer dLibra z katalogu SE, następnie z katalogu IS. Po pierwszym uruchomieniu takiej konfiguracji usług w katalogach obu serwerów powstanie plik services.dat, który należy wykorzystać do wygenerowania nowych licencji.

 

Search Server

...

and Index Server

...

Rozwiązanie to zakłada, że usługi Search Server i Index Server będą umieszczone na osobnych fizycznych maszynach, więc naturalnie będą działać w ramach oddzielnych maszyn wirtualnych Java. W celu uzyskania takiej konfiguracji należy wykonać następujące kroki:

on Separate Machines

In that solution, the Search Server and Index Server services are located on separate physical machines and, consequently, operate within the framework of separate Java virtual machines. In order to obtain such a configuration, the user has to take the following steps:

  • Copy the server directory (without the “logs” subdirectory) to the new location on a separate machine and, optionally, change the name of the directory so that it indiates that it refers to the Index Server service. Further in the text, we will – for clarity’s sake –  call the original directory of the server SE and the copied catalog with the Index Server – IS.
  • Delete the SE/conf/is subdirectory.
  • Open the
  • Kopiujemy katalog serwera (bez podkatalogu logs) do nowej lokalizacji na osobnej maszynie i opcjonalnie zmieniamy nazwę katalogu w taki sposób, by wskazywała, że dotyczy usługi Index Server. Dalej na potrzebę przejrzystości opisu pierwotny katalog serwera nazywać będziemy SE natomiast skopiowany katalog z usługą Index Server nazywać będziemy IS.
  • Usuwamy podkatalog SE/conf/is.
  • Otwieramy plik SE/conf/server.xml i w sekcji file in the <service-list> usuwamy wpis dotyczący usługi section; remove the part concerning the Index Server service.
  • W podkatalogu IS/conf usuwamy wszystkie podkatalogi oprócz is, mx, wrapper.Otwieramy plik
  • Open file IS/conf/server.xml i w sekcji ; in section <service-list> usuwamy wszystkie wpisy oprócz tych dotyczących usługi Index Server i interfejsu JMX. Oprócz tego zmieniamy parametr serverHost na wartość odpowiadającą adresowi IP maszyny, na której umieszczono Index Server, wartość parametru serverPort może pozostać bez zmian. Jeśli sekcja <systemServicesUrl> jest zakomentowana, należy komentarz usunąć i wprowadzić URL do usługi System Services (adres i port serwera odpowiadają pierwotnemu serwerowi)., remove all entries apart from those which concern th eIndex Server service and the JMX interface. Also, change parameter serverHost  to a value which corresponds to the IP address of the machine on which the Index Server has been placed; the value of parameter serverPort can remain as is. If section <systemServicesUrl> is commented out, then the comment should be removed, and the URL should be entered in the System Services service (the address and port of the server correspond to the initial server).
  • In the database, in table SYS_SERVICES, modify the entry pertaining to the Index Server service, by changing the values of columns SER_HOST and SER_PORT to the values set in file W bazie danych modyfikujemy w tabeli SYS_SERVICES wpis dotyczący usługi Index Server zmieniając wartości kolumn SER_HOST i SER_PORT na takie, jakie ustawione zostały w pliku IS/conf/server.xml w poprzednim kroku. in the previous step.
  • In the same table, add a new tuple corresponding to the JMX interface for the new Index Server. Here is an example for the Oracle databaseW tej samej tabeli dopisujemy nową krotkę odpowiadającą interfejsowi JMX dla nowego Index Servera. Przykład dla bazy danych Oracle:

    Code Block
    insert into SYS_SERVICES
    (SER_ID, SER_TYPE, SER_DESCRIPTION,
     SER_VERSION, SER_CONNECTED, SER_PASSWORD,
     SER_HOST, SER_PORT)
    values
    (SYS_SERVICES_SER_ID_SEQ.NEXTVAL, 'mx', 'dLibra JMX Management Service',
     '5.0', 0, '@ME_PASSWD@',
     '@SERVER_HOSTNAME@', @SERVER_PORT@);
    

    Parametry @ME_PASSWD@, @SERVER_HOSTNAME@ i @SERVER_PORT@ należy zamienić zgodnie z wartościami umieszczonymi w pliku IS/conf/server.xml.

  • Kopiujemy katalog zawierający indeksy wyszukiwawcze (ścieżka do tego katalogu zapisana jest w pliku Copy the directory which contains search indexes (the path to that directory is saved in file SE/conf/lucene.properties w kluczu indexDirectory) na maszynę z usługą Index Server. Ścieżkę do nowej lokalizacji indeksów wpisujemy do klucza indexDirectory pliku , in key indexDirectory) to the machine with the Index Server service. Enter the path to the new index location in key indexDirectory of file IS/conf/lucene.properties. Podobnie postępujemy z katalogiem zawierającym kopie zapasowe indeksów wyszukiwawczych, przy czym należy uwzględnić fakt, iż ścieżka do tego katalogu zapisana jest pod kluczem indexBackupDirectory.
  • Uruchamiamy serwer dLibra z katalogu SE, następnie z katalogu IS. Po pierwszym uruchomieniu takiej konfiguracji usług w katalogach obu serwerów powstanie plik services.dat, który należy wykorzystać do wygenerowania nowych licencji.

 

Konfiguracja synchronizacji indeksów wyszukiwawczych

  • Do the same for the directory which contains the backup copies of search indexes, taking into account the fact that the path to that directory is saved at key indexBackupDirectory.
  • Start up the dLibra server from the SE directory, and then from theIS directory. After the first startup of such a service configuration, file services.dat will be created in the directories of both servers. It should be used for generating new licenses.

 

Configuring the Synchronization of Search Indexes

The separation of the indexing and searching services makes them operate on independent search indexes. As a result, the index used for searching is not always current, and it has to be periodically refreshed. The dLibra server has a mechanism for synchronizing the indexes between the Index Server and Search Server services. The synchronization is run in accordance with the settings of the periodic task defined in file Rozdzielenie usług indeksującej i wyszukującej powoduje, że działają one na niezależnych od siebie indeksach wyszukiwawczych. Konsekwencją tego jest fakt, iż indeks wykorzystywany do wyszukiwania nie zawsze jest aktualny i wymaga okresowego odświeżania. Serwer dLibry wyposażony jest w mechanizm synchronizacji indeksów pomiędzy usługami Index Server i Search Server. Synchronizacja uruchamiana jest zgodnie z ustawieniami zadania okresowego zdefiniowanego w pliku SE/conf/se/jobs.xml. Domyślny plan synchronizacji zakłada, że indeks treści (a także indeksy słownikowe *_spell) z racji swojego rozmiaru będzie synchronizowany oddzielnie od indeksów metadanych. Plan ten można dostosować do własnych potrzeb modyfikując wyrażenia CRON dla poszczególnych zadań. Możliwe jest również utworzenie dodatkowych zadań okresowych związanych z konkretnym typem indeksów.

 

Uwagi

  • Oba rozwiązania zakładają, że wydzielenie usługi Index Server odbywa się z konfiguracji umieszczonej na 1 maszynie. W zwiazku z tym usługa Search Server jest umieszczona razem z pozostałymi usługami, ale w miarę możliwości można ją wydzielić na osobną maszynę podobnie jak Index Server.

In the default synchronization plan, the content index (as well as the _spell dictionary indexes) is synchronized separately from metadata indexes because of its size. The plan can be adjusted to individual needs, by modifying the CRON expressions for particular tasks. Additional periodic tasks related to particular index types can also be created.

 

Notes

  • In both solutions, the Index Server service is separated from a configuration placed on one machine. For that reason, the Search Server is placed together with the remaining services, but in need, it can be separated and placed on another machine, just like the Index Server.
  • Since index synchronization makes use of the system temporary directory, there should be enough free space on the drive. During a synchronization, a mechanism for creating backup copies which operates on ZIP archives is used, so the amount of free space should be sufficient for storing both the ZIP archive of all indexes and their unpacked versions, as well as the current version of search indexesZ uwagi na to, iż synchronizacja indeksów wykorzystuje systemowy katalog tymczasowy należy zapewnić odpowiednią ilość wolnego miejsca na dysku. W czasie synchronizacji wykorzystywany jest mechanizm kopii zapasowych operujący na archiwach ZIP, należy więc tak dostosować ilość wolnego miejsca, aby było możliwe jednoczesne przechowywanie archiwum ZIP wszystkich indeksów oraz ich postaci niespakowanych równolegle z bieżącą wersją indeksów wyszukiwawczych.