Skip to content

LXC Fess Search Engine Install

On the LXC Host System

Checking the value vm.max_map_count use:

sysctl vm.max_map_count

When the value is less than 262144, modify file /etc/sysctl.conf and add or modify a line like this:

vm.max_map_count=262144

To change the setting immediately without rebooting use the following command:

sysctl -w vm.max_map_count=262144

Create Container

To create a container and use the following command:

lxc-create -n fess -t download

When asked for a distribution, select ubuntu and then noble.

Start and attach to the container:

lxc-start -n fess
lxc-attach -n fess

Install OpenSearch

Install the required Java version first.

apt install -y openjdk-21-jdk

Sanity check on the Java version.

java -version

Download OpenSearch deb package to the /root/download directory.

mkdir donload && cd download
wget https://artifacts.opensearch.org/releases/bundle/opensearch/3.5.0/opensearch-3.5.0-linux-x64.deb

Set the required for the initial admin password.

export OPENSEARCH_INITIAL_ADMIN_PASSWORD='GiveMeAccess123'

Now install OpenSearch.

dpkg -i opensearch-3.5.0-linux-x64.deb

Call the following command to reload the systemd daemon.

systemctl daemon-reload

To prevent the following error, the service needs to be modified or amended.

Feb 23 13:14:15 search (mkdir)[4230]: opensearch.service: Failed to set up mount namespacing: /sys/fs/cgroup/cpu: No such file or directory

USe the service edit command to modify the service.

sudo systemctl edit opensearch.service

Past the following content into the editor.

[Service]
# Disable namespace isolation and cgroup protections that fail in LXC
ProtectControlGroups=no
ProtectKernelModules=no
ProtectKernelTunables=no
PrivateTmp=no
RestrictNamespaces=no
# Optional: ensure it doesn't look for missing cgroup paths
ReadOnlyPaths=

Again, call the following command to reload the systemd daemon.

systemctl daemon-reload

Install the required opensearch plugins.

/usr/share/opensearch/bin/opensearch-plugin install org.codelibs.opensearch:opensearch-analysis-fess:3.5.0
/usr/share/opensearch/bin/opensearch-plugin install org.codelibs.opensearch:opensearch-analysis-extension:3.5.0
/usr/share/opensearch/bin/opensearch-plugin install org.codelibs.opensearch:opensearch-minhash:3.5.0
/usr/share/opensearch/bin/opensearch-plugin install org.codelibs.opensearch:opensearch-configsync:3.5.0

Edit file /etc/opensearch/opensearch.yml and add the following lines.

configsync.config_path: /var/lib/opensearch/data/config/
plugins.security.disabled: true
discovery.type: single-node

Enable and start opensearch service.

systemctl enable opensearch.service
systemctl start opensearch.service

Check the status of OpenSearch and the log information when needed.

systemctl status opensearch.service
journalctl -xeu opensearch.service

Install Fess

Download OpenSearch deb package to the /root/download directory.

cd download
wget https://github.com/codelibs/fess/releases/download/fess-15.5.0/fess-15.5.0.deb

Install the Fess Debian package.

sudo dpkg -i fess-15.5.0.deb

Configure Fess to connect to OpenSearch and edit file /usr/share/fess/bin/fess.in.sh.
Ensure these variables point to the correct locations:

SEARCH_ENGINE_HTTP_URL=http://localhost:9200
FESS_DICTIONARY_PATH=/var/lib/opensearch/data/config/

Note: Must ve exact like this otherwise Fess will not work and a 404 error will be returned.

Enable and start Fess service.

systemctl enable fess
systemctl start fess

For the web-interface access the administration console at http://<your-ip>:8080/admin/.

Possible Fixes for Issues

sudo usermod -aG opensearch fess