你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

使用 Azure CLI 部署 Active Directory 集成的已启用 Azure Arc 的 PostgreSQL

本文介绍如何使用 Azure CLI 通过 Active Directory (AD) 身份验证部署已启用 Azure Arc 的 PostgreSQL 服务器。

有关具体说明,请参阅以下文章:

先决条件

在继续操作之前,请安装以下工具:

若要了解有关如何设置 OU 和 AD 帐户的更多详细信息,请转到通过 Active Directory 身份验证部署已启用 Azure Arc 的数据服务 - 先决条件

重要

使用 Active Directory 时,必须将默认帐户命名为“postgres”才能成功连接。

部署并更新 Active Directory 集成的已启用 Azure Arc 的 PostgreSQL 服务器

客户管理的密钥表模式

创建已启用 Azure Arc 的 PostgreSQL 服务器

要查看已启用 Azure Arc 的 PostgreSQL 服务器的 create 命令的可用选项,请使用以下命令:

az postgres server-arc create --help

若要创建 SQL 托管实例,请使用 az postgres server-arc create。 请参阅以下示例:

az postgres server-arc create 
--name < PostgreSQL server name >  
--k8s-namespace < namespace > 
--ad-connector-name < your AD connector name > 
--keytab-secret < PostgreSQL server keytab secret name >  
--ad-account-name < PostgreSQL server AD user account >  
--dns-name < PostgreSQL server primary endpoint DNS name > 
--port < PostgreSQL server primary endpoint port number >
--use-k8s

示例:

az postgres server-arc create 
--name contosopg 
--k8s-namespace arc 
--ad-connector-name adarc 
--keytab-secret arcuser-keytab-secret
--ad-account-name arcuser 
--dns-name arcpg.contoso.local
--port 31432
--use-k8s

更新已启用 Azure Arc 的 PostgreSQL 服务器

要更新已启用 Arc 的 PostgreSQL 服务器,请使用 az postgres server-arc update。 请参阅以下示例:

az postgres server-arc update 
--name < PostgreSQL server name >  
--k8s-namespace < namespace > 
--keytab-secret < PostgreSQL server keytab secret name >  
--use-k8s

示例:

az postgres server-arc update 
--name contosopg 
--k8s-namespace arc 
--keytab-secret arcuser-keytab-secret
--use-k8s
  • 请试用。在 Azure Kubernetes 服务 (AKS)、AWS Elastic Kubernetes Service (EKS)、Google Cloud Kubernetes Engine (GKE) 或 Azure VM 中通过 Azure Arc 快速入门快速开始