> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ocient.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Cloud Platform Ocient Installation

export const Debian = "Debian®";

export const RHEL = "Red Hat® Enterprise Linux® (RHEL®)";

export const Linux = "Linux®";

export const GoogleCloud = "Google® Cloud™";

export const Ocient = "Ocient®";

This guide explains how to install an {Ocient} System in {GoogleCloud} (GCP).

For details about GCP concepts, see these pages:

* [What is Compute Engine?](https://cloud.google.com/compute/docs/concepts)
* [What is IAM?](https://cloud.google.com/iam/docs/overview)
* [VPC Network Overview](https://cloud.google.com/vpc/docs/overview)

<Danger>
  Ocient supports deployment in GCP for pilot or testing purposes, but this setup does not guarantee data durability. Stopping Compute Engine virtual machine (VM) instances can result in permanent data loss.
</Danger>

The steps for deploying an Ocient System in GCP are:

1. Prepare GCP resources.
2. Set up an initial instance.
3. Create machine images from the initial instance.
4. Launch other instances.
5. Follow the standard Ocient installation procedure.

## **Example Configuration**

The table below shows the recommended VM types for each node type.

| **Node Type**        | **VM Type**   |
| -------------------- | ------------- |
| Foundation Nodes (3) | n2-highmem-96 |
| Loader Nodes (1)     | n2-highmem-96 |
| SQL Nodes (1)        | n2-highmem-96 |

Metadata and non-Ocient nodes use the n2-standard-X machine type, where X represents the number of Virtual Central Processing Units (vCPUs) for your workload.

This diagram shows an example of an Ocient cluster in GCP. The system deploys the Compute Engine VMs (SQL, Loader, and Foundation) within a single subnet of a Virtual Private Cloud (VPC). GCP uses VPC firewall rules and network tags to control traffic to each node type.

<Frame>
  <img src="https://mintcdn.com/ocient/nZBibs1YRH_BOCeo/images/GCP_setup.png?fit=max&auto=format&n=nZBibs1YRH_BOCeo&q=85&s=e1dac33621590fac4e2387984df8f132" alt="Virtual private cloud for loading data from a Cloud Storage bucket using a JDBC client" width="1544" height="711" data-path="images/GCP_setup.png" />
</Frame>

## Prepare GCP Resources

Create and configure these GCP resources:

* The VPC network and subnets for the Ocient System. For details, see [Create and manage VPC networks](https://cloud.google.com/vpc/docs/create-modify-vpc-networks).
* VPC firewall rules with network tags to control access to the endpoints for each node type. For details about firewall configuration, see [Create firewall rules](https://cloud.google.com/vpc/docs/using-firewalls) and [Add and remove network tags](https://cloud.google.com/vpc/docs/add-remove-network-tags). For details about the network security configuration, see the [Ocient Security Guide](/ocient-security-guide).
* Identity and Access Management (IAM) roles. For details, see [Grant an IAM role](https://cloud.google.com/iam/docs/granting-changing-revoking-access).

<Info>
  If you are loading data from Cloud Storage, the Loader Nodes require IAM access to a Cloud Storage bucket. Assign the `roles/storage.objectViewer` role (or `roles/storage.objectAdmin` if you also need write access) to the service account used by the Loader Node VMs.
</Info>

## Node Setup (SQL Role) for the Initial Instance

<Steps>
  <Step title="Launch the Instance">
    Use this configuration for your machine image. Configuration steps differ depending on whether your setup uses a single-volume or multi-volume machine image. For details about creating instances, see [Create and start a Compute Engine instance](https://cloud.google.com/compute/docs/instances/create-start-instance).

    ### **Operating System (OS)**

    To set up the machine image, you can use any Ocient-supported OS (see [Ocient System Requirements](/ocient-system-requirements)).

    **Single-Volume Machine Image**

    If you use a single-volume machine image, specify this configuration:

    * Increase the boot disk to 128GB or more.

    **Multi-Volume Machine Image**

    If you use a multi-volume machine image (e.g., CIS hardened {RHEL} (RHEL) 9), use this configuration:

    * Increase the boot disk to 30GB or more.
    * Increase the additional Persistent Disk volume to 100GB or more. For details, see [Add a Persistent Disk to your VM](https://cloud.google.com/compute/docs/disks/add-persistent-disk).

    <Info>
      This Persistent Disk volume supports key system directories in the image (`/home`, `/var`, `/var/log`, `/var/log/audit`, `/var/tmp`).
    </Info>

    **VM Type**

    Use n2-highmem-96 for Ocient nodes. Use n2-standard-X for Metadata and non-Ocient nodes.

    **Secure Boot**

    Disable Shielded VM secure boot when creating the instance. Use the `--no-shielded-secure-boot` flag with the `gcloud` command.

    ```shell Shell theme={null}
    gcloud compute instances create INSTANCE_NAME \
        --no-shielded-secure-boot
    ```

    If you are using the Console, uncheck **Turn on Secure Boot** under **Security > Shielded VM**. For details, see [Shielded VM](https://cloud.google.com/compute/docs/shielded-vm).

    **Firewall Rules and Network Tags**

    Create VPC firewall rules with network tags that enforce these rules:

    * Allow SSH to the nodes.
    * Allow communication internally between nodes.
    * Allow access to SQL Node endpoints. For details, see the [Ocient Security Guide](/ocient-security-guide).

    Assign the appropriate network tags to each VM so that the firewall rules apply to the correct node types. For details, see [Create firewall rules](https://cloud.google.com/vpc/docs/using-firewalls) and [Add and remove network tags](https://cloud.google.com/vpc/docs/add-remove-network-tags).
  </Step>

  <Step title="Access the Shell">
    Connect to your instance using Secure Shell (SSH). For details, see [Connect to Linux VMs using Google tools](https://cloud.google.com/compute/docs/connect/standard-ssh).
  </Step>

  <Step title="Extend Logical Volume Manager (LVM) Volumes (Multi-Volume Machine Image Only)">
    <Info>
      This step applies only to multi-volume machine images. If you are using a single-volume instance, skip this step.
    </Info>

    If you use a multi-volume manager, extend the `/home` and `/var` LVM volumes and their filesystems to fill up the expanded Persistent Disk volumes. These actions expand the LVM volume and the contained file system to accommodate the package, logging, and metadata of the Ocient System.

    These code examples show how to extend LVM volumes for a RHEL 9 image.

    <Info>
      Other machine image types might require different sizing. Contact Ocient support for the best sizing for your system for multi-volume instances.
    </Info>

    **Examples**

    Resize the physical volumes of two drives to use their full capacity after expanding them (see [Prepare GCP Resources](#prepare-gcp-resources)).

    ```shell Shell theme={null}
    sudo pvresize /dev/nvme0n1
    sudo pvresize /dev/nvme1n1
    ```

    Extend local volumes:

    * Add 66 percent of the available free space in `vg-01` to the `var_vol` logical volume.
    * Add all (100 percent) of the remaining free space in `vg-01` to the `home_vol` logical volume.

    ```shell Shell theme={null}
    sudo lvextend -l +66%FREE /dev/vg-01/var_vol
    sudo lvextend -l +100%FREE /dev/vg-01/home_vol
    ```

    Extend the file system to use all available space on its underlying logical volume.

    ```shell Shell theme={null}
    sudo xfs_growfs /home
    sudo xfs_growfs /var
    ```
  </Step>

  <Step title="Update Packages">
    Update all your software packages to their latest versions and then reboot your instance.

    For RHEL-compatible systems, use this command.

    ```shell Shell theme={null}
    sudo dnf update
    ```

    For {Debian}-compatible systems, use this command.

    ```shell Shell theme={null}
    sudo apt update
    ```

    Reboot after the update.

    ```shell Shell theme={null}
    sudo reboot
    ```
  </Step>

  <Step title="Install GCP Kernel Modules">
    GCP Compute Engine VMs require additional kernel modules for full hardware support. Install the extra kernel modules package that matches your running kernel version.

    ```shell Shell theme={null}
    sudo apt install linux-modules-extra-$(uname -r)
    ```

    Reboot the node after the installation completes.

    ```shell Shell theme={null}
    sudo reboot
    ```

    <Info>
      This step is required for GCP Compute Engine VMs. Without the extra kernel modules, certain hardware drivers and features might not function correctly.
    </Info>
  </Step>

  <Step title="Install the Ocient Package">
    Copy over the `ocient` RPM or DEB package and install it.

    For RHEL-compatible systems, use this command.

    ```shell Shell theme={null}
    sudo dnf install ./ocient-RELEASE-XX.X.X-xxxxxxxxxxxxxx-x86_64.rpm
    ```

    For Debian-compatible systems, use this command.

    ```shell Shell theme={null}
    sudo apt install ./ocient-RELEASE-XX.X.X-xxxxxxxx.xxxxxx-xxxxxxxxxxxx-amd64.deb
    ```
  </Step>

  <Step title="Set Up Kernel Parameters">
    Use the `ockernelparams` utility to set up kernel parameters automatically, including the huge pages configuration. Repeat this step on other nodes.

    ```shell Shell theme={null}
    sudo /opt/ocient/scripts/ockernelparams --node-role sql  
    ```

    Reboot the system for the parameters to take effect.

    ```shell Shell theme={null}
    sudo reboot
    ```

    Check that the local storage drive is attached to the `uio` or `vfio` driver after reboot (the Ocient package installs a service that runs on startup to perform this action).

    ```shell Shell theme={null}
    sudo /opt/ocient/scripts/nvme-driver-util.sh
    ```

    On GCP, drives bound to the `uio_pci_generic` driver display without a device name. This behavior is expected for GCP NVMe drives.

    ```text theme={null}
    NVMe device status

    BDF             Numa Node       Driver name             Device name
    0000:00:04.0    -1              uio_pci_generic         -
    ```

    For examples of attaching drivers to the NVMe drives, see [NVMe Drive Firmware Upgrade Process](/nvme-drive-firmware-upgrade-process#page-title).
  </Step>

  <Step title="Configure the Firewall">
    <Info>
      If you are not using an OS-level firewall, skip this step.
    </Info>

    If your base machine image includes a system firewall, you must configure rules that explicitly allow required network communication for your Ocient deployment. For details, see the [Ocient Security Guide](/ocient-security-guide).

    Required OS firewall rules:

    * Allow all necessary ports and protocols between Ocient nodes by:
      * Opening all TCP/UDP ports within the private network range (e.g., `10.0.0.0/16`), or allowing known Ocient ports.
    * Allow external access where needed by:
      * Enabling SSH access (port `22`) from your administrator IP range.
      * Allowing client access to SQL endpoints (for example, port `13101` or as specified in your setup).
      * Opening any additional ports required for monitoring or management tools.

    For a list of required ports, see [Network Exposure and Firewall](/ocient-security-guide#network-exposure-and-firewall).

    <Info>
      In addition to OS-level firewall rules, ensure that your GCP VPC firewall rules and network tags are properly configured (see [Prepare GCP Resources](#prepare-gcp-resources)). Both layers must allow the required traffic for the Ocient System to function correctly.
    </Info>
  </Step>
</Steps>

## Create the Machine Image

After your initial node is fully configured, you must replicate the setup process for the remaining nodes in your cluster. This action ensures consistency and allows for proper internal communication between nodes.

For details about creating a machine image, see [Create a machine image](https://cloud.google.com/compute/docs/machine-images/create-machine-images).

## Set Up Remaining Nodes to Launch the Remaining Instances

Go through this process for each of your remaining nodes.

<Steps>
  <Step title="Set Up Parameters">
    Launch the remaining instances with these parameters. For details, see [Create an instance from a machine image](https://cloud.google.com/compute/docs/machine-images/create-instance-from-machine-image).

    * Machine image — Use the machine image created in the [Node Setup (SQL Role) for Initial Instance](#node-setup-sql-role-for-initial-instance) step.
    * VM type — Use `n2-highmem-96` for Ocient nodes. This VM type:
      * Provides sufficient memory and compute for high-performance Ocient workloads.
      * Has high throughput and network bandwidth for internal cluster communication.
    * Secure boot — Disable secure boot using the `--no-shielded-secure-boot` flag.
    * VPC firewall rules — Ensure these rules are in place using network tags associated with the nodes:
      * Allow SSH to the nodes.
      * Allow internal communication between all Ocient nodes.
      * Allow access to endpoints described in the [Ocient Security Guide](/ocient-security-guide).
  </Step>

  <Step title="Access the Shell">
    Connect to your instance using SSH. For details, see [Connect to Linux VMs using Google tools](https://cloud.google.com/compute/docs/connect/standard-ssh).
  </Step>

  <Step title="Set Up Kernel Parameters">
    Use the `ockernelparams` utility to automatically set up kernel parameters, including the `hugepages` parameters.

    This example specifies a Foundation Node `foundation`. Use a different node type as necessary.

    ```shell Shell theme={null}
    sudo /opt/ocient/scripts/ockernelparams --node-role foundation  
    ```

    Reboot the system for the parameters to take effect.

    ```shell Shell theme={null}
    sudo reboot
    ```
  </Step>
</Steps>

## Bootstrap the Ocient System

Complete the bootstrapping process for your Ocient System. For details, see [Node Bootstrapping Reference](/node-bootstrapping-reference).

## Related Links

[Load Data](/load-data)

[Query Ocient](/query-ocient)
