Para receber a permissão necessária para atualizar um serviço do Dataproc Metastore,
peça ao administrador para conceder a você os
seguintes papéis do IAM no projeto, com base no princípio de privilégio mínimo:
É possível atualizar os seguintes parâmetros do metastore do Dataproc.
Número da porta. Atualize o número da porta TCP da interface do Apache Thrift.
Nível de serviço. Alterne entre o nível de serviço Developer ou Enterprise. Esses níveis influenciam a capacidade do serviço.
Sincronização do Data Catalog. Ative ou desative o recurso de sincronização do Data Catalog.
Janela de manutenção. Mude a frequência da janela de manutenção, incluindo Dia da semana e Hora do dia.
Kerberos. Ative ou desative a autenticação Kerberos. Se já estiver ativado, você poderá atualizar os arquivos de configuração do Kerberos.
Configurações do metastore do Hive. Atualize o local do diretório do seu data warehouse do Hive.
Configuração da versão auxiliar (Visualização). Ative, desative ou adicione outras versões auxiliares.
Rótulos. Adicione ou remova rótulos opcionais que descrevem seus metadados.
Fator de escalonamento. Mude o fator de escalonamento. É possível ativar ou desativar o escalonamento automático e atualizar os fatores de escalonamento mínimo ou máximo.
Atualizar um serviço
Antes de executar uma atualização, observe as seguintes considerações:
É possível executar apenas um job de atualização por vez para cada serviço do metastore do Dataproc.
É possível atualizar vários parâmetros em um único job de atualização.
Você ainda pode usar o metastore do Dataproc enquanto ele estiver sendo atualizado.
Quando a atualização é bem-sucedida, o metastore do Dataproc entra automaticamente no estado ativo. Se a atualização falhar, o serviço do metastore do Dataproc vai reverter para o estado íntegro anterior.
As instruções a seguir mostram como atualizar um serviço do metastore do Dataproc.
Console
No console do Google Cloud , abra a página Metastore do Dataproc:
SERVICE: o nome do seu serviço metastore do Dataproc.
LOCATION: a Google Cloud região em que o serviço Metastore do Dataproc está localizado.
PORT: opcional: a porta TCP da interface Thrift que você está usando com o serviço do metastore do Dataproc.
TIER: opcional: a capacidade do nível do seu serviço do metastore do Dataproc.
MAINTENANCE_WINDOW_DAY (opcional): o dia da semana em que a janela de serviço começa.
MAINTENANCE_WINDOW_HOUR: opcional: a hora do dia em que a janela de serviço começa.
KERBEROS_PRINCIPAL: opcional: um principal do Kerberos que existe na guia key e no KDC. Um principal típico é o formato "primary/instance@REALM", mas não há um formato exato.
KEYTAB: opcional: um arquivo keytab Kerberos que é usado para autenticar um principal de serviço com um centro de distribuição de chaves do Kerberos.
KRB5_CONFIG (opcional): o arquivo krb5.config especifica as informações de domínio do KDC e do Kerberos, que incluem locais de KDCs e padrões para os aplicativos real e Kerberos.
[KEY, ...]: opcional: as configurações do metastore do Hive que você quer atualizar.
Se uma variável existir nesse campo, o valor dela será atualizado. Caso contrário, uma nova variável será criada.
Se essa flag for definida, -clear-hive-metastore-configs também será definida automaticamente.
[KEY, ...]: opcional: as configurações do metastore do Hive que você quer remover.
[KEY=VALUE, ...]: opcional: os rótulos ou as configurações de par de chave-valor do metastore do Hive que você quer atualizar.
[KEY, ...]: opcional: os rótulos ou as configurações de par de chave-valor do metastore do Hive que você quer remover.
Atualizar a configuração do data warehouse do metastore do Hive
Se o diretório de armazenamento do Hive estiver no Cloud Storage, defina uma modificação da configuração do metastore. Essa substituição define seu data warehouse específico como o diretório de armazenamento padrão para o metastore do Dataproc.
Antes de definir essa substituição, verifique se o serviço Metastore do Dataproc tem permissões de leitura e gravação de objeto para acessar o diretório do armazenamento.
Saiba mais em Diretório de armazenamento do Hive.
As instruções a seguir mostram como atualizar uma substituição de configuração do metastore do Hive.
Console
No console do Google Cloud , abra a página Metastore do Dataproc:
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-08-27 UTC."],[[["\u003cp\u003eThis guide outlines how to update your Dataproc Metastore service, allowing you to modify configuration settings and enable or disable optional features.\u003c/p\u003e\n"],["\u003cp\u003eYou can update parameters such as port number, service tier, Data Catalog sync, maintenance window, Kerberos, Hive metastore configurations, auxiliary version config, labels, and scaling factor, but some parameters require you to delete and recreate the service to modify.\u003c/p\u003e\n"],["\u003cp\u003eUpdating a service can be done via the Google Cloud console, the gcloud CLI, or REST API, and multiple parameters can be changed in a single update job without interrupting the service's operation.\u003c/p\u003e\n"],["\u003cp\u003eTo modify the Hive Metastore warehouse directory, you must set a Metastore config override with the \u003ccode\u003ehive.metastore.warehouse.dir\u003c/code\u003e key and your Cloud Storage directory as its value, and the service requires read and write permissions to access this directory.\u003c/p\u003e\n"],["\u003cp\u003eBefore updating, ensure you have the necessary IAM permissions, specifically \u003ccode\u003emetastore.services.update\u003c/code\u003e, which is included in the predefined \u003ccode\u003eroles/metastore.editor\u003c/code\u003e and \u003ccode\u003eroles/metastore.admin\u003c/code\u003e roles.\u003c/p\u003e\n"]]],[],null,["# Update a Dataproc Metastore service\n\nThis page explains how to update a Dataproc Metastore service.\n\nYou can update your Dataproc Metastore service to change\nconfiguration settings, or to enable or disable optional features.\n\nBefore you begin\n----------------\n\n- [Enable Dataproc Metastore in your project](/dataproc-metastore/docs/enable-service).\n- [Create a Dataproc Metastore service](/dataproc-metastore/docs/create-service).\n\n### Required roles\n\n\nTo get the permission that\nyou need to update a Dataproc Metastore service,\n\nask your administrator to grant you the\nfollowing IAM roles on your project, based on the principle of least privilege:\n\n- [Grant full control of Dataproc Metastore resources](/iam/docs/roles-permissions/metastore#metastore.editor) (`roles/metastore.editor`)\n- [Grant full access to all Dataproc Metastore resources, including IAM policy administration](/iam/docs/roles-permissions/metastore#metastore.admin) (`roles/metastore.admin`)\n\n\nFor more information about granting roles, see [Manage access to projects, folders, and organizations](/iam/docs/granting-changing-revoking-access).\n\n\nThis predefined role contains the\n` metastore.services.update`\npermission,\nwhich is required to\nupdate a Dataproc Metastore service.\n\n\nYou might also be able to get\nthis permission\nwith [custom roles](/iam/docs/creating-custom-roles) or\nother [predefined roles](/iam/docs/roles-overview#predefined).\nFor more information about specific Dataproc Metastore roles and permissions, see [Dataproc Metastore IAM overview](/dataproc-metastore/docs/iam-and-access-control).\n\n\u003cbr /\u003e\n\nAbout updating a service\n------------------------\n\nYou can update the following Dataproc Metastore parameters.\n\n- **Port number**. Update the TCP port number of the Apache Thrift interface.\n- **Service tier** . Switch between the **Developer** service tier or **Enterprise** service tier. These tiers influence the capacity of the service.\n- **Data Catalog sync**. Toggle the Data Catalog sync feature on or off.\n- **Maintenance window** . Change the frequency of your maintenance window, including **Day of week** and **Hour of day**.\n- **Kerberos**. Enable or disable Kerberos authentication. If previously enabled, you can update your Kerberos configuration files.\n- **Hive metastore configurations**. Update the location of your Hive warehouse directory.\n- **Auxiliary version config** ([Preview](/products#product-launch-stages)). Enable, disable, or add additional auxiliary versions.\n- **Labels**. Add or remove optional labels that describe your metadata.\n- **Scaling factor**. Change the scaling factor. You can enable or disable autoscaling and update the minimum or maximum scaling factors.\n\n| **Note:** To update other Dataproc Metastore parameters that aren't included in the previous list, you must [delete your service](/dataproc-metastore/docs/delete-service) and create a new one.\n\nUpdate a service\n----------------\n\nBefore running an update, note the following considerations:\n\n- You can only run a single update job at a time (for each Dataproc Metastore service).\n- You can update multiple parameters in a single update job.\n- You can still use your Dataproc Metastore while it's being updated.\n\nWhen the update succeeds, Dataproc Metastore automatically enters an [active](/dataproc-metastore/docs/reference/rest/v1/projects.locations.services#state) state. If the update fails,\nthen the Dataproc Metastore service rolls back to its previous healthy state.\n\nThe following instructions show you how to update a Dataproc Metastore\nservice. \n\n### Console\n\n1. In the Google Cloud console, open the **Dataproc Metastore** page:\n\n [Open Dataproc Metastore](https://console.cloud.google.com/dataproc/metastore/services)\n2. On the **Dataproc Metastore** page, click the service name of the\n service that you want to update.\n\n The **Service detail** page opens.\n The Dataproc Metastore Service detail page\n3. On the **Configuration** tab, click **Edit**.\n\n The **Edit service** page opens.\n4. Choose the values that you want to update for your service.\n\n5. Click **Submit**.\n\n Return to the **Dataproc Metastore** page, and\n verify that your service was successfully updated.\n\n### gcloud CLI\n\n1. To update a service, run the following [`gcloud metastore services update`](/sdk/gcloud/reference/metastore/services/update) command:\n\n ```\n gcloud metastore services update SERVICE \\\n --location=LOCATION \\\n --port=PORT \\\n --tier=TIER \\\n --maintenance-window-day=MAINTENANCE_WINDOW_DAY \\\n --maintenance-window-hour=MAINTENANCE_WINDOW_HOUR \\\n --kerberos_principal=KERBEROS_PRINCIPAL \\\n --keytab=KEYTAB \\\n --krb5-config=KRB5_CONFIG \\\n --update-hive-metastore-configs-from-file=[KEY=VALUE, ...] \\\n --clear-hive-metastore-configs \\\n --remove-hive-metastore-configs=[KEY, ...] \\\n --update-labels=[KEY=VALUE, ...] \\\n --clear-labels \\\n --remove-labels=[KEY, ...]\n ```\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eSERVICE\u003c/var\u003e: The name of your Dataproc Metastore service.\n - \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: The Google Cloud region that your Dataproc Metastore service resides in.\n - \u003cvar translate=\"no\"\u003ePORT\u003c/var\u003e: Optional: The TCP port of the Thrift interface you're using with your Dataproc Metastore service.\n - \u003cvar translate=\"no\"\u003eTIER\u003c/var\u003e: Optional: The tier capacity of your Dataproc Metastore service.\n - \u003cvar translate=\"no\"\u003eMAINTENANCE_WINDOW_DAY\u003c/var\u003e: Optional: The day of week when the service window starts.\n - \u003cvar translate=\"no\"\u003eMAINTENANCE_WINDOW_HOUR\u003c/var\u003e: Optional: The hour of day when the service window starts.\n - \u003cvar translate=\"no\"\u003eKERBEROS_PRINCIPAL\u003c/var\u003e: Optional: A Kerberos principal that exists in both the keytab and the KDC. A typical principal is of the form \"primary/instance@REALM\", but there's no exact format.\n - \u003cvar translate=\"no\"\u003eKEYTAB\u003c/var\u003e: Optional: A Kerberos keytab file that is used to authenticate a service principal with a Kerberos Key Distribution Center.\n - \u003cvar translate=\"no\"\u003eKRB5_CONFIG\u003c/var\u003e: 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.\n - \u003cvar translate=\"no\"\u003e[KEY, ...]\u003c/var\u003e: Optional: The Hive metastore configs you want to update. If a variable exists in this field, its value is updated. Otherwise, a new variable is created. If this flag is set, then `-clear-hive-metastore-configs` is automatically set as well.\n - \u003cvar translate=\"no\"\u003e[KEY, ...]\u003c/var\u003e: Optional: The Hive metastore configs you want to remove.\n - \u003cvar translate=\"no\"\u003e[KEY=VALUE, ...]\u003c/var\u003e: Optional: The labels or Hive metastore key-value pair configs you want to update.\n - \u003cvar translate=\"no\"\u003e[KEY, ...]\u003c/var\u003e: Optional: The labels or Hive metastore key-value pair configs you want to remove.\n2. Verify that the update was successful.\n\n### REST\n\nFollow the API instructions to [update a service](/dataproc-metastore/docs/reference/rest/v1/projects.locations.services/patch)\nby using the APIs Explorer.\n\nUpdate the Hive Metastore warehouse config\n------------------------------------------\n\nIf your Hive warehouse directory is on Cloud Storage, you should set a Metastore\nconfig override. This override sets your specific data warehouse as the\ndefault warehouse directory for Dataproc Metastore\n\nBefore you set this override, make sure that your Dataproc Metastore service\nhas object read and write permissions to access the warehouse directory.\nFor more information, see [Hive warehouse directory](/dataproc-metastore/docs/hive-metastore#hive-warehouse-dir).\n\nThe following instructions show you how to update a Hive Metastore config override. \n\n### Console\n\n1. In the Google Cloud console, open the Dataproc Metastore page:\n\n [Open Dataproc Metastore](https://console.cloud.google.com/dataproc/metastore/services)\n2. On the **Dataproc Metastore** page, click the service name of the\n service want to update.\n\n The **Service detail** page opens.\n3. On the **Configuration** tab, click **Edit**.\n\n The **Edit service** page opens.\n4. In the **Metastore config overrides**, enter the following:\n\n - **Key** : Enter the following value: `hive.metastore.warehouse.dir`.\n - **Value** : The Cloud Storage location of your warehouse directory. For example: `gs://my-bucket/path/to/location`.\n5. Click **Submit**.\n\n Return to the **Dataproc Metastore** page, and\n verify that your service was successfully updated.\n\n### gcloud\n\n1. To update a service, run the following `gcloud metastore services update` command:\n\n ```\n gcloud metastore services update SERVICE \\\n --location=LOCATION \\\n --update-hive-metastore-configs=\"hive.metastore.warehouse.dir=CUSTOMER_DIR\"\n ```\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eSERVICE\u003c/var\u003e: The name of your Dataproc Metastore service.\n - \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: The Google Cloud region that your Dataproc Metastore service resides in.\n - \u003cvar translate=\"no\"\u003eCUSTOMER_DIR\u003c/var\u003e: The Cloud Storage location of your warehouse directory. For example: `gs://my-bucket/path/to/location`\n2. Verify that the update was successful.\n\nWhat's next\n-----------\n\n- [Cloud audit logging](/dataproc-metastore/docs/audit-logging)\n- [Dataproc Metastore IAM and access control](/dataproc-metastore/docs/iam-and-access-control)\n- [Service access](/dataproc-metastore/docs/access-service)"]]