편집

다음을 통해 공유


Get-AzRedisCacheLink

Get geo replication link for Redis Cache.

Syntax

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>]

Description

There are four different ways to get geo-replication link detail. Either provide parameter Name or PrimaryServerName and/or SecondaryServerName. Name is given then all link where cache exists will be returned. If only PrimaryServerName is given then all links where cache is primary will be returned. If only SecondaryServerName is given then all links where cache is secondary will be returned. If PrimaryServerName and SecondaryServerName both are given then specific link with correct role will be returned.

Examples

Example 1: Get using parameter set 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

This command gets all geo-replication links for Redis Cache named mycache1.

Example 2: Get using parameter set 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

This command gets geo-replication links where Redis Cache named mycache1 is primary.

Example 3: Get using parameter set 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

This command gets geo-replication links where Redis Cache named mycache2 is secondary.

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

This command gets a single geo-replication links where Redis Cache named mycache1 is primary and Redis Cache named mycache2 is secondary.

Parameters

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with azure.

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

Name of redis cache.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-PrimaryServerName

Name of primary redis cache in link.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-SecondaryServerName

Name of secondary redis cache in link.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

Inputs

String

Outputs

PSRedisLinkedServer