Managing a service

This page explains how to update and delete an existing Dataproc Metastore service.

Access control

  • To update and delete a service, you must be granted IAM roles containing the metastore.services.update and the metastore.services.delete IAM permissions respectively. The Dataproc Metastore specific roles roles/metastore.admin and roles/metastore.editor can be used to grant update and delete permission.

  • You can also give update and delete permission to users or groups by using the roles/owner and roles/editor legacy roles.

For more information, see Dataproc Metastore IAM and access control.

Updating a service

You can update a service by editing service parameters on the Configuration tab of the Service detail page opened in a local browser, by using the Cloud SDK gcloud command-line tool, or by issuing a Dataproc Metastore API method services.patch.

Only one update job is supported at a time, and each job can have multiple property updates. You can still use the service while it's being updated.

The following service parameters can be updated:

  • Port number
  • Service tier
  • Data Catalog sync
  • Maintenance window
  • Kerberos fields
  • Hive metastore configurations
  • Labels

You must recreate a service if you'd like to change service parameters that can't be updated.

The following instructions demonstrate how to update a Dataproc Metastore service using the Google Cloud Console, the gcloud tool, or the Dataproc Metastore API.

Console

  1. In the Cloud Console, open the Dataproc Metastore page:

    Open Dataproc Metastore in the Cloud Console

  2. On the Dataproc Metastore page, click the service name of the service you'd like to update. The Service detail page for that service opens.

    Service detail page
  3. Under the Configuration tab, click the Edit button. The Edit service page opens.

  4. Choose the updated service parameter values.

  5. Click the Submit button to update the service.

  6. Verify that you have returned to the Dataproc Metastore page, and that your updated service appears in the list.

gcloud

  1. Use the following gcloud metastore services update command to update a service:

    gcloud metastore services update SERVICE \
        --location=LOCATION \
        --port=PORT \
        --tier=TIER \
        --maintenance-window-day=MAINTENANCE_WINDOW_DAY \
        --maintenance-window-hour=MAINTENANCE_WINDOW_HOUR \
        --kerberos_principal=KERBEROS_PRINCIPAL \
        --keytab=KEYTAB \
        --krb5-config=KRB5_CONFIG \
        --update-hive-metastore-configs-from-file=[KEY=VALUE, ...] \
        --clear-hive-metastore-configs \
        --remove-hive-metastore-configs=[KEY, ...] \
        --update-labels=[KEY=VALUE, ...] \
        --clear-labels \
        --remove-labels=[KEY, ...]
    
    • --update-hive-metastore-configs-from-file: If a variable exists, its value is updated; otherwise, a new variable is created.
    • --clear-hive-metastore-configs: This happens first if update-hive-metastore-configs-from-file is also set.

    Replace the following:

    • SERVICE: The name of the service.
    • LOCATION: Refers to a Google Cloud region.
    • PORT: Optional: The TCP port at which the Dataproc Metastore Thrift interface is available.
    • TIER: The tier capacity of the service.
    • MAINTENANCE_WINDOW_DAY: The day of week when the window starts.
    • MAINTENANCE_WINDOW_HOUR: The hour of day when the window starts.
    • KERBEROS_PRINCIPAL: Optional: A Kerberos principal that exists in the both the keytab and the KDC. A typical principal is of the form "primary/instance@REALM", but there is no exact format.
    • KEYTAB: Optional: A Kerberos keytab file that can be used to authenticate a service principal with a Kerberos Key Distribution Center.
    • KRB5_CONFIG: Optional: The krb5.config file specifies the KDC and the Kerberos realm information, which includes locations of KDCs and defaults for the realm and Kerberos applications.
    • [KEY, ...]: Optional: The Hive metastore configs used.
    • [KEY=VALUE, ...]: Optional: The labels or the Hive metastore key-value pair configs used.
  2. Verify that the update was successful.

REST

Follow the API instructions to update a service by using the APIs Explorer.

When the update succeeds, the service automatically enters active state. If it fails, then the service is rolled back to its previous healthy state.

Deleting a service

You can delete a service by clicking delete on the Service detail page opened in a local browser, by using the Cloud SDK gcloud command-line tool, or by issuing a Dataproc Metastore API method services.delete.

You may want to delete your service if your configurations, such as service name, network, or Hive metastore version, are wrong and can't be changed.

The following instructions demonstrate how to delete a Dataproc Metastore service using the Google Cloud Console, the gcloud tool, or the Dataproc Metastore API.

Console

  1. In the Cloud Console, open the Dataproc Metastore page:

    Open Dataproc Metastore in the Cloud Console

  2. Select the service by checking the box to the left of the service name.

  3. At the top of the Dataproc Metastore page, click Delete to delete the service.

  4. On the dialog, click Delete to confirm the deletion.

You can also delete your service on the Service detail page.

  1. On the Dataproc Metastore page, click the service name of the service you'd like to delete. The Service detail page for that service opens.

    Service detail page
  2. At the top of the page under the Configuration tab, click Delete Service.

  3. On the dialog, click Delete to confirm the deletion.

  4. Verify that you have returned to the Dataproc Metastore page, and that your deleted service no longer appears in the list.

gcloud

  1. Use the following gcloud metastore services delete command to delete a service:

    gcloud metastore services delete SERVICE \
        --location=LOCATION
    

    Replace the following:

    • SERVICE: The name of the new service.
    • LOCATION: Refers to a Google Cloud region.
  2. Verify that the deletion was successful.

REST

Follow the API instructions to delete a service by using the APIs Explorer.

All deletions succeed immediately.

What's next?