Installing on Amazon Linux 2

Prerequisites

Recommended EC2 instance type is t3a.xlarge.

  1. Install OpenJDK 21 by running the following command:

    sudo yum install java-21-amazon-corretto-devel
    java -version 
    
  2. Install wget by running the following command:

    yum install wget
    
  3. Set map count within /etc/sysctl.conf file by adding the following line:
    vm.max_map_count=262144

echo "vm.max_map_count=262144" | sudo tee -a /etc/sysctl.conf
  1. Increase ulimit value and test system settings

    To change the file descriptor setting, edit the file /etc/sysctl.conf.
    Add line fs.file-max=100000 to it.

    echo "fs.file-max=100000" | sudo tee -a /etc/sysctl.conf
    

    To apply the changes :

    sudo sysctl -p
    

    To change the ulimit setting, edit the file /etc/security/limits.conf and set the hard and soft limits:
    * soft nofile 100000
    * hard nofile 100000

    echo "* soft nofile 100000" | sudo tee -a /etc/security/limits.conf
    echo "* hard nofile 100000" | sudo tee -a /etc/security/limits.conf
    

    After this value is changed please reboot the server.

    sudo reboot
    

    Post Reboot Verification

  2. # Verify kernel parameters
    sysctl vm.max_map_count fs.file-max
    
    # Check file descriptors
    ulimit -a
    cat /proc/sys/fs/file-max
    
    # Monitor current usage
    cat /proc/sys/fs/file-nr
    lsof | wc -l
    

Installation

  1. Please login as root using sudo su if you are not the root user.

  2. Create a SearchBlox user

    sudo adduser searchblox
    sudo passwd searchblox
    
  3. SearchBlox has to be installed in /opt folder, so change directory to /opt
    cd /opt

  4. Download SearchBlox rpm package

    sudo wget https://d2fco3ozzrfhhd.cloudfront.net/v11.0.3/searchblox-11.0.3-0.noarch.rpm
    
  5. Install the rpm package

    sudo rpm -ivh searchblox-10.0.3-0.noarch.rpm
    
  6. Change permission for the following folders

    sudo chown -R searchblox:searchblox /opt/searchblox
    sudo chmod -R 755 /opt/searchblox/bin
    sudo chmod -R 755 /opt/searchblox/opensearch
    sudo chmod -R 755 /opt/searchblox/logs
    sudo chmod -R 755 /opt/searchblox/connectors
    
  7. Install and run the SearchAI PrivateLLM and ollama.service from the following section:
    SearchAI PrivateLLM models

  8. Start SearchBlox service by running the following command:

    sudo systemctl start searchblox
    

👍

Note:

SearchBlox service will start opensearch service internally unlike previous versions. If service start up gives any issues, enable searchblox.service using the command below:
systemctl daemon-reload

  1. Stop Analytics, SearchBlox and Opensearch services by running the following command:
    systemctl stop searchblox
    
  2. To verify the status of the SearchBlox service please use the following command:
    systemctl status searchblox
    

Verify Installation

After you start the services, wait for 30 seconds then go to https://<Hostname or Host IP>:8443/console/ to access the SearchBlox Management Console to login.

You can also verify if SearchBlox has started successfully by viewing the status.log file in the /opt/searchblox/webapps/ROOT/logs folder.

Please confirm the message "Started Successfully" is shown in the log. In case of any errors, this log will provide additional information for troubleshooting.

🚧

SearchBlox Admin Console Access using IP Address or Domain Name

Steps to Install and Run SearchAI PrivateLLM

  1. After SearchBlox installation from Installation section, Download the Models folder from the following link.
    SearchAI PrivateLLM Models
    sudo wget https://d2fco3ozzrfhhd.cloudfront.net/ollama/models.zip -P /tmp/
    
  2. After downloading , extract the models folder.
    sudo unzip /tmp/models.zip -d /tmp/
    
  3. Navigate to /opt/searchblox/ollama/models and replace the models folder with the downloaded one.
    sudo rm -rf /opt/searchblox/ollama/models
    sudo mv /tmp/models /opt/searchblox/ollama/
    
  4. To create a service file, navigate to /etc/systemd/system/ and create a ollama.service file by running the following command:
    vi /etc/systemd/system/ollama.service
  5. Update the /etc/systemd/system/ollama.service file with following script:
    [Unit]
    Description=Ollama Service
    After=network-online.target
    [Service]
    WorkingDirectory=/opt/searchblox/ollama/bin
    ExecStart=/opt/searchblox/ollama/bin/ollama serve
    User=root
    Group=root
    Restart=always
    RestartSec=3
    Environment="OLLAMA_MODELS=/opt/searchblox/ollama/models/"
    [Install]
    WantedBy=default.target
    
  6. Provide execute permission for ollama.service file by executing the following command:
    chmod 755 /etc/systemd/system/ollama.service
    chmod 755 /opt/searchblox/ollama/bin/ollama
    
  7. Enable the ollama.service by running the following command:
    systemctl daemon-reload
    
  8. Start ollama Service by running the following command:
    systemctl start ollama
    
  9. To check the models run the following command:
    ./opt/searchblox/ollama/bin/ollama list
    
  10. To download the model run the following command:
    ./opt/searchblox/ollama/bin/ollama pull qwen2.5
    
  11. To stop Ollama Service run the following command:
    systemctl stop ollama
    
  12. To auto start ollama service when system reboots run the following command:
    systemctl enable ollama
    

Change SearchBlox Server Port

SearchBlox Server runs on port 8443 by default.

You can change the port by following the steps as shown in the following:

  1. Stop SearchBlox service

  2. Edit the file /opt/searchblox/start.d/https.ini and add the below line to set the required port number:
    jetty.ssl.port=443

  3. Save the file https.ini

  4. Start SearchBlox service

🚧

Port Update

Fix the permission denied error while using searchblox service on less than ports 1024, run the below commands:
Check the Java Path

readlink -f $(which java)

Set the capability to bind low ports for non-root searchblox user.

setcap cap_net_bind_service+ep <javapath>

Uninstall

Stop all services:

sudo systemctl stop searchblox
sudo systemctl stop ollama  # If SearchAI PrivateLLM is installed

Uninstall or remove SearchBlox by running the following command:

sudo yum remove searchblox

Note: For clean SearchBlox uninstallation, it is required to remove searchblox directory i.e., /opt/searchblox manually by running the following command:

sudo rm -rf /opt/searchblox  # Main installation directory
sudo rm -f /etc/systemd/system/ollama.service  # Remove service file if exists

📘

NOTE:

If you face any trouble in starting opensearch and in logs if you find the error as Opensearch status RED follow the steps given here:

  • Set the OPENSEARCH_JAVA_HOME by running the following command:
  • If you have installed java from Prerequisites section, use the below command:
  • export OPENSEARCH_JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
  • If java is installed in different path, change the value.
  • export OPENSEARCH_JAVA_HOME=<java installation path>