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

Get-AzureRmRedisCacheLink

获取 Redis 缓存的异地副本 (replica)连接链接。

警告

截至 2024 年 2 月 29 日,AzureRM PowerShell 模块已正式弃用。 为了确保持续获得支持和更新,建议用户从 AzureRM 迁移到 Az PowerShell 模块。

尽管 AzureRM 模块仍可能正常运行,但它不再维护或受支持,但会根据用户的自由裁量权和风险继续使用任何继续使用模块。 有关过渡到 Az 模块的指导,请参阅我们的迁移资源

语法

Get-AzureRmRedisCacheLink
   -Name <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzureRmRedisCacheLink
   -PrimaryServerName <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzureRmRedisCacheLink
   -PrimaryServerName <String>
   -SecondaryServerName <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzureRmRedisCacheLink
   -SecondaryServerName <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

说明

可通过四种不同的方式获取异地副本 (replica)链接详细信息。 提供参数名称或 PrimaryServerName 和/或 SecondaryServerName。 此时会提供名称,然后返回缓存存在的所有链接。 如果仅提供 PrimaryServerName,则将返回缓存是主节点的所有链接。 如果仅提供 SecondaryServerName,则返回缓存为辅助位置的所有链接。 如果同时提供 PrimaryServerName 和 SecondaryServerName,则会返回具有正确角色的特定链接。

示例

示例 1:使用参数集 AllLinksForCache

PS C:\>Get-AzureRmRedisCacheLink -Name "mycache1"

        PrimaryServerName   : mycache1
        SecondaryServerName : mycache2
        ProvisioningState   : Succeeded

此命令获取名为 mycache1 的 Redis 缓存的所有异地副本 (replica)tion 链接。

示例 2:使用参数集 AllLinksForPrimaryCache

PS C:\>Get-AzureRmRedisCacheLink -PrimaryServerName "mycache1"

        PrimaryServerName   : mycache1
        SecondaryServerName : mycache2
        ProvisioningState   : Succeeded

此命令获取名为 mycache1 的 Redis 缓存是主要位置的异地副本 (replica)链接。

示例 3:使用参数集 AllLinksForSecondaryCache

PS C:\>Get-AzureRmRedisCacheLink -SecondaryServerName "mycache2"

        PrimaryServerName   : mycache1
        SecondaryServerName : mycache2
        ProvisioningState   : Succeeded

此命令获取名为 mycache2 的 Redis 缓存是次要位置的异地副本 (replica)链接。

PS C:\>Get-AzureRmRedisCacheLink -PrimaryServerName "mycache1" -SecondaryServerName "mycache2"

        PrimaryServerName   : mycache1
        SecondaryServerName : mycache2
        ProvisioningState   : Succeeded

此命令获取一个地理副本 (replica)链接,其中名为 mycache1 的 Redis 缓存是主要缓存,名为 mycache2 的 Redis 缓存是辅助缓存。

参数

-DefaultProfile

用于与 Azure 通信的凭据、帐户、租户和订阅。

类型:IAzureContextContainer
别名:AzureRmContext, AzureCredential
Position:Named
默认值:None
必需:False
接受管道输入:False
接受通配符:False

-Name

redis 缓存的名称。

类型:String
Position:Named
默认值:None
必需:True
接受管道输入:True
接受通配符:False

-PrimaryServerName

链接中主要 redis 缓存的名称。

类型:String
Position:Named
默认值:None
必需:True
接受管道输入:True
接受通配符:False

-SecondaryServerName

链接中的辅助 redis 缓存的名称。

类型:String
Position:Named
默认值:None
必需:True
接受管道输入:True
接受通配符:False

输入

String

输出

PSRedisLinkedServer