Installing on Google Cloud

To deploy SearchAI on Google Cloud using a GPU server, you will need to set up a Google Cloud Compute Engine instance with a GPU, and then follow the SearchBlox installation steps for Ubuntu.

Steps to set-up a GPU Server on Google Cloud

Follow the following steps to set-up GPU Server on Google Cloud:

  1. Google Cloud Account and Project:
  • Make sure you have a Google Cloud account and a project created.
  • Enable the Compute Engine API for your project.
  1. GPU Quota:
  • Google Cloud requires GPU quotas for using GPUs.
  • You may need to request a quota increase for the required GPU type in your selected region or zone.
  • You can check GPU availability and request quota increases in the Google Cloud Console under IAM & Admin → Quotas.
  1. Choose a GPU Model and Machine Type:
  • Select a suitable GPU model (for example, NVIDIA T4, L4, A100, or H100) and a compatible machine type.
  • Different GPU models are available only in specific regions and zones.
  • For machine learning and data processing workloads, accelerator-optimized machine types are recommended.
  1. Create a VM Instance:
  • Go to Compute Engine → VM instances in the Google Cloud Console.
  • Click Create Instance.
  • Enter a name for the instance and select a region and zone where the chosen GPU type is available and the quota is approved.
  • Under Machine configuration, select GPU, then choose the required GPU model and number of GPUs. This will automatically suggest compatible machine types (for example, the G2 series for L4 GPUs).
  • Boot Disk: Select an Ubuntu LTS image (such as Ubuntu 20.04 LTS or 22.04 LTS), which is supported by the SearchBlox installation guide. Ensure the disk size is sufficient (for example, 100 GB SSD is recommended for better performance).
  • Firewall: Allow HTTP and HTTPS traffic (ports 80 and 443). You may also need to open port 8443 for SearchBlox.
  • Install NVIDIA drivers automatically: During VM creation, enable the option to automatically install NVIDIA GPU drivers if it is available. If this option is not available, you will need to install the drivers manually after the VM is created.
  • Review all settings and click Create.
  1. Install NVIDIA Drivers and Container Toolkit (if not installed automatically):
  • After the VM is created, connect to it using SSH.
  • Follow NVIDIA’s instructions to install the required GPU drivers and the NVIDIA Container Toolkit, especially if you plan to run SearchAI PrivateLLM in a containerized environment.
  • This step is necessary for the VM to detect and use the GPUs.

Install SearchBlox Service on GPU Server

Prerequisites

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

    sudo apt install openjdk-25-jdk
    

    Verify the Installation:

    java -version
    

    Ensure the output shows OpenJDK 25.

  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
    

  1. 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
    

  2. 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
    

  1. Reboot the Server:
    Reboot the server to apply all changes:
    sudo reboot
    
  2. Verify ulimit Settings:
    After rebooting, verify the ulimit settings:
    ulimit -a
    ulimit -Sn  # Check soft limit
    ulimit -Hn  # Check hard limit
    

SearchBlox Installation

  1. Login as Root:
    If you are not the root user, switch to the root user

    sudo su
    
  2. Create a SearchBlox User:
    Create a dedicated user for SearchBlox. Follow the prompts to set a password and provide necessary details.

    sudo adduser searchblox
    
  3. Navigate to the /opt Directory:
    SearchBlox must be installed in the /opt folder. Change to the /opt directory:

    cd /opt
    
  4. Download the SearchBlox Debian Package:
    Download the SearchBlox Debian package using wget:

    sudo wget https://d2fco3ozzrfhhd.cloudfront.net/v12.0/searchblox_12.0-0_all.deb
    
  5. Install the Debian Package:
    Install the downloaded package using dpkg:

    sudo dpkg -i searchblox_12.0-0_all.deb
    
  6. Set Permissions:
    Change ownership and permissions for the SearchBlox directories:

    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
    sudo chmod -R 755 /opt/searchblox/webapps/ROOT/logs/
    
  7. Install and Run SearchAI PrivateLLM:
    Follow the instructions in the SearchAI PrivateLLM documentation to install and run the SearchAI PrivateLLM and ollama.service.

  8. Start the SearchBlox Service:
    Start the SearchBlox service using systemctl:

    systemctl start searchblox
    
  9. To stop SearchBlox service, use

    systemctl stop searchblox
    

    To Check the Status of the SearchBlox Service:

    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).

GPU

  • Confirm GPU Usage: After configuring and integrating SearchAI PrivateLLM, monitor your GPU usage on the VM using tools like nvidia-smi to ensure SearchAI is properly utilizing the GPU.

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

📘

NOTE:

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