Configuring Google Cloud Storage (GCS)

    You can set up Couchbase Enterprise Analytics to use Google Cloud Storage as its storage solution. You can deploy Enterprise Analytics (EA) 2.2 and later on Google Cloud Platform (GCP) and configure it to use Google Cloud Storage (GCS) for compute-storage separation.

    Prerequisites

    • You have created a GCS bucket on your Google Cloud project. For more information, see Create buckets in the Google Cloud documentation.

    • You have created a GCP Service Account with read and write permissions to the GCS bucket, and attached it to each VM where you want to deploy Enterprise Analytics. The VM automatically discovers the Service Account credentials from the GCP metadata server — no credentials file is required on the VM. For more information, see Service accounts overview and Create and enable service accounts for instances in the Google Cloud documentation.

    • You have the installer for Enterprise Analytics version 2.2. For more information, see Installing Enterprise Analytics.

    Cluster Setup

    Use the Couchbase UI or REST API to configure Enterprise Analytics to use Google Cloud Storage as its object storage.

    You can only configure the blob storage settings during the initial cluster setup.

    Set Up a Cluster Using the UI

    To set up Enterprise Analytics to use Google Cloud Storage from the UI:

    1. Choose Google Cloud Storage as the Blob Storage Scheme.

    2. Provide the following details:

      • Enter the Bucket Name for the GCS bucket where EA stores all of its data.

      • Enter the Prefix (optional) within that bucket where EA stores all of its data.

    Set Up a Cluster Using the REST API

    To configure Enterprise Analytics to use a GCS bucket from the REST API:

    1. Set the Analytics blob configuration using the /settings/analytics endpoint and the POST method:

      curl --request POST \
        --url http://localhost:8091/settings/analytics \
        --header 'Content-Type: application/x-www-form-urlencoded' \
        --data blobStorageScheme=gs \
        --data blobStorageBucket=$GCS_BUCKET_NAME \
        --data blobStoragePrefix=$GCS_BUCKET_PREFIX

      You must include the following --data parameters in your request:

      • blobStorageScheme=gs: specifies Google Cloud Storage.

      • blobStorageBucket: the name of the GCS bucket.

      • blobStoragePrefix: the prefix within the bucket (optional).

    2. Initialize the cluster using the POST method on the /clusterInit endpoint. For example:

      curl -X POST http://localhost:8091/clusterInit \
      -d 'username=$ADMIN_USERNAME' \
      -d 'password=$ADMIN_PASSWORD' \
      -d 'services=kv,cbas' \
      -d 'memoryQuota=$MEMORY_QUOTA' \
      -d 'cbasMemoryQuota=$CBAS_MEMORY_QUOTA' \
      -d 'port=SAME'

      You must include the following parameters as part of your request:

      • username and password: Credentials for the cluster administrator.

      • services: The services to be configured (here, kv for Key-Value and cbas for Analytics).

      • memoryQuota: Memory allocation for the Key-Value service (in MB). Recommended to set it to 100 MB.

      • cbasMemoryQuota: Memory allocation for the Analytics Service (in MB).

      • port: Specifies the port configuration.

    Next Steps