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

Get-AzRedisCacheLink

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

语法

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

说明

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

示例

示例 1:使用参数集 AllLinksForCache

Get-AzRedisCacheLink -Name "mycache1"

PrimaryServerName            : mycache1
        SecondaryServerName          : mycache2
        ProvisioningState            : Succeeded
        LinkedRedisCacheLocation     : East US
        ServerRole                   : Secondary
        PrimaryHostName              : mycache1.redis.cache.windows.net
        GeoReplicatedPrimaryHostName : mycache2.geo.redis.cache.windows.net

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

示例 2:使用参数集 AllLinksForPrimaryCache

Get-AzRedisCacheLink -PrimaryServerName "mycache1"

PrimaryServerName            : mycache1
        SecondaryServerName          : mycache2
        ProvisioningState            : Succeeded
        LinkedRedisCacheLocation     : East US
        ServerRole                   : Secondary
        PrimaryHostName              : mycache1.redis.cache.windows.net
        GeoReplicatedPrimaryHostName : mycache2.geo.redis.cache.windows.net

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

示例 3:使用参数集 AllLinksForSecondaryCache

Get-AzRedisCacheLink -SecondaryServerName "mycache2"

PrimaryServerName            : mycache1
        SecondaryServerName          : mycache2
        ProvisioningState            : Succeeded
        LinkedRedisCacheLocation     : East US
        ServerRole                   : Secondary
        PrimaryHostName              : mycache1.redis.cache.windows.net
        GeoReplicatedPrimaryHostName : mycache2.geo.redis.cache.windows.net

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

Get-AzRedisCacheLink -PrimaryServerName "mycache1" -SecondaryServerName "mycache2"

PrimaryServerName            : mycache1
        SecondaryServerName          : mycache2
        ProvisioningState            : Succeeded
        LinkedRedisCacheLocation     : East US
        ServerRole                   : Secondary
        PrimaryHostName              : mycache1.redis.cache.windows.net
        GeoReplicatedPrimaryHostName : mycache2.geo.redis.cache.windows.net

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

参数

-DefaultProfile

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

类型:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
默认值:None
必需:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

redis 缓存的名称。

类型:String
Position:Named
默认值:None
必需:True
Accept pipeline input:True
Accept wildcard characters:False

-PrimaryServerName

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

类型:String
Position:Named
默认值:None
必需:True
Accept pipeline input:True
Accept wildcard characters:False

-SecondaryServerName

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

类型:String
Position:Named
默认值:None
必需:True
Accept pipeline input:True
Accept wildcard characters:False

输入

String

输出

PSRedisLinkedServer