Installing on Azure

To install SearchAI on Azure, follow the following steps to set up the prerequisites and configure the system for optimal performance. This guide assumes you are using an Azure environment.

Prerequisites

Recommended EC2 instance type is NC Family Like NC4as T4 v3.

  1. Install OpenJDK 21:
    SearchBlox requires Java to run. Install OpenJDK 21 using the following commands:

    sudo apt install openjdk-21-jdk
    

    Verify the Installation:

    java -version
    

    Ensure the output shows OpenJDK 21.

  2. Install wget:
    wget is required to download files from the internet. Install it using:

    sudo apt-get update
    sudo apt-get install wget
    
  3. Install Dependencies for Dynamic Auto Collection Crawler:
    Install the following libraries:

    sudo apt-get install libxkbcommon0 libgbm1
    
  4. Set vm.max_map_count:
    Edit the /etc/sysctl.conf file to set the vm.max_map_count value:

    sudo vi /etc/sysctl.conf
    

    Add the following line:

    vm.max_map_count=262144
    

    Apply the changes:

    sudo sysctl -p
    
  5. Increase File Descriptor Limit:
    Edit the /etc/sysctl.conf file to increase the file descriptor limit

    sudo vi /etc/sysctl.conf
    

    Add the following line:

    fs.file-max=100000
    

    Apply the changes:

    sudo sysctl -p
    


  6. Set ulimit Values:
    Edit the /etc/security/limits.conf file to set soft and hard limits:

    sudo vi /etc/security/limits.conf
    

    Add the following lines

    *          soft      nofile     100000
    *          hard      nofile     100000
    
  7. Enable pam_limits
    Edit the /etc/pam.d/common-session file:

    sudo vi /etc/pam.d/common-session
    

    Add the following line

    session required pam_limits.so
    


  8. Reboot the Server:
    Reboot the server to apply all changes:

    sudo reboot
    
  9. Verify ulimit Settings:
    After rebooting, verify the ulimit settings:

    ulimit -a
    ulimit -Sn  # Check soft limit
    ulimit -Hn  # Check hard limit
    

Installation

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

  2. Create a SearchBlox user

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

  4. Download SearchBlox Debian package

    sudo wget https://d2fco3ozzrfhhd.cloudfront.net/v11.1.0.3/searchblox_11.1.0.3-0_all.deb
    
  5. Install the Debian package

    sudo dpkg -i searchblox_11.1.0.3-0_all.deb
    
  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. Installing the GPU Drivers:

    # ── prerequisites
    sudo apt-get update && sudo apt-get install -y build-essential git wget curl
    
    # ── NVIDIA driver & CUDA 12 (works with V100 / T4 / A100)
    curl -O https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb
    sudo dpkg -i cuda-keyring_1.1-1_all.deb
    sudo apt-get update
    sudo apt-get -y install cuda-drivers-535  # or newer
    
    # ── reboot to load nvidia modules
    sudo reboot
    

    After Reboot:

    nvidia-smi   or dkms status       # should list your GPU
    nvcc --version        # confirms CUDA install
    
  9. To check the ollama model, by running the following command:

    ollama  list
    
  10. To download the models use the following command:

    ollama pull qwen2.5
    
  11. Start SearchBlox service by running the following command:

    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 SearchBlox and Opensearch services by running the following command:
systemctl stop searchblox
  1. To verify the status of the SearchBlox service please use the following command:
systemctl status searchblox

Verify Installation

  1. Access the SearchBlox Admin Console:
    Wait for 30-60 seconds after starting the SearchBlox service.
    Open a web browser using the end point: https://<localhost or IP>:8443/console

  2. Log in to the Admin Console:
    Setup the Super Admin Password.

    Login using the updated username and password.

  3. Verify the Service Status:
    If the Admin Console loads successfully, the SearchBlox service is running correctly.

Check the Status Log File

  1. Navigate to the Logs Directory:
    The status log file is located at:
/opt/searchblox/webapps/ROOT/logs/status.log
  1. View the Log File:
    Use the following command to view the log:
cat /opt/searchblox/webapps/ROOT/logs/status.log
  1. Confirm Successful Startup:
    Look for the message:
SearchBlox Started
  1. Troubleshoot Errors:
    If the service fails to start, the status.log file will contain error messages or warnings that can help identify the issue.
    Common issues include:
    • Port conflicts (ensure port 8443 is free).
    • Incorrect file permissions (verify permissions for /opt/searchblox).
      Verify that the /opt/searchblox directory and its subdirectories have the correct permissions:
      sudo chown -R searchblox:searchblox /opt/searchblox
      sudo chmod -R 755 /opt/searchblox
      
    • Missing dependencies (ensure Java and other prerequisites are installed).

Additional Resources

🚧

SearchBlox Admin Console Access using IP Address or Domain Name

  1. Using IP Address:
    Replace localhost with your server's IP address in the URL:
    https://<your-server-ip>:8443/console
    
  2. Using Domain Name:
    If a domain name is mapped to your server's IP address, use the domain name in the URL:
    https://exampledomain:8443/console
    

Important Notes

  • Port Number: By default, SearchBlox uses port 8443. Ensure this port is open and accessible in your firewall or security group (if using a cloud instance like AWS EC2).
  • HTTPS: SearchBlox uses HTTPS for secure communication. Ensure your browser trusts the SSL certificate (self-signed certificates may require manual approval).
  • Domain Configuration: If using a domain name, ensure the DNS records are correctly configured to point to your server's IP address

Steps to Install and Run SearchAI PrivateLLM

To install and run SearchAI PrivateLLM after completing the SearchBlox installation, follow the steps below. This process involves downloading the PrivateLLM Models, setting up the ollama.service, and starting the service.

  1. Download the Models Folder:
    Download the PrivateLLM Models from the provided link:
    SearchAI PrivateLLM Models
    Extract the downloaded models folder.
  2. Replace the Models Folder:
    Navigate to the /opt/searchblox/ollama/models directory and replace the existing models folder with the downloaded one.
    cd /opt/searchblox/ollama/models
    
  3. Create the ollama.service File:
    1. Navigate to the /etc/systemd/system/ directory:
    cd /etc/systemd/system/
    
    1. Create a new service file named ollama.service:
    sudo vi /etc/systemd/system/ollama.service
    

Add the following script to the ollama.service file:

[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

Then save and exit the file.

  1. Set Execute Permissions:
    Provide execute permissions for the ollama.service file:
    sudo chmod 755 /etc/systemd/system/ollama.service
    
    Also, set execute permissions for the ollama binary:
    sudo chmod 755 /opt/searchblox/ollama/bin/ollama
    

  2. Reload Systemd Daemon:
    Reload the systemd daemon to apply the new service file:
    sudo systemctl daemon-reload
    
  3. Start the Ollama Service:
    sudo systemctl start ollama
    
  4. Verify the Models:
    Check the list of available models by running:
    ./opt/searchblox/ollama/bin/ollama list
    
  5. Download the Model:
    Download the model using the command below:
    ./opt/searchblox/ollama/bin/ollama pull qwen2.5
    
  6. Stop the Ollama Service (Optional):
    To stop the ollama service, use:
    sudo systemctl stop ollama
    
  7. Enable Auto-Start on Reboot:
    To ensure the ollama service starts automatically on system reboot, enable it:
    sudo 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

  1. First Stop the SearchBlox, by running the command:
    systemctl stop searchblox

  2. Run the following command to uninstall or remove SearchBlox:
    apt-get remove searchblox

  3. To remove the user, run the command;
    userdel searchblox

  4. Reboot the server:
    reboot

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