Load Balancing

Before setting up Highlighter instances for load balancing, make sure to understand its data files.

Load Balancing using Pro Edition

With Highlighter Pro Edition, load balancing strategy consists of keeping full text search index local to Highlighter instance and sharing cache files among instances via network attached storage.

Configuration example:

application.conf
# we define own properties that we'll reuse later in the config
myHighlighterSharedDataHome = "/shared/folder/highlighter" # network attached storage location
myHighlighterInstanceDataHome = "/var/highlighter" # local (or at least instance private) path
 
# highlighter config
highlighter {
# set local data properties
dataDir = ${myHighlighterInstanceDataHome}
indexing.indexesHomeDir = ${myHighlighterInstanceDataHome}"/index/solr"
# override cache locations
caching {
docsCacheDir = ${myHighlighterSharedDataHome}"/results"
metaCacheDir = ${myHighlighterSharedDataHome}"/results"
}
storage {
textpos {
implementation = files
files.textCacheDir = ${myHighlighterSharedDataHome}"/textpos"
}
}
}

Full text search index cannot be shared between instances due to file locking. Each Highlighter instance will maintain own copy of index.

Load Balancing using Enterprise Edition

Beside the above described data storage strategy, Highlighter Enterprise Edition allows:

  • Use of a relational database for cache file storage, and

  • Use of an external Solr instance.

Using Database Storage

Supported databases are listed below. Instructions for manual population of a database are provided where needed. Where not, Highlighter should automatically create a valid schema.

To connect to a database, Highlighter server needs the database specific JDBC (Java Database Connectivity) drivers. Download driver jar file linked in appropriate database section, and copy it to Highlighter's conf folder.

In the config examples we use the same database for both results and text positions cache but you can use separate databases if you like.

Postgres

Download JDBC driver jar here (bundle link in the Files section) and install as described above.

Create database "highlighter-db" and user with appropriate access rights.

Copy config snippet below to your application conf, update for database server and user credentials.

application.conf
highlighter {
storage {
textpos {
implementation = db
db {
url = "jdbc:postgresql://localhost/highlighter-db?ssl=false"
username = "hluser"
password = "hlpass"
}
}
results {
implementation = db
db {
url = "jdbc:postgresql://localhost/highlighter-db?ssl=false"
username = "hluser"
password = "hlpass"
}
}
}
}

SQL Server

Download JDBC driver jar here (jar link in the Files section) and install as described above.

Create database "highlighter-db" and user with appropriate access rights.

Copy config snippet below to your application conf, update for database server and user credentials.

application.conf
highlighter {
storage {
textpos {
implementation = db
db {
url = "jdbc:sqlserver://localhost:1433;databaseName=highlighter-db"
username = "hluser"
password = "hlpass"
}
}
results {
implementation = db
db {
url = "jdbc:sqlserver://localhost:1433;databaseName=highlighter-db"
username = "hluser"
password = "hlpass"
}
}
}
}

MySQL / MariaDB

Download JDBC driver jar here (jar link in the Files section) and install as described above.

Create database "highlighter-db" and user with appropriate access rights. Create database schema.

Copy config snippet below to your application conf, update for database server and user credentials.

application.conf
highlighter {
storage {
textpos {
implementation = db
db {
url = "jdbc:sqlserver://localhost:3306/highlighter-db?ssl=false"
username = "hluser"
password = "hlpass"
}
}
results {
implementation = db
db {
url = "jdbc:sqlserver://localhost:3306/highlighter-db?ssl=false"
username = "hluser"
password = "hlpass"
}
}
}
}

Using External Solr

Create a core on your Solr instance using schema from Highlighter distribution (located in folder "conf/search/config-lib/Default/conf").

Update your application.conf to point Highlighter to the external Solr core:

highlighter.indexing.solr.external = "http://servername:8983/solr/highlighter-core"

As a reminder, if you're going to use only "highlight-for-xml" highlighting method, the full text search indexing module can be disabled completely.


comments powered by Disqus